Skip to navigation

Handle errors

Read AvaTax error responses and retry safely.
View as Markdown

AvaTax returns standard HTTP status codes. On failure, the body contains an error object with a machine-readable code, a human-readable message, and a details array pinpointing the problem.

Error response
{
"error": {
"code": "AddressError",
"message": "Address is not valid.",
"target": "IncorrectData",
"details": [
{
"code": "AddressError",
"number": 308,
"message": "The address is not deliverable.",
"severity": "Error",
"refersTo": "Addresses[0]"
}
]
}
}

Status codes

StatusMeaningWhat to do
400Malformed request or invalid dataFix the payload; inspect details[].refersTo
401Missing or invalid credentialsRecheck your account ID and license key
403Authenticated but not permittedConfirm the account’s subscriptions and permissions
404Resource not foundVerify the company code and transaction code
429Rate limit exceededBack off and retry with exponential delay
500Service errorRetry idempotently after a short delay

Retrying safely

Calculation is deterministic, so retrying transactions/create with the same document code is safe — AvaTax returns the existing transaction rather than duplicating it.

1

Respect the limit

On 429, read the Retry-After header if present and wait at least that long.

2

Back off exponentially

Double the delay on each retry (1s, 2s, 4s…) with jitter, up to a sensible ceiling.

3

Give up gracefully

After a few attempts, surface the error to the caller rather than blocking checkout.

Log the full error.code and details on failures. The refersTo field points at the exact line or address that caused the problem, which makes support tickets far faster to resolve.