{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"billing_time": "anniversary",
"name": "Repository A",
"plan_code": "premium",
"plan_amount_cents": 10000,
"plan_amount_currency": "USD",
"status": "active",
"created_at": "2022-08-08T00:00:00Z",
"canceled_at": "2022-09-14T16:35:31Z",
"started_at": "2022-08-08T00:00:00Z",
"ending_at": "2022-10-08T00:00:00Z",
"subscription_at": "2022-08-08T00:00:00Z",
"terminated_at": "2022-09-14T16:35:31Z",
"previous_plan_code": null,
"next_plan_code": null,
"downgrade_plan_date": "2022-04-30",
"trial_ended_at": "2022-08-08T00:00:00Z",
"current_billing_period_started_at": "2022-08-08T00:00:00Z",
"current_billing_period_ending_at": "2022-09-08T00:00:00Z",
"on_termination_credit_note": "credit",
"on_termination_invoice": "generate",
"payment_method": {
"payment_method_type": "provider",
"payment_method_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
},
"consolidate_invoice": true,
"progressive_billing_disabled": false,
"cancellation_reason": "payment_failed",
"activated_at": "2022-08-08T00:00:00Z",
"activation_rules": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"type": "payment",
"timeout_hours": 48,
"status": "pending",
"expires_at": "2022-08-10T00:00:00Z",
"created_at": "2022-08-08T00:00:00Z",
"updated_at": "2022-08-08T00:00:00Z"
}
],
"purchase_order_number": "PO-123",
"payment_term": {
"term_type": "net",
"days": 30,
"day_of_month": 15,
"month_offset": 1
},
"billing_entity_code": "default",
"applied_invoice_custom_sections": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"created_at": "2023-07-06T14:35:58Z",
"invoice_custom_section": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "EU Bank Details",
"code": "eu_bank_details",
"description": "This section contains the bank details for EU customers.",
"details": "Bank Name: Lago Bank, IBAN: FR7630004000031234567890143",
"display_name": "Bank Details:",
"applied_to_organization": true,
"organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"created_at": "2023-07-06T14:35:58Z"
},
"invoice_custom_section_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
}
],
"applicable_usage_thresholds": [
{
"threshold_display_name": "Threshold 1",
"amount_cents": 10000,
"recurring": true
}
],
"entitlements": [
{
"code": "seats",
"name": "Number of seats",
"description": "Number of users of the account",
"privileges": [
{
"code": "max",
"name": "Maximum",
"value_type": "integer",
"config": {},
"value": 15,
"plan_value": 10,
"override_value": 15
},
{
"code": "max_admins",
"name": "Max Admins",
"value_type": "integer",
"config": {},
"value": 5,
"plan_value": 5,
"override_value": null
},
{
"code": "root",
"name": "Allow root user",
"value_type": "boolean",
"config": {},
"value": true,
"plan_value": true,
"override_value": null
},
{
"code": "provider",
"name": "SSO Provider",
"value_type": "select",
"value": "okta",
"plan_value": "google",
"override_value": "okta",
"config": {
"select_options": [
"google",
"okta"
]
}
}
],
"overrides": {
"max": 15,
"provider": "okta"
}
}
]
}The subscription object
This object represents the assignation of plan to one of the customer of your business.
The billing time for the subscription, which can be set as either anniversary or calendar. If not explicitly provided, it will default to calendar. The billing time determines the timing of recurring billing cycles for the subscription. By specifying anniversary, the billing cycle will be based on the specific date the subscription started (billed fully), while calendar sets the billing cycle at the first day of the week/month/year (billed with proration).
calendar, anniversary "anniversary"
The currency of the related plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed.
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JPY, KES, KGS, KHR, KMF, KRW, KYD, KZT, LAK, LBP, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SOS, SRD, STD, SYP, SZL, THB, TJS, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW "USD"
The status of the subscription, which can have the following values:
active: the subscription is currently active and applied to the customer.canceled: the subscription has been stopped before its activation. This can occur when two consecutive downgrades have been applied to a customer, when a subscription with a pending status is terminated, or when a payment-gated subscription fails to be paid (or its activation rule expires) before activation. When caused by payment gating, thecancellation_reasonfield is set.incomplete: the subscription was created with a payment activation rule and is waiting for the gating payment to succeed before it becomesactive. It is automaticallycanceledif the payment fails or the activation rule expires.pending: a previous subscription has been downgraded, and the current one is awaiting automatic activation at the end of the billing period.terminated: the subscription is no longer active.
active, canceled, incomplete, pending, terminated "active"
The anniversary date and time of the initial subscription. This date serves as the basis for billing subscriptions with anniversary billing time. The anniversary_date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
"2022-08-08T00:00:00Z"
When a pay-in-advance subscription is terminated before the end of its billing period, we generate a credit note for the unused subscription time by default. This field allows you to control the behavior of the credit note generation:
credit: A credit note is generated for the unused subscription time. The unused amount is credited back to the customer.refund: A credit note is generated for the unused subscription time. If the invoice is paid or partially paid, the unused paid amount is refunded; any unpaid unused amount is credited back to the customer.offset: A credit note is generated for the unused subscription time. If the invoice is paid or partially paid, the unused paid amount is refunded; any unpaid unused amount is applied to the invoice reducing its amount due.skip: No credit note is generated for the unused subscription time.
Note: This field is only applicable to pay-in-advance plans and will be null for pay-in-arrears plans.
credit, refund, offset, skip "credit"
When a subscription is terminated before the end of its billing period, we generate an invoice for the unbilled usage. This field allows you to control the behavior of the invoice generation:
generate: An invoice is generated for the unbilled usage.skip: No invoice is generated for the unbilled usage.
generate, skip "generate"
Controls whether this subscription is eligible to be grouped with other subscriptions of the same customer on a consolidated recurring invoice.
true(default): the subscription is included in the customer's standard invoice grouping (by billing entity, currency and payment method).false: the subscription is excluded from consolidation and always billed on its own dedicated invoice, regardless of other grouping criteria.
true
Indicates whether progressive billing is switched off for this subscription, regardless of any usage thresholds defined on the plan (including thresholds inherited from a parent plan when the subscription runs on a plan override).
When true, no progressive billing invoice is issued for this subscription.
false
The reason a payment-gated subscription was canceled while still incomplete. Null unless the subscription was canceled before activation.
payment_failed: the gating payment failed.timeout: the activation rule expired before the payment succeeded.manual: the incomplete subscription was canceled on demand, via a terminate request withstatus=incomplete.
payment_failed, timeout, manual "payment_failed"
The date and time when a payment-gated subscription was activated (i.e. moved from incomplete to active once the gating payment succeeded), represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). Null while the subscription is still incomplete.
"2022-08-08T00:00:00Z"