Skip to content

Direct API

With the Direct API, your own UI collects the payment method and any fields it requires (like a phone number for EcoCash), and you submit everything directly — no redirect to a Pesepay-hosted page.

  1. Customer → Your server Submits checkout method + phone number
  2. Your server → Pesepay Make payment POST /v2/payments/make-payment
  3. Pesepay → Wallet provider Requests the debit
  4. Wallet provider → Customer PIN prompt on the phone
  5. Pesepay → Your server referenceNumber + pollUrl status not yet final
  6. Customer → Wallet provider Enters PIN
  7. Pesepay → Your server Result callback POST resultUrl
  8. Your server → Pesepay Confirm the status GET /payments/check-payment
Direct API — an EcoCash payment approved on the customer's phone

The gap between Make Payment returning and the result callback is the part that catches people out: your API call has already returned while the customer is still holding their phone. Show a waiting state, and drive it from the callback or pollUrl.

  1. Pick a payment method and check its required fields — e.g. EcoCash needs customerPhoneNumber, InnBucks needs no extra fields at all.
  2. Build the request — amount, currency, paymentMethodCode, the method’s required fields, plus resultUrl and returnUrl.
  3. Encrypt and send it to Make Payment.
  4. Decrypt the response and store the referenceNumber. The customer still has to approve the payment on their side, so the status you get back is usually not final.
  5. Get the result via the result callback or by checking status with the referenceNumber.

Running the Direct API on a web checkout and want cards or more methods? See Migrate from the Direct API.

Full request/response fields, headers, and code samples in five languages: Make Payment reference →