Webhooks are user-defined HTTP callbacks triggered by an event. 8Pay uses webhooks to asynchronously let your application know when events happen, like payments are completed, customers subscribe to plans, subscriptions are cancelled, billings are executed and so on.

When an event occurs, 8Pay makes an HTTP POST request to the URL you have configured for your webhook, sending a notification of the event. Your application can then perform whatever logic is necessary.

Verify integrity

Each notification is identified by a unique id generated hashing the rest of the notification with the sha256 algorithm. To verify its integrity you can compare the id with the sha256 hash of the notification itself, stripped of its id.

Retry logic

8Pay attempts to deliver the notifications for up to three days with an exponential back off. If your webhook has been removed when we attempt a retry, future retries of that event will be prevented. However, if you change a webhook endpoint before we’re able to retry, you should still expect to see future retry attempts.

Verify events are sent from 8Pay

To confirm that received events are sent from 8Pay, you can use the Webhook Notifications API to retrieve the notifications by their id.