Response Handling
The API can return an HTTP success response while the payment result inside the response body still indicates a processor decline.
Always inspect both:
| Layer | What to check |
|---|---|
| HTTP status | Whether the API request was accepted and processed by the API. |
response_code | Whether the transaction succeeded or declined during processing. |
Common HTTP statuses
| HTTP status | Meaning |
|---|---|
200 | Request accepted. Inspect response_code in the body. |
400 | Validation error or processing error. |
401 | Missing or invalid X-Api-Key. |
403 | API key is valid but does not have permission for this operation. |
500 | Processing-side error. Retry later or contact support if it persists. |
Common response codes
response_code | Meaning |
|---|---|
100 | Charge processed successfully. |
200 | Processor declined the charge. Inspect gateway response fields when available. |
Example successful response
{
"order_id": "700201",
"response_code": 100
}Example declined response
{
"order_id": "700202",
"response_code": 200,
"gateway_response_code": "202",
"gateway_response_description": "Insufficient funds"
}Best practice
Store the API response together with your original tracking2 value. When a postback arrives later, use clickID, orderID, and transactionID to update the same order record.
Updated 2 days ago