Skip to main content

Errors

This page covers the global error model: the shape of every failure response, the HTTP status codes the API uses, and the message codes that can appear regardless of endpoint. For carrier-originated failures (INSUFFICIENT_FUNDS, BLACKLISTED, etc.), see Carrier errors.

Failure envelope

Failures use the same envelope as successful responses, with status: "FAIL" and a machine-readable message. payload is omitted or null.

{
"status": "FAIL",
"message": "BAD_REQUEST",
"status_code": 400,
"payload": null
}

HTTP status codes

HTTP statusMeaning
200The request reached the API. Inspect the JSON status field — it may still be "FAIL".
400Malformed request body or missing required fields.
401Missing, invalid, or inactive API key.
403Source IP not allowlisted, or the merchant has no integration for the requested service/country.
404Resource not found (for example, an unknown subscription_id).
500Unexpected server error. Safe to retry with exponential backoff.

A 200 response always contains a JSON envelope; clients must branch on status to detect business-logic failures. See Conventions → HTTP 200 with status: "FAIL".

Global message codes

These codes can be returned by any endpoint:

messageWhen
UNAUTHORIZEDAPI key missing, invalid, or inactive; or source IP not allowlisted.
BAD_REQUESTRequired fields missing, or schema validation failed.
METHOD_NOT_ALLOWEDWrong HTTP method. All endpoints are POST.
MERCHANT_SERVICE_NOT_CONFIGUREDThe merchant has no integration provisioned for that service_code + country_code combination.
ERRORUnexpected server-side failure. Safe to retry with backoff.

Endpoint-specific failures (for example SUBSCRIPTION_NOT_FOUND for the status endpoint) are documented on their respective pages.

Carrier-originated failures

A separate class of failures bubbles up from the underlying mobile carrier and is exposed via the message field. These are listed in Carrier errors. Carrier errors generally return HTTP 200 with status: "FAIL" because the request itself was valid — the carrier refused.