Error Handling
Nopan uses structured error responses to help developers understand and react to problems quickly and effectively. All API errors follow a predictable pattern, combining standard HTTP status codes with detailed Nopan-specific reason codes.
This guide covers how errors are reported, how to troubleshoot them, and how to interpret our internal codes.
Error Code Families
Nopan reasonCode values are grouped to make troubleshooting easier.
Use these families to decide what to fix (request vs. logic) and whether to retry.
HTTP Status Codes
We follow standard HTTP response codes to indicate success or failure.
Success
Requests that are processed correctly (irrespective of a transaction status) return status codes in the 2xx range.
Failure
Client-side errors return a 4xx code. These usually require action from your application.
Server-side issues return a 5xx code and indicate a problem within Nopan or downstream services.
Common Error Scenarios
Below are examples of real-world error situations, mapped to HTTP status codes and Nopan reason codes, with tips on how to handle them.
- For client certificate related errors see Authentication
- For Access token related errors see OAuth Access Tokens
- For request signature related errors see HTTP Signatures
Example Responses
- 400 Bad_Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not_Found
- 409 Conflict
- 413 Content Too Large
- 429 Rate_Limit
- 500 Internal_Error
- 502 Bad_Gateway
Example 1
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "4000",
"message": "Invalid input"
},
"fields": {
"processingAccountId": "Processing Account ID is required",
"paymentDetails.amount": "Amount is required"
},
"callId": "678c62b0177e4bc3-a12309"
}
Example 2
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "4990",
"message": "Signature error"
},
"callId": "0af7a364bc7745f2-b823fc"
}
Example 3
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "4980",
"message": "Certificate error"
},
"callId": "dccdf12110264f4c-a19b2c"
}
Example 1
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "4061",
"message": "Token is expired"
},
"callId": "c84b0b9f91714d4e-5d2311"
}
Example 2
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "4991",
"message": "Error validating the signature"
},
"callId": "a3c8cdef0a134df4-2e31b1"
}
Example 3
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "4970",
"message": "Authentication error"
},
"callId": "be1d37ab317e4b2d-a8f9d4"
}
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "4971",
"message": "Authorization error: Resource is not allowed"
},
"callId": "0dbad1cf74de4f76-31bc1e"
}
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "6102",
"message": "Security violation"
}
}
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "4001",
"message": "Payment not found"
},
"callId": "0dbad1cf74de4f76-31bc1e"
}
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "4010",
"message": "Payment already exists"
},
"callId": "9cf37980efdc4316-01a4bc"
}
The distinction between 409 Conflict and 200 OK for duplicate requests depends on whether the original request was successfully processed or not. You should treat either as a signal that the transaction is already underway or completed.
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "6103",
"message": "Request too large"
}
}
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "3000",
"message": "Rate limit exceeded"
},
"callId": "4a9137cf2ccf4c19-00982e"
}
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "9999",
"message": "Internal Server Error"
},
"callId": "e147c3ba09cd496f-bd02e7"
}
{
"status": "DECLINED",
"statusInfo": {
"reasonCode": "8003",
"message": "Provider Error"
},
"callId": "0af7a364bc7745f2-b823fc"
}
callIdError response includes a unique callId — a trace identifier generated by Nopan.
Include it when contacting support to help us locate logs and diagnose the issue quickly.
These responses are returned immediately as part of the HTTP call and indicate problems that must be resolved before retrying or proceeding.
Nopan reason codes
Each error response from Nopan includes a reasonCode and message. These codes are specific to Nopan and help developers understand exactly what went wrong.
Below is the full catalog of error codes returned by Nopan, including reason code returned for non-2xx response described above: