Booking Codes

Cancel an event, single-calendar or appointment-type-bound, with a booking code

Changed on

Consume FIRST, then delete, matching the GraphQL original.

The event FK on the token has on_delete=CASCADE, so deleting the event would cascade-delete the token -- making a post-delete consume impossible. Consuming first (via SELECT FOR UPDATE) keeps the row alive long enough to lock it; the cascade then removes the already-consumed token row when the event is deleted. Both statements share the one outer transaction.atomic() block below, so if the delete step raises unexpectedly, the whole block -- including the consume -- rolls back, leaving the code available for retry.

post/public/booking/events/cancel/

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 CANCEL permission and bound to a specific event.

Response

No response body

Changes