{"record":{"id":"aa704bdba60ea700","repo":"calcom/cal.diy","slug":"no-more-seats-left-at-this-seated-booking","errorCode":null,"errorMessage":"No more seats left at this seated booking.","messagePattern":"No more seats left at this seated booking\\.","errorType":"exception","errorClass":"ConflictException","httpStatus":409,"severity":"error","filePath":"apps/api/v2/src/platform/bookings/2024-08-13/services/bookings.service.ts","lineNumber":547,"sourceCode":"      }\n\n      const outputBooking = await this.outputService.getOutputCreateSeatedBooking(\n        databaseBooking,\n        booking.seatReferenceUid || \"\",\n        userIsEventTypeAdminOrOwner\n      );\n      return Object.assign(\n        outputBooking,\n        booking.userId\n          ? {\n              isPlatformManagedUserBooking: booking.user?.isPlatformManaged ?? false,\n            }\n          : {}\n      );\n    } catch (error) {\n      if (error instanceof Error) {\n        if (error.message === \"booking_seats_full_error\") {\n          throw new ConflictException(\"No more seats left at this seated booking.\");\n        }\n      }\n      throw error;\n    }\n  }\n\n  async getBooking(uid: string, authUser: AuthOptionalUser) {\n    const booking = await this.bookingsRepository.getByUidWithAttendeesWithBookingSeatAndUserAndEvent(uid);\n    const userIsEventTypeAdminOrOwner =\n      authUser && booking?.eventType\n        ? await this.eventTypeAccessService.userIsEventTypeAdminOrOwner(authUser, booking.eventType)\n        : false;\n\n    if (booking) {\n      const isRecurring = !!booking.recurringEventId;\n      const isSeated = !!booking.eventType?.seatsPerTimeSlot;\n\n      if (isRecurring && !isSeated) {","sourceCodeStart":529,"sourceCodeEnd":565,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/platform/bookings/2024-08-13/services/bookings.service.ts#L529-L565","documentation":"Thrown as a ConflictException (HTTP 409) when the underlying booking creation detects that a seated event type has no remaining seats. The service catches an error whose message equals 'booking_seats_full_error' (emitted by the core handleNewBooking/booking engine) and re-throws it with this user-facing message.","triggerScenarios":"Creating or rescheduling a booking on a seated event type (seatsPerTimeSlot set) where all seats for that time slot are already booked — the new attendee would exceed capacity.","commonSituations":"Concurrent booking requests racing for the last seat; UI allowed selection of a slot that filled in the meantime; seatsPerTimeSlot reduced after bookings were made.","solutions":["Call the availability/slots endpoint immediately before booking to confirm remaining seats.","On 409, refresh slot availability and offer the user an alternative time.","Increase seatsPerTimeSlot on the event type if demand exceeds capacity."],"exampleFix":"// before — book blindly\nawait client.post('/v2/bookings', body);\n// after — check seats then book, retry on conflict\nconst slots = await client.get(`/v2/slots?eventTypeId=${eventTypeId}`);\nif (slots[0].attendeesRemaining > 0) {\n  try { await client.post('/v2/bookings', body); }\n  catch (e) { if (e.status === 409) refreshSlots(); else throw e; }\n}","handlingStrategy":"retry","validationCode":"const slot = await client.get(`/v2/slots?eventTypeId=${eventTypeId}&startTime=${start}`);\nif ((slot.attendeesRemaining ?? 0) <= 0) throw new Error('No seats remaining');","typeGuard":"function hasSeats(slot: { attendeesRemaining?: number }): boolean {\n  return typeof slot.attendeesRemaining === 'number' && slot.attendeesRemaining > 0;\n}","tryCatchPattern":"try { await client.post('/v2/bookings', body); }\ncatch (e) {\n  if (e.status === 409 && /No more seats/i.test(e.message)) { /* refresh slots, offer alt time */ }\n  else throw e;\n}","preventionTips":["Check seat availability right before booking","Handle 409 by refreshing and retrying with a new slot","Increase seatsPerTimeSlot if chronic contention"],"tags":["api-v2","bookings","seats","conflict","concurrency"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}