OpheliaDocs
Search docs⌘K
DashboardCreate an account
v3 · Guide

When a drive pauses

A booking can stop and wait for you: for a code the site sent the person, for your yes before a press, or for a card. This page shows how to answer each one, and how to let the booking go.

What it does

A pause is a booking answered with 202 and status: "requires_action". The booking is not finished and not failed: it is waiting for you. challenge_type says what it waits for, and resumable says how you answer.

challenge_typeresumableWhat it waits for and how to answer
otp
true
The site sent the person a code. The page is held open for you. Send the code to POST /v3/bookings/{attempt_id}/continue.
card_security_code
true
The order is paid with the card saved in the person's account (authorize.payment: "account_on_file"), and after the order press the store asks for that card's security code (CVV). Ask the person for its 3 or 4 digits and send them as code to POST /v3/bookings/{attempt_id}/continue. It is typed once and never kept. A wrong one ends in 409 not_confirmed_after_otp: the order press landed, so don't resend the booking.
authorize_action
false
The drive stopped before a press it may not make without your yes, and let the page go. To say yes, send the booking request again with authorize.authorized_for set to the pause's authorized_for and a new idempotency_key. The same key answers with this pause again.
payment_link
false
The booking waits for the cardholder to enter a card at pay_url. You send nothing. Read GET /v3/bookings/{booking_id} for the outcome.
link_wallet_approval
false
The booking waits for the person to approve the purchase in Link at pay_url (payment_collection: "link_wallet"). You send nothing. Read GET /v3/bookings/{booking_id} for the outcome.

A booking can pause more than once. After a code, the site may ask for something else, such as a bank's check. The drive pauses again under the same attempt, with a fresh window.

The request

Send the code

Ask the person for the code the site sent them, and send it to the route in continue_with. The field is code; otp_code is also accepted.

curl
curl -X POST https://api.opheliaos.com/v3/bookings/att_64bf82ce9687b7a239ed5f1c/continue \
-H "Authorization: Bearer YOUR_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{ "code": "246810" }'

The call stays open while the drive types the code and reads the result, then answers.

Let the booking go

If the person will not answer, abandon the attempt. The page is released and nothing more is typed. The route takes no body.

curl
curl -X POST https://api.opheliaos.com/v3/bookings/att_6cf2814d9eb72b0945453f1d/abandon \
-H "Authorization: Bearer YOUR_TEST_KEY"

Abandoning a booking that waits on a payment link spends the link: a card entered after that drives nothing. Abandoning one that waits on a Link approval cancels it the same way. If the card already arrived, or the person already approved, the abandon answers 200 processing with continue_in_flight: nothing was abandoned and the booking is being driven.

The response

A code pause
json
{
"status": "requires_action",
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"attempt_id": "att_64bf82ce9687b7a239ed5f1c",
"challenge_type": "otp",
"resumable": true,
"live_url": "https://opheliapractice.com/restaurant/practice-bistro",
"continue_with": "POST /v3/bookings/att_64bf82ce9687b7a239ed5f1c/continue",
"cancellable": false,
"cancel_via": "contact the venue directly using the confirmation on this booking"
}
FieldMeans
booking_id
The booking. Read it with GET /v3/bookings/{booking_id}.
attempt_id
The attempt that is paused. Continue and abandon take this id.
challenge_type
What it waits for: otp, card_security_code, authorize_action, payment_link or link_wallet_approval.
resumable
true: the page is held, so answer at continue_with. false: nothing is held; answer as the table above says.
live_url
The page the drive is paused on.
continue_with
How to answer, in words or as the route to call.
authorized_for, action
On an authorize_action pause: the value to send back, and the press it is for.
pay_url, pay_expires_at
On a payment_link or link_wallet_approval pause: the page for the cardholder (or Link's approval page), and when it lapses.
The right code

200 succeeded, with the site's confirmation_number.

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"
}
}
A wrong code

When the site says the code is wrong and asks again, you get the same pause back: 202 requires_action under the same attempt_id. Ask the person again and send the new code.

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

The code box is asked at most 3 times in all: the first ask and 2 more. The third wrong code ends the attempt with 409 not_confirmed_after_otp, because the press before the code has landed and the booking may exist.

json
{
"status": "failed",
"booking_id": "bk_54fafca4b13d2804d4cb40a3",
"attempt_id": "att_b85fa71bb6b6c6f858925d30",
"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 challenge: stalled on challenge at https://opheliapractice.com/restaurant/practice-bistro — the page says: That code isn't right. (a finalizing press DID land — 1 commit(s) — so this attempt may have created a booking and must not be retried)"
}

Once an attempt has ended, every continue gets that same answer back with idempotent_replay: true, even with the right code.

How long a pause is held

A code pause is held for 600 seconds (10 minutes). After that, or if Ophelia restarts, the pause lapses. A continue then answers 410 attempt_expired, and GET /v3/bookings/{booking_id} reads status: "failed" with the same error_code. The code was never typed, so the booking almost certainly did not complete, but v3 cannot confirm that. Check with the site if it matters. Then, if the person still wants one, start a new booking with a new idempotency_key.

A continue already running

While one continue is typing its code, a second continue or an abandon for the same attempt answers 200 with status: "processing" and error_code: "continue_in_flight". Nothing was typed or released, and the booking may complete. Do not send the code again. Read GET /v3/bookings/{booking_id} until it changes: while the continue runs, it reads processing with continue_in_flight too.

An abandoned attempt
json
{
"status": "failed",
"booking_id": "bk_ac12c8f2543da9a840e906e1",
"attempt_id": "att_6cf2814d9eb72b0945453f1d",
"failure_class": "terminal",
"error_code": "attempt_abandoned",
"error": "the held session was released and its browser closed. The challenge was never answered, so the booking was almost certainly not completed — but v3 cannot confirm that and cannot cancel, so treat the outcome as unknown and check with the venue if a commitment matters"
}

The abandon answers 200. The code was never typed, so the booking was almost certainly not made, but v3 cannot confirm that. Check with the site if it matters, then start a new booking with a new idempotency_key if the person still wants one. A continue sent after the abandon gets the same answer, with idempotent_replay: true.

An abandon can also answer 200 with status: "processing" and no error_code: nothing is paused, and the drive is still running. Read GET /v3/bookings/{booking_id} until it changes.

A payment-link pause

The booking has not started: it waits for the card. Pay covers payment links.

json
{
"status": "requires_action",
"reason": "waiting for the card: the cardholder enters it at pay_url, and the booking is then driven under this request's ceiling. Nothing has been attempted yet",
"booking_id": "bk_7216fc1be8d092c1e6c3b92a",
"attempt_id": "att_fccd618995fb1876c2fdf91e",
"challenge_type": "payment_link",
"resumable": false,
"continue_with": "the cardholder enters the card at pay_url; read GET /v3/bookings/bk_7216fc1be8d092c1e6c3b92a for the outcome",
"pay_url": "https://api.opheliaos.com/pay/Pc0u3Ma8Y2YVgiBT2ecA1lNivZEpWL9JcmdkD3cMK_U",
"pay_expires_at": "2026-11-04T01:21:17.144437Z"
}

A continue on a pause that is not waiting for a code (authorize_action, payment_link or link_wallet_approval) types nothing. It answers with the pause and says how to answer it.

When the request is missing something

422 with status: "needs_input" is not a pause. Nothing is held. It can come after a drive ran, and then nothing was pressed. missing[] lists what to add: each item has a role and a prompt, and for a choice such as a size, choice and the values to pick from. Send the request again with the missing value.

json
"missing": [
{
"role": "date",
"prompt": "the caller asked for no date"
}
]

What can go wrong

error_codeHTTPWhat it means and what to do
invalid_input
400
The continue had no code. Send {"code": "…"}.
unknown_attempt
404
No attempt with that id was ever started in your organization. Check the attempt_id. (An attempt that finished answers its stored result with idempotent_replay: true; one that lapsed answers 410 attempt_expired.)
attempt_expired
410
Not confirmed: the pause lapsed before the code arrived, so it is almost certainly not booked. Check with the site if it matters, then you may start a new booking with a new idempotency_key.
attempt_abandoned
200
Not confirmed: you abandoned the attempt, so it is almost certainly not booked. Check with the site if it matters, then you may start a new booking with a new idempotency_key.
continue_in_flight
200
Another continue is typing the code now (status: "processing"). Do not resend. Read the booking.
not_confirmed_after_otp
409
The third wrong code, or a final press landed and no confirmation was seen. The booking may exist. Never retry; tell the person and check with the site.
transaction_status_unknown
409
The drive was lost after the code was typed. The booking may exist. Never retry; read the booking, tell the person and check with the site.
Any other error_code
The code does not say when it happened. Read GET /v3/bookings/{booking_id} and check with the site before you book again. See Handle errors.

A continue with no code:

json
{
"error": "the challenge answer is required (send `code`)",
"error_code": "invalid_input"
}
An unknown outcome is not a failure to retry. After not_confirmed_after_otp or transaction_status_unknown, a final press may have landed, and v3 cannot cancel. A second booking can book twice.

Booking continues and connected-account continues share one budget: 20 every 5 minutes for your organization. See Rate limits.

Next: Pay.