Skip to content
Pay Sef

Core concepts

Responses and errors

Every response has the same shape. Branch on the HTTP status and error_code; show the message to people, never parse it.

The response envelope

Success
{
  "success": true,
  "status_code": 200,
  "message": "Done. Order delivered.",
  "data": { "order_id": "0199f2a4-…", "status": "SUCCESS_SETTLED" },
  "meta": {
    "request_id": "01JAAXH6Z9R3M2K8Q4T7V5W1YB",
    "timestamp": "2026-10-17T12:00:00.123456Z"
  }
}
Error
{
  "success": false,
  "status_code": 403,
  "error_code": "WALLET_LOCKED",
  "message": "Your wallet is on hold, so it cannot be used right now. Your money is safe. Contact support to sort it out.",
  "meta": {
    "request_id": "01JAAXH6Z9R3M2K8Q4T7V5W1YB",
    "timestamp": "2026-10-17T12:00:00.123456Z"
  }
}
  • meta.request_id is also sent as the X-Request-ID header. Log it; support uses it to find your request.
  • details is an optional list of {field, message} objects. Some codes add fields next to error_code: retry_after_seconds, order_id and order_ref, or maintenance.
  • List endpoints add meta.pagination as a cursor page: {limit, has_more, next_cursor, prev_cursor}. Pass next_cursor as cursor for the next page and stop when has_more is false.
  • Responses look the same whichever network delivered the order. Branch on error_code and customer_status, never on message or a display label such as order_status or label.
  • Timestamps are UTC, ISO 8601, ending in Z.
  • Amounts are whole kobo as JSON integers (₦1 = 100 kobo) in fields ending _kobo; rates end _bp (basis points). Send text fields such as phone numbers as strings.
  • Keys are only ever added, never renamed or removed: ignore the ones you do not use. A key marked deprecated keeps working until integrations have moved off it.

Error codes

HTTPerror_codeMeaning
400VALIDATION_ERRORA field is missing, invalid or of the wrong JSON type (for example a number where a string is expected), a naira field such as amount was sent instead of amount_kobo, the sku belongs to another service, an airtime network or type is not on sale, the Idempotency-Key is over 100 characters, or the body is over 32 KB. The message names the problem.
400BULK_LINES_INVALIDOne or more lines of a bulk purchase cannot be bought. details lists each one (recipients[3] or phone_numbers[3]) with the reason. Nothing was charged.
400IDEMPOTENCY_KEY_REQUIREDA purchase or bulk request has no Idempotency-Key header.
400INVALID_CURSORThe pagination cursor was not issued by this API.
401UNAUTHORIZEDThe API key is missing, malformed, revoked or replaced.
403FORBIDDENThis endpoint does not accept API keys. On the catalogue endpoints, also an account that is not active.
403IP_NOT_WHITELISTEDThe request came from outside your IP allowlist.
403SANDBOX_TEST_KEY_REQUIREDA live key, or no key, was sent to sandbox.paysef.com, which takes test keys only. Use api.paysef.com with a live key.
403API_ACCOUNT_REQUIREDA live key was used on an account that is not an API Partner account. Test keys work on any account.
403ACCOUNT_SUSPENDEDYour account is suspended.
403ACCOUNT_FROZENYour account is temporarily frozen.
403ACCOUNT_CLOSEDYour account is closed.
403WALLET_LOCKEDYour live wallet is on hold. Contact support.
404NOT_FOUNDThe order, batch, transaction or endpoint does not exist on your account.
404SERVICE_NOT_FOUNDNo service has that code or id.
404PRODUCT_NOT_FOUNDThe sku is unknown or switched off. (An airtime network or type that is not on sale is a 400 VALIDATION_ERROR.)
404PROFILE_NOT_FOUNDYour account has no customer profile. Contact support.
404PRICING_RULE_NOT_FOUNDThe product has no price for your account. Contact support.
404WALLET_NOT_FOUNDNo live wallet exists for your account.
409CONFLICTAn order with this reference already exists, or a concurrent update clashed.
409DUPLICATE_PURCHASESame product to the same recipient within your duplicate-guard window. See retry_after_seconds.
409ORDER_ALREADY_PLACEDA retry with the same Idempotency-Key arrived after the first attempt placed the order but could not answer. The body carries order_id and order_ref; check that order instead of buying again.
409IDEMPOTENCY_IN_FLIGHTThe first request with this Idempotency-Key is still running.
409IDEMPOTENCY_PAYLOAD_MISMATCHThis Idempotency-Key was used with a different body.
422INSUFFICIENT_BALANCENot enough available balance (the test wallet, in test mode).
422DAILY_LIMIT_EXCEEDEDCustomer accounts only: the purchase would exceed your daily limit.
422VTU_ORDER_FAILEDThe provider refused the order and nothing was charged. details holds the order_ref.
429RATE_LIMIT_EXCEEDEDToo many requests within the window (see rate limits on the security page). Wait retry_after_seconds when the body carries it; the Retry-After header has the same value.
500INTERNAL_SERVER_ERRORAn unexpected error on our side. Quote the request_id to support.
500CONFIGURATION_ERRORPay Sef cannot check smartcard or meter details right now. Try again later or contact support.
502EXTERNAL_PROVIDER_ERRORA provider could not be reached.
503PRODUCT_UNAVAILABLEThe product is temporarily unavailable.
503NO_PROVIDERS_AVAILABLENo provider can fulfil the order right now. Nothing was charged.
503SERVICE_MAINTENANCEPlanned maintenance. The body carries retry_after_seconds and maintenance.level (READ_ONLY: reads work, purchases and validation are refused; FULL: everything is refused) with maintenance.expected_end_at.

When to retry

ResponseWhat to do
4xx (except below)Do not retry as is. Fix the request, then send it with a new Idempotency-Key.
409 IDEMPOTENCY_IN_FLIGHTRetry the same request with the same key after a few seconds.
409 DUPLICATE_PURCHASECheck whether the earlier order is what you wanted. If you really need another, wait retry_after_seconds and use a new key.
409 ORDER_ALREADY_PLACEDThe order exists. Read it with the order_id in the body and do not buy again.
429 or 503Wait for retry_after_seconds (also sent as the Retry-After header) when the response has it, otherwise up to 60 seconds. Retry a purchase with the same Idempotency-Key, and cache catalogue responses.
5xx or a timeoutCheck with verify whether the order exists. If it does not, retry with a new key and exponential back-off.

A timeout is not a failure

If a purchase times out, the order may still have been created. Never charge your customer again or retry with a new key until you have confirmed there is no order.