# Rider code (PIN)

> A trip starts only when your driver enters the rider's 4-digit code.

1. The rider sees a 4-digit code in the PerfectRide app and tells the driver.
2. The driver enters it in your app.
3. You send it as `pin` in `trip.started`. We check it.

**trip.started**

```json
{
  "event": "trip.started",
  "event_id": "ev_0001",
  "partner_trip_id": "t_9931",
  "pr_trip_id": "pr_55a9",
  "occurred_at": "2026-12-03T10:06:02Z",
  "pin": "4821"
}
```

## Wrong codes

- A wrong code gets 422 `wrong_pin`. Ask the driver to check it with the rider and send `trip.started` again with a new `event_id`.
- After 5 wrong codes we answer 422 `pin_locked`. The trip cannot start and the rider contacts PerfectRide support.
- The right code does not use up a try.

> **Warning:** Never show the code to the driver before the rider says it, and never guess. Repeated guesses lock the trip.

> **Tip:** In the sandbox, certification checks both: send `0000` first (refused), then the PIN the portal shows.

## Next

- [Trip events](https://docs.perfectride.io/docs/trip-events.md): Tell PerfectRide what happens on each trip, in order, and handle our answers.
- [Stops](https://docs.perfectride.io/docs/stops.md): Up to 3 stops between pickup and drop-off, priced in your quote. Off until you turn them on.
- [Driver app rules](https://docs.perfectride.io/docs/driver-app-rules.md): What your driver app shows on every PerfectRide trip, and what drivers never do.

Source: https://docs.perfectride.io/docs/rider-code
