Test on the practice site
Set site to opheliapractice.com and v3 answers the request itself: the same routes, ids, statuses and error codes as a real site, with nothing reserved, bought or charged.
v3 works real websites, and POST /v3/bookings presses the final button by default. That holds for a test key too: only the practice site is pretend. The practice site is where you build and test your integration first. Send "site": "opheliapractice.com/restaurant" (or any path below) with your test key. No browser opens and no website is contacted. Everything else is the production API.
opheliapractice.com is a name the API recognises, not a website. A misspelling such as opheliapractise.com is treated as an ordinary site and worked for real, and a booking there commits by default.How it works
Practice answers are not mock responses written for the docs. Each one is the answer a real drive gives for that kind of page, read by the same code that reads a real drive. So the practice site behaves the way v3 does today, limits included: where a real drive returns less, so does practice.
oph_test_…) or live key. A test key holds v3:search and v3:book, and they work here as on any v3 call.246810, for every practice entity and for connecting an account (POST /v3/sessions). It never appears in a response: your agent has to ask the person, as with a real site.ent_, off_, bk_, att_, vss_ ids, the same HTTP statuses and error codesThe practice site
Each path stands for a kind of site. A bare opheliapractice.com takes its kind from your vertical. Every listing has at least three entities, because a real search that finds fewer than three results, with no term to narrow it, fails. Every restaurant, hotel, ticket and class page offers at least three things. Each shop item is one thing to buy.
opheliapractice.com/restaurantopheliapractice.com/hotelopheliapractice.com/ticketsopheliapractice.com/classopheliapractice.com/shopThe entities are in Ophelia Test City. Send "location": "Ophelia Test City" or no location. On the restaurant, ticket and class listings, an area such as "Old Town" works too. A search for another city fails the way a real one does when the page never mentions the place you asked for.
Walkthrough: a table with a texted code
Send "max_commitment": "begin" in authorize to stop at the checkout form instead. The answer says what was pressed and what the form asks for, and nothing is booked.
What the answers look like
Each result carries what the practice listing publishes: images, description, reviews, attributes, rating and rating_scale, a price with currency (a restaurant shows only a price band such as "$$$", with no price_amount or currency), and for products brand, seller and availability. Real sites publish less, often much less, so treat every one of these fields as optional. The reviews are written for the practice entities and describe nothing real.
A search with no term lists every entity of its kind. A term that matches only one or two entities returns those, as a real site's narrow search does: on the shop, "term": "headphones" returns Practice Over-Ear Headphones, and on the hotel, "term": "inn" returns Practice Inn. A term that matches nothing fails with 409 no_results, as a real site does when its own search says it found nothing: on the shop, "term": "spaceship".
A search sent with authorize.max_commitment: "begin" succeeds and also walks a result to its booking form, stopping there with nothing final pressed. Its answer carries the offer and booking reports beside the entities. Send searches with no authorize unless you want that.
Availability offers are what production reads off the page: the label on each control. A restaurant or class offer is its time ("7:00 PM"). A room or a ticket tier is the price printed on its button ("$378.00"), with no room name, price, unit or end date on the offer. Each offer's expires_at is at most 15 minutes after the read.
422, status: "needs_input", missing date409 search_error409 search_error: a product page has no availability to read. Book it directly.Send authorize.fill_identity: true when the customer's email or phone is needed.Without it Ophelia will not type either one into a form. The booking then stalls on the details form, and if that form's own button is the final one, it has already been pressed.
offer_id is checked before anything runs: an unknown one is 404 unknown_offer, another entity's is 400 offer_entity_mismatch, and an expired one is 409 offer_expired. It does not choose what is booked. The booking is for your datetime and party_size: the time you asked for if the page shows it, and otherwise the first time on the page. For a room or ticket tier, it 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 time as datetime with the party, name the room or tier when there are several, and check the confirmation. Book or buy has the rule.200, status: "succeeded" with confirmation_number202 requires_action, challenge_type: "otp". Send it to POST /v3/bookings/{attempt_id}/continue within 10 minutes.202 requires_action under the same attempt_id. The code is asked for three times in all. The third wrong code is 409 not_confirmed_after_otp.200 succeeded410 attempt_expired. GET /v3/bookings/{booking_id} then reads failed, attempt_expired.409 not_confirmed_after_otp. The final press landed: do not retry.409 booking_error. Nothing final was pressed.409 booking_error409 no_bookable_action, with no messageSend a code within the 10-minute window. If the person is not going to answer, call POST /v3/bookings/{attempt_id}/abandon. How pauses work is on When a drive pauses.
Test cards
Send the card in card on POST /v3/bookings. Practice entities never charge it. These numbers fail on purpose, at the payment step.
42424242424242424000000000000002409 card_declined, as a real store answers a decline. The page still asks for payment and shows no order: nothing was bought. Try another card.4000000000000119409 transaction_status_unknown. The booking may exist. On tickets it fails after the code.transaction_status_unknown (the 4000000000000119 card, or the timeout scenario) or not_confirmed_after_otp (the not_confirmed_after_otp or otp_not_sent scenario), the final button may have been pressed. Your agent must stop and tell the person. It must never retry: v3 cannot cancel, and a second attempt on a real site can book twice. See Handle errors.Failing on purpose
Set the Ophelia-Practice-Scenario header to make a request fail the way a real one does, at the step where it fails. For a scenario that fails on POST /v3/bookings/{attempt_id}/continue, set the header on the booking request; the continue does not need it. Any other value returns 400 invalid_practice_scenario. A bad Ophelia-Practice-Timing value returns 400 invalid_practice_timing, and is checked first.
blocked503 bot_wall_blocked, failure_class: "retryable_elsewhere"timeoutcommit fails with 409 transaction_status_unknown. A booking at begin, a search or an availability call fails with 502 runner_transport.slowno_availability409 search_error. A booking is 409 no_bookable_action.phone_only409 no_bookable_actioncard_declined409 card_declined. Nothing was bought.otp_not_sent409 not_confirmed_after_otpotp_expired410 attempt_expired.card_security_codeaccount_on_file, after a connect) pauses after its order press with challenge_type: "card_security_code". Continue with 123 to confirm; any other code ends in 409 not_confirmed_after_otp.not_confirmed_after_otp409 not_confirmed_after_otp.modify_not_verified, phone_invalid and terms_changed are accepted, because v1 uses them, but they have no effect on v3.
Timing
v3 works somebody else's website the way a person would, so it is much slower than an ordinary API. By default every practice step takes as long as a typical real drive. Set your client's timeouts against these numbers, not against a fast test.
The search and booking-form numbers come from real drives. The numbers for availability, completing a booking and answering a code are estimates. A site Ophelia read moments ago can add up to 25 s more on a real drive.
livefastinstant