Preview: the API is being built and these endpoints may change

Errors

The error shape and every code you can get back.

Every response has the same four fields, errors included:

json
{
  "success": false,
  "data": null,
  "message": "Insufficient wallet balance",
  "code": "WALLET_INSUFFICIENT_FUNDS"
}

On success code is always OK. Branch on code, not on message: messages may be reworded, codes never change.

A validation error names each field in data.errors:

json
{
  "success": false,
  "data": { "errors": [{ "field": "amount", "message": "must be an amount in naira with at most 2 decimal places" }] },
  "message": "must be an amount in naira with at most 2 decimal places",
  "code": "VALIDATION_FAILED"
}

Codes

StatusCodeMeaning
400VALIDATION_FAILEDA field is missing or malformed, or the product_code cannot be sold right now; data.errors names the field
400IDEMPOTENCY_KEY_MISSINGA sale without an Idempotency-Key header
401AUTH_REQUIREDNo key, a key that does not exist, or a missing or invalid request signature
402WALLET_INSUFFICIENT_FUNDSThe available balance cannot cover the sale's fee
403PERMISSION_DENIEDThe key has an IP allowlist and this address is not on it, or the key may not do this
404NOT_FOUNDNo such transaction or resource
409IDEMPOTENCY_IN_PROGRESSThe same idempotency key is still running
409CONFLICTThe client_reference is already used; message names that sale's reference
413REQUEST_TOO_LARGEThe body is too large
422IDEMPOTENCY_FINGERPRINT_MISMATCHThe same idempotency key with a different body
429RATE_LIMITEDToo many requests; wait for Retry-After
500INTERNAL_ERRORSomething broke on our side; safe to repeat with the same Idempotency-Key
503SERVICE_UNAVAILABLEWe are briefly unavailable; repeat with the same Idempotency-Key

Failed sales

A failed sale is not an error: it answers 200 with status failed, a failure_code and a failure_message, and its hold is released.

Failure codeMeaning
ROUTING_NO_CANDIDATESNo line or channel could take the sale right now
PROVIDER_REJECTEDThe sale was refused for good, such as an invalid number; it is not tried again
RETRIES_EXHAUSTEDEvery line or channel tried failed for a passing reason
PROVIDER_FAILEDThe line or channel reported the sale failed