Back to Collection Items
#include <C_CkHttp.h>
#include <C_CkJsonObject.h>
#include <C_CkHttpResponse.h>
#include <C_CkStringBuilder.h>
void ChilkatSample(void)
{
HCkHttp http;
BOOL success;
HCkJsonObject json;
HCkHttpResponse resp;
HCkStringBuilder sbResponseBody;
HCkJsonObject jResp;
int respStatusCode;
const char *amountAmount;
const char *amountCode;
const char *Category;
int Categoryid;
const char *categoryCreated_at;
int categoryId;
BOOL Is_cogs;
BOOL Is_editable;
const char *Parentid;
const char *categoryUpdated_at;
int categoryVis_state;
const char *description;
int id;
int list_index;
const char *quantity;
const char *tax_amount1;
const char *tax_amount2;
const char *tax_authorityid1;
const char *tax_authorityid2;
const char *tax_name1;
const char *tax_name2;
const char *tax_percent1;
const char *tax_percent2;
const char *total_amountAmount;
const char *total_amountCode;
const char *unit_costAmount;
const char *unit_costCode;
const char *Amount;
const char *Code;
const char *Attachment;
const char *Bill_number;
const char *Created_at;
const char *Currency_code;
const char *Due_date;
int Due_offset_days;
int Id;
const char *Issue_date;
const char *Language;
const char *OutstandingAmount;
const char *OutstandingCode;
const char *Overall_category;
const char *Overall_description;
const char *PaidAmount;
const char *PaidCode;
const char *Status;
const char *Tax_amountAmount;
const char *Tax_amountCode;
const char *Total_amountAmount;
const char *Total_amountCode;
const char *Updated_at;
int Vis_state;
int i;
int count_i;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "bill": {
// "vendorid": "5",
// "previous_vendor_id": null,
// "bill_number": null,
// "issue_date": "2020-10-09",
// "due_offset_days": 39,
// "currency_code": "USD",
// "language": "en",
// "lines": [
// {
// "tax_percent1": null,
// "tax_percent2": null,
// "unit_cost": {
// "amount": "125",
// "code": "USD"
// },
// "description": "Malm Side Table",
// "tax_name1": null,
// "quantity": 1,
// "tax_name2": null,
// "compounded_tax": false,
// "categoryid": "65773"
// },
// {
// "tax_percent1": null,
// "tax_percent2": null,
// "unit_cost": {
// "amount": "250",
// "code": "USD"
// },
// "description": "Malm Book Shelf",
// "tax_name1": null,
// "quantity": 1,
// "tax_name2": null,
// "compounded_tax": false,
// "categoryid": "65773"
// }
// ],
// "attachment": null
// }
// }
json = CkJsonObject_Create();
CkJsonObject_UpdateString(json,"bill.vendorid","5");
CkJsonObject_UpdateNull(json,"bill.previous_vendor_id");
CkJsonObject_UpdateNull(json,"bill.bill_number");
CkJsonObject_UpdateString(json,"bill.issue_date","2020-10-09");
CkJsonObject_UpdateInt(json,"bill.due_offset_days",39);
CkJsonObject_UpdateString(json,"bill.currency_code","USD");
CkJsonObject_UpdateString(json,"bill.language","en");
CkJsonObject_UpdateNull(json,"bill.lines[0].tax_percent1");
CkJsonObject_UpdateNull(json,"bill.lines[0].tax_percent2");
CkJsonObject_UpdateString(json,"bill.lines[0].unit_cost.amount","125");
CkJsonObject_UpdateString(json,"bill.lines[0].unit_cost.code","USD");
CkJsonObject_UpdateString(json,"bill.lines[0].description","Malm Side Table");
CkJsonObject_UpdateNull(json,"bill.lines[0].tax_name1");
CkJsonObject_UpdateInt(json,"bill.lines[0].quantity",1);
CkJsonObject_UpdateNull(json,"bill.lines[0].tax_name2");
CkJsonObject_UpdateBool(json,"bill.lines[0].compounded_tax",FALSE);
CkJsonObject_UpdateString(json,"bill.lines[0].categoryid","65773");
CkJsonObject_UpdateNull(json,"bill.lines[1].tax_percent1");
CkJsonObject_UpdateNull(json,"bill.lines[1].tax_percent2");
CkJsonObject_UpdateString(json,"bill.lines[1].unit_cost.amount","250");
CkJsonObject_UpdateString(json,"bill.lines[1].unit_cost.code","USD");
CkJsonObject_UpdateString(json,"bill.lines[1].description","Malm Book Shelf");
CkJsonObject_UpdateNull(json,"bill.lines[1].tax_name1");
CkJsonObject_UpdateInt(json,"bill.lines[1].quantity",1);
CkJsonObject_UpdateNull(json,"bill.lines[1].tax_name2");
CkJsonObject_UpdateBool(json,"bill.lines[1].compounded_tax",FALSE);
CkJsonObject_UpdateString(json,"bill.lines[1].categoryid","65773");
CkJsonObject_UpdateNull(json,"bill.attachment");
// Adds the "Authorization: Bearer <access_token>" header.
CkHttp_putAuthToken(http,"<access_token>");
resp = CkHttp_PostJson3(http,"https://api.freshbooks.com/accounting/account/{{accountId}}/bills/bills","application/json",json);
if (CkHttp_getLastMethodSuccess(http) == FALSE) {
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
CkJsonObject_Dispose(json);
return;
}
sbResponseBody = CkStringBuilder_Create();
CkHttpResponse_GetBodySb(resp,sbResponseBody);
jResp = CkJsonObject_Create();
CkJsonObject_LoadSb(jResp,sbResponseBody);
CkJsonObject_putEmitCompact(jResp,FALSE);
printf("Response Body:\n");
printf("%s\n",CkJsonObject_emit(jResp));
respStatusCode = CkHttpResponse_getStatusCode(resp);
printf("Response Status Code = %d\n",respStatusCode);
if (respStatusCode >= 400) {
printf("Response Header:\n");
printf("%s\n",CkHttpResponse_header(resp));
printf("Failed.\n");
CkHttpResponse_Dispose(resp);
CkHttp_Dispose(http);
CkJsonObject_Dispose(json);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jResp);
return;
}
CkHttpResponse_Dispose(resp);
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "response": {
// "result": {
// "bill": {
// "amount": {
// "amount": "375.00",
// "code": "USD"
// },
// "attachment": null,
// "bill_number": null,
// "bill_payments": [
// ],
// "created_at": "2020-10-09 15:28:49",
// "currency_code": "USD",
// "due_date": "2020-11-17",
// "due_offset_days": 39,
// "id": 7,
// "issue_date": "2020-10-09",
// "language": "en",
// "lines": [
// {
// "amount": {
// "amount": "125.00",
// "code": "USD"
// },
// "category": {
// "category": "Office Expenses & Postage",
// "categoryid": 65773,
// "created_at": "2016-11-17 14:22:35",
// "id": 65773,
// "is_cogs": false,
// "is_editable": false,
// "parentid": null,
// "updated_at": "2016-11-17 14:22:35",
// "vis_state": 0
// },
// "description": "Malm Side Table",
// "id": 13,
// "list_index": 1,
// "quantity": "1",
// "tax_amount1": null,
// "tax_amount2": null,
// "tax_authorityid1": null,
// "tax_authorityid2": null,
// "tax_name1": null,
// "tax_name2": null,
// "tax_percent1": null,
// "tax_percent2": null,
// "total_amount": {
// "amount": "125.00",
// "code": "USD"
// },
// "unit_cost": {
// "amount": "125.00",
// "code": "USD"
// }
// },
// {
// "amount": {
// "amount": "250.00",
// "code": "USD"
// },
// "category": {
// "category": "Office Expenses & Postage",
// "categoryid": 65773,
// "created_at": "2016-11-17 14:22:35",
// "id": 65773,
// "is_cogs": false,
// "is_editable": false,
// "parentid": null,
// "updated_at": "2016-11-17 14:22:35",
// "vis_state": 0
// },
// "description": "Malm Book Shelf",
// "id": 15,
// "list_index": 2,
// "quantity": "1",
// "tax_amount1": null,
// "tax_amount2": null,
// "tax_authorityid1": null,
// "tax_authorityid2": null,
// "tax_name1": null,
// "tax_name2": null,
// "tax_percent1": null,
// "tax_percent2": null,
// "total_amount": {
// "amount": "250.00",
// "code": "USD"
// },
// "unit_cost": {
// "amount": "250.00",
// "code": "USD"
// }
// }
// ],
// "outstanding": {
// "amount": "375.00",
// "code": "USD"
// },
// "overall_category": "Office Expenses & Postage",
// "overall_description": "Malm Side Table",
// "paid": {
// "amount": "0.00",
// "code": "USD"
// },
// "status": "unpaid",
// "tax_amount": {
// "amount": "0.00",
// "code": "USD"
// },
// "total_amount": {
// "amount": "375.00",
// "code": "USD"
// },
// "updated_at": "2020-10-09 15:28:49",
// "vis_state": 0
// }
// }
// }
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
// Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.
Amount = CkJsonObject_stringOf(jResp,"response.result.bill.amount.amount");
Code = CkJsonObject_stringOf(jResp,"response.result.bill.amount.code");
Attachment = CkJsonObject_stringOf(jResp,"response.result.bill.attachment");
Bill_number = CkJsonObject_stringOf(jResp,"response.result.bill.bill_number");
Created_at = CkJsonObject_stringOf(jResp,"response.result.bill.created_at");
Currency_code = CkJsonObject_stringOf(jResp,"response.result.bill.currency_code");
Due_date = CkJsonObject_stringOf(jResp,"response.result.bill.due_date");
Due_offset_days = CkJsonObject_IntOf(jResp,"response.result.bill.due_offset_days");
Id = CkJsonObject_IntOf(jResp,"response.result.bill.id");
Issue_date = CkJsonObject_stringOf(jResp,"response.result.bill.issue_date");
Language = CkJsonObject_stringOf(jResp,"response.result.bill.language");
OutstandingAmount = CkJsonObject_stringOf(jResp,"response.result.bill.outstanding.amount");
OutstandingCode = CkJsonObject_stringOf(jResp,"response.result.bill.outstanding.code");
Overall_category = CkJsonObject_stringOf(jResp,"response.result.bill.overall_category");
Overall_description = CkJsonObject_stringOf(jResp,"response.result.bill.overall_description");
PaidAmount = CkJsonObject_stringOf(jResp,"response.result.bill.paid.amount");
PaidCode = CkJsonObject_stringOf(jResp,"response.result.bill.paid.code");
Status = CkJsonObject_stringOf(jResp,"response.result.bill.status");
Tax_amountAmount = CkJsonObject_stringOf(jResp,"response.result.bill.tax_amount.amount");
Tax_amountCode = CkJsonObject_stringOf(jResp,"response.result.bill.tax_amount.code");
Total_amountAmount = CkJsonObject_stringOf(jResp,"response.result.bill.total_amount.amount");
Total_amountCode = CkJsonObject_stringOf(jResp,"response.result.bill.total_amount.code");
Updated_at = CkJsonObject_stringOf(jResp,"response.result.bill.updated_at");
Vis_state = CkJsonObject_IntOf(jResp,"response.result.bill.vis_state");
i = 0;
count_i = CkJsonObject_SizeOfArray(jResp,"response.result.bill.bill_payments");
while (i < count_i) {
CkJsonObject_putI(jResp,i);
i = i + 1;
}
i = 0;
count_i = CkJsonObject_SizeOfArray(jResp,"response.result.bill.lines");
while (i < count_i) {
CkJsonObject_putI(jResp,i);
amountAmount = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].amount.amount");
amountCode = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].amount.code");
Category = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].category.category");
Categoryid = CkJsonObject_IntOf(jResp,"response.result.bill.lines[i].category.categoryid");
categoryCreated_at = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].category.created_at");
categoryId = CkJsonObject_IntOf(jResp,"response.result.bill.lines[i].category.id");
Is_cogs = CkJsonObject_BoolOf(jResp,"response.result.bill.lines[i].category.is_cogs");
Is_editable = CkJsonObject_BoolOf(jResp,"response.result.bill.lines[i].category.is_editable");
Parentid = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].category.parentid");
categoryUpdated_at = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].category.updated_at");
categoryVis_state = CkJsonObject_IntOf(jResp,"response.result.bill.lines[i].category.vis_state");
description = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].description");
id = CkJsonObject_IntOf(jResp,"response.result.bill.lines[i].id");
list_index = CkJsonObject_IntOf(jResp,"response.result.bill.lines[i].list_index");
quantity = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].quantity");
tax_amount1 = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].tax_amount1");
tax_amount2 = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].tax_amount2");
tax_authorityid1 = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].tax_authorityid1");
tax_authorityid2 = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].tax_authorityid2");
tax_name1 = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].tax_name1");
tax_name2 = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].tax_name2");
tax_percent1 = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].tax_percent1");
tax_percent2 = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].tax_percent2");
total_amountAmount = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].total_amount.amount");
total_amountCode = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].total_amount.code");
unit_costAmount = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].unit_cost.amount");
unit_costCode = CkJsonObject_stringOf(jResp,"response.result.bill.lines[i].unit_cost.code");
i = i + 1;
}
CkHttp_Dispose(http);
CkJsonObject_Dispose(json);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jResp);
}
Curl Command
curl -X POST
-H "Authorization: Bearer <access_token>"
-d '{
"bill": {
"vendorid": "5",
"previous_vendor_id": null,
"bill_number": null,
"issue_date": "2020-10-09",
"due_offset_days": 39,
"currency_code": "USD",
"language": "en",
"lines": [
{
"tax_percent1": null,
"tax_percent2": null,
"unit_cost": {
"amount": "125",
"code": "USD"
},
"description": "Malm Side Table",
"tax_name1": null,
"quantity": 1,
"tax_name2": null,
"compounded_tax": false,
"categoryid": "65773"
},
{
"tax_percent1": null,
"tax_percent2": null,
"unit_cost": {
"amount": "250",
"code": "USD"
},
"description": "Malm Book Shelf",
"tax_name1": null,
"quantity": 1,
"tax_name2": null,
"compounded_tax": false,
"categoryid": "65773"
}
],
"attachment": null
}
}'
https://api.freshbooks.com/accounting/account/{{accountId}}/bills/bills
Postman Collection Item JSON
{
"name": "Add Bill from Vendor",
"request": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"bill\": {\n \"vendorid\": \"5\",\n \"previous_vendor_id\": null,\n \"bill_number\": null,\n \"issue_date\": \"2020-10-09\",\n \"due_offset_days\": 39,\n \"currency_code\": \"USD\",\n \"language\": \"en\",\n \"lines\": [\n {\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"unit_cost\": {\n \"amount\": \"125\",\n \"code\": \"USD\"\n },\n \"description\": \"Malm Side Table\",\n \"tax_name1\": null,\n \"quantity\": 1,\n \"tax_name2\": null,\n \"compounded_tax\": false,\n \"categoryid\": \"65773\"\n },\n {\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"unit_cost\": {\n \"amount\": \"250\",\n \"code\": \"USD\"\n },\n \"description\": \"Malm Book Shelf\",\n \"tax_name1\": null,\n \"quantity\": 1,\n \"tax_name2\": null,\n \"compounded_tax\": false,\n \"categoryid\": \"65773\"\n }\n ],\n \"attachment\": null\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.freshbooks.com/accounting/account/{{accountId}}/bills/bills",
"protocol": "https",
"host": [
"api",
"freshbooks",
"com"
],
"path": [
"accounting",
"account",
"{{accountId}}",
"bills",
"bills"
]
}
},
"response": [
{
"name": "Add Bill from Vendor",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"bill\": {\n \"vendorid\": \"5\",\n \"previous_vendor_id\": null,\n \"bill_number\": null,\n \"issue_date\": \"2020-10-09\",\n \"due_offset_days\": 39,\n \"currency_code\": \"USD\",\n \"language\": \"en\",\n \"lines\": [\n {\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"unit_cost\": {\n \"amount\": \"125\",\n \"code\": \"USD\"\n },\n \"description\": \"Malm Side Table\",\n \"tax_name1\": null,\n \"quantity\": 1,\n \"tax_name2\": null,\n \"compounded_tax\": false,\n \"categoryid\": \"65773\"\n },\n {\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"unit_cost\": {\n \"amount\": \"250\",\n \"code\": \"USD\"\n },\n \"description\": \"Malm Book Shelf\",\n \"tax_name1\": null,\n \"quantity\": 1,\n \"tax_name2\": null,\n \"compounded_tax\": false,\n \"categoryid\": \"65773\"\n }\n ],\n \"attachment\": null\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.freshbooks.com/accounting/account/{{accountId}}/bills/bills",
"protocol": "https",
"host": [
"api",
"freshbooks",
"com"
],
"path": [
"accounting",
"account",
"{{accountId}}",
"bills",
"bills"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "nginx"
},
{
"key": "Date",
"value": "Fri, 09 Oct 2020 15:28:49 GMT"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Vary",
"value": "Accept-Encoding"
},
{
"key": "X-NewRelic-App-Data",
"value": "PxQBWV5TCBABVlVSAwEOVlcTGhE1AwE2QgNWEVlbQFtcCxYnRA9QFg1ZWU4DFVdfRgFPCkNFR0gGWFpfEVwBC1wOS0AUCBgCHVEKVwVWBVZSDwdSX1oJBBxVU1IBHRVVAgYGVQRQVQAAV11UCVwDEB8DWA1CBG4="
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "Content-Security-Policy",
"value": "default-src 'self'"
},
{
"key": "X-Content-Security-Policy",
"value": "default-src 'self'"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=31556926; includeSubDomains; preload"
},
{
"key": "Referrer-Policy",
"value": "strict-origin-when-cross-origin"
},
{
"key": "X-RateLimit-Limit",
"value": "600"
},
{
"key": "X-RateLimit-Remaining",
"value": "599"
},
{
"key": "X-RateLimit-Reset",
"value": "1602257389"
},
{
"key": "Retry-After",
"value": "59"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "Content-Encoding",
"value": "gzip"
},
{
"key": "Via",
"value": "1.1 google"
},
{
"key": "Alt-Svc",
"value": "h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
},
{
"key": "Transfer-Encoding",
"value": "chunked"
}
],
"cookie": [
],
"body": "{\n \"response\": {\n \"result\": {\n \"bill\": {\n \"amount\": {\n \"amount\": \"375.00\",\n \"code\": \"USD\"\n },\n \"attachment\": null,\n \"bill_number\": null,\n \"bill_payments\": [],\n \"created_at\": \"2020-10-09 15:28:49\",\n \"currency_code\": \"USD\",\n \"due_date\": \"2020-11-17\",\n \"due_offset_days\": 39,\n \"id\": 7,\n \"issue_date\": \"2020-10-09\",\n \"language\": \"en\",\n \"lines\": [\n {\n \"amount\": {\n \"amount\": \"125.00\",\n \"code\": \"USD\"\n },\n \"category\": {\n \"category\": \"Office Expenses & Postage\",\n \"categoryid\": 65773,\n \"created_at\": \"2016-11-17 14:22:35\",\n \"id\": 65773,\n \"is_cogs\": false,\n \"is_editable\": false,\n \"parentid\": null,\n \"updated_at\": \"2016-11-17 14:22:35\",\n \"vis_state\": 0\n },\n \"description\": \"Malm Side Table\",\n \"id\": 13,\n \"list_index\": 1,\n \"quantity\": \"1\",\n \"tax_amount1\": null,\n \"tax_amount2\": null,\n \"tax_authorityid1\": null,\n \"tax_authorityid2\": null,\n \"tax_name1\": null,\n \"tax_name2\": null,\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"total_amount\": {\n \"amount\": \"125.00\",\n \"code\": \"USD\"\n },\n \"unit_cost\": {\n \"amount\": \"125.00\",\n \"code\": \"USD\"\n }\n },\n {\n \"amount\": {\n \"amount\": \"250.00\",\n \"code\": \"USD\"\n },\n \"category\": {\n \"category\": \"Office Expenses & Postage\",\n \"categoryid\": 65773,\n \"created_at\": \"2016-11-17 14:22:35\",\n \"id\": 65773,\n \"is_cogs\": false,\n \"is_editable\": false,\n \"parentid\": null,\n \"updated_at\": \"2016-11-17 14:22:35\",\n \"vis_state\": 0\n },\n \"description\": \"Malm Book Shelf\",\n \"id\": 15,\n \"list_index\": 2,\n \"quantity\": \"1\",\n \"tax_amount1\": null,\n \"tax_amount2\": null,\n \"tax_authorityid1\": null,\n \"tax_authorityid2\": null,\n \"tax_name1\": null,\n \"tax_name2\": null,\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"total_amount\": {\n \"amount\": \"250.00\",\n \"code\": \"USD\"\n },\n \"unit_cost\": {\n \"amount\": \"250.00\",\n \"code\": \"USD\"\n }\n }\n ],\n \"outstanding\": {\n \"amount\": \"375.00\",\n \"code\": \"USD\"\n },\n \"overall_category\": \"Office Expenses & Postage\",\n \"overall_description\": \"Malm Side Table\",\n \"paid\": {\n \"amount\": \"0.00\",\n \"code\": \"USD\"\n },\n \"status\": \"unpaid\",\n \"tax_amount\": {\n \"amount\": \"0.00\",\n \"code\": \"USD\"\n },\n \"total_amount\": {\n \"amount\": \"375.00\",\n \"code\": \"USD\"\n },\n \"updated_at\": \"2020-10-09 15:28:49\",\n \"vis_state\": 0\n }\n }\n }\n}"
},
{
"name": "Add Bill from Vendor",
"originalRequest": {
"method": "POST",
"header": [
],
"body": {
"mode": "raw",
"raw": "{\n \"bill\": {\n \"vendorid\": \"5\",\n \"previous_vendor_id\": null,\n \"bill_number\": null,\n \"issue_date\": \"2020-10-09\",\n \"due_offset_days\": 39,\n \"currency_code\": \"USD\",\n \"language\": \"en\",\n \"lines\": [\n {\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"unit_cost\": {\n \"amount\": \"125\",\n \"code\": \"USD\"\n },\n \"description\": \"Malm Side Table\",\n \"tax_name1\": null,\n \"quantity\": 1,\n \"tax_name2\": null,\n \"compounded_tax\": false,\n \"categoryid\": \"65773\"\n },\n {\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"unit_cost\": {\n \"amount\": \"250\",\n \"code\": \"USD\"\n },\n \"description\": \"Malm Book Shelf\",\n \"tax_name1\": null,\n \"quantity\": 1,\n \"tax_name2\": null,\n \"compounded_tax\": false,\n \"categoryid\": \"65773\"\n }\n ],\n \"attachment\": null\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.freshbooks.com/accounting/account/{{accountId}}/bills/bills",
"protocol": "https",
"host": [
"api",
"freshbooks",
"com"
],
"path": [
"accounting",
"account",
"{{accountId}}",
"bills",
"bills"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "nginx"
},
{
"key": "Date",
"value": "Fri, 09 Oct 2020 15:28:49 GMT"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Vary",
"value": "Accept-Encoding"
},
{
"key": "X-NewRelic-App-Data",
"value": "PxQBWV5TCBABVlVSAwEOVlcTGhE1AwE2QgNWEVlbQFtcCxYnRA9QFg1ZWU4DFVdfRgFPCkNFR0gGWFpfEVwBC1wOS0AUCBgCHVEKVwVWBVZSDwdSX1oJBBxVU1IBHRVVAgYGVQRQVQAAV11UCVwDEB8DWA1CBG4="
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "Content-Security-Policy",
"value": "default-src 'self'"
},
{
"key": "X-Content-Security-Policy",
"value": "default-src 'self'"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=31556926; includeSubDomains; preload"
},
{
"key": "Referrer-Policy",
"value": "strict-origin-when-cross-origin"
},
{
"key": "X-RateLimit-Limit",
"value": "600"
},
{
"key": "X-RateLimit-Remaining",
"value": "599"
},
{
"key": "X-RateLimit-Reset",
"value": "1602257389"
},
{
"key": "Retry-After",
"value": "59"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "Content-Encoding",
"value": "gzip"
},
{
"key": "Via",
"value": "1.1 google"
},
{
"key": "Alt-Svc",
"value": "h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
},
{
"key": "Transfer-Encoding",
"value": "chunked"
}
],
"cookie": [
],
"body": "{\n \"response\": {\n \"result\": {\n \"bill\": {\n \"amount\": {\n \"amount\": \"375.00\",\n \"code\": \"USD\"\n },\n \"attachment\": null,\n \"bill_number\": null,\n \"bill_payments\": [],\n \"created_at\": \"2020-10-09 15:28:49\",\n \"currency_code\": \"USD\",\n \"due_date\": \"2020-11-17\",\n \"due_offset_days\": 39,\n \"id\": 7,\n \"issue_date\": \"2020-10-09\",\n \"language\": \"en\",\n \"lines\": [\n {\n \"amount\": {\n \"amount\": \"125.00\",\n \"code\": \"USD\"\n },\n \"category\": {\n \"category\": \"Office Expenses & Postage\",\n \"categoryid\": 65773,\n \"created_at\": \"2016-11-17 14:22:35\",\n \"id\": 65773,\n \"is_cogs\": false,\n \"is_editable\": false,\n \"parentid\": null,\n \"updated_at\": \"2016-11-17 14:22:35\",\n \"vis_state\": 0\n },\n \"description\": \"Malm Side Table\",\n \"id\": 13,\n \"list_index\": 1,\n \"quantity\": \"1\",\n \"tax_amount1\": null,\n \"tax_amount2\": null,\n \"tax_authorityid1\": null,\n \"tax_authorityid2\": null,\n \"tax_name1\": null,\n \"tax_name2\": null,\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"total_amount\": {\n \"amount\": \"125.00\",\n \"code\": \"USD\"\n },\n \"unit_cost\": {\n \"amount\": \"125.00\",\n \"code\": \"USD\"\n }\n },\n {\n \"amount\": {\n \"amount\": \"250.00\",\n \"code\": \"USD\"\n },\n \"category\": {\n \"category\": \"Office Expenses & Postage\",\n \"categoryid\": 65773,\n \"created_at\": \"2016-11-17 14:22:35\",\n \"id\": 65773,\n \"is_cogs\": false,\n \"is_editable\": false,\n \"parentid\": null,\n \"updated_at\": \"2016-11-17 14:22:35\",\n \"vis_state\": 0\n },\n \"description\": \"Malm Book Shelf\",\n \"id\": 15,\n \"list_index\": 2,\n \"quantity\": \"1\",\n \"tax_amount1\": null,\n \"tax_amount2\": null,\n \"tax_authorityid1\": null,\n \"tax_authorityid2\": null,\n \"tax_name1\": null,\n \"tax_name2\": null,\n \"tax_percent1\": null,\n \"tax_percent2\": null,\n \"total_amount\": {\n \"amount\": \"250.00\",\n \"code\": \"USD\"\n },\n \"unit_cost\": {\n \"amount\": \"250.00\",\n \"code\": \"USD\"\n }\n }\n ],\n \"outstanding\": {\n \"amount\": \"375.00\",\n \"code\": \"USD\"\n },\n \"overall_category\": \"Office Expenses & Postage\",\n \"overall_description\": \"Malm Side Table\",\n \"paid\": {\n \"amount\": \"0.00\",\n \"code\": \"USD\"\n },\n \"status\": \"unpaid\",\n \"tax_amount\": {\n \"amount\": \"0.00\",\n \"code\": \"USD\"\n },\n \"total_amount\": {\n \"amount\": \"375.00\",\n \"code\": \"USD\"\n },\n \"updated_at\": \"2020-10-09 15:28:49\",\n \"vis_state\": 0\n }\n }\n }\n}"
}
]
}