Error response 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:
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 |
provider_original_response_code | String | Original response code from downstream provider (This attribute is only for code provider_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"
}
internal_error
{
"code":"internal_error",
"message":"An internal error was encountered. Please try again later."
}
issuer_declined
{
"code":"issuer_declined",
"message":"The card issuer declined this transaction. Please refer to the original response code.",
"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 |
404 | not_found | The requested endpoint does not exist |
Error codes for 400
Error Codes for HTTP Response code 400
Code | Message (subject to change) |
---|---|
internal_error | An internal error was encountered. Please try again later. |
validation_error | {message varies by validation rules} |
configuration_error | Invalid request against merchant configuration. Please contact your account manager. |
provider_unavailable | The payment provider is temporarily unavailable. Please try again later. |
issuer_unavailable | The card issuer is temporarily unavailable. Please try again later. |
provider_declined | The payment provider declined this transaction. Please refer to the original response code. |
issuer_declined | The card issuer declined this transaction. Please refer to the original response code. |
risk_declined | The transaction is blocked because of risk concern. |
authentication_declined | The user failed authentication. |
quote_expired | The quote has expired. Please create new quote and try again. |
amount_above_limit | The operating amount $amount is above the limit $limit . |
amount_below_limit | The operating amount $amount is below the limit $limit . |
frequency_above_limit | The frequency limit of $resource is reached for operation $operation . |
resource_not_found | The $resource with ID $id cannot be found. |
resource_already_exists | The $resource with ID $id already exists. |
duplicate_request | The request ID $id has been used previously. |
invalid_status_for_operation | The $resource status $status is invalid for operation $operation . |
operation_not_supported | The operation $operation is not supported. |
currency_not_supported | The currency $currency is not supported. |
card_brand_not_supported | The card brand $card_brand is not supported. |
no_3ds_liability_shift | Transaction declined since Liability shift couldn't not be acheived due to network outage or Issuer unavailibility. |