Skip to Content
Pesa VoucherDeveloper Documentation

How Deposits Work

Step-by-step guide on handling Pesavoucher deposits, linking internal orders to official payment references, and crediting users safely.


How Deposits Work

Pesavoucher deposits are designed to be simple and secure. Follow these steps to correctly handle deposits in your system.

Step 1 – Create Your Own Order

Generate an internal order_id in your system.

This ID is only for your tracking and internal use — it is not sent to Pesavoucher.

your internal order_id
your user reference

Step 2 – Send STK Push to Pesavoucher

Send the deposit request including:

  • User phone number
  • Amount
  • Callback URL

Note: You do not need to send your order_id — Pesavoucher will handle the official transaction reference.

{
"phone_number": "254712345678",
"amount": 1000.00,
"callback_url": "https://yourapp.com/webhook/deposit"
}

Step 3 – Pesavoucher Returns a payment_id

Pesavoucher will return an official payment_id — the transaction reference. Save this alongside your internal order and user reference:

Your order_idYour userPesavoucher payment_id
ORD-2026-001123PV-XYZ-987654321

Step 4 – Wait for the Webhook

Pesavoucher will send a webhook to your specified callback_url with:

  • payment_id
  • Final status (Success, Failed, Cancelled, Timeout)
{
"payment_id": "PV-XYZ-987654321",
"status": "Success",
"amount": 1000.00
}

Step 5 – Credit the User

Only credit the user if the webhook status is Success.

Do not credit for:

  • Failed
  • Cancelled
  • Timeout

Always rely on the webhook to confirm the final status.

✅ Summary

  • Your order_id → internal tracking only
  • Pesavoucher payment_id → official transaction reference
  • Link them together in your database
  • Credit user only when webhook status is Success

This ensures accurate reconciliation and avoids duplicate or incorrect credits.