Chilkat Online Tools

DataFlex / New FreshBooks / General Ledger

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vSbResponseBody
    Handle hoSbResponseBody
    Handle hoJResp
    Integer iRespStatusCode
    String sAccount_name
    String sAccount_number
    String sAccount_type
    Integer iAccountid
    String sBalance
    String sCurrency_code
    Integer iId
    Integer j
    Integer iCount_j
    String sAccount_sub_name
    String sAccount_sub_number
    Boolean iCustom
    Integer iParentid
    Integer iSub_accountid
    Integer iPage
    Integer iPages
    Integer iPer_page
    Integer iTotal
    Integer i
    Integer iCount_i
    String sTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"
    Send ComSetRequestHeader To hoHttp "Content-Type" "application/json"

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComQuickGetSb Of hoHttp "https://api.freshbooks.com/accounting/account/{{accountId}}/journal_entry_accounts/journal_entry_accounts" vSbResponseBody To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
    If (Not(IsComObjectCreated(hoJResp))) Begin
        Send CreateComObject of hoJResp
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
    Set ComEmitCompact Of hoJResp To False

    Showln "Response Body:"
    Get ComEmit Of hoJResp To sTemp1
    Showln sTemp1

    Get ComLastStatus Of hoHttp To iRespStatusCode
    Showln "Response Status Code = " iRespStatusCode
    If (iRespStatusCode >= 400) Begin
        Showln "Response Header:"
        Get ComLastHeader Of hoHttp To sTemp1
        Showln sTemp1
        Showln "Failed."
        Procedure_Return
    End

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

    // {
    //   "response": {
    //     "result": {
    //       "journal_entry_accounts": [
    //         {
    //           "account_name": "Cash",
    //           "account_number": "1000",
    //           "account_type": "asset",
    //           "accountid": 545882,
    //           "balance": "340.54",
    //           "currency_code": "USD",
    //           "id": 545882,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Petty Cash",
    //               "account_sub_number": "1",
    //               "account_type": "asset",
    //               "balance": "340.54",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635972,
    //               "parentid": 545882,
    //               "sub_accountid": 635972
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Accounts Receivable",
    //           "account_number": "1200",
    //           "account_type": "asset",
    //           "accountid": 545884,
    //           "balance": "-500",
    //           "currency_code": "USD",
    //           "id": 545884,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Accounts Receivable",
    //               "account_sub_number": "1",
    //               "account_type": "asset",
    //               "balance": "-500",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635974,
    //               "parentid": 545884,
    //               "sub_accountid": 635974
    //             },
    //             {
    //               "account_sub_name": "Customer Deposits",
    //               "account_sub_number": "2",
    //               "account_type": "asset",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635976,
    //               "parentid": 545884,
    //               "sub_accountid": 635976
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Property, Plant, and Equipment",
    //           "account_number": "1500",
    //           "account_type": "asset",
    //           "accountid": 545886,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545886,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Office Equipment",
    //               "account_sub_number": "1",
    //               "account_type": "asset",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635978,
    //               "parentid": 545886,
    //               "sub_accountid": 635978
    //             },
    //             {
    //               "account_sub_name": "Furniture",
    //               "account_sub_number": "2",
    //               "account_type": "asset",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635980,
    //               "parentid": 545886,
    //               "sub_accountid": 635980
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Deferred Discounts",
    //           "account_number": "1600",
    //           "account_type": "asset",
    //           "accountid": 545888,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545888,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Deferred Discounts",
    //               "account_sub_number": "1",
    //               "account_type": "asset",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635982,
    //               "parentid": 545888,
    //               "sub_accountid": 635982
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Accounts Payable",
    //           "account_number": "2000",
    //           "account_type": "liability",
    //           "accountid": 545890,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545890,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Accrued Payroll",
    //               "account_sub_number": "1",
    //               "account_type": "liability",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635984,
    //               "parentid": 545890,
    //               "sub_accountid": 635984
    //             },
    //             {
    //               "account_sub_name": "Accrued Rent",
    //               "account_sub_number": "2",
    //               "account_type": "liability",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635986,
    //               "parentid": 545890,
    //               "sub_accountid": 635986
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Taxes Payable",
    //           "account_number": "2001",
    //           "account_type": "liability",
    //           "accountid": 545892,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545892,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "HST",
    //               "account_sub_number": "1",
    //               "account_type": "liability",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 636766,
    //               "parentid": 545892,
    //               "sub_accountid": 636766
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Unearned Revenue",
    //           "account_number": "2002",
    //           "account_type": "liability",
    //           "accountid": 545894,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545894,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Unearned Revenue",
    //               "account_sub_number": "1",
    //               "account_type": "liability",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635988,
    //               "parentid": 545894,
    //               "sub_accountid": 635988
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Customer Credit",
    //           "account_number": "2003",
    //           "account_type": "liability",
    //           "accountid": 545896,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545896,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Customer Credit",
    //               "account_sub_number": "1",
    //               "account_type": "liability",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635990,
    //               "parentid": 545896,
    //               "sub_accountid": 635990
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Credit Cards",
    //           "account_number": "2004",
    //           "account_type": "liability",
    //           "accountid": 545898,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545898,
    //           "sub_accounts": [
    //           ]
    //         },
    //         {
    //           "account_name": "Owner's Equity",
    //           "account_number": "3000",
    //           "account_type": "equity",
    //           "accountid": 545900,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545900,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Owner's Equity",
    //               "account_sub_number": "1",
    //               "account_type": "equity",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635992,
    //               "parentid": 545900,
    //               "sub_accountid": 635992
    //             },
    //             {
    //               "account_sub_name": "Common Stock",
    //               "account_sub_number": "2",
    //               "account_type": "equity",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635994,
    //               "parentid": 545900,
    //               "sub_accountid": 635994
    //             },
    //             {
    //               "account_sub_name": "Retained Earnings",
    //               "account_sub_number": "3",
    //               "account_type": "equity",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635996,
    //               "parentid": 545900,
    //               "sub_accountid": 635996
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Opening Balance",
    //           "account_number": "3001",
    //           "account_type": "equity",
    //           "accountid": 545902,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545902,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Opening Balance Adjustments",
    //               "account_sub_number": "4",
    //               "account_type": "equity",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 635998,
    //               "parentid": 545902,
    //               "sub_accountid": 635998
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Revenue",
    //           "account_number": "4000",
    //           "account_type": "income",
    //           "accountid": 545904,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545904,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Sales",
    //               "account_sub_number": "1",
    //               "account_type": "income",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 636000,
    //               "parentid": 545904,
    //               "sub_accountid": 636000
    //             },
    //             {
    //               "account_sub_name": "Billed Expenses",
    //               "account_sub_number": "2",
    //               "account_type": "income",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 636002,
    //               "parentid": 545904,
    //               "sub_accountid": 636002
    //             },
    //             {
    //               "account_sub_name": "Discounts",
    //               "account_sub_number": "3",
    //               "account_type": "income",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 636004,
    //               "parentid": 545904,
    //               "sub_accountid": 636004
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Cost of Goods Sold",
    //           "account_number": "5000",
    //           "account_type": "expense",
    //           "accountid": 545906,
    //           "balance": "0",
    //           "currency_code": "USD",
    //           "id": 545906,
    //           "sub_accounts": [
    //           ]
    //         },
    //         {
    //           "account_name": "Operating Expenses",
    //           "account_number": "6000",
    //           "account_type": "expense",
    //           "accountid": 545908,
    //           "balance": "141.12",
    //           "currency_code": "USD",
    //           "id": 545908,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "Other Expenses",
    //               "account_sub_number": "1",
    //               "account_type": "expense",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 636768,
    //               "parentid": 545908,
    //               "sub_accountid": 636768
    //             },
    //             {
    //               "account_sub_name": "Rent or Lease",
    //               "account_sub_number": "2",
    //               "account_type": "expense",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 760282,
    //               "parentid": 545908,
    //               "sub_accountid": 760282
    //             },
    //             {
    //               "account_sub_name": "Car & Truck Expenses",
    //               "account_sub_number": "3",
    //               "account_type": "expense",
    //               "balance": "141.12",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 849638,
    //               "parentid": 545908,
    //               "sub_accountid": 849638
    //             }
    //           ]
    //         },
    //         {
    //           "account_name": "Taxes Paid",
    //           "account_number": "6001",
    //           "account_type": "expense",
    //           "accountid": 545910,
    //           "balance": "18.34",
    //           "currency_code": "USD",
    //           "id": 545910,
    //           "sub_accounts": [
    //             {
    //               "account_sub_name": "HST",
    //               "account_sub_number": "1",
    //               "account_type": "expense",
    //               "balance": "0",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 636770,
    //               "parentid": 545910,
    //               "sub_accountid": 636770
    //             },
    //             {
    //               "account_sub_name": "other tax",
    //               "account_sub_number": "2",
    //               "account_type": "expense",
    //               "balance": "18.34",
    //               "currency_code": "USD",
    //               "custom": false,
    //               "id": 849640,
    //               "parentid": 545910,
    //               "sub_accountid": 849640
    //             }
    //           ]
    //         }
    //       ],
    //       "page": 1,
    //       "pages": 1,
    //       "per_page": 15,
    //       "total": 15
    //     }
    //   }
    // }

    // Sample code for parsing the JSON response...
    // Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    Get ComIntOf Of hoJResp "response.result.page" To iPage
    Get ComIntOf Of hoJResp "response.result.pages" To iPages
    Get ComIntOf Of hoJResp "response.result.per_page" To iPer_page
    Get ComIntOf Of hoJResp "response.result.total" To iTotal
    Move 0 To i
    Get ComSizeOfArray Of hoJResp "response.result.journal_entry_accounts" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].account_name" To sAccount_name
        Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].account_number" To sAccount_number
        Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].account_type" To sAccount_type
        Get ComIntOf Of hoJResp "response.result.journal_entry_accounts[i].accountid" To iAccountid
        Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].balance" To sBalance
        Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].currency_code" To sCurrency_code
        Get ComIntOf Of hoJResp "response.result.journal_entry_accounts[i].id" To iId
        Move 0 To j
        Get ComSizeOfArray Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts" To iCount_j
        While (j < iCount_j)
            Set ComJ Of hoJResp To j
            Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts[j].account_sub_name" To sAccount_sub_name
            Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts[j].account_sub_number" To sAccount_sub_number
            Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts[j].account_type" To sAccount_type
            Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts[j].balance" To sBalance
            Get ComStringOf Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts[j].currency_code" To sCurrency_code
            Get ComBoolOf Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts[j].custom" To iCustom
            Get ComIntOf Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts[j].id" To iId
            Get ComIntOf Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts[j].parentid" To iParentid
            Get ComIntOf Of hoJResp "response.result.journal_entry_accounts[i].sub_accounts[j].sub_accountid" To iSub_accountid
            Move (j + 1) To j
        Loop

        Move (i + 1) To i
    Loop



End_Procedure

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
https://api.freshbooks.com/accounting/account/{{accountId}}/journal_entry_accounts/journal_entry_accounts

Postman Collection Item JSON

{
  "name": "General Ledger",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json",
        "type": "text"
      }
    ],
    "url": {
      "raw": "https://api.freshbooks.com/accounting/account/{{accountId}}/journal_entry_accounts/journal_entry_accounts",
      "protocol": "https",
      "host": [
        "api",
        "freshbooks",
        "com"
      ],
      "path": [
        "accounting",
        "account",
        "{{accountId}}",
        "journal_entry_accounts",
        "journal_entry_accounts"
      ],
      "query": [
        {
          "key": "search%5Bcurrency_code%5D",
          "value": "USD",
          "disabled": true
        },
        {
          "key": "search%5Bstart_date%5D",
          "value": "2019-04-01",
          "disabled": true
        },
        {
          "key": "search%5Bend_date%5D",
          "value": "2019-04-30",
          "disabled": true
        }
      ]
    },
    "description": "A complete record of your transactions to help you prepare financial statements."
  },
  "response": [
    {
      "name": "General Ledger",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://api.freshbooks.com/accounting/account/{{accountId}}/journal_entry_accounts/journal_entry_accounts",
          "protocol": "https",
          "host": [
            "api",
            "freshbooks",
            "com"
          ],
          "path": [
            "accounting",
            "account",
            "{{accountId}}",
            "journal_entry_accounts",
            "journal_entry_accounts"
          ],
          "query": [
            {
              "key": "search%5Bcurrency_code%5D",
              "value": "USD",
              "disabled": true
            },
            {
              "key": "search%5Bstart_date%5D",
              "value": "2019-04-01",
              "disabled": true
            },
            {
              "key": "search%5Bend_date%5D",
              "value": "2019-04-30",
              "disabled": true
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "nginx"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        },
        {
          "key": "X-NewRelic-App-Data",
          "value": "PxQBWV5TCBABVlVSAwEOVlcTGhE1AwE2QgNWEVlbQFtcCxYnRA9QFg1ZWU4DFVdfRgFPCkNFR0gOXkNBDAcPPVUMTBBBZ1VRUApMD0USCQgLQ0UPBw9dXUQWGANUUlgTCkVFEU5WT1IeUwhUDwwFBgFdClYEUwdWVQIbTFdPGgUDU1hTBwYFAFUED1dQUwJAHARZDktdaQ=="
        },
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "Expires",
          "value": "Tue, 24 Apr 2018 18:32:11 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 18:32:11 GMT"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "X-Served-By",
          "value": "cache-mdw17369-MDW"
        },
        {
          "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            \"journal_entry_accounts\": [\n                {\n                    \"account_name\": \"Cash\",\n                    \"account_number\": \"1000\",\n                    \"account_type\": \"asset\",\n                    \"accountid\": 545882,\n                    \"balance\": \"340.54\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545882,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Petty Cash\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"asset\",\n                            \"balance\": \"340.54\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635972,\n                            \"parentid\": 545882,\n                            \"sub_accountid\": 635972\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Accounts Receivable\",\n                    \"account_number\": \"1200\",\n                    \"account_type\": \"asset\",\n                    \"accountid\": 545884,\n                    \"balance\": \"-500\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545884,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Accounts Receivable\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"asset\",\n                            \"balance\": \"-500\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635974,\n                            \"parentid\": 545884,\n                            \"sub_accountid\": 635974\n                        },\n                        {\n                            \"account_sub_name\": \"Customer Deposits\",\n                            \"account_sub_number\": \"2\",\n                            \"account_type\": \"asset\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635976,\n                            \"parentid\": 545884,\n                            \"sub_accountid\": 635976\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Property, Plant, and Equipment\",\n                    \"account_number\": \"1500\",\n                    \"account_type\": \"asset\",\n                    \"accountid\": 545886,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545886,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Office Equipment\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"asset\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635978,\n                            \"parentid\": 545886,\n                            \"sub_accountid\": 635978\n                        },\n                        {\n                            \"account_sub_name\": \"Furniture\",\n                            \"account_sub_number\": \"2\",\n                            \"account_type\": \"asset\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635980,\n                            \"parentid\": 545886,\n                            \"sub_accountid\": 635980\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Deferred Discounts\",\n                    \"account_number\": \"1600\",\n                    \"account_type\": \"asset\",\n                    \"accountid\": 545888,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545888,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Deferred Discounts\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"asset\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635982,\n                            \"parentid\": 545888,\n                            \"sub_accountid\": 635982\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Accounts Payable\",\n                    \"account_number\": \"2000\",\n                    \"account_type\": \"liability\",\n                    \"accountid\": 545890,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545890,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Accrued Payroll\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"liability\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635984,\n                            \"parentid\": 545890,\n                            \"sub_accountid\": 635984\n                        },\n                        {\n                            \"account_sub_name\": \"Accrued Rent\",\n                            \"account_sub_number\": \"2\",\n                            \"account_type\": \"liability\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635986,\n                            \"parentid\": 545890,\n                            \"sub_accountid\": 635986\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Taxes Payable\",\n                    \"account_number\": \"2001\",\n                    \"account_type\": \"liability\",\n                    \"accountid\": 545892,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545892,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"HST\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"liability\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 636766,\n                            \"parentid\": 545892,\n                            \"sub_accountid\": 636766\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Unearned Revenue\",\n                    \"account_number\": \"2002\",\n                    \"account_type\": \"liability\",\n                    \"accountid\": 545894,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545894,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Unearned Revenue\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"liability\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635988,\n                            \"parentid\": 545894,\n                            \"sub_accountid\": 635988\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Customer Credit\",\n                    \"account_number\": \"2003\",\n                    \"account_type\": \"liability\",\n                    \"accountid\": 545896,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545896,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Customer Credit\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"liability\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635990,\n                            \"parentid\": 545896,\n                            \"sub_accountid\": 635990\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Credit Cards\",\n                    \"account_number\": \"2004\",\n                    \"account_type\": \"liability\",\n                    \"accountid\": 545898,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545898,\n                    \"sub_accounts\": []\n                },\n                {\n                    \"account_name\": \"Owner's Equity\",\n                    \"account_number\": \"3000\",\n                    \"account_type\": \"equity\",\n                    \"accountid\": 545900,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545900,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Owner's Equity\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"equity\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635992,\n                            \"parentid\": 545900,\n                            \"sub_accountid\": 635992\n                        },\n                        {\n                            \"account_sub_name\": \"Common Stock\",\n                            \"account_sub_number\": \"2\",\n                            \"account_type\": \"equity\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635994,\n                            \"parentid\": 545900,\n                            \"sub_accountid\": 635994\n                        },\n                        {\n                            \"account_sub_name\": \"Retained Earnings\",\n                            \"account_sub_number\": \"3\",\n                            \"account_type\": \"equity\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635996,\n                            \"parentid\": 545900,\n                            \"sub_accountid\": 635996\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Opening Balance\",\n                    \"account_number\": \"3001\",\n                    \"account_type\": \"equity\",\n                    \"accountid\": 545902,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545902,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Opening Balance Adjustments\",\n                            \"account_sub_number\": \"4\",\n                            \"account_type\": \"equity\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 635998,\n                            \"parentid\": 545902,\n                            \"sub_accountid\": 635998\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Revenue\",\n                    \"account_number\": \"4000\",\n                    \"account_type\": \"income\",\n                    \"accountid\": 545904,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545904,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Sales\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"income\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 636000,\n                            \"parentid\": 545904,\n                            \"sub_accountid\": 636000\n                        },\n                        {\n                            \"account_sub_name\": \"Billed Expenses\",\n                            \"account_sub_number\": \"2\",\n                            \"account_type\": \"income\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 636002,\n                            \"parentid\": 545904,\n                            \"sub_accountid\": 636002\n                        },\n                        {\n                            \"account_sub_name\": \"Discounts\",\n                            \"account_sub_number\": \"3\",\n                            \"account_type\": \"income\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 636004,\n                            \"parentid\": 545904,\n                            \"sub_accountid\": 636004\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Cost of Goods Sold\",\n                    \"account_number\": \"5000\",\n                    \"account_type\": \"expense\",\n                    \"accountid\": 545906,\n                    \"balance\": \"0\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545906,\n                    \"sub_accounts\": []\n                },\n                {\n                    \"account_name\": \"Operating Expenses\",\n                    \"account_number\": \"6000\",\n                    \"account_type\": \"expense\",\n                    \"accountid\": 545908,\n                    \"balance\": \"141.12\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545908,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"Other Expenses\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"expense\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 636768,\n                            \"parentid\": 545908,\n                            \"sub_accountid\": 636768\n                        },\n                        {\n                            \"account_sub_name\": \"Rent or Lease\",\n                            \"account_sub_number\": \"2\",\n                            \"account_type\": \"expense\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 760282,\n                            \"parentid\": 545908,\n                            \"sub_accountid\": 760282\n                        },\n                        {\n                            \"account_sub_name\": \"Car & Truck Expenses\",\n                            \"account_sub_number\": \"3\",\n                            \"account_type\": \"expense\",\n                            \"balance\": \"141.12\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 849638,\n                            \"parentid\": 545908,\n                            \"sub_accountid\": 849638\n                        }\n                    ]\n                },\n                {\n                    \"account_name\": \"Taxes Paid\",\n                    \"account_number\": \"6001\",\n                    \"account_type\": \"expense\",\n                    \"accountid\": 545910,\n                    \"balance\": \"18.34\",\n                    \"currency_code\": \"USD\",\n                    \"id\": 545910,\n                    \"sub_accounts\": [\n                        {\n                            \"account_sub_name\": \"HST\",\n                            \"account_sub_number\": \"1\",\n                            \"account_type\": \"expense\",\n                            \"balance\": \"0\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 636770,\n                            \"parentid\": 545910,\n                            \"sub_accountid\": 636770\n                        },\n                        {\n                            \"account_sub_name\": \"other tax\",\n                            \"account_sub_number\": \"2\",\n                            \"account_type\": \"expense\",\n                            \"balance\": \"18.34\",\n                            \"currency_code\": \"USD\",\n                            \"custom\": false,\n                            \"id\": 849640,\n                            \"parentid\": 545910,\n                            \"sub_accountid\": 849640\n                        }\n                    ]\n                }\n            ],\n            \"page\": 1,\n            \"pages\": 1,\n            \"per_page\": 15,\n            \"total\": 15\n        }\n    }\n}"
    }
  ]
}