Quickstart
A test key, test money and a test M-Pesa payout that succeeds, in five minutes.
In five minutes you'll have a test key, test money and a test payout that succeeds, without touching real money. You need an AutoPayKe account (sign up in the app with your phone) with an email address on your profile.
Open a workspace
Sign in at console.autopayke.com with your AutoPayKe account and choose Open developer workspace for the account you want to integrate (personal, business or organization). It starts in the sandbox at once.
Create a test key
In API keys, with Test selected at the top, choose Create key, pick the Payouts preset and create it. Copy the key (it starts
apk_test_) into your environment. It's shown once.export AUTOPAYKE_API_KEY="apk_test_…"Check the key works
curl "https://api.autopayke.com/api/v1/account" \ -H "Authorization: Bearer $AUTOPAYKE_API_KEY"livemode: falseconfirms you're in the sandbox.Add test money
curl -X POST "https://api.autopayke.com/api/v1/sandbox/faucet" \ -H "Authorization: Bearer $AUTOPAYKE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount_usdc": 1000 }'The Console's Overview has the same button. Test USDC isn't real and can't be withdrawn.
Send a test payout
curl -X POST "https://api.autopayke.com/api/v1/payouts" \ -H "Authorization: Bearer $AUTOPAYKE_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "amount": 150000, "currency": "KES", "destination": { "type": "mobile_money", "phone": "+254700000001" }, "reference": "order_1042" }'The answer comes back at once with
status: "pending". About five seconds later the payout succeeds:+254700000001is a sandbox number that always does.See the result
curl "https://api.autopayke.com/api/v1/payouts/po_…" -H "Authorization: Bearer $AUTOPAYKE_API_KEY"Or open Logs in the Console to see the request and response. Next, add a webhook so you're told instead of asking.
Next
- Webhooks: get
payout.succeededandpayout.failedpushed to you, and verify signatures. - Sandbox: numbers and amounts that fail, reverse, hold for review or time out.
- Payouts: every destination type and what each status means.
- Going live: apply, get approved, get your live key approved, fund your balance.