TaxJar API: How to address invalid product tax codes
The release of Version V2.1 - 2022 of the TaxJar API (dated 2022-01-24) includes product tax code validation.
In this version of the API, requests to the TaxJar API /v2/transactions endpoint that include invalid product tax codes (PTCs) will return the following:
{ "status": 400, "error": "Bad Request", "detail": "line_items include invalid tax codes: XXXXXX" }
A transaction that receives a 400 error, like the one noted above, will fail to sync to TaxJar, and will not be available in your list of transactions or your state reports. Therefore, you will need to ensure that you have the ability to review failed transaction API calls to TaxJar to avoid missing transactions.
In order to mitigate the errors and transactions that fail to sync, we recommend verifying that you are sending valid PTCs. If you are unable to do this, we recommend not sending PTCs with your transaction creation requests.
What is an example of an API failure and how do I fix it?
Below is an example of a transaction creation call that uses a made up PTC phrase or name. This will now cause an error to be returned.
# POST /v2/transactions/orders { "transaction_id": "invalid-product-tax-code-20220124", "transaction_date": "2022-01-16 04:26:17", "to_street": "123 Foo RD", "to_city": "Chapin", "to_state": "SC", "to_zip": "29036", "to_country": "US", "amount": "59.0000", "shipping": 0, "sales_tax": "4.1300", "line_items": [{ "quantity": 1, "product_identifier": "SVTLPP1M", "product_tax_code": "FOO FIGHTERS", "description": "Lease Plan-Monthly Payment (2 of 13) for February 2019", "unit_price": "59.0000", "sales_tax": "4.1300" }] } # RESPONSE { "status": 400, "error": "Bad Request", "detail": "line_items include invalid tax codes: FOO FIGHTERS" }
Below is an example which uses an invalid PTC number which will now return an error.
# PUT /v2/transactions/orders/20220124 { "transaction_id": "20220124", "transaction_date": "2022-01-16 04:26:17", "to_street": "123 Foo RD", "to_city": "Chapin", "to_state": "SC", "to_zip": "29036", "to_country": "US", "amount": "59.0000", "shipping": 0, "sales_tax": "4.1300", "line_items": [{ "quantity": 1, "product_identifier": "SVTLPP1M", "product_tax_code": "123456789", "description": "Lease Plan-Monthly Payment (2 of 13) for February 2019", "unit_price": "59.0000", "sales_tax": "4.1300" }] } # RESPONSE { "status": 400, "error": "Bad Request", "detail": "line_items include invalid tax codes: 123456789" }
In order to fix these errors you will need to modify the API request's 'product_tax_code'
to a valid PTC. You can find our valid PTCs in our API documentation here.
- Please note, active PTCS returned by the
/v2/categories
endpoint along with0
or11111
or blank/omitted are also acceptable.
If you have any questions, please reach out to support@taxjar.com.