Skip to main content

Error Response Format

The Taxwire API returns errors in a standardized format, inspired by the JSON:API spec:
Each error object contains:

Error Codes

The Taxwire API uses the following standardized error codes:

HTTP Status Codes

400 Bad Request

The request is invalid. The error response will include specific validation errors. Common error codes: validation_error Action: Check your request parameters and ensure they match the API specifications.

401 Unauthorized

The request is unauthorized. This can happen when the API key provided is invalid or expired. Common error codes: auth_error, auth_api_key_not_found, auth_api_key_expired Action: Verify your API key is valid and active.

403 Forbidden

The request is forbidden. This can happen for a number of reasons:
  • The API key header is missing
  • The API key does not have access to the resource
Common error codes: auth_error Action: Ensure you’re using the correct API key with appropriate permissions.

404 Not Found

The requested resource was not found. This can happen for a number of reasons:
  • The resource does not exist
  • The resource is not accessible by the API key
Action: Check that the resource identifier is correct.

409 Conflict

The request could not be processed due to a conflict with the current state of the resource. This could happen if you have sent the same transaction more than once. Common error codes: conflict Action: Resolve the conflict and try again.

422 Unprocessable Entity

The request contains valid data but the server cannot process it. This typically happens when:
  • The request is missing a required parameter
  • Some data in the request is invalid
Common error codes: validation_error, validation_required_field, validation_invalid_format Action: Check the error details for specific information about what needs be corrected.

429 Too Many Requests

The request was rate limited. This means you have made too many requests in a short period of time. Common error codes: rate_limit_error Action: The response will include a Retry-After header with the number of seconds to wait before making the next request. Implement exponential backoff in your client. For example, a rate-limited response would include this header:
This indicates you should wait at least 30 seconds before making another request. Your client should respect this header and implement proper backoff strategies.

500 Internal Server Error

The server encountered an error while processing the request. Common error codes: system_internal_error Action: This is likely a bug and should be reported to support if it persists.

Error Examples

Internal Server Error

Rate Limit Error

Validation Errors

API Key Error

Sample Error Handling

Here is a simple example of how to handle errors in Python:
Python