{"lexicon":1,"id":"money.atmosphere.payment.createCheckout","defs":{"main":{"type":"procedure","description":"Start an ATM-hosted checkout for one exact catalog purchase. Requires app inter-service auth: a service-auth JWT whose iss is the app, aud is the broker DID's #atmosphere_money_broker service and lxm is money.atmosphere.payment.createCheckout. The checkout is idempotent per authenticated app, resolved environment and idempotencyKey: an exact retry returns the original result even after the browser checkout expires, and a different request under the same key is IdempotencyConflict. Amounts come from the exact listing and Price records (and an authenticated private quote where one applies), never from an app-supplied total. The response keeps three identifiers apart: paymentId is the ledger identity, statusToken is the app's polling capability for money.atmosphere.payment.getCheckoutStatus, and url is the browser checkout, which carries its own bearer. A browser redirect is never payment truth; apps fulfil from getCheckoutStatus or the signed event. Responses are private and no-store. Served only where ATM's native checkout is enabled; elsewhere the method is not implemented.","input":{"encoding":"application/json","schema":{"type":"object","required":["items","idempotencyKey"],"properties":{"items":{"type":"array","minLength":1,"maxLength":100,"items":{"type":"ref","ref":"#item"},"description":"The purchase. Exactly one item is admitted today; the wider bound is wire capacity, not multi-item checkout."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code, matched case-insensitively against the Price's currency. Optional; the Price fixes the currency."},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"description":"Caller-chosen key: ASCII letters, digits and . _ : / -. Scoped to the authenticated app and resolved environment. Reuse it unchanged to recover a lost response; never reuse it for a different purchase."},"environment":{"type":"string","maxLength":8,"knownValues":["test","live"],"description":"ATM environment. Pinned for the operation: recovery never searches another environment to infer an omitted value."},"checkoutExpiresAt":{"type":"string","format":"datetime","description":"Reservation deadline for a shop or commission checkout. Rejected for other payment types."},"payerDidHint":{"type":"string","format":"did","description":"Unverified account hint for prefill only. It never becomes payer, saved-card, membership or publication authority, and never appears in the app-visible payer snapshot."},"payerAuth":{"type":"string","maxLength":16,"knownValues":["none","optional","required"],"description":"Whether the buyer may, or must, sign in with an Atmosphere account at checkout."},"payerDid":{"type":"string","format":"did","description":"Asserted payer. Required together with payerAssertionJwt, and only with it."},"payerAssertionJwt":{"type":"string","minLength":1,"maxLength":8192,"description":"A single-use payer service-auth JWT (lxm money.atmosphere.payment.assertPayer) whose iss is payerDid, minted from the payer's live session with the app. Verified once and discarded; it proves identity only, never publication consent or spending authority."},"payerBinding":{"type":"string","maxLength":16,"knownValues":["fixed","switchable"],"description":"fixed keeps the asserted payer for the whole checkout and requires payerDid. switchable lets the buyer change account before a payment instrument exists; each change rotates the browser bearer while the statusToken stays valid."},"rsvp":{"type":"string","maxLength":8,"knownValues":["atm","app","none"],"description":"Who writes an event RSVP for a ticket purchase, when the buyer chooses one: ATM, the app, or nobody. This routes responsibility; it is not the buyer's consent."},"returnUrl":{"type":"string","format":"uri","description":"HTTPS URL on the app's registered origin to return the buyer to. A return is navigation, not payment truth."},"cancelUrl":{"type":"string","format":"uri","description":"HTTPS URL on the app's registered origin for a buyer who leaves checkout."},"shipping":{"type":"ref","ref":"#shipping"},"publicRecords":{"type":"ref","ref":"#publicRecords"},"customerEmail":{"type":"string","maxLength":320,"description":"Editable email prefill for the payment form. Private: never published or treated as a verified address."},"metadata":{"type":"unknown","description":"Private app metadata: a JSON object of at most 64 keys, depth 6 and 8 KiB serialized. Keys beginning atm_ and reserved cadence keys are refused. Returned only to the originating app; never published."}}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["statusToken","paymentId","url","expiresAt"],"properties":{"statusToken":{"type":"string","minLength":1,"maxLength":256,"description":"The app's capability for money.atmosphere.payment.getCheckoutStatus. Keep it server-side; it never appears in the checkout URL and does not expire with the browser checkout."},"paymentId":{"type":"string","minLength":1,"maxLength":256,"description":"ATM's ledger identity for this checkout. Not a bearer."},"url":{"type":"string","format":"uri","description":"The ATM-hosted browser checkout. It carries the browser bearer; send the buyer here and do not log it."},"expiresAt":{"type":"string","format":"datetime","description":"When the browser checkout stops accepting a new payment. Not proof of nonsettlement: poll status until a terminal value."},"reservationExpiresAt":{"type":"string","format":"datetime","description":"Reservation deadline for a shop or commission checkout, never earlier than expiresAt."}}}},"errors":[{"name":"InvalidCheckout","description":"The request is malformed, or its listing, Price, quote or URLs are not acceptable."},{"name":"CurrencyUnsupported","description":"The currency is not enabled for this recipient or environment."},{"name":"RecipientNotPayable","description":"The recipient cannot currently accept this payment."},{"name":"TestEnvironmentUnavailable","description":"Test-environment checkout is not available on this deployment."},{"name":"PayerAssertionInvalid","description":"payerAssertionJwt failed verification or does not match payerDid."},{"name":"PayerBindingUnsupported","description":"The requested payer binding is not available for this checkout."},{"name":"CheckoutPayerChanged","description":"An exact retry found that the buyer has since switched account. The original checkout may still settle; poll its statusToken and do not create a replacement automatically."},{"name":"DuplicateSubscription","description":"The payer already holds an active subscription that this offering limits to one."},{"name":"InvalidDiscountCode","description":"discountCodeText does not give a discount on this item now (unknown, disabled, not yet valid, expired, used up, or not for this item). One name for every reason. Retry without the code, or with another code."},{"name":"IdempotencyConflict","description":"idempotencyKey was already used for a different request."},{"name":"AuthenticationRequired","description":"The service-auth JWT is missing or does not name this method and broker."},{"name":"RateLimitExceeded","description":"Too many requests from this network or app. Retry later with the same idempotencyKey."},{"name":"CheckoutUnavailable","description":"Checkout is temporarily unavailable, including while ATM has paused native checkout. Retry with the same idempotencyKey."}]},"item":{"type":"object","description":"One exact catalog purchase.","required":["recipient","listing","price","quantity"],"properties":{"recipient":{"type":"string","format":"did","description":"The seller being paid."},"amount":{"type":"integer","minimum":0,"maximum":99999999,"description":"Per-unit amount in the currency's minor unit. For a pay-what-you-want Price, the buyer's choice within its published bounds (default: the Price's unitAmount). For a private quote, optional and equal to the quoted amount. A fixed Price refuses it. ATM accepts tips up to 99,999,999 minor units and caps other payment types at 2,000,000; tips require an explicit choice."},"paymentType":{"type":"string","maxLength":16,"knownValues":["tip","shop","commission","subscribe","ticket"],"description":"Kind of purchase. Subscription fields require subscribe."},"orderRouting":{"type":"ref","ref":"money.atmosphere.order.defs#routing","description":"Routed commerce order snapshot; its kind must equal paymentType."},"interval":{"type":"string","maxLength":8,"knownValues":["day","week","month","year"],"description":"Subscription cadence unit. Enabled cadences: month x1, month x3 and year x1. Usually omitted: the exact Price controls cadence."},"intervalCount":{"type":"integer","minimum":1,"maximum":366,"description":"Subscription cadence count."},"subscriptionGroupKey":{"type":"string","minLength":1,"maxLength":256,"description":"Subscription offering group, ASCII letters, digits and . _ : / -. A membership groups by its Program (membership:<Program AT-URI>)."},"subscriptionPolicy":{"type":"ref","ref":"#subscriptionPolicy"},"listing":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Exact record being sold (URI and CID)."},"price":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Exact money.atmosphere.price record (URI and CID) whose terms apply."},"quantity":{"type":"integer","minimum":1,"maximum":9007199254740991},"quoteId":{"type":"string","minLength":1,"maxLength":256,"description":"Authenticated private quote (ASCII letters, digits, _ and -). Not an app-invented amount."},"entitlements":{"type":"array","maxLength":25,"items":{"type":"ref","ref":"com.atproto.repo.strongRef"},"description":"Exact records the purchase unlocks, as public context. Not a grant or bearer credential."},"discount":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Public money.atmosphere.discount terms. Exclusive with discountCodeText."},"discountCode":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Legacy public discount code record. Exclusive with discountCodeText."},"discountCodeText":{"type":"string","minLength":1,"maxLength":192,"description":"A private code the buyer entered, resolved privately by recipient. At most 64 characters; never published."},"requiredFeeTier":{"type":"string","minLength":1,"maxLength":1024,"description":"App fee tier this purchase requires (ASCII letters, digits, _ and -)."},"creatorHandle":{"type":"string","maxLength":600,"description":"Display hint for the seller's handle; at most 200 characters."},"creatorDisplayName":{"type":"string","maxLength":600,"description":"Display hint for the seller's name; at most 200 characters."}}},"subscriptionPolicy":{"type":"object","description":"How many active subscriptions a payer may hold for this offering.","properties":{"activeLimit":{"type":"string","maxLength":32,"knownValues":["multiple","one_per_payer_recipient"],"description":"Must match the app's configured policy when supplied."}}},"shipping":{"type":"object","description":"A private, authenticated shipping quote. Never an app-invented amount or buyer contact data.","required":["quoteId"],"properties":{"quoteId":{"type":"string","minLength":1,"maxLength":256,"description":"ASCII letters, digits, _ and -."}}},"publicRecords":{"type":"object","description":"Per-checkout caps on public records. An app may cap visibility at private; it cannot grant publication, which remains the payer's choice at checkout.","properties":{"appRecord":{"type":"string","maxLength":16,"knownValues":["public","private"]},"attestation":{"type":"string","maxLength":16,"knownValues":["public","private"]},"payerRecord":{"type":"string","maxLength":16,"knownValues":["public","private"]}}}}}