Skip to content

Quotes and booking

The four endpoints you host: quote, book, cancel and get a trip.

Quote

Request
POST {your base URL}/quotes
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"
}
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.
  • price is 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_bps is 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

  • standard
    Our nameEconomy
    The carAny car, with or without AC
  • comfort
    Our nameComfort
    The carWorking AC, and the car is clean
  • premium
    Our namePremium
    The carPremium 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_55a9
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
}
Response 201
{ "partner_trip_id": "t_9931", "status": "searching" }
  • The same Idempotency-Key again returns the same trip. Never create a second one.
  • masked_phone is for screens. The full number comes later in trip.rider_contact. rider.phone is no longer sent; ignore it if your code reads it.
  • Show brand and prepaid to your driver: see Driver app rules.
  • Cash bookings carry payment_method: "cash", prepaid: false and amount_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_9931
Body
{ "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_id in the path, reason rider_cancelled and Idempotency-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

  • Timeout
    Rule2 seconds for quotes, 8 seconds for every other call
  • Redirects
    RuleNot followed. Answer at the URL you gave us
  • Hosts
    RulePublic HTTPS hosts only
  • User-Agent
    RulePerfectRide-PartnerAPI/1
  • Signed path
    RuleThe path after your base URL: base https://api.you.example/pr and call /quotes signs /quotes

View this page as Markdown · hello@perfectride.io