Before you start
You need a Tanda account with sandbox access. Sign in to the dashboard and open Developers → API keys to find your sandbox public key and API key.1
Generate a bearer token
Send your API key in the The token lasts one hour. Send it as
api-key header and your public key in the body.Response
Authorization: Bearer <token> on every other request.2
Check your account
Confirm the token works and see your sandbox balance and webhook URLs.
3
Collect a payment
Send an M-PESA prompt to a sandbox test number.
254712345678 always succeeds in sandbox.Response
4
Confirm the outcome
Fetch the transaction by its Fulfil only when
transactionId or your externalReference. In production you’d wait for a webhook instead of polling.chargeStatus is successful.5
Send a payout
Pay out to an M-PESA wallet. In sandbox, The final status arrives as a
254712345678 succeeds and 254787654321 fails.payout_updated webhook.Next steps
Set up webhooks
Receive outcomes in real time instead of polling.
Test every outcome
Sandbox values for success, failure and every customer step.

