{"lexicon":1,"id":"money.atmosphere.event.receive","defs":{"eventType":{"type":"string","knownValues":["app.webhook.test","payment.completed","payment.failed","payment.refunded","payment.disputed","subscription.invoice_paid","subscription.updated","subscription.cancelled","payer.record.requested","creator.proof.requested","attestation.updated","product.updated","product.archived","product.deleted","ticket.hold.created","ticket.hold.expired","tickets.issued","ticket.voided","ticket.refunded","ticket.checked_in"],"description":"ATM app event type."},"payment":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"paymentType":{"type":"string"},"amount":{"type":"string"},"amountCents":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string"},"payerDid":{"type":"string","format":"did"},"recipientDid":{"type":"string","format":"did"},"metadata":{"type":"unknown"},"listing":{"type":"ref","ref":"com.atproto.repo.strongRef"},"entitlements":{"type":"array","items":{"type":"ref","ref":"com.atproto.repo.strongRef"}}}},"invoice":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"subscriptionId":{"type":"string"},"amount":{"type":"string"},"amountCents":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"firstInvoice":{"type":"boolean"}}},"subscription":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"metadata":{"type":"unknown"}}},"ticketHold":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"eventId":{"type":"string"},"paymentId":{"type":"string"},"status":{"type":"string"},"reason":{"type":"string"},"items":{"type":"array","items":{"type":"ref","ref":"#ticketHoldItem"}}}},"ticketHoldItem":{"type":"object","required":["tierId"],"properties":{"tierId":{"type":"string"},"title":{"type":"string"},"quantity":{"type":"integer"},"unitAmount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}}},"issuedTicket":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"eventId":{"type":"string"},"tierId":{"type":"string"},"paymentId":{"type":"string"},"claimId":{"type":"string"},"status":{"type":"string"}}},"product":{"type":"object","required":["uri"],"properties":{"uri":{"type":"string","format":"at-uri"},"cid":{"type":"string","format":"cid"}}},"attestation":{"type":"object","properties":{"cid":{"type":"string","format":"cid"},"mode":{"type":"string"}}},"distribution":{"type":"object","required":["planned"],"properties":{"planned":{"type":"integer","minimum":0}}},"appWebhookTest":{"type":"object","properties":{"message":{"type":"string"}}},"paymentCompleted":{"type":"object","required":["payment"],"properties":{"payment":{"type":"ref","ref":"#payment"},"distribution":{"type":"ref","ref":"#distribution"},"tickets":{"type":"unknown"},"attestation":{"type":"ref","ref":"#attestation"}}},"paymentFailed":{"type":"object","required":["payment"],"properties":{"payment":{"type":"ref","ref":"#payment"},"reason":{"type":"string"}}},"paymentRefunded":{"type":"object","required":["payment"],"properties":{"payment":{"type":"ref","ref":"#payment"},"amount":{"type":"integer","minimum":0},"reason":{"type":"string"},"distribution":{"type":"ref","ref":"#distribution"}}},"paymentDisputed":{"type":"object","required":["payment"],"properties":{"payment":{"type":"ref","ref":"#payment"},"reason":{"type":"string"},"disputeReason":{"type":"string"},"status":{"type":"string"}}},"subscriptionInvoicePaid":{"type":"object","required":["payment","invoice"],"properties":{"payment":{"type":"ref","ref":"#payment"},"invoice":{"type":"ref","ref":"#invoice"},"invoiceId":{"type":"string"},"distribution":{"type":"ref","ref":"#distribution"},"attestation":{"type":"ref","ref":"#attestation"}}},"subscriptionUpdated":{"type":"object","required":["subscription","payment","priorAmountCents","amountCents","currency","updatedAt"],"properties":{"subscription":{"type":"ref","ref":"#subscription"},"payment":{"type":"ref","ref":"#payment"},"previousPayment":{"type":"ref","ref":"#payment"},"priorAmountCents":{"type":"integer","minimum":0},"amountCents":{"type":"integer","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"updatedAt":{"type":"string","format":"datetime"},"currentPeriodEnd":{"type":"string","format":"datetime"},"updatedBy":{"type":"unknown"},"attestation":{"type":"ref","ref":"#attestation"}}},"subscriptionCancelled":{"type":"object","required":["subscription","payment","cancelledAt"],"properties":{"subscription":{"type":"ref","ref":"#subscription"},"payment":{"type":"ref","ref":"#payment"},"cancelledAt":{"type":"string","format":"datetime"},"cancelledBy":{"type":"unknown"},"reason":{"type":"string"}}},"payerRecordRequested":{"type":"object","required":["paymentId","payerDid","recipientDid","collection","canonicalRecord","expectedCid","expiresAt"],"properties":{"paymentId":{"type":"string"},"payerDid":{"type":"string","format":"did"},"recipientDid":{"type":"string","format":"did"},"collection":{"type":"string"},"canonicalRecord":{"type":"unknown"},"expectedCid":{"type":"string","format":"cid"},"expiresAt":{"type":"string","format":"datetime"}}},"creatorProofRequested":{"type":"object","required":["paymentId","creatorDid","attestationCid","proofRecord","expiresAt"],"properties":{"paymentId":{"type":"string"},"creatorDid":{"type":"string","format":"did"},"attestationCid":{"type":"string","format":"cid"},"payerProofRef":{"type":"ref","ref":"com.atproto.repo.strongRef"},"proofRecord":{"type":"unknown"},"expiresAt":{"type":"string","format":"datetime"}}},"attestationUpdated":{"type":"object","required":["paymentId"],"properties":{"paymentId":{"type":"string"}}},"productUpdated":{"type":"object","required":["product"],"properties":{"product":{"type":"ref","ref":"#product"},"creatorDid":{"type":"string","format":"did"},"appLink":{"type":"unknown"}}},"productArchived":{"type":"object","required":["product"],"properties":{"product":{"type":"ref","ref":"#product"},"creatorDid":{"type":"string","format":"did"},"appLink":{"type":"unknown"}}},"productDeleted":{"type":"object","required":["product"],"properties":{"product":{"type":"ref","ref":"#product"},"creatorDid":{"type":"string","format":"did"},"appLink":{"type":"unknown"}}},"ticketHoldCreated":{"type":"object","required":["hold"],"properties":{"hold":{"type":"ref","ref":"#ticketHold"}}},"ticketHoldExpired":{"type":"object","required":["hold"],"properties":{"hold":{"type":"ref","ref":"#ticketHold"}}},"ticketsIssued":{"type":"object","required":["hold","tickets"],"properties":{"paymentId":{"type":"string"},"claimId":{"type":"string"},"hold":{"type":"ref","ref":"#ticketHold"},"tickets":{"type":"array","items":{"type":"ref","ref":"#issuedTicket"}}}},"ticketVoided":{"type":"object","required":["paymentId","tickets"],"properties":{"paymentId":{"type":"string"},"reason":{"type":"string"},"tickets":{"type":"array","items":{"type":"ref","ref":"#issuedTicket"}}}},"ticketRefunded":{"type":"object","required":["paymentId","tickets"],"properties":{"paymentId":{"type":"string"},"reason":{"type":"string"},"tickets":{"type":"array","items":{"type":"ref","ref":"#issuedTicket"}}}},"ticketCheckedIn":{"type":"object","required":["ticket","checkIn"],"properties":{"ticket":{"type":"ref","ref":"#issuedTicket"},"checkIn":{"type":"unknown"}}},"main":{"type":"procedure","description":"Optional app-implemented XRPC receiver for ATM outbound events. ATM calls this with service-auth; signed HTTP webhooks remain the universal fallback.","input":{"encoding":"application/json","schema":{"type":"object","required":["id","type","created","apiVersion","data"],"properties":{"id":{"type":"string","description":"ATM delivery id. Receivers should use this for idempotency."},"type":{"type":"string","knownValues":["app.webhook.test","payment.completed","payment.failed","payment.refunded","payment.disputed","subscription.invoice_paid","subscription.updated","subscription.cancelled","payer.record.requested","creator.proof.requested","attestation.updated","product.updated","product.archived","product.deleted","ticket.hold.created","ticket.hold.expired","tickets.issued","ticket.voided","ticket.refunded","ticket.checked_in"],"description":"ATM event type, such as payment.completed or tickets.issued."},"created":{"type":"integer","description":"Unix timestamp, in seconds, when ATM built the event envelope."},"apiVersion":{"type":"string","description":"ATM outbound event envelope version."},"environment":{"type":"string","knownValues":["test","live"],"description":"ATM app environment for this delivery."},"data":{"type":"unknown","description":"Event-specific payload. See the named payload defs in this lexicon; ATM validates event payloads by type before delivery. Private operational fields stay off public PDS records."}}}},"output":{"encoding":"application/json","schema":{"type":"object","properties":{"accepted":{"type":"boolean","description":"Optional acknowledgement. Any 2xx response means the receiver accepted the event."}}}},"errors":[{"name":"Rejected","description":"The receiver rejected the event. ATM may retry non-2xx HTTP responses."}]}}}