Moflay webhooks notify your backend when payment and customer events happen. Use webhooks in production instead of relying only on polling.Documentation Index
Fetch the complete documentation index at: https://moflay.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
How webhooks fit into the payment flow
Your backend creates a payment
Your app calls
POST /v1/express with a sandbox or production API key.Moflay processes the M-Pesa result
Moflay receives the Safaricom callback, updates the payment and transaction,
and stores the final status.
Moflay sends your webhook
Moflay sends a signed event such as
payment.completed or
payment.failed to your configured endpoint.Configure a webhook endpoint
- Open Webhooks.
- Create an endpoint for your backend URL.
- Subscribe to the events your app needs.
- Store the signing secret in your backend environment variables.
- Verify every incoming webhook before processing the payload.
Recommended payment events
For most payment integrations, subscribe to:payment.completedpayment.failed
Safaricom callbacks vs Moflay webhooks
| Term | Who sends it | Who receives it |
|---|---|---|
| Safaricom callback | Safaricom Daraja | Moflay |
| Moflay webhook | Moflay | Your backend |