Getting started
Test mode and Live mode
Build against Test data with the Abuna simulator or provider sandboxes, then switch to Live with the same code.
Every app has two environments, Test and Live. Each has its own app ID, secret keys, publishable key, webhook signing secret, webhook URL, and data. The app ID in the path picks the mode. There is no mode parameter.
In the dashboard, use the Test and Live switch to move between them. In the API, GET /v1/apps/{appID} returns the app's environment, test or live. Every webhook body carries it too.
Test mode
Build and test with the Test app ID and its sk_test_ key. Test mode works like Live mode, with these differences:
- Payments move no money. They go through the Abuna simulator, or through any provider sandbox you connect. See Test payments.
- You don't need a verified email.
- Plan limits on subscribers don't apply, and your plan never makes a Test app read-only.
- Customer emails and Telegram messages aren't sent. Abuna records each one as a
notification.capturedevent, which never goes to your webhook endpoint. The notices list stays empty. - A checkout session's
success_urlandcancel_urlcan behttpURLs onlocalhost,127.0.0.1, or[::1]. Live mode takes onlyhttps. - A new Test app doesn't copy the Live app's webhook URL. Set one for Test separately, under Webhooks in Test mode.
Test payments
A Test app can always take payments through the Abuna simulator. A team owner can also connect the sandbox of each provider, pawaPay, Notch Pay, and Flutterwave, side by side. The Payments page, under Settings in Test mode, lists the simulator and every connected sandbox. Each sandbox has its own Webhook URL.
On a Test pay page, the payer chooses under Test with: Abuna simulator, the default, or a connected sandbox, such as pawaPay sandbox. Live pay pages never offer this choice.
- Abuna simulator: you pick each outcome on the pay page. See Simulated payments.
- A provider sandbox: the pay page offers the provider's networks, a phone number field, and the provider's test numbers. Choosing a test number fills in the phone number and its network. Payments update and fail as the provider reports them. See Test numbers.
Connect a sandbox to see how your provider behaves before you go Live. Disconnecting one leaves the simulator and your other sandboxes as they are. Both are free and unlimited on every plan. See Test with your provider's sandbox.
Simulated payments
The Abuna simulator has one payment method per outcome. On the Test pay page, the customer picks one:
- Successful payment (
test): the payment succeeds. - Needs approval, then succeeds (
test_pending): the payment ispendingat first, like a mobile money prompt. It succeeds on the first status check after 10 seconds. The pay page checks for you. - Declined payment (
test_declined): fails with402and codepayment_declined. - Insufficient balance (
test_insufficient): fails with402and codeinsufficient_funds.
When your server charges an entry with POST /v1/apps/{appID}/entries/{id}/pay, a Test app always uses the simulator's test method, so the payment succeeds.
To try another outcome without the pay page, send it to the pay link's endpoint. This endpoint takes no key. Use the entry's pay_token.
curl https://api.abuna.app/v1/pay/3a7e1c9f5b2d8a4e6c0f7b3d9a1e5c8f2b6d \
-H "Content-Type: application/json" \
-d '{"method": "test_declined"}'{
"code": "payment_declined",
"error": "payment was declined"
}To pay through a connected sandbox instead, add provider: pawapay, notchpay, or flutterwave. Leave it out for the simulator. method is then one of the provider's networks, and phone_number is the number to charge instead of the customer's. A provider the Test app hasn't connected returns 422 with code payment_unavailable, and so does provider on a Live pay link.
curl https://api.abuna.app/v1/pay/3a7e1c9f5b2d8a4e6c0f7b3d9a1e5c8f2b6d \
-H "Content-Type: application/json" \
-d '{"provider": "pawapay", "method": "MTN_MOMO_CMR", "phone_number": "+237653456039"}'Test numbers
Each provider's sandbox settles a payment according to the phone number charged. Test pay pages show the same numbers as these tables, for the network chosen. The failure reason your customer sees depends on what the provider reports.
- pawaPay: the sandbox never asks for a PIN. A number that gets no answer stays
pending. See pawaPay's test numbers. - Notch Pay: the last digit picks the outcome. Notch Pay checks for fraud in its sandbox too, so don't use one number for every test. It has no test numbers for Benin or Burkina Faso. See Notch Pay's testing page.
- Flutterwave: its test mode completes every mobile money payment after a few seconds, whatever the number. It has no number that fails a payment in Cameroon, so use the Abuna simulator to try failures. See Flutterwave's testing page.
pawaPay
| Number | Network | What happens |
|---|---|---|
+237653456789 | MTN Mobile Money Cameroon | Succeeds |
+237653456129 | MTN Mobile Money Cameroon | No answer, stays pending |
+237653456019 | MTN Mobile Money Cameroon | Fails: account limit reached |
+237653456029 | MTN Mobile Money Cameroon | Fails: no mobile money account |
+237653456039 | MTN Mobile Money Cameroon | Fails: not approved on the phone |
+237653456069 | MTN Mobile Money Cameroon | Fails: declined |
+237693456789 | Orange Money Cameroon | Succeeds |
+237693456129 | Orange Money Cameroon | No answer, stays pending |
+237693456019 | Orange Money Cameroon | Fails: account limit reached |
+237693456029 | Orange Money Cameroon | Fails: no mobile money account |
+237693456039 | Orange Money Cameroon | Fails: not approved on the phone |
+237693456049 | Orange Money Cameroon | Fails: balance too low |
+237693456069 | Orange Money Cameroon | Fails: declined |
+2250503456789 | MTN Mobile Money Côte d'Ivoire | Succeeds |
+2250503456129 | MTN Mobile Money Côte d'Ivoire | No answer, stays pending |
+2250503456029 | MTN Mobile Money Côte d'Ivoire | Fails: no mobile money account |
+2250503456039 | MTN Mobile Money Côte d'Ivoire | Fails: not approved on the phone |
+2250503456069 | MTN Mobile Money Côte d'Ivoire | Fails: declined |
+2250734567890 | Orange Money Côte d'Ivoire | Succeeds |
+2250734567130 | Orange Money Côte d'Ivoire | No answer, stays pending |
+2250734567030 | Orange Money Côte d'Ivoire | Fails: not approved on the phone |
+2250734567060 | Orange Money Côte d'Ivoire | Fails: declined |
+221763456789 | Free Money Senegal | Succeeds |
+221763456129 | Free Money Senegal | No answer, stays pending |
+221763456049 | Free Money Senegal | Fails: balance too low |
+221763456069 | Free Money Senegal | Fails: declined |
+221773456789 | Orange Money Senegal | Succeeds |
+221773456129 | Orange Money Senegal | No answer, stays pending |
+221773456029 | Orange Money Senegal | Fails: no mobile money account |
+221773456049 | Orange Money Senegal | Fails: balance too low |
+221773456069 | Orange Money Senegal | Fails: declined |
+22951345789 | MTN Mobile Money Benin | Succeeds |
+22951345129 | MTN Mobile Money Benin | No answer, stays pending |
+22951345029 | MTN Mobile Money Benin | Fails: no mobile money account |
+22951345039 | MTN Mobile Money Benin | Fails: not approved on the phone |
+22951345069 | MTN Mobile Money Benin | Fails: declined |
+22995345789 | Moov Money Benin | Succeeds |
+22995345639 | Moov Money Benin | No answer, stays pending |
+22995345679 | Moov Money Benin | Fails: not approved on the phone |
+22995345529 | Moov Money Benin | Fails: declined |
+22602345678 | Moov Money Burkina Faso | Succeeds |
+22602345138 | Moov Money Burkina Faso | No answer, stays pending |
+22602345048 | Moov Money Burkina Faso | Fails: balance too low |
+22602345068 | Moov Money Burkina Faso | Fails: declined |
+242063456789 | MTN Mobile Money Congo | Succeeds |
+242063456129 | MTN Mobile Money Congo | No answer, stays pending |
+242063456029 | MTN Mobile Money Congo | Fails: no mobile money account |
+242063456039 | MTN Mobile Money Congo | Fails: not approved on the phone |
+242063456049 | MTN Mobile Money Congo | Fails: balance too low |
+242063456069 | MTN Mobile Money Congo | Fails: declined |
+242053456789 | Airtel Money Congo | Succeeds |
+242053456129 | Airtel Money Congo | No answer, stays pending |
+242053456039 | Airtel Money Congo | Fails: not approved on the phone |
+242053456049 | Airtel Money Congo | Fails: balance too low |
+242053456069 | Airtel Money Congo | Fails: declined |
+24174345678 | Airtel Money Gabon | Succeeds |
+24174345128 | Airtel Money Gabon | No answer, stays pending |
+24174345048 | Airtel Money Gabon | Fails: balance too low |
+24174345068 | Airtel Money Gabon | Fails: declined |
Notch Pay
| Number | Network | What happens |
|---|---|---|
+237670000000 | MTN Mobile Money Cameroon | Succeeds |
+237670000001 | MTN Mobile Money Cameroon | Fails: balance too low |
+237670000002 | MTN Mobile Money Cameroon | Fails: declined |
+237670000003 | MTN Mobile Money Cameroon | No answer, stays pending |
+237670000004 | MTN Mobile Money Cameroon | Fails: not approved on the phone |
+237690000000 | Orange Money Cameroon | Succeeds |
+237690000001 | Orange Money Cameroon | Fails: balance too low |
+237690000002 | Orange Money Cameroon | Fails: declined |
+237690000003 | Orange Money Cameroon | No answer, stays pending |
+237690000004 | Orange Money Cameroon | Fails: not approved on the phone |
+225050000000 | MTN Mobile Money Côte d'Ivoire | Succeeds |
+225050000001 | MTN Mobile Money Côte d'Ivoire | Fails: balance too low |
+225050000002 | MTN Mobile Money Côte d'Ivoire | Fails: declined |
+225050000003 | MTN Mobile Money Côte d'Ivoire | No answer, stays pending |
+225050000004 | MTN Mobile Money Côte d'Ivoire | Fails: not approved on the phone |
+225070000000 | Orange Money Côte d'Ivoire | Succeeds |
+225070000001 | Orange Money Côte d'Ivoire | Fails: balance too low |
+225070000002 | Orange Money Côte d'Ivoire | Fails: declined |
+225070000003 | Orange Money Côte d'Ivoire | No answer, stays pending |
+225070000004 | Orange Money Côte d'Ivoire | Fails: not approved on the phone |
+225010000000 | Moov Money Côte d'Ivoire | Succeeds |
+225010000001 | Moov Money Côte d'Ivoire | Fails: balance too low |
+225010000002 | Moov Money Côte d'Ivoire | Fails: declined |
+225010000003 | Moov Money Côte d'Ivoire | No answer, stays pending |
+225010000004 | Moov Money Côte d'Ivoire | Fails: not approved on the phone |
+221770000000 | Orange Money Senegal | Succeeds |
+221770000001 | Orange Money Senegal | Fails: balance too low |
+221770000002 | Orange Money Senegal | Fails: declined |
+221770000003 | Orange Money Senegal | No answer, stays pending |
+221770000004 | Orange Money Senegal | Fails: not approved on the phone |
+221760000000 | Free Money Senegal | Succeeds |
+221760000001 | Free Money Senegal | Fails: balance too low |
+221760000002 | Free Money Senegal | Fails: declined |
+221760000003 | Free Money Senegal | No answer, stays pending |
+221760000004 | Free Money Senegal | Fails: not approved on the phone |
Flutterwave
| Number | Network | What happens |
|---|---|---|
+237670000000 | MTN Mobile Money Cameroon | Succeeds |
+237690000000 | Orange Money Cameroon | Succeeds |
Live mode
Live mode bills real customers with the Live app ID and its sk_live_ key. Before it works, you need two things:
- A verified email for the team owner. Until then, every Live endpoint except
GET /v1/apps/{appID}returns403with codeemail_unverified. - A connected payment provider. Connect your pawaPay, Notch Pay, or Flutterwave account in the dashboard. Until then, you can set up products, prices, and customers. Starting a subscription or taking a payment returns
422with codenot_accepting_payments.
GET /v1/apps/{appID} shows where you stand. Its payments object has email_verified, provider_connected, and ready.
Live payments are charged to the customer's phone through your own provider account. Abuna never holds the money.
Switching to Live
Change the app ID and the secret key together. Your code stays the same. Live starts with no data: products, prices, customers, and subscriptions don't carry over from Test, so create them again in Live. Set your Live webhook endpoint and use the Live webhook signing secret to check signatures.
Next steps
- Authentication and API keysAuthenticate requests with your secret key, and know which key goes where.
- Connecting a payment providerConnect your own pawaPay, Notch Pay, or Flutterwave account so customers pay you directly. More are coming.
- Going live checklistEverything to check before you take real payments.