Create a stay booking (with optional protection plan)

Create a stay booking from a locked fare. Accepts the same fields as POST /v1/{vertical}/bookings plus an optional insuranceQuotes list of Mercury protection-plan UUIDs from GET /v1/stays/fares/{fareId}/protection-plans.

Quote UUIDs are translated to provider IDs before forwarding. A stale or unknown UUID results in 410 QUOTE_EXPIRED.

The Idempotency-Key header is required.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Request body for POST /v1/stays/bookings (MER-761).

Stays-only booking creation request. Extends
:class:CreateBookingRequest with insuranceQuotes — a list of Mercury
protection-plan UUIDs obtained from
GET /v1/stays/fares/{fareId}/protection-plans — and rooms — an
optional per-room guest allocation for multi-room bookings.

fareId is the canonical locked-fare identifier (Mercury UUID from
POST /v1/stays/fares/build). tripId optionally associates the
booking with an existing trip.

UUIDs in insuranceQuotes are translated to provider quote IDs before
forwarding. A stale or unrecognised UUID results in 410 QUOTE_EXPIRED.

This schema is intentionally limited to POST /v1/stays/bookings so
that insuranceQuotes and rooms do not appear in the OpenAPI
schemas for flights, trains, or cars.

string
required

Locked fare ID from the search session.

passengers
array of objects

Passenger details. Exactly one adult must have isHolder=true.

Passengers
extraServices
array of objects
deprecated

Deprecated: send all ancillary selections via ancillaries. Still accepted for back-compat; ancillaries takes precedence.

Extraservices
array | null

Unified ancillary selection input. Each item: {id, quantity, passenger_id}. Takes precedence over extraServices when both are provided. For cars, both booking-flow and pay-at-desk selections go here; Mercury routes each to the correct provider bucket by its ancillary kind, so requestServices is no longer needed.

requestServices
array of objects
deprecated

Deprecated (cars only): pay-at-desk selections now belong in the unified ancillaries field, which Mercury routes by ancillary kind. Still accepted for back-compat.

Requestservices

Optional trip to associate this booking with. When provided, a TripSegment record is persisted linking the booking to the trip.

Whether this is a personal (non-business) booking.

Contact phone number for the booking.

Invoice profile to use for this booking. Omitting the key and sending an explicit null are equivalent: Mercury resolves both to the account's first available invoice profile (the same list GET /v1/invoice-profiles/booking returns) before the request reaches the provider, so neither shape is ever forwarded to the provider as a null or missing value. A client that has already defaulted this field to null (for example a generated TypeScript client with no way to omit an optional key it has serialized) still gets auto-resolution — it does not need to strip the key to opt in. When the account has no invoice profile at all, booking creation fails with a 422 NO_INVOICE_PROFILE error before any provider call is made — no booking is created and no fiscal documents are issued. Do not assume a newly created guest-checkout account (from the magic-link exchange) has a default invoice profile at the moment of its first booking — Mercury's own account provisioning does not create one, so that first booking should be expected to hit this error unless a real invoiceProfileId is supplied explicitly. Whichever profile is resolved cannot be changed after create — there is no way to point an existing booking at a different profile. Whether an edit to this profile (PATCH /v1/invoice-profiles/{id}) made after this booking is created — including appending an emailRecipients entry — is reflected in the invoice this booking eventually generates is not currently documented or guaranteed. Do not design a flow that depends on a post-create edit reaching this booking's invoice.

Billing address to associate with this booking. Omitting the key and sending an explicit null are equivalent, following the same null-as-absent rule as invoiceProfileId: both are resolved from the resolved invoice profile's default billing address before the request reaches the provider. That defaulting applies to stays and flights; for cars and trains the key is left off the request to the provider entirely rather than sent as null.

A flight booking needs a billing address to be confirmed. The provider requires one to finalize and reports it missing only at POST /v1/flights/bookings/{id}/confirm, by which point the booking already exists and can never be confirmed. So when a flight create resolves no billing address — none sent here, and the resolved invoice profile has no default — it fails with 422 BILLING_ADDRESS_REQUIRED (recoveryAction: FIX_INPUT, field error on this field) before any provider call, and no booking is created. Send a billingAddressId from GET /v1/billing/addresses, or an invoiceProfileId whose defaultBillingAddressId is set. A newly provisioned guest-checkout account has neither, so a guest flight booking must supply this field. Cars, trains and stays are not subject to this check.

object | null

Answers to the account's custom fields for this vertical, keyed by definition key (from GET /v1/custom-fields). Values: string for text/single_select (option key) and date (YYYY-MM-DD), list of option keys for multi_select. Answers are validated against the account's definitions; any invalid answer fails the request with a field-level 422. An empty value ("" or []) means unanswered and is stripped at the boundary, so it is treated identically to omitting the key.

length ≤ 2000

A message for the approver, for a traveler whose company requires one on bookings that need approval (see approvalMessageRequired on GET /v1/profile/identity). Passed on to the approver, stored on the booking and returned as approvalMessage on its detail. Optional; blank counts as missing. When the company requires one and it is missing, create fails with 422 APPROVAL_MESSAGE_REQUIRED.

array | null

Optional list of protection-plan Mercury UUIDs from GET /v1/stays/fares/{fareId}/protection-plans. UUIDs are translated to provider quote IDs before forwarding.

array | null

Optional per-room guest allocation for a multi-room stay booking. Each entry lists the passengers indices assigned to that room, mirroring StaySearchRequest.rooms from search so a client can carry its search-time room split into the booking. Omit for a single-room booking — identical wire behaviour to today. When provided, every passenger (adult, child or infant) must be referenced by exactly one room, and exactly one referenced passenger must have isHolder=true.

length ≤ 2000

Why the traveler is booking outside travel policy, as typed at checkout. Stored on the booking and returned as policyJustification on its detail. Optional; blank counts as missing. It does not answer a confirm that asks for a reason: send that on the confirm request.

The taskId of the traveler's quote request (the requestQuote TIE task) when the booking is made from one of its quoted options in the quote's checkout. Once the booking is created, Mercury ends that task as customer_accepted and links it to the booking; no chat acceptance or device confirmation is involved. A task that is not the caller's, is not a quote request, or has already ended is ignored: the booking is created either way. Omit it for any other booking.

Headers

Client-generated idempotency key (UUID v4 recommended). Required on all booking mutation requests.

Responses

401

Missing or invalid authentication

403

User lacks booking capability for this vertical

404

Fare not found or expired / trip not accessible

409

Booking already exists (conflict)

410

Protection plan quote expired; re-fetch quotes

422

Validation error, missing passenger document, missing Idempotency-Key, or APPROVAL_MESSAGE_REQUIRED

503

Booking service not configured

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json