# Mercury webhooks

Mercury webhooks are HTTP POST requests that Mercury sends to your endpoint when a transaction or an account balance changes in your Mercury account.

The event names on these pages are what you subscribe to with `eventTypes`. They aren't in the delivery: its body identifies the change with `resourceType` and `operationType`, so route on those.

Agent skill: `npx skills add hookdeck/webhook-skills --skill mercury-webhooks` ([details](https://hookdeck.com/webhooks/mercury/skill))

> Independent reference generated from hookdeck/webhook-registry (commit ff7f882, 20 Nov 2026). [Mercury's official docs](https://docs.mercury.com/reference/webhooks).

[Overview](https://hookdeck.com/webhooks/mercury) · [Webhook events (7)](https://hookdeck.com/webhooks/mercury/events) · [MCP events](https://hookdeck.com/webhooks/mercury/mcp-events) · [Verify signatures](https://hookdeck.com/webhooks/mercury/verify) · [Production guide](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts) · [Agent skill](https://hookdeck.com/webhooks/mercury/skill)

## Key facts

| Fact | Value | Source |
|---|---|---|
| Signature header | `Mercury-Signature` Format: t=<unix seconds>,v1=<hex> | [Mercury docs](https://docs.mercury.com/reference/webhooks) |
| Scheme | `HMAC-SHA256` | [Mercury docs](https://docs.mercury.com/reference/webhooks) |
| Signed material | `{t}.{raw body}` t from the Mercury-Signature header, a literal dot, then the body exactly as received. Re-serialised JSON will not verify. | [Mercury docs](https://docs.mercury.com/reference/webhooks) |
| How events are identified | `resourceType and operationType in the body` | [Mercury docs](https://docs.mercury.com/reference/webhooks) |
| Body format | `JSON` | [Mercury docs](https://docs.mercury.com/reference/webhooks) |
| Send timestamp | `Mercury-Signature` Reject deliveries older than 5 minutes. | [Mercury docs](https://docs.mercury.com/reference/webhooks) |
| Envelope | `id, resourceType, resourceId, operationType, resourceVersion, occurredAt, changedPaths, mergePatch, previousValues` | [Mercury docs](https://docs.mercury.com/reference/webhooks) |
| Agent skill | `npx skills add hookdeck/webhook-skills --skill mercury-webhooks` | [Agent skill →](https://hookdeck.com/webhooks/mercury/skill) |

[Verify Mercury webhooks](https://hookdeck.com/webhooks/mercury/verify)

## How Mercury webhooks work

Webhooks push changes to your server as they happen, so you don't have to poll Mercury's Events API. Mercury sends a POST with a JSON body to each endpoint subscribed to the change, and a 2xx within 5 seconds counts as delivered.

The body has the same structure as an Events API event. `resourceType` names what changed, such as `transaction`, and `operationType` is `create`, `update` or `delete`. `changedPaths` lists the changed fields, `mergePatch` holds their new values as a JSON Merge Patch, and `previousValues` holds the old ones. There's no payload version: `resourceVersion` counts the changes to that one resource.

## Setting up Mercury webhooks

- Create an endpoint with `POST https://api.mercury.com/api/v1/webhooks`, giving an HTTPS `url` and optional `eventTypes` and `filterPaths`. Save the `secret` in the response, because Mercury doesn't return it again.
- Send a test event with `POST /webhooks/{id}/verify`. It sends `transaction.created` unless you pass another `eventType`. Webhooks aren't available in Mercury's sandbox.
- To test locally, run the [Hookdeck CLI](/docs/cli): `hookdeck listen 3000 mercury --path /webhooks/mercury`, then use its URL as the endpoint's `url`.
- Mercury documents no resend call. To recover changes you missed, read `GET /events`, which keeps events for 90 days.

## Delivery behaviour

- **Timeout:** 5 seconds. no response in that time counts as a failed delivery. [Guide](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#timeouts)
- **Retries:** up to 10. exponential backoff over about a day; a `4xx` other than `429` isn't retried. [Guide](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#retries)
- **Endpoint disabled:** after consecutive failures. the threshold isn't documented; set `status` back to `active` to reactivate. [Guide](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#retries)
- **Duplicates:** at least once. the same event can arrive more than once, so deduplicate on `id`. [Guide](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#duplicates)

## Known failure modes

1. **Event names aren't in the body.** `transaction.created` is a subscription filter and never arrives in a delivery. Route on `resourceType` and `operationType` instead, for example `transaction` and `create`. [Choose and route events](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#choosing-events)
2. **Duplicate deliveries.** Mercury delivers at least once, so the same event can arrive more than once. Deduplicate on the event's `id` before you process it. [Handle duplicates](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#duplicates)
3. **A 4xx isn't retried.** Mercury doesn't retry a `4xx` other than `429`, so a strict validator or a wrong secret loses that delivery. Return a `5xx` when a dependency is down, and read the Events API to recover. [Retries and disabled endpoints](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#retries)
4. **Endpoint disabled after failures.** Mercury sets an endpoint's `status` to `disabled` after consecutive delivery failures, and it doesn't publish the threshold. Set `status` back to `active`, then reconcile the gap from the Events API. [Retries and disabled endpoints](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#retries)

From [Hookdeck's Mercury guide](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts).

## Mercury webhook best practices

- **[Verify every signature](https://hookdeck.com/webhooks/mercury/verify).** Check `Mercury-Signature` against the raw body. Without it, anyone who finds your URL can send a fake transaction.
- **[Return a 2xx within 5 seconds](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#timeouts).** Store the event and respond before you apply the patch or call the API, so a slow handler doesn't count as a failed delivery.
- **[Deduplicate on `id`](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#duplicates).** Delivery is at least once, so record each event's `id` and skip any you've already processed.
- **[Track `resourceVersion`](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#ordering).** Keep the last version you applied to each resource and ignore lower ones, since Mercury documents no ordering guarantee.
- **[Subscribe narrowly](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#choosing-events).** Use `eventTypes` and `filterPaths` so Mercury sends only the changes you handle.
- **[Reconcile from the Events API](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts#retries).** After an outage, or after a `4xx` you returned by mistake, read `GET /events` to pick up what you missed. Events stay available for 90 days.

## Common Mercury webhook events

### Transactions

- [transaction.created](https://hookdeck.com/webhooks/mercury/events#transaction.created): New transaction appears in your Mercury account
- [transaction.updated](https://hookdeck.com/webhooks/mercury/events#transaction.updated): Existing transaction changes, such as its status or note

### Account balances

- [checkingAccount.balance.updated](https://hookdeck.com/webhooks/mercury/events#checkingAccount.balance.updated): Checking account's available, current or in-flight balance changes
- [savingsAccount.balance.updated](https://hookdeck.com/webhooks/mercury/events#savingsAccount.balance.updated): Savings account's available, current or in-flight balance changes
- [treasuryAccount.balance.updated](https://hookdeck.com/webhooks/mercury/events#treasuryAccount.balance.updated): Treasury account's available, current or in-flight balance changes
- [creditAccount.balance.updated](https://hookdeck.com/webhooks/mercury/events#creditAccount.balance.updated): Credit account's available, current or in-flight balance changes
- [investmentAccount.balance.updated](https://hookdeck.com/webhooks/mercury/events#investmentAccount.balance.updated): Investment account's available, current or in-flight balance changes

## Events

| Resource | Events | Payloads |
|---|---|---|
| [Mercury events](https://hookdeck.com/webhooks/mercury/events#resource-other) | 7 | 1 |

[All 7 events](https://hookdeck.com/webhooks/mercury/events)

## In this hub

- [Webhook events](https://hookdeck.com/webhooks/mercury/events): Every covered Mercury event, with payloads where the registry has them.
- [MCP events](https://hookdeck.com/webhooks/mercury/mcp-events): How an agent subscribes to Mercury events as MCP events.
- [Verify signatures](https://hookdeck.com/webhooks/mercury/verify): Signature facts, verification code and common failures.
- [Production guide](https://hookdeck.com/webhooks/mercury/guide-duplicates-ordering-retries-timeouts): Production problems, such as timeouts and retries, and how to handle them.
- [Agent skill](https://hookdeck.com/webhooks/mercury/skill): Install the webhook skill in your coding agent. `npx skills add hookdeck/webhook-skills --skill mercury-webhooks`
---

Not affiliated with Mercury. Facts are compiled from public sources and linked inline. [View as JSON](https://hookdeck.com/webhooks/mercury.json) · [Report a correction](https://hookdeck.com/contact)
