Webhook


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.

Setting Up a Webhook

You can use the Payant Dashboard Settings to setup a webhook subscription. You will be required to specify:

  • Webhook URL - a URL to your endpoint that can process both verification and notification requests.
  • Verify Token - a string that you supply which we will include whenever we send a verification request.

Webhook URL

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

Verification Request

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.

  • type=subscribe
  • 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 that the verify_token corresponds to the token your supplied when setting up your webhook.
  • Respond with the challenge value.

Notification Request

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

Webhook Server Example

We have created an example Node.js server for you to get started quickly.