Use Payabli’s notification functions to create and manage automated notifications and reports for important events. This guide covers the key operations for managing notifications through the API.

Considerations

Keep these considerations in mind when working with notifications:

  • Notifications can be owned by either an organization or a paypoint.
  • Multiple notification methods are supported including email, SMS, webhooks, and automated reports.
  • Each notification requires a specific event type to trigger it. Learn more about the events here.
  • Notifications can be set to run until cancelled or for a specific duration.
  • For webhook notifications, you can include custom header parameters.

Create a notification

Send a POST request to /api/Notification to create a notification. The notification can be configured to trigger on specific events and deliver updates via email, SMS, or webhooks. See the API reference for full documentation.

This example creates a webhook notification that triggers when a payment is approved:

Create notification example
curl --request POST \
     --url https://api-sandbox.payabli.com/api/Notification \
     --header 'accept: application/json' \
     --header 'content-type: application/*+json' \
     --header 'requestToken: <API TOKEN>' \
     --data '
{
     "content": {
          "timeZone": "0",
          "webHeaderParameters": [
               {
                    "key": "myAuthorizationID", 
                    "value": "1234"
               }
          ],
          "eventType": "ApprovedPayment"
     },
     "method": "web",
     "frequency": "untilcancelled",
     "target": "https://www.example.com/captureWebhook/",
     "status": 1,
     "ownerType": 0,
     "ownerId": 999
}
'

Get notification details

Send a GET request to /api/Notification/{notificationId} to retrieve information about a specific notification. See the API reference for full documentation.

This example retrieves details for notification ID 1717:

Get notification example
curl --request GET \
     --url https://api-sandbox.payabli.com/api/Notification/1717 \
     --header 'requestToken: <API TOKEN>'

Update a notification

Send a PUT request to /api/Notification/{notificationId} to modify an existing notification’s configuration. See the API reference for full documentation.

This example updates a notification to use a different webhook URL and adds a new header parameter:

Update notification example
curl --request PUT \
     --url https://api-sandbox.payabli.com/api/Notification/1717 \
     --header 'accept: application/json' \
     --header 'content-type: application/*+json' \
     --header 'requestToken: <API TOKEN>' \
     --data '
{
     "content": {
          "webHeaderParameters": [
               {
                    "key": "myAuthorizationID",
                    "value": "1234"
               },
               {
                    "key": "version",
                    "value": "2.0"
               }
          ],
          "eventType": "ApprovedPayment"
     },
     "target": "https://www.example.com/webhooks/v2/",
     "status": 1
}
'

Delete a notification

Send a DELETE request to /api/Notification/{notificationId} to remove an existing notification. See the API reference for full documentation.

This example deletes notification ID 1717:

Delete notification example
curl --request DELETE \
     --url https://api-sandbox.payabli.com/api/Notification/1717 \
     --header 'requestToken: <API TOKEN>'

Response format

Most notification operations return a standardized response format:

Response format example
{
  "isSuccess": true,
  "responseText": "Success",
  "responseCode": 1,
  "responseData": 1717 // this is the notification ID
}