m2pfintech
Webhook Guide

Retry Policy & Best Practices

Webhook retry behavior, failure handling, and production best practices for reliable webhook integration.

How M2P handles failed webhook deliveries and production best practices for building a reliable webhook integration.


Retry Policy

If your endpoint does not return HTTP 200 within 10 seconds, M2P automatically retries with exponential backoff:

AttemptDelay After PreviousTotal Elapsed
Initial delivery0s
1st retry30 seconds30s
2nd retry2 minutes2m 30s
3rd retry10 minutes12m 30s
4th retry1 hour1h 12m 30s
Final retry (5th)4 hours5h 12m 30s

After 5 failed attempts, the event is marked as permanently failed and logged. Contact M2P support to replay failed events if needed.


Best Practices

PracticeWhy It Matters
Return 200 immediately, process asynchronouslyPrevents timeouts — acknowledge receipt first, then process
Store eventId and deduplicateEvents may be retried — use eventId to detect and skip duplicates
Verify signature before processingPrevents webhook spoofing — see Signature Verification
Use a message queue (e.g., SQS, RabbitMQ, Redis)Decouples receipt from processing — ensures no events are lost
Log all eventsEnables debugging, auditing, and event replay
Monitor consecutive failuresAlert your team when multiple deliveries fail in a row
Handle unknown event types gracefullyFuture-proof your handler — return 200 for unrecognized events

  1. Webhook endpoint — Receives the HTTP POST, verifies the signature, and immediately returns 200
  2. Message queue — Durably stores the event for async processing
  3. Worker process — Consumes events from the queue, applies business logic, and updates your database

On this page