RideKit
Docs/Reference/Toll gates (Dubai Salik)

Toll gates (Dubai Salik)

Built: 2026-11-02. Written for operators and for whoever maintains the code.

Dubai's Salik gates charge every car that passes under them. Riders pay the tolls their trip ran up, and Careem and Uber both itemise them on the fare ("Salik × 2"). RideKit now does the same:

  • the estimate prices the gates on the trip's road route;
  • the settlement charges the gates the car's GPS track actually crossed;
  • the toll is repaid to the driver in full, with no commission.

The same feature works for any gate-priced toll road: draw the gates and name the network.

Legal note. Salik's prices change by time of day (since January 2025) and differ during Ramadan and on event days. The preset below is a starting point. Check it against Salik's current table before going live, and edit the windows when Salik changes them.

Setting it up

  1. Admin → Zones → Draw new zone. Draw a thin shape across the road at the gate: click points on the map, then double-click to finish. Cover every lane in the direction(s) that pay. The shape must be crossed by the route; one that only touches a road beside the gate charges nothing.
  2. Type: Toll gate.
  3. Press Fill Salik prices, or enter them by hand:
    • Toll network: the name riders see on the receipt ("Salik").
    • Price per crossing: what a crossing costs outside every window (AED 4). 0 means free.
    • Time windows. Each has the days it starts on, from and to times (HH:MM), and a price (0 for free). Windows are tried in order and the first that holds wins, so put the free night window first. A window that runs past midnight belongs to the day it starts.
  4. Save. The zone list shows "Salik · AED 4.00".

The preset fills these windows:

Window Days Time Price
1 every day 01:00–06:00 free
2 Mon–Sat 06:00–10:00 AED 6
3 Mon–Sat 16:00–20:00 AED 6

All other times, Sundays included, cost AED 4.

What happens

Estimate. When any toll gate is drawn, pricing asks the road route for the trip once (one routing call for every ride type on the screen) and checks which gates it crosses. Each gate is priced at the trip's local time. Without a road route (no maps key, or the routing service is down), the straight line between the stops is checked instead.

Where gates are drawn, the toll is measured: a ride type's flat "default toll" no longer applies. Where no gates are drawn, the flat default toll works exactly as before.

Booking. The quote freezes the toll it priced, and the ride stores the receipt lines ("Salik × 1, AED 4").

During the trip. Every location the driver's app sends draws a short line from the previous point. When that line crosses a gate, the crossing is recorded with its time. Jumps longer than 3 km (a GPS glitch, or the app coming back after a gap) record nothing, and the same gate is not recorded twice within 3 minutes.

Settlement. The quoted toll is swapped for the toll of the gates the car crossed, each priced at the time it crossed:

  • A gate the car avoided is refunded.
  • A gate the quote did not see is charged.
  • With no GPS track at all (the odometer never moved), the quoted toll stands: no recorded crossing is not proof that the car crossed none.
  • If the crossings cannot be read, the quoted toll stands and the error is logged. The ride never fails to complete because of tolls.

Tolls are outside the fare clamps: a fixed fare's "never more than ×N" limit caps the fare, not the tolls.

Money. The toll stays a pass-through, as tolls always were:

  • the driver is repaid it in full;
  • it carries no commission and no fleet share;
  • it is outside the tax invoice.

The rider sees:

  • On the confirm screen: "Includes AED 4.00 in Salik tolls for this route (gates: 1). You pay only for the gates the trip actually passes."
  • On the receipt, one line per network: "Salik × 1, AED 4.00".
    • In a fixed-quote market, the agreed fare is shown without the quoted toll, so the lines add up to what was paid.
    • In a metered market, the surcharge line keeps only the zone fees.

The driver sees under the trip in History: "Salik × 1: AED 4.00 repaid to you, no commission".

Admin → Trips → a trip shows the same "Salik × 1" row in the quoted → final view.

Not covered

  • Salik's event-day and Ramadan prices. Edit the windows for those periods. Prices by date are not modelled.
  • Abu Dhabi Darb. Darb has daily and monthly caps per car, which this does not model. Per-crossing prices work; the caps do not.
  • Direction. A gate charges both directions. Draw it only across the paying carriageway if only one direction pays.
  • Live tolls on the driver's screen. The driver sees the tolls after the trip, not while driving.

For maintainers

Area Files
Rules (pure) backend/src/geo/toll-rules.ts: parseTollRules, tollPriceAt, tollLines, tollTotal
Storage Migration 1700000130000-TollGates.ts: zone type toll_gate, table ride_toll_crossings, rides.toll_items
Geometry GeoService.hasTollGates / tollsOnRoute / tollsCrossed
Crossing capture the crossed CTE in DriversService.accumulateJourneyOdometer
Estimate PricingService.gateTollsFor (30-second memo, so one screen routes once); breakdown.tolls
Quote FrozenFareQuote.tollMinor; RidesService.buildFareQuote; the booking pass-through writes toll_items
Settlement DispatchService.settleTolls; FareFinalization.tolls / tollMinor / quotedTollMinor
Tests geo/toll-rules.spec.ts, pricing/toll-gates.spec.ts, rides/toll-settlement.spec.ts, admin zones/toll-form.test.ts and lib/fare-integrity.test.ts, rider and driver lib/fareIntegrity.test.ts
Admin zones/TollGateFields.tsx, zones/toll-form.ts (SALIK_PRESET), TripMoney.tsx lineToll
Rider confirm.tsx toll note; receiptLines → fareToll
Driver historyTolls in src/lib/fareIntegrity.ts, shown in history.tsx
source: docs/toll-gates.md (ships identically in the product zip)