Chilkat Online Tools

SQL Server / Belvo API Docs / Retrieve

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

    EXEC sp_OASetProperty @http, 'BasicAuth', 1
    EXEC sp_OASetProperty @http, 'Login', '{{secretId}}'
    EXEC sp_OASetProperty @http, 'Password', '{{secretPassword}}'

    -- Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    -- The following JSON is sent in the request body.

    -- {
    --   "date_from": "2020-01-01",
    --   "date_to": "2020-02-01",
    --   "link": "d4617561-1c01-4b2f-83b6-a594f7b3bc57",
    --   "type": "OUTFLOW",
    --   "attach_xml": false,
    --   "save_data": true
    -- }

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

    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'date_from', '2020-01-01'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'date_to', '2020-02-01'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'link', 'd4617561-1c01-4b2f-83b6-a594f7b3bc57'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'type', 'OUTFLOW'
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'attach_xml', 0
    EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'save_data', 1

    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Content-Type', 'application/json'

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'PostJson3', @resp OUT, 'https://domain.com/api/invoices/', 'application/json', @json
    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 @json
        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 @jarrResp int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonArray', @jarrResp OUT

    EXEC sp_OAMethod @jarrResp, 'LoadSb', @success OUT, @sbResponseBody
    EXEC sp_OASetProperty @jarrResp, 'EmitCompact', 0


    PRINT 'Response Body:'
    EXEC sp_OAMethod @jarrResp, '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 @json
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jarrResp
        RETURN
      END
    EXEC @hr = sp_OADestroy @resp

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

    -- [
    --   {
    --     "link": "<string>",
    --     "collected_at": "<dateTime>",
    --     "invoice_identification": "<string>",
    --     "invoice_date": "<date>",
    --     "status": "<string>",
    --     "invoice_type": "<string>",
    --     "type": "incididunt exercitation anim dolore",
    --     "sender_id": "<string>",
    --     "sender_name": "<string>",
    --     "receiver_id": "<string>",
    --     "receiver_name": "<string>",
    --     "cancelation_status": "<string>",
    --     "cancelation_update_date": "<date>",
    --     "certification_date": "<date>",
    --     "certification_authority": "<string>",
    --     "payment_type": "<string>",
    --     "payment_type_description": "<string>",
    --     "payment_method": "<string>",
    --     "payment_method_description": "<string>",
    --     "usage": "<string>",
    --     "version": "<string>",
    --     "place_of_issue": "<string>",
    --     "invoice_details": [
    --       {
    --         "description": "<string>",
    --         "product_identification": "<string>",
    --         "quantity": "<integer>",
    --         "unit_code": "<string>",
    --         "unit_description": "<string>",
    --         "unit_amount": "<number>",
    --         "pre_tax_amount": "<number>",
    --         "tax_percentage": "<number>",
    --         "tax_amount": "<number>",
    --         "total_amount": "<number>",
    --         "retained_taxes": [
    --           {
    --             "collected_at": "<dateTime>",
    --             "tax": "<string>",
    --             "tax_percentage": "<number>",
    --             "retained_tax_amount": "<number>"
    --           },
    --           {
    --             "collected_at": "<dateTime>",
    --             "tax": "<string>",
    --             "tax_percentage": "<number>",
    --             "retained_tax_amount": "<number>"
    --           }
    --         ],
    --         "collected_at": "<dateTime>"
    --       },
    --       {
    --         "description": "<string>",
    --         "product_identification": "<string>",
    --         "quantity": "<integer>",
    --         "unit_code": "<string>",
    --         "unit_description": "<string>",
    --         "unit_amount": "<number>",
    --         "pre_tax_amount": "<number>",
    --         "tax_percentage": "<number>",
    --         "tax_amount": "<number>",
    --         "total_amount": "<number>",
    --         "retained_taxes": [
    --           {
    --             "collected_at": "<dateTime>",
    --             "tax": "<string>",
    --             "tax_percentage": "<number>",
    --             "retained_tax_amount": "<number>"
    --           },
    --           {
    --             "collected_at": "<dateTime>",
    --             "tax": "<string>",
    --             "tax_percentage": "<number>",
    --             "retained_tax_amount": "<number>"
    --           }
    --         ],
    --         "collected_at": "<dateTime>"
    --       }
    --     ],
    --     "currency": "<string>",
    --     "subtotal_amount": "<number>",
    --     "exchange_rate": "<number>",
    --     "tax_amount": "<number>",
    --     "discount_amount": "<number>",
    --     "total_amount": "<number>",
    --     "payments": [
    --       {
    --         "date": "<string>",
    --         "payment_type": "<string>",
    --         "currency": "<string>",
    --         "exchange_rate": "<string>",
    --         "amount": "<float>",
    --         "operation_number": "<string>",
    --         "beneficiary_rfc": "<string>",
    --         "beneficiary_account_number": "<string>",
    --         "payer_rfc": "<string>",
    --         "payer_account_number": "<string>",
    --         "payer_bank_name": "<string>",
    --         "related_documents": [
    --           {
    --             "invoice_identification": "<string>",
    --             "currency": "<string>",
    --             "payment_method": "<string>",
    --             "partiality_number": "<integer>",
    --             "previous_balance": "<float>",
    --             "amount_paid": "<float>",
    --             "outstanding_balance": "<float>"
    --           },
    --           {
    --             "invoice_identification": "<string>",
    --             "currency": "<string>",
    --             "payment_method": "<string>",
    --             "partiality_number": "<integer>",
    --             "previous_balance": "<float>",
    --             "amount_paid": "<float>",
    --             "outstanding_balance": "<float>"
    --           }
    --         ]
    --       },
    --       {
    --         "date": "<string>",
    --         "payment_type": "<string>",
    --         "currency": "<string>",
    --         "exchange_rate": "<string>",
    --         "amount": "<float>",
    --         "operation_number": "<string>",
    --         "beneficiary_rfc": "<string>",
    --         "beneficiary_account_number": "<string>",
    --         "payer_rfc": "<string>",
    --         "payer_account_number": "<string>",
    --         "payer_bank_name": "<string>",
    --         "related_documents": [
    --           {
    --             "invoice_identification": "<string>",
    --             "currency": "<string>",
    --             "payment_method": "<string>",
    --             "partiality_number": "<integer>",
    --             "previous_balance": "<float>",
    --             "amount_paid": "<float>",
    --             "outstanding_balance": "<float>"
    --           },
    --           {
    --             "invoice_identification": "<string>",
    --             "currency": "<string>",
    --             "payment_method": "<string>",
    --             "partiality_number": "<integer>",
    --             "previous_balance": "<float>",
    --             "amount_paid": "<float>",
    --             "outstanding_balance": "<float>"
    --           }
    --         ]
    --       }
    --     ],
    --     "payroll": {
    --       "days": "<number>",
    --       "type": "<string>",
    --       "amount": "<number>",
    --       "version": "<string>",
    --       "date_from": "<date>",
    --       "date_to": "<date>",
    --       "collected_at": "<dateTime>",
    --       "payment_date": "<date>"
    --     },
    --     "xml": "<string>",
    --     "warnings": {
    --       "code": "<string>",
    --       "message": "<string>"
    --     }
    --   },
    --   {
    --     "link": "<string>",
    --     "collected_at": "<dateTime>",
    --     "invoice_identification": "<string>",
    --     "invoice_date": "<date>",
    --     "status": "<string>",
    --     "invoice_type": "<string>",
    --     "type": "non in do qui",
    --     "sender_id": "<string>",
    --     "sender_name": "<string>",
    --     "receiver_id": "<string>",
    --     "receiver_name": "<string>",
    --     "cancelation_status": "<string>",
    --     "cancelation_update_date": "<date>",
    --     "certification_date": "<date>",
    --     "certification_authority": "<string>",
    --     "payment_type": "<string>",
    --     "payment_type_description": "<string>",
    --     "payment_method": "<string>",
    --     "payment_method_description": "<string>",
    --     "usage": "<string>",
    --     "version": "<string>",
    --     "place_of_issue": "<string>",
    --     "invoice_details": [
    --       {
    --         "description": "<string>",
    --         "product_identification": "<string>",
    --         "quantity": "<integer>",
    --         "unit_code": "<string>",
    --         "unit_description": "<string>",
    --         "unit_amount": "<number>",
    --         "pre_tax_amount": "<number>",
    --         "tax_percentage": "<number>",
    --         "tax_amount": "<number>",
    --         "total_amount": "<number>",
    --         "retained_taxes": [
    --           {
    --             "collected_at": "<dateTime>",
    --             "tax": "<string>",
    --             "tax_percentage": "<number>",
    --             "retained_tax_amount": "<number>"
    --           },
    --           {
    --             "collected_at": "<dateTime>",
    --             "tax": "<string>",
    --             "tax_percentage": "<number>",
    --             "retained_tax_amount": "<number>"
    --           }
    --         ],
    --         "collected_at": "<dateTime>"
    --       },
    --       {
    --         "description": "<string>",
    --         "product_identification": "<string>",
    --         "quantity": "<integer>",
    --         "unit_code": "<string>",
    --         "unit_description": "<string>",
    --         "unit_amount": "<number>",
    --         "pre_tax_amount": "<number>",
    --         "tax_percentage": "<number>",
    --         "tax_amount": "<number>",
    --         "total_amount": "<number>",
    --         "retained_taxes": [
    --           {
    --             "collected_at": "<dateTime>",
    --             "tax": "<string>",
    --             "tax_percentage": "<number>",
    --             "retained_tax_amount": "<number>"
    --           },
    --           {
    --             "collected_at": "<dateTime>",
    --             "tax": "<string>",
    --             "tax_percentage": "<number>",
    --             "retained_tax_amount": "<number>"
    --           }
    --         ],
    --         "collected_at": "<dateTime>"
    --       }
    --     ],
    --     "currency": "<string>",
    --     "subtotal_amount": "<number>",
    --     "exchange_rate": "<number>",
    --     "tax_amount": "<number>",
    --     "discount_amount": "<number>",
    --     "total_amount": "<number>",
    --     "payments": [
    --       {
    --         "date": "<string>",
    --         "payment_type": "<string>",
    --         "currency": "<string>",
    --         "exchange_rate": "<string>",
    --         "amount": "<float>",
    --         "operation_number": "<string>",
    --         "beneficiary_rfc": "<string>",
    --         "beneficiary_account_number": "<string>",
    --         "payer_rfc": "<string>",
    --         "payer_account_number": "<string>",
    --         "payer_bank_name": "<string>",
    --         "related_documents": [
    --           {
    --             "invoice_identification": "<string>",
    --             "currency": "<string>",
    --             "payment_method": "<string>",
    --             "partiality_number": "<integer>",
    --             "previous_balance": "<float>",
    --             "amount_paid": "<float>",
    --             "outstanding_balance": "<float>"
    --           },
    --           {
    --             "invoice_identification": "<string>",
    --             "currency": "<string>",
    --             "payment_method": "<string>",
    --             "partiality_number": "<integer>",
    --             "previous_balance": "<float>",
    --             "amount_paid": "<float>",
    --             "outstanding_balance": "<float>"
    --           }
    --         ]
    --       },
    --       {
    --         "date": "<string>",
    --         "payment_type": "<string>",
    --         "currency": "<string>",
    --         "exchange_rate": "<string>",
    --         "amount": "<float>",
    --         "operation_number": "<string>",
    --         "beneficiary_rfc": "<string>",
    --         "beneficiary_account_number": "<string>",
    --         "payer_rfc": "<string>",
    --         "payer_account_number": "<string>",
    --         "payer_bank_name": "<string>",
    --         "related_documents": [
    --           {
    --             "invoice_identification": "<string>",
    --             "currency": "<string>",
    --             "payment_method": "<string>",
    --             "partiality_number": "<integer>",
    --             "previous_balance": "<float>",
    --             "amount_paid": "<float>",
    --             "outstanding_balance": "<float>"
    --           },
    --           {
    --             "invoice_identification": "<string>",
    --             "currency": "<string>",
    --             "payment_method": "<string>",
    --             "partiality_number": "<integer>",
    --             "previous_balance": "<float>",
    --             "amount_paid": "<float>",
    --             "outstanding_balance": "<float>"
    --           }
    --         ]
    --       }
    --     ],
    --     "payroll": {
    --       "days": "<number>",
    --       "type": "<string>",
    --       "amount": "<number>",
    --       "version": "<string>",
    --       "date_from": "<date>",
    --       "date_to": "<date>",
    --       "collected_at": "<dateTime>",
    --       "payment_date": "<date>"
    --     },
    --     "xml": "<string>",
    --     "warnings": {
    --       "code": "<string>",
    --       "message": "<string>"
    --     }
    --   }
    -- ]

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

    DECLARE @Date_from int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.DtObj', @Date_from OUT

    DECLARE @Date_to int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.DtObj', @Date_to OUT

    DECLARE @json int

    DECLARE @link nvarchar(4000)

    DECLARE @collected_at nvarchar(4000)

    DECLARE @invoice_identification nvarchar(4000)

    DECLARE @invoice_date nvarchar(4000)

    DECLARE @status nvarchar(4000)

    DECLARE @invoice_type nvarchar(4000)

    DECLARE @v_type nvarchar(4000)

    DECLARE @sender_id nvarchar(4000)

    DECLARE @sender_name nvarchar(4000)

    DECLARE @receiver_id nvarchar(4000)

    DECLARE @receiver_name nvarchar(4000)

    DECLARE @cancelation_status nvarchar(4000)

    DECLARE @cancelation_update_date nvarchar(4000)

    DECLARE @certification_date nvarchar(4000)

    DECLARE @certification_authority nvarchar(4000)

    DECLARE @payment_type nvarchar(4000)

    DECLARE @payment_type_description nvarchar(4000)

    DECLARE @payment_method nvarchar(4000)

    DECLARE @payment_method_description nvarchar(4000)

    DECLARE @usage nvarchar(4000)

    DECLARE @version nvarchar(4000)

    DECLARE @place_of_issue nvarchar(4000)

    DECLARE @v_currency nvarchar(4000)

    DECLARE @subtotal_amount nvarchar(4000)

    DECLARE @exchange_rate nvarchar(4000)

    DECLARE @tax_amount nvarchar(4000)

    DECLARE @discount_amount nvarchar(4000)

    DECLARE @total_amount nvarchar(4000)

    DECLARE @Days nvarchar(4000)

    DECLARE @v_Type nvarchar(4000)

    DECLARE @Amount nvarchar(4000)

    DECLARE @Version nvarchar(4000)

    DECLARE @Collected_at nvarchar(4000)

    DECLARE @Payment_date nvarchar(4000)

    DECLARE @xml nvarchar(4000)

    DECLARE @Code nvarchar(4000)

    DECLARE @Message nvarchar(4000)

    DECLARE @j int

    DECLARE @count_j int

    DECLARE @description nvarchar(4000)

    DECLARE @product_identification nvarchar(4000)

    DECLARE @quantity nvarchar(4000)

    DECLARE @unit_code nvarchar(4000)

    DECLARE @unit_description nvarchar(4000)

    DECLARE @unit_amount nvarchar(4000)

    DECLARE @pre_tax_amount nvarchar(4000)

    DECLARE @tax_percentage nvarchar(4000)

    DECLARE @k int

    DECLARE @count_k int

    DECLARE @tax nvarchar(4000)

    DECLARE @retained_tax_amount nvarchar(4000)

    DECLARE @date nvarchar(4000)

    DECLARE @amount nvarchar(4000)

    DECLARE @operation_number nvarchar(4000)

    DECLARE @beneficiary_rfc nvarchar(4000)

    DECLARE @beneficiary_account_number nvarchar(4000)

    DECLARE @payer_rfc nvarchar(4000)

    DECLARE @payer_account_number nvarchar(4000)

    DECLARE @payer_bank_name nvarchar(4000)

    DECLARE @partiality_number nvarchar(4000)

    DECLARE @previous_balance nvarchar(4000)

    DECLARE @amount_paid nvarchar(4000)

    DECLARE @outstanding_balance nvarchar(4000)

    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAGetProperty @jarrResp, 'Size', @count_i OUT
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OAMethod @jarrResp, 'ObjectAt', @json OUT, @i
        EXEC sp_OAMethod @json, 'StringOf', @link OUT, 'link'
        EXEC sp_OAMethod @json, 'StringOf', @collected_at OUT, 'collected_at'
        EXEC sp_OAMethod @json, 'StringOf', @invoice_identification OUT, 'invoice_identification'
        EXEC sp_OAMethod @json, 'StringOf', @invoice_date OUT, 'invoice_date'
        EXEC sp_OAMethod @json, 'StringOf', @status OUT, 'status'
        EXEC sp_OAMethod @json, 'StringOf', @invoice_type OUT, 'invoice_type'
        EXEC sp_OAMethod @json, 'StringOf', @v_type OUT, 'type'
        EXEC sp_OAMethod @json, 'StringOf', @sender_id OUT, 'sender_id'
        EXEC sp_OAMethod @json, 'StringOf', @sender_name OUT, 'sender_name'
        EXEC sp_OAMethod @json, 'StringOf', @receiver_id OUT, 'receiver_id'
        EXEC sp_OAMethod @json, 'StringOf', @receiver_name OUT, 'receiver_name'
        EXEC sp_OAMethod @json, 'StringOf', @cancelation_status OUT, 'cancelation_status'
        EXEC sp_OAMethod @json, 'StringOf', @cancelation_update_date OUT, 'cancelation_update_date'
        EXEC sp_OAMethod @json, 'StringOf', @certification_date OUT, 'certification_date'
        EXEC sp_OAMethod @json, 'StringOf', @certification_authority OUT, 'certification_authority'
        EXEC sp_OAMethod @json, 'StringOf', @payment_type OUT, 'payment_type'
        EXEC sp_OAMethod @json, 'StringOf', @payment_type_description OUT, 'payment_type_description'
        EXEC sp_OAMethod @json, 'StringOf', @payment_method OUT, 'payment_method'
        EXEC sp_OAMethod @json, 'StringOf', @payment_method_description OUT, 'payment_method_description'
        EXEC sp_OAMethod @json, 'StringOf', @usage OUT, 'usage'
        EXEC sp_OAMethod @json, 'StringOf', @version OUT, 'version'
        EXEC sp_OAMethod @json, 'StringOf', @place_of_issue OUT, 'place_of_issue'
        EXEC sp_OAMethod @json, 'StringOf', @v_currency OUT, 'currency'
        EXEC sp_OAMethod @json, 'StringOf', @subtotal_amount OUT, 'subtotal_amount'
        EXEC sp_OAMethod @json, 'StringOf', @exchange_rate OUT, 'exchange_rate'
        EXEC sp_OAMethod @json, 'StringOf', @tax_amount OUT, 'tax_amount'
        EXEC sp_OAMethod @json, 'StringOf', @discount_amount OUT, 'discount_amount'
        EXEC sp_OAMethod @json, 'StringOf', @total_amount OUT, 'total_amount'
        EXEC sp_OAMethod @json, 'StringOf', @Days OUT, 'payroll.days'
        EXEC sp_OAMethod @json, 'StringOf', @v_Type OUT, 'payroll.type'
        EXEC sp_OAMethod @json, 'StringOf', @Amount OUT, 'payroll.amount'
        EXEC sp_OAMethod @json, 'StringOf', @Version OUT, 'payroll.version'
        EXEC sp_OAMethod @json, 'DtOf', @success OUT, 'payroll.date_from', 0, @Date_from
        EXEC sp_OAMethod @json, 'DtOf', @success OUT, 'payroll.date_to', 0, @Date_to
        EXEC sp_OAMethod @json, 'StringOf', @Collected_at OUT, 'payroll.collected_at'
        EXEC sp_OAMethod @json, 'StringOf', @Payment_date OUT, 'payroll.payment_date'
        EXEC sp_OAMethod @json, 'StringOf', @xml OUT, 'xml'
        EXEC sp_OAMethod @json, 'StringOf', @Code OUT, 'warnings.code'
        EXEC sp_OAMethod @json, 'StringOf', @Message OUT, 'warnings.message'
        SELECT @j = 0
        EXEC sp_OAMethod @json, 'SizeOfArray', @count_j OUT, 'invoice_details'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @json, 'J', @j
            EXEC sp_OAMethod @json, 'StringOf', @description OUT, 'invoice_details[j].description'
            EXEC sp_OAMethod @json, 'StringOf', @product_identification OUT, 'invoice_details[j].product_identification'
            EXEC sp_OAMethod @json, 'StringOf', @quantity OUT, 'invoice_details[j].quantity'
            EXEC sp_OAMethod @json, 'StringOf', @unit_code OUT, 'invoice_details[j].unit_code'
            EXEC sp_OAMethod @json, 'StringOf', @unit_description OUT, 'invoice_details[j].unit_description'
            EXEC sp_OAMethod @json, 'StringOf', @unit_amount OUT, 'invoice_details[j].unit_amount'
            EXEC sp_OAMethod @json, 'StringOf', @pre_tax_amount OUT, 'invoice_details[j].pre_tax_amount'
            EXEC sp_OAMethod @json, 'StringOf', @tax_percentage OUT, 'invoice_details[j].tax_percentage'
            EXEC sp_OAMethod @json, 'StringOf', @tax_amount OUT, 'invoice_details[j].tax_amount'
            EXEC sp_OAMethod @json, 'StringOf', @total_amount OUT, 'invoice_details[j].total_amount'
            EXEC sp_OAMethod @json, 'StringOf', @collected_at OUT, 'invoice_details[j].collected_at'
            SELECT @k = 0
            EXEC sp_OAMethod @json, 'SizeOfArray', @count_k OUT, 'invoice_details[j].retained_taxes'
            WHILE @k < @count_k
              BEGIN
                EXEC sp_OASetProperty @json, 'K', @k
                EXEC sp_OAMethod @json, 'StringOf', @collected_at OUT, 'invoice_details[j].retained_taxes[k].collected_at'
                EXEC sp_OAMethod @json, 'StringOf', @tax OUT, 'invoice_details[j].retained_taxes[k].tax'
                EXEC sp_OAMethod @json, 'StringOf', @tax_percentage OUT, 'invoice_details[j].retained_taxes[k].tax_percentage'
                EXEC sp_OAMethod @json, 'StringOf', @retained_tax_amount OUT, 'invoice_details[j].retained_taxes[k].retained_tax_amount'
                SELECT @k = @k + 1
              END
            SELECT @j = @j + 1
          END
        SELECT @j = 0
        EXEC sp_OAMethod @json, 'SizeOfArray', @count_j OUT, 'payments'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @json, 'J', @j
            EXEC sp_OAMethod @json, 'StringOf', @date OUT, 'payments[j].date'
            EXEC sp_OAMethod @json, 'StringOf', @payment_type OUT, 'payments[j].payment_type'
            EXEC sp_OAMethod @json, 'StringOf', @v_currency OUT, 'payments[j].currency'
            EXEC sp_OAMethod @json, 'StringOf', @exchange_rate OUT, 'payments[j].exchange_rate'
            EXEC sp_OAMethod @json, 'StringOf', @amount OUT, 'payments[j].amount'
            EXEC sp_OAMethod @json, 'StringOf', @operation_number OUT, 'payments[j].operation_number'
            EXEC sp_OAMethod @json, 'StringOf', @beneficiary_rfc OUT, 'payments[j].beneficiary_rfc'
            EXEC sp_OAMethod @json, 'StringOf', @beneficiary_account_number OUT, 'payments[j].beneficiary_account_number'
            EXEC sp_OAMethod @json, 'StringOf', @payer_rfc OUT, 'payments[j].payer_rfc'
            EXEC sp_OAMethod @json, 'StringOf', @payer_account_number OUT, 'payments[j].payer_account_number'
            EXEC sp_OAMethod @json, 'StringOf', @payer_bank_name OUT, 'payments[j].payer_bank_name'
            SELECT @k = 0
            EXEC sp_OAMethod @json, 'SizeOfArray', @count_k OUT, 'payments[j].related_documents'
            WHILE @k < @count_k
              BEGIN
                EXEC sp_OASetProperty @json, 'K', @k
                EXEC sp_OAMethod @json, 'StringOf', @invoice_identification OUT, 'payments[j].related_documents[k].invoice_identification'
                EXEC sp_OAMethod @json, 'StringOf', @v_currency OUT, 'payments[j].related_documents[k].currency'
                EXEC sp_OAMethod @json, 'StringOf', @payment_method OUT, 'payments[j].related_documents[k].payment_method'
                EXEC sp_OAMethod @json, 'StringOf', @partiality_number OUT, 'payments[j].related_documents[k].partiality_number'
                EXEC sp_OAMethod @json, 'StringOf', @previous_balance OUT, 'payments[j].related_documents[k].previous_balance'
                EXEC sp_OAMethod @json, 'StringOf', @amount_paid OUT, 'payments[j].related_documents[k].amount_paid'
                EXEC sp_OAMethod @json, 'StringOf', @outstanding_balance OUT, 'payments[j].related_documents[k].outstanding_balance'
                SELECT @k = @k + 1
              END
            SELECT @j = @j + 1
          END
        EXEC @hr = sp_OADestroy @json

        SELECT @i = @i + 1
      END

    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @json
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jarrResp
    EXEC @hr = sp_OADestroy @Date_from
    EXEC @hr = sp_OADestroy @Date_to


END
GO

Curl Command

curl -X POST
	-u '{{secretId}}:{{secretPassword}}'
	-H "Content-Type: application/json"
	-d '{
    "date_from": "2020-01-01",
    "date_to": "2020-02-01",
    "link": "d4617561-1c01-4b2f-83b6-a594f7b3bc57",
    "type": "OUTFLOW",
    "attach_xml": false,
    "save_data": true
}'
https://domain.com/api/invoices/

Postman Collection Item JSON

{
  "name": "Retrieve",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"date_from\": \"2020-01-01\",\n    \"date_to\": \"2020-02-01\",\n    \"link\": \"d4617561-1c01-4b2f-83b6-a594f7b3bc57\",\n    \"type\": \"OUTFLOW\",\n    \"attach_xml\": false,\n    \"save_data\": true\n}"
    },
    "url": {
      "raw": "{{baseUrl}}/api/invoices/",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "invoices",
        ""
      ]
    },
    "description": "Retrieve invoice information from a specific fiscal link.\n\nℹ️ You can ask for up to **one** year (365 days) of invoices per request. If you need invoices for more than one year, just make another request.\n"
  },
  "response": [
    {
      "name": "Ok (when save_data=false)",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"date_from\": \"<date>\",\n    \"date_to\": \"<date>\",\n    \"link\": \"<uuid>\",\n    \"type\": \"<string>\",\n    \"attach_xml\": false,\n    \"encryption_key\": \"<string>\",\n    \"save_data\": true\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/invoices",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "invoices"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "[\n\t{\n\t\t\"link\": \"<string>\",\n\t\t\"collected_at\": \"<dateTime>\",\n\t\t\"invoice_identification\": \"<string>\",\n\t\t\"invoice_date\": \"<date>\",\n\t\t\"status\": \"<string>\",\n\t\t\"invoice_type\": \"<string>\",\n\t\t\"type\": \"incididunt exercitation anim dolore\",\n\t\t\"sender_id\": \"<string>\",\n\t\t\"sender_name\": \"<string>\",\n\t\t\"receiver_id\": \"<string>\",\n\t\t\"receiver_name\": \"<string>\",\n\t\t\"cancelation_status\": \"<string>\",\n\t\t\"cancelation_update_date\": \"<date>\",\n\t\t\"certification_date\": \"<date>\",\n\t\t\"certification_authority\": \"<string>\",\n\t\t\"payment_type\": \"<string>\",\n\t\t\"payment_type_description\": \"<string>\",\n\t\t\"payment_method\": \"<string>\",\n\t\t\"payment_method_description\": \"<string>\",\n\t\t\"usage\": \"<string>\",\n\t\t\"version\": \"<string>\",\n\t\t\"place_of_issue\": \"<string>\",\n\t\t\"invoice_details\": [\n\t\t\t{\n\t\t\t\t\"description\": \"<string>\",\n\t\t\t\t\"product_identification\": \"<string>\",\n\t\t\t\t\"quantity\": \"<integer>\",\n\t\t\t\t\"unit_code\": \"<string>\",\n\t\t\t\t\"unit_description\": \"<string>\",\n\t\t\t\t\"unit_amount\": \"<number>\",\n\t\t\t\t\"pre_tax_amount\": \"<number>\",\n\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\"tax_amount\": \"<number>\",\n\t\t\t\t\"total_amount\": \"<number>\",\n\t\t\t\t\"retained_taxes\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"collected_at\": \"<dateTime>\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"description\": \"<string>\",\n\t\t\t\t\"product_identification\": \"<string>\",\n\t\t\t\t\"quantity\": \"<integer>\",\n\t\t\t\t\"unit_code\": \"<string>\",\n\t\t\t\t\"unit_description\": \"<string>\",\n\t\t\t\t\"unit_amount\": \"<number>\",\n\t\t\t\t\"pre_tax_amount\": \"<number>\",\n\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\"tax_amount\": \"<number>\",\n\t\t\t\t\"total_amount\": \"<number>\",\n\t\t\t\t\"retained_taxes\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"collected_at\": \"<dateTime>\"\n\t\t\t}\n\t\t],\n\t\t\"currency\": \"<string>\",\n\t\t\"subtotal_amount\": \"<number>\",\n\t\t\"exchange_rate\": \"<number>\",\n\t\t\"tax_amount\": \"<number>\",\n\t\t\"discount_amount\": \"<number>\",\n\t\t\"total_amount\": \"<number>\",\n\t\t\"payments\": [\n\t\t\t{\n\t\t\t\t\"date\": \"<string>\",\n\t\t\t\t\"payment_type\": \"<string>\",\n\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\"exchange_rate\": \"<string>\",\n\t\t\t\t\"amount\": \"<float>\",\n\t\t\t\t\"operation_number\": \"<string>\",\n\t\t\t\t\"beneficiary_rfc\": \"<string>\",\n\t\t\t\t\"beneficiary_account_number\": \"<string>\",\n\t\t\t\t\"payer_rfc\": \"<string>\",\n\t\t\t\t\"payer_account_number\": \"<string>\",\n\t\t\t\t\"payer_bank_name\": \"<string>\",\n\t\t\t\t\"related_documents\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"invoice_identification\": \"<string>\",\n\t\t\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\t\t\"payment_method\": \"<string>\",\n\t\t\t\t\t\t\"partiality_number\": \"<integer>\",\n\t\t\t\t\t\t\"previous_balance\": \"<float>\",\n\t\t\t\t\t\t\"amount_paid\": \"<float>\",\n\t\t\t\t\t\t\"outstanding_balance\": \"<float>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"invoice_identification\": \"<string>\",\n\t\t\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\t\t\"payment_method\": \"<string>\",\n\t\t\t\t\t\t\"partiality_number\": \"<integer>\",\n\t\t\t\t\t\t\"previous_balance\": \"<float>\",\n\t\t\t\t\t\t\"amount_paid\": \"<float>\",\n\t\t\t\t\t\t\"outstanding_balance\": \"<float>\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"date\": \"<string>\",\n\t\t\t\t\"payment_type\": \"<string>\",\n\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\"exchange_rate\": \"<string>\",\n\t\t\t\t\"amount\": \"<float>\",\n\t\t\t\t\"operation_number\": \"<string>\",\n\t\t\t\t\"beneficiary_rfc\": \"<string>\",\n\t\t\t\t\"beneficiary_account_number\": \"<string>\",\n\t\t\t\t\"payer_rfc\": \"<string>\",\n\t\t\t\t\"payer_account_number\": \"<string>\",\n\t\t\t\t\"payer_bank_name\": \"<string>\",\n\t\t\t\t\"related_documents\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"invoice_identification\": \"<string>\",\n\t\t\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\t\t\"payment_method\": \"<string>\",\n\t\t\t\t\t\t\"partiality_number\": \"<integer>\",\n\t\t\t\t\t\t\"previous_balance\": \"<float>\",\n\t\t\t\t\t\t\"amount_paid\": \"<float>\",\n\t\t\t\t\t\t\"outstanding_balance\": \"<float>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"invoice_identification\": \"<string>\",\n\t\t\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\t\t\"payment_method\": \"<string>\",\n\t\t\t\t\t\t\"partiality_number\": \"<integer>\",\n\t\t\t\t\t\t\"previous_balance\": \"<float>\",\n\t\t\t\t\t\t\"amount_paid\": \"<float>\",\n\t\t\t\t\t\t\"outstanding_balance\": \"<float>\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\t\"payroll\": {\n\t\t\t\"days\": \"<number>\",\n\t\t\t\"type\": \"<string>\",\n\t\t\t\"amount\": \"<number>\",\n\t\t\t\"version\": \"<string>\",\n\t\t\t\"date_from\": \"<date>\",\n\t\t\t\"date_to\": \"<date>\",\n\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\"payment_date\": \"<date>\"\n\t\t},\n\t\t\"xml\": \"<string>\",\n\t\t\"warnings\": {\n\t\t\t\"code\": \"<string>\",\n\t\t\t\"message\": \"<string>\"\n\t\t}\n\t},\n\t{\n\t\t\"link\": \"<string>\",\n\t\t\"collected_at\": \"<dateTime>\",\n\t\t\"invoice_identification\": \"<string>\",\n\t\t\"invoice_date\": \"<date>\",\n\t\t\"status\": \"<string>\",\n\t\t\"invoice_type\": \"<string>\",\n\t\t\"type\": \"non in do qui\",\n\t\t\"sender_id\": \"<string>\",\n\t\t\"sender_name\": \"<string>\",\n\t\t\"receiver_id\": \"<string>\",\n\t\t\"receiver_name\": \"<string>\",\n\t\t\"cancelation_status\": \"<string>\",\n\t\t\"cancelation_update_date\": \"<date>\",\n\t\t\"certification_date\": \"<date>\",\n\t\t\"certification_authority\": \"<string>\",\n\t\t\"payment_type\": \"<string>\",\n\t\t\"payment_type_description\": \"<string>\",\n\t\t\"payment_method\": \"<string>\",\n\t\t\"payment_method_description\": \"<string>\",\n\t\t\"usage\": \"<string>\",\n\t\t\"version\": \"<string>\",\n\t\t\"place_of_issue\": \"<string>\",\n\t\t\"invoice_details\": [\n\t\t\t{\n\t\t\t\t\"description\": \"<string>\",\n\t\t\t\t\"product_identification\": \"<string>\",\n\t\t\t\t\"quantity\": \"<integer>\",\n\t\t\t\t\"unit_code\": \"<string>\",\n\t\t\t\t\"unit_description\": \"<string>\",\n\t\t\t\t\"unit_amount\": \"<number>\",\n\t\t\t\t\"pre_tax_amount\": \"<number>\",\n\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\"tax_amount\": \"<number>\",\n\t\t\t\t\"total_amount\": \"<number>\",\n\t\t\t\t\"retained_taxes\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"collected_at\": \"<dateTime>\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"description\": \"<string>\",\n\t\t\t\t\"product_identification\": \"<string>\",\n\t\t\t\t\"quantity\": \"<integer>\",\n\t\t\t\t\"unit_code\": \"<string>\",\n\t\t\t\t\"unit_description\": \"<string>\",\n\t\t\t\t\"unit_amount\": \"<number>\",\n\t\t\t\t\"pre_tax_amount\": \"<number>\",\n\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\"tax_amount\": \"<number>\",\n\t\t\t\t\"total_amount\": \"<number>\",\n\t\t\t\t\"retained_taxes\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"collected_at\": \"<dateTime>\"\n\t\t\t}\n\t\t],\n\t\t\"currency\": \"<string>\",\n\t\t\"subtotal_amount\": \"<number>\",\n\t\t\"exchange_rate\": \"<number>\",\n\t\t\"tax_amount\": \"<number>\",\n\t\t\"discount_amount\": \"<number>\",\n\t\t\"total_amount\": \"<number>\",\n\t\t\"payments\": [\n\t\t\t{\n\t\t\t\t\"date\": \"<string>\",\n\t\t\t\t\"payment_type\": \"<string>\",\n\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\"exchange_rate\": \"<string>\",\n\t\t\t\t\"amount\": \"<float>\",\n\t\t\t\t\"operation_number\": \"<string>\",\n\t\t\t\t\"beneficiary_rfc\": \"<string>\",\n\t\t\t\t\"beneficiary_account_number\": \"<string>\",\n\t\t\t\t\"payer_rfc\": \"<string>\",\n\t\t\t\t\"payer_account_number\": \"<string>\",\n\t\t\t\t\"payer_bank_name\": \"<string>\",\n\t\t\t\t\"related_documents\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"invoice_identification\": \"<string>\",\n\t\t\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\t\t\"payment_method\": \"<string>\",\n\t\t\t\t\t\t\"partiality_number\": \"<integer>\",\n\t\t\t\t\t\t\"previous_balance\": \"<float>\",\n\t\t\t\t\t\t\"amount_paid\": \"<float>\",\n\t\t\t\t\t\t\"outstanding_balance\": \"<float>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"invoice_identification\": \"<string>\",\n\t\t\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\t\t\"payment_method\": \"<string>\",\n\t\t\t\t\t\t\"partiality_number\": \"<integer>\",\n\t\t\t\t\t\t\"previous_balance\": \"<float>\",\n\t\t\t\t\t\t\"amount_paid\": \"<float>\",\n\t\t\t\t\t\t\"outstanding_balance\": \"<float>\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"date\": \"<string>\",\n\t\t\t\t\"payment_type\": \"<string>\",\n\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\"exchange_rate\": \"<string>\",\n\t\t\t\t\"amount\": \"<float>\",\n\t\t\t\t\"operation_number\": \"<string>\",\n\t\t\t\t\"beneficiary_rfc\": \"<string>\",\n\t\t\t\t\"beneficiary_account_number\": \"<string>\",\n\t\t\t\t\"payer_rfc\": \"<string>\",\n\t\t\t\t\"payer_account_number\": \"<string>\",\n\t\t\t\t\"payer_bank_name\": \"<string>\",\n\t\t\t\t\"related_documents\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"invoice_identification\": \"<string>\",\n\t\t\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\t\t\"payment_method\": \"<string>\",\n\t\t\t\t\t\t\"partiality_number\": \"<integer>\",\n\t\t\t\t\t\t\"previous_balance\": \"<float>\",\n\t\t\t\t\t\t\"amount_paid\": \"<float>\",\n\t\t\t\t\t\t\"outstanding_balance\": \"<float>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"invoice_identification\": \"<string>\",\n\t\t\t\t\t\t\"currency\": \"<string>\",\n\t\t\t\t\t\t\"payment_method\": \"<string>\",\n\t\t\t\t\t\t\"partiality_number\": \"<integer>\",\n\t\t\t\t\t\t\"previous_balance\": \"<float>\",\n\t\t\t\t\t\t\"amount_paid\": \"<float>\",\n\t\t\t\t\t\t\"outstanding_balance\": \"<float>\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\t\"payroll\": {\n\t\t\t\"days\": \"<number>\",\n\t\t\t\"type\": \"<string>\",\n\t\t\t\"amount\": \"<number>\",\n\t\t\t\"version\": \"<string>\",\n\t\t\t\"date_from\": \"<date>\",\n\t\t\t\"date_to\": \"<date>\",\n\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\"payment_date\": \"<date>\"\n\t\t},\n\t\t\"xml\": \"<string>\",\n\t\t\"warnings\": {\n\t\t\t\"code\": \"<string>\",\n\t\t\t\"message\": \"<string>\"\n\t\t}\n\t}\n]"
    },
    {
      "name": "Created (when save_data=true)",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"date_from\": \"<date>\",\n    \"date_to\": \"<date>\",\n    \"link\": \"<uuid>\",\n    \"type\": \"<string>\",\n    \"attach_xml\": false,\n    \"encryption_key\": \"<string>\",\n    \"save_data\": true\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/invoices",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "invoices"
          ]
        }
      },
      "status": "Created",
      "code": 201,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "[\n\t{\n\t\t\"description\": \"<string>\",\n\t\t\"product_identification\": \"<string>\",\n\t\t\"quantity\": \"<integer>\",\n\t\t\"unit_code\": \"<string>\",\n\t\t\"unit_description\": \"<string>\",\n\t\t\"unit_amount\": \"<number>\",\n\t\t\"pre_tax_amount\": \"<number>\",\n\t\t\"tax_percentage\": \"<number>\",\n\t\t\"tax_amount\": \"<number>\",\n\t\t\"total_amount\": \"<number>\",\n\t\t\"retained_taxes\": [\n\t\t\t{\n\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t}\n\t\t],\n\t\t\"collected_at\": \"<dateTime>\"\n\t},\n\t{\n\t\t\"description\": \"<string>\",\n\t\t\"product_identification\": \"<string>\",\n\t\t\"quantity\": \"<integer>\",\n\t\t\"unit_code\": \"<string>\",\n\t\t\"unit_description\": \"<string>\",\n\t\t\"unit_amount\": \"<number>\",\n\t\t\"pre_tax_amount\": \"<number>\",\n\t\t\"tax_percentage\": \"<number>\",\n\t\t\"tax_amount\": \"<number>\",\n\t\t\"total_amount\": \"<number>\",\n\t\t\"retained_taxes\": [\n\t\t\t{\n\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"collected_at\": \"<dateTime>\",\n\t\t\t\t\"tax\": \"<string>\",\n\t\t\t\t\"tax_percentage\": \"<number>\",\n\t\t\t\t\"retained_tax_amount\": \"<number>\"\n\t\t\t}\n\t\t],\n\t\t\"collected_at\": \"<dateTime>\"\n\t}\n]"
    },
    {
      "name": "Bad request error",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"date_from\": \"<date>\",\n    \"date_to\": \"<date>\",\n    \"link\": \"<uuid>\",\n    \"type\": \"<string>\",\n    \"attach_xml\": false,\n    \"encryption_key\": \"<string>\",\n    \"save_data\": true\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/invoices",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "invoices"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
    },
    {
      "name": "Unauthorized",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"date_from\": \"<date>\",\n    \"date_to\": \"<date>\",\n    \"link\": \"<uuid>\",\n    \"type\": \"<string>\",\n    \"attach_xml\": false,\n    \"encryption_key\": \"<string>\",\n    \"save_data\": true\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/invoices",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "invoices"
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
    },
    {
      "name": "Request Timeout",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"date_from\": \"<date>\",\n    \"date_to\": \"<date>\",\n    \"link\": \"<uuid>\",\n    \"type\": \"<string>\",\n    \"attach_xml\": false,\n    \"encryption_key\": \"<string>\",\n    \"save_data\": true\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/invoices",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "invoices"
          ]
        }
      },
      "status": "Request Timeout",
      "code": 408,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
    },
    {
      "name": "Unexpected Error",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"date_from\": \"<date>\",\n    \"date_to\": \"<date>\",\n    \"link\": \"<uuid>\",\n    \"type\": \"<string>\",\n    \"attach_xml\": false,\n    \"encryption_key\": \"<string>\",\n    \"save_data\": true\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/invoices",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "invoices"
          ]
        }
      },
      "status": "Internal Server Error",
      "code": 500,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
    }
  ]
}