API reference
Events you send
Every trip event PerfectRide accepts at the events URL, with its fields.
POST each one to https://www.perfectride.io/api/partner/v1/events, signed with path /events. Every event has event, event_id (unique, up to 128 characters), partner_trip_id, pr_trip_id and occurred_at (ISO 8601).
trip.driver_assignedWhenA driver accepts. Again with the new driver if you reassign before pickupAlso senddriver { id, name, phone },vehicle { make, model, plate },eta_seconds. Optional:driver.licence_number(up to 40),driver.partner_driver_ref(up to 128),driver.photo_url(https),driver.rating,driver.trips,vehicle.color,locationtrip.driver_locationWhenEvery 10 s before pickup, every 30 s on the tripAlso sendlocation { lat, lng }trip.driver_arrivedWhenAt pickupAlso sendNothing elsetrip.startedWhenThe driver entered the rider's codeAlso sendpin(4 digits)trip.arrived_at_stopWhenOptional: the driver reached a stopAlso sendstop_ordertrip.departed_stopWhenOptional: the driver left a stopAlso sendstop_ordertrip.completedWhenDrop-offAlso sendfinal_price(kobo, equal to the quote)trip.cancelledWhenYour side cancelsAlso sendcancelled_by(driverorpartner),reason. Optionalcancellation_fee(0)trip.no_driverWhenNobody could take it, within 3 minutes of bookingAlso sendNothing elsetrip.rider_ratedWhenOptional: the driver rated the riderAlso sendstars(1 to 5),tags
| Event | When | Also send |
|---|---|---|
trip.driver_assigned | A driver accepts. Again with the new driver if you reassign before pickup | driver { id, name, phone }, vehicle { make, model, plate }, eta_seconds. Optional: driver.licence_number (up to 40), driver.partner_driver_ref (up to 128), driver.photo_url (https), driver.rating, driver.trips, vehicle.color, location |
trip.driver_location | Every 10 s before pickup, every 30 s on the trip | location { lat, lng } |
trip.driver_arrived | At pickup | Nothing else |
trip.started | The driver entered the rider's code | pin (4 digits) |
trip.arrived_at_stop | Optional: the driver reached a stop | stop_order |
trip.departed_stop | Optional: the driver left a stop | stop_order |
trip.completed | Drop-off | final_price (kobo, equal to the quote) |
trip.cancelled | Your side cancels | cancelled_by (driver or partner), reason. Optional cancellation_fee (0) |
trip.no_driver | Nobody could take it, within 3 minutes of booking | Nothing else |
trip.rider_rated | Optional: the driver rated the rider | stars (1 to 5), tags |
Note:
driver.phone is required, as +234XXXXXXXXXX or 0XXXXXXXXXX. Missing or invalid gets 400 invalid_event.Examples
trip.driver_assigned
Body
{
"event": "trip.driver_assigned",
"event_id": "ev_0001",
"partner_trip_id": "t_9931",
"pr_trip_id": "pr_55a9",
"occurred_at": "2026-12-03T10:01:12Z",
"driver": { "id": "d_771", "name": "Musa A.", "phone": "+2348090001122", "licence_number": "ABC12345", "partner_driver_ref": "drv_771", "photo_url": "https://cdn.partner.example/d_771.jpg", "rating": 4.9, "trips": 2140 },
"vehicle": { "make": "Toyota", "model": "Corolla", "color": "Black", "plate": "PHC-123-AB" },
"location": { "lat": 4.8170, "lng": 7.0320 },
"eta_seconds": 240
}trip.driver_location
Body
{
"event": "trip.driver_location",
"event_id": "ev_0002",
"partner_trip_id": "t_9931",
"pr_trip_id": "pr_55a9",
"occurred_at": "2026-12-03T10:01:22Z",
"location": { "lat": 4.8165, "lng": 7.0331 }
}trip.started
Body
{
"event": "trip.started",
"event_id": "ev_0007",
"partner_trip_id": "t_9931",
"pr_trip_id": "pr_55a9",
"occurred_at": "2026-12-03T10:06:02Z",
"pin": "4821"
}trip.completed
Body
{
"event": "trip.completed",
"event_id": "ev_0042",
"partner_trip_id": "t_9931",
"pr_trip_id": "pr_55a9",
"occurred_at": "2026-12-03T10:24:40Z",
"final_price": 650000
}trip.cancelled
Body
{
"event": "trip.cancelled",
"event_id": "ev_0009",
"partner_trip_id": "t_9931",
"pr_trip_id": "pr_55a9",
"occurred_at": "2026-12-03T10:03:00Z",
"cancelled_by": "driver",
"reason": "vehicle_breakdown"
}trip.no_driver
Body
{
"event": "trip.no_driver",
"event_id": "ev_0010",
"partner_trip_id": "t_9931",
"pr_trip_id": "pr_55a9",
"occurred_at": "2026-12-03T10:03:00Z"
}Answers
- 200
{ "ok": true, "result": "applied" | "duplicate" | "ignored", "trip_status": "..." }. - Everything else is an error body. See Trip events for what to retry and Errors for every code.