Guides
Quotes and booking
The four endpoints you host: quote, book, cancel and get a trip.
Quote
Request
POST {your base URL}/quotesBody
{
"pickup": { "lat": 4.8156, "lng": 7.0345, "address": "Hotel Presidential, Aba Road, Port Harcourt" },
"dropoff": { "lat": 4.8242, "lng": 6.9969, "address": "Genesis Centre, GRA Phase 2, Port Harcourt" },
"ride_class": "standard",
"passengers": 1,
"payment_method": "perfectride"
}Response 200
{ "quote_id": "q_8f21", "price": 650000, "eta_seconds": 300, "expires_at": "2026-12-03T10:05:00Z" }Response 200, no driver
{ "available": false }- Answer within 2 seconds. No driver is not an error: answer
available: false. priceis what your own app charges for the same trip, in kobo. It is final in the pilot.- Your commission is set in your contract, not per quote.
commission_rate_bpsis no longer sent; if you send it, it is ignored. - Keep quotes valid for at least 2 minutes.
- Optional
stops: see Stops.
# Call your own sandbox the way PerfectRide does (signed with your secret).
# The signed path is the path after your base URL: /quotes.
TS=$(date +%s)
BODY='{"pickup":{"lat":4.8156,"lng":7.0345,"address":"Hotel Presidential, Aba Road, Port Harcourt"},"dropoff":{"lat":4.8242,"lng":6.9969,"address":"Genesis Centre, GRA Phase 2, Port Harcourt"},"ride_class":"standard","passengers":1,"payment_method":"perfectride"}'
SIG=$(printf '%s' "$TS.POST./quotes.$BODY" | openssl dgst -sha256 -hmac "$PR_SECRET" | sed 's/^.*= //')
curl "$YOUR_BASE_URL/quotes" \
-H "Authorization: Bearer $KEY_YOU_GAVE_US" \
-H "Content-Type: application/json" \
-H "X-PR-Timestamp: $TS" \
-H "X-PR-Signature: sha256=$SIG" \
--data-raw "$BODY"Ride classes
standardOur nameEconomyThe carAny car, with or without ACcomfortOur nameComfortThe carWorking AC, and the car is cleanpremiumOur namePremiumThe carPremium makes and models: Mercedes-Benz, Toyota Prado or Land Cruiser, Lexus, BMW, Range Rover and similar
ride_class | Our name | The car |
|---|---|---|
standard | Economy | Any car, with or without AC |
comfort | Comfort | Working AC, and the car is clean |
premium | Premium | Premium makes and models: Mercedes-Benz, Toyota Prado or Land Cruiser, Lexus, BMW, Range Rover and similar |
Quote only cars that meet the class. Riders report a car below its class like a wrong car.
Book
Request
POST {your base URL}/trips
Idempotency-Key: book:pr_55a9Body
{
"quote_id": "q_8f21",
"pr_trip_id": "pr_55a9",
"rider": { "first_name": "Ada", "masked_phone": "+234803***4521" },
"payment_method": "perfectride",
"brand": "PerfectRide",
"prepaid": true
}Response 201
{ "partner_trip_id": "t_9931", "status": "searching" }- The same
Idempotency-Keyagain returns the same trip. Never create a second one. masked_phoneis for screens. The full number comes later intrip.rider_contact.rider.phoneis no longer sent; ignore it if your code reads it.- Show
brandandprepaidto your driver: see Driver app rules. - Cash bookings carry
payment_method: "cash",prepaid: falseandamount_to_collect: see Cash trips.
TS=$(date +%s)
BODY='{"quote_id":"q_8f21","pr_trip_id":"pr_55a9","rider":{"first_name":"Ada","masked_phone":"+234803***4521"},"payment_method":"perfectride","brand":"PerfectRide","prepaid":true}'
SIG=$(printf '%s' "$TS.POST./trips.$BODY" | openssl dgst -sha256 -hmac "$PR_SECRET" | sed 's/^.*= //')
# Run it twice: the second answer must be the same trip.
curl "$YOUR_BASE_URL/trips" \
-H "Authorization: Bearer $KEY_YOU_GAVE_US" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: book:pr_55a9" \
-H "X-PR-Timestamp: $TS" \
-H "X-PR-Signature: sha256=$SIG" \
--data-raw "$BODY"Cancel
Request
POST {your base URL}/trips/{partner_trip_id}/cancel
Idempotency-Key: cancel:t_9931Body
{ "reason": "rider_cancelled" }Response 200
{ "status": "cancelled", "cancellation_fee": 0 }- Reasons:
rider_cancelled,no_driver_in_time,driver_paused. - If a booking call times out or fails on our side, we send a best-effort cancel with our
pr_trip_idin the path, reasonrider_cancelledandIdempotency-Key: cancel:<pr_trip_id>. Accept either id.
Get a trip
We call it if an event is missed.
Request
GET {your base URL}/trips/{partner_trip_id}Response 200
{
"partner_trip_id": "t_9931",
"pr_trip_id": "pr_55a9",
"status": "driver_assigned",
"driver": { "id": "d_771", "name": "Musa A." },
"vehicle": { "make": "Toyota", "model": "Corolla", "plate": "PHC-123-AB" },
"location": { "lat": 4.8170, "lng": 7.0320 },
"updated_at": "2026-12-03T10:01:40Z"
}How we call you
- TimeoutRule2 seconds for quotes, 8 seconds for every other call
- RedirectsRuleNot followed. Answer at the URL you gave us
- HostsRulePublic HTTPS hosts only
- User-AgentRule
PerfectRide-PartnerAPI/1 - Signed pathRuleThe path after your base URL: base
https://api.you.example/prand call/quotessigns/quotes
| Item | Rule |
|---|---|
| Timeout | 2 seconds for quotes, 8 seconds for every other call |
| Redirects | Not followed. Answer at the URL you gave us |
| Hosts | Public HTTPS hosts only |
| User-Agent | PerfectRide-PartnerAPI/1 |
| Signed path | The path after your base URL: base https://api.you.example/pr and call /quotes signs /quotes |