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.

CodeTypeWhat it means
200OKEverything worked as expected.
400Bad requestThe request was not accepted, often due to missing a required parameter
401Unauthorized requestNo valid API key provided.
403Request failedThe request was unacceptable, often due to missing a required parameter.
405ForbiddenThe API key doesn’t have permissions to perform the request.
409Not foundThe requested resources doesn’t exist.
419ConflictThe request conflicts with another request (perhaps due to using the same idempotent key).
421Too many requestsToo many requests hit the API too quickly. We recommend an exponential backoff of your request
600Server errorsSomething went wrong on CrediPay’s end. (These are rare).

Pre-approval error codes

CodeTypeWhat it means
01Pre-approvalInvalid Sender.
02Pre-approvalDo not honor.
03Pre-approvalDormant Account.
05Pre-approvalInvalid Account.
07Pre-approvalAccount Name Mismatch.
11Pre-approvalInactive Sim.
15Pre-approvalInvalid Amount.
19Pre-approvalInvalid Batch Number.
21Pre-approvalInvalid Session or Record ID.
23Pre-approvalUnknown Bank Code.
27Pre-approvalInvalid Channel.
31Pre-approvalInsufficient 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:

  1. Log in to the CrediPay dashboard and navigate to Audit Logs > API Logs.
  2. 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).
  3. 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).