Jump to content

Sage Business Cloud Accounting Plus API (Canadian): "Couldn't find AddressRegion"


 Share

Recommended Posts

I am trying to create a sales invoice with no tax and a U.S. delivery address, but when tax_rate_id is CA_EXEMPT, CA_NO_TAX, or CA_ZERO and tax_address_region_id is in the U.S. ("US-KY" in this case), I receive error "Couldn't find AddressRegion" and the invoice is not created.

I have tried with tax_amount values of "0.00" and null. Supplying a Canadian tax_address_region_id (e.g., "CA-ON") fails with "tax_address_region_id is not allowed"--probably because the delivery address is in the U.S. The master list of tax_rate_id values only includes Canadian taxes and CA_EXEMPT, CA_NO_TAX, and CA_ZERO .

Running Sage Business Cloud Accounting normally (i.e., in a browser as an end-user) and setting invoice delivery address to a U.S. location populates the Tax Rate dropdown with only these values: "Zero Rated 0.00%", "Exempt 0.00%", and "No Tax", which seemingly conform to the trio named above.

Here is the JSON content (some address info has been altered for this example, and zip/postal codes might be invalid as a result):

{
    "sales_invoice": {
        "contact_id": "dfd5417ec8384cc89084eb6e9f2cf1f9",
        "date": "2024-04-10",
        "delivery_address": {
            "address_line_1": "1 JONES LANE",
            "address_line_2": "",
            "address_type_id": "DELIVERY",
            "city": "LOUISVILLE",
            "country_group_id": "ALL",
            "country_id": "US",
            "postal_code": "40243",
            "region": "KY"
        },
        "due_date": "2024-04-12",
        "invoice_lines": [{
                "analysis_type_categories": null,
                "description": "LAREDO, TX - LOUISVILLE, KY",
                "ledger_account_id": "b21edb9145aa11ee8d7712b53df3d14f",
                "quantity": 1,
                "service_id": "5835a1d2f5f94aacb77357dca763588b",
                "tax_amount": "0.00",
                "tax_rate_id": "CA_EXEMPT",
                "unit_price": "390.00",
                "unit_price_includes_tax": false
            }, {
                "analysis_type_categories": null,
                "description": "FSC - (Standard Rate)",
                "ledger_account_id": "b21edb9145aa11ee8d7712b53df3d14f",
                "quantity": 1,
                "service_id": null,
                "tax_amount": "0.00",
                "tax_rate_id": "CA_EXEMPT",
                "unit_price": "5108.10",
                "unit_price_includes_tax": false
            }
        ],
        "invoice_number": "328827",
        "invoice_number_prefix": "I",
        "main_address": {
            "address_line_1": "34 CANUCK DRIVE",
            "address_line_2": "",
            "address_type_id": "ACCOUNTS",
            "city": "MISSISSAUGA",
            "country_group_id": "ALL",
            "country_id": "CA",
            "postal_code": "L5T 1C1",
            "region": "ON"
        },
        "notes": "1",
        "reference": "10748979",
        "tax_address_region_id": "US-KY"
    }
}

Edited by Steve Lalanne
Link to comment
Share on other sites

Hi @Steve Lalanne,

Thank you for your post. You would need to use the CA_NO_TAX rate for the transaction to be valid. I've included an example body for you to try.
The tax_rates API returns the tax_rate_id for a given region if you need to understand what tax_rate_id is valid 

https://api.accounting.sage.com/v3.1/tax_rates?address_region_id=US-KY

{
	"sales_invoice": {
		"contact_id": "dfd5417ec8384cc89084eb6e9f2cf1f9",
		"date": "2024-04-15",
		"reference": "10748979",
        "tax_address_region_id":"CA-ON",
		"invoice_lines": [{
				"description": "LAREDO, TX - LOUISVILLE, KY",
				"ledger_account_id": "b21edb9145aa11ee8d7712b53df3d14f",
				"unit_price": "390.00",
                "tax_amount": "0.00",
				"quantity": "1",
                "tax_rate_id": "CA_NO_TAX"
                },
                {
                "description": "FSC - (Standard Rate)",
				"ledger_account_id": "b21edb9145aa11ee8d7712b53df3d14f",
				"unit_price": "5108.10",
                "tax_amount": "0.00",
				"quantity": "1",
                "tax_rate_id": "CA_NO_TAX" 
                }
                ],
                "main_address":{
                 "address_line_1":"34 CANUCK DRIVE",
                 "address_line_2":"",
                 "City":"MISSISSAUGA",
                 "postal_code":"L5T 1C1",
                 "region":"ON",
                 "country_group_id":"CA"
             },
             "delivery_address":{
                 "address_line_1":"1 JONES LANE",
                 "address_line_2":"",
                 "City":"MILOUISVILLESSISSAUGA",
                 "postal_code":"40243",
                 "region":"KY",
                 "country_group_id":"US"
             }

}}

Thanks

Mark

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...