Skip to content

Errors ​

Every error has the same shape. Branch on error.code; it never changes.

json
{
  "success": false,
  "message": "Your balance is too low for this.",
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "hint": "Top up your balance, then make a new quote.",
    "docs_url": "https://docs.partners.xash.co.zw/errors#insufficient_balance"
  }
}

The API never answers 502 or 504. When a provider's answer is unknown, you get 202 with status pending, not an error.

CodeHTTPMeaningWhat to do
KEY_INVALID401The API key is missing, wrong, expired or revoked.Send Authorization: Bearer xash_test_... or xash_live_... Create a new key in Developers → API keys if needed.
KEY_ENVIRONMENT_MISMATCH401This key belongs to the other environment for this request.Use a xash_test_ key for sandbox and a xash_live_ key for live.
ABILITY_MISSING403This key is not allowed to do that.Create a key that has the ability named in error.ability.
IP_NOT_ALLOWED403Requests from this IP address are not allowed for this partner.Add your server IP in Settings → Security, or call from an allowed IP.
LIVE_NOT_ENABLED403Live sales are not enabled for this partner yet.Finish go-live in the portal: turn on 2FA, accept the terms and make a first top-up.
PARTNER_PAUSED403This partner is paused.Check error.reason. If your balance is below zero, top up. Otherwise contact support.
NOT_FOUND404Nothing exists at this address.Check the path against https://docs.partners.xash.co.zw/openapi.json.
METHOD_NOT_ALLOWED405This address does not accept that HTTP method.Check the HTTP method against the API reference.
VALIDATION_FAILED422Some fields are missing or invalid.Fix the fields listed in errors and send the request again.
RECIPIENT_INVALID422The provider rejected this phone number, meter or account.Ask your customer to check the number, meter or account, then make a new quote.
INSUFFICIENT_BALANCE402Your balance is too low for this.Top up your balance, then make a new quote.
LIMIT_EXCEEDED409This would go over one of your limits.error.limit says which limit. Wait for it to reset, or ask support to raise it.
QUOTE_EXPIRED409This quote has expired.Make a new quote. Quotes last 5 minutes.
QUOTE_USED409This quote has already been used.Look up the existing transaction by your reference instead of buying again.
IDEMPOTENCY_CONFLICT409This reference or Idempotency-Key was already used with different details.Use a new reference for a new sale. To retry the same sale, send exactly the same body and key.
IDEMPOTENCY_IN_PROGRESS409A request with this Idempotency-Key is still being processed.Wait a second and send the same request again.
PRODUCT_UNAVAILABLE409This product is paused right now.Try again later, or offer your customer another product.
COLLECTION_METHOD_UNAVAILABLE409This payment method is paused right now.Try again later, or ask your customer to pay another way.
OTP_INVALID422The OTP is wrong or has expired.Ask your customer for the latest OTP and confirm again.
RATE_LIMITED429Too many requests.Wait for the Retry-After seconds, then retry.
VELOCITY_LIMITED429Too many sales in a short time.Wait for the Retry-After seconds, then retry.
UPSTREAM_UNAVAILABLE503The provider could not be reached. Nothing was sent.It is safe to send the same request again after Retry-After seconds.
INTERNAL_ERROR500Something went wrong on our side.Retry with the same Idempotency-Key. If it keeps failing, contact support with the X-Request-Id.

Xash Partners API. Sandbox keys never move real money.