{"lexicon":1,"id":"tickets.atmosphere.createTicketHold","defs":{"main":{"type":"procedure","description":"Atomically reserve ticket capacity and return an ATM checkout URL.","input":{"encoding":"application/json","schema":{"type":"object","required":["items"],"nullable":["buyerDid","buyerAssertionJwt","customerEmail","idempotencyKey"],"properties":{"environment":{"type":"string","knownValues":["test","live"],"maxLength":16},"eventId":{"type":"string","minLength":1,"maxLength":300},"eventUri":{"type":"string","format":"at-uri"},"buyerDid":{"type":"string","format":"did"},"buyerAssertionJwt":{"type":"string","description":"Optional short-lived user service-auth JWT from buyerDid to ATM. Proves the originating app saw this signed-in buyer without giving ATM a browser OAuth session.","maxLength":8192},"customerEmail":{"type":"string","maxLength":320,"description":"Private delivery/receipt hint for ticket emails. Stored privately by ATM; never written to protocol records."},"items":{"type":"array","items":{"type":"ref","ref":"tickets.atmosphere.defs#ticketHoldItemRequest"},"minLength":1,"maxLength":20},"returnUrl":{"type":"string","format":"uri","maxLength":2000},"cancelUrl":{"type":"string","format":"uri","maxLength":2000},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200},"metadata":{"type":"unknown"}}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["holdId","token","url","expiresAt","amountCents","currency","items"],"properties":{"holdId":{"type":"string","maxLength":300},"token":{"type":"string","maxLength":500},"url":{"type":"string","format":"uri","maxLength":2000},"environment":{"type":"string","knownValues":["test","live"],"maxLength":16},"expiresAt":{"type":"string","format":"datetime"},"amountCents":{"type":"integer","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"items":{"type":"array","items":{"type":"ref","ref":"tickets.atmosphere.defs#ticketHoldItem"},"minLength":1,"maxLength":20},"reused":{"type":"boolean"}}}},"errors":[{"name":"AppNotRegistered","description":"Caller DID is not registered as an ATM app."},{"name":"TicketsModuleDisabled","description":"This app has not enabled ATM Tickets."},{"name":"OrganizerNotRegistered","description":"Organizer has not signed in to ATM yet."},{"name":"PaymentSetupIncomplete","description":"Organizer has not finished ATM payment setup."},{"name":"InvalidItems","description":"At least one ticket tier is required."},{"name":"InvalidQuantity","description":"Ticket quantity must be at least 1."},{"name":"TicketTierNotFound","description":"One or more ticket tiers were not found."},{"name":"MixedEvents","description":"A ticket hold can only contain tiers from one event."},{"name":"MixedCurrency","description":"A ticket hold can only use one currency."},{"name":"TicketsUnavailable","description":"The tier is not currently on sale."},{"name":"FreeTicketRequiresClaim","description":"Free tiers must use tickets.atmosphere.claimFreeTicket."},{"name":"QuantityTooHigh","description":"Requested quantity exceeds the per-order maximum."},{"name":"InsufficientTicketCapacity","description":"Not enough capacity remains for the request."}]}}}