Web Hooks

A webhook is a mechanism that allows applications to send real-time data or notifications to other systems or services whenever specific events occur. Instead of polling or manually requesting updates, webhooks push data to a designated URL (endpoint) as soon as an event is triggered.

By registering a webhook, you can configure your system to listen for events and automatically process the notifications, such as updating your database, triggering workflows, or sending alerts.

Webhooks consist of the following key components:

  • Event Trigger: A specific event (e.g., payment success, refund issued) that initiates the webhook call.
  • Endpoint URL: The destination where the webhook payload (event data) is sent.
  • Payload: The data related to the event, which is delivered in the webhook call.

Webhooks are a powerful tool for integrating our services with your own applications, enabling automation, real-time synchronization, and streamlined communication between systems.

POST/hooks/channel/create

A WebHookChannel is required to establish a connection with our event notification system. The channel serves as the communication link between your application and the events generated by the payment gateway. When you register a WebHookChannel, you're defining the endpoint where we will deliver notifications, such as payment events.

The WebHookChannel encapsulates important configuration details like the endpoint type (e.g., HTTP), the client ID, and security parameters. However, the channel itself does not specify which events will be sent but should be considered as the pipeline for receiving those events. After registering a channel, you can then configure triggers separately using a subscription request to define which specific payment events should flow through this channel.

    Request Attributes

200 OK WebHookChannelCreateResponse

    Response Attributes

Request

WebHookChannelCreateRequest
{
  "channel_name":"",
  "clientid":"PC12345",
  "config":{},
  "endpoint_id":""
}

Response

WebHookChannelCreateResponse
{
  "config":"",
  "endpoint_id":"",
  "web_channel_id":""
}
POST/hooks/channel/delete

The WebHookChannelDeleteRequest allows you to remove an existing WebHookChannel from the event notification system. By specifying the channel ID, you can deactivate the communication link between your application and the payment gateway’s event system. Deleting a channel effectively halts any further notifications being sent to the associated endpoint, ensuring that no additional events are processed through that channel.

    Request Attributes

200 OK Acknowledgement

    Response Attributes

Request

WebHookChannelDeleteRequest
{
  "channel_id":""
}

Response

Acknowledgement
{
  "code":"001",
  "context":"aspiu352908ns47n343598bads",
  "identifier":"95b857a1-5955-4b86-963c-5a6dbfc4fb95",
  "message":"Web hook channel has been deleted"
}
POST/hooks/subscribe

The WebHookSubscriptionRequest is used to define and activate event triggers for an existing WebHookChannel. This request specifies the events or conditions that your application wants to be notified about, ensuring that only relevant event data flows through the channel.

    Request Attributes

200 OK WebHookSubscriptionResponse

    Response Attributes

Request

WebHookSubscriptionRequest
{
  "channels":[],
  "clientid":"PC12345",
  "live":true,
  "merchant_id":[
    11223344,
    5667788
  ],
  "triggers":[]
}

Response

WebHookSubscriptionResponse
{
  "web_hook_id":""
}
POST/hooks/unsubscribe

The WebHookUnsubscribeRequest is used to remove an existing webhook subscription from the system. This allows clients to stop receiving event notifications for specific webhook subscriptions that are no longer needed.

    Request Attributes

200 OK Acknowledgement

    Response Attributes

Request

WebHookUnsubscribeRequest
{
  "clientid":"PC12345",
  "web_hook_id":""
}

Response

Acknowledgement
{
  "code":"001",
  "context":"aspiu352908ns47n343598bads",
  "identifier":"95b857a1-5955-4b86-963c-5a6dbfc4fb95",
  "message":"WebHook Unsubscribed"
}