Wallet & Payments
Phase 2 — rider wallet, top-ups, promo codes, payments.
Your wallet
GET /api/wallet → your balance (minor units)
GET /api/wallet/transactions → your wallet history
Money is added to a wallet only by a real payment (below) or by an operator recording cash in the admin panel — there is no endpoint that credits a wallet without one.
Balances are held in an immutable ledger; every change is a recorded transaction you can never lose track of.
Topping up via a payment gateway
GET /api/payments/providers → available gateways (e.g. stripe)
POST /api/payments/topup
{ "amountMinor": "50000", "idempotencyKey": "…", "provider": "stripe" }
- Cash is not a customer top-up: the
manualprovider is refused here. An operator records cash a customer handed over in the admin panel. - Card (Stripe): a charge is created. In markets that require card authentication (e.g. India's 3-D Secure), you complete the authentication, and the wallet is credited when the gateway confirms the payment (via webhook) — exactly like other apps that send you an OTP.
The same idempotency key never charges or credits twice.
Promo codes
POST /api/promo/validate
{ "code": "WELCOME20", "fareMinor": "13173" }
→ { discountMinor, netFareMinor }
Validates the code for you and the fare (limits, validity, minimum fare) and shows the discount before you book.
Referrals
When you refer a friend (rider or driver), both of you receive a wallet credit once the referral's reward conditions are met.
Cancellations
Cancelling before a driver accepts, or within the free window after acceptance, is free. After that a small fee may apply (shown before you confirm). A no-show fee applies if the driver arrives and you're not there.