Skip to main content

Subscribing to Webhooks


Calling this endpoint will allow you to receive notifications for the events or categories of events you specify. This is a POST request.

Parameters

    Content-Type String - (Required)
    application-json


    Accept String - (Required)
    application-json


    Authorization String - (Required)
    Bearer {ACCESS_TOKEN} (See Authentication)


    url URL - (Required)
    Your URL where webhook notificatons should be delivered.


    secretKey String - (Required)
    A secret key, to be provided by Merchant, which will be used later to validate the authenticity of the webhook request.


    subscriptionDetails Object - (Required)
    See subscription details object below


subscriptionDetails

    type enum - (Required)
    EVENT or CATEGORY or ALL


    details String - (Required)
    If type is CATEGORY, this should be a list of ACCOUNT, CUSTOMER and/or PAYMENT. If type is EVENT, this should be a list of events from the events table below. If type is ALL, this value is optional.


Returns

    subscriptionKey String
    A unique key for this subscription. Can be used to unsubscribe from webhooks


Post Request

POST - /v1/webhook/subscribe
POST Request
1curl --location --request POST '{API_BASE_URL}/v1/webhook/subscribe' \
2--header 'Content-Type: application/json' \
3--header 'Authorization: Bearer {ACCESS_TOKEN}' \
4--data-raw '{ 
5	"url":"{URL}", 
6	"secretKey":"{SECRET_KEY}", 
7	"subscriptionDetails" : { 
8		"type" : "CATEGORY", 
9		"details" : ["CUSTOMER","ACCOUNT","PAYMENT"] 
10	} 
11}'

Response Body

Response
1{ "subscriptionKey" : "4fa54dcce-32b9-8c8c-7344-1e8f4b41826" }