Docs

Agent integration

A concise checklist for using coding agents to add native ATM test checkout, notifications and tests safely.

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.

What to give the agent

Coding agents work best with a narrow ATM contract, a starter file and a verification loop. Give the agent the package docs, your app's order model, your assigned test configuration (without secrets) and the exact backend route where checkout should start. The first admitted flow is a fixed-price digital purchase in test mode.

Discovery files

ATM exposes public agent discovery files at the root of atmosphere.money. Point coding agents at these before asking them to wire payments, so they choose native hosted checkout, the server SDK, canonical status and private-data boundaries from the start.

https://atmosphere.money/llms.txtShort index of the ATM docs, SDK packages, default recommendation, and do-not-cross boundaries.
https://atmosphere.money/llms-full.txtLonger agent context with architecture, checkout sequence, tickets sequence, auth model, and a copyable prompt.
https://atmosphere.money/sitemap.xmlSearch and crawler index for the docs entry points agents should find.

MCP wrapper

@atmosphere-money/mcp is the agent-friendly local wrapper for ATM developer actions. It is deliberately scoped to integration work: docs discovery, signed fixtures, app config inspection, test event delivery, delivery logs and test redrive. Its checkout tool uses the legacy initiate route, so do not use it to build or test a native checkout integration.

Safe implementation boundary

The agent should write server-side integration code. It must not put service-auth, attempt storage, status tokens, webhook secrets, payer assertions, ticket scan tokens or fulfilment into browser components.

Browser

  • Shows app UI
  • Calls your backend
  • Follows ATM checkout URL

App backend

  • Mints app service-auth
  • Captures attempts
  • Creates checkout
  • Reconciles status

ATM

  • Owns hosted checkout
  • Tracks payment state
  • Sends app events
  • Owns receipts and tickets

App database

  • Stores orders and attempts
  • Tracks fulfilment by effect key
  • Deduplicates delivery ids
  • Stores ATM payment ids

Environment variables

Keep environment names boring and explicit. Agents can wire local examples faster when the variable names match the docs.

ATM_APP_DIDYour app DID. Used as the app service-auth issuer.
ATM_BROKER_DIDThe test broker DID assigned to your app: brokerDid for checkout attempts and expectedIssuerDid for receiver verification. The service-auth audience is this DID plus #atmosphere_money_broker.
ATM_BROKER_URLThe HTTPS checkout origin assigned with that broker DID.
ATM_WEBHOOK_SECRETEnvironment-scoped signing secret from the ATM app dashboard.
ATM_WEBHOOK_PREVIOUS_SECRETOptional previous secret during rotation.

Prompt checklist

A good agent prompt should include the integration outcome and the test that proves it. This keeps the work scoped and reviewable.

text
Read https://atmosphere.money/llms.txt and https://atmosphere.money/docs/quickstart first.
Use the pinned native build of @atmosphere-money/app-node from the backend only.
Sell one fixed-price digital item in test mode, environment "test", for this order model: <describe order>.
Use createAtmCheckoutAttempts with a durable compare-and-swap store in our database.
Capture the exact createCheckout request before contacting ATM; retry only with recover and the same attempt ID.
Mint a new service-auth JWT per call: exact lxm, aud = <broker DID>#atmosphere_money_broker.
Return only the checkout URL to the browser. Keep the statusToken on the server.
Run a worker that calls attempts.reconcile and grants the purchase once, by effectKey, only on "fulfil".
Add an ATM webhook route with createNodeWebhookHandler that verifies, claims and only enqueues reconciliation.
Add tests with @atmosphere-money/testing fixtures for duplicates, redrive and a restart between capture and reply.
Never use initiatePayment, getPaymentStatus or a GET status request.

Webhook test loop

The fastest local loop is fixture first, dashboard event second, full sandbox checkout third.

  1. 01

    Fixture test

    Use @atmosphere-money/testing to create a signed payment.completed request.

  2. 02

    Route check

    Verify your handler rejects bad signatures and ignores duplicate delivery ids.

  3. 03

    Dashboard event

    Send a test event from the ATM app dashboard once your receiver URL exists.

  4. 04

    Sandbox checkout

    Run a test checkout and confirm the worker grants it once from canonical status.

Common mistakes

  • Calling the legacy initiatePayment or getPaymentStatus, or reading status with a GET request.
  • Generating a new idempotency key on retry instead of recovering the captured attempt.
  • Fulfilling from the checkout return page, or directly from a webhook body.
  • Returning the statusToken to the browser or logging it.
  • Parsing webhook JSON before preserving the exact raw request body.
  • Caching or reusing one service-auth JWT across calls.
  • Treating payerDidHint as payer authentication.