Docs

Payment lifecycle

How a native checkout moves from creation to a terminal status, and what your app does at each step.

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.

Lifecycle overview

Treat ATM checkout as a state machine that your backend follows. The browser redirect keeps the buyer oriented; your purchase effect comes from canonical status after the payment settles.

  1. Capture

    App

    Save the exact createCheckout request and idempotency key for an authorized Buy.

  2. Create

    App -> ATM

    POST createCheckout. ATM returns paymentId, statusToken, the checkout URL and expiresAt.

  3. Pay

    Buyer

    Complete hosted checkout with ATM Wallet, a new card, Apple Pay, Google Pay or another eligible method.

  4. Settle

    ATM

    Record the payment in ATM’s ledger only after the processor confirms it.

  5. Notify

    ATM -> App

    Send a verified wake-up through your receiver or signed webhook.

  6. Reconcile

    App -> ATM

    POST getCheckoutStatus with the saved token and apply the result once.

Browser return versus fulfilment

Browser returnShows confirmation or processing UI. It can arrive before settlement, or never.
Status pollingThe canonical path. A backend worker POSTs getCheckoutStatus until the status is terminal.
Verified notificationCarries the same settled fact and wakes the same worker early, so each effect still happens once.
Delivery logRepair receiver failures with redrive. The buyer never pays again.

Statuses

pendingWaiting for settlement. fulfillment is not_applicable. An optional finalizesAt is an advisory target, not a deadline.
completedSettled, with completedAt. fulfillment is fulfil for a direct digital purchase, or order_pending or order_conflict when an order owner must confirm first.
failedThe payment did not succeed. The checkout closed unpaid.
canceledThe checkout was canceled before payment.
expiredThe checkout ended unpaid.

Stop polling only at a terminal status. Refunds and disputes never move a completed status backwards; they arrive as separate events and need their own handling. The payer and payer revision freeze at the first terminal status.

App events

ATM sends app events after state changes. AT Protocol apps receive them through the canonical XRPC receiver; conventional web apps can select signed HTTP instead. Verify each event, then let your reconciler read canonical state before acting.

payment.completedWake reconciliation for the matching attempt; grant on completed plus fulfil.
payment.refundedReverse or flag the purchase according to your app’s policy.
payment.disputedPause or review the purchase while the dispute is open.
product.archivedStop offering the item. Historical purchases stay valid.

Payloads for every event type are on Webhook events.

Receipts and public records

ATM owns the payment receipt; buyers open it from the authenticated receipt view on the dashboard origin. The test flow writes no public payment records. When a completed status includes receipt or proof refs, they are independently verifiable evidence, never the fulfilment trigger.

Retries and reconciliation

  • Capture each attempt before contacting ATM, and send its original request and key on every retry.
  • Store the ATM paymentId and your effect key beside your order.
  • Deduplicate notifications on stable delivery identity before queuing work.
  • If a buyer sees a charge but your order is unpaid, keep reconciling the original attempt. Never ask them to pay again.
  • If your receiver fails, fix it and redrive the stored delivery from the dashboard.