Your webhook handler should be idempotent because webhook delivery systems can send the same event more than once.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.
Why duplicate handling matters
Duplicate delivery can happen when:- Your endpoint times out.
- Your endpoint returns a non-2xx response.
- Network errors interrupt delivery.
- Your app receives the same payment state through polling and webhooks.
Recommended handler pattern
- Verify the webhook signature.
- Read the message identifier from
svix-id. - Check whether your app already processed that message or Moflay resource state.
- Apply the state change once.
- Store that the message or resource state was processed.
- Return a 2xx response.
Idempotent payment updates
For payment events, use one of these stable identifiers as your idempotency key:- The
svix-idmessage header - The Moflay
paymentId - The Moflay
transactionId - Your own order ID stored in payment metadata
Payment creation idempotency
Webhook idempotency is separate from payment creation idempotency. When your backend callsPOST /v1/express, send an Idempotency-Key header for safe retries.