Webhook - Subscription Topics

Cleeng Webhooks

Webhooks are notifications that Cleeng sends out to subscribed broadcasters about certain events occurring in the platform. The events are sent in the form of a POST request made to specified endpoints with a JSON payload as its body.

The body of the request consists of three constant fields:

broadcasterId – the ID of the broadcaster that the webhooks is sent for,
topic – the name of the topic that the webhook is sent about,
data – topic-specific payload about the event.

Available Subscription Topics

subscriptionReadyForPaymentAuthorisation

Trigger:
The event is triggered whenever a payment authorization attempt should be made for a given subscription.

Use case:

  • Payment handling (external payment gateways, carrier billing,etc.)

🚧

subscriptionReadyForPaymentAuthorisation is required for recurring payments.

{
    "broadcasterId": 558186818,
    "topic": "subscriptionReadyForPaymentAuthorisation",
    "data": {
        "subscriptionId": "332332332",
        "offerId": "S123123123_US",
        "customerId": 123321123,
        "customerEmail": '[email protected]'
        "paymentDetailsId": 665665665,
        "active": true,
        "dunningAttemptDate": "2019-11-04T19:55:41Z",
        "dunningStatus": "authorize",
        "expirationDate": "2019-11-07T19:55:41Z",
        "currency": "USD",
        "paymentCountry": "BY",
        "paymentMethodId": 123123123,
        "token": "tok_en",
    }
}

subscriptionReadyForPaymentCapture

Trigger:
The event is triggered whenever a payment capture attempt should be made for a given subscription.

Use case:

  • Payment handling (external payment gateways, carrier billing,etc.)

🚧

subscriptionReadyForPaymentCapture is required for recurring payments.

{
    "broadcasterId": 558186818,
    "topic": "subscriptionReadyForPaymentCapture",
    "data": {
        "subscriptionId": 121780131,
        "offerId": 'S729964196_CA',
        "customerId": 388082979,
        "customerEmail": '[email protected]',
        "paymentDetailsId": 255888155,
        "active": true,
        "dunningAttemptDate": '2019-03-03T09:43:20+01:00',
        "dunningStatus": 'capture',
        "expirationDate": '2019-03-06T09:43:20+01:00',
        "currency": 'USD',
        "token": 'tok_en',
        "paymentId": 123456789,
        "externalPaymentId": 'externalId',
        "orderId": 123123123
    }
}

subscriptionStopped

Trigger:
The event is triggered whenever a subscription is stopped.

Use cases:

  • Sending notifications
  • Caching of entitlements
  • Win-back campaigns
{
    "broadcasterId": 123123123,
    "topic": "subscriptionStopped",
    "data": {
        "subscriptionId": 123123123,
        "subscriptionExternalId": "I-GHF2VR4V5U33"
        "customerId": 593300903,
        "customerEmail": "[email protected]",
        "customerExternalId": "123456789"
    }
}

subscriptionRenewed

Trigger:
The event is triggered after recurring.

Use cases:

  • Sending notifications
  • Caching of entitlements
{
    "broadcasterId": 123123123,
    "topic": "subscriptionRenewed",
    "data": {
        "subscriptionId": 123123123,
        "offerId": "S123123123_PL",
        "customerId": 987654321,
        "customerEmail": "[email protected]",
        "active": true,
        "expirationDate": "2019-03-06T09:43:20+01:00",
        "customerExternalId": "123456789"
    }
}

subscriptionReactivated

Trigger:
The event is triggered whenever a subscription is reactivated (change subscription status from canceled (stopped) into active)

Use cases:

  • Sending notifications
  • Caching of entitlements
{
    "broadcasterId": 123123123,
    "topic": "subscriptionReactivated",
    "data": {
        "subscriptionId": 123123123,
        "offerId": "S123123123_PL",
        "customerId": 987654321,
        "customerEmail": "[email protected]",
        "active": true,
        "expirationDate": "2019-03-06T09:43:20+01:00",
        "customerExternalId": "123456789"
    }
}

subscriptionReadyForTermination

Trigger:
The event is triggered whenever a subscription should be terminated.

Use cases:

  • Sending notifications
  • Caching of entiltements
  • Win-back campaigns
  • Payment handling

🚧

subscriptionReadyForTermination is required for recurring payments.

{
    "broadcasterId": 558186818,
    "topic": "subscriptionReadyForTermination",
    "data": {
        "offerType": "subscription",
        "subscriptionId": "332332332",
        "offerId": "S123123123_US",
        "customerId": 123321123,
        "customerEmail": "[email protected]",
        "paymentDetailsId": 665665665,
        "active": true,
        "dunningAttemptDate": "2019-11-04T19:55:41Z",
        "dunningStatus": "capture",
        "expirationDate": "2019-11-07T19:55:41Z",
        "subscriptionExternalId": "I-GHF2VR4V5U98",
        "token": "token_en",
        "customerExternalId": "123456789"
    }
}

subscriptionCreated

Trigger:
The event is triggered whenever a subscription is created.

Use cases:

  • Sending notifications
  • Caching of entitlements
{
    "broadcasterId": 558186818,
    "topic": "subscriptionCreated",
    "data": {
        "offerType": "subscription",
        "subscriptionId": "332332332",
        "offerId": "S123123123_US",
        "customerId": 123321123,
        "customerEmail": "[email protected]",
        "active": true,
        "dunningAttemptDate": "2019-11-04T19:55:41Z",
        "dunningStatus": "capture",
        "expirationDate": "2019-11-07T19:55:41Z",
        "customerExternalId": "123456789",
        "inTrial": false
    }
}

subscriptionTerminated

Trigger:
The event is triggered whenever a subscription is terminated.

Use cases:

  • Sending notifications
  • Caching of entitlements
  • Win-back campaigns
{
    "broadcasterId": 558186818,
    "topic": "subscriptionTerminated",
    "data": {
        "offerType": "subscription",
        "subscriptionId": "332332332",
        "offerId": "S123123123_US",
        "customerId": 123321123,
        "customerEmail": "[email protected]",
        "customerExternalId": "123456789"
    }
}

subscriptionTrialConverted

Trigger:
The event is triggered when a subscription moves out of trial (the trial period ends and the subscription status changes to paid subscription).

Use cases:

  • Sending notifications
  • Caching of entitlements
{
  "broadcasterId": 558186818,
  "topic": "subscriptionTrialConverted",
  "data": {
    "offerType": "subscription",
    "subscriptionId": "332332332",
    "offerId": "S123123123_US",
    "customerId": 123321123,
    "customerExternalId": "ext-123321123",
    "customerEmail": "[email protected]",
    "active": true,
    "expirationDate": "2019-11-07T19:55:41Z"
  }
}

subscriptionSwitched

Trigger:
The event is triggered after a subscription upgrade or downgrade takes place.

The webhook is available for iOS & tvOS, Android and Roku.

{
  "broadcasterId": 558186818,
  "topic": "subscriptionSwitched",
  "data": {
    "direction": "downgrade",
    "customerId": 111222333,
    "fromOfferId": "S653123187_PL",
    "toOfferId": "S278490202_PL",
    "subscriptionId": 123456789
  }
}

Did this page help you?