Escrow Safe Trade is live: protect your next high-value deal Learn more
ProductsPayment links & checkoutM-Pesa, cards, invoices, split payoutsEscrow Safe TradeMilestone and release-based escrowWallets & P2PPersonal and business walletsChama, Lengo & DeniGroup savings, goals and IOUsBusiness toolkitAccounting, payroll, POS, ticketingBulk payments & payrollPay many people in one uploadSubscriptions & billingRecurring plans and renewalsRent, loans & donationsCollections and campaignsAll products
SolutionsMerchantsBuyersChama groupsBusiness solutionsIndustries
Pricing
DevelopersDeveloper overviewQuickstart, auth and sandboxREST APIsCheckout, invoices and requestsWebhooksSigned, real-time eventsWallet-as-a-ServiceVirtual sub-accountsDocumentationGuides and API reference
Security
CompanyAbout usCareersPartnersBlogHelp centreContact us
Log in Get started Talk to sales
Developers

Build on the
payments platform

Accept M-Pesa, cards and PayPal, hold funds in escrow, create wallets and split payouts with one REST API and signed webhooks.

Developer working on code with a payments dashboard
REST + JSONpredictable resources
Signed webhooksHMAC-SHA256
Sandboxtest before live
Idempotentsafe retries

Take a payment in three calls

Illustrative requests. Endpoint names and fields are shown for design; see the docs for the current reference.

Create a checkout session
curl https://api.paysasa.com/v1/checkout/sessions \
  -H "Authorization: Bearer $PAYSASA_SECRET_KEY" \
  -d amount=250000 \
  -d currency=KES \
  -d "methods[]"=mpesa -d "methods[]"=card \
  -d reference=ORDER-1042 \
  -d callback_url=https://shop.example/hooks/paysasa
Receive the webhook
{
  "event": "payment.succeeded",
  "id": "evt_8f21c",
  "data": {
    "reference": "ORDER-1042",
    "amount": 250000,
    "currency": "KES",
    "method": "mpesa",
    "receipt": "SJK3L9XYZ1"
  }
}

Webhooks you can trust

Every event is signed so you can verify it came from Paysasa. Handle retries safely with idempotency keys and event IDs.

  • Signed with HMAC-SHA256 and a timestamp
  • Automatic retries with exponential back-off
  • Events for payments, payouts, escrow, wallets and disputes
  • Replay events from the dashboard
Verify the signature
// Verify the webhook signature (Node.js)
const sig = req.headers['paysasa-signature'];
const ok  = crypto.timingSafeEqual(
  Buffer.from(sig),
  Buffer.from(hmac(secret, rawBody)));
if (!ok) return res.sendStatus(400);

Go live in four steps

1

Create an account

Sign up and complete business verification.

2

Get test keys

Use the sandbox and test numbers to simulate payments.

3

Build and test

Integrate checkout and webhooks and run through failures.

4

Switch to live keys

Go live once verified, and monitor events in the dashboard.

Built for production

Secure by default

TLS, scoped API keys, IP allow-lists and signed callbacks.

Idempotent requests

Send an idempotency key so retries never create duplicate payments.

Clear errors

Consistent error codes and messages that tell you what to fix.

Frequently asked questions

Create an account, then open Developers in the dashboard to create test and live keys. Live keys need a verified business.

Yes. The sandbox mirrors production with test numbers and simulated M-Pesa and card outcomes.

The API is plain REST and JSON so it works from any language. Official SDKs are planned. [Confirm SDK list.]

The reference is at our docs site. If you are stuck, talk to our developer support.

Yes. Use Wallet-as-a-Service for seller wallets and split payouts, with escrow for high-value orders. See Platforms and marketplaces.

Start building
today

Get API keys

Sandbox included · No card needed