Errors

When a request to the Dotapay API fails, the response always includes clear information about what went wrong and how to fix it. Each error follows a consistent structure that contains a human-readable message, a machine-readable code, and optional diagnostic information to help you debug quickly.

Dotapay's API is RESTful and as such, uses conventional HTTP response codes to indicate the success or failure of requests.

200

Request was successful and intended action was carried out. Note that we will always send a 200 if a charge or verify request was made. Do check the data object to know how the charge went (i.e. successful or failed).

201

A resource has successfully been created.

400

A validation or client side error occurred and the request was not fulfilled.

401

The request was not authorized. This can be triggered by passing an invalid secret key in the authorization header or the lack of one.

404

Request could not be fulfilled as the request resource does not exist.

5xx

Request could not be fulfilled due to an error on Dotapay's end. This shouldn't happen so please report as soon as you encounter any instance of this.

Error categories

Errors are grouped into categories to make them easier to understand and handle programmatically.

api_errorString
This indicates that the error happened on the Dotapay API. Errors here include attempts to access resources that an integration is not authorized to access, or similar API-level issues.

validation_errorString

This indicates that the error is related to invalid data in the request. Errors here include missing or invalid parameters being passed to the API.

processor_errorString

This indicates that the error is related to the payment processor or gateway. Errors here include insufficient funds, blocked/expired cards, or other issues relayed by the payment processor.

Last updated