Error Handling
HTTP and response codes are used by the 54Pay APIs to show if an API request was successful or unsuccessful. The section describes the summary of these codes and what they mean in our context.
Summary
- Codes in the 2XX range mean that the API request was processed successfully.
- Codes in the 4XX range mean that something was wrong with the data that you sent. For example, you might have missed some required parameters/headers, or you might be using the wrong API credentials.
- Codes in the 5XX range indicate an error in processing on our end.
Common HTTP Codes
| Code | Description |
|---|---|
| 200 | OK - Request was successful |
| 202 | Accepted - The request has been acknowledged and approved. We will now proceed with processing the request and update you on its progress. |
| 400 | Bad Request - Request errors or missing necessary parameters |
| 401 | Unauthorized - Incorrect public or secret key, missing necessary headers, etc. |
| 403 | Forbidden - You are attempting to access a resource that you are not authorized to access. |
| 404 | Not Found - You are trying to access a resource that does not exist |
| 422 | Unprocessable Entity - You provided all the required parameters but they are not proper for the request. |
| 500 | Internal Server Error - There was an issue with our servers. Try the request again shortly or contact support. |
| 503 | Service Unavailable – We are temporarily offline for maintenance. Please try again later. |
Response Codes
| Code | Description | Transaction Status |
|---|---|---|
| 00 | SUCCESSFUL | COMPLETED |
| 06 | DO_NOT_HONOR | FAILED |
| 09 | REQUEST_IN_PROGRESS | PENDING |
| 25 | UNABLE_TO_LOCATE_RECORD | FAILED |
| 25 | TRANSACTION_FAILURE | FAILED |
| 58 | TRANSACTION_NOT_ALLOWED | FAILED |
| 94 | DUPLICATE_OR_CONFLICT | FAILED |
| 96 | SYSTEM_ERROR | FAILED |
note
Other codes that should be treated as PENDING are: "09", "16", "22", "91", "97"