{"lexicon":1,"id":"tickets.atmosphere.updateTicketType","defs":{"main":{"type":"procedure","description":"Update organizer-owned ATM ticket type metadata. The resulting paid type must retain or receive an exact active organizer-owned kind=ticket Product whose one-time default Price matches amount and currency; Product may be attached or repointed but not cleared, and callers using product must omit legacy defaultPrice because ATM derives it. Requires app service-auth plus current primary-organizer or accepted co-organizer authority; price, currency, capacity, raw metadata (which carries PWYW), and archival remain primary-organizer-only, and creation provenance alone is insufficient. quantityTotal sets the per-type cap; unlimited:true clears it (provide at most one of the two).","input":{"encoding":"application/json","schema":{"type":"object","required":["ticketTypeId"],"nullable":["description","saleStartsAt","saleEndsAt","ticketTypeRef","defaultPrice"],"properties":{"environment":{"type":"string","knownValues":["test","live"],"maxLength":16},"ticketTypeId":{"type":"string","minLength":1,"maxLength":300},"organizerDid":{"type":"string","format":"did","description":"The primary organizer or accepted co-organizer authorizing this mutation. Omit only when the calling app is itself the event's primary organizer."},"organizerAssertionJwt":{"type":"string","description":"Optional only for an app updating its own event. Otherwise, a short-lived user service-auth JWT from organizerDid to ATM scoped to tickets.atmosphere.updateTicketType.","maxLength":8192},"title":{"type":"string","minLength":1,"maxGraphemes":100,"maxLength":1000},"description":{"type":"string","maxGraphemes":1000,"maxLength":10000},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"Lowercase ISO 4217 alphabetic code matching money.atmosphere.price. Chargeability is enforced separately by the configured processor allowlist. Asset-denominated value uses the money.atmosphere.payment.defs value union, never this field."},"unitAmount":{"type":"integer","minimum":0,"maximum":2000000,"description":"Amount in the smallest unit of currency. 0 creates a free ticket type (claimed via tickets.atmosphere.claimFreeTicket). A resulting paid ticket type must have an exact organizer-owned kind=ticket Product; paid amounts must also meet the processor minimum charge."},"maxPerOrder":{"type":"integer","minimum":1,"maximum":50},"saleStartsAt":{"type":"string","format":"datetime"},"saleEndsAt":{"type":"string","format":"datetime"},"ticketTypeRef":{"type":"ref","ref":"com.atproto.repo.strongRef"},"product":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Exact current organizer-owned money.atmosphere.product with kind=ticket. createTicketType requires it whenever unitAmount is greater than 0; a free type may omit it. updateTicketType requires the resulting paid type to retain or receive one, may attach or repoint it, and cannot clear it. The Product must be active and its exact default Price must be one-time, per-unit, and match the ticket amount and currency."},"defaultPrice":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Legacy direct-Price compatibility only. New callers using product MUST omit defaultPrice; ATM derives and verifies Product.defaultPrice and rejects both fields together. Readers still accept this field on Product-less historical ticket types."},"metadata":{"type":"unknown"},"visibility":{"type":"string","knownValues":["public","hidden"],"maxLength":16,"description":"Private buyer-facing visibility (default public). Hidden types are excluded from availability and buyer surfaces until unlocked by a ticket access code; organizer surfaces always see them."},"quantityTotal":{"type":"integer","minimum":1,"maximum":250000,"description":"Set the per-type cap."},"unlimited":{"type":"boolean","description":"true clears the per-type cap (unlimited)."},"status":{"type":"string","knownValues":["active","paused","archived"],"maxLength":32}}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["ticketType"],"properties":{"ticketType":{"type":"ref","ref":"tickets.atmosphere.defs#ticketTypeSummary"}}}},"errors":[{"name":"AppNotRegistered","description":"Caller DID is not registered as an ATM app."},{"name":"TicketsModuleDisabled","description":"This app has not enabled ATM Tickets."},{"name":"RecipientNotPayable","description":"The organizer has not completed payment setup for this environment."},{"name":"RecipientCurrencyUnavailable","description":"ATM could not verify the organizer's primary settlement currency."},{"name":"RecipientCurrencyUnsupported","description":"The organizer's primary settlement currency is not supported by ATM's current payment processor."},{"name":"RecipientCurrencyNotEnabled","description":"The organizer's primary settlement currency is not enabled in this ATM environment."},{"name":"RecipientCurrencyMismatch","description":"The paid ticket currency does not match the organizer's primary settlement currency."},{"name":"UnsupportedHistoricalCurrency","description":"Stored ticket data uses a historical currency that the current ISO 4217 wire contract cannot represent."},{"name":"TicketTypeNotFound","description":"Ticket type not found."},{"name":"EventControlRequired","description":"A verified primary-organizer or accepted co-organizer authorization is required for this event."},{"name":"PrimaryOrganizerRequired","description":"Only the current primary organizer can change ticket pricing, capacity, or raw metadata, or archive the ticket type."},{"name":"UserDidMismatch","description":"organizerAssertionJwt issuer does not match organizerDid."},{"name":"InvalidAmount","description":"Ticket price is invalid: negative, above the maximum, or a paid amount below the processor minimum charge (use 0 for free ticket types)."},{"name":"TicketCurrencyUnsupportedForFee","description":"This paid ticket currency is incompatible with the app's fixed ticket-fee denomination."},{"name":"InvalidCapacity","description":"Capacity is invalid, or lower than tickets already sold or held for this type."},{"name":"InvalidCapacityConfig","description":"Provide at most one of quantityTotal or unlimited:true."}]}}}