Test mode
Build and test your integration without moving money.
Build with a test key (fpk_test_…): it works as soon as you sign up and moves no money. Switch to a live key
(fpk_live_…) once your merchant is verified. The base URL, endpoints and responses are the same.
- What you create with a test key can only be reached with a test key, and the same for live. Your test and live balances are separate.
livemodeon every payment, webhook endpoint and event isfalsefor test andtruefor live.- A webhook endpoint registered with a test key gets only test events.
Choose the outcome with a test number
In test mode, pick the outcome you want to test with the customer's phone number.
payment_method_data.mobile_money.phone | Outcome |
|---|---|
255700000001 | Succeeds a few seconds after it is created. Any number not in this table does the same. |
255700000002 | Fails: the customer declines. failureCode is CUSTOMER_DECLINED. |
255700000003 | Fails: the customer's wallet is short. failureCode is INSUFFICIENT_FUNDS. |
255700000004 | Stays pending, so you can test a payment that never settles. |
255700000005 | Succeeds, like 255700000001. |
255700000006 | The customer never approves the request. A collection expires after 3 minutes, so you can test payment.expired. |
The same numbers work for payouts. A test payment to one of them is on the mpesa network. A live payment to a test number is refused with 400.
Go live
When your integration works in test mode:
- Verify your business in the dashboard, and wait for the approval email.
- Create a live API key. Until your business is approved, creating one is refused with
403and the codeaccount_not_verified. - Register your webhook endpoints with the live key.
- Switch your server to the live key.
Go live lists the details and documents we ask for and what each review state means.