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#

  1. Make a URL on your server

    Add a route that accepts POST requests with a JSON body, such as https://yourapp.com/webhooks/morzepay. It must be a public https:// address.

  2. 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 livemode in each event before you act on it.

  3. 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.

  4. Send a test event

    Click Send test event. We send a ping event and show exactly what your server answered.

What we send#

Webhook request
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#

EventWhen
deposit.succeededA customer paid and the wallet was credited.
deposit.failedA collection was declined, timed out or cancelled.
payout.succeededThe recipient was paid. fee holds the real fee.
payout.failedA payout failed. Everything held for it is back in the wallet.
transfer.succeededA wallet-to-wallet transfer completed.
transaction.reviewA transaction needs a manual check. Its final status follows.
invoice.finalizedAn invoice got its number and can be paid.
invoice.sentAn invoice was emailed or texted.
invoice.paidAn invoice was paid on its hosted page (with payment) or marked paid.
invoice.payment_failedA payment attempt on an invoice failed. The invoice stays open.
invoice.overpaidA payment arrived for an invoice that was already paid or voided. Refund it with a payout.
invoice.voided, invoice.marked_uncollectibleYou changed an invoice’s status.
checkout.session.completedA checkout session or payment page was paid (with payment). Sent for every payment on a reusable link.
checkout.session.expiredA session expired or was deactivated.
pingA 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 id and ignore ones you’ve already handled.
  • Events can arrive out of order. Use the status in data, 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}.