Rwanda, Senegal & Liberia Mobile Money Gate
Accept Airtel Money, MTN MoMo and Orange Money pay-ins on a hosted page where the payer approves a push on their phone, and send mobile-money payouts in Rwanda (RWF), Senegal (XOF) and Liberia (LRD).
When to use it
The Mobile Money Gate accepts mobile-money pay-ins on a MagicPayments-hosted page, and sends mobile-money payouts to a phone number, in three countries. The integration is the same everywhere. Only the currency, the operators and the phone numbers differ:
| Country | Currency | Decimal places | Operators |
|---|---|---|---|
| Rwanda | RWF (Rwandan Franc) | 0 | Airtel Money, MTN MoMo |
| Senegal | XOF (West African CFA Franc) | 0 | Orange Money |
| Liberia | LRD (Liberian Dollar) | 2 | MTN MoMo, Orange Money |
| Operation | Rail | How the integration looks |
|---|---|---|
| Pay-in | Mobile money (push to payer) | Create an invoice, redirect the payer to the hosted page. |
| Pay-out | Mobile money (phone) | Server-to-server call to the phone payout endpoint. |
The Rwandan Franc and the CFA Franc have 0 decimal places, so the minor unit equals the
major one: "amount": 5000 means 5,000 RWF (or 5,000 XOF), not 50.00. Sending
500000 for a 5,000 RWF order overcharges the payer by 100×. This is the single most common
mistake on this gate.
The Liberian Dollar has 2 decimal places: "amount": 150050 means
1,500.50 LRD. Convert per currency. Code that multiplies by 100 for LRD must not do it for RWF or XOF.
You need your signing credentials from Getting started,
one pay-in gate_id per country and operator (Airtel Money and MTN MoMo in
Rwanda are separate gates, and so are MTN MoMo in Rwanda and MTN MoMo in Liberia), and one
pay-out cascade_id per country and operator. Your account manager provides all of
them.
Pay-in — hosted mobile-money page
The payer never touches your servers with their payment details. You create an invoice; we host the page where they enter their own mobile-money number and approve the charge on their handset.
Each operator is its own gate, because the operator is fixed before the page opens — the payer is not
asked to pick one. Choose the gate_id by the payer's country and number:
| Country | Operator | Number starts with | Local number | Gate |
|---|---|---|---|---|
| Rwanda | Airtel Money | 072, 073 | 10 digits, 07XXXXXXXX | your Rwanda Airtel gate_id |
| Rwanda | MTN MoMo | 078, 079 | 10 digits, 07XXXXXXXX | your Rwanda MTN gate_id |
| Senegal | Orange Money | 77, 78 | 9 digits, 7XXXXXXXX | your Senegal Orange gate_id |
| Liberia | MTN MoMo | 088, 055 | 10 digits, 0XXXXXXXXX | your Liberia MTN gate_id |
| Liberia | Orange Money | 077 | 10 digits, 0XXXXXXXXX | your Liberia Orange gate_id |
The hosted page speaks the country's languages: English, French and Kinyarwanda in Rwanda, French and English in Senegal, English in Liberia. It follows the payer's browser language.
-
Create the invoice
Call the gate endpoint with the operator's
gate_idand the amount in the country's currency (RWF,XOForLRD). If you already know the payer's number, pass it incustomer.phone_number— by default the page pre-fills it and the payer can still edit it before pressing Pay. If your account manager has turned on payer-data locking for this gate (a per-gate setting), the page shows the number read-only instead, so it must already be a valid number for the operator table above: the local number, or the country code (250,221or231) followed by the number without its leading0. Otherwise creation fails with400 invalid_customer_data(see Error handling). With locking on, the accepted number is stored normalised: country code plus digits, no+. -
Redirect the payer
Send the customer's browser to the
invoice_urlwe return. The page is branded for that operator, accepts only that operator's numbers, and shows that operator's approval steps. The payer confirms the number and presses Pay. - The payer approves on their phone The operator pushes a confirmation request to the handset and the payer enters their mobile-money PIN. On some operators the payer is instead sent to the operator's own confirmation page — we handle that redirect on the hosted page, so nothing changes on your side.
-
Receive the result
We call your
callback_urlon every status change and you can poll invoice status as a fallback.
/api/invoice{
"gate_id": "rw-mtn-momo-gate",
"invoice": {
"invoice_id": "order-rw-2026-000123",
"currency": "RWF",
"amount": 5000,
"description": "Wallet top-up",
"ttl_minutes": 30
},
"customer": {
"id": "cust-77120",
"full_name": "Mugisha Jean",
"email": "[email protected]",
"phone_number": "+250788123456"
},
"workflow_hooks": {
"callback_url": "https://merchant.example.com/mp/callbacks",
"return_success_url": "https://merchant.example.com/orders/123/done",
"return_decline_url": "https://merchant.example.com/orders/123/retry"
}
}
Python
resp = signed_post("/api/invoice", {
"gate_id": "rw-mtn-momo-gate", # the MTN gate — +250 78… number below
"invoice": {
"invoice_id": "order-rw-2026-000123",
"currency": "RWF",
"amount": 5_000, # 5,000 RWF — RWF has 0 decimal places
"description": "Wallet top-up",
"ttl_minutes": 30,
},
"customer": {
"id": "cust-77120",
"full_name": "Mugisha Jean",
"email": "[email protected]",
"phone_number": "+250788123456",
},
"workflow_hooks": {
"callback_url": "https://merchant.example.com/mp/callbacks",
"return_success_url": "https://merchant.example.com/orders/123/done",
"return_decline_url": "https://merchant.example.com/orders/123/retry",
},
})
invoice = resp.json()
redirect_url = invoice["invoice_url"] # send the payer here
Response
{
"request_id": "0f0b1d2e-...",
"request_status": "success",
"invoice_id": "62051f64-9a79-4edb-8a9e-95c86c55ee4e",
"merchant_invoice_id": "order-rw-2026-000123",
"invoice_status": "unpaid",
"invoice_url": "https://stage.example-mp.com/public/invoice/62051f64-.../gate",
"message": "Invoice (Gate PayIn) with internal uid=62051f64-... has been created."
}
With locking enabled and an invalid or wrong-operator customer.phone_number, no invoice is
created and no callback is sent — you get this instead:
{
"detail": "customer.phone_number belongs to a different operator: MTN MoMo numbers start with 078, 079.",
"error_code": "invalid_customer_data",
"field": "customer.phone_number",
"reason": "wrong_operator"
}
Rwandan mobile-money operators require the payer's full name and email on the charge request, so send
them on every country. Pass customer.full_name and customer.email when you create
the invoice. If you leave them out, the operator may reject the charge before the payer ever sees the
push.
Tracking the pay-in
Look up the invoice by your own id (or our invoice_uid). It reaches paid on success.
/api/invoice/statusresp = signed_post("/api/invoice/status", {
"merchant_invoice_id": "order-rw-2026-000123"
})
invoice = resp.json()
# invoice["status"] -> "paid" | "payment_failed" | "expired" | "canceled" | ...
# invoice["actual_payment"]["processing_info"]["amount_acquired"] -> settled amount, minor units
The charge sits in processing until the payer approves the push on their handset, which
can take a couple of minutes. Set a ttl_minutes that gives them room, and treat
processing as "not finished yet" rather than as a failure.
Pay-out — mobile money to a phone
Payouts go server-to-server. The destination is a phone number plus the operator that
serves it. Like pay-ins, payouts are split per country and operator: use the cascade_id of
the recipient's country and operator, and set phone.provider to that operator. The cascade
decides where the money goes, not phone.provider: a number from another operator goes to the
cascade's operator anyway and fails there, usually as a decline.
| Country | Operator | phone.provider | Cascade |
|---|---|---|---|
| Rwanda | Airtel Money | airtel | your Rwanda Airtel payout cascade_id |
| Rwanda | MTN MoMo | mtn | your Rwanda MTN payout cascade_id |
| Senegal | Orange Money | orange | your Senegal Orange payout cascade_id |
| Liberia | MTN MoMo | mtn | your Liberia MTN payout cascade_id |
| Liberia | Orange Money | orange | your Liberia Orange payout cascade_id |
/api/payment/payout/phone{
"cascade_id": "rw-mtn-payout",
"payment": {
"payment_id": "payout-rw-2026-000045",
"currency": "RWF",
"amount": 30000,
"description": "Affiliate payout"
},
"phone": {
"provider": "mtn",
"phone_number": "+250788123456"
},
"customer": {
"id": "partner-2391",
"full_name": "Uwase Claire",
"email": "[email protected]"
},
"workflow_hooks": {
"callback_url": "https://merchant.example.com/mp/callbacks"
}
}
Python
resp = signed_post("/api/payment/payout/phone", {
"cascade_id": "rw-mtn-payout",
"payment": {
"payment_id": "payout-rw-2026-000045",
"currency": "RWF",
"amount": 30_000, # 30,000 RWF
"description": "Affiliate payout",
},
"phone": {"provider": "mtn", "phone_number": "+250788123456"},
"customer": {
"id": "partner-2391",
"full_name": "Uwase Claire", # first and last name, space-separated
"email": "[email protected]", # required on payouts
},
"workflow_hooks": {"callback_url": "https://merchant.example.com/mp/callbacks"},
})
payout = resp.json()
payout_uid = payout["payment_id"] # our uid; status starts at "initiated"
Always send customer.full_name as first and last name separated by a space
("Uwase Claire", not "Claire") and a valid customer.email.
Without full_name no payout reaches the operator, and depending on the route a payout with a
one-word name or no email is stopped the same way: the request is accepted, then the payout moves to
error with error_code: "invalid_request" shortly after, and no money moves.
A malformed email is refused at once with 422.
Tracking the pay-out
Payouts use the payment status endpoint (not the invoice one).
/api/payment/statusresp = signed_post("/api/payment/status", {
"merchant_payment_id": "payout-rw-2026-000045"
})
# resp.json()["status"] -> "success" | "processing" | "decline" | "error"
Phone number format
Spaces, dashes, parentheses and a leading + are accepted and stripped. The accepted forms
depend on the country:
| Country | Accepted forms | Example |
|---|---|---|
| Rwanda | local 07XXXXXXXX, or 250 + 9 digits | +250 788 123 456 |
| Senegal | 221 + 9 digits only | +221 77 123 45 67 |
| Liberia | local 0XXXXXXXXX, or 231 + 9 digits | +231 886 123 456 |
Senegalese numbers have no leading 0, so the 9-digit local form
(771234567) can't be told apart from a short number, and a payout to it is refused.
Always send 221 in front (+221771234567). The pay-in page accepts both
forms.
What matters most is that the number belongs to the cascade's operator: a mismatch is the most common
cause of a decline on payout.
Testing & go-live
- On stage, use the test
gate_id/cascade_idfrom your account manager; no real funds move. - Verify you can drive a pay-in to
paidand a payout tosuccess, and that your callback handler verifies the signature and is idempotent. - Confirm your amount conversion once more before go-live: for RWF and XOF
amountis a whole number of francs with no ×100; for LRD it is in cents. - Check every country and operator you go live with end to end, each with its own gate and cascade. An integration that works on one is not proof the others are routed. Sending an MTN number to the Airtel gate is rejected on the page, not by the operator.
- Per-transaction limits apply in each country. Your account manager confirms the exact range for your terminal:
- Rwanda: roughly 100 RWF to 10,000,000 RWF.
- Senegal: 200 XOF to 500,000 XOF for pay-ins, 100 XOF to 500,000 XOF for payouts.
- Liberia: 100 LRD to 5,000,000 LRD for pay-ins, 10 LRD to 5,000,000 LRD for payouts.
- Swap base URL and credentials to production; the request shapes are identical.