Errors
Zenith Payments uses standard HTTP response codes to show whether a request succeeded or failed. A 2XX code means the request succeeded. A 4XX code means the information you sent was wrong, for example a missing parameter or unauthorised access. A 5XX code means a problem on our servers, so please contact us if it happens.
When the code is not 2XX, the operation failed and you may need to act. The response is JSON, and its message field briefly explains the error:
{
"message": "Invalid payment reference."
}
For the error responses of each endpoint, with exact schemas and examples, see the API reference.
Status codes returned by the API
| Status code | Error | Explanation |
|---|---|---|
| 300 | Multiple Choices | The request duplicates an earlier one. Returned for refund requests, customers (duplicate reference), preauth captures, request-pays and batch payments. A batch payment returns a Location header pointing to the original. |
| 400 | Bad Request | The request was unacceptable, often because a required parameter is missing. A repeated merchantUniquePaymentId on POST /v2/payments also returns 400. |
| 401 | Unauthorized | No valid API key provided, or no credentials sent. |
| 403 | Forbidden | The API key does not have the right permissions to perform the request. |
| 404 | Not Found | The requested resource doesn't exist. |
| 409 | Conflict | A unique ID you sent is already used. Returned by POST /v2/cardproxies and POST /v2/credit-requests. |
| 412 | Precondition Failed | Tokenisation failed (POST /v2/cardproxies), or the request is not allowed because of a limit or because it is not eligible (POST /v2/credit-requests). |
| 422 | Unprocessable Entity | The merchant is forbidden to perform this operation (POST /v2/credit-requests). |
| 5XX | Server Error | ZenPay servers have failed to process your request. |
Retries and duplicates
Networks fail, users retry, and backend actions can be repeated. Design your integration so that a repeated request or notification does not cause a duplicate side effect.
Where the API takes a unique identifier you supply, such as merchantUniquePaymentId, use one every time and treat it as part of the design, not optional bookkeeping. It lets you:
- deduplicate retries
- reconcile state safely
- query the result of an earlier action
- avoid duplicate creation bugs
Pair it with backend state tracking, safe retry logic and explicit reconciliation queries.
Handling 500 responses safely
A 500 response does not guarantee the operation failed. The resource may or may not have been created, updated, or submitted. Never assume failure on a 500 and retry blindly, because that can cause duplicate payments, duplicate customers, or duplicate tokens.
Safe handling pattern:
- Do not immediately retry the same request. A second attempt with the same
merchantUniquePaymentIdorcustomerUniqueIdmay be rejected (a repeated payment ID returns400) or, worse, it may succeed and create a duplicate. - Query the resource using the merchant-supplied identifier (
merchantUniquePaymentId,customerUniqueId, or similar). If it exists, the original request succeeded, so treat the500as transient. - If the resource does not exist, it is safe to submit a new request.
- Log the full response body and escalate to Zenith Payments support if the pattern repeats.
Debugging checklist
When investigating an error response:
- Read the
messagefield. - Note the HTTP status code and match it against the table above.
- Capture the full request payload and response body.
- Capture the request timestamp (UTC) and any merchant-side request identifier.
- For
409and500responses, check whether the resource already exists before retrying. - For
412responses, check merchant configuration and the upstream provider. - For persistent
500responses, escalate to Zenith Payments support with the captured context.