Book an event on a single calendar with a booking code
Changed onResolve 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.
Request
- The document declares no server URL.
- Auth: none declared. Required headers: X-Booking-Code
Headers
Single-use booking code, minted with the CREATE permission and scoped to a single calendar (not an appointment type).
Request body
Response
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
- ○