A webhook is a notification the payment service sends to your site's address whenever a payment status changes. It — not the buyer returning to a thank-you page — should be treated as the source of truth: it is the only way the store reliably learns about a payment.
Why the redirect is not enough
A buyer can close the tab right after paying, lose connectivity or never wait for the redirect. The money is taken, but the store never finds out — the order sits in "awaiting payment" until someone sorts it out by hand. A webhook reaches your server regardless of what the buyer does.
How it is arranged at MulenPay
The notification address is set in the store settings in the dashboard. On every status change — succeeded, declined, refunded, hold released — MulenPay sends a request there with the payment id, the amount and your order number, signed with the store's secret key so the handler can tell it from an outside one. If your server does not respond, you trigger a resend yourself from the dashboard; the same notification can then arrive twice, and the handler must allow for that. The platform modules — WordPress, 1C-Bitrix, OpenCart and others — already contain a handler; the request format for your own integration is documented at docs.mulenpay.com.
Example: a buyer pays for order 1842 and closes the browser before the thank-you page loads. A second later the store's server receives a webhook for 1842 with a paid status; the handler verifies the signature, marks the order paid and queues it for picking.
What your handler must do
- Accept the request and answer 200 immediately — otherwise the service treats delivery as failed.
- Find the order by the identifier you passed when creating the payment.
- Verify the request signature before changing anything in the database.
- Update the order status and store the payment id for reconciliation.
Common mistakes
- The address sits behind auth or a firewall — notifications never arrive.
- The handler returns 500 or times out — heavy logic inside; move it to a background job.
- No signature check — the endpoint will accept whatever arrives.
- Processing the same notification twice — it can arrive more than once; the handler must cope.
Integration details are on the payment API page; the signature check is covered in why webhooks are signed.