Associate or move an existing booking to a trip

Associate an existing booking with the trip, or atomically move it from its current trip. This endpoint does not create a booking; it only links an already-persisted booking row (created via POST /v1/{vertical}/bookings or reconciliation) to the trip via trip_segment_bookings.

Move semantics (MER-765): if the booking is already linked to a different trip, it is atomically detached and re-attached within a single DB transaction; empty segments on the old trip are removed.

Idempotent on retry: a re-attach of a booking that is already linked to this trip succeeds and returns the existing stage — no duplicate rows are created.

Stub reconciler note (MER-449 → MER-451): every booking currently lands in its own freshly-created stage; role is derived from the vertical alone. Once MER-451 ships, multiple bookings sharing a destination + date window will collapse into a single stage and round-trip flights will pick up a paired egress role.

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

Request body for POST /v1/trips/{tripId}/bookings.

uuid
required

Mercury Booking.id UUID to attach to the trip.

Responses

404

Trip or booking not found

422

Booking vertical not supported, or destination city could not be extracted from booking detail.

503

Database unavailable

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