Subscription object
This object represents the assignation of plan to one of the customer of your business.
The subscription will then define how a the related customer will be invoiced based on the fixed and usage-based charges belonging to this related plan.
Schema
{
"subscription": {
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac129b",
"lago_customer_id": "99a6094e-199b-4101-896a-54e927ce7bd7",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"canceled_at": "2022-04-29T08:59:51Z",
"created_at": "2022-04-29T08:59:51Z",
"plan_code": "new_code",
"started_at": "2022-04-29T08:59:51Z",
"status": "active",
"name": "display name",
"external_id": "external_id",
"billing_time": "anniversary",
"subscription_at": "2022-04-29T00:00:00Z",
"terminated_at": null,
"previous_plan_code": null,
"next_plan_code": null,
"downgrade_plan_date": null
}
}
Attributes | Description |
---|---|
lago_id String Not null | Unique identifer of the subscription in Lago application |
lago_customer_id String Not null | Unique identifer of the customer in Lago application |
billing_time String Not null | Billing time of the subscription. Possible values- anniversary : Subscription will be billed on each week/month/year anniversary, depending on the plan reccurence- calendar : Subscription at the end of week/month/year. The first subscription billing will be at pro-rata if it is not created at the beginning of the week/month/year |
external_customer_id String Not null | Unique identifer of the customer in your application |
subscription_at String Not null ISO 8601 datetime in UTC | Anniversary date and time of the initial subscription. It is used a the based date to bill subscription with anniversary billing time. |
canceled_at String ISO 8601 datetime in UTC | Cancelation date of the subscription. It's not null when the subscription is canceled |
created_at String Not null ISO 8601 datetime in UTC | Creation date of the subscription |
plan_code String Not null | Code identifying the plan. It matches the code property of one of the plans |
started_at String Not null ISO 8601 datetime in UTC | Start date of the subscription. It could be null if the subscription is pending of canceled |
name String | Subscription display name in Lago application |
external_id String Not null | Unique external identifier of the subscription. Used as an idempotency key. Corresponds to the external_customer_id for subscriptions created before August 8th, 2022. |
status String Not null | Status of the subscription. Possible values- pending : a previous subscription has been downgraded, the current one is waiting for its automatic activation at the end of the billing period.- active : the subscription is currently applied to the customer.- terminated : the subscription is not active anymore- canceled : the subscription has been stopped before its activation. It could happen when two consecutive downgrade have been applied to a customer or when a subscription with a pending one is terminaded. |
terminated_at String ISO 8601 datetime in UTC | Termination date of the subscription. It's not null when the subscription is terminated |
previous_plan_code String | Code identifying the previous plan. |
next_plan_code String | Code identifying the next plan, in case of downgrade. |
downgrade_plan_date String ISO 8601 date | Date when the plan will be downgraded. |
Deprecated attributes
Attributes | Description |
---|---|
subscription_date String Not null ISO 8601 date | Anniversary date of the initial subscription. It is used a the based date to bill subscription with anniversary billing time. |