Build with Swiftpoint.
A unified interface for Nigerian virtual top-ups and digital bill payments.
REST over HTTPS · JSON · NGN amounts in whole naira (decimal amounts, where supported, must be represented with exactly two decimal places). Server-side integration only.
https://api.swiftpoint.example/v1
Authentication
Use a server-side bearer token issued from the planned merchant dashboard. Sandbox and production credentials must be separate, scoped and revocable. Never expose secret keys in browser code.
Authorization: Bearer TEST_KEY Content-Type: application/json Idempotency-Key: merchant-order-001
Send a unique idempotency key with each purchase. Retrying the same key and payload must return the original transaction instead of charging again. Reuse with a different payload should return 409.
Make your first transaction
Illustrative airtime request. Other services require plan identifiers or validated biller account details.
curl -X POST https://api.swiftpoint.example/v1/airtime \
-H 'Authorization: Bearer TEST_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: merchant-order-001' \
-d '{"network":"mtn","phone":"08012345678","amount":500}'Sample response · HTTP 202
{
"reference": "sp_test_001",
"status": "pending",
"service": "airtime",
"amount": "500.00",
"currency": "NGN"
}Pending is not delivery confirmation. Query transaction status or wait for a verified webhook.
Discover plans & verify recipients
Retrieve current service and plan identifiers from the catalogue. Verify an electricity meter or TV smartcard before purchase and use the returned validation reference. Do not hardcode live rates or treat a validation response as a payment.
Proposed endpoint catalogue
Endpoints are illustrative contracts. Service availability, pricing and specific provider codes must be retrieved from the catalogue rather than hardcoded.
Transaction lifecycle
| Status | Meaning | Merchant action |
|---|---|---|
| pending | Accepted, provider result unknown | Requery; do not retry with a new key. |
| successful | Provider confirmed delivery | Mark fulfilled; present receipt. |
| failed | Confirmed non-delivery | Check reversal status before retrying. |
| reversed | Eligible debit returned | Reconcile wallet ledger. |
Webhooks
Proposed event delivery to an HTTPS merchant endpoint. Verify HMAC-SHA256 over the UTF-8 string consisting of the Unix timestamp, a period, and the exact raw request body, using the assigned webhook secret. Compare signatures in constant time, reject stale timestamps, and deduplicate by event ID before updating records.
X-Swiftpoint-Timestamp: 1795996800
X-Swiftpoint-Signature: sha256=<hex-hmac>
{
"event_id": "evt_test_001",
"type": "transaction.successful",
"data": {"reference":"sp_test_001","status":"successful"}
}Return HTTP 2xx after durable receipt. Delivery can be repeated or arrive out of order. Requery if uncertain. Do not send sensitive electricity tokens or PIN codes in webhooks; retrieve via authenticated transaction details.
Error reference
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_request | Correct request fields. |
| 401/403 | unauthorized / forbidden | Check credentials and scopes. |
| 402 | insufficient_funds | Fund wallet before purchase. |
| 409 | idempotency_conflict | Same key, different payload. |
| 422 | validation_failed | Verify recipient or biller information. |
| 429 | rate_limited | Back off; respect Retry-After. |
| 503 | service_unavailable | Requery before retrying a purchase. |
Before going live
Confirm supplier contracts and service availability; build merchant verification, wallet ledger, price catalogue and payment integrations; implement idempotency, provider status reconciliation, reversal logic and signed webhooks; test real delivery, refunds, limits and data protection. Partner-dependent financial products require separate approval and integration.
