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.

58 events covered

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

Signature header
AgentCard-Signature

Format: t=<unix seconds>,v1=<hex>

Scheme
HMAC-SHA256
Signed material
{t}.{raw body}

t from the AgentCard-Signature header, a literal dot, then the raw body bytes.

How events are identified
type field in the body
Body format
JSON
Send timestamp
AgentCard-Signature

Reject deliveries older than 5 minutes.

Legacy signature
X-AgentCard-Signature

sha256=<...> over the body alone; encoding not stated

Other headers
x-agentcard-signature
Envelope
id, type, created, livemode, data
Agent skill
npx skills add hookdeck/webhook-skills --skill agentcard-webhooks

Verify Agentcard webhooks →

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 a url and enabled_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_charge simulates 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.listen receives 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}/deliveries and the dashboard list recent delivery attempts.

Delivery behaviour

  1. Duplicate deliveries

    Agentcard delivers each event at least once, and id stays the same on every redelivery. Record each id and skip any you've already processed.

    Handle duplicates →
  2. Out-of-order delivery

    A retried Agentcard delivery can arrive after a newer one. On trip plans, keep the highest version for each booking, and elsewhere don't assume events arrive in the order they happened.

    Handle ordering →
  3. 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 →
  4. Purchase messages never arrive

    A catch-all * doesn't turn on purchase.message, so a shopper never hears about a step even though the endpoint looks healthy. Subscribe to it by name or with purchase.*.

    Choosing events →

Agentcard webhook best practices

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

checkout_authorization.approved · .submitted · .declined · .expired +8

12 9
transfer

transfer.approved · .completed · .initiated · .failed +1

5 1
order

order.placed · .confirmed · .failed · .updated

4 3
transaction

transaction.authorized · .cleared · .declined · .voided

4 4
vault

vault.session_linked · .card_stored · .payment_permission.updated · .session_card_picked

4 3
card

card.created · .updated · .closed

3 3
recovery

recovery.requested · .completed · .rejected

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.

Not affiliated with Agentcard. Facts are compiled from public sources and linked inline.