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": 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"
}
}{
"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_idis also sent as theX-Request-IDheader. Log it; support uses it to find your request.detailsis an optional list of{field, message}objects. Some codes add fields next toerror_code:retry_after_seconds,order_idandorder_ref, ormaintenance.- List endpoints add
meta.paginationas a cursor page:{limit, has_more, next_cursor, prev_cursor}. Passnext_cursorascursorfor the next page and stop whenhas_moreisfalse. - Responses look the same whichever network delivered the order. Branch on
error_codeandcustomer_status, never onmessageor a display label such asorder_statusorlabel. - 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
| HTTP | error_code | Meaning |
|---|---|---|
| 400 | VALIDATION_ERROR | A 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. |
| 400 | BULK_LINES_INVALID | One 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. |
| 400 | IDEMPOTENCY_KEY_REQUIRED | A purchase or bulk request has no Idempotency-Key header. |
| 400 | INVALID_CURSOR | The pagination cursor was not issued by this API. |
| 401 | UNAUTHORIZED | The API key is missing, malformed, revoked or replaced. |
| 403 | FORBIDDEN | This endpoint does not accept API keys. On the catalogue endpoints, also an account that is not active. |
| 403 | IP_NOT_WHITELISTED | The request came from outside your IP allowlist. |
| 403 | SANDBOX_TEST_KEY_REQUIRED | A live key, or no key, was sent to sandbox.paysef.com, which takes test keys only. Use api.paysef.com with a live key. |
| 403 | API_ACCOUNT_REQUIRED | A live key was used on an account that is not an API Partner account. Test keys work on any account. |
| 403 | ACCOUNT_SUSPENDED | Your account is suspended. |
| 403 | ACCOUNT_FROZEN | Your account is temporarily frozen. |
| 403 | ACCOUNT_CLOSED | Your account is closed. |
| 403 | WALLET_LOCKED | Your live wallet is on hold. Contact support. |
| 404 | NOT_FOUND | The order, batch, transaction or endpoint does not exist on your account. |
| 404 | SERVICE_NOT_FOUND | No service has that code or id. |
| 404 | PRODUCT_NOT_FOUND | The sku is unknown or switched off. (An airtime network or type that is not on sale is a 400 VALIDATION_ERROR.) |
| 404 | PROFILE_NOT_FOUND | Your account has no customer profile. Contact support. |
| 404 | PRICING_RULE_NOT_FOUND | The product has no price for your account. Contact support. |
| 404 | WALLET_NOT_FOUND | No live wallet exists for your account. |
| 409 | CONFLICT | An order with this reference already exists, or a concurrent update clashed. |
| 409 | DUPLICATE_PURCHASE | Same product to the same recipient within your duplicate-guard window. See retry_after_seconds. |
| 409 | ORDER_ALREADY_PLACED | A 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. |
| 409 | IDEMPOTENCY_IN_FLIGHT | The first request with this Idempotency-Key is still running. |
| 409 | IDEMPOTENCY_PAYLOAD_MISMATCH | This Idempotency-Key was used with a different body. |
| 422 | INSUFFICIENT_BALANCE | Not enough available balance (the test wallet, in test mode). |
| 422 | DAILY_LIMIT_EXCEEDED | Customer accounts only: the purchase would exceed your daily limit. |
| 422 | VTU_ORDER_FAILED | The provider refused the order and nothing was charged. details holds the order_ref. |
| 429 | RATE_LIMIT_EXCEEDED | Too 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. |
| 500 | INTERNAL_SERVER_ERROR | An unexpected error on our side. Quote the request_id to support. |
| 500 | CONFIGURATION_ERROR | Pay Sef cannot check smartcard or meter details right now. Try again later or contact support. |
| 502 | EXTERNAL_PROVIDER_ERROR | A provider could not be reached. |
| 503 | PRODUCT_UNAVAILABLE | The product is temporarily unavailable. |
| 503 | NO_PROVIDERS_AVAILABLE | No provider can fulfil the order right now. Nothing was charged. |
| 503 | SERVICE_MAINTENANCE | Planned 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
| Response | What to do |
|---|---|
| 4xx (except below) | Do not retry as is. Fix the request, then send it with a new Idempotency-Key. |
| 409 IDEMPOTENCY_IN_FLIGHT | Retry the same request with the same key after a few seconds. |
| 409 DUPLICATE_PURCHASE | Check 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_PLACED | The order exists. Read it with the order_id in the body and do not buy again. |
| 429 or 503 | Wait 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 timeout | Check 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.