RideKit
Docs/Reference/Settling a complaint about a trip's charge

Settling a complaint about a trip's charge

Built: 2026-11-03. Written for support staff and operators, especially in Mexico (PROFECO), and for whoever maintains the code.

Complaints that reach Mexico's consumer agency (PROFECO) are about money:

  • a longer route than needed;
  • a fare above the estimate;
  • a driver who never came but a fee was charged;
  • a cancellation fee.

The trip page now has what you need to answer them.

On the trip page (Admin → Trips → a trip)

  • The route actually driven. The journey map draws where the car really went, from the driver's location fixes during the trip: one point every few seconds. Before this it was a straight line from pickup to drop-off.

  • Started far from the pickup. If the driver started the trip more than 300 m from the pickup, a yellow banner says how far, e.g. "This trip was started 1.5 km from its pickup". Either the driver never came, or the trip was started early.

  • Complaint about the charge. The card shows:

    • what the rider paid (the fare after discounts, or the cancellation fee);
    • what was already refunded;
    • what can still be refunded.

    Each refund records:

    • Amount: never more than what is left;
    • Reason: longer route, overcharged, driver never came, started before pickup, cancellation fee, vehicle or service, safety, other (other needs a note);
    • Who pays: the platform (out of its commission) or the driver (out of their wallet, which may go negative);
    • Note: kept in the record.

The money reaches the rider's wallet at once, and they get a notification in their language. In their wallet it shows as "Refund". Refunding needs the payout.approve permission; seeing the card needs ride.view_all.

Mexican terms

Admin → Content (CMS) → terms has a Load Mexican terms button on a Mexican installation. It loads Spanish terms written around what PROFECO cases are about:

  • how fares are set and when they can change;
  • tolls;
  • payment and pending balances;
  • cancellations;
  • complaints, with a response time and refunds;
  • safety;
  • lost items;
  • privacy;
  • the right to go to PROFECO, with its phone numbers.

Fill in the bracketed parts and have your counsel review the text before publishing.

Code

  • backend/src/rides/ride-refunds.ts: reasons, validation, the cap, the start-far flag (no I/O);
  • rides/ride-refunds.service.ts:
    • GET /admin/rides/:id/dispute;
    • POST /admin/rides/:id/refunds;
  • drivers/drivers.service.ts recordPathPoint: route points from the location fixes, while a ride is accepted, arrived or in progress;
  • rides/dispatch.service.ts start: the start offset;
  • wallet/wallet.service.ts refundRideToRider;
  • migration 1700000156000-RideRefundsAndPath;
  • admin:
    • components/trip/TripDispute.tsx;
    • TripJourney.tsx (the route);
    • lib/terms-mx.ts.

Check locally

Confirm the PROFECO contact details and your complaint response times with counsel. Route points are personal data: they fall under your privacy notice's location purpose and its retention period.

source: docs/trip-disputes.md (ships identically in the product zip)