RideKit
Docs/Reference/Brazil: paying for the ride by Pix

Brazil: paying for the ride by Pix

Built: 2026-11-03. Written for operators in Brazil and whoever maintains the code.

Pix is how most of Brazil pays. 99 and Uber take it for the ride itself, not only to fund a wallet. In RideKit, a rider in Brazil can pick Pix when booking and pay the fare after the drop with a QR code or a Pix copia e cola code.

What the rider sees

  1. On the booking screen, Pix appears next to cash and wallet: "Pay after the ride by QR or copy-and-paste code".
  2. When the ride ends, the trip-complete screen shows Pay R$ 9,85 by Pix, and a push notification says the same (tapping it opens the payment).
  3. The payment screen shows the amount, the QR code and the copy-and-paste code. It updates by itself when the bank confirms, usually within seconds. The rider can leave it and come back; the same code is shown again while it is valid (one day).
  4. Until it is paid, the home screen shows "You owe R$ 9,85 — Pay", and booking another Pix ride is refused with a link to pay first.

The same payment screen settles any pending balance, not only a Pix ride. For example, a cash trip paid short, or a wallet ride that ran over its estimate.

What the driver sees

During the trip: "Paid by Pix in the app. Don't collect cash; your earnings are credited at the drop." The driver is paid at the drop like for a wallet ride, whether or not the rider has paid yet. The platform carries that risk, not the driver.

How the money moves

  • The ride settles like a wallet ride. Credit already in the rider's wallet is used first; what is missing leaves the wallet below zero. That is the debt.
  • The Pix payment is raised through the Pix gateway (Asaas) for exactly that debt. When it arrives, it lands in the wallet as a top-up and brings it back to zero. The ride is then marked paid.
  • Minimum charge. Asaas does not take Pix charges under R$5,00. A smaller debt is charged R$5,00, and the difference stays in the wallet as credit for the next ride. The rider is told this on the payment screen.
  • Payments are confirmed the same way as Pix top-ups: by Asaas's webhook (checked against the webhook token) or by asking Asaas directly. A forged "paid" message moves no money.

Setting it up

  1. Admin → Providers → Asaas: enter the API key and the webhook token. Point the Asaas webhook to https://<your API>/api/payments/webhook/asaas.
  2. Admin → Markets → Brazil → Payments → Pix for the ride. It is on by default, with a R$5,00 minimum. Turn it off to keep Pix for wallet top-ups only.

Without the Asaas key, Pix is not shown for rides and a Pix booking is refused with pix_unavailable; cash and the wallet work as before.

Where to look

  • Admin → Trips → a trip: the Money card has a Pix line. It shows what was owed after the ride and either "Paid (date)" or "Not paid yet". "The wallet covered it" means nothing was owed.

For the code

What Where
Rules (defaults, minimum, booking block) backend/src/payments/pix-rides.ts
Service and endpoints (GET /riders/me/pix, POST /riders/me/pix/pay) backend/src/payments/pix-rides.service.ts
Booking check rides.service: paymentMethod: 'pix', then pixRides.assertBookable
Settlement dispatch.service: Pix is not cash, then pixRides.afterRideSafe
Marking paid payment.service (webhook) and topup-reconcile.service (poll and sweep), via afterCreditSafe
Re-showing a live QR AsaasPixProvider.pixQrCode
Columns migration 168: rides.pix_due_minor, rides.pix_paid_at, topup_charges.purpose
Rider app confirm.tsx (option), rate.tsx (pay card), home.tsx (banner), pix-due.tsx
Driver app trip.tsx banner
Admin PixRidesCard, trip Money card

Error codes: pix_unavailable, pix_balance_due (with amountMinor), pix_nothing_due, pix_charge_failed.

Check before launch. The R$5,00 minimum is Asaas's published figure for its standard plan; confirm it on your Asaas account. Unpaid Pix rides are a credit risk the operator carries. Consider how long a rider may stay in debt and how it is collected; legal advice in Brazil (CDC, Procon) applies.

source: docs/brazil-pix-rides.md (ships identically in the product zip)