Webhooks

Subscription Created

The event is triggered when a new subscription (app, main…) is created

Webhook authorization: using an app, a business or a directory token.

Subscribing to the Subscription Created webhook:

curl --location --request POST '/platform/v1/webhook/subscribe' \
--header 'Authorization: "Bearer API_TOKEN"'\
--header 'Content-Type: application/json' \
--data-raw '{
"event": "subscription/create",
"target_url": "URL"
}'

Subscription Created Payload Example:

{
  "entity_name": "subscription",
  "event_type": "created",
  "data": {
    "uid": "c33f32c-95ae-4e8f-9f65-18bba589cb43",
    "created_at": "2024-01-01T09:00:00Z",
    "updated_at": "2024-03-20T12:34:56Z",
    "display_name": "Premium 10",
    "is_active": true,
    "offering_uid": "bc33f12d-98ee-428f-9f65-18bba589cb95",
    "offering_type": "package",
    "purchase_state": "purchased",
    "cancellation_date": "",
    "expiration_date": "",
    "buyer_uid": "user_12345",
    "business_uid": "biz_67890",
    "purchase_price": 99.99,
    "purchase_currency": "USD",
    "payment_type": "monthly",
    "bundled_from_subscription_uid": "",
    "charged_by": "platform",
    "trial_type": "no_trial",
    "next_charge_date": "2025-03-20T12:34:56Z"
  }
}

Subscription Updated

The event is triggered when a subscription (app, main…) is updated.

Webhook authorization: using an app, a business or a directory token.

📘

To get the subscription’s current data, you need to call the GET subscription API

Subscribing to the Subscription Update webhook:

curl --location --request POST '/platform/v1/webhook/subscribe' \
--header 'Authorization: "Bearer API_TOKEN"'\
--header 'Content-Type: application/json' \
--data-raw '{
"event": "subscription/updated",
"target_url": "URL"
}'

Subscription Update Payload Example:

{
  "entity_name": "subscription",
  "event_type": "update",
  "data": {
    "uid": "c33f32c-95ae-4e8f-9f65-18bba589cb43",
    "created_at": "2024-01-01T09:00:00Z",
    "updated_at": "2024-03-20T12:34:56Z",
    "display_name": "Premium 10",
    "is_active": true,
    "offering_uid": "bc33f12d-98ee-428f-9f65-18bba589cb95",
    "offering_type": "package",
    "purchase_state": "purchased",
    "cancellation_date": "",
    "expiration_date": "",
    "buyer_uid": "user_12345",
    "business_uid": "biz_67890",
    "purchase_price": 99.99,
    "purchase_currency": "USD",
    "payment_type": "monthly",
    "bundled_from_subscription_uid": "",
    "charged_by": "platform",
    "trial_type": "no_trial",
    "next_charge_date": "2025-03-20T12:34:56Z"
  }
}