Agentcard webhooks
Agentcard webhooks are HTTP POST requests that Agentcard sends to your endpoint when something happens to your connected users, such as a card stored in their vault, a checkout approved or an order placed.
How Agentcard webhooks work
Webhooks push events to your server as they happen, so you don't have to poll Agentcard's API. Agentcard treats SDK callbacks as signals for your UI and webhooks as the record. You register an endpoint for one mode with a list of events, and it receives only what it lists.
Every event has the same JSON envelope: id, type, created in Unix seconds, livemode and data, which varies by type. Branch on type, which Agentcard says is part of its API contract. livemode is false in sandbox. Deliveries carry no API version.
Key facts
{t}.{raw body} t from the AgentCard-Signature header, a literal dot, then the raw body bytes.
X-AgentCard-Signature sha256=<...> over the body alone; encoding not stated
Setting up Agentcard webhooks
- Create an endpoint with
POST https://api.agentcard.sh/api/v2/webhook_endpoints, or in the dashboard under Developers > Webhooks, giving aurlandenabled_events. Do it once per mode, because your token decides whether it's a sandbox or production endpoint. - To test locally, run the Hookdeck CLI:
hookdeck listen 3000 agentcard --path /webhooks/agentcard, then create a sandbox endpoint for its URL.POST /api/v2/cards/{card_id}/test_chargesimulates a charge on a sandbox card and sends the same events a real one does. - On a server that keeps running, the Commerce SDK's
agentcard.listenreceives the same events over one outbound connection, with no endpoint or signature to manage. - Agentcard documents no resend call.
GET /api/v2/webhook_endpoints/{id}/deliveriesand the dashboard list recent delivery attempts.
Delivery behaviour
10 seconds any answer other than a 2xx counts as a failure Retries up to 5 immediately, then after 1 minute, 5 minutes, 30 minutes and 1 hour After the last retry not documented there's no documented resend call, so reconcile from the API Duplicates at least once id stays the same on every redelivery Known failure modes
From Hookdeck's Agentcard guide →-
Duplicate deliveries
Agentcard delivers each event at least once, and
Handle duplicates →idstays the same on every redelivery. Record eachidand skip any you've already processed. -
Out-of-order delivery
A retried Agentcard delivery can arrive after a newer one. On trip plans, keep the highest
Handle ordering →versionfor each booking, and elsewhere don't assume events arrive in the order they happened. -
Events lost in a long outage
Agentcard retries a failed delivery five times over less than two hours and documents nothing after that. After a longer outage, check the deliveries log and read the current state of the objects involved.
Retries and outages → -
Purchase messages never arrive
A catch-all
Choosing events →*doesn't turn onpurchase.message, so a shopper never hears about a step even though the endpoint looks healthy. Subscribe to it by name or withpurchase.*.
Agentcard webhook best practices
- Verify every signature.
Check
AgentCard-Signatureagainst the raw body, using the wholewhsec_secret as the key. A Standard Webhooks library won't match. - Return a 2xx within 10 seconds. Store the event and respond before you do any slow work, so a slow handler doesn't count as a failed delivery.
- Deduplicate on the event id.
Delivery is at least once, and
idstays the same on every redelivery. Record each one and skip repeats. - Keep the highest version on trip plans.
A retried
plan.updatedorplan.item.updatedcan arrive after a newer one, so ignore a lowerversion. - Subscribe to purchase.message by name.
A catch-all
*doesn't turn it on. List it by name, or withpurchase.*, alongside the other events you handle. - Keep sandbox and production apart.
Use separate endpoints, secrets and environment variables, and check
livemodebefore acting on an event that moves money.
Common Agentcard webhook events
Cards and transactions
card.created | One-time virtual card is issued |
card.closed | Virtual card is closed |
transaction.authorized | Merchant authorizes a charge on a card |
transaction.cleared | Authorized charge settles |
balance.low | Card balance falls below its threshold |
Checkouts and orders
checkout_authorization.approved | User approves a checkout and the processor responds |
checkout_authorization.settled | Processor read-back shows the charge succeeded |
order.placed | Order goes through at the merchant |
order.failed | Approved confirm ends without an order |
Connected users
connection.created | User finishes connecting to your platform |
vault.card_stored | User saves a card to their vault |
purchase.message | Purchase step a shopper should hear about, with text to send them |
Events by resource
| Resource | Events | Payloads |
|---|---|---|
checkout_authorization | 12 | 9 |
transfer | 5 | 1 |
order | 4 | 3 |
transaction | 4 | 4 |
vault | 4 | 3 |
card | 3 | 3 |
recovery | 3 | 1 |
1 more resource, including Other Agentcard events. All 58 events →
In this hub
| Webhook events → | Every covered Agentcard event, with payloads where the registry has them. |
| MCP events → | How an agent subscribes to Agentcard events as MCP events. |
| Verify signatures → | Signature facts, verification code and common failures. |
| Production guide → | Production problems, such as timeouts and retries, and how to handle them. |
| Agent skill → | Install the webhook skill in your coding agent. npx skills add hookdeck/webhook-skills --skill agentcard-webhooks |
Keep a short retry schedule from losing Agentcard events.
Hookdeck Event Gateway accepts every Agentcard delivery, verifies its signature, queues events and retries to your service on your schedule.