SQL Server / New FreshBooks / Balance Sheet
Back to Collection Items
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @iTmp0 int
-- Important: Do not use nvarchar(max). See the warning about using nvarchar(max).
DECLARE @sTmp0 nvarchar(4000)
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @http int
-- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
DECLARE @queryParams int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @queryParams OUT
EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'dates[]', '2019-04-19'
EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'dates[]', '2019-04-25'
EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'currency_code', 'USD'
-- Adds the "Authorization: Bearer <access_token>" header.
EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'
DECLARE @resp int
EXEC sp_OAMethod @http, 'QuickRequestParams', @resp OUT, 'GET', 'https://api.freshbooks.com/accounting/account/{{accountId}}/reports/accounting/balance_sheet', @queryParams
EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
IF @iTmp0 = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
RETURN
END
DECLARE @sbResponseBody int
-- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody
DECLARE @jResp int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT
EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
EXEC sp_OASetProperty @jResp, 'EmitCompact', 0
PRINT 'Response Body:'
EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
PRINT @sTmp0
DECLARE @respStatusCode int
EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT
PRINT 'Response Status Code = ' + @respStatusCode
IF @respStatusCode >= 400
BEGIN
PRINT 'Response Header:'
EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Failed.'
EXEC @hr = sp_OADestroy @resp
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
RETURN
END
EXEC @hr = sp_OADestroy @resp
-- Sample JSON response:
-- (Sample code for parsing the JSON response is shown below)
-- {
-- "response": {
-- "result": {
-- "balance_sheet": {
-- "assets_total": [
-- {
-- "balance": {
-- "amount": "-1380.98",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "10345.56",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "company_name": "Postman Sandbox",
-- "currency_code": "USD",
-- "data": [
-- {
-- "account_type": "asset",
-- "accounts": [
-- {
-- "account_name": "Cash",
-- "account_number": "1000",
-- "balances": [
-- {
-- "balance": {
-- "amount": "5744.02",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "6310.56",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_accounts": [
-- {
-- "balances": [
-- {
-- "balance": {
-- "amount": "5744.02",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "6310.56",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_account_name": "Petty Cash",
-- "sub_account_number": "1"
-- }
-- ]
-- },
-- {
-- "account_name": "Accounts Receivable",
-- "account_number": "1200",
-- "balances": [
-- {
-- "balance": {
-- "amount": "-7125.00",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "4035.00",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_accounts": [
-- {
-- "balances": [
-- {
-- "balance": {
-- "amount": "-7125.00",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "4435.00",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_account_name": "Accounts Receivable",
-- "sub_account_number": "1"
-- },
-- {
-- "balances": [
-- {
-- "balance": {
-- "amount": "0.00",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "-400.00",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_account_name": "Customer Deposits",
-- "sub_account_number": "2"
-- }
-- ]
-- }
-- ],
-- "balances": [
-- {
-- "balance": {
-- "amount": "-1380.98",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "10345.56",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "category": "current"
-- },
-- {
-- "account_type": "liability",
-- "accounts": [
-- {
-- "account_name": "Taxes Payable",
-- "account_number": "2001",
-- "balances": [
-- {
-- "balance": {
-- "amount": "205.00",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "211.00",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_accounts": [
-- {
-- "balances": [
-- {
-- "balance": {
-- "amount": "205.00",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "211.00",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_account_name": "HST",
-- "sub_account_number": "1"
-- }
-- ]
-- },
-- {
-- "account_name": "Customer Credit",
-- "account_number": "2003",
-- "balances": [
-- {
-- "balance": {
-- "amount": "3120.00",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "3120.00",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_accounts": [
-- {
-- "balances": [
-- {
-- "balance": {
-- "amount": "3120.00",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "3120.00",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_account_name": "Customer Credit",
-- "sub_account_number": "1"
-- }
-- ]
-- }
-- ],
-- "balances": [
-- {
-- "balance": {
-- "amount": "3325.00",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "3331.00",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "category": "current"
-- },
-- {
-- "account_type": "equity",
-- "accounts": [
-- {
-- "account_name": "Net Income",
-- "account_number": null,
-- "balances": [
-- {
-- "balance": {
-- "amount": "-4705.98",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "7014.56",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "sub_accounts": [
-- ]
-- }
-- ],
-- "balances": [
-- {
-- "balance": {
-- "amount": "-4705.98",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "7014.56",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ],
-- "category": null
-- }
-- ],
-- "dates": [
-- "2019-04-19",
-- "2019-04-25"
-- ],
-- "download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50aWQiOiJ3a01kMmciLCJ1c2VyaWQiOjEsImNvbnRhY3RpZCI6LTEsImxldmVsIjozLCJ0eXBlIjoicmVwb3J0Iiwib2JqZWN0aWQiOiJiYWxhbmNlX3NoZWV0IiwicGFyYW1zIjp7ImRhdGVzIjpbIjIwMTktMDQtMTkiLCIyMDE5LTA0LTI1Il0sImN1cnJlbmN5X2NvZGUiOiJVU0QifSwiaWF0IjoxNTU2MTMwNzAzLCJleHAiOjE1NTg3MjI3MDN9.FziuxTK2nbj1xfrefdPjL9J7_a5tFjBneqTp5juy4D0",
-- "liabilities_and_equity_total": [
-- {
-- "balance": {
-- "amount": "-1380.98",
-- "code": "USD"
-- },
-- "date": "2019-04-19"
-- },
-- {
-- "balance": {
-- "amount": "10345.56",
-- "code": "USD"
-- },
-- "date": "2019-04-25"
-- }
-- ]
-- }
-- }
-- }
-- }
-- Sample code for parsing the JSON response...
-- Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
DECLARE @Amount nvarchar(4000)
DECLARE @Code nvarchar(4000)
DECLARE @date nvarchar(4000)
DECLARE @account_type nvarchar(4000)
DECLARE @category nvarchar(4000)
DECLARE @j int
DECLARE @count_j int
DECLARE @account_name nvarchar(4000)
DECLARE @account_number nvarchar(4000)
DECLARE @k int
DECLARE @count_k int
DECLARE @balanceAmount nvarchar(4000)
DECLARE @balanceCode nvarchar(4000)
DECLARE @sub_account_name nvarchar(4000)
DECLARE @sub_account_number nvarchar(4000)
DECLARE @json1 int
DECLARE @i1 int
DECLARE @count_i1 int
DECLARE @strVal nvarchar(4000)
DECLARE @Company_name nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Company_name OUT, 'response.result.balance_sheet.company_name'
DECLARE @Currency_code nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Currency_code OUT, 'response.result.balance_sheet.currency_code'
DECLARE @Download_token nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @Download_token OUT, 'response.result.balance_sheet.download_token'
DECLARE @i int
SELECT @i = 0
DECLARE @count_i int
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'response.result.balance_sheet.assets_total'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @Amount OUT, 'response.result.balance_sheet.assets_total[i].balance.amount'
EXEC sp_OAMethod @jResp, 'StringOf', @Code OUT, 'response.result.balance_sheet.assets_total[i].balance.code'
EXEC sp_OAMethod @jResp, 'StringOf', @date OUT, 'response.result.balance_sheet.assets_total[i].date'
SELECT @i = @i + 1
END
SELECT @i = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'response.result.balance_sheet.data'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @account_type OUT, 'response.result.balance_sheet.data[i].account_type'
EXEC sp_OAMethod @jResp, 'StringOf', @category OUT, 'response.result.balance_sheet.data[i].category'
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'response.result.balance_sheet.data[i].accounts'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @account_name OUT, 'response.result.balance_sheet.data[i].accounts[j].account_name'
EXEC sp_OAMethod @jResp, 'StringOf', @account_number OUT, 'response.result.balance_sheet.data[i].accounts[j].account_number'
SELECT @k = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'response.result.balance_sheet.data[i].accounts[j].balances'
WHILE @k < @count_k
BEGIN
EXEC sp_OASetProperty @jResp, 'K', @k
EXEC sp_OAMethod @jResp, 'StringOf', @balanceAmount OUT, 'response.result.balance_sheet.data[i].accounts[j].balances[k].balance.amount'
EXEC sp_OAMethod @jResp, 'StringOf', @balanceCode OUT, 'response.result.balance_sheet.data[i].accounts[j].balances[k].balance.code'
EXEC sp_OAMethod @jResp, 'StringOf', @date OUT, 'response.result.balance_sheet.data[i].accounts[j].balances[k].date'
SELECT @k = @k + 1
END
SELECT @k = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_k OUT, 'response.result.balance_sheet.data[i].accounts[j].sub_accounts'
WHILE @k < @count_k
BEGIN
EXEC sp_OASetProperty @jResp, 'K', @k
EXEC sp_OAMethod @jResp, 'StringOf', @sub_account_name OUT, 'response.result.balance_sheet.data[i].accounts[j].sub_accounts[k].sub_account_name'
EXEC sp_OAMethod @jResp, 'StringOf', @sub_account_number OUT, 'response.result.balance_sheet.data[i].accounts[j].sub_accounts[k].sub_account_number'
EXEC sp_OAMethod @jResp, 'ObjectOf', @json1 OUT, 'response.result.balance_sheet.data[i].accounts[j].sub_accounts[k]'
SELECT @i1 = 0
EXEC sp_OAMethod @json1, 'SizeOfArray', @count_i1 OUT, 'balances'
WHILE @i1 < @count_i1
BEGIN
EXEC sp_OASetProperty @json1, 'I', @i1
EXEC sp_OAMethod @json1, 'StringOf', @balanceAmount OUT, 'balances[i].balance.amount'
EXEC sp_OAMethod @json1, 'StringOf', @balanceCode OUT, 'balances[i].balance.code'
EXEC sp_OAMethod @json1, 'StringOf', @date OUT, 'balances[i].date'
SELECT @i1 = @i1 + 1
END
EXEC @hr = sp_OADestroy @json1
SELECT @k = @k + 1
END
SELECT @j = @j + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'response.result.balance_sheet.data[i].balances'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
EXEC sp_OAMethod @jResp, 'StringOf', @balanceAmount OUT, 'response.result.balance_sheet.data[i].balances[j].balance.amount'
EXEC sp_OAMethod @jResp, 'StringOf', @balanceCode OUT, 'response.result.balance_sheet.data[i].balances[j].balance.code'
EXEC sp_OAMethod @jResp, 'StringOf', @date OUT, 'response.result.balance_sheet.data[i].balances[j].date'
SELECT @j = @j + 1
END
SELECT @i = @i + 1
END
SELECT @i = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'response.result.balance_sheet.dates'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'response.result.balance_sheet.dates[i]'
SELECT @i = @i + 1
END
SELECT @i = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'response.result.balance_sheet.liabilities_and_equity_total'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @balanceAmount OUT, 'response.result.balance_sheet.liabilities_and_equity_total[i].balance.amount'
EXEC sp_OAMethod @jResp, 'StringOf', @balanceCode OUT, 'response.result.balance_sheet.liabilities_and_equity_total[i].balance.code'
EXEC sp_OAMethod @jResp, 'StringOf', @date OUT, 'response.result.balance_sheet.liabilities_and_equity_total[i].date'
SELECT @i = @i + 1
END
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
END
GO
Curl Command
curl -G -d "dates[]=2019-04-19"
-d "dates[]=2019-04-25"
-d "currency_code=USD"
-H "Authorization: Bearer <access_token>"
https://api.freshbooks.com/accounting/account/{{accountId}}/reports/accounting/balance_sheet
Postman Collection Item JSON
{
"name": "Balance Sheet",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "https://api.freshbooks.com/accounting/account/{{accountId}}/reports/accounting/balance_sheet?dates[]=2019-04-19&dates[]=2019-04-25¤cy_code=USD",
"protocol": "https",
"host": [
"api",
"freshbooks",
"com"
],
"path": [
"accounting",
"account",
"{{accountId}}",
"reports",
"accounting",
"balance_sheet"
],
"query": [
{
"key": "dates[]",
"value": "2019-04-19",
"description": "will need to explain [] as anything before this date"
},
{
"key": "dates[]",
"value": "2019-04-25"
},
{
"key": "currency_code",
"value": "USD"
}
]
},
"description": "A snapshot of your company's assets, liabilities and equity at any given point in time."
},
"response": [
{
"name": "Balance Sheet",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "https://api.freshbooks.com/accounting/account/{{accountId}}/reports/accounting/balance_sheet?dates[]=2019-04-19&dates[]=2019-04-25¤cy_code=USD",
"protocol": "https",
"host": [
"api",
"freshbooks",
"com"
],
"path": [
"accounting",
"account",
"{{accountId}}",
"reports",
"accounting",
"balance_sheet"
],
"query": [
{
"key": "dates[]",
"value": "2019-04-19",
"description": "will need to explain [] as anything before this date"
},
{
"key": "dates[]",
"value": "2019-04-25"
},
{
"key": "currency_code",
"value": "USD"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "nginx"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "X-NewRelic-App-Data",
"value": "PxQBWV5TCBABVlVSAwEOVlcTGhE1AwE2QgNWEVlbQFtcCxYnRA9QFg1ZWU4DFVdfRgFPCkNFR0gWVEZcEBIQWFEBWw1NVkBbXQJLBEEOQRYXFBtRSlMWAwlcU1QFAgZWVAMOA1VQUlUcTwlOGg5VB1dVAAMBUlEHUgBRBwdBFFVRCBIHag=="
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "Expires",
"value": "Tue, 24 Apr 2018 18:31:43 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": "Accept-Ranges",
"value": "bytes"
},
{
"key": "Accept-Ranges",
"value": "bytes"
},
{
"key": "Age",
"value": "0"
},
{
"key": "Age",
"value": "0"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
},
{
"key": "Date",
"value": "Wed, 24 Apr 2019 18:31:43 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 \"balance_sheet\": {\n \"assets_total\": [\n {\n \"balance\": {\n \"amount\": \"-1380.98\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"10345.56\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"company_name\": \"Postman Sandbox\",\n \"currency_code\": \"USD\",\n \"data\": [\n {\n \"account_type\": \"asset\",\n \"accounts\": [\n {\n \"account_name\": \"Cash\",\n \"account_number\": \"1000\",\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"5744.02\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"6310.56\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_accounts\": [\n {\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"5744.02\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"6310.56\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_account_name\": \"Petty Cash\",\n \"sub_account_number\": \"1\"\n }\n ]\n },\n {\n \"account_name\": \"Accounts Receivable\",\n \"account_number\": \"1200\",\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"-7125.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"4035.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_accounts\": [\n {\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"-7125.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"4435.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_account_name\": \"Accounts Receivable\",\n \"sub_account_number\": \"1\"\n },\n {\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"0.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"-400.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_account_name\": \"Customer Deposits\",\n \"sub_account_number\": \"2\"\n }\n ]\n }\n ],\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"-1380.98\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"10345.56\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"category\": \"current\"\n },\n {\n \"account_type\": \"liability\",\n \"accounts\": [\n {\n \"account_name\": \"Taxes Payable\",\n \"account_number\": \"2001\",\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"205.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"211.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_accounts\": [\n {\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"205.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"211.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_account_name\": \"HST\",\n \"sub_account_number\": \"1\"\n }\n ]\n },\n {\n \"account_name\": \"Customer Credit\",\n \"account_number\": \"2003\",\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"3120.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"3120.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_accounts\": [\n {\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"3120.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"3120.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_account_name\": \"Customer Credit\",\n \"sub_account_number\": \"1\"\n }\n ]\n }\n ],\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"3325.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"3331.00\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"category\": \"current\"\n },\n {\n \"account_type\": \"equity\",\n \"accounts\": [\n {\n \"account_name\": \"Net Income\",\n \"account_number\": null,\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"-4705.98\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"7014.56\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"sub_accounts\": []\n }\n ],\n \"balances\": [\n {\n \"balance\": {\n \"amount\": \"-4705.98\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"7014.56\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ],\n \"category\": null\n }\n ],\n \"dates\": [\n \"2019-04-19\",\n \"2019-04-25\"\n ],\n \"download_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50aWQiOiJ3a01kMmciLCJ1c2VyaWQiOjEsImNvbnRhY3RpZCI6LTEsImxldmVsIjozLCJ0eXBlIjoicmVwb3J0Iiwib2JqZWN0aWQiOiJiYWxhbmNlX3NoZWV0IiwicGFyYW1zIjp7ImRhdGVzIjpbIjIwMTktMDQtMTkiLCIyMDE5LTA0LTI1Il0sImN1cnJlbmN5X2NvZGUiOiJVU0QifSwiaWF0IjoxNTU2MTMwNzAzLCJleHAiOjE1NTg3MjI3MDN9.FziuxTK2nbj1xfrefdPjL9J7_a5tFjBneqTp5juy4D0\",\n \"liabilities_and_equity_total\": [\n {\n \"balance\": {\n \"amount\": \"-1380.98\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-19\"\n },\n {\n \"balance\": {\n \"amount\": \"10345.56\",\n \"code\": \"USD\"\n },\n \"date\": \"2019-04-25\"\n }\n ]\n }\n }\n }\n}"
}
]
}