Skip to content

Sandbox and test data

Test against PerfectRide before any rider is involved: portal tests, certification trips and fixed scenarios.

Sandbox and live

  • The key decides the environment. The events and supply URLs are the same for both.
  • Sandbox trips have no rider and no money. Send their events with your prk_test_ key.
  • An event sent with the wrong key for its trip gets 403 wrong_environment.

Test your API

In the portal, Test your API calls your sandbox the way a real trip does and shows 6 results.

  • Quote
    Passes whenYou answer POST /quotes within 2 seconds, or say available: false
  • Book
    Passes whenPOST /trips books, and the same Idempotency-Key again returns the same trip
  • Get trip
    Passes whenGET /trips/{partner_trip_id} returns that trip
  • Cancel
    Passes whenPOST /trips/{partner_trip_id}/cancel answers 2xx
  • Wrong signature
    Passes whenYou answer 401
  • Old timestamp
    Passes whenA 10-minute-old X-PR-Timestamp gets 401

Sandbox only, public HTTPS hosts only, 10 runs an hour.

Certification trips

Start a run in Certification (5 a day). We book one test trip per scenario. Each shows its pr_trip_id and PIN. Play them, then press check.

  • Card trip
    What you doAssign a driver, send a location, arrive. Send trip.started with pin 0000 (we refuse it), then with the PIN shown. Complete at the quoted price. Optional: trip.rider_rated
  • Driver cancels
    What you doAssign a driver, then cancel as the driver (cancelled_by: driver)
  • No drivers
    What you doSend trip.no_driver
  • Rider cancels
    What you doNothing. We book it twice with the same Idempotency-Key and cancel it as the rider
  • Stops
    What you doOnly when your Max stops is above 0. Assign, arrive, start with the PIN, send trip.arrived_at_stop then trip.departed_stop for each stop_order, complete at the quoted price
Note: Cash is not part of the sandbox run. PerfectRide switches cash on per partner during the pilot. See Cash trips.

What certification checks

  • Quote within 2 seconds, and available: false handled
    RequiredYes
  • Trip completed
    RequiredYes
  • Events in the right order. trip.driver_assigned carries a valid driver.phone
    RequiredYes
  • Cancel by the rider (we call you) and by the driver (you send it)
    RequiredYes
  • trip.no_driver when nobody is free
    RequiredYes
  • Duplicate booking returns the same trip
    RequiredYes
  • Signatures and timestamps checked both ways
    RequiredYes
  • Rider code: a wrong code is refused, the right one starts the trip
    RequiredYes
  • Driver counts: a valid POST /supply with your sandbox key during the run
    RequiredYes
  • Trip with stops
    RequiredOnce your Max stops is above 0
  • Ratings both ways
    RequiredOptional
  • Settlement report matches
    RequiredOptional

Tools

  • UseSend signed events, and call your own endpoints the way we do
  • UseA reference partner in one Node file: run t_1 4821 plays a whole trip
  • Event log
    UseIn the portal: your last 100 events, accepted or refused, with the reason
Our reference partner

PerfectRide tests its own side against a mock partner that implements this spec, at https://www.perfectride.io/api/partner-sandbox/mock. Its behaviour follows the pickup address, which is a handy model for your own test switches:

  • slow: the quote takes 3 seconds (over the 2 second limit)
  • nodriver: 200 { "available": false }
  • broken: 500

It only answers keys PerfectRide wired to it.

View this page as Markdown · hello@perfectride.io