Error codes
Airwallex uses conventional HTTP response codes to indicate the success or failure of an API request.
HTTP response codes
HTTP Response Codes and description
Code | Description |
---|---|
200 | OK - The request was processed successfully |
201 | Created - The request was processed successfully |
400 | Error - The request was invalid, or an error occurred in Airwallex or downstream provider |
401 | Unauthorized - Please verify that the authentication token is provided and is valid |
404 | Not found - The requested endpoint does not exist |
Error response structure
When we send an error response, the body will generally contain the following fields:
Response Body Attributes
Name | Type | Description | Example |
---|---|---|---|
code | String | Error code | validation_error |
source | String | Name of the request parameter that caused the error (This attribute is only for code validation_error) | merchant_order_id |
message | String | Error message | merchant_order_id must be provided |
providerOriginalResponseCode | String | Original response code from downstream provider (This attribute is only for code processor_declined or issuer_declined) | 01 |
Error response examples for HTTP response code 400
validation_error
{
"code":"validation_error",
"source":"merchant_order_id",
"message":"merchant_order_id must be provided"
}
resource_not_found
{
"code":"resource_not_found",
"message":"The resource with ID int_n3fXc5NDzgVE9DLx3zGhMibdSlx cannot be found"
}
service_unavailable
{
"code":"service_unavailable",
"message":"The system is temporarily unavailable. Please try again later. [54.07.01]"
}
issuer_declined
{
"code":"issuer_declined",
"message":"TThe issuer declined this transaction.",
"provider_original_response_code": "01"
}
Error codes for 401, 404
Error Codes for HTTP Response code 401 and 404
Http response code | Code | Message |
---|---|---|
401 | unauthorized | Access denied, authentication failed |
404 | not_found | The requested endpoint does not exist |
Error codes for 400
Error Codes for HTTP Response code 400
Code | Message |
---|---|
validation_error | {massages vary by validation rules} |
duplicate_request | The same request ID has already been used. Please try again with a different ID. |
resource_not_found | The resource with ID \$Id cannot be found. |
resource_already_exists | The resource with ID \$Id already exists. |
state_invalid_for_operation | Cannot $operation the $resource of status $status. |
service_unavailable | The system is temporarily unavailable. Please try again later. [$internalCode] |
processor_declined | The processor declined this transaction. |
issuer_declined | The issuer declined this transaction. |
risk_declined | The transaction is blocked because of risk concern. Please contact your account manager. |
amount_above_limit | The operating amount is above the limit. Please adjust the amount and try again. |
frequency_above_limit | Failed to $operation the $resource. Frequency limit is reached. Please try again later. |
operation_not_supported | The operation is not supported. Please contact your account manager. |
currency_not_supported | The currency $currency is not supported according to merchant’s configuration. Please update the currency or contact your account manager. |
quote_expired | The quote has expired. Please create a new quote and try again. |
card_invalid | The card is invalid. Please update your card information or try another card. |
card_brand_not_supported | The card brand $brand is not supported. |