Open the Château de Versailles payment page
Automatically open the Château de Versailles payment page on billetterie.chateauversailles.fr. Take the cart filled with add_to_cart and identified with fill_booking_details on the official Château de Versailles ticket shop to its payment page, and stop there. It never enters payment details and never pays: with dryRun true (the default) it opens the payment form and returns whether it was reached, the total in euros, the payment provider and the cart lines; dryRun false is refused. It opens the payment form only for the cart the caller reviewed: without a reviewHash, or when the cart changed, it opens nothing and the error gives the current cart and its reviewHash. It ticks the shop's sales conditions box, which the shop asks for before payment. A cart with a total of 0 is confirmed by the shop without payment, so the script stops before that step and says so. An empty cart, or a browser that did not go through fill_booking_details, fails with an error that names the script to run first.
Input
dryRun optionalStop at the payment page. The script never pays, so false is refused.
Default: truelanguage optionalreviewHash optionalThe cart's reviewHash. Without it, or when the cart changed, the script opens nothing and returns the current cart and its reviewHash in its error.
Output
lines requiredtotal requiredpaymentPageReached requiredreason optionalreviewHash optionalHash of the cart's slots, rates, quantities, prices and total.
paymentHost optionalpaymentProvider optionalFAQ
Check Château de Versailles ticket availability
For one visit date on the official Château de Versailles ticket shop, list the entry time slots of one ticket type (Passport by default) with the places left in each slot and every rate the slot offers (full, reduced, youth, child, free) with its price in euros. Also lists every ticket type sold that day, so a caller can pick another one by name or id. A day with no entry tickets on sale (for example a Monday, when the palace is closed) returns no slots and a reason. A date in the past or not yet on sale fails with an error, unless time is given. Pass time (HH:MM) to get only that slot, with available and, when it cannot be booked, the reason (full, closed, not on sale, or no entry at that time) instead of an error. visitors only sets enoughForVisitors on each slot; it reserves nothing.
Fill Château de Versailles booking details
Give the visitor details for the cart already filled with add_to_cart on the official Château de Versailles ticket shop, as a guest (no account is created). The shop checks every email address with a 6-digit code it sends to that address, so this runs in two passes on the same browser: first with the email only, which makes the shop send the code and returns status email_code_sent; then again with the same email, the code from that email and the visitor's first and last name, which fills the guest form and returns status details_filled. Returns the fields the shop requires and whether each one is filled. It stops before payment: run pay next. A wrong or expired code fails with an error that says to run the first pass again. An empty cart fails with an error that says to run add_to_cart first.
Add Château de Versailles tickets to the cart
Put tickets for one date, one entry slot and one ticket type (Passport by default) in the cart of the official Château de Versailles ticket shop, with a quantity per rate (full, reduced, youth, child, free). Take the slot and the rates from check_availability: a slot is its slotId or its time (HH:MM), a rate is its priceId or its label. Returns the cart lines (date, slot time, entrance, ticket, rate, quantity, unit price, line total), the cart total in euros and how many seconds the site still holds the cart. The cart lives in this browser: tickets already in it stay there and are listed too. The site holds a cart for about 35 minutes. Nothing is paid or booked. A quantity above what the slot allows, an unknown slot or an unknown rate fails with an error that names the valid ones.
