OpheliaDocs
Search docs⌘K
DashboardCreate an account
v3 · Guide

Get told when it changes

A booking can take minutes, and it can pause or finish after your call has returned. A webhook tells you the moment it moves, with what happened and why.

What you get

Every time a booking changes, Ophelia sends your webhook URL the booking as GET /v3/bookings/{booking_id}would answer it at that moment. You don't need to poll: act on the event, and read the booking only when you want to be sure of its latest state.

The events

typeSent when
v3.booking.processing
The booking was accepted and the drive started, or the cardholder entered the card on a pay link and the drive is starting.
v3.booking.requires_action
The drive paused for you: a code, a card on a pay link. continue_with says how to answer.
v3.booking.succeeded
Booked, or a begin drive reached the form. confirmation_number when the site issued one.
v3.booking.failed
It did not book, or it may have. failure_class and error_code say which.

The v3. prefix keeps these apart from v1's booking.* events if you use both: the ids and statuses are not the same.

What an event says

data.object is the API's own answer for the booking, plus object, host, entity_id, created_at and updated_at. On a failure, read it in this order:

FieldTells you
failure_class
retryable_elsewhere: nothing was committed, so trying again is safe. terminal: stop; a retry could book twice.
error_code
What happened, as a code you can branch on. Handle errors sorts every code into booked, not confirmed, nothing booked, and check first.
error
The same thing in one sentence you can show a person.
diagnosis
When the site refused a form: its own reason. cause names the kind, detail usually names the field it wanted, alerts are the messages the page showed.
booking
How far the drive got: what it pressed, the screen and url it stopped on, the form it found and what was filled.
An event sent when the drive ends carries everything the drive saw. A later GET keeps the status, the code and the message, but not diagnosis or the drive's booking report. Keep the event if you want the detail.

Examples

The site refused the form
json
{
"id": "evt_9TqLm2Rx4Pb",
"type": "v3.booking.failed",
"created": "2026-11-14T19:03:12Z",
"data": {
"object": {
"object": "booking",
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"entity_id": "ent_5c0d2e9b81f4a7c3d6e1f209",
"host": "opheliapractice.com",
"status": "failed",
"failure_class": "terminal",
"error_code": "booking_error",
"error": "the drive reached the booking form and could not get past it; nothing was booked",
"diagnosis": {
"cause": "missing_required_input",
"detail": "Phone number is required.",
"alerts": ["Phone number is required."]
},
"booking": {
"pressed": "Reserve",
"url": "https://opheliapractice.com/restaurant/practice-bistro/book",
"form_reached": true
},
"cancellable": false,
"cancel_via": "contact the venue directly using the confirmation on this booking",
"created_at": "2026-11-14T19:01:40Z",
"updated_at": "2026-11-14T19:03:12Z"
}
}
}

Nothing was booked (booking_error), and the site said why: it wanted a phone number. Send customer.phone and book again with a new idempotency_key.

The drive is waiting for a code
json
{
"id": "evt_2HvXa8Kd0Lq",
"type": "v3.booking.requires_action",
"created": "2026-11-14T19:02:05Z",
"data": {
"object": {
"object": "booking",
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"attempt_id": "att_64bf82ce9687b7a239ed5f1c",
"host": "opheliapractice.com",
"status": "requires_action",
"entity_id": "ent_5c0d2e9b81f4a7c3d6e1f209",
"challenge_type": "otp",
"resumable": true,
"continue_with": "POST /v3/bookings/att_64bf82ce9687b7a239ed5f1c/continue",
"cancellable": false,
"cancel_via": "contact the venue directly using the confirmation on this booking",
"created_at": "2026-11-14T19:01:40Z",
"updated_at": "2026-11-14T19:02:05Z"
}
}
}

The drive holds the site's page for 10 minutes. See When a drive pauses.

Where they go

Events go to your organization's webhook URL, set on the dashboard's Settings page, with the same signature, retries and delivery history as v1. Webhooks covers all three, with code to check the signature.

RuleWhy it matters
An event is sent only after the booking is saved.
What an event says is what GET will say. If a late failure loses to a confirmation, no failed event is sent.
At least once, in any order.
Deduplicate on the event id. When order matters, read the booking.
No URL, no events.
Nothing is queued for later. Read the booking instead.

Next: Pay.