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.
otptruePOST /v3/bookings/{attempt_id}/continue.card_security_codetrueauthorize.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_actionfalseauthorize.authorized_for set to the pause's authorized_for and a new idempotency_key. The same key answers with this pause again.payment_linkfalsepay_url. You send nothing. Read GET /v3/bookings/{booking_id} for the outcome.link_wallet_approvalfalsepay_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
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.
The call stays open while the drive types the code and reads the result, then answers.
If the person will not answer, abandon the attempt. The page is released and nothing more is typed. The route takes no body.
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
booking_idGET /v3/bookings/{booking_id}.attempt_idchallenge_typeotp, card_security_code, authorize_action, payment_link or link_wallet_approval.resumabletrue: the page is held, so answer at continue_with. false: nothing is held; answer as the table above says.live_urlcontinue_withauthorized_for, actionauthorize_action pause: the value to send back, and the press it is for.pay_url, pay_expires_atpayment_link or link_wallet_approval pause: the page for the cardholder (or Link's approval page), and when it lapses.200 succeeded, with the site's confirmation_number.
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.
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.
Once an attempt has ended, every continue gets that same answer back with idempotent_replay: true, even with the right code.
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.
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.
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.
The booking has not started: it waits for the card. Pay covers payment links.
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.
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.
What can go wrong
invalid_inputcode. Send {"code": "…"}.unknown_attemptattempt_id. (An attempt that finished answers its stored result with idempotent_replay: true; one that lapsed answers 410 attempt_expired.)attempt_expiredidempotency_key.attempt_abandonedidempotency_key.continue_in_flightstatus: "processing"). Do not resend. Read the booking.not_confirmed_after_otptransaction_status_unknownGET /v3/bookings/{booking_id} and check with the site before you book again. See Handle errors.A continue with no code:
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.