Webhooks
Webhooks
Webhooks are HTTP-based real-time push notifications that Hyperswitch would use for instant status communication to your server. Webhooks are vital in payments for the following reasons:
- Preventing merchants from losing business due to delayed status communication (say, in case of flight or movie reservations where there is a need for instant payment confirmation).
- Prevent payment reconciliation issues where payments change from “Failed” to “Succeeded”.
- Providing the best payment experience for the end-user by instantly communicating payment status and fulfilling the purchase.
Configuring Webhooks
Create an endpoint on your server
Update your webhook endpoint on Hyperswitch Dashboard
Update Hyperswitch’s webhook endpoints on your connector Dashboard
Hyperswitch’s webhook endpoint format is as follows:
Environment | Webhook Endpoint |
---|---|
Sandbox | sandbox.hyperswitch.io/webhooks/{merchant_id} /{connector_name} |
Production | api.hyperswitch.io/webhooks/{merchant_id} /{connector_name} |
Handling Webhooks
-
Select the events for Webhooks: On the same page on the dashboard, select the events for which you would like to receive notifications. Currently, Webhooks are available on Hyperswitch for the following events:
- payment_succeeded
- payment_failed
- payment_processing
- action_required
- refund_succeeded
- refund_failed
- dispute_opened
- dispute_expired
- dispute_accepted
- dispute_cancelled
- dispute_challenged
- dispute_won
- dispute_lost
-
Return a 2xx response: Your server must return a successful 2xx response on successful receipt of webhooks.
-
Retries: In case of 3xx, 4xx, or 5xx response or no response from your endpoint for webhooks, Hyperswitch has a retry mechanism that tries sending the webhooks again up to 3 times before marking the event as failed.