Booking Codes

Book an event on a single calendar with a booking code

Changed on

Resolve the code, then create the event and consume the code atomically.

Create FIRST, then consume, matching the GraphQL original (create_calendar_event_with_code). Both statements run inside the same outer transaction.atomic() block (see step 5 below), so any exception either one raises -- including consume_code's TokenAlreadyUsedError on a lost race -- unwinds the whole transaction: the DB outcome (one event, code consumed once) is the same regardless of which statement runs first. What create-first actually buys is that both racers do the provider-side write (the adapter's create_event call) before either one's outcome is decided, rather than the loser being turned away by the row lock before ever reaching the provider.

post/public/booking/calendar-events/

Request

  • The document declares no server URL.
  • Auth: none declared. Required headers: X-Booking-Code

Headers

X-Booking-Codestring required

Single-use booking code, minted with the CREATE permission and scoped to a single calendar (not an appointment type).

Request body

titlestring required
descriptionstring
start_timestring date-time required
end_timestring date-time required
timezonestring required

Response

idinteger required
providerstring
titlestring required
descriptionstring
start_timestring date-time required
end_timestring date-time required
timezonestring required
createdstring date-time required
modifiedstring date-time required
external_idstring required
rrule_stringstring

RRULE string for creating recurring events

parent_recurring_object_idinteger

ID of parent event for recurring instances

is_recurring_instanceboolean required

True if this is an instance of a recurring event

is_recurringboolean required

True if this is a recurring event

is_recurring_exceptionboolean

True if this object is an exception to the recurrence rule (modified occurrence)

recurrence_idstring date-time nullable

For recurring instances, this identifies which occurrence this is

google_calendar_service_accountinteger
calendarinteger

Changes

    • ▲

      removed the required property from the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status