Lesson 4 of 15
43. Design Flash-Sale Ticket Booking (Ticketmaster / IRCTC Tatkal)

43.3 What are the doors?

3 min read+10 XP

Step 3: API and data model (10 minutes)

POST /v1/sales/{id}/join (from 09:45; one spot per account) returns: { "queue_token": "q_…", "position": 600123, "eta_s": 300 } GET /v1/sales/{id}/queue?token=… (cheap, cached status poll) returns: { "position": 412000, "eta_s": 206 } or { "admitted": true, "admission_token": "a_…" } or { "sold_out": true } POST /v1/holds Authorization: admission_token body: { "section": "B", "count": 2 } returns: { "hold_id": "h_9", "seats": ["B-14", "B-15"], "expires_at": "10:07:31" } POST /v1/holds/{id}/pay Idempotency-Key: … → 202 (payment flow, Chapter 42)

The admission token is signed and short-lived: booking endpoints refuse anyone without one, so skipping the queue is impossible.