Skip to content
Pay Sef

Core concepts

Order lifecycle

A purchase reserves funds, goes to a provider and ends in exactly one final status. Your integration only needs to react to the final ones.

Read the HTTP status first

HTTPOrder statusWhat to do
200SUCCESS_SETTLEDDelivered. Show the result (and the token or PIN, if any) to your customer.
202PENDING_PROVIDER_QUERYNot final. Wait for the webhook, or check the order at the poll_url path in the response. Do not buy again.
422FAILED_UNRESERVEDThe provider refused it. Nothing was charged. The error code is VTU_ORDER_FAILED.

All statuses

StatusFinalMeaning
INITIATEDNoThe order was created.
FUNDS_RESERVEDNoThe amount is held in your wallet.
DISPATCHING_PROVIDERNoThe order is being sent to the provider.
PENDING_PROVIDER_QUERYNoThe provider has not confirmed yet; Pay Sef keeps checking.
ADMIN_MANUAL_REVIEWNoPay Sef staff are reviewing the order. Funds stay reserved.
SUCCESS_SETTLEDYesDelivered and charged.
FAILED_UNRESERVEDYesFailed, immediately or after a pending period; the reservation was released and nothing was charged.
FAILED_REFUNDEDYesRefunded by Pay Sef after a review, for example from manual review or after an order was reported as not delivered.

The short view: customer_status and money_location

Every order also carries two fields that collapse the eight statuses into what a customer needs to know. Branch your integration on customer_status: it has only three values and is the same on orders, transaction history and webhooks, whichever network delivered the order. Keep status for your records.

statuscustomer_statusmoney_location
INITIATEDprocessingnot_charged
FUNDS_RESERVED, DISPATCHING_PROVIDER, PENDING_PROVIDER_QUERY, ADMIN_MANUAL_REVIEWprocessingheld
SUCCESS_SETTLEDdeliveredspent
FAILED_UNRESERVED, FAILED_REFUNDEDfailedrefunded

When an order fails, failure_reason is written for your customer (This order did not go through. Your money is back in your wallet.) and is safe to show as it is. An order in ADMIN_MANUAL_REVIEW carries one too: We are checking this order with the network. Your money is on hold, not spent.

Statuses can be added

Treat any status you do not recognise as not final, and keep checking the order. In rare cases Pay Sef corrects a final order after review (for example refunding one that was reported as not delivered); you get a webhook when that happens.

Resolving a pending order

  1. Store the order_id, order_ref and your own reference from the 202 response.
  2. Wait for an order.success, order.failed or order.refunded webhook.
  3. If no webhook arrives, call GET /vtu/orders/verify/{reference} with back-off (for example after 10 s, 30 s, 1 min, then every 5 min).
  4. Tell your customer the result only when the status is final.

Amounts on an order

face_value_kobo is the value delivered to the recipient (for example 50000 for ₦500 of airtime). amount_debited_kobo is what your wallet paid after any discount for your account type. Amounts are whole kobo (₦1 = 100 kobo).