Matches API
A match is the result of evaluating one candidate journey against one request. It is a separate resource from both.
Endpoints
GET /api/v1/matches/:id
POST /api/v1/matches/:id/accept
POST /api/v1/matches/:id/decline
POST /api/v1/matches/:id/expireexpire is an internal or system operation.
Why matches are separate from requests
Because the matching engine evaluates many possible drivers before surfacing any of them. Collapsing the candidate into the request would erase the record of what was considered and rejected — which is exactly the evidence a compliance review later needs.
A single ride_requests.matches list cannot answer "which journeys were evaluated and why was this one chosen".
Stored fields
Scores, eligibility and compliance outcome, policy version and algorithm version.
{
"id": "mch_01...",
"ride_request_id": "req_01...",
"journey_id": "jny_01...",
"route_score": 94.0,
"pickup_score": 91.0,
"dropoff_score": 97.0,
"time_score": 88.0,
"seat_score": 100.0,
"overall_score": 93.8,
"detour_meters": 1200,
"detour_seconds": 240,
"detour_percentage": 6.42,
"eligibility_status": "ALLOW",
"compliance_status": "ALLOW",
"status": "OFFERED",
"algorithm_version": "matching-0.1"
}algorithm_version is recorded on every match so a scoring change can be attributed rather than guessed at later.
Lifecycle
CANDIDATE → OFFERED → ACCEPTED
↓
DECLINED
CANDIDATE | OFFERED → EXPIRED
any state → BLOCKEDAn offer carries an expiry. An expired match cannot be accepted — accepting one would mean booking a journey whose seats may since have gone.
Eligibility vs compliance
Two separate columns, two separate checks:
eligibility_status— factual: is the driver verified, the vehicle verified, the account in good standing, seats available?compliance_status— policy: is this permitted under the active ruleset?
A match can be eligible and still blocked by compliance. That combination is normal and is the reason the platform can adopt a stricter operating model later without changing the matching logic.
