Zum Hauptinhalt springen

Webhooks

You can listen to various events in the Fynn platform by using webhooks. Webhooks are HTTP callbacks that are triggered when an event occurs. You can use webhooks to receive notifications about events that happen in the Fynn platform.

Register endpoint

The webhook endpoint can be registered in the administration. See Webhooks for more information.

Webhook payload

The webhook payload is a JSON object looking like this:

{
"event": {
"type": "my.webhook.name",
"id": "webhk_1234567890",
"version": "1.0.0",
"created": "2021-05-12T12:00:00.000Z"
},
"tenantId": "ad8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d",
"data": {
"content": "webhook specific content"
}
}

Webhook events

See Webhooks for more information.

Subscription

All subscription events have the following event data body:

{
"id": "ad8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d",
"debitorId": "ad8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d",
"documentNumber": "20210512-1234567890",
"status": "STATUS_ACTIVE", // STATUS_ACTIVE, STATUS_CANCELLED, STATUS_IN_TRIAL
"paymentMethodId": "ad8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d",
"alias": "My subscription", // optional
"createdAt": "2021-05-12T12:00:00.000Z",
"trialEndsOn": "2021-05-12T12:00:00.000Z", // optional
"costCentre": "KOST-123", // optional
"products": [
{
"id": "ad8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d",
"name": "My product",
"description": "My product description",
"customDescription": "My custom product description",
"cancellationDate": "2021-05-12T12:00:00.000Z", // optional
"contractStartDate": "2021-05-12T12:00:00.000Z",
"components": [
{
"id": "ad8d8d8d-8d8d-8d8d-8d8d-8d8d8d8d8d8d",
"name": "My component",
"customDescription": "My component description",
"cancellationDate": "2021-05-12T12:00:00.000Z", // optional
"contractStartDate": "2021-05-12T12:00:00.000Z",
"quantity": 1,
"unitDescription": "Stück"
}
]
}
]
}

Available events

Event nameDescription
subscription.activatedA new subscription was activated and will is in billing now.
subscription.cancelledA subscription was canceled.
subscription.trial.startedA trial subscription was started.
subscription.trial.extendedA trial subscription was extended.
subscription.trial.expiredA trial subscription ended. The subscription will be activated now.
subscription.trial.canceledA trial subscription was canceled. The subscription will not be billed.
subscription.product.cancelledA subscription product was canceled.