Bookings API
A booking is the confirmed shared journey. It is the outcome of a match.
It is not a "trip" and not a "ride". Those terms imply a dispatch relationship between a driver and a customer that does not exist here — two people agreed to share a journey they are each already taking.
Endpoints
POST /api/v1/bookings
GET /api/v1/bookings/:id
GET /api/v1/bookings
POST /api/v1/bookings/:id/confirm
POST /api/v1/bookings/:id/cancel
GET /api/v1/bookings/:id/contribution
POST /api/v1/bookings/:id/contribution
POST /api/v1/bookings/:id/ratingCreate
{ "matchId": "mch_01..." }{
"bookingId": "bok_01...",
"status": "PENDING_CONFIRMATION"
}A booking is created only from an eligible, accepted, non-expired match whose compliance status is ALLOW. match_id is mandatory — a booking that cannot name the match that justified it is not auditable.
Requires Idempotency-Key. A retried create must not double-book a seat.
Confirm
Both parties confirm. The journey proceeds only when the booking reaches CONFIRMED.
Lifecycle
PENDING_CONFIRMATION → CONFIRMED → IN_PROGRESS → COMPLETED
PENDING_CONFIRMATION | CONFIRMED → CANCELLED
CONFIRMED → NO_SHOW
any state → SUSPENDEDContribution
GET /api/v1/bookings/:id/contribution{
"status": "CONFIGURED",
"type": "APPROVED_COST_SHARE",
"amount": 6,
"currency": "AED"
}Contribution functionality is controlled entirely by the active policy. When contribution.enabled is false, the endpoint reports that contributions are not available rather than returning a disabled-but-present control.
The production implementation activates payment and contribution functionality only in a form consistent with the operating model approved for the service. See Contribution Policy.
Rating
{
"rating": 5,
"categories": {
"punctuality": 5,
"communication": 5,
"safety": 5
},
"comment": "Good journey."
}Ratings are recorded once per reviewer per booking. A rating never overrides a compliance decision — it is feedback, not a control.
