MoonPay webhooks
MoonPay webhooks are HTTP POST requests that MoonPay sends to your endpoint when a crypto buy or sell transaction, a customer's KYC status or a virtual account changes.
How MoonPay webhooks work
Webhooks push asynchronous updates to your server, so you don't have to poll MoonPay for a transaction's status. MoonPay sends a POST with a JSON body to each endpoint subscribed to the event, and a 2xx within 5 seconds counts as delivered. Two integrations send them: the widget sends buy, sell, identity and virtual account events, and the newer Platform API sends KYC and buy transaction updates.
The top-level type field says what happened. Widget transaction and identity events carry the object in data, while virtual account events carry it in body. The Platform KYC event adds id and timestamp. MoonPay's docs disagree about Platform buy updates: the overview points to the widget's transaction_updated, and the Platform OpenAPI file shows {eventTime, data} with no type. MoonPay documents no payload version.
Key facts
{t}.{raw body} t from the Moonpay-Signature-V2 header, a literal period, then the raw request body. A JSON parser changes the bytes, so verify before you parse.
Moonpay-Signature Same t=,s= form as V2, but keyed with the endpoint's signing secret rather than the webhook API key.
Setting up MoonPay webhooks
- Add an endpoint in the dashboard's webhook settings, then choose all event types or specific ones. One event can go to several endpoints.
- Create one setting for test mode and one for live mode, even if both use the same URL.
- To test locally, run the Hookdeck CLI:
hookdeck listen 3000 moonpay --path /webhooks/moonpay, then use its URL as the test mode endpoint. MoonPay's own docs suggest ngrok or webhook.site. - MoonPay documents no way to resend an event. After an outage, read transactions from its API instead.
Delivery behaviour
5 seconds anything else but a 2xx in that time is a failed delivery Retries up to 9 exponential backoff from 1 second, roughly doubling, for 10 attempts in all After retries not redelivered MoonPay documents no manual resend Ordering not guaranteed use updatedAt in the payload, not arrival order Known failure modes
From Hookdeck's MoonPay guide →-
Duplicate deliveries
MoonPay delivers at least once. Deduplicate Platform events on the
Handle duplicates →webhook-idheader, and widget transactions ontype,data.idanddata.updatedAt. -
Out-of-order delivery
MoonPay events can arrive out of order, especially around retries. Compare the payload's
Handle ordering →updatedAtwith the state you've stored and ignore older updates. -
Events lost after a short outage
MoonPay stops after 10 attempts, and with backoff from 1 second that takes minutes. Once retries run out the event isn't redelivered, so reconcile from its API after any outage.
Retries and reconciling → -
Platform docs that disagree
MoonPay's Platform overview says
Other MoonPay limits →Moonpay-Signature-V2and points to the widgettransaction_updatedbody, while its Platform OpenAPI file saysX-Signatureand{eventTime, data}. Send one test mode delivery and check before building on either.
MoonPay webhook best practices
- Verify every signature.
Check
Moonpay-Signature-V2against the raw body with your webhook API key, and return400if it's missing or wrong. - Return a 2xx within 5 seconds. Store the event and respond before doing anything else, because MoonPay treats a slower answer as a failed delivery.
- Make your handler idempotent.
Delivery is at least once. Deduplicate on
webhook-idfor Platform events, and ontype,data.idanddata.updatedAtfor widget transactions. - Compare
updatedAtbefore writing. Events can arrive out of order, so ignore an update that's older than the state you've stored. - Reconcile after an outage. MoonPay stops after 10 attempts and doesn't redeliver, so read transactions from its API to catch anything you missed.
- Surface requotes in your product.
sell_transaction_requote_requiredmeans the customer can accept or decline a new quote, so show it in-app instead of relying on MoonPay's email.
Common MoonPay webhook events
Buy
transaction_created | Customer creates a buy transaction in the widget |
transaction_updated | Buy transaction's status or details change |
transaction_failed | Buy transaction fails |
Sell
sell_transaction_updated | Sell transaction's status or details change |
sell_transaction_requote_required | Price moved before the deposit arrived, so the sale needs a new quote |
sell_transaction_failed | Sell transaction fails |
Identity
identity_check_updated | Customer's KYC status changes in a widget integration |
customer.identity_status_updated | Customer's KYC status changes on the Platform API |
Events by resource
| Resource | Events | Payloads |
|---|---|---|
sell | 4 | 1 |
buy | 3 | 1 |
1 more resource, including Other MoonPay events. All 11 events →
In this hub
| Webhook events → | Every covered MoonPay event, with payloads where the registry has them. |
| MCP events → | How an agent subscribes to MoonPay 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 moonpay-webhooks |
Keep a short outage from losing your MoonPay events.
Event Gateway verifies the signature and answers MoonPay as soon as it accepts each delivery, so a slow handler or a failed deploy doesn't use up MoonPay's retries, and your events wait in its queue until your service recovers.