Skip to content

Credit notification Webhooks

Credit notification webhooks requests are sent to your endpoints when you have created a credit notification, and specified a webhook url as part of the setup.

A Credit notification webhook request will be made to your specified endpoint within a minute of your account falling below the threshold you configured in the notification.

Request

In this example, the URL supplied in the callback parameter is:

https://my-website.com/credit-notification

Endpoint

A POST request will be made to your endpoint

POST https://my-website.com/credit-notification

Body

json
{
    "notification_uuid": "3dd57172-eb3b-4158-865b-1e65688933c8",
    "account_uuid": "ecc6808e-d3a6-4668-8f8f-cc8913b5cac7",
    "threshold_type": "paid_fixed_number",
    "threshold_value": 20,
    "paid_credit_balance": 19,
    "packaged_credit_balance": 0
}
json
{
    "notification_uuid": "3dd57172-eb3b-4158-865b-1e65688933c8",
    "account_uuid": "ecc6808e-d3a6-4668-8f8f-cc8913b5cac7",
    "threshold_type": "paid_negative_percentage",
    "threshold_value": 0.2,
    "paid_credit_balance": -801,
    "packaged_credit_balance": 0
    // In this example, the negative limit is -1000
}
json
{
    "notification_uuid": "3dd57172-eb3b-4158-865b-1e65688933c8",
    "account_uuid": "ecc6808e-d3a6-4668-8f8f-cc8913b5cac7",
    "threshold_type": "packaged_fixed_number",
    "threshold_value": 5,
    "paid_credit_balance": 250,
    "packaged_credit_balance": 4
}
KeyExpected valueDescription
notification_uuidstringThe UUID of the triggered notification
account_uuidstringThe UUID of the account to attach the notification to
threshold_typeThresholdType (string)The ThresholdType for this notification
threshold_valuenumericThe threshold value for this notification
paid_credit_balancenumericRemaining paid credits as of this notification being triggered
packaged_credit_balancenumericRemaining packaged credits as of this notification being triggered

ThresholdType string

We support 5 different threshold_types, each of which can be either a fixed_number or percentage threshold.

ValueTypeDescription
paid_negative_fixed_numberfixed_numberTrigger when remaining negative credits fall below a fixed number
paid_negative_percentagepercentageTrigger when remaining negative credits fall below a percentage of the negative limit
paid_fixed_numberfixed_numberTrigger when paid credits fall below a fixed number
packaged_fixed_numberfixed_numberTrigger when packaged credits fall below a fixed number
packaged_percentagepercentageTrigger when packaged credits fall below a percentage of the packaged credit refill value

Threshold types with a fixed_number threshold must have the threshold_value supplied as exactly the value you want credits to fall below. Eg. 120 represents a credit threshold of 120 credits.

Threshold types with a percentage threshold must have the threshold_value supplied as a 0..1 floating point number. Eg. 0.25 represents a threshold of 25%.

Response

Messaging Plus expects a 200 response to the webhook. If a non-200 response is supplied, we will retry up to 5 times.

Messaging Plus is a Cymba API