Error Codes
Learn about the different HTTP response codes we send for successful and failed API calls.
To provide you with the best experience, we aim to successfully process all API calls. However, financial transactions involve multiple systems and an API call can fail due to external factors in these systems. API calls can also fail due to other unforeseen circumstances such as human error while providing inputs, network errors, and intermittent connectivity.
We use standard HTTP response codes to indicate a successful or failed API call. All successful API calls return a 2XX response code. You can treat any non 2XX HTTP response as a failed call.
The table below lists the various HTTP response codes we return to indicate successful or failed API calls.
HTTP Response Code | Description | Next Step |
---|---|---|
2XX | Successful API call. | |
4XX | Failed API call. There is an error in the information provided by you. For example:
| Check and correct the information passed in the API call. |
5XX (very rare) | Failed API call. Error with ZWITCH servers. |
Error Parameters
To make it easier for you to identify where the error occurred and how to rectify the error, we return an error message with all non 2XX HTTP response codes.
Shown below are sample error responses for different non 2XX HTTP response codes.
{
"error": {
"type": "authentication_error",
"message": "Invalid secret key."
}
}
{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "No such account: va_onMda91dobg5YYX0kH",
"param": "id"
}
}
{
"error": {
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The type field must be one of vpa, account_number",
"param": "type"
}
}
{
"error": {
"type": "invalid_request_error",
"code": "parameter_unknown",
"message": "received unknown parameter: whitelisted_remitters",
"param": "whitelisted_remitters"
}
}
{
"error": {
"type": "internal_system_error",
"message": "something went wrong",
"trace_id": "bfa30905-e73b-8d86-f656-6c64ac308634"
}
}
The below table gives a brief description of the different parameters in the error message sent with all non-2XX HTTP response codes.
Parameter | Type | Description |
---|---|---|
type | string | Type of the error. Possible values:
|
code | string | The error short code. Possible values:
|
message | string | Error description. This parameter tells you why the error occurred. For example, The name_of_account_holder field is required . |
param | string | The parameter where the error occurred. For example, name_of_account_holder . |
trace_id | string | 500 Error Only This is a unique identifier for the API call in our database. Share this value with our Integrations Team if you face any issues with our APIs. This helps us identify the API call, debug the call, and provide you with a resolution. Note: This value is also present in all our responses headers as x-zwitch-trace-id . |
Updated over 2 years ago