Skip to main content
Version: 1.0.0

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 codeErrorExplanation
300Multiple ChoicesThe 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.
400Bad RequestThe request was unacceptable, often because a required parameter is missing. A repeated merchantUniquePaymentId on POST /v2/payments also returns 400.
401UnauthorizedNo valid API key provided, or no credentials sent.
403ForbiddenThe API key does not have the right permissions to perform the request.
404Not FoundThe requested resource doesn't exist.
409ConflictA unique ID you sent is already used. Returned by POST /v2/cardproxies and POST /v2/credit-requests.
412Precondition FailedTokenisation failed (POST /v2/cardproxies), or the request is not allowed because of a limit or because it is not eligible (POST /v2/credit-requests).
422Unprocessable EntityThe merchant is forbidden to perform this operation (POST /v2/credit-requests).
5XXServer ErrorZenPay 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:

  1. Do not immediately retry the same request. A second attempt with the same merchantUniquePaymentId or customerUniqueId may be rejected (a repeated payment ID returns 400) or, worse, it may succeed and create a duplicate.
  2. Query the resource using the merchant-supplied identifier (merchantUniquePaymentId, customerUniqueId, or similar). If it exists, the original request succeeded, so treat the 500 as transient.
  3. If the resource does not exist, it is safe to submit a new request.
  4. Log the full response body and escalate to Zenith Payments support if the pattern repeats.

Debugging checklist​

When investigating an error response:

  1. Read the message field.
  2. Note the HTTP status code and match it against the table above.
  3. Capture the full request payload and response body.
  4. Capture the request timestamp (UTC) and any merchant-side request identifier.
  5. For 409 and 500 responses, check whether the resource already exists before retrying.
  6. For 412 responses, check merchant configuration and the upstream provider.
  7. For persistent 500 responses, escalate to Zenith Payments support with the captured context.