Errors
Error Types
When you make an API call to our endpoints, CrediPay uses conventional HTTP response codes to indicate the success or failure of the API request. In general, codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that occurred due to the information provided, for example, a required parameter was omitted. Codes in the 5xx range indicate an error with our servers, but these are usually rare.
Below, we have detailed API errors you might use using CrediPay and how to fix them. For widget errors, please get in touch with our support team here.
| Code | Type | What it means |
|---|---|---|
| 200 | OK | Everything worked as expected. |
| 400 | Bad request | The request was not accepted, often due to missing a required parameter |
| 401 | Unauthorized request | No valid API key provided. |
| 403 | Request failed | The request was unacceptable, often due to missing a required parameter. |
| 405 | Forbidden | The API key doesn’t have permissions to perform the request. |
| 409 | Not found | The requested resources doesn’t exist. |
| 419 | Conflict | The request conflicts with another request (perhaps due to using the same idempotent key). |
| 421 | Too many requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your request |
| 600 | Server errors | Something went wrong on CrediPay’s end. (These are rare). |
Pre-approval error codes
| Code | Type | What it means |
|---|---|---|
| 01 | Pre-approval | Invalid Sender. |
| 02 | Pre-approval | Do not honor. |
| 03 | Pre-approval | Dormant Account. |
| 05 | Pre-approval | Invalid Account. |
| 07 | Pre-approval | Account Name Mismatch. |
| 11 | Pre-approval | Inactive Sim. |
| 15 | Pre-approval | Invalid Amount. |
| 19 | Pre-approval | Invalid Batch Number. |
| 21 | Pre-approval | Invalid Session or Record ID. |
| 23 | Pre-approval | Unknown Bank Code. |
| 27 | Pre-approval | Invalid Channel. |
| 31 | Pre-approval | Insufficient funds. |
Error Handling
While building your CrediPay integration, we strongly recommend that you keep a log of all API requests you make and the responses you receive. You should keep a log file as part of your application and record the API signature, any API URL parameters, and request body (you may strip the API keys) in JSON. Then, write down the API response code and log the JSON body of the error message if one occurs. When your integration is stable, you can lower the logging level and log only the API name (signature), the response code, and any error messages that may have occurred.
On your CrediPay dashboard, you can also see the logs of each API call you make. This applies to both successful and failed responses (provided the access key and secret key are correct).
To access your API Logs on the dashboard:
- Log in to the CrediPay dashboard and navigate to Audit Logs > API Logs.
- Use the dropdown at the top right to select your CrediPay App, or filter by Scope (Identity, Statements, etc), Status (failed or successful), and Environment (live or test).
- Then, your API call data will be displayed based on the filters you chose.
In addition, the response body will be empty if a standard HTTP error code such as 401 (Not Authorized) or 404 (Not Found) is sufficiently descriptive. The response will also contain an error entity that provides additional information about the incident, including an application error code and a human-readable error description. In other situations, we will utilize the standard response code for client errors (400).
