In terms of implementing retry mechanisms on the Webhooks of Checkout, how should I handle the retries your platform is sending onto my endpoint?
Hello @Cerie,
Happy New Year!
For webhooks used in Maya Online Payments (such as Maya Checkout, Payments via Maya Vault, and Pay with Maya), your endpoint must be designed to safely receive and acknowledge retry attempts in case of delivery failures.
Maya automatically retries webhook deliveries when your endpoint does not return a successful HTTP status (2xx). These retries follow an exponential backoff strategy and are attempted only a limited number of times.
To ensure reliable webhook handling, follow these best practices:
- Implement idempotent processing
- The same event may be delivered more than once.
- Processing the same event multiple times should not result in duplicate actions or duplicate records in your system.
- Always validate the webhook payload before processing, including:
- Payment ID - Maya’s unique identifier for the transaction; use this to match and track payments in your system.
- Event type or the Payment status - Use this to determine the changes or current state of the payment. To understand the payment statuses, you may check Understanding Payment Statuses in Maya Checkout
If you’re experiencing repeated webhook calls, verify the following:
- Your endpoint is publicly reachable and not timing out.
- Your server responds promptly with a 2xx status.
- There are no internal application errors occurring during webhook handling.