Docs

Checkout

How apps start native ATM-hosted checkout, retry it safely, and read canonical status.

Closed beta@atmosphere-money/app-nodeSDK beta: 0.0.0-beta.3ATM API beta: 2026-0671 published lexicons

Compatible with the closed-beta ATM app APIs and versioned ATM event headers. Check atm-api-version on every webhook or XRPC receiver event.

Hosted checkout

ATM-hosted checkout is the checkout surface for every human payment. ATM owns the payment form, ATM Wallet authorization, explicit card-saving consent, same-tab sign-in, receipts and payment state. Stripe Link is disabled. Your app owns the product page, the Buy button and fulfilment.

Invited apps start with one fixed-price digital purchase in test mode; other product types arrive as ATM admits them. Embedded checkout is on the roadmap, with hosted checkout as the fallback.

Seller permission

The seller grants your app payment permission and accepts the exact seller terms in their ATM dashboard. ATM checks that permission, the accepted terms and the seller's payment setup on every checkout. Seller permission never stands in for buyer consent. Creator-setup reads such as getRecipientApproval and getPayoutStatus describe setup progress for your settings screens; they are not checkout authority.

Create a checkout

money.atmosphere.payment.createCheckout is a JSON POST procedure. Authenticate it with a fresh app service-auth JWT whose lxm is this method and whose aud is <brokerDid>#atmosphere_money_broker for your assigned test broker.

http
POST /xrpc/money.atmosphere.payment.createCheckout
Authorization: Bearer <fresh app service-auth JWT>
Content-Type: application/json

{
  "environment": "test",
  "idempotencyKey": "order_123_attempt_1",
  "items": [{
    "recipient": "did:plc:seller",
    "listing": { "uri": "at://did:plc:seller/money.atmosphere.product/digital", "cid": "bafy..." },
    "price": { "uri": "at://did:plc:seller/money.atmosphere.price/fixed", "cid": "bafy..." },
    "quantity": 1,
    "paymentType": "shop"
  }],
  "returnUrl": "https://app.example/orders/123/return",
  "cancelUrl": "https://app.example/orders/123/return",
  "metadata": { "appOrderId": "order_123" }
}

With the SDK, capture the request with attempts.capture and send it with attempts.recover, as in the Quickstart. If your app already stores equivalent attempts, atm.createCheckout(input) is the low-level call; persist the exact request before calling it.

ts
import { createAtmAppClient } from "@atmosphere-money/app-node";

const atm = createAtmAppClient({
  brokerUrl: "https://your-assigned-test-checkout.example",
  serviceAudience: "did:plc:bbbbbbbbbbbbbbbbbbbbbbbb#atmosphere_money_broker",
  getServiceAuthToken: ({ lxm, aud }) => mintMyAppServiceAuthJwt({ lxm, aud }),
});

// The input you persisted before this call, sent unchanged on every retry.
const created = await atm.createCheckout(input);

Request fields

Required marks what this test integration must send. Other fields in the SDK types, such as shipping, quotes, discounts, order routing and recurring cadence, belong to capabilities ATM admits separately; leave them out of fixed digital checkout.

FieldTypeRequiredDescription
itemsarrayyesExactly one item.
items[].recipientdidyesThe seller DID.
items[].listingstrongRefyesThe exact Product record: AT-URI plus CID.
items[].pricestrongRefyesThe exact money.atmosphere.price record for that Product.
items[].quantityintegeryes1 for fixed digital checkout.
items[].paymentTypestringnoshop for a digital purchase.
items[].amountintegernoOmit for fixed prices. ATM derives the amount from the Price; only an admitted chosen-amount flow sends one.
idempotencyKeystringyes1 to 200 characters from A–Z, a–z, 0–9 and . _ : / -. Assigned once per attempt.
environmentstringyesAlways test for this integration. The SDK attempt helper refuses anything else.
returnUrl, cancelUrlhttps URLnoOn your registered app origin. Navigation only, never payment proof.
checkoutExpiresAtdatetimenoAn earlier end for the browser checkout. Checkouts last 45 minutes at most.
metadataobjectnoPrivate correlation such as your order ID. Never buyer personal data or secrets.
payerDid, payerAssertionJwtdid, JWTnoAn authoritative pair: supply both or neither. See Payer identity.
payerDidHintdidnoA display-only account suggestion. It never authenticates the payer.
customerEmailstringnoUnverified, editable prefill. Never identity or receipt authority.

Response

FieldTypeRequiredDescription
paymentIdstringyesATM’s ledger identity for this payment.
statusTokenstringyesYour app’s private polling capability for getCheckoutStatus. It never expires by time. Keep it on your server.
urlhttps URLyesThe hosted checkout for the buyer. It carries its own browser bearer.
expiresAtdatetimeyesWhen the browser checkout ends. The payment can still settle afterwards.
reservationExpiresAtdatetimenoA separate reservation deadline, when one applies.

Save the whole response on the original attempt before redirecting. Only url goes to the browser.

Retries and errors

createCheckout is idempotent per authenticated app, environment and idempotencyKey. An exact retry returns the original result, even after the browser checkout expires. Retry with the same request and key, and a fresh service-auth JWT. No error, missing reply or elapsed deadline proves that a payment did not happen.

CodeHTTPRetryCauseDeveloper action
AuthenticationRequired401yesThe JWT is missing, expired, already used, or names the wrong method or audience.Mint a fresh token for the exact method and audience, then retry the same request.
RateLimitExceeded429yesToo many requests from this network or app.Back off, then retry the same request and key.
CheckoutUnavailable503yesTemporarily unavailable, including while ATM pauses native checkout.Retry later with the same request and key.
IdempotencyConflict400noThe key was already used for a different request.Your stored request changed. Fix that; never mint a new key to get unstuck.
InvalidCheckout400noThe request, its listing or Price, or its URLs are not acceptable.Keep the attempt for support. Do not replace it automatically.
RecipientNotPayable400noThe seller cannot accept this payment right now.Show an unavailable state until the seller finishes setup.
CurrencyUnsupported400noThe currency is not enabled for this seller or environment.Keep the purchase action unavailable.
TestEnvironmentUnavailable400noTest checkout is not available on this deployment.Check that you used the assigned test checkout origin.
PayerAssertionInvalid400nopayerAssertionJwt failed verification or does not match payerDid.Ask the signed-in buyer to try again, as a new attempt with a new assertion.
PayerBindingUnsupported400noThe requested payer binding is not available for this checkout.Omit payerBinding, or use the binding your flow supports.
CheckoutPayerChanged400noAn exact retry found that the buyer switched accounts.The original checkout may still settle. Keep polling its status token; never create a replacement.

Read status

money.atmosphere.payment.getCheckoutStatus is also a JSON POST procedure. Send the saved token in the body with a fresh JWT for this method; never in a URL, a GET request or a log line. Poll from a backend worker with bounded backoff, even if the buyer never returns, and stop only at a terminal status.

http
POST /xrpc/money.atmosphere.payment.getCheckoutStatus
Authorization: Bearer <fresh app service-auth JWT>
Content-Type: application/json

{ "statusToken": "<saved status token>" }
pendingKeep polling. It can outlive expiresAt and the advisory finalizesAt.
completedSettled. fulfillment: “fulfil” authorizes a direct digital grant; order_pending and order_conflict need the order owner first.
failed, canceled, expiredUnpaid terminal outcomes.
CheckoutNotFoundMalformed, unknown or not your token. Not an outcome: check your app, broker and environment binding and keep the attempt.
CheckoutUnavailableTemporarily unavailable. Retry later; this is not pending or terminal.

An authenticated completed status is the same settled fact that a signed notification carries. Route both through one reconciler, so each purchase effect happens once and stays bound to the attempt you saved.

Payer identity

payerDid and payerAssertionJwt are an authoritative pair: supply both or neither. The assertion is a service-auth JWT from the signed-in buyer, with the buyer's DID as issuer, your broker's #atmosphere_money_broker audience, and money.atmosphere.payment.assertPayer as its method. It is frozen with the original request, so never refresh it inside a retry, and never substitute a raw OAuth access token.

An asserted payer is fixed by default. Opt into payerBinding: "switchable" only when your app reconciles the final payer from status. Without an assertion, payerDidHint is display only. Every status reports the payer and a payer revision that freezes at the first terminal status; reconcile against that, not your initial hint. ATM owns disclosure, receipt consent, Wallet access and card saving.

Receipts and public records

ATM owns the payment receipt. Buyers open it from ATM's authenticated receipt view on the dashboard origin; your confirmation page is not a receipt. The test flow writes no public payment records. When a completed status carries receipt or proof refs, they are independently verifiable evidence, never the fulfilment trigger. The SDK attempt helper keeps the first terminal snapshot it sees. A publicRecords value on the request is an app-side cap only; it never grants the buyer's publication consent.