{
  "subscription": {
    "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",
    "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",
    "plan": {
      "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
      "name": "Startup",
      "invoice_display_name": "Startup plan",
      "created_at": "2023-06-27T19:43:42Z",
      "code": "startup",
      "interval": "monthly",
      "description": "",
      "amount_cents": 10000,
      "amount_currency": "USD",
      "trial_period": 5,
      "pay_in_advance": true,
      "bill_charges_monthly": null,
      "active_subscriptions_count": 0,
      "draft_invoices_count": 0,
      "minimum_commitment": {
        "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "plan_code": "premium",
        "amount_cents": 100000,
        "invoice_display_name": "Minimum Commitment (C1)",
        "interval": "monthly",
        "created_at": "2022-04-29T08:59:51Z",
        "updated_at": "2022-04-29T08:59:51Z",
        "taxes": [
          {
            "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "name": "TVA",
            "code": "french_standard_vat",
            "description": "French standard VAT",
            "rate": 20,
            "applied_to_organization": true,
            "add_ons_count": 0,
            "charges_count": 0,
            "customers_count": 0,
            "plans_count": 0,
            "created_at": "2023-07-06T14:35:58Z"
          }
        ]
      },
      "charges": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a91",
          "lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a91",
          "billable_metric_code": "requests",
          "created_at": "2023-06-27T19:43:42Z",
          "charge_model": "package",
          "invoiceable": true,
          "invoice_display_name": "Setup",
          "pay_in_advance": false,
          "prorated": false,
          "min_amount_cents": 3000,
          "properties": {
            "amount": "30",
            "free_units": 100,
            "package_size": 1000
          },
          "filters": []
        },
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a92",
          "lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a92",
          "billable_metric_code": "cpu",
          "created_at": "2023-06-27T19:43:42Z",
          "charge_model": "graduated",
          "invoiceable": true,
          "invoice_display_name": "Setup",
          "pay_in_advance": false,
          "prorated": false,
          "min_amount_cents": 0,
          "properties": {
            "graduated_ranges": [
              {
                "from_value": 0,
                "to_value": 10,
                "flat_amount": "10",
                "per_unit_amount": "0.5"
              },
              {
                "from_value": 11,
                "to_value": null,
                "flat_amount": "0",
                "per_unit_amount": "0.4"
              }
            ]
          },
          "filters": []
        },
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a93",
          "lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a93",
          "billable_metric_code": "seats",
          "created_at": "2023-06-27T19:43:42Z",
          "charge_model": "standard",
          "invoiceable": true,
          "invoice_display_name": "Setup",
          "pay_in_advance": true,
          "prorated": false,
          "min_amount_cents": 0,
          "properties": {},
          "filters": [
            {
              "invoice_display_name": "Europe",
              "properties": {
                "amount": "10"
              },
              "values": {
                "region": [
                  "Europe"
                ]
              }
            },
            {
              "invoice_display_name": "USA",
              "properties": {
                "amount": "5"
              },
              "values": {
                "region": [
                  "USA"
                ]
              }
            },
            {
              "invoice_display_name": "Africa",
              "properties": {
                "amount": "8"
              },
              "values": {
                "region": [
                  "Africa"
                ]
              }
            }
          ]
        },
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
          "lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
          "billable_metric_code": "storage",
          "created_at": "2023-06-27T19:43:42Z",
          "charge_model": "volume",
          "invoiceable": true,
          "invoice_display_name": "Setup",
          "pay_in_advance": false,
          "prorated": false,
          "min_amount_cents": 0,
          "properties": {
            "volume_ranges": [
              {
                "from_value": 0,
                "to_value": 100,
                "flat_amount": "0",
                "per_unit_amount": "0"
              },
              {
                "from_value": 101,
                "to_value": null,
                "flat_amount": "0",
                "per_unit_amount": "0.5"
              }
            ]
          },
          "filters": []
        },
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a95",
          "lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a95",
          "billable_metric_code": "payments",
          "created_at": "2023-06-27T19:43:42Z",
          "charge_model": "percentage",
          "invoiceable": false,
          "invoice_display_name": "Setup",
          "pay_in_advance": true,
          "prorated": false,
          "min_amount_cents": 0,
          "properties": {
            "rate": "1",
            "fixed_amount": "0.5",
            "free_units_per_events": 5,
            "free_units_per_total_aggregation": "500"
          },
          "filters": []
        }
      ],
      "taxes": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "name": "TVA",
          "code": "french_standard_vat",
          "description": "French standard VAT",
          "rate": 20,
          "applied_to_organization": true,
          "add_ons_count": 0,
          "charges_count": 0,
          "customers_count": 0,
          "plans_count": 0,
          "created_at": "2023-07-06T14:35:58Z"
        }
      ]
    }
  }
}

Attributes

subscription
object
lago_id
string
required

Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s record within the Lago system.

lago_customer_id
string
required

Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer’s record within the Lago system.

billing_time
string
required

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).

external_customer_id
string
required

The customer external unique identifier (provided by your own application).

external_id
string
required

The subscription external unique identifier (provided by your own application).

subscription_at
string
required

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 in seconds and expressed in Coordinated Universal Time (UTC).

canceled_at
string

The cancellation date of the subscription. This field is not null when the subscription is canceled. This date should be provided in ISO 8601 datetime format in seconds and expressed in Coordinated Universal Time (UTC).

created_at
string
required

The creation date of the subscription, represented in ISO 8601 datetime format in seconds and expressed in Coordinated Universal Time (UTC). This date provides a timestamp indicating when the subscription was initially created.

plan_code
string
required

The unique code representing the plan to be attached to the customer. This code must correspond to the code property of one of the active plans.

started_at
string
required

The effective start date of the subscription. This field can be null if the subscription is pending or canceled. This date should be provided in ISO 8601 datetime format in seconds and expressed in Coordinated Universal Time (UTC).

ending_at
string

The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format in seconds and expressed in Coordinated Universal Time (UTC).

name
string
required

The display name of the subscription on an invoice. This field allows for customization of the subscription’s name for billing purposes, especially useful when a single customer has multiple subscriptions using the same plan.

status
string
required

The status of the subscription, which can have the following values: - pending: a previous subscription has been downgraded, and the current one is awaiting automatic activation at the end of the billing period. - active: the subscription is currently active and applied to the customer. - terminated: the subscription is no longer active. - canceled: the subscription has been stopped before its activation. This can occur when two consecutive downgrades have been applied to a customer or when a subscription with a pending status is terminated.

terminated_at
string

The termination date of the subscription. This field is not null when the subscription is terminated. This date should be provided in ISO 8601 datetime format in seconds and expressed in Coordinated Universal Time (UTC)

previous_plan_code
string

The code identifying the previous plan associated with this subscription.

next_plan_code
string

The code identifying the next plan in the case of a downgrade.

downgrade_plan_date
string

The date when the plan will be downgraded, represented in ISO 8601 date format.

trial_ended_at
string

The expiration date of the free trial, formatted in ISO 8601 standard.

plan
object