Skip to content
Pay Sef

Getting started

Quickstart

Make a sandbox data purchase in five steps. Nothing here spends real money.

1

Get a test key

Create an account at app.paysef.com (or in the Android app), open Profile → Developer, generate a test key and confirm with your PIN. Save it as an environment variable:

export PAYSEF_API_KEY="pays_test_…"

The examples below call the sandbox address, https://sandbox.paysef.com/api/v1, which takes test keys only. See the sandbox address.

2

Check your test wallet

Your test wallet starts with ₦900,000.00 of test funds (available_balance_kobo 90000000).

curl "https://sandbox.paysef.com/api/v1/wallets/me" \
  -H "Authorization: Bearer $PAYSEF_API_KEY"
3

Find a product

List MTN SME data bundles and pick a sku. The selling_price_kobo is what you will pay, in kobo.

curl "https://sandbox.paysef.com/api/v1/services/DATA/products?network=MTN&type=SME" \
  -H "Authorization: Bearer $PAYSEF_API_KEY"
4

Buy it

Send the purchase with a new Idempotency-Key and your own reference. A phone number ending in 0 succeeds immediately in the sandbox; try 2 for a pending order or 1 for a failure, when the service is simulated (see test numbers).

curl -X POST "https://sandbox.paysef.com/api/v1/vtu/data/purchase" \
  -H "Authorization: Bearer $PAYSEF_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ord_7Hk2pQ9xR4" \
  -d '{
  "sku": "DATA_MTN_SME_1GB",
  "phone_number": "08031234560",
  "reference": "quickstart-001"
}'
200 Done. Order delivered.
{
  "success": true,
  "status_code": 200,
  "message": "Done. Order delivered.",
  "data": {
    "order_id": "0199f2a4-6c1e-7b3a-9d42-5e8f1a2b3c4d",
    "order_ref": "VTU-20261017-9A8B7C6D5E4F",
    "reference": "quickstart-001",
    "client_reference": "quickstart-001",
    "recipient": "08031234560",
    "description": "MTN SME 1GB - 30 days — 08031234560",
    "face_value_kobo": 30000,
    "amount_debited_kobo": 28500,
    "status": "SUCCESS_SETTLED",
    "customer_status": "delivered",
    "money_location": "spent",
    "is_test": true,
    "created_at": "2026-10-17T12:00:00.000Z",
    "updated_at": "2026-10-17T12:00:00.412Z"
  },
  "meta": { "request_id": "01JAAXH6Z9R3M2K8Q4T7V5W1YB", "timestamp": "2026-10-17T12:00:00.430211Z" }
}
5

Check the order

Look the order up by your reference at any time, for example after a 202 or a timeout.

curl "https://sandbox.paysef.com/api/v1/vtu/orders/verify/quickstart-001" \
  -H "Authorization: Bearer $PAYSEF_API_KEY"

Next steps

Set up webhooks so you hear about pending orders without polling, read how idempotency keeps retries safe, then work through the going-live checklist.