Change a Held Seat Without Losing the Cart

Handle a seat upgrade with server-held inventory: check cart capacity, hold the replacement, release the old seat, recalculate the total and handle conflicts.

An amber seat moving between rows in a miniature theater seating model.

A buyer holds Stalls C12 and asks for B12. The map can highlight B12 immediately, but the order must not promise it until inventory accepts the change. A booking session gives your page a server-held cart for one event; it does not provide an atomic two-seat exchange or adjust a payment for you.

Use an explicit pre-payment sequence

  1. Read the current session. Confirm it is ACTIVE, contains C12 and has time left. Keep C12 visible as held while the buyer considers B12.
  2. Check maxSeats from session creation. Holding B12 before releasing C12 temporarily uses one extra place. If the cart is already at its limit, do not start a hold-first swap that the session must reject.
  3. Show the proposed seat and price to the buyer. Request lock for B12. A successful response is the first point at which you may show B12 as held. On a 409 conflict, keep C12 and show which proposed seat was unavailable.
  4. Request unlock for C12, then redraw from the returned cart and total. The brief interval between calls can contain both seats; do not mistake that interim total for the amount to charge. If the second call fails or its result is unclear, call get before offering checkout.
  5. Ask the buyer to accept the final seat and total. Call checkout to freeze the cart for payment. Your backend still owns payment, order changes and final confirmation.

Suppose C12 is €60 and B12 is €80. During a hold-first change, the interim cart may total €140. The final one-seat cart should total €80. Display the final server response and your own order calculation, including any fees or taxes, before asking for payment.

Choose a policy for a full cart

When maxSeats leaves no spare place, a release-first attempt can free C12 before B12 is acquired. B12 may then be taken by another buyer, and C12 may no longer be recoverable. State that risk in the interface and let the buyer keep the current seat or start a new selection. Do not label two separate API calls a guaranteed swap. For a paid order, use your platform’s separate exchange and refund policy rather than reopening a finished cart in the browser.

Result What the booking page should do
Replacement hold refused Keep the original held seat and explain the conflict.
Session expired or cancelled Clear the old selection, explain that inventory was released, and start a new session if the buyer continues.
Session PENDING_PAYMENT Stop seat editing; the cart is frozen. Use an explicit start-over flow if payment is abandoned.
Uncertain result after a network failure Fetch the session again and render its actual cart before any retry.

Test these four cases with your payment handoff before enabling a seat-change button. If your current checkout cannot explain the cart’s intermediate state, book a demo with the exact exchange flow you want buyers to use.

Continue reading

All posts →

Restore a Seat Cart After a Page Reload

Persist a booking-session id, reload the server-held cart, handle expired or frozen states, and show buyers which seats they still own after a refresh.