Error Response Format
The Taxwire API returns errors in a standardized format, inspired by the JSON:API spec:| Field | Required | Description |
|---|---|---|
status | Yes | HTTP status code as a string |
code | Yes | Application-specific error code |
title | Yes | A short, human-readable summary of the problem |
detail | Yes | A human-readable explanation of the error |
source.pointer | No | A pointer to the associated entity in the request document (only for validation errors) |
Error Codes
The Taxwire API uses the following standardized error codes:| Category | Error Code | Description |
|---|---|---|
| System Errors | system_internal_error | An unexpected server error occurred |
system_service_unavailable | The service is temporarily unavailable | |
| Validation Errors | validation_error | General validation error |
validation_required_field | A required field is missing | |
validation_invalid_format | A field has an invalid format | |
| Authentication Errors | auth_error | General authentication error |
auth_api_key_not_found | The provided API key was not found | |
auth_api_key_expired | The provided API key has expired | |
| Other Errors | rate_limit_error | Rate limit exceeded |
conflict | Resource conflict |
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
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
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
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:
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