A webhook allows your application to recieve updates when updates are made on your account on Payant. Webhook update notifications are sent as POST requests to a callback URL that you supply.
You can use the Payant Dashboard Settings to setup a webhook subscription. You will be required to specify:
You need to setup a webhook endpoint before you setup a subscription to it on Payant. Your endpoint must be HTTPs and must be able to receive both GET and POST requests.
If you need help setting up HTTPs on your endpoint, check out the Getting Started Guide from Let's Encrypt
We'll send a GET request while setting up your webhook. The request will include the following parameters appended to the end of your webhook URL.
challenge- A random string
verify_token- a string that you supply to setup the webhook
When your endpoint receives the verification request, it must:
verify_tokencorresponds to the token your supplied when setting up your webhook.
Whenever their are changes on your account, we will send a POST request to your webhook endpoint. The request will have a JSON payload as follows:
type- Notification type
data- An array containing the notification data
We have created an example Node.js server for you to get started quickly.