CediLink API
Accept mobile money payments in Ghana through one integration. The live gateway is Yebeck for Ghana (mobile money on MTN, Telecel and AT, by direct prompt). There is no Nigeria gateway live on the production API: the Flutterwave adapter and the NGN methods exist in code, but no Nigeria gateway is registered on the live deployment, so an NGN payment cannot complete there. A customer pays through a CediLink checkout page; the money settles into your CediLink balance, and you withdraw it to your own account.
Read this before anything else
25000, never 250.00. Sending a decimal returns a 400. This is the single most common integration mistake, and getting it wrong by a factor of 100 is not a mistake you want to make with real money.Take a payment in five minutes
Sign up, copy your test secret key from the dashboard, and run this. No verification needed to start.
curl https://cedilinkweb-production.up.railway.app/v1/payment_intents \
-H "Authorization: Bearer sk_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"amount": 25000,
"currency": "GHS",
"method": "mobile_money",
"network": "MTN",
"customer": { "phone": "0244123456" },
"reference": "order-4471"
}'{
"id": "pi_01HXYZ",
"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_..."
}The payment is only created at this point — nothing has been asked of the customer yet, and the gateway has not been called. amount is the total the customer will pay (your 25000 plus the 3% customer fee);merchant_amount is the amount that settles to you. Send the customer to checkout_url — the ?cs= client secret in it 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, and the customer approves it with their MoMo PIN — the intent is processing while the prompt is out. Nothing is prompted before the customer confirms. After a recorded failure the checkout returns the customer to your return_url after 3 seconds, with a Return now link. After a recorded success it stays on the receipt, with a Start new payment button — the customer leaves by that button, or by refreshing, which starts a fresh payment. You find out through a webhook, not through the browser coming back.
Check the live build
GET /version is public, no key, and answers the commit the live API is running — { "status": "ok", "commit": "...", "mode": "live", "checkoutRecheck": "enabled", "degraded": false }. Use it to confirm a deploy landed before you test against it. checkoutRecheck: enabled means the checkout page re-queries the gateway itself when a payment is open (instant credit); degraded: true means that check failed to load — treat it as a failed deploy check. Note: this is at the API root, not under /v1.
How a payment moves
| Stage | What it means | What you do |
|---|---|---|
created | We have the intent, nothing has been asked of the customer, and the gateway has not been called yet. | Nothing — send the customer to checkout_url. |
requires_action | The customer needs to approve a prompt or complete a redirect. On the live Yebeck rail (Ghana) this is set once the prompt is sent — create returns created with no next_action, and requires_action appears on other rails at creation. | Send them to checkout_url — the checkout page reads next_action and branches. |
processing | In flight at the gateway. | Wait. |
succeeded | Money moved. Confirmed by us, not just claimed by a callback. | Ship the goods. |
failed | Terminal. The customer declined, had no funds, or the number was wrong. | Show the reason and let them retry. |
unknown | A gateway went quiet. The customer may or may not have been debited. | Treat as pending. Never re-charge. |
The one that catches people
unknown is not a failure. It means we asked a gateway to move money and never got a clear answer. We poll until we know, which is usually seconds and occasionally hours. If you treat it as failed and ask the customer to pay again, you will double-debit real people.Where to go next
| Page | What is there |
|---|---|
| Authentication | Keys, idempotency, and what belongs on a server. |
| Payments | Full endpoint reference with every field. |
| Webhooks | Signature verification, retries, and being idempotent. |
| Errors | Every code, what caused it, and what to tell the customer. |
| Testing scenarios | How to trigger a decline, a timeout, an amount mismatch. |
