id, a type, and a data object whose shape depends on the type. See Webhooks for how to register a URL and verify the signature before trusting any of this.
Every
amount field below is a string (e.g. "49.99"), not a number. This differs from amount on SDK create calls (checkouts, payment links), which is a plain number in currency units. Parse it before doing arithmetic.The field names below are the literal snake_case keys AgentaOS
POSTs to your webhookUrl, what you parse in any language. As returned by the SDK webhooks.verify() (Node.js) the same fields come back camelCased and typed: link_id becomes linkId, session_id becomes sessionId, tx_hash becomes txHash, payer_type becomes payerType, chain_id becomes chainId, transaction_id becomes transactionId, and so on. This page mirrors the raw body documented in Webhooks.string
Unique event ID, e.g.
evt_550e8400-e29b-41d4-a716-446655440000. Always present. For checkout.session.completed it is independent of data.session_id. For send.completed and send.failed it is derived as evt_${data.transaction_id}, so a redelivered send always carries the same event id. Either way, use id to deduplicate the delivery, and the data-level ID (session_id or transaction_id) to deduplicate the underlying payment or send.string
One of
checkout.session.completed, send.completed, send.failed, or a subscription.* event. Switch on this to decide how to parse data.object
Event-specific payload. See each event below.
checkout.session.completed
Fired when a checkout is paid, by card, wallet, or stablecoin. This is the event to listen for to fulfill an order.
tx_hash, payer, and network describe on-chain settlement. For checkouts paid by card, these fields are empty, use vendor_reference for the off-chain reference and don’t assume the on-chain fields are always populated. Key fulfillment off session_id and amount/currency, which are present for every payment method.Example
send.completed
Fired when an outbound stablecoin send you initiated confirms on-chain.
Example
send.failed
Fired when an outbound send fails to broadcast, network error, insufficient balance, or the transaction reverted.
Example
Subscription events
Subscription lifecycle events, delivered to your organization webhook endpoint. All five share the samedata shape.
subscription.createdfirst payment succeeded; now active (or trialing).subscription.reneweda cycle was paid and renewed for another period.subscription.payment_faileda renewal payment failed; now past due.subscription.updatedthe subscription changed: a cancel scheduled or resumed (cancel_at_period_end), a downgrade scheduled (pending_planset), a scheduled downgrade reverted (pending_plannull again), an upgrade applied (newplan_name/link_id/amount_minor), or the scheduled plan taking over at the period end.subscription.canceledterminal; no further charges.
Example
Next steps
Verify signatures
How to register a URL and verify the HMAC-SHA256 signature, in TypeScript, Python, Go, and PHP.
Payment SDK: Webhooks
The
webhooks resource in @agentaos/pay.