---
title: "Update a subscription"
method: PUT
path: "/subscriptions/{external_id}"
tags: ["subscriptions"]
---

# Update a subscription

`PUT /subscriptions/{external_id}`

This endpoint allows you to update a subscription.

## Query parameters

- `status` 'active' | 'pending'

## Request body

- SubscriptionUpdateInput
  - `status` 'active' | 'pending' — If the field is not defined and multiple `active` and `pending` subscriptions exists, Lago will update the `active` subscription. However, if you wish to update a `pending` subscription, please ensure that you include the `status` attribute with the `pending` value in your request body.
  - `subscription` object, required
    - `name` string, nullable — 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.
    - `ending_at` string, date-time, nullable, required — 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, and use Coordinated Universal Time (UTC).
    - `subscription_at` string, date-time — The start date and time of the subscription. This field can only be modified for pending subscriptions that have not yet started. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
    - `plan_overrides` PlanOverridesObject — Based plan overrides.
      - `amount_cents` integer — The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
      - `amount_currency` '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' | 'SZL' | 'THB' | 'TJS' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW'
      - `description` string — The description on the plan.
      - `invoice_display_name` string — Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the plan will be used as the default display name.
      - `name` string — The name of the plan.
      - `tax_codes` string[] — List of unique code used to identify the taxes.
      - `trial_period` number — The duration in days during which the base cost of the plan is offered for free.
      - `minimum_commitment` MinimumCommitmentInput, nullable — Minimum commitment for this plan.
        - `amount_cents` integer, required — The amount of the minimum commitment in cents.
        - `invoice_display_name` string — Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
        - `tax_codes` string[] — List of unique code used to identify the taxes.
      - `charges` object[] — Additional usage-based charges for this plan.
        - `id` string, uuid — Unique identifier of the charge created by Lago.
        - `billable_metric_id` string, uuid — Unique identifier of the billable metric created by Lago.
        - `code` string — Unique code identifying the charge within the plan.
        - `charge_model` 'dynamic' | 'graduated' | 'graduated_percentage' | 'package' | 'percentage' | 'standard' | 'volume' — Specifies the pricing model used for the calculation of the final fee. It can be any of the following values: - [`dynamic`](https://docs.getlago.com/guide/plans/charges/charge-models/dynamic) - [`graduated_percentage`](https://docs.getlago.com/guide/plans/charges/charge-models/graduated-percentage) - [`graduated`](https://docs.getlago.com/guide/plans/charges/charge-models/graduated) - [`package`](https://docs.getlago.com/guide/plans/charges/charge-models/package) - [`percentage`](https://docs.getlago.com/guide/plans/charges/charge-models/percentage) - [`standard`](https://docs.getlago.com/guide/plans/charges/charge-models/standard) - [`volume`](https://docs.getlago.com/guide/plans/charges/charge-models/volume)
        - `invoice_display_name` string — Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
        - `min_amount_cents` integer — The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
        - `properties` ChargeObjectProperties
          - `grouped_by` string[] — **Deprecated.** Replaced by `pricing_group_keys`. The list of event properties that are used to group the events on the invoice for a `standard` charge model.
          - `pricing_group_keys` string[] — The list of event properties that are used to group the events on the invoice.
          - `graduated_ranges` object[] — Graduated ranges, sorted from bottom to top tiers, used for a `graduated` charge model.
            - `from_value` integer, required — Specifies the lower value of a tier for a `graduated` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
            - `to_value` integer, nullable, required — Specifies the highest value of a tier for a `graduated` charge model. - This value must be higher than the from_value of the same tier. - This value must be null for the last tier.
            - `flat_amount` string, required — The flat amount for a whole tier, excluding tax, for a `graduated` charge model. It is expressed as a decimal value.
            - `per_unit_amount` string, required — The unit price, excluding tax, for a specific tier of a `graduated` charge model. It is expressed as a decimal value.
          - `graduated_percentage_ranges` object[] — Graduated percentage ranges, sorted from bottom to top tiers, used for a `graduated_percentage` charge model.
            - `from_value` integer, required — Specifies the lower value of a tier for a `graduated_percentage` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
            - `to_value` integer, nullable, required — Specifies the highest value of a tier for a `graduated_percentage` charge model. - This value must be higher than the from_value of the same tier. - This value must be null for the last tier.
            - `rate` string, ^[0-9]+.?[0-9]*$, required — The percentage rate that is applied to the amount of each transaction in the tier for a `graduated_percentage` charge model. It is expressed as a decimal value.
            - `flat_amount` string, ^[0-9]+.?[0-9]*$, required — The flat amount for a whole tier, excluding tax, for a `graduated_percentage` charge model. It is expressed as a decimal value.
          - `amount` string — - The unit price, excluding tax, for a `standard` charge model. It is expressed as a decimal value. - The amount, excluding tax, for a complete set of units in a `package` charge model. It is expressed as a decimal value.
          - `free_units` integer — The quantity of units that are provided free of charge for each billing period in a `package` charge model. This field specifies the number of units that customers can use without incurring any additional cost during each billing cycle.
          - `package_size` integer — The quantity of units included in each pack or set for a `package` charge model. It indicates the number of units that are bundled together as a single package or set within the pricing structure.
          - `rate` string — The percentage rate that is applied to the amount of each transaction for a `percentage` charge model. It is expressed as a decimal value.
          - `fixed_amount` string — The fixed fee that is applied to each transaction for a `percentage` charge model. It is expressed as a decimal value.
          - `free_units_per_events` integer, nullable — The count of transactions that are not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the number of transactions that are exempt from the calculation of charges based on the specified percentage rate and fixed fee.
          - `free_units_per_total_aggregation` string, nullable — The transaction amount that is not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the portion of the transaction amount that is exempt from the calculation of charges based on the specified percentage rate and fixed fee.
          - `per_transaction_max_amount` string, ^[0-9]+.?[0-9]*$, nullable — Specifies the maximum allowable spending for a single transaction. Working as a transaction cap.
          - `per_transaction_min_amount` string, ^[0-9]+.?[0-9]*$, nullable — Specifies the minimum allowable spending for a single transaction. Working as a transaction floor.
          - `volume_ranges` object[] — Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model.
            - `from_value` integer, required — Specifies the lower value of a tier for a `volume` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
            - `to_value` integer, nullable, required — Specifies the highest value of a tier for a `volume` charge model. - This value must be higher than the `from_value` of the same tier. - This value must be `null` for the last tier.
            - `flat_amount` string, required — The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
            - `per_unit_amount` string, required — The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
          - `presentation_group_keys` object[] — Groups usage into sub-items on invoices for display only, without affecting pricing or aggregation.
            - `value` string — The event property to group by.
            - `options` object
              - …
        - `filters` ChargeFilterInput[] — List of filters used to apply differentiated pricing based on additional event properties.
          - `invoice_display_name` string, nullable — Specifies the name that will be displayed on an invoice. If no value is set for this field, the values of the filter will be used as the default display name.
          - `properties` ChargeProperties, required
            - `grouped_by` string[] — **Deprecated.** Replaced by `pricing_group_keys`. The list of event properties that are used to group the events on the invoice for a `standard` charge model.
            - `pricing_group_keys` string[] — The list of event properties that are used to group the events on the invoice.
            - `graduated_ranges` object[] — Graduated ranges, sorted from bottom to top tiers, used for a `graduated` charge model.
              - …
            - `graduated_percentage_ranges` object[] — Graduated percentage ranges, sorted from bottom to top tiers, used for a `graduated_percentage` charge model.
              - …
            - `amount` string — - The unit price, excluding tax, for a `standard` charge model. It is expressed as a decimal value. - The amount, excluding tax, for a complete set of units in a `package` charge model. It is expressed as a decimal value.
            - `free_units` integer — The quantity of units that are provided free of charge for each billing period in a `package` charge model. This field specifies the number of units that customers can use without incurring any additional cost during each billing cycle.
            - `package_size` integer — The quantity of units included in each pack or set for a `package` charge model. It indicates the number of units that are bundled together as a single package or set within the pricing structure.
            - `rate` string — The percentage rate that is applied to the amount of each transaction for a `percentage` charge model. It is expressed as a decimal value.
            - `fixed_amount` string — The fixed fee that is applied to each transaction for a `percentage` charge model. It is expressed as a decimal value.
            - `free_units_per_events` integer, nullable — The count of transactions that are not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the number of transactions that are exempt from the calculation of charges based on the specified percentage rate and fixed fee.
            - `free_units_per_total_aggregation` string, nullable — The transaction amount that is not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the portion of the transaction amount that is exempt from the calculation of charges based on the specified percentage rate and fixed fee.
            - `per_transaction_max_amount` string, ^[0-9]+.?[0-9]*$, nullable — Specifies the maximum allowable spending for a single transaction. Working as a transaction cap.
            - `per_transaction_min_amount` string, ^[0-9]+.?[0-9]*$, nullable — Specifies the minimum allowable spending for a single transaction. Working as a transaction floor.
            - `volume_ranges` object[] — Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model.
              - …
          - `values` object, required — List of possible filter values. The key and values must match one of the billable metric filters.
        - `tax_codes` string[] — List of unique code used to identify the taxes.
        - `applied_pricing_unit` object — Updates the pricing unit conversion rate for this charge. Only applies if the charge has applied pricing unit.
          - `conversion_rate` string — The conversion rate from pricing units to the plan's currency. This rate determines how many currency units (in the plan's base currency) equal one pricing unit. For example, if the plan uses USD and the conversion rate is 0.5, then 1 pricing unit = $0.50 USD.
      - `fixed_charges` object[] — Fixed charge overrides for the subscription. When `plan_overrides` contains only `fixed_charges` and every entry contains only `id`, `units`, and optionally `apply_units_immediately`, the units are recorded as a per-subscription override without creating a plan override, and subscription-scoped reads return these units. If any entry carries other fields, or `plan_overrides` contains any other key, the request is applied as a full plan override for the subscription instead.
        - `id` string, uuid, required — Unique identifier of the fixed charge created by Lago.
        - `invoice_display_name` string — Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
        - `units` number — The number of units for the fixed charge. Defaults to 0 if not provided.
        - `apply_units_immediately` boolean — Determines if the units should be applied immediately upon assignment or deferred to the next billing cycle.
        - `properties` FixedChargeProperties
          - `amount` string — - The unit price, excluding tax, for a `standard` charge model. It is expressed as a decimal value. - The amount, excluding tax, for a complete set of units in a `package` charge model. It is expressed as a decimal value.
          - `graduated_ranges` object[] — Graduated ranges, sorted from bottom to top tiers, used for a `graduated` charge model.
            - `from_value` integer, required — Specifies the lower value of a tier for a `graduated` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
            - `to_value` integer, nullable, required — Specifies the highest value of a tier for a `graduated` charge model. - This value must be higher than the from_value of the same tier. - This value must be null for the last tier.
            - `flat_amount` string, required — The flat amount for a whole tier, excluding tax, for a `graduated` charge model. It is expressed as a decimal value.
            - `per_unit_amount` string, required — The unit price, excluding tax, for a specific tier of a `graduated` charge model. It is expressed as a decimal value.
          - `volume_ranges` object[] — Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model.
            - `from_value` integer, required — Specifies the lower value of a tier for a `volume` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
            - `to_value` integer, nullable, required — Specifies the highest value of a tier for a `volume` charge model. - This value must be higher than the `from_value` of the same tier. - This value must be `null` for the last tier.
            - `flat_amount` string, required — The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
            - `per_unit_amount` string, required — The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
        - `tax_codes` string[] — List of unique code used to identify the taxes.
      - `usage_thresholds` UsageThresholdInput[] — List of usage thresholds applied to the subscription.
        - `threshold_display_name` string, nullable — The display name of the usage threshold.
        - `amount_cents` integer, required — The amount to reach to trigger a `progressive_billing` invoice.
        - `recurring` boolean — This field when set to `true` indicates that a `progressive_billing` invoice will be created every time the lifetime usage increases by the specified amount.
      - `metadata` MetadataInput — Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
    - `invoice_custom_section` InvoiceCustomSectionInput — Configuration for invoice custom sections to apply to invoices generated by this resource.
      - `skip_invoice_custom_sections` boolean — Set to `true` to exclude all invoice custom sections from PDF generation for invoices related to this resource. When `true`, `invoice_custom_section_codes` is ignored.
      - `invoice_custom_section_codes` string[] — List of unique codes identifying the invoice custom sections to apply. These override the default invoice custom sections configured at the customer or billing entity level.
    - `payment_method` PaymentMethodReference — Reference to a specific payment method for processing the payment.
      - `payment_method_type` 'provider' | 'manual' — The type of payment method to use.
      - `payment_method_id` string, uuid — The unique identifier of the payment method (required when using a specific provider payment method).
    - `consolidate_invoice` boolean — Defines whether this subscription should be grouped with other subscriptions of the same customer when generating recurring invoices. - `true`: 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.
    - `billing_entity_code` string — The code of the billing entity associated with the subscription. Updates take effect on future invoices only.
    - `activation_rules` SubscriptionActivationRuleInput[] — Optional list of activation rules that gate the subscription activation. Activation rules can only be set or modified while the subscription is `pending` (future-dated and not yet activated); the request is rejected for `incomplete`, `active`, or `terminated` subscriptions.
      - `type` 'payment', required — The type of the activation rule. Only `payment` is currently supported. A `payment` rule gates the subscription activation on a successful payment of the first invoice.
      - `timeout_hours` integer — The number of hours the subscription stays in the `incomplete` state waiting for the payment to succeed before it is automatically canceled. Must be a positive integer or zero.

## Response `200`

Subscription updated

- Subscription
  - `subscription` SubscriptionObject, required
    - `lago_id` string, uuid, 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
    - `external_id` string, required — The subscription external unique identifier (provided by your own application).
    - `lago_customer_id` string, uuid, 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
    - `external_customer_id` string, required — The customer external unique identifier (provided by your own application).
    - `billing_entity_code` string — The code of the billing entity associated with the subscription.
    - `billing_time` 'calendar' | 'anniversary', 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).
    - `name` string, nullable, 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.
    - `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.
    - `plan_amount_cents` integer — The base cost of the related plan, excluding any applicable taxes, that is billed on a recurring basis.
    - `plan_amount_currency` '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' | 'SZL' | 'THB' | 'TJS' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW'
    - `status` 'active' | 'canceled' | 'incomplete' | 'pending' | 'terminated', required — 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, the `cancellation_reason` field is set. - `incomplete`: the subscription was created with a payment activation rule and is waiting for the gating payment to succeed before it becomes `active`. It is automatically `canceled` if 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.
    - `created_at` string, date-time, required — The creation date of the subscription, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). This date provides a timestamp indicating when the subscription was initially created.
    - `canceled_at` string, date-time, nullable, required — 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 and expressed in Coordinated Universal Time (UTC).
    - `started_at` string, date-time, nullable, 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 and expressed in Coordinated Universal Time (UTC).
    - `ending_at` string, date-time, nullable, required — 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, and use Coordinated Universal Time (UTC).
    - `subscription_at` string, date-time, 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 and expressed in Coordinated Universal Time (UTC).
    - `terminated_at` string, date-time, nullable, required — 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 and expressed in Coordinated Universal Time (UTC)
    - `previous_plan_code` string, nullable, required — The code identifying the previous plan associated with this subscription.
    - `next_plan_code` string, nullable, required — The code identifying the next plan in the case of a downgrade.
    - `downgrade_plan_date` string, date, nullable, required — The date when the plan will be downgraded, represented in ISO 8601 date format.
    - `trial_ended_at` string, date-time, nullable, required — The date when the free trial is ended, represented in ISO 8601 date format.
    - `current_billing_period_started_at` string, date-time, nullable, required — The date and time when the current billing period started, represented in ISO 8601 date format.
    - `current_billing_period_ending_at` string, date-time, nullable, required — The date and time when the current billing period ends, represented in ISO 8601 date format.
    - `on_termination_credit_note` 'credit' | 'refund' | 'offset' | 'skip', nullable, required — 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._
    - `on_termination_invoice` 'generate' | 'skip', required — 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.
    - `applied_invoice_custom_sections` AppliedInvoiceCustomSectionObject[] — The invoice custom sections applied to invoices generated by this subscription.
      - `lago_id` string, uuid, required — Unique identifier of the applied invoice custom section in the Lago application.
      - `created_at` string, date-time, required — The date of the applied invoice custom section creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
      - `invoice_custom_section_id` string, uuid — **Deprecated.** Unique identifier of the invoice custom section that was applied.
      - `invoice_custom_section` InvoiceCustomSectionObject, required
        - `lago_id` string, uuid, required — Unique identifier for the invoice custom section in the Lago application, generated by Lago to ensure record uniqueness within the system.
        - `name` string, required — Name of the invoice custom section.
        - `code` string, required — Unique code identifying the invoice custom section for the API request.
        - `description` string — Internal description of the invoice custom section.
        - `details` string — The value shown on the invoice PDF.
        - `display_name` string — The name of the invoice custom section displayed on the invoice.
        - `applied_to_organization` boolean — **Deprecated.** This field will be removed in a future version. When set to true, it applies the invoice custom section to the organization's default billing entity. To apply or remove an invoice custom section from any billing entity (including the default one), please use the `PUT /billing_entities/:code` endpoint instead.
        - `organization_id` string, uuid — Unique identifier for the organization associated with the invoice custom section.
        - `created_at` string, date-time — Creation date of the tax.
    - `payment_method` PaymentMethodReference — Reference to a specific payment method for processing the payment.
      - `payment_method_type` 'provider' | 'manual' — The type of payment method to use.
      - `payment_method_id` string, uuid — The unique identifier of the payment method (required when using a specific provider payment method).
    - `consolidate_invoice` boolean — 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.
    - `cancellation_reason` 'payment_failed' | 'timeout', nullable — The reason a payment-gated subscription was canceled before activation. Null unless the subscription was canceled by payment gating. - `payment_failed`: the gating payment failed. - `timeout`: the activation rule expired before the payment succeeded.
    - `activated_at` string, date-time, nullable — 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`.
    - `activation_rules` SubscriptionActivationRuleObject[] — The activation rules attached to the subscription. A payment activation rule gates activation on a successful first payment, keeping the subscription in the `incomplete` state until the payment succeeds or the rule expires.
      - `lago_id` string, uuid, required — Unique identifier assigned to the activation rule within the Lago application. This ID is exclusively created by Lago.
      - `type` 'payment', required — The type of the activation rule. Only `payment` is currently supported. A `payment` rule gates the subscription activation on a successful payment of the first invoice.
      - `timeout_hours` integer, required — The number of hours the subscription stays in the `incomplete` state waiting for the payment to succeed before it is automatically canceled.
      - `status` 'inactive' | 'pending' | 'satisfied' | 'declined' | 'failed' | 'expired' | 'not_applicable', required — The evaluation status of the activation rule: - `inactive`: the rule has not been evaluated yet. - `pending`: the rule is applicable and is waiting to be satisfied (e.g. waiting for the payment). - `satisfied`: the rule has been satisfied and no longer blocks activation. - `declined`: the rule was applicable but was declined. - `failed`: the rule could not be satisfied (e.g. the payment failed). - `expired`: the rule was not satisfied before its timeout elapsed. - `not_applicable`: the rule did not apply to this subscription.
      - `expires_at` string, date-time, nullable — The date and time when the rule expires, after which an unsatisfied rule causes the subscription to be canceled. Represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). Null until the rule starts being evaluated.
      - `created_at` string, date-time, required — The creation date of the activation rule, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
      - `updated_at` string, date-time, required — The last update date of the activation rule, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).

## Other responses

- `400` — Bad Request error
- `401` — Unauthorized error
- `404` — Not Found error
- `422` — Unprocessable entity error

---

[API](https://skmtc.dev/getlago/apis/lago-api-documentation.md) · [All operations](https://skmtc.dev/getlago/apis/lago-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getlago/lago-api-documentation/revisions/6e969ef3bb45/schema)
