Jump to content

[Canada business] Create invoice - Error: line_items.currency_tax_amount - this field is required


Recommended Posts

Posted

Hello,

We noticed an issue during invoice creation for Canadian business. This was noticed today and it wasn't an issue couple of days ago. 

When we are creating an invoice, we are sending the request as follows:

{
    "sales_invoice": {
        "contact_id": "479b90167950499c80ef3abd8a89f9bd",
        "date": "2023-03-29",
        "tax_address_region_id": "CA-QC",
        "invoice_lines": [
            {
                "description": "Some service 1",
                "service_id": "7896d5025d92423b85db7c821efc488f",
                "ledger_account_id": "3c65c506bda911eda8c40ef4cf562701",
                "quantity": "1.0",
                "unit_price": "25.0",
                "tax_rate_id": "CA_NO_TAX"
            }
        ]
    }
}

And we get the response:

[
    {
        "$severity": "error",
        "$dataCode": "RecordInvalid",
        "$message": "This field is required.",
        "$source": "line_items.currency_tax_amount"
    }
]

This field is not mentioned in documentation, at least not by this exact name. There is a field "base_currency_tax_amount" which we tried specifying, but the outcome is the same. In any way, this field is marked as optional in API docs.

Were there any API changes lately that could affect this behaviour? What is the workaround for this issue?

Thanks in advance.

Posted

Hi ,thanks for your question.

The business in question must be set to collect taxes for this region/province and needs to see the tax_amount.

 

{
    "sales_invoice": {
        "contact_id": "479b90167950499c80ef3abd8a89f9bd",
        "date": "2023-03-29",
        "tax_address_region_id": "CA-QC",
        "invoice_lines": [
            {
                "description": "Some service 1",
                "service_id": "7896d5025d92423b85db7c821efc488f",
                "ledger_account_id": "3c65c506bda911eda8c40ef4cf562701",
                "quantity": "1.0",
                "unit_price": "25.0",
                "tax_amount": "0.0",
                "tax_rate_id": "CA_NO_TAX"
            }
        ]
    }
}

Thanks

Mark

  • Like 1
Posted (edited)

Hi,

Thanks for answering. What are the rules for specifying "tax_amount"? Our implementation should work with multiple Sage businesses (multiple countries) and it seems that there is a difference between countries. Here in docs, it is said that if omitted it will be automatically set to "0" which we were doing up until now, but it seems that something changed and this field is now required.  (https://developer.sage.com/accounting/guides/concepts/invoicing/) Should we now pass "tax_amount" as "0" always?

Thanks

Edited by Test Integration Test Integration
Posted

"Here in docs, it is said that if omitted it will be automatically set to "0" which we were doing up until now, but it seems that something changed and this field is now required. "  - When did you notice this change in behaviour?

The SBCA API's supported here are intended to be used across 6 different regions CA, ES, FR, IRE, UK and US. Within these countries there are many different tax rules and rates which encompass many different business types and taxation treatments which add up to many thousands of different permutations. The API reference should be treated as a guide, as different fields and values will become required for different configurations.

For example, if you create a Sales invoice for a UK VAT registered business and the contact selected does not have an address set but has a tax_number set against it, the request would fail if you did not provide the address in the sales_invoice body. 

For Canadian businesses how do you establish if they collect taxes in the region/province you are creating the sales_invoice for? Are you providing the user with a UI to select from the appropriate rates or are you presuming that the transaction always uses a tax_rate of CA_NO_TAX?

Thanks 
Mark

  • Like 1
Posted

Hi,

We noticed this change yesterday. We are presuming that CA_NO_TAX will be used. We also tried marking "taxes will not be collected here" for specific region, but it still asked for tax_amount. I will need to recheck if we started getting the same error message for other countries too just to be sure if it was Canada specific or not.

Thanks

Posted (edited)

Hi,

We used this request for testing and when we added "tax_amount": "0" to it, then it passed. Same case for other countries (UK, Ireland). We tried using minimal request with only required fields and "tax_amount" seemed like it could be omitted and it was automatically set to 0 by Sage (from my understanding).

AFAIK there is an exception for Spain, where "tax_amount" field is not allowed and shouldn't be specified. For Spain we are still omitting "tax_amount" and it works.

Edited by Test Integration Test Integration

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...