Chilkat Online Tools

unicodeC / New FreshBooks / Create Expense

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>
#include <C_CkStringBuilderW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkJsonObjectW json;
    HCkHttpResponseW resp;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    const wchar_t *Account_name;
    const wchar_t *Accountid;
    const wchar_t *Accounting_systemid;
    const wchar_t *Amount;
    const wchar_t *Code;
    int Attachmentid;
    int Id;
    const wchar_t *v_Jwt;
    const wchar_t *Media_type;
    const wchar_t *Background_jobid;
    const wchar_t *Bank_name;
    int Categoryid;
    int Clientid;
    BOOL Compounded_tax;
    const wchar_t *Date;
    int Expenseid;
    int Ext_invoiceid;
    int Ext_systemid;
    BOOL From_bulk_import;
    BOOL Has_receipt;
    int ExpenseId;
    BOOL Include_receipt;
    const wchar_t *Invoiceid;
    BOOL Is_cogs;
    BOOL Isduplicate;
    const wchar_t *Markup_percent;
    const wchar_t *Notes;
    const wchar_t *Profileid;
    int Projectid;
    int Staffid;
    int Status;
    const wchar_t *TaxAmount1Amount;
    const wchar_t *TaxAmount1Code;
    const wchar_t *TaxAmount2;
    const wchar_t *TaxName1;
    const wchar_t *TaxName2;
    const wchar_t *TaxPercent1;
    const wchar_t *TaxPercent2;
    const wchar_t *Transactionid;
    const wchar_t *Updated;
    const wchar_t *Vendor;
    int Vis_state;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    http = CkHttpW_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.

    // {
    //   "expense": {
    //     "transactionid": null,
    //     "status": null,
    //     "has_receipt": false,
    //     "always_remember": false,
    //     "is_cogs": true,
    //     "account_name": null,
    //     "include_receipt": false,
    //     "amount": {
    //       "amount": "79.73",
    //       "code": "USD"
    //     },
    //     "notes": "Purchased Gasoline for deliveries",
    //     "vendor": "Shell Gas Station",
    //     "date": "2019-04-24",
    //     "staffid": 1,
    //     "author_name": null,
    //     "taxName1": "other tax",
    //     "taxName2": null,
    //     "taxAmount1": {
    //       "amount": "9.17",
    //       "code": "USD"
    //     },
    //     "taxPercent1": 13,
    //     "taxPercent2": null,
    //     "markup_percent": 20,
    //     "invoiceid": null,
    //     "attachment": {
    //       "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50Ijo0MjM2NDEwLCJvcmlnaW5hbF9maWxlbmFtZSI6IlNjcmVlbiBTaG90IDIwMTktMDQtMjQgYXQgOS4zOS4xOSBBTS5wbmciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtMGU2ZDMwOWQ1ZTI5MzA3NmNhMGIyNDdkODFlOGJlNWE4NDZlZWE0YSIsImxlbmd0aCI6MTkxNDcyLCJrZXkiOiInZG9jcy0nLTQyMzY0MTAvdXBsb2FkLTBlNmQzMDlkNWUyOTMwNzZjYTBiMjQ3ZDgxZThiZTVhODQ2ZWVhNGEifQ.SOoW3_nTUrxjYO76g1UXHPIrO_aLbTpXCHEa-ZcnejA",
    //       "media_type": "image/png",
    //       "expenseid": null
    //     },
    //     "categoryid": "65679",
    //     "category_name": "",
    //     "clientid": 485558,
    //     "converse_projectid": 12345
    //   }
    // }

    json = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateNull(json,L"expense.transactionid");
    CkJsonObjectW_UpdateNull(json,L"expense.status");
    CkJsonObjectW_UpdateBool(json,L"expense.has_receipt",FALSE);
    CkJsonObjectW_UpdateBool(json,L"expense.always_remember",FALSE);
    CkJsonObjectW_UpdateBool(json,L"expense.is_cogs",TRUE);
    CkJsonObjectW_UpdateNull(json,L"expense.account_name");
    CkJsonObjectW_UpdateBool(json,L"expense.include_receipt",FALSE);
    CkJsonObjectW_UpdateString(json,L"expense.amount.amount",L"79.73");
    CkJsonObjectW_UpdateString(json,L"expense.amount.code",L"USD");
    CkJsonObjectW_UpdateString(json,L"expense.notes",L"Purchased Gasoline for deliveries");
    CkJsonObjectW_UpdateString(json,L"expense.vendor",L"Shell Gas Station");
    CkJsonObjectW_UpdateString(json,L"expense.date",L"2019-04-24");
    CkJsonObjectW_UpdateInt(json,L"expense.staffid",1);
    CkJsonObjectW_UpdateNull(json,L"expense.author_name");
    CkJsonObjectW_UpdateString(json,L"expense.taxName1",L"other tax");
    CkJsonObjectW_UpdateNull(json,L"expense.taxName2");
    CkJsonObjectW_UpdateString(json,L"expense.taxAmount1.amount",L"9.17");
    CkJsonObjectW_UpdateString(json,L"expense.taxAmount1.code",L"USD");
    CkJsonObjectW_UpdateInt(json,L"expense.taxPercent1",13);
    CkJsonObjectW_UpdateNull(json,L"expense.taxPercent2");
    CkJsonObjectW_UpdateInt(json,L"expense.markup_percent",20);
    CkJsonObjectW_UpdateNull(json,L"expense.invoiceid");
    CkJsonObjectW_UpdateString(json,L"expense.attachment.jwt",L"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50Ijo0MjM2NDEwLCJvcmlnaW5hbF9maWxlbmFtZSI6IlNjcmVlbiBTaG90IDIwMTktMDQtMjQgYXQgOS4zOS4xOSBBTS5wbmciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtMGU2ZDMwOWQ1ZTI5MzA3NmNhMGIyNDdkODFlOGJlNWE4NDZlZWE0YSIsImxlbmd0aCI6MTkxNDcyLCJrZXkiOiInZG9jcy0nLTQyMzY0MTAvdXBsb2FkLTBlNmQzMDlkNWUyOTMwNzZjYTBiMjQ3ZDgxZThiZTVhODQ2ZWVhNGEifQ.SOoW3_nTUrxjYO76g1UXHPIrO_aLbTpXCHEa-ZcnejA");
    CkJsonObjectW_UpdateString(json,L"expense.attachment.media_type",L"image/png");
    CkJsonObjectW_UpdateNull(json,L"expense.attachment.expenseid");
    CkJsonObjectW_UpdateString(json,L"expense.categoryid",L"65679");
    CkJsonObjectW_UpdateString(json,L"expense.category_name",L"");
    CkJsonObjectW_UpdateInt(json,L"expense.clientid",485558);
    CkJsonObjectW_UpdateInt(json,L"expense.converse_projectid",12345);

    // Adds the "Authorization: Bearer <access_token>" header.
    CkHttpW_putAuthToken(http,L"<access_token>");
    CkHttpW_SetRequestHeader(http,L"Content-Type",L"application/json");

    resp = CkHttpW_PostJson3(http,L"https://api.freshbooks.com/accounting/account/{{accountId}}/expenses/expenses?include%5B%5D=attachment",L"application/json",json);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(json);
        return;
    }

    sbResponseBody = CkStringBuilderW_Create();
    CkHttpResponseW_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",CkJsonObjectW_emit(jResp));

    respStatusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpResponseW_header(resp));
        wprintf(L"Failed.\n");
        CkHttpResponseW_Dispose(resp);
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(json);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    CkHttpResponseW_Dispose(resp);

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "response": {
    //     "result": {
    //       "expense": {
    //         "account_name": "",
    //         "accountid": null,
    //         "accounting_systemid": "wkMd2g",
    //         "amount": {
    //           "amount": "79.73",
    //           "code": "USD"
    //         },
    //         "attachment": {
    //           "attachmentid": 8670,
    //           "id": 8670,
    //           "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50Ijo0MjM2NDEwLCJvcmlnaW5hbF9maWxlbmFtZSI6IlNjcmVlbiBTaG90IDIwMTktMDQtMjQgYXQgOS4zOS4xOSBBTS5wbmciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtMGU2ZDMwOWQ1ZTI5MzA3NmNhMGIyNDdkODFlOGJlNWE4NDZlZWE0YSIsImxlbmd0aCI6MTkxNDcyLCJrZXkiOiInZG9jcy0nLTQyMzY0MTAvdXBsb2FkLTBlNmQzMDlkNWUyOTMwNzZjYTBiMjQ3ZDgxZThiZTVhODQ2ZWVhNGEifQ.SOoW3_nTUrxjYO76g1UXHPIrO_aLbTpXCHEa-ZcnejA",
    //           "media_type": "image/png"
    //         },
    //         "background_jobid": null,
    //         "bank_name": "",
    //         "categoryid": 2003174,
    //         "clientid": 0,
    //         "compounded_tax": false,
    //         "date": "2019-04-24",
    //         "expenseid": 1825574,
    //         "ext_invoiceid": 0,
    //         "ext_systemid": 0,
    //         "from_bulk_import": false,
    //         "has_receipt": true,
    //         "id": 1825574,
    //         "include_receipt": false,
    //         "invoiceid": null,
    //         "is_cogs": false,
    //         "isduplicate": true,
    //         "markup_percent": "0",
    //         "notes": "Purchased Gasoline for deliveries",
    //         "profileid": null,
    //         "projectid": 0,
    //         "staffid": 1,
    //         "status": 0,
    //         "taxAmount1": {
    //           "amount": "9.17",
    //           "code": "USD"
    //         },
    //         "taxAmount2": null,
    //         "taxName1": "other tax",
    //         "taxName2": null,
    //         "taxPercent1": "13",
    //         "taxPercent2": null,
    //         "transactionid": null,
    //         "updated": "2019-04-24 11:33:35",
    //         "vendor": "Shell Gas Station",
    //         "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.

    Account_name = CkJsonObjectW_stringOf(jResp,L"response.result.expense.account_name");
    Accountid = CkJsonObjectW_stringOf(jResp,L"response.result.expense.accountid");
    Accounting_systemid = CkJsonObjectW_stringOf(jResp,L"response.result.expense.accounting_systemid");
    Amount = CkJsonObjectW_stringOf(jResp,L"response.result.expense.amount.amount");
    Code = CkJsonObjectW_stringOf(jResp,L"response.result.expense.amount.code");
    Attachmentid = CkJsonObjectW_IntOf(jResp,L"response.result.expense.attachment.attachmentid");
    Id = CkJsonObjectW_IntOf(jResp,L"response.result.expense.attachment.id");
    v_Jwt = CkJsonObjectW_stringOf(jResp,L"response.result.expense.attachment.jwt");
    Media_type = CkJsonObjectW_stringOf(jResp,L"response.result.expense.attachment.media_type");
    Background_jobid = CkJsonObjectW_stringOf(jResp,L"response.result.expense.background_jobid");
    Bank_name = CkJsonObjectW_stringOf(jResp,L"response.result.expense.bank_name");
    Categoryid = CkJsonObjectW_IntOf(jResp,L"response.result.expense.categoryid");
    Clientid = CkJsonObjectW_IntOf(jResp,L"response.result.expense.clientid");
    Compounded_tax = CkJsonObjectW_BoolOf(jResp,L"response.result.expense.compounded_tax");
    Date = CkJsonObjectW_stringOf(jResp,L"response.result.expense.date");
    Expenseid = CkJsonObjectW_IntOf(jResp,L"response.result.expense.expenseid");
    Ext_invoiceid = CkJsonObjectW_IntOf(jResp,L"response.result.expense.ext_invoiceid");
    Ext_systemid = CkJsonObjectW_IntOf(jResp,L"response.result.expense.ext_systemid");
    From_bulk_import = CkJsonObjectW_BoolOf(jResp,L"response.result.expense.from_bulk_import");
    Has_receipt = CkJsonObjectW_BoolOf(jResp,L"response.result.expense.has_receipt");
    ExpenseId = CkJsonObjectW_IntOf(jResp,L"response.result.expense.id");
    Include_receipt = CkJsonObjectW_BoolOf(jResp,L"response.result.expense.include_receipt");
    Invoiceid = CkJsonObjectW_stringOf(jResp,L"response.result.expense.invoiceid");
    Is_cogs = CkJsonObjectW_BoolOf(jResp,L"response.result.expense.is_cogs");
    Isduplicate = CkJsonObjectW_BoolOf(jResp,L"response.result.expense.isduplicate");
    Markup_percent = CkJsonObjectW_stringOf(jResp,L"response.result.expense.markup_percent");
    Notes = CkJsonObjectW_stringOf(jResp,L"response.result.expense.notes");
    Profileid = CkJsonObjectW_stringOf(jResp,L"response.result.expense.profileid");
    Projectid = CkJsonObjectW_IntOf(jResp,L"response.result.expense.projectid");
    Staffid = CkJsonObjectW_IntOf(jResp,L"response.result.expense.staffid");
    Status = CkJsonObjectW_IntOf(jResp,L"response.result.expense.status");
    TaxAmount1Amount = CkJsonObjectW_stringOf(jResp,L"response.result.expense.taxAmount1.amount");
    TaxAmount1Code = CkJsonObjectW_stringOf(jResp,L"response.result.expense.taxAmount1.code");
    TaxAmount2 = CkJsonObjectW_stringOf(jResp,L"response.result.expense.taxAmount2");
    TaxName1 = CkJsonObjectW_stringOf(jResp,L"response.result.expense.taxName1");
    TaxName2 = CkJsonObjectW_stringOf(jResp,L"response.result.expense.taxName2");
    TaxPercent1 = CkJsonObjectW_stringOf(jResp,L"response.result.expense.taxPercent1");
    TaxPercent2 = CkJsonObjectW_stringOf(jResp,L"response.result.expense.taxPercent2");
    Transactionid = CkJsonObjectW_stringOf(jResp,L"response.result.expense.transactionid");
    Updated = CkJsonObjectW_stringOf(jResp,L"response.result.expense.updated");
    Vendor = CkJsonObjectW_stringOf(jResp,L"response.result.expense.vendor");
    Vis_state = CkJsonObjectW_IntOf(jResp,L"response.result.expense.vis_state");


    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(json);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -X POST
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
	-d '{
    "expense": {
        "transactionid": null,
        "status": null,
        "has_receipt": false,
        "always_remember": false,
        "is_cogs": true,
        "account_name": null,
        "include_receipt": false,
        "amount": {
            "amount": "79.73",
            "code": "USD"
        },
        "notes": "Purchased Gasoline for deliveries",
        "vendor": "Shell Gas Station",
        "date": "2019-04-24",
        "staffid": 1,
        "author_name": null,
        "taxName1": "other tax",
        "taxName2": null,
        "taxAmount1": {
            "amount": "9.17",
            "code": "USD"
        },
        "taxPercent1": 13,
        "taxPercent2": null,
        "markup_percent": 20,
        "invoiceid": null,
        "attachment": {
            "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50Ijo0MjM2NDEwLCJvcmlnaW5hbF9maWxlbmFtZSI6IlNjcmVlbiBTaG90IDIwMTktMDQtMjQgYXQgOS4zOS4xOSBBTS5wbmciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtMGU2ZDMwOWQ1ZTI5MzA3NmNhMGIyNDdkODFlOGJlNWE4NDZlZWE0YSIsImxlbmd0aCI6MTkxNDcyLCJrZXkiOiInZG9jcy0nLTQyMzY0MTAvdXBsb2FkLTBlNmQzMDlkNWUyOTMwNzZjYTBiMjQ3ZDgxZThiZTVhODQ2ZWVhNGEifQ.SOoW3_nTUrxjYO76g1UXHPIrO_aLbTpXCHEa-ZcnejA",
            "media_type": "image/png",
            "expenseid": null
        },
        "categoryid": "65679",
        "category_name": "",
        "clientid": 485558,
        "converse_projectid": 12345	
    }
}'
https://api.freshbooks.com/accounting/account/{{accountId}}/expenses/expenses?include%5B%5D=attachment

Postman Collection Item JSON

{
  "name": "Create Expense",
  "event": [
    {
      "listen": "test",
      "script": {
        "exec": [
          "let jsonData = JSON.parse(responseBody);",
          "pm.environment.set(\"expenseId\", jsonData.response.result.expense.id);",
          ""
        ],
        "type": "text/javascript"
      }
    }
  ],
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "name": "Content-Type",
        "value": "application/json",
        "type": "text"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"expense\": {\n        \"transactionid\": null,\n        \"status\": null,\n        \"has_receipt\": false,\n        \"always_remember\": false,\n        \"is_cogs\": true,\n        \"account_name\": null,\n        \"include_receipt\": false,\n        \"amount\": {\n            \"amount\": \"79.73\",\n            \"code\": \"USD\"\n        },\n        \"notes\": \"Purchased Gasoline for deliveries\",\n        \"vendor\": \"Shell Gas Station\",\n        \"date\": \"2019-04-24\",\n        \"staffid\": 1,\n        \"author_name\": null,\n        \"taxName1\": \"other tax\",\n        \"taxName2\": null,\n        \"taxAmount1\": {\n            \"amount\": \"9.17\",\n            \"code\": \"USD\"\n        },\n        \"taxPercent1\": 13,\n        \"taxPercent2\": null,\n        \"markup_percent\": 20,\n        \"invoiceid\": null,\n        \"attachment\": {\n            \"jwt\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50Ijo0MjM2NDEwLCJvcmlnaW5hbF9maWxlbmFtZSI6IlNjcmVlbiBTaG90IDIwMTktMDQtMjQgYXQgOS4zOS4xOSBBTS5wbmciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtMGU2ZDMwOWQ1ZTI5MzA3NmNhMGIyNDdkODFlOGJlNWE4NDZlZWE0YSIsImxlbmd0aCI6MTkxNDcyLCJrZXkiOiInZG9jcy0nLTQyMzY0MTAvdXBsb2FkLTBlNmQzMDlkNWUyOTMwNzZjYTBiMjQ3ZDgxZThiZTVhODQ2ZWVhNGEifQ.SOoW3_nTUrxjYO76g1UXHPIrO_aLbTpXCHEa-ZcnejA\",\n            \"media_type\": \"image/png\",\n            \"expenseid\": null\n        },\n        \"categoryid\": \"65679\",\n        \"category_name\": \"\",\n        \"clientid\": 485558,\n        \"converse_projectid\": 12345\t\n    }\n}"
    },
    "url": {
      "raw": "https://api.freshbooks.com/accounting/account/{{accountId}}/expenses/expenses?include%5B%5D=attachment",
      "protocol": "https",
      "host": [
        "api",
        "freshbooks",
        "com"
      ],
      "path": [
        "accounting",
        "account",
        "{{accountId}}",
        "expenses",
        "expenses"
      ],
      "query": [
        {
          "key": "include%5B%5D",
          "value": "attachment"
        }
      ]
    },
    "description": "Category can be passed as categoryid or category_name, both as string values."
  },
  "response": [
    {
      "name": "Create Expense",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"expense\": {\n        \"transactionid\": null,\n        \"status\": null,\n        \"has_receipt\": false,\n        \"always_remember\": false,\n        \"is_cogs\": false,\n        \"account_name\": null,\n        \"include_receipt\": false,\n        \"amount\": {\n            \"amount\": \"79.73\",\n            \"code\": \"USD\"\n        },\n        \"notes\": \"Purchased Gasoline for deliveries\",\n        \"vendor\": \"Shell Gas Station\",\n        \"date\": \"2019-04-24\",\n        \"staffid\": 1,\n        \"author_name\": null,\n        \"taxName1\": \"other tax\",\n        \"taxName2\": null,\n        \"taxAmount1\": {\n            \"amount\": \"9.17\",\n            \"code\": \"USD\"\n        },\n        \"taxPercent1\": 13,\n        \"taxPercent2\": null,\n        \"markup_percent\": null,\n        \"invoiceid\": null,\n        \"attachment\": {\n            \"jwt\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50Ijo0MjM2NDEwLCJvcmlnaW5hbF9maWxlbmFtZSI6IlNjcmVlbiBTaG90IDIwMTktMDQtMjQgYXQgOS4zOS4xOSBBTS5wbmciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtMGU2ZDMwOWQ1ZTI5MzA3NmNhMGIyNDdkODFlOGJlNWE4NDZlZWE0YSIsImxlbmd0aCI6MTkxNDcyLCJrZXkiOiInZG9jcy0nLTQyMzY0MTAvdXBsb2FkLTBlNmQzMDlkNWUyOTMwNzZjYTBiMjQ3ZDgxZThiZTVhODQ2ZWVhNGEifQ.SOoW3_nTUrxjYO76g1UXHPIrO_aLbTpXCHEa-ZcnejA\",\n            \"media_type\": \"image/png\",\n            \"expenseid\": null\n        },\n        \"categoryid\": \"2003174\",\n        \"clientid\": null\n    }\n}"
        },
        "url": {
          "raw": "https://api.freshbooks.com/accounting/account/{{accountId}}/expenses/expenses?include%5B%5D=attachment",
          "protocol": "https",
          "host": [
            "api",
            "freshbooks",
            "com"
          ],
          "path": [
            "accounting",
            "account",
            "{{accountId}}",
            "expenses",
            "expenses"
          ],
          "query": [
            {
              "key": "include%5B%5D",
              "value": "attachment"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "nginx"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        },
        {
          "key": "X-NewRelic-App-Data",
          "value": "PxQBWV5TCBABVlVSAwEOVlcTGhE1AwE2QgNWEVlbQFtcCxYnRA9QFg1ZWU4DFVdfRgFPCkNFR0gBSUZWDBUGEQoHQBJdVkdXQEcVUR1RHVBVBQBZU1UMCwNQVFsDBgVRSAAFBVBKQVFWUwEACAkBCgJcCFQBAAtASFBWDRUGZQ=="
        },
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "Expires",
          "value": "Tue, 24 Apr 2018 15:33:35 GMT"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache"
        },
        {
          "key": "Content-Encoding",
          "value": "gzip"
        },
        {
          "key": "Via",
          "value": "1.1 google"
        },
        {
          "key": "Via",
          "value": "1.1 varnish"
        },
        {
          "key": "Transfer-Encoding",
          "value": "chunked"
        },
        {
          "key": "Accept-Ranges",
          "value": "bytes"
        },
        {
          "key": "Date",
          "value": "Wed, 24 Apr 2019 15:33:35 GMT"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "X-Served-By",
          "value": "cache-jfk8129-JFK"
        },
        {
          "key": "X-Cache",
          "value": "MISS"
        },
        {
          "key": "X-Cache-Hits",
          "value": "0"
        },
        {
          "key": "Vary",
          "value": "Accept-Encoding"
        },
        {
          "key": "Country",
          "value": "CA"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=31536000; includeSubDomains; preload"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"response\": {\n        \"result\": {\n            \"expense\": {\n                \"account_name\": \"\",\n                \"accountid\": null,\n                \"accounting_systemid\": \"wkMd2g\",\n                \"amount\": {\n                    \"amount\": \"79.73\",\n                    \"code\": \"USD\"\n                },\n                \"attachment\": {\n                    \"attachmentid\": 8670,\n                    \"id\": 8670,\n                    \"jwt\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50Ijo0MjM2NDEwLCJvcmlnaW5hbF9maWxlbmFtZSI6IlNjcmVlbiBTaG90IDIwMTktMDQtMjQgYXQgOS4zOS4xOSBBTS5wbmciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtMGU2ZDMwOWQ1ZTI5MzA3NmNhMGIyNDdkODFlOGJlNWE4NDZlZWE0YSIsImxlbmd0aCI6MTkxNDcyLCJrZXkiOiInZG9jcy0nLTQyMzY0MTAvdXBsb2FkLTBlNmQzMDlkNWUyOTMwNzZjYTBiMjQ3ZDgxZThiZTVhODQ2ZWVhNGEifQ.SOoW3_nTUrxjYO76g1UXHPIrO_aLbTpXCHEa-ZcnejA\",\n                    \"media_type\": \"image/png\"\n                },\n                \"background_jobid\": null,\n                \"bank_name\": \"\",\n                \"categoryid\": 2003174,\n                \"clientid\": 0,\n                \"compounded_tax\": false,\n                \"date\": \"2019-04-24\",\n                \"expenseid\": 1825574,\n                \"ext_invoiceid\": 0,\n                \"ext_systemid\": 0,\n                \"from_bulk_import\": false,\n                \"has_receipt\": true,\n                \"id\": 1825574,\n                \"include_receipt\": false,\n                \"invoiceid\": null,\n                \"is_cogs\": false,\n                \"isduplicate\": true,\n                \"markup_percent\": \"0\",\n                \"notes\": \"Purchased Gasoline for deliveries\",\n                \"profileid\": null,\n                \"projectid\": 0,\n                \"staffid\": 1,\n                \"status\": 0,\n                \"taxAmount1\": {\n                    \"amount\": \"9.17\",\n                    \"code\": \"USD\"\n                },\n                \"taxAmount2\": null,\n                \"taxName1\": \"other tax\",\n                \"taxName2\": null,\n                \"taxPercent1\": \"13\",\n                \"taxPercent2\": null,\n                \"transactionid\": null,\n                \"updated\": \"2019-04-24 11:33:35\",\n                \"vendor\": \"Shell Gas Station\",\n                \"vis_state\": 0\n            }\n        }\n    }\n}"
    }
  ]
}