Skip to content

Webhooks we send

Every event PerfectRide sends to your webhook URL, with an example, retries and signing.

Delivery

  • Method
    RulePOST to your webhook URL, Content-Type: application/json
  • Signature
    RuleSigned like every call with your webhook secret and path /, whatever your URL's path
  • Envelope
    RuleEvery event has event, event_id and occurred_at
  • Success
    RuleAny 2xx within 8 seconds. Redirects are not followed
  • Retries
    Rule30 seconds, then doubling, at most 1 hour apart, for 24 hours
  • Repeats
    RuleThe event_id never changes between retries. Ignore one you have already handled
  • Ordering
    RuleNot guaranteed. Use occurred_at and the current state, not arrival order
const seen = new Set(); // use your database

app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const raw = req.body.toString("utf8");
  // Our webhook calls are signed with path "/", whatever your URL is.
  if (!prVerify(process.env.PR_SECRET, "POST", "/", raw, req.headers)) return res.sendStatus(401);
  const e = JSON.parse(raw);
  if (!seen.has(e.event_id)) {
    seen.add(e.event_id);
    handle(e); // driver.paused, statement.ready, trip.rider_contact, ...
  }
  res.sendStatus(200); // any 2xx stops our retries
});

Events

  • trip.rider_contact
    WhenLive trips, when a driver is assigned, and again on reassign
    Fieldspr_trip_id, partner_trip_id, rider { first_name, phone }
  • driver.paused
    WhenPerfectRide paused a driver
    Fieldsdriver_id, reason (rider_complaints, low_ratings, safety_review, documents, other), until (or null)
  • driver.reinstated
    WhenThe pause ended
    Fieldsdriver_id
  • partner.balance_due
    WhenYou owe us at the end of a period, or you passed your credit limit
    Fieldsamount_due, currency, then period_start and period_end, or reason: "credit_limit"
  • account.status_changed
    WhenYour account status changed
    Fieldsfrom, to (sandbox, in_review, pilot, live, paused), reason (optional)
  • statement.ready
    WhenOnce a day, for the day before (WAT)
    Fieldsdate, trips, amount (what we owe you, kobo), currency
Example: trip.rider_contact
Body
{
  "event": "trip.rider_contact",
  "event_id": "evt_0b6f2c4e-...",
  "occurred_at": "2026-12-03T10:01:13Z",
  "pr_trip_id": "pr_55a9",
  "partner_trip_id": "t_9931",
  "rider": { "first_name": "Ada", "phone": "+2348031234521" }
}
Example: driver.paused
Body
{
  "event": "driver.paused",
  "event_id": "evt_6a1e...",
  "occurred_at": "2026-12-03T12:00:00Z",
  "driver_id": "d_771",
  "reason": "rider_complaints",
  "until": null
}
Example: partner.balance_due
Body
{
  "event": "partner.balance_due",
  "event_id": "evt_91c3...",
  "occurred_at": "2026-12-08T06:00:00Z",
  "amount_due": 1250000,
  "currency": "NGN",
  "period_start": "2026-12-01T00:00:00.000Z",
  "period_end": "2026-12-08T00:00:00.000Z"
}
Example: account.status_changed
Body
{
  "event": "account.status_changed",
  "event_id": "evt_2d7a...",
  "occurred_at": "2026-12-10T09:00:00Z",
  "from": "in_review",
  "to": "pilot"
}
Example: statement.ready
Body
{
  "event": "statement.ready",
  "event_id": "evt_7f3a...",
  "occurred_at": "2026-12-04T06:00:00Z",
  "date": "2026-12-03",
  "trips": 38,
  "amount": 21450000,
  "currency": "NGN"
}
Tip: New fields may appear at any time. Ignore ones you don't recognise.

View this page as Markdown · hello@perfectride.io