Skip to content

Redirect (checkout) flow

The redirect flow is the fastest way to accept payments: you create a transaction, redirect the customer to a page Pesepay hosts, and they pick a payment method and complete the payment there. Pesepay handles the method-specific UI for you — including card entry, which keeps card data out of your systems entirely.

  1. Customer → Your server Starts checkout
  2. Your server → Pesepay Create transaction POST /payments/initiate
  3. Pesepay → Your server redirectUrl + referenceNumber
  4. Your server → Customer Redirect to Pesepay
  5. Customer → Pesepay Picks a method and pays
  6. Pesepay → Payment provider Charges the customer
  7. Pesepay → Your server Result callback POST resultUrl
  8. Your server → Pesepay Confirm the status GET /payments/check-payment
Redirect flow — the customer pays on Pesepay's hosted page
  1. Build the request — amount, currency, reason for payment, plus your resultUrl and returnUrl.
  2. Encrypt and send it to Initiate Transaction.
  3. Decrypt the response to get a redirectUrl and referenceNumber. Store the referenceNumber against your order now.
  4. Redirect the customer’s browser to redirectUrl.
  5. The customer chooses a method and pays on Pesepay’s page.
  6. They land back on your returnUrl, and separately, Pesepay posts the final status to your resultUrl — see The Result Callback.
  7. Confirm before you fulfil with Check Payment Status, and only act on SUCCESS.

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