Docs

Webhooks and XRPC

Receive ATM wake-ups through the default AT-native XRPC receiver or signed HTTP webhook compatibility.

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.

Delivery choices

New AT Protocol-native registrations default to the canonical#AtmEventReceiver service andmoney.atmosphere.event.receiveEvent method. Conventional web apps can explicitly select signed HTTP webhooks by supplying a URL. ATM stores and redrives either wake-up transport; always reconcile canonical status/query state before fulfillment.

Explicit transport: "none"disables app-facing push. Its retainedlistEvents projection returns only successfully delivered test receiver history for diagnostics. It is not a complete log, fulfillment source, recovery feed, or current state, and it can never pass live readiness.

Live XRPC receiver and webhook deliveries are notifications only. Query canonical ATM status/current state before irreversible fulfillment.

Delivery is at-least-once but not indefinite: a failing delivery is retried up to 14 attempts with exponential backoff (capped at 24 hours between attempts), keeping it retryable for roughly three days — mirroring Stripe's webhook retry window. After the final attempt the delivery is marked failed and automatic retries stop; fix your receiver, then redrive it from the dashboard delivery log (the redrive keeps the original Atm-Delivery-Id, so idempotent receivers treat it as the same event). If an outage outlasts the window, reconcile from the query endpoints instead of waiting for a webhook that will no longer come.

Default XRPC receiver

AT Protocol-native apps receive events through money.atmosphere.event.receiveEvent. This keeps ATM integration on the same DID-discoverable service-auth surface as the rest of the app's XRPC contract.

Your assigned broker signs each call. Verify iss = the test broker DID from your test configuration, aud = <your app DID>#AtmEventReceiver and lxm = money.atmosphere.event.receiveEvent, then replay-protect the token's jti. With the SDK, pass that broker DID to constructAtmXrpcReceiverEvent as expectedIssuerDid; without it, the helper expects ATM's production broker.

Signed HTTP verification

Each webhook carries Atm-Signature: t=<timestamp>,v1=<hex>: an HMAC-SHA256 over <timestamp>.<deliveryId>.<rawBody> with this app and environment's signing secret. The SDK route helpers read the raw bytes, compare in constant time, allow five minutes of clock skew, and check the delivery ID, event, API version and environment headers against the body.

  • Read the original bytes before any JSON middleware; re-serialized JSON fails the signature.
  • Keep the current and previous secrets during rotation. A signature from a retired secret stops verifying.
  • Enforce your expected environment and API version even when a header is absent.
  • Claim each delivery with an expiring lease and a random claim ID; complete or release only with that ID.
  • Queue reconciliation durably before acknowledging; return 503 for a busy claim so ATM retries.

Event envelope

Event payloads include delivery, environment, wire-format version, and event type metadata. The envelope id IS the delivery id — it matches the Atm-Delivery-Idheader — so use it for idempotency. Apps should verify the signature or service-auth envelope before processing the event.

json
{
  "id": "whd_...",
  "type": "payment.completed",
  "createdAt": "2026-06-05T00:00:00.000Z",
  "apiVersion": "2026-07",
  "environment": "test",
  "data": {
    "$type": "money.atmosphere.event.defs#paymentCompleted",
    "paymentId": "pay_...",
    "amount": 500,
    "currency": "usd",
    "recipientDid": "did:plc:creator"
  }
}

Idempotency

Delivery is at-least-once. Retries and redrives keep the delivery ID, type, environment, API version and data, but carry a fresh createdAt. Deduplicate on that stable identity, never the whole body; keep the first body as evidence, acknowledge a completed duplicate, and let a released claim process again. Your purchase effect stays single because the reconciler grants it under a unique effect key.