OpheliaDocs
Search docs⌘K
DashboardCreate an account
v3 · Guide

Book or buy

Book an entity on its site: a table, a room, a ticket or an order. Stop at the checkout form to see what it asks, or press the final button.

What it does

POST /v3/bookings opens the entity's page, picks what you asked for, fills the form with the customer's details and goes as far as you allow. A request that passes the checks gets a booking id (bk_…), even one that stops at the form or fails later. A request the checks refuse (a bad field, an offer check, commitment_refused, max_total_required, a payment-link refusal) has no booking_id.

max_commitmentHow far the drive goes
begin
As far as the checkout form, then stop. The drive presses the buttons that lead to the form, such as "Find a table" or "Add to cart". Nothing final is pressed and no card is typed.
commit
Press the final button. This is the default when you send no max_commitment.
A booking presses the final button unless you send "max_commitment": "begin". On a real site that books or buys for real. Use begin, or the practice site, while you build.

max_commitment: "read" presses nothing, so a booking refuses it with 409 commitment_refused. To only read, use search or availability.

The call stays open while the drive works, which can take minutes, and then answers. Set your client's timeout to match. If your client times out anyway, send the same request with the same idempotency_key: you get the booking as it stands (processing while the drive runs), never a second booking.

The request

FieldWhat to send
entity_id
The entity, from search. Or send its booking_url as url; entity_id wins when you send both.
offer_id
An off_ id from availability. Send the offer's own time as datetime too: the offer_id alone does not choose what is booked.
datetime
The offer's own time, in RFC 3339, written as the place's own local time with its own offset. For the 7:00 PM offer in New York: 2026-11-14T19:00:00-05:00. A booking named by entity_id or url with no location is driven with the clock time you wrote, as written. See Find something.
party_size
How many people. Other search fields, such as end_date, mean the same here.
customer
Who the booking is for: name (or first_name and last_name), email, phone, and where a site asks, dob, sex, postal_code, address.
authorize.max_commitment
begin or commit. Default commit.
authorize.fill_identity
true lets the drive type the customer's email and phone. See below.
idempotency_key
Your key for this booking, so a retry never books twice. Or send it as the Idempotency-Key header. Only POST /v3/bookings takes one.

Paying has its own page: Pay. So do orders from a store (Order from a store) and bookings on a person's own account (Use a person's own account).

Send the offer and its time
The offer_id does not choose what is booked. The booking is made for the datetime and party_size you send, on the entity you name. Where the page shows that time, that time is booked. Where it does not, the drive may book the first time the page shows. For rooms or ticket tiers, the drive books the row whose label names the room or tier your request asks for (slots room_type, bed_type, cabin or seat_preference), else the first row. So send the offer's own time as datetime with the party you read it for, name the room or tier when there are several, and check the confirmation.

The offer_id is still checked before anything runs: it must be yours, belong to this entity, and not be past its expires_at. It is kept on the booking. Where the site's results list their times and the offer's time is gone, the drive stops with offer_gone.

Let the drive type the email and phone

The drive types the customer's email and phone only when you send authorize.fill_identity: true. Without it the form stays unfinished.

Without fill_identity, a booking can still press the final button. On some forms the details button is the final one. The drive presses it with the email and phone empty, and the answer is 409 not_confirmed_after_otp: the booking may exist. Send fill_identity: true whenever the customer has an email or phone.

Here is that answer, from a booking sent with a customer and no authorize. The form report shows only name filled.

json
{
"status": "failed",
"booking_id": "bk_595765fb7b86bce361c6e1d9",
"booking": {
"form": {
"result": {
"complete": false,
"filled": ["name"],
"needs": ["email", "phone"]
}
},
"form_reached": true,
"pressed": true,
"screen": "identity"
},
"failure_class": "terminal",
"error_code": "not_confirmed_after_otp",
"error": "the booking was authorized to commit and never reached a confirmation — the drive ended on identity: stalled on identity at https://opheliapractice.com/restaurant/practice-trattoria — the form still wants email, phone (withheld or not held) (a finalizing press DID land — 1 commit(s) — so this attempt may have created a booking and must not be retried)"
}
Book at begin
curl
curl -X POST https://api.opheliaos.com/v3/bookings \
-H "Authorization: Bearer YOUR_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{
"entity_id": "ent_bc78e91578f61f35555280df",
"offer_id": "off_ea27bf414d62895bf8c9bec4",
"idempotency_key": "docs-begin-001",
"datetime": "2026-11-14T19:00:00-05:00",
"party_size": 2,
"customer": {
"name": "Jane Smith",
"email": "jane.smith.diner@gmail.com",
"phone": "+12124567890"
},
"authorize": {
"max_commitment": "begin",
"fill_identity": true
}
}'
Book at commit

The same request with no max_commitment, and its own key.

curl
curl -X POST https://api.opheliaos.com/v3/bookings \
-H "Authorization: Bearer YOUR_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{
"entity_id": "ent_bc78e91578f61f35555280df",
"offer_id": "off_ea27bf414d62895bf8c9bec4",
"idempotency_key": "docs-commit-001",
"datetime": "2026-11-14T19:00:00-05:00",
"party_size": 2,
"customer": {
"name": "Jane Smith",
"email": "jane.smith.diner@gmail.com",
"phone": "+12124567890"
},
"authorize": {
"fill_identity": true
}
}'
The idempotency key

A key is 1 to 128 letters, digits, ., _ or -, and starts with a letter or digit. Use a new key for each booking you mean to make, and for each new attempt after a failure. Send the same key again and you get the first answer back, a failure included, with idempotent_replay: true; nothing is driven again. The key is checked first, so a replay skips every other check.

Without a key, an identical commit request within 15 minutes is answered with the first booking and places nothing. The one exception: if the first failed in a way that placed nothing (a wall, a decline, out of stock), the second drives again. A request that changes anything, such as the card, the ceiling or the address, is a new request.

The response

At begin: the form, and nothing final pressed

200, status: "succeeded", a booking_id and no confirmation_number. At begin, succeeded means the drive reached the form, not that anything was booked: look at confirmation_number, not status, to know whether something was booked. The booking report says whether the form was reached, what it asks for (form.fields) and what was filled, still needed or missing (form.result).

json
{
"status": "succeeded",
"booking_id": "bk_d9a8ab05d47ca72b5c68615e",
"booking": {
"action": "Find a table",
"form": {
"fields": [
{ "key": "name", "tier": "pii" },
{ "key": "email", "tier": "pii" },
{ "key": "phone", "tier": "pii" }
],
"result": {
"complete": true,
"filled": ["name", "email", "phone"],
"missing": [],
"needs": []
}
},
"form_reached": true,
"screen": "identity",
"url": "https://opheliapractice.com/restaurant/practice-bistro",
"why": "the page asks for name, email, phone"
},
"cancellable": false,
"cancel_via": "contact the venue directly using the confirmation on this booking"
}

The offer and booking reports are for display and debugging; their inner keys can change. Know what an answer means covers them.

Branch on one key of booking: ALERT_BOOKING_CREATED. It means a begin drive landed on a confirmation anyway. A booking may have been made that you did not authorize. Tell the person and check with the site.
At commit: often a pause first

Some sites send the person a code before they confirm. The drive then pauses with 202 requires_action, and you send the code. When a drive pauses covers this.

json
{
"status": "requires_action",
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"attempt_id": "att_64bf82ce9687b7a239ed5f1c",
"challenge_type": "otp",
"resumable": true,
"continue_with": "POST /v3/bookings/att_64bf82ce9687b7a239ed5f1c/continue"
}
Booked

200, status: "succeeded" and the site's confirmation_number. confirmation is the page's own record, so its keys vary by site. An order's keys are on Order from a store. An RSVP, an appointment request or a free event can succeed at commit with no confirmation_number; reason then says so.

json
{
"status": "succeeded",
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"attempt_id": "att_64bf82ce9687b7a239ed5f1c",
"confirmation_number": "PB-108554",
"confirmation": {
"reference": "PB-108554",
"screen": "confirmed",
"url": "https://opheliapractice.com/restaurant/practice-bistro"
},
"cancellable": false,
"cancel_via": "contact the venue directly using the confirmation on this booking"
}
The same key again
json
{
"status": "succeeded",
"reason": "this idempotency key was already used; this is the first attempt's answer, and no second booking was made",
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"confirmation_number": "PB-108554",
"idempotent_replay": true
}
Not known yet

status: "processing" (200) means the outcome is not known yet. Do not send the booking again with a new key. Read it with GET /v3/bookings/{booking_id} until the status changes, or let a webhook tell you.

Read a booking later

GET /v3/bookings/{booking_id} reads the booking as it stands now. Mostly that is the stored answer. A pause is read again: one no longer held reads failed with attempt_expired (410), a lapsed payment link reads payment_link_expired (409), and a pause a continue is answering reads processing with continue_in_flight (200).

curl
curl https://api.opheliaos.com/v3/bookings/bk_a12d331e7b3dcd72d6fb057f \
-H "Authorization: Bearer YOUR_TEST_KEY"
No undo
v3 cannot cancel or change a booking. Every booking answer carries cancellable: false and cancel_via. To undo one, the person contacts the site or the place with the confirmation. POST /v3/bookings/{booking_id}/cancel and POST /v3/bookings/{booking_id}/modify exist only to refuse.
json
{
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"cancel_via": "contact the venue directly using the confirmation on this booking",
"cancellable": false,
"confirmation_number": "PB-108554",
"error": "v3 cannot cancel a booking. This booking is real and was not cancelled.",
"error_code": "not_implemented_in_v3"
}

That refusal is 501.

What can go wrong

A 409 means this request failed. Do not send the same request again. Whether a new attempt is fine depends on the code, and a new attempt always takes a new idempotency_key. Handle errors sorts every code into four answers.

May have booked

Never send the booking again, with any key. Tell the person, and check with the site.

error_codeHTTPWhat it means
not_confirmed_after_otp
409
A final press landed and no confirmation was seen.
transaction_status_unknown
409
The drive was lost after a press, or after a code was typed.
booked_a_different_entity
409
The drive completed a booking for a different thing than the one you named. The person must undo it with the site now.
Nothing was booked

Fix what the code names and try again with a new idempotency_key.

error_codeHTTPWhat it means and what to do
booking_error
409
The drive stalled before any final press. The booking report says where. Fix what it names and send again with a new key.
no_bookable_action
409
The page has no way to book online.
offer_gone
409
The site lists its times and the offer's time is no longer among them. Read availability again.
entity_not_reached
409
The drive no longer reaches the entity you named. Nothing was substituted. Search again.
offer_expired
409
The offer is past its expires_at. Read availability again for a fresh one.
unknown_offer
404
No offer has that id in your organization.
offer_entity_mismatch
400
The offer belongs to another entity. Send the offer's own entity_id.
unknown_entity
404
No entity has that id in your organization.
wrong_id_namespace
400
The id is not a v3 id (for example a v1 ven_ id).
unaddressable_entity
409
The entity has no page of its own. Pick another result.
commitment_refused
409
The booking was sent max_commitment: "read". Send begin or commit.
invalid_input
400
No entity_id or url, a bad idempotency_key, or another field that breaks a rule. error says which; Request rules lists them all.

Price ceilings (max_total_required, over_max_total) are on Order from a store. Codes and expired pauses (not confirmed, almost certainly not booked) are on When a drive pauses. Any other failure at commit does not say when it happened: read GET /v3/bookings/{booking_id} and check with the site before you book again. Bot walls, that rule and what to retry are on Handle errors. Every other error code is in Statuses and error codes.

Next: When a drive pauses.