Payments
A payment intent represents one attempt to collect money from one customer.
Ghana and Nigeria, one endpoint
/v1/payment_intents endpoint handles both currencies. Which fields are required — and what next_action comes back — depends on currency and method together, not on any separate country-specific route. One honest caveat: the NGN methods validate, but no Nigeria gateway is registered on the live deployment, so an NGN payment cannot complete there today — build for GHS unless told otherwise.Create a payment intent
/v1/payment_intentsBody
| Field | Type | Required | Notes |
|---|---|---|---|
amount | integer | yes | Minor units. Pesewas for GHS, kobo for NGN — both are 2 decimal places, so GH₵ 250.00 and ₦250.00 are each written as 25000. Decimals are rejected. No single deposit above 5,000.00 in the charge currency (amount_above_maximum); the 3% fee grosses up from there, so the largest prompt a customer can see is 5,150.00. |
currency | string | yes | GHS or NGN. Defaults to GHS if omitted. |
reference | string | yes | Your own order id. Unique within your account. |
method | string | yes | mobile_money (GHS only), bank_transfer (NGN only), ussd (NGN only), or card (NGN only). |
network | string | for mobile_money | MTN, TELECEL or AIRTELTIGO. Ghana only — there is no Nigerian equivalent field, see bank_code below for the NGN USSD case. |
bank_code | string | for ussd | The customer's own bank's numeric code (e.g. 058 for GTBank), not a mobile network. Fetch valid codes from GET /v1/banks?country=NG below and let the customer pick their bank — do not ask them to type this from memory. |
customer.phone | string | for mobile_money | Local or international. 0244123456 and 233244123456 both work. |
customer.email | string | no | Pass it when you have it — the receipt goes there. |
description | string | no | Shown to the customer on the prompt where the network supports it. |
return_url | string | no | Where the browser returns after a recorded failure — after 3 seconds, with a Return now link. After a recorded success the checkout stays on the receipt, with a Start new payment button. Pending or processing payments never redirect. The return is not proof of payment; only a verified succeeded status authorizes fulfilment. |
metadata | object | no | Round-tripped to your webhook. Strings only. |
Method × currency
Each payment method is only valid for one currency. Sending mobile_money with currency: "NGN", for example, returns a 400 — mobile money collection for Nigeria (OPay-style wallets) is not wired up yet and is tracked separately from bank transfer/USSD/card. And the NGN methods below validate but cannot complete on the live deployment: no Nigeria gateway is registered there today.
| Currency | Available methods |
|---|---|
| GHS | mobile_money |
| NGN | bank_transfer, ussd, card |
Ghana — mobile money
POST /v1/payment_intents
Authorization: Bearer sk_test_...
Idempotency-Key: 8f14e45f-ea5b-4c0f-9b3a-2c1d4e5f6a7b
Content-Type: application/json
{
"amount": 25000,
"currency": "GHS",
"method": "mobile_money",
"network": "MTN",
"customer": { "phone": "0244123456", "email": "ama@example.com" },
"reference": "order-4471",
"description": "Order #4471",
"metadata": { "cart_id": "c_9912" }
}{
"id": "pi_01HXYZ",
"object": "payment_intent",
"status": "created",
"amount": 25500,
"merchant_amount": 25000,
"fee_charged_to_customer": 500,
"currency": "GHS",
"reference": "order-4471",
"next_action": null,
"client_secret": "cs_...",
"checkout_url": "https://cedilink.vercel.app/checkout/pi_01HXYZ?cs=cs_...",
"created_at": "2026-08-02T12:42:00Z"
}The payment is only created — the gateway has not been called yet, so there is no next_action. amount is the total the customer pays (your 25000 plus the 3% customer fee); merchant_amount is what settles to you. Send the customer to checkout_url — the ?cs= client secret is part of the URL. On the checkout page the number the intent was created with is verified automatically as soon as it loads, and the page lands straight on the consent screen — the registered account name, the amount and the total. One Confirm tap sends the prompt to their handset (MTN, Telecel or AT — all three pay by direct prompt), and the intent is processing while the prompt is out. Nothing is prompted before the customer confirms, and there is no hosted redirect anywhere on this rail. Do not create another payment while one is processing. If the prompt is already on the phone, a second submit answers 409 — poll instead, never a second charge. If the checkout has expired, the answer is 410 and the customer needs a fresh payment link. A payment approved on the handset credits the merchant in about 5–7 seconds with the page open, within 15–20 seconds with it closed — GET /v1/checkout/{id} re-queries the gateway itself while the charge is open, so the status you poll is provider truth. Poll the intent no faster than every 5 seconds; only a verified succeeded status authorizes fulfilment. After a recorded failure the checkout returns the customer to return_url after 3 seconds and offers a Return now link; after a recorded success it stays on the receipt with a Start new payment button — pending or processing payments never redirect, and the return itself is not proof of payment.
Ghana — banks
/v1/banks?country=GHPublic — no API key required. The live Ghana rail lists the 23 Ghana banks (codes 3003xx) for the bank-transfer destination picker on disbursements.
{
"data": [
{ "code": "300302", "name": "Standard Chartered Bank" },
{ "code": "300304", "name": "GCB Bank Limited" },
{ "code": "300312", "name": "Ecobank Ghana Ltd" }
]
}Nigeria — bank transfer
Not live
A dynamic (one-time) virtual account number is generated for this exact charge. The customer transfers the exact amount into it from their own banking app or USSD — there is no push prompt to wait for, so the checkout experience is fundamentally different from mobile money. Show the account number, bank name, and a countdown; do not reuse “check your phone” copy here.
POST /v1/payment_intents
Authorization: Bearer sk_test_...
Idempotency-Key: 3a7c9e12-...
Content-Type: application/json
{
"amount": 500000,
"currency": "NGN",
"method": "bank_transfer",
"customer": { "email": "chidi@example.com" },
"reference": "order-4472"
}{
"id": "pi_01HXAB",
"object": "payment_intent",
"status": "requires_action",
"amount": 510000,
"merchant_amount": 500000,
"fee_charged_to_customer": 10000,
"currency": "NGN",
"reference": "order-4472",
"next_action": {
"type": "virtual_account",
"accountNumber": "8901234567",
"bankName": "Wema Bank",
"accountName": "CediLink",
"expiresAt": "2026-08-02T13:42:00Z"
},
"client_secret": "cs_...",
"checkout_url": "https://cedilink.vercel.app/checkout/pi_01HXAB?cs=cs_...",
"created_at": "2026-08-02T12:42:00Z"
}Dynamic virtual accounts expire — typically in 1 hour
next_action.expiresAt, the account stops accepting funds. Your checkout UI should show a live countdown, same as the MoMo prompt timer.Nigeria — USSD
Not live
The customer dials their own bank’s USSD code and completes the payment from that menu. This requires bank_code— the customer’s bank, identified by its numeric code, not a mobile network. Fetch the list of valid codes first so your checkout can show a bank picker rather than a free-text field.
List Nigerian banks
/v1/banks?country=NGPublic — no API key required. This is reference data your checkout page needs before a payment method is even chosen, so it is not gated behind authentication. The list comes from the active rail: on the live Ghana rail (Yebeck) this answers 502 — Yebeck lists Ghana banks only — and the Nigeria list is served when the Flutterwave rail is configured.
{
"data": [
{ "code": "044", "name": "Access Bank" },
{ "code": "058", "name": "Guaranty Trust Bank" },
{ "code": "057", "name": "Zenith Bank" }
]
}POST /v1/payment_intents
Authorization: Bearer sk_test_...
Idempotency-Key: 5d2f8a01-...
Content-Type: application/json
{
"amount": 250000,
"currency": "NGN",
"method": "ussd",
"bank_code": "058",
"customer": { "email": "ngozi@example.com" },
"reference": "order-4473"
}{
"id": "pi_01HXCD",
"object": "payment_intent",
"status": "requires_action",
"amount": 255000,
"merchant_amount": 250000,
"fee_charged_to_customer": 5000,
"currency": "NGN",
"reference": "order-4473",
"next_action": {
"type": "await_prompt",
"expires_at": "2026-08-02T12:47:00Z",
"ussd_fallback": "*737*50*2500#"
},
"client_secret": "cs_...",
"checkout_url": "https://cedilink.vercel.app/checkout/pi_01HXCD?cs=cs_...",
"created_at": "2026-08-02T12:42:00Z"
}Handling next_action
Branch on next_action.type. When it appears depends on the rail: on the Yebeck rail (Ghana) create returns next_action: null and the action is set once the customer verifies their number on the checkout page; on other rails it can be returned at creation. The checkout page handles the branch for you — this table is for merchants driving their own UI.
| Type | What to do |
|---|---|
await_prompt | Show “check your phone and approve”. Display ussd_fallback if present — it only appears on the Nigeria USSD rail, which is not live. |
virtual_account | NGN bank_transfer only — not live. Show accountNumber, bankName, and accountName for the customer to transfer into. Show a countdown to expiresAt. There is nothing to “wait for a buzz” on — the customer must actively act. |
redirect | Send the browser to next_action.url. |
submit_otp | Collect the code and POST it to /v1/payment_intents/{id}/validate with { otp }. A wrong code answers 402 otp_invalid. |
submit_pin | Collect the PIN and POST it to the same /v1/payment_intents/{id}/validate endpoint. |
none | Nothing to do. Wait for the webhook. |
Show the USSD fallback when the rail provides one
Retrieve a payment intent
/v1/payment_intents/{id}Safe to poll, but webhooks are the intended mechanism. Poll no faster than every 5 seconds — the checkout re-query is throttled to once per 10 seconds per charge, and there is no per-key rate limit — and rely on the webhook for the final answer. Only a verified succeeded status authorizes fulfilment.
{
"id": "pi_01HXYZ",
"object": "payment_intent",
"status": "succeeded",
"amount": 25500,
"merchant_amount": 25000,
"fee_charged_to_customer": 500,
"currency": "GHS",
"reference": "order-4471"
}amount is the grossed total the customer paid. Settle against merchant_amount — the requested figure — or you will over-credit wallets by the fee.
The browser returning is not proof of payment
return_url means their browser finished a redirect. It does not mean money moved, and anyone who reads your JavaScript can hit that URL directly. Ship goods on the webhook, never on the redirect.Verify a number before prompting
Prompts go out without any number check unless you verify first. Call this endpoint before creating a payment intent: it confirms the number holds a live MoMo account on the network and shows you the exact amount the customer will pay, so your checkout can display the account holder's name and the total for the customer to confirm. Only a verified: true answer approves sending the prompt. That is advice, not a gate — nothing on the payment path refuses on a missing name: create and the checkout account check always proceed, and the prompt itself is the final check.
Available on the live Ghana rail
verified: true and the account name. Only a verified: true answer approves sending the prompt — and the checkout page runs the same lookup for you, but it never blocks the payment either: the prompt itself is the final check./v1/verify-numberSecret-key only. This endpoint never sends a prompt itself — after a verified answer, create the payment intent with POST /v1/payment_intents as usual.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
phone | string | yes | Local or international. 0244123456 and 233244123456 both work. The response returns the canonical 233… form. |
network | string | no | MTN, TELECEL or AIRTELTIGO. Detected from the number's prefix when omitted. |
amount_minor | integer | no | The amount the merchant is charging, in minor units. When given, the response shows the total the customer will actually pay: requested amount plus the 3% customer fee, exactly as the prompt will ask for it. |
currency | string | no | GHS by default. |
POST /v1/verify-number
Authorization: Bearer sk_test_...
Content-Type: application/json
{
"phone": "0244123456",
"network": "MTN",
"amount_minor": 5000,
"currency": "GHS"
}{
"verified": true,
"account_name": "AMA SERWAA",
"can_prompt": true,
"phone": "233244123456",
"network": "MTN",
"amount": {
"requested_minor": 5000,
"customer_fee_minor": 100,
"total_minor": 5100,
"total_display": "GH₵51.00",
"currency": "GHS"
}
}{
"verified": false,
"reason": "no_account",
"can_prompt": false,
"phone": "233244123456",
"network": "MTN",
"amount": { "...": "same amount block as above" }
}Only verified: true approves the prompt
no_account means do not send the prompt — the number holds no MoMo account on that network. An unavailable check answers 502: the check itself could not run, so retry later rather than prompting blind. This endpoint advises only — it never gates the prompt; the payment path always proceeds and the prompt itself is the final check. And verify once per number (for example on first payment) and reuse the result: each verification is a provider call.Direct checkout — client secret
The checkout page's own calls, for merchants driving their own UI. All are authenticated by the intent's client secret (?cs=), not by an API key, so they are safe to call from a browser.
Read the intent
/v1/checkout/{id}?cs={client_secret}Amount, merchant name, method, network, the masked customer hint, next_action and expires_at, plus the receipt in GH₵ amounts only — merchant_amount, fee_charged_to_customer and the grossed total. While the charge is still open this read also re-queries the gateway (throttled to once per 10 seconds per charge), so a payment approved on the handset shows as succeeded within seconds.
Check the account name
/v1/checkout/{id}/yebeck?cs={client_secret}{
"phone": "0244123456",
"network": "MTN"
}201 with the registered account name, bound to the intent server-side. The lookup never refuses: a lookup that finds no account, answers without a name, or cannot run returns 201 with account_name: null — the prompt itself is the final check. A repeat call returns the stored binding, never a second lookup. The body may be empty ({} or no body at all): the call then falls back to the phone and network the intent was created with, and refuses 400 phone_required only when the intent has no stored phone. 503 yebeck_unavailable when Yebeck is not the active gateway; 410 checkout_expired when the checkout has expired.
Send the MoMo prompt
/v1/checkout/{id}/momo?cs={client_secret}{
"phone": "0244123456",
"network": "MTN"
}201 means processing / await_prompt — the prompt is out. The body may be empty here too, using the number bound by the account check. 409 already_submitted when a prompt is already waiting — poll instead, never a second prompt. 410 checkout_expired when the checkout has expired. Only this call sends the prompt, and only after the customer confirmed on the consent screen.
Validate an OTP at checkout
/v1/checkout/{id}/validate?cs={client_secret}{ otp }. A wrong code answers 402 otp_invalid. The merchant-API equivalent is POST /v1/payment_intents/{id}/validate with your secret key.
Refunds
Public — no API key. A refund is matched to a succeeded charge by its provider reference and the number it was paid with, so only someone who knows both can ask for one.
/v1/refunds/request{
"provider_ref": "MVN-261126-CF3D0D56",
"phone": "0244123456",
"reason": "Customer requested a refund"
}201 returns { data: { id: "rfd_...", status: "pending" } }; a second request for the same payment returns 200 with already_requested: true; no matching succeeded charge returns 404 refund_not_matched; a bad body returns 400 invalid_input. The refund amount is the charge amount minus the PIN fee. An admin approves it before any money moves.
/v1/refunds/status/{id}200 returns { data: { id, status, amount_minor, created_at } }; unknown id returns 404.
