Ryft provides several webhook events related to subscriptions that allow you to stay informed about the status and lifecycle of subscriptions in your account. These webhooks can be used to automate workflows, update your database, or trigger other actions in your system.
We highly recommend using these webhooks, to ensure you can correctly handle different scenarios that may arise with subscriptions, such as renewals, cancellations, and payment failures.
These events are related to the lifecycle of a subscription, including its creation, updates, cancellations, and renewals.
This event is triggered when a subscription is created in your Ryft account. Note that the status of the subscription can be any of the following: Pending, Active, PastDue, depending on how the subscription was created.
{
"id": "ev_XXXXXXXX",
"eventType": "Subscription.created",
"data": {
"id": "sub_XXXXXXXX",
"status": "PastDue",
"customer": {"id": "cus_XXXXXXXX"},
"paymentSessions": {
"initial": {
"id": "ps_XXXXXXXX",
"clientSecret": "ps_XXXXXXXX_secret_XXXXXXXX",
},
"latest": {
"id": "ps_XXXXXXXX",
"clientSecret": "ps_XXXXXXXX_secret_XXXXXXXX",
},
},
"price": {
"amount": 100,
"currency": "GBP",
"interval": {"unit": "Days", "count": 1, "times": 7},
},
"balance": {"amount": 100},
"billingDetail": {
"totalCycles": 7,
"currentCycle": 1,
"currentCycleStartTimestamp": 1758844800,
"currentCycleEndTimestamp": 1758931199,
"billingCycleTimestamp": 1758844800,
"nextBillingTimestamp": 1758952800,
"failureDetail": {"paymentAttempts": 1},
},
"paymentSettings": {
"statementDescriptor": {"descriptor": "Test Descriptor", "city": "London"}
},
"createdTimestamp": 1758897312,
"amount": 100,
"currency": "GBP",
},
"createdTimestamp": 1758897313,
"lastUpdatedTimestamp": 1758897313,
"deliveryStatus": "None",
}