Skip to content

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.

  1. 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.

  2. 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_…"
  3. Check the key works

    curl "https://api.autopayke.com/api/v1/account" \
      -H "Authorization: Bearer $AUTOPAYKE_API_KEY"

    livemode: false confirms you're in the sandbox.

  4. 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.

  5. 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: +254700000001 is a sandbox number that always does.

  6. 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.succeeded and payout.failed pushed 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.