Chilkat Online Tools

SQL Server / New FreshBooks / Item Sales

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
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    DECLARE @queryParams int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @queryParams OUT

    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'start_date', '2019-01-01'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'end_date', '2019-12-31'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'currency_code', 'USD'
    EXEC sp_OAMethod @queryParams, 'UpdateInt', @success OUT, 'clientids', 31006
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'item_names', 'Fanny Pack'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'statusids', 'paid'

    -- 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/wkMd2g/reports/accounting/item_sales', @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
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody

    DECLARE @jResp int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.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


    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 "start_date=2019-01-01"
	-d "end_date=2019-12-31"
	-d "currency_code=USD"
	-d "clientids=31006"
	-d "item_names=Fanny%20Pack"
	-d "statusids=paid"
	-H "Authorization: Bearer <access_token>"
https://api.freshbooks.com/accounting/account/wkMd2g/reports/accounting/item_sales

Postman Collection Item JSON

{
  "name": "Item Sales",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "https://api.freshbooks.com/accounting/account/wkMd2g/reports/accounting/item_sales?start_date=2019-01-01&end_date=2019-12-31&currency_code=USD&clientids=31006&item_names=Fanny Pack&statusids=paid",
      "protocol": "https",
      "host": [
        "api",
        "freshbooks",
        "com"
      ],
      "path": [
        "accounting",
        "account",
        "wkMd2g",
        "reports",
        "accounting",
        "item_sales"
      ],
      "query": [
        {
          "key": "start_date",
          "value": "2019-01-01",
          "description": "created during or after the given date i.e. `2019-01-01`"
        },
        {
          "key": "end_date",
          "value": "2019-12-31",
          "description": "created during or before the given date i.e. `2019-12-31`"
        },
        {
          "key": "currency_code",
          "value": "USD"
        },
        {
          "key": "clientids",
          "value": "31006"
        },
        {
          "key": "item_names",
          "value": "Fanny Pack"
        },
        {
          "key": "statusids",
          "value": "paid"
        }
      ]
    },
    "description": "See how much money you're making from each item to sell."
  },
  "response": [
    {
      "name": "Item Sales",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "https://api.freshbooks.com/accounting/account/wkMd2g/reports/accounting/item_sales?start_date=2019-01-01&end_date=2019-12-31&currency_code=USD&clientids=31006&item_names=Fanny Pack&statusids=paid",
          "protocol": "https",
          "host": [
            "api",
            "freshbooks",
            "com"
          ],
          "path": [
            "accounting",
            "account",
            "wkMd2g",
            "reports",
            "accounting",
            "item_sales"
          ],
          "query": [
            {
              "key": "start_date",
              "value": "2019-01-01",
              "description": "created during or after the given date i.e. `2019-01-01`"
            },
            {
              "key": "end_date",
              "value": "2019-12-31",
              "description": "created during or before the given date i.e. `2019-12-31`"
            },
            {
              "key": "currency_code",
              "value": "USD"
            },
            {
              "key": "clientids",
              "value": "31006"
            },
            {
              "key": "item_names",
              "value": "Fanny Pack"
            },
            {
              "key": "statusids",
              "value": "paid"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Server",
          "value": "nginx"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        },
        {
          "key": "X-NewRelic-App-Data",
          "value": "PxQBWV5TCBABVlVSAwEOVlcTGhE1AwE2QgNWEVlbQFtcCxYnRA9QFg1ZWU4DFVdfRgFPCkNFR0gWVEZcEBIQWFEBWw1NVkBbXQJLBEEOQRYXFBtRSlMWAgBTU1UDAQJTUAkGCldRU1EcTwlOGgkMBVJTXVZUUQdbUQAEVF9BFFVRCBIHag=="
        },
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "Expires",
          "value": "Tue, 24 Apr 2018 18:30:47 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:30:47 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            \"item_sales\": {\n                \"clientids\": [],\n                \"company_name\": \"Postman Sandbox\",\n                \"currency_code\": \"USD\",\n                \"download_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50aWQiOiJ3a01kMmciLCJ1c2VyaWQiOjEsImNvbnRhY3RpZCI6LTEsImxldmVsIjozLCJ0eXBlIjoicmVwb3J0Iiwib2JqZWN0aWQiOiJpdGVtX3NhbGVzIiwicGFyYW1zIjp7InN0YXJ0X2RhdGUiOiIyMDE5LTAxLTAxIiwiZW5kX2RhdGUiOiIyMDE5LTEyLTMxIiwiY3VycmVuY3lfY29kZSI6IlVTRCIsImNsaWVudGlkcyI6bnVsbCwic3RhdHVzaWRzIjpbXSwiaXRlbV9uYW1lcyI6W119LCJpYXQiOjE1NTYxMzA2NDcsImV4cCI6MTU1ODcyMjY0N30.h4AnC-DagiYu5Qp-qdFfa7DD5lZVJmYbUEnWTbuKoQc\",\n                \"end_date\": \"2019-12-31\",\n                \"item_names\": [],\n                \"items\": [\n                    {\n                        \"invoices\": [\n                            {\n                                \"amount\": {\n                                    \"amount\": \"2800.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000005\",\n                                \"invoiceid\": 26398,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"2800.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"overdue\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"2800.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000008\",\n                                \"invoiceid\": 28006,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"2800.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"draft\"\n                            }\n                        ],\n                        \"name\": \"Acting Services\",\n                        \"total\": {\n                            \"amount\": \"5600.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_discount\": {\n                            \"amount\": \"0.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_qty\": \"2\"\n                    },\n                    {\n                        \"invoices\": [\n                            {\n                                \"amount\": {\n                                    \"amount\": \"100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Beaufort\",\n                                \"invoice_number\": \"0000010\",\n                                \"invoiceid\": 29610,\n                                \"lname\": \"Michelin\",\n                                \"organization\": \"Witting, McDermott and Gutmann\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"draft\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Tarra\",\n                                \"invoice_number\": \"0000011\",\n                                \"invoiceid\": 29616,\n                                \"lname\": \"Arblaster\",\n                                \"organization\": \"Hermann-Jast\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"draft\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000012\",\n                                \"invoiceid\": 29618,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"overdue\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000013\",\n                                \"invoiceid\": 34420,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"paid\"\n                            }\n                        ],\n                        \"name\": \"Belay Device\",\n                        \"total\": {\n                            \"amount\": \"400.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_discount\": {\n                            \"amount\": \"0.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_qty\": \"4\"\n                    },\n                    {\n                        \"invoices\": [\n                            {\n                                \"amount\": {\n                                    \"amount\": \"500.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000005\",\n                                \"invoiceid\": 26398,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"500.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"overdue\"\n                            }\n                        ],\n                        \"name\": \"Celebration\",\n                        \"total\": {\n                            \"amount\": \"500.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_discount\": {\n                            \"amount\": \"0.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_qty\": \"1\"\n                    },\n                    {\n                        \"invoices\": [\n                            {\n                                \"amount\": {\n                                    \"amount\": \"500.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000008\",\n                                \"invoiceid\": 28006,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"500.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"draft\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"80.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Beaufort\",\n                                \"invoice_number\": \"0000010\",\n                                \"invoiceid\": 29610,\n                                \"lname\": \"Michelin\",\n                                \"organization\": \"Witting, McDermott and Gutmann\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"80.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"draft\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"80.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Tarra\",\n                                \"invoice_number\": \"0000011\",\n                                \"invoiceid\": 29616,\n                                \"lname\": \"Arblaster\",\n                                \"organization\": \"Hermann-Jast\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"80.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"draft\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"80.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000012\",\n                                \"invoiceid\": 29618,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"80.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"overdue\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"80.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000013\",\n                                \"invoiceid\": 34420,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"80.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"paid\"\n                            }\n                        ],\n                        \"name\": \"Climbing Helmet\",\n                        \"total\": {\n                            \"amount\": \"820.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_discount\": {\n                            \"amount\": \"0.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_qty\": \"5\"\n                    },\n                    {\n                        \"invoices\": [\n                            {\n                                \"amount\": {\n                                    \"amount\": \"500.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-18\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000001\",\n                                \"invoiceid\": 24042,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"500.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"sent\"\n                            }\n                        ],\n                        \"name\": \"Computer Hardware\",\n                        \"total\": {\n                            \"amount\": \"500.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_discount\": {\n                            \"amount\": \"0.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_qty\": \"1\"\n                    },\n                    {\n                        \"invoices\": [\n                            {\n                                \"amount\": {\n                                    \"amount\": \"500.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-18\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000001\",\n                                \"invoiceid\": 24042,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"500.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"sent\"\n                            }\n                        ],\n                        \"name\": \"Computer Hardware 1\",\n                        \"total\": {\n                            \"amount\": \"500.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_discount\": {\n                            \"amount\": \"0.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_qty\": \"1\"\n                    },\n                    {\n                        \"invoices\": [\n                            {\n                                \"amount\": {\n                                    \"amount\": \"50.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-19\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Myrta\",\n                                \"invoice_number\": \"0000003\",\n                                \"invoiceid\": 26250,\n                                \"lname\": \"Westhofer\",\n                                \"organization\": \"Prosacco Group\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"50.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"paid\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"50.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Myrta\",\n                                \"invoice_number\": \"0000007\",\n                                \"invoiceid\": 28002,\n                                \"lname\": \"Westhofer\",\n                                \"organization\": \"Prosacco Group\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"50.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"draft\"\n                            }\n                        ],\n                        \"name\": \"Fanny Pack\",\n                        \"total\": {\n                            \"amount\": \"100.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_discount\": {\n                            \"amount\": \"0.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_qty\": \"2\"\n                    },\n                    {\n                        \"invoices\": [\n                            {\n                                \"amount\": {\n                                    \"amount\": \"5000.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000002\",\n                                \"invoiceid\": 24068,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"5000.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"paid\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"4100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000004\",\n                                \"invoiceid\": 26384,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"4100.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"draft\"\n                            }\n                        ],\n                        \"name\": \"Paperwork\",\n                        \"total\": {\n                            \"amount\": \"9100.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_discount\": {\n                            \"amount\": \"0.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_qty\": \"2\"\n                    },\n                    {\n                        \"invoices\": [\n                            {\n                                \"amount\": {\n                                    \"amount\": \"3000.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000002\",\n                                \"invoiceid\": 24068,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"3000.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"paid\"\n                            },\n                            {\n                                \"amount\": {\n                                    \"amount\": \"2800.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"create_date\": \"2019-04-20\",\n                                \"discount\": {\n                                    \"amount\": \"0.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"fname\": \"Nicolas\",\n                                \"invoice_number\": \"0000004\",\n                                \"invoiceid\": 26384,\n                                \"lname\": \"one\",\n                                \"organization\": \"first company\",\n                                \"qty\": \"1\",\n                                \"unit_cost\": {\n                                    \"amount\": \"2800.00\",\n                                    \"code\": \"USD\"\n                                },\n                                \"v3_status\": \"draft\"\n                            }\n                        ],\n                        \"name\": \"TV Ads\",\n                        \"total\": {\n                            \"amount\": \"5800.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_discount\": {\n                            \"amount\": \"0.00\",\n                            \"code\": \"USD\"\n                        },\n                        \"total_qty\": \"2\"\n                    }\n                ],\n                \"start_date\": \"2019-01-01\",\n                \"statusids\": [],\n                \"total\": {\n                    \"amount\": \"23320.00\",\n                    \"code\": \"USD\"\n                },\n                \"total_discount\": {\n                    \"amount\": \"0.00\",\n                    \"code\": \"USD\"\n                },\n                \"total_qty\": \"20\"\n            }\n        }\n    }\n}"
    }
  ]
}