Webhooks
Get a signed message the moment a payment, payout or invoice changes.
A webhook is a message Morzepay sends to your server when something happens, such as a payment succeeding. With webhooks you don’t have to keep asking whether a payment is done: we tell you the moment it is.
Set up your endpoint#
- Make a URL on your server
Add a route that accepts
POSTrequests with a JSON body, such ashttps://yourapp.com/webhooks/morzepay. It must be a publichttps://address. - Add it in the dashboard
Go to Developers → Payment notifications, enter the URL and save. One URL gets both test and live events, so check
livemodein each event before you act on it. - Store the signing secret
The first time you save, you get a signing secret starting with
whsec_. It’s shown only once. Put it in your server’s environment variables: you need it to verify signatures. - Send a test event
Click Send test event. We send a
pingevent and show exactly what your server answered.
What we send#
POST /webhooks/morzepay HTTP/1.1
Content-Type: application/json
Morzepay-Event: deposit.succeeded
Morzepay-Delivery: evt_Mx8Qp3VnK7rT2bWc9LhZ4d
Morzepay-Signature: t=1791127650,v1=5e8f0c7a...
{
"id": "evt_Mx8Qp3VnK7rT2bWc9LhZ4d",
"event": "deposit.succeeded",
"created_at": "2026-10-04T14:07:51+03:00",
"data": {
"id": "txn_Rk3Lp9WmQ2vX7bN4cTz8Hd",
"livemode": true,
"type": "deposit",
"status": "success",
"amount": "10000.00",
"net": "10000.00",
"reference": "order-77812",
"metadata": {
"order_id": "77812"
}
}
}data is the same object the API returns: a transaction, an invoice or a checkout session.
Events#
| Event | When |
|---|---|
deposit.succeeded | A customer paid and the wallet was credited. |
deposit.failed | A collection was declined, timed out or cancelled. |
payout.succeeded | The recipient was paid. fee holds the real fee. |
payout.failed | A payout failed. Everything held for it is back in the wallet. |
transfer.succeeded | A wallet-to-wallet transfer completed. |
transaction.review | A transaction needs a manual check. Its final status follows. |
invoice.finalized | An invoice got its number and can be paid. |
invoice.sent | An invoice was emailed or texted. |
invoice.paid | An invoice was paid on its hosted page (with payment) or marked paid. |
invoice.payment_failed | A payment attempt on an invoice failed. The invoice stays open. |
invoice.overpaid | A payment arrived for an invoice that was already paid or voided. Refund it with a payout. |
invoice.voided, invoice.marked_uncollectible | You changed an invoice’s status. |
checkout.session.completed | A checkout session or payment page was paid (with payment). Sent for every payment on a reusable link. |
checkout.session.expired | A session expired or was deactivated. |
ping | A test event you sent from the dashboard. |
Payments on invoices and checkout pages also send the usual deposit.succeeded for the underlying transaction. Its metadata holds the invoice_id or checkout_session_id, so you can handle all payments in one place if you prefer.
Answer quickly#
Reply with any 2xx status within 10 seconds. Do the slow work, like sending emails or updating stock, after you’ve replied.
Retries#
If your server doesn’t answer with a 2xx in time, we try again after 1 minute, 5 minutes, 15 minutes, 1 hour, 2 hours, 6 hours, 12 hours and 24 hours. The dashboard shows every delivery, its attempts and your server’s last answer.
- The same event can arrive more than once. Store each event’s
idand ignore ones you’ve already handled. - Events can arrive out of order. Use the
statusindata, not the order of arrival. - We don’t follow redirects. Give the final URL.
Trust, but check#
Always verify the signature before acting on a webhook. For high-value actions, such as releasing goods, also confirm the payment with GET/v1/transactions/{transaction_id}.