> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperline.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create subscription transition

> Transition a subscription to another subscription, configured from a subscription, a plan or a template. If the application_schedule is `immediately`, the transition is applied right away.



## OpenAPI

````yaml post /v2/subscriptions/transitions
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v2/subscriptions/transitions:
    post:
      tags:
        - Subscriptions > Transitions
      summary: Create subscription transition
      description: >-
        Transition a subscription to another subscription, configured from a
        subscription, a plan or a template. If the application_schedule is
        `immediately`, the transition is applied right away.
      operationId: createSubscriptionTransition
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                source_subscription_id:
                  type: string
                  description: The ID of the subscription to transition from
                name:
                  type: string
                  description: An optional name for the transition
                calculation_method:
                  type: string
                  enum:
                    - do_not_charge
                    - pro_rata
                  description: >-
                    The calculation method to use for the transition.
                    'do_not_charge' will not generate any transition invoice.
                    'pro_rata' will generate a prorated invoice for the
                    remaining period.
                billing_cycle_transition_method:
                  type: string
                  enum:
                    - keep_current_billing_cycle
                    - align_to_new_billing_cycle
                  description: >-
                    The billing cycle transition method to use.
                    'keep_current_billing_cycle' will keep the current billing
                    cycle dates if possible. 'align_to_new_billing_cycle' will
                    align the billing cycle to the transition date.
                application_schedule:
                  type: string
                  enum:
                    - scheduled
                    - immediately
                  description: >-
                    Whether the transition should be applied 'immediately' or
                    'scheduled' for a specific date. Past dates within the
                    current billing period are supported and will be applied
                    immediately.
                transition_date:
                  type: string
                  format: date-time
                  description: >-
                    The date at which the transition should occur. Only
                    applicable if the application schedule is 'scheduled'. Can
                    be a past date within the current billing period. UTC date
                    time string in the [ISO
                    8601](https://en.wikipedia.org/wiki/ISO_8601) format.
                  example: '2024-12-20T16:04:11Z'
                target_subscription:
                  allOf:
                    - type: object
                      properties:
                        name:
                          type: string
                          description: Subscription custom name.
                        purchase_order:
                          type: string
                          description: Reference to the purchase order.
                        invoicing_entity_id:
                          type: string
                          description: >-
                            ID of the invoicing entity attached to the
                            subscription. If not defined, fallback to customer's
                            invoicing entity.
                          example: ive_jerrb484RHn
                        crm_opportunity_id:
                          type: string
                          description: >-
                            ID of the related opportunity/deal in the connected
                            CRM.
                        commitment_interval:
                          type: object
                          properties:
                            period:
                              type: string
                              enum:
                                - days
                                - weeks
                                - months
                                - years
                            count:
                              type: number
                              minimum: 1
                          required:
                            - period
                            - count
                          description: Deprecated field, please use `contract_terms`.
                          example:
                            period: years
                            count: 1
                          deprecated: true
                        renew_for:
                          type: object
                          properties:
                            period:
                              type: string
                              enum:
                                - days
                                - weeks
                                - months
                                - years
                            count:
                              type: number
                          required:
                            - period
                            - count
                          description: Deprecated field, please use `contract_terms`.
                          example:
                            period: years
                            count: 1
                          deprecated: true
                        minimum_invoice_fee:
                          type:
                            - number
                            - 'null'
                          description: >-
                            Minimum fee applied to each invoice outside of one
                            time payments.
                          example: 250
                        contract_terms:
                          allOf:
                            - type: object
                              properties:
                                starts_at:
                                  type: string
                                  format: date-time
                                  description: >-
                                    Start date of the contract. UTC date time
                                    string in the [ISO
                                    8601](https://en.wikipedia.org/wiki/ISO_8601)
                                    format.
                                  example: '2024-12-20T16:04:11Z'
                                ends_at:
                                  type: string
                                  format: date-time
                                  description: >-
                                    End date of the contract. UTC date time
                                    string in the [ISO
                                    8601](https://en.wikipedia.org/wiki/ISO_8601)
                                    format.
                                  example: '2024-12-20T16:04:11Z'
                                duration:
                                  type: object
                                  properties:
                                    period:
                                      type: string
                                      enum:
                                        - days
                                        - weeks
                                        - months
                                        - years
                                    count:
                                      type: integer
                                      minimum: 1
                                      default: 1
                                  required:
                                    - period
                                  description: >-
                                    Interval over which the contract initially
                                    spans. Only applies to `duration` end
                                    strategy.
                                  example:
                                    count: 6
                                    period: months
                                renew_automatically:
                                  anyOf:
                                    - type: boolean
                                    - type: string
                                      enum:
                                        - 'true'
                                        - 'false'
                                  description: >

                                    Indicates if the contract should be renewed
                                    automatically.


                                    - `true`: The contract will be renewed
                                    automatically.

                                    - `false`: The contract will not be renewed
                                    automatically.
                                  example: true
                                renew_for_duration:
                                  type: object
                                  properties:
                                    period:
                                      type: string
                                      enum:
                                        - days
                                        - weeks
                                        - months
                                        - years
                                    count:
                                      type: integer
                                      minimum: 1
                                      default: 1
                                  required:
                                    - period
                                  description: >

                                    Interval over which the contract will be
                                    renewed. Only applies if
                                    `renew_automatically` is true.
                                  example:
                                    count: 1
                                    period: years
                            - type: object
                              properties:
                                activation_strategy:
                                  type: string
                                  enum:
                                    - start_date
                                    - immediately
                                    - manual
                                    - quote_signature
                                    - checkout
                                  description: >

                                    Activation strategy of the contract.


                                    - `immediately`: The contract will be
                                    activated immediately.

                                    - `manual`: The contract will be activated
                                    when a user manually activates it.

                                    - `start_date`: The contract will be
                                    activated on a specified date.

                                    - `quote_signature`: The contract will be
                                    activated when the subscription quote is
                                    signed.

                                    - `checkout`: The contract will be activated
                                    when the subscription checkout is completed.
                                  example: start_date
                                end_strategy:
                                  type: string
                                  enum:
                                    - end_date
                                    - duration
                                    - manual
                                  description: >

                                    End strategy of contract.


                                    - `manual`: The contract ends when a user
                                    manually stops it.

                                    - `end_date`: The contract ends on a
                                    specified date.

                                    - `duration`: The contract ends after a
                                    specific relative duration, unless
                                    `renew_automatically` is true.
                                  example: duration
                              required:
                                - activation_strategy
                                - end_strategy
                          description: Contract terms linked to the subscription.
                        starts_at:
                          type: string
                          format: date-time
                          description: >-
                            Applies only if the activation strategy is
                            `start_date`. UTC date time string in the [ISO
                            8601](https://en.wikipedia.org/wiki/ISO_8601)
                            format.
                          example: '2024-12-20T16:04:11Z'
                        contract_start:
                          type: string
                          format: date-time
                          description: Deprecated field, please use `contract_terms`.
                          example: '2024-01-15T00:00:00Z'
                          deprecated: true
                        contract_end:
                          type: string
                          format: date-time
                          description: Deprecated field, please use `contract_terms`.
                          example: '2025-01-15T00:00:00Z'
                          deprecated: true
                        initial_billing_at:
                          type: string
                          format: date-time
                          description: >-
                            Date when the subscription will start being billed.
                            If not specified, it will correspond to the
                            `starts_at` date. UTC date time string in the [ISO
                            8601](https://en.wikipedia.org/wiki/ISO_8601)
                            format.
                          example: '2024-12-20T16:04:11Z'
                        display_shipping_details:
                          anyOf:
                            - type: boolean
                            - type: string
                              enum:
                                - 'true'
                                - 'false'
                          description: >-
                            Indicates if the shipping details should be
                            displayed on the subscription's invoices.
                        cancel_at:
                          type: string
                          format: date-time
                          description: >-
                            Subscription cancel date. UTC date time string in
                            the [ISO
                            8601](https://en.wikipedia.org/wiki/ISO_8601)
                            format.
                          example: '2024-12-20T16:04:11Z'
                        cancellation_strategy:
                          type: string
                          enum:
                            - refund_prorata
                            - refund_custom
                            - charge_prorata
                            - charge_custom
                            - end_of_period
                            - do_nothing
                          description: >

                            Strategy used to cancel the subscription. If not
                            specified `do_nothing` is used.


                            - `charge_prorata`: Will charge the customer the
                            unpaid amount for the prorated period up to the end
                            of the current period.

                            - `charge_custom`: Will charge the customer a custom
                            amount.

                            - `refund_prorata`: Will refund to the customer the
                            overpaid subscription amount using prorated
                            calculations on the cancellation date.

                            - `refund_custom`: Will refund to the customer a
                            custom amount.

                            - `end_of_period`: Will cancel the subscription at
                            the end date of the current billing period.

                            - `do_nothing`: Will only cease the subscription
                            without any additional actions.
                        cancellation_amount:
                          type: number
                          description: >-
                            Custom amount used when cancelling the subscription.
                            Only applies to the `charge_custom` or the
                            `refund_custom` cancellation strategy.
                        cancellation_refund_method:
                          type: string
                          enum:
                            - wallet
                            - original_payment_method
                            - external
                          description: >-
                            Override the refund destination for credit notes
                            generated by `refund_prorata` / `refund_custom`
                            cancellation strategies. When omitted, falls back to
                            the invoicing entity's
                            `creditNoteWalletRefundEnabled` setting.
                        properties:
                          type: object
                          additionalProperties:
                            anyOf:
                              - type: string
                              - type: number
                              - type: boolean
                              - type: 'null'
                              - type: array
                                items:
                                  anyOf:
                                    - type: string
                                    - type: number
                                    - type: boolean
                                    - type: 'null'
                                    - type: 'null'
                              - type: 'null'
                          description: >-
                            Key/value pairs to store any metadata useful in your
                            context.
                        custom_properties:
                          type: object
                          additionalProperties:
                            anyOf:
                              - type: string
                              - type: number
                              - type: boolean
                              - type: string
                                format: date-time
                                description: >-
                                  UTC date time string in the [ISO
                                  8601](https://en.wikipedia.org/wiki/ISO_8601)
                                  format.
                                example: '2024-12-20T16:04:11Z'
                              - type: array
                                items:
                                  type: string
                              - type: 'null'
                          description: >-
                            A list of key value with the slug of the custom
                            property as the key and the custom property value as
                            value.
                        tax_only:
                          anyOf:
                            - type: boolean
                            - type: string
                              enum:
                                - 'true'
                                - 'false'
                          description: Only tax will be charged on this subscription.
                        generate_draft_invoices:
                          anyOf:
                            - type: boolean
                            - type: string
                              enum:
                                - 'true'
                                - 'false'
                          description: >-
                            Generate draft invoices for the subscription. Each
                            invoice will need to be reviewed and validated
                            manually before being sent
                        generate_document:
                          anyOf:
                            - type: boolean
                            - type: string
                              enum:
                                - 'true'
                                - 'false'
                          description: Generate non-legal documents instead of invoices.
                        document_name:
                          type:
                            - string
                            - 'null'
                          description: >-
                            If `generate_document` is turned on, allows you to
                            give a name to your document.
                        add_tax_to_document:
                          anyOf:
                            - type: boolean
                            - type: string
                              enum:
                                - 'true'
                                - 'false'
                          description: >-
                            If `generate_document` is turned on, will add taxes
                            to document.
                        do_not_charge_subscription:
                          anyOf:
                            - type: boolean
                            - type: string
                              enum:
                                - 'true'
                                - 'false'
                          description: >-
                            Subscription will be invoiced but not charged
                            (invoices/documents will be settled directly).
                        invoice_custom_note:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Default custom note added to invoices generated by
                            the subscription.
                        invoice_schedule:
                          type:
                            - string
                            - 'null'
                          enum:
                            - period_start
                            - period_end
                          description: >

                            Defines when invoices are generated relative to the
                            billing period.


                            - `period_start`: Invoices are generated at the
                            start of the billing period.

                            - `period_end`: Invoices are generated at the end of
                            the billing period.
                    - type: object
                      properties:
                        plan_id:
                          type: string
                          description: ID of the plan that the subscription is linked to.
                          example: plan_zHmjoDee4ZRmQV
                          deprecated: true
                        template_id:
                          type: string
                          description: >-
                            ID of the template that the subscription is linked
                            to.
                          example: subt_7gdusOkqr5L0B8
                        template_configuration_id:
                          type: string
                          description: >-
                            ID of the template configuration that the
                            subscription is linked to.
                          example: subtc_7mHWOlPStUogvp
                    - anyOf:
                        - type: object
                          properties:
                            phases:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                    description: Name of the subscription phase.
                                    example: Name of the subscription phase.
                                  type:
                                    type: string
                                    enum:
                                      - setup
                                      - trial
                                      - standard
                                    default: standard
                                    description: >

                                      Type of subscription phase.


                                      - `setup`: The phase represents a
                                      non-recurring service setup period, often
                                      used before the actual recurring
                                      subscription begins.

                                      - `trial`: The phase represents a
                                      non-recurring trial period, often used to
                                      allow users to opt out or experience a
                                      free test.

                                      - `standard`: The phase represents a
                                      standard recurring billing.
                                    example: standard
                                  status:
                                    type: string
                                    enum:
                                      - finished
                                      - pending
                                    default: pending
                                    description: >

                                      Status of subscription phase.


                                      - `pending`: The phase is waiting to start
                                      (not started yet).

                                      - `active`: The phase is currently in
                                      progress.

                                      - `finished`: The phase has ended and is
                                      complete.
                                    example: pending
                                  order:
                                    type: number
                                    description: >-
                                      Order in which the phase is executed
                                      within all subscription phases.
                                    example: 0
                                  activation_strategy:
                                    type: string
                                    enum:
                                      - immediately
                                      - manual
                                      - start_date
                                      - quote_signature
                                      - checkout
                                      - contract_start_date
                                      - previous_phase_end
                                    description: >

                                      Activation strategy of subscription phase.


                                      - `immediately`: The phase starts as soon
                                      as the subscription is activated.

                                      - `manual`: The phase starts when a user
                                      manually activates it.

                                      - `start_date`: The phase starts on a
                                      specified date.

                                      - `quote_signature`: The phase starts when
                                      the subscription quote is signed.

                                      - `checkout`: The phase starts when the
                                      subscription checkout is completed.

                                      - `contract_start_date`: The phase starts
                                      on the start date of the related
                                      subscription contract.

                                      - `previous_phase_end`: The phase starts
                                      when the previous phase ends.
                                    example: manual
                                  end_strategy:
                                    type: string
                                    enum:
                                      - manual
                                      - end_date
                                      - duration
                                      - contract_end_date
                                    description: >

                                      End strategy of subscription phase.


                                      - `manual`: The phase ends when a user
                                      manually stops it.

                                      - `end_date`: The phase ends on a
                                      specified date.

                                      - `duration`: The phase ends after a
                                      specific relative duration.

                                      - `contract_end_date`: The phase ends on
                                      the end date of the related subscription
                                      contract.
                                    example: duration
                                  duration:
                                    type: object
                                    properties:
                                      period:
                                        type: string
                                        enum:
                                          - days
                                          - weeks
                                          - months
                                          - years
                                      count:
                                        type: integer
                                        minimum: 1
                                        default: 1
                                    required:
                                      - period
                                    description: >-
                                      Interval over which the subscription phase
                                      spans. Only applies to `duration` end
                                      strategy.
                                    example:
                                      count: 1
                                      period: years
                                  billing_date_setting:
                                    type: string
                                    enum:
                                      - phase_start
                                      - specific_date
                                    description: >

                                      Represents when the first billing date
                                      occurs.


                                      - `phase_start`: Aligns with the start of
                                      the phase.

                                      - `specific_date`: Occurs on a specified
                                      date.
                                    example: phase_start
                                  initial_billing_at:
                                    type: string
                                    format: date-time
                                    description: >-
                                      Date when the subscription phase will
                                      start being billed. Only applies to
                                      `specific_date` billing date setting. UTC
                                      date time string in the [ISO
                                      8601](https://en.wikipedia.org/wiki/ISO_8601)
                                      format.
                                    example: '2024-12-20T16:04:11Z'
                                  starts_at:
                                    type: string
                                    format: date-time
                                    description: >-
                                      Actual start date of the phase. UTC date
                                      time string in the [ISO
                                      8601](https://en.wikipedia.org/wiki/ISO_8601)
                                      format.
                                    example: '2024-12-20T16:04:11Z'
                                  ends_at:
                                    type: string
                                    format: date-time
                                    description: >-
                                      Actual end date of the phase. UTC date
                                      time string in the [ISO
                                      8601](https://en.wikipedia.org/wiki/ISO_8601)
                                      format.
                                    example: '2024-12-20T16:04:11Z'
                                  billing_cycle_alignment:
                                    type: string
                                    enum:
                                      - calendar_period
                                      - anniversary
                                    default: anniversary
                                    description: >

                                      Alignment of product billing cycles.


                                      - `calendar_period`: The billing cycles of
                                      the products will be aligned on the
                                      calendar period, after the first period
                                      which will be invoiced taking into account
                                      the prorata of the first cycle compared to
                                      the product periodicity.

                                      - `anniversary`: The billing cycles of the
                                      products will be aligned on the
                                      anniversary of the phase initial billing
                                      date.
                                    example: anniversary
                                  do_not_invoice_phase:
                                    type: boolean
                                    default: false
                                    description: >-
                                      Indicates if the phase should be invoiced.
                                      If set to true, the phase will not
                                      generate any invoices.
                                    example: false
                                  transition_calculation_method:
                                    type: string
                                    enum:
                                      - prorata
                                      - pay_in_full
                                      - none
                                    default: prorata
                                    description: >

                                      Calculation method used when transitioning
                                      from one phase to the next one.


                                      - `prorata`: The prorated amount between
                                      the two phases relative to the end date
                                      (the transition date) must be paid.

                                      - `pay_in_full`: The full amount for the
                                      phase billing period must be paid.

                                      - `none`: No amount will need to be paid,
                                      phase will simply transition from one to
                                      the next.
                                    example: prorata
                                  transition_invoicing_schedule:
                                    type: string
                                    enum:
                                      - immediately
                                    default: immediately
                                    description: >

                                      Represents when the transition amount will
                                      be invoiced.


                                      - `immediately`: An invoice will be
                                      generated immediately with the
                                      corresponding amount.
                                    example: immediately
                                  products:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          description: Product ID.
                                          example: itm_FJKlqUb8COXw55
                                        name:
                                          type: string
                                          description: >-
                                            Product name. This will appear on the
                                            final invoices.
                                          example: Product name
                                        description:
                                          type: string
                                          description: >-
                                            Product description. This will appear on
                                            the final invoices.
                                          example: A description of the product.
                                        description_display_interval_dates:
                                          type: boolean
                                          default: false
                                          description: >-
                                            Indicates if the dates of the interval
                                            should be automatically added in the
                                            product description on the invoices.
                                        payment_interval:
                                          anyOf:
                                            - type: object
                                              properties:
                                                period:
                                                  type: string
                                                  enum:
                                                    - once
                                              required:
                                                - period
                                              title: Once
                                              example:
                                                period: once
                                            - type: object
                                              properties:
                                                period:
                                                  type: string
                                                  enum:
                                                    - days
                                                    - weeks
                                                    - months
                                                    - years
                                                count:
                                                  type: integer
                                                  minimum: 1
                                                  default: 1
                                              required:
                                                - period
                                              title: Period
                                              example:
                                                period: months
                                                count: 1
                                          description: >-
                                            Interval on which the product is billed.
                                            This interval can be different between
                                            products and can differ from the
                                            subscription commitment interval.
                                        payment_schedule:
                                          type: string
                                          enum:
                                            - start
                                            - end
                                          description: >-
                                            Indicates if the product should be
                                            billed at the start or the end of the
                                            payment interval.
                                          example: start
                                        price:
                                          type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - fee
                                            amount:
                                              type: number
                                              description: >-
                                                Monetary amount. Expressed in currency's
                                                smallest unit.
                                          required:
                                            - type
                                            - amount
                                          description: >-
                                            Similar to `prices`, allow to apply a
                                            single fee price more easily.
                                          example:
                                            type: fee
                                            amount: 200
                                        prices:
                                          type: array
                                          items:
                                            oneOf:
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - fee
                                                  amount:
                                                    type: number
                                                    description: >-
                                                      Monetary amount. Expressed in currency's
                                                      smallest unit.
                                                required:
                                                  - type
                                                  - amount
                                                title: Fee price
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - volume
                                                  amount:
                                                    type: number
                                                    description: >-
                                                      Monetary amount of the price for the
                                                      number of units defined by `unit_count`.
                                                      Expressed in currency's smallest unit.
                                                  unit_count:
                                                    type: number
                                                    description: >-
                                                      Number of units considered for the
                                                      amount.
                                                  from:
                                                    type: number
                                                    description: From limit.
                                                  to:
                                                    type:
                                                      - number
                                                      - 'null'
                                                    description: To limit.
                                                  on_tier_incomplete:
                                                    type:
                                                      - string
                                                      - 'null'
                                                    enum:
                                                      - pro_rata
                                                      - pay_in_full
                                                      - do_not_charge
                                                    default: pro_rata
                                                    description: >-

                                                      Logic used to compute the amount when
                                                      usage on the tier is incomplete.


                                                      - `pro_rata`: The amount is computed
                                                      using the pro rata of the tier's
                                                      consumption.

                                                      - `pay_in_full`: The amount corresponds
                                                      to the full payment of the tier.

                                                      - `do_not_charge`: The tier is not
                                                      charged and ignored.
                                                        
                                                  metering_filter:
                                                    allOf:
                                                      - $ref: '#/components/schemas/MeteringFilter'
                                                      - type: object
                                                        description: >-
                                                          Metering filter that scopes which
                                                          billable events are eligible for this
                                                          price tier. Only present when the price
                                                          is filtered.
                                                required:
                                                  - type
                                                  - amount
                                                  - unit_count
                                                  - from
                                                  - to
                                                title: Volume price
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - packaged
                                                  amount:
                                                    type: number
                                                    description: >-
                                                      Monetary amount of the price for the
                                                      number of units defined by `unit_count`.
                                                      Expressed in currency's smallest unit.
                                                  unit_count:
                                                    type: number
                                                    description: >-
                                                      Number of units considered for the
                                                      amount.
                                                  from:
                                                    type: number
                                                    description: From limit.
                                                  to:
                                                    type:
                                                      - number
                                                      - 'null'
                                                    description: To limit.
                                                  on_bucket_incomplete:
                                                    type:
                                                      - string
                                                      - 'null'
                                                    enum:
                                                      - pro_rata
                                                      - pay_in_full
                                                      - do_not_charge
                                                    default: pro_rata
                                                    description: >-

                                                      Logic used to compute the amount when
                                                      usage reaches an incomplete bucket (the
                                                      bucket size corresponds to the
                                                      `unitCount`).

                                                        - `pro_rata`: The amount is computed using the pro rata of the bucket's consumption.
                                                        - `pay_in_full`: The amount corresponds to the full payment of the bucket.
                                                        - `do_not_charge`: The bucket is not charged and ignored.
                                                          
                                                  metering_filter:
                                                    allOf:
                                                      - $ref: '#/components/schemas/MeteringFilter'
                                                      - type: object
                                                        description: >-
                                                          Metering filter that scopes which
                                                          billable events are eligible for this
                                                          price tier. Only present when the price
                                                          is filtered.
                                                required:
                                                  - type
                                                  - amount
                                                  - unit_count
                                                  - from
                                                  - to
                                                title: Packaged price
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - bulk
                                                  amount:
                                                    type: number
                                                    description: >-
                                                      Monetary amount of the price for the
                                                      number of units defined by `unit_count`.
                                                      Expressed in currency's smallest unit.
                                                  unit_count:
                                                    type: number
                                                    description: >-
                                                      Number of units considered for the
                                                      amount.
                                                  to:
                                                    type:
                                                      - number
                                                      - 'null'
                                                    description: To limit.
                                                  on_tier_incomplete:
                                                    type:
                                                      - string
                                                      - 'null'
                                                    enum:
                                                      - pro_rata
                                                      - pay_in_full
                                                      - do_not_charge
                                                    default: pro_rata
                                                    description: >-

                                                      Logic used to compute the amount when
                                                      usage on the tier is incomplete.


                                                      - `pro_rata`: The amount is computed
                                                      using the pro rata of the tier's
                                                      consumption.

                                                      - `pay_in_full`: The amount corresponds
                                                      to the full payment of the tier.

                                                      - `do_not_charge`: The tier is not
                                                      charged and ignored.
                                                        
                                                  metering_filter:
                                                    allOf:
                                                      - $ref: '#/components/schemas/MeteringFilter'
                                                      - type: object
                                                        description: >-
                                                          Metering filter that scopes which
                                                          billable events are eligible for this
                                                          price tier. Only present when the price
                                                          is filtered.
                                                required:
                                                  - type
                                                  - amount
                                                  - unit_count
                                                  - to
                                                title: Bulk price
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - bps
                                                  from:
                                                    type: number
                                                    description: From limit.
                                                  to:
                                                    type:
                                                      - number
                                                      - 'null'
                                                    description: To limit.
                                                  percentage:
                                                    type: number
                                                    description: >-
                                                      Percentage applied on each unit to
                                                      compute the usage.
                                                  per_unit_cap:
                                                    type:
                                                      - number
                                                      - 'null'
                                                    description: >-
                                                      Maximum amount for one unit. Expressed
                                                      in currency's smallest unit.
                                                  per_unit_floor:
                                                    type:
                                                      - number
                                                      - 'null'
                                                    description: >-
                                                      Minimum amount for one unit. Expressed
                                                      in currency's smallest unit.
                                                  per_unit_fee:
                                                    type:
                                                      - number
                                                      - 'null'
                                                    description: >-
                                                      Fee amount applied per unit. Expressed
                                                      in currency's smallest unit.
                                                  metering_filter:
                                                    allOf:
                                                      - $ref: '#/components/schemas/MeteringFilter'
                                                      - type: object
                                                        description: >-
                                                          Metering filter that scopes which
                                                          billable events are eligible for this
                                                          price tier. Only present when the price
                                                          is filtered.
                                                required:
                                                  - type
                                                  - from
                                                  - to
                                                  - percentage
                                                  - per_unit_cap
                                                  - per_unit_floor
                                                  - per_unit_fee
                                                title: BPS price
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - bundle
                                                  amount:
                                                    type: number
                                                    description: >-
                                                      Monetary amount of the price for the
                                                      number of units defined by `unit_count`.
                                                      Expressed in currency's smallest unit.
                                                  unit_count:
                                                    type: number
                                                    description: >-
                                                      Number of units considered for the
                                                      amount.
                                                required:
                                                  - type
                                                  - amount
                                                  - unit_count
                                                title: Bundle price
                                                description: >-
                                                  For seat products only, if you are
                                                  looking for credits, use a fee price
                                          description: >-
                                            Prices of the product. If not specified,
                                            the matching prices (depending on the
                                            currency, interval, etc) of the product
                                            defined in the products catalog/plan are
                                            used.
                                          example:
                                            - type: volume
                                              from: 0
                                              to: 20
                                              amount: 200
                                              unit_count: 1
                                              on_tier_incomplete: null
                                            - type: volume
                                              from: 20
                                              to: null
                                              amount: 150
                                              unit_count: 1
                                              on_tier_incomplete: null
                                        count:
                                          type: number
                                          minimum: 1
                                          description: >-
                                            Number of product units. Only applies to
                                            products of type `flat_fee`, `seat` or
                                            `credit`.
                                          example: 2
                                        unit_name:
                                          type: string
                                          description: >-
                                            Product name. This will appear on the
                                            final invoices. Only applies to products
                                            of type `seat` or `usage`.
                                          example: user
                                        min_committed_count:
                                          type: number
                                          minimum: 1
                                          description: >-
                                            Minimum of units committed. If usage is
                                            less than this number, then this value
                                            will be used. Only applies to products
                                            of type `usage`.
                                        min_amount:
                                          type:
                                            - number
                                            - 'null'
                                          description: >-
                                            Minimum amount billed. If the final
                                            computed amount from the usage for this
                                            product is less than this amount, then
                                            this value will be used. Only applies to
                                            products of type `usage`.
                                        max_amount:
                                          type:
                                            - number
                                            - 'null'
                                          description: >-
                                            Maximum amount billed. If the final
                                            computed amount from the usage for this
                                            product is greater than this amount,
                                            then this value will be used. Only
                                            applies to products of type `usage`.
                                        charging_method:
                                          type:
                                            - string
                                            - 'null'
                                          enum:
                                            - prorata
                                            - pay_in_full
                                            - do_not_charge
                                          description: >-
                                            Charging method for seat count updates
                                            within the current billing period. Only
                                            applies to connected seat products.


                                            - `prorata`: Price calculated
                                            proportionally to time elapsed in the
                                            billing period.

                                            - `pay_in_full`: Price calculated for
                                            the entire billing period.

                                            - `do_not_charge`: No charge for the
                                            update.
                                        seat_invoicing_schedule:
                                          type:
                                            - string
                                            - 'null'
                                          enum:
                                            - immediately
                                            - next_invoice
                                            - custom
                                          description: >

                                            Policy defining when seat count changes
                                            are invoiced. Only applies to connected
                                            seat products.


                                            - `immediately`: Seat changes are
                                            invoiced immediately.

                                            - `next_invoice`: Seat changes are
                                            invoiced at the next invoice.

                                            - `custom`: Seat changes are invoiced on
                                            a custom schedule.
                                        metering_interval_type:
                                          type: string
                                          enum:
                                            - subscription_commitment
                                            - payment_interval
                                            - full_database
                                            - custom
                                          description: >-

                                            Indicates on which type of interval the
                                            usage should be aggregated.


                                            - `subscription_commitment`: For the
                                            usage contained within the subscription
                                            commitment period.

                                            - `payment_interval`: For the usage
                                            contained within the payment interval of
                                            the product.

                                            - `full_database`: For all the usage we
                                            ingested for this product, no matter the
                                            period.

                                            - `custom`: For the usage contained
                                            within a custom interval that starts
                                            with the phase and renews independently
                                            of the billing interval. Requires
                                            `metering_interval` to be set.
                                               Only applies to products of type `usage`.
                                        metering_interval:
                                          type: object
                                          properties:
                                            period:
                                              type: string
                                              enum:
                                                - days
                                                - weeks
                                                - months
                                                - years
                                            count:
                                              type: integer
                                              minimum: 1
                                          required:
                                            - period
                                            - count
                                          description: >-
                                            Custom interval for usage aggregation.
                                            Required when `metering_interval_type`
                                            is `custom`. The interval starts at the
                                            phase start and renews on its own cycle
                                            (e.g. `{ period: 'months', count: 3 }`
                                            for quarterly metering with monthly
                                            billing). Only applies to products of
                                            type `usage`.
                                        bill_usage_difference:
                                          anyOf:
                                            - type: boolean
                                            - type: string
                                              enum:
                                                - 'true'
                                                - 'false'
                                          default: false
                                          description: >-
                                            Only bill the usage difference comparing
                                            to the previous period (i.e. actual
                                            amount minus last invoice amount).
                                            Doesn't apply to `payment_interval`
                                            metering interval type. Only applies to
                                            products of type `usage`.
                                        credits_expiration_in_days:
                                          type:
                                            - number
                                            - 'null'
                                          description: >-
                                            Validity in days for credits that will
                                            be topped-up automatically. Once the
                                            period has passed, they'll expire.
                                        expire_credits_at_end_of_period:
                                          anyOf:
                                            - type: boolean
                                            - type: string
                                              enum:
                                                - 'true'
                                                - 'false'
                                          default: false
                                          description: >-
                                            Automatically set the expiration date to
                                            the end of the next period for each
                                            topup. Takes priority on
                                            `creditsExpirationInDays`
                                      required:
                                        - id
                                    description: >-
                                      Products comprising the subscription
                                      phase.
                                  coupons:
                                    type: array
                                    items:
                                      allOf:
                                        - anyOf:
                                            - type: object
                                              properties:
                                                id:
                                                  type: string
                                                  description: Coupon ID.
                                              required:
                                                - id
                                              title: Existing coupon
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - amount
                                                name:
                                                  type: string
                                                  description: Coupon name.
                                                discount_amount:
                                                  type: number
                                                  exclusiveMinimum: 0
                                                  description: >-
                                                    Coupon discount amount. Expressed in
                                                    currency's smallest unit.
                                              required:
                                                - type
                                                - discount_amount
                                              title: Coupon amount
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - percent
                                                name:
                                                  type: string
                                                  description: Coupon name.
                                                discount_percent:
                                                  type: number
                                                  exclusiveMinimum: 0
                                                  maximum: 100
                                                  description: Coupon discount percentage.
                                              required:
                                                - type
                                                - discount_percent
                                              title: Coupon percent
                                        - type: object
                                          properties:
                                            repeat:
                                              type:
                                                - string
                                                - 'null'
                                              enum:
                                                - once
                                                - forever
                                                - custom
                                                - duration
                                              description: >

                                                Coupon frequency. Required for inline
                                                coupons. Optional when an existing
                                                coupon `id` is provided: if omitted,
                                                defaults to the catalog coupon's repeat
                                                value.


                                                - `once`: Will apply the coupon only to
                                                the first one invoice.

                                                - `forever`: Will apply the coupon to
                                                all invoices.

                                                - `custom`: Will apply to coupon until a
                                                specified expiration date.

                                                - `duration`: Will apply the coupon for
                                                a specific duration (e.g., 3 months).
                                            duration_period:
                                              type: string
                                              enum:
                                                - days
                                                - weeks
                                                - months
                                                - years
                                              description: >-
                                                Period of time for which the coupon will
                                                be applied. Only applies to the
                                                `duration` coupon frequency.
                                            duration_count:
                                              type: number
                                              description: >-
                                                Number of periods for which the coupon
                                                will be applied. Only applies to the
                                                `duration` coupon frequency.
                                            expires_at:
                                              type: string
                                              format: date-time
                                              description: >-
                                                Coupon expiration date. Only applies to
                                                the `custom` coupon frequency. UTC date
                                                time string in the [ISO
                                                8601](https://en.wikipedia.org/wiki/ISO_8601)
                                                format.
                                              example: '2024-12-20T16:04:11Z'
                                            apply_at:
                                              type: string
                                              format: date-time
                                              description: >-
                                                Coupon first application date. UTC date
                                                time string in the [ISO
                                                8601](https://en.wikipedia.org/wiki/ISO_8601)
                                                format.
                                              example: '2024-12-20T16:04:11Z'
                                            product_ids:
                                              type: array
                                              items:
                                                type: string
                                              description: >-
                                                Product IDs to which the coupon will be
                                                applied.
                                    description: Coupons comprising the subscription phase.
                                required:
                                  - activation_strategy
                                  - end_strategy
                                  - billing_date_setting
                                  - products
                          required:
                            - phases
                          title: With phases
                        - allOf:
                            - type: object
                              properties:
                                products:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                        description: Product ID.
                                        example: itm_FJKlqUb8COXw55
                                      name:
                                        type: string
                                        description: >-
                                          Product name. This will appear on the
                                          final invoices.
                                        example: Product name
                                      description:
                                        type: string
                                        description: >-
                                          Product description. This will appear on
                                          the final invoices.
                                        example: A description of the product.
                                      description_display_interval_dates:
                                        type: boolean
                                        default: false
                                        description: >-
                                          Indicates if the dates of the interval
                                          should be automatically added in the
                                          product description on the invoices.
                                      payment_interval:
                                        anyOf:
                                          - type: object
                                            properties:
                                              period:
                                                type: string
                                                enum:
                                                  - once
                                            required:
                                              - period
                                            title: Once
                                            example:
                                              period: once
                                          - type: object
                                            properties:
                                              period:
                                                type: string
                                                enum:
                                                  - days
                                                  - weeks
                                                  - months
                                                  - years
                                              count:
                                                type: integer
                                                minimum: 1
                                                default: 1
                                            required:
                                              - period
                                            title: Period
                                            example:
                                              period: months
                                              count: 1
                                        description: >-
                                          Interval on which the product is billed.
                                          This interval can be different between
                                          products and can differ from the
                                          subscription commitment interval.
                                      payment_schedule:
                                        type: string
                                        enum:
                                          - start
                                          - end
                                        description: >-
                                          Indicates if the product should be
                                          billed at the start or the end of the
                                          payment interval.
                                        example: start
                                      price:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - fee
                                          amount:
                                            type: number
                                            description: >-
                                              Monetary amount. Expressed in currency's
                                              smallest unit.
                                        required:
                                          - type
                                          - amount
                                        description: >-
                                          Similar to `prices`, allow to apply a
                                          single fee price more easily.
                                        example:
                                          type: fee
                                          amount: 200
                                      prices:
                                        type: array
                                        items:
                                          oneOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - fee
                                                amount:
                                                  type: number
                                                  description: >-
                                                    Monetary amount. Expressed in currency's
                                                    smallest unit.
                                              required:
                                                - type
                                                - amount
                                              title: Fee price
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - volume
                                                amount:
                                                  type: number
                                                  description: >-
                                                    Monetary amount of the price for the
                                                    number of units defined by `unit_count`.
                                                    Expressed in currency's smallest unit.
                                                unit_count:
                                                  type: number
                                                  description: >-
                                                    Number of units considered for the
                                                    amount.
                                                from:
                                                  type: number
                                                  description: From limit.
                                                to:
                                                  type:
                                                    - number
                                                    - 'null'
                                                  description: To limit.
                                                on_tier_incomplete:
                                                  type:
                                                    - string
                                                    - 'null'
                                                  enum:
                                                    - pro_rata
                                                    - pay_in_full
                                                    - do_not_charge
                                                  default: pro_rata
                                                  description: >-

                                                    Logic used to compute the amount when
                                                    usage on the tier is incomplete.


                                                    - `pro_rata`: The amount is computed
                                                    using the pro rata of the tier's
                                                    consumption.

                                                    - `pay_in_full`: The amount corresponds
                                                    to the full payment of the tier.

                                                    - `do_not_charge`: The tier is not
                                                    charged and ignored.
                                                      
                                                metering_filter:
                                                  allOf:
                                                    - $ref: '#/components/schemas/MeteringFilter'
                                                    - type: object
                                                      description: >-
                                                        Metering filter that scopes which
                                                        billable events are eligible for this
                                                        price tier. Only present when the price
                                                        is filtered.
                                              required:
                                                - type
                                                - amount
                                                - unit_count
                                                - from
                                                - to
                                              title: Volume price
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - packaged
                                                amount:
                                                  type: number
                                                  description: >-
                                                    Monetary amount of the price for the
                                                    number of units defined by `unit_count`.
                                                    Expressed in currency's smallest unit.
                                                unit_count:
                                                  type: number
                                                  description: >-
                                                    Number of units considered for the
                                                    amount.
                                                from:
                                                  type: number
                                                  description: From limit.
                                                to:
                                                  type:
                                                    - number
                                                    - 'null'
                                                  description: To limit.
                                                on_bucket_incomplete:
                                                  type:
                                                    - string
                                                    - 'null'
                                                  enum:
                                                    - pro_rata
                                                    - pay_in_full
                                                    - do_not_charge
                                                  default: pro_rata
                                                  description: >-

                                                    Logic used to compute the amount when
                                                    usage reaches an incomplete bucket (the
                                                    bucket size corresponds to the
                                                    `unitCount`).

                                                      - `pro_rata`: The amount is computed using the pro rata of the bucket's consumption.
                                                      - `pay_in_full`: The amount corresponds to the full payment of the bucket.
                                                      - `do_not_charge`: The bucket is not charged and ignored.
                                                        
                                                metering_filter:
                                                  allOf:
                                                    - $ref: '#/components/schemas/MeteringFilter'
                                                    - type: object
                                                      description: >-
                                                        Metering filter that scopes which
                                                        billable events are eligible for this
                                                        price tier. Only present when the price
                                                        is filtered.
                                              required:
                                                - type
                                                - amount
                                                - unit_count
                                                - from
                                                - to
                                              title: Packaged price
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - bulk
                                                amount:
                                                  type: number
                                                  description: >-
                                                    Monetary amount of the price for the
                                                    number of units defined by `unit_count`.
                                                    Expressed in currency's smallest unit.
                                                unit_count:
                                                  type: number
                                                  description: >-
                                                    Number of units considered for the
                                                    amount.
                                                to:
                                                  type:
                                                    - number
                                                    - 'null'
                                                  description: To limit.
                                                on_tier_incomplete:
                                                  type:
                                                    - string
                                                    - 'null'
                                                  enum:
                                                    - pro_rata
                                                    - pay_in_full
                                                    - do_not_charge
                                                  default: pro_rata
                                                  description: >-

                                                    Logic used to compute the amount when
                                                    usage on the tier is incomplete.


                                                    - `pro_rata`: The amount is computed
                                                    using the pro rata of the tier's
                                                    consumption.

                                                    - `pay_in_full`: The amount corresponds
                                                    to the full payment of the tier.

                                                    - `do_not_charge`: The tier is not
                                                    charged and ignored.
                                                      
                                                metering_filter:
                                                  allOf:
                                                    - $ref: '#/components/schemas/MeteringFilter'
                                                    - type: object
                                                      description: >-
                                                        Metering filter that scopes which
                                                        billable events are eligible for this
                                                        price tier. Only present when the price
                                                        is filtered.
                                              required:
                                                - type
                                                - amount
                                                - unit_count
                                                - to
                                              title: Bulk price
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - bps
                                                from:
                                                  type: number
                                                  description: From limit.
                                                to:
                                                  type:
                                                    - number
                                                    - 'null'
                                                  description: To limit.
                                                percentage:
                                                  type: number
                                                  description: >-
                                                    Percentage applied on each unit to
                                                    compute the usage.
                                                per_unit_cap:
                                                  type:
                                                    - number
                                                    - 'null'
                                                  description: >-
                                                    Maximum amount for one unit. Expressed
                                                    in currency's smallest unit.
                                                per_unit_floor:
                                                  type:
                                                    - number
                                                    - 'null'
                                                  description: >-
                                                    Minimum amount for one unit. Expressed
                                                    in currency's smallest unit.
                                                per_unit_fee:
                                                  type:
                                                    - number
                                                    - 'null'
                                                  description: >-
                                                    Fee amount applied per unit. Expressed
                                                    in currency's smallest unit.
                                                metering_filter:
                                                  allOf:
                                                    - $ref: '#/components/schemas/MeteringFilter'
                                                    - type: object
                                                      description: >-
                                                        Metering filter that scopes which
                                                        billable events are eligible for this
                                                        price tier. Only present when the price
                                                        is filtered.
                                              required:
                                                - type
                                                - from
                                                - to
                                                - percentage
                                                - per_unit_cap
                                                - per_unit_floor
                                                - per_unit_fee
                                              title: BPS price
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - bundle
                                                amount:
                                                  type: number
                                                  description: >-
                                                    Monetary amount of the price for the
                                                    number of units defined by `unit_count`.
                                                    Expressed in currency's smallest unit.
                                                unit_count:
                                                  type: number
                                                  description: >-
                                                    Number of units considered for the
                                                    amount.
                                              required:
                                                - type
                                                - amount
                                                - unit_count
                                              title: Bundle price
                                              description: >-
                                                For seat products only, if you are
                                                looking for credits, use a fee price
                                        description: >-
                                          Prices of the product. If not specified,
                                          the matching prices (depending on the
                                          currency, interval, etc) of the product
                                          defined in the products catalog/plan are
                                          used.
                                        example:
                                          - type: volume
                                            from: 0
                                            to: 20
                                            amount: 200
                                            unit_count: 1
                                            on_tier_incomplete: null
                                          - type: volume
                                            from: 20
                                            to: null
                                            amount: 150
                                            unit_count: 1
                                            on_tier_incomplete: null
                                      count:
                                        type: number
                                        minimum: 1
                                        description: >-
                                          Number of product units. Only applies to
                                          products of type `flat_fee`, `seat` or
                                          `credit`.
                                        example: 2
                                      unit_name:
                                        type: string
                                        description: >-
                                          Product name. This will appear on the
                                          final invoices. Only applies to products
                                          of type `seat` or `usage`.
                                        example: user
                                      min_committed_count:
                                        type: number
                                        minimum: 1
                                        description: >-
                                          Minimum of units committed. If usage is
                                          less than this number, then this value
                                          will be used. Only applies to products
                                          of type `usage`.
                                      min_amount:
                                        type:
                                          - number
                                          - 'null'
                                        description: >-
                                          Minimum amount billed. If the final
                                          computed amount from the usage for this
                                          product is less than this amount, then
                                          this value will be used. Only applies to
                                          products of type `usage`.
                                      max_amount:
                                        type:
                                          - number
                                          - 'null'
                                        description: >-
                                          Maximum amount billed. If the final
                                          computed amount from the usage for this
                                          product is greater than this amount,
                                          then this value will be used. Only
                                          applies to products of type `usage`.
                                      charging_method:
                                        type:
                                          - string
                                          - 'null'
                                        enum:
                                          - prorata
                                          - pay_in_full
                                          - do_not_charge
                                        description: >-
                                          Charging method for seat count updates
                                          within the current billing period. Only
                                          applies to connected seat products.


                                          - `prorata`: Price calculated
                                          proportionally to time elapsed in the
                                          billing period.

                                          - `pay_in_full`: Price calculated for
                                          the entire billing period.

                                          - `do_not_charge`: No charge for the
                                          update.
                                      seat_invoicing_schedule:
                                        type:
                                          - string
                                          - 'null'
                                        enum:
                                          - immediately
                                          - next_invoice
                                          - custom
                                        description: >

                                          Policy defining when seat count changes
                                          are invoiced. Only applies to connected
                                          seat products.


                                          - `immediately`: Seat changes are
                                          invoiced immediately.

                                          - `next_invoice`: Seat changes are
                                          invoiced at the next invoice.

                                          - `custom`: Seat changes are invoiced on
                                          a custom schedule.
                                      metering_interval_type:
                                        type: string
                                        enum:
                                          - subscription_commitment
                                          - payment_interval
                                          - full_database
                                          - custom
                                        description: >-

                                          Indicates on which type of interval the
                                          usage should be aggregated.


                                          - `subscription_commitment`: For the
                                          usage contained within the subscription
                                          commitment period.

                                          - `payment_interval`: For the usage
                                          contained within the payment interval of
                                          the product.

                                          - `full_database`: For all the usage we
                                          ingested for this product, no matter the
                                          period.

                                          - `custom`: For the usage contained
                                          within a custom interval that starts
                                          with the phase and renews independently
                                          of the billing interval. Requires
                                          `metering_interval` to be set.
                                             Only applies to products of type `usage`.
                                      metering_interval:
                                        type: object
                                        properties:
                                          period:
                                            type: string
                                            enum:
                                              - days
                                              - weeks
                                              - months
                                              - years
                                          count:
                                            type: integer
                                            minimum: 1
                                        required:
                                          - period
                                          - count
                                        description: >-
                                          Custom interval for usage aggregation.
                                          Required when `metering_interval_type`
                                          is `custom`. The interval starts at the
                                          phase start and renews on its own cycle
                                          (e.g. `{ period: 'months', count: 3 }`
                                          for quarterly metering with monthly
                                          billing). Only applies to products of
                                          type `usage`.
                                      bill_usage_difference:
                                        anyOf:
                                          - type: boolean
                                          - type: string
                                            enum:
                                              - 'true'
                                              - 'false'
                                        default: false
                                        description: >-
                                          Only bill the usage difference comparing
                                          to the previous period (i.e. actual
                                          amount minus last invoice amount).
                                          Doesn't apply to `payment_interval`
                                          metering interval type. Only applies to
                                          products of type `usage`.
                                      credits_expiration_in_days:
                                        type:
                                          - number
                                          - 'null'
                                        description: >-
                                          Validity in days for credits that will
                                          be topped-up automatically. Once the
                                          period has passed, they'll expire.
                                      expire_credits_at_end_of_period:
                                        anyOf:
                                          - type: boolean
                                          - type: string
                                            enum:
                                              - 'true'
                                              - 'false'
                                        default: false
                                        description: >-
                                          Automatically set the expiration date to
                                          the end of the next period for each
                                          topup. Takes priority on
                                          `creditsExpirationInDays`
                                    required:
                                      - id
                                  description: Products that make up the subscription.
                                coupons:
                                  type: array
                                  items:
                                    allOf:
                                      - anyOf:
                                          - type: object
                                            properties:
                                              id:
                                                type: string
                                                description: Coupon ID.
                                            required:
                                              - id
                                            title: Existing coupon
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - amount
                                              name:
                                                type: string
                                                description: Coupon name.
                                              discount_amount:
                                                type: number
                                                exclusiveMinimum: 0
                                                description: >-
                                                  Coupon discount amount. Expressed in
                                                  currency's smallest unit.
                                            required:
                                              - type
                                              - discount_amount
                                            title: Coupon amount
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - percent
                                              name:
                                                type: string
                                                description: Coupon name.
                                              discount_percent:
                                                type: number
                                                exclusiveMinimum: 0
                                                maximum: 100
                                                description: Coupon discount percentage.
                                            required:
                                              - type
                                              - discount_percent
                                            title: Coupon percent
                                      - type: object
                                        properties:
                                          repeat:
                                            type:
                                              - string
                                              - 'null'
                                            enum:
                                              - once
                                              - forever
                                              - custom
                                              - duration
                                            description: >

                                              Coupon frequency. Required for inline
                                              coupons. Optional when an existing
                                              coupon `id` is provided: if omitted,
                                              defaults to the catalog coupon's repeat
                                              value.


                                              - `once`: Will apply the coupon only to
                                              the first one invoice.

                                              - `forever`: Will apply the coupon to
                                              all invoices.

                                              - `custom`: Will apply to coupon until a
                                              specified expiration date.

                                              - `duration`: Will apply the coupon for
                                              a specific duration (e.g., 3 months).
                                          duration_period:
                                            type: string
                                            enum:
                                              - days
                                              - weeks
                                              - months
                                              - years
                                            description: >-
                                              Period of time for which the coupon will
                                              be applied. Only applies to the
                                              `duration` coupon frequency.
                                          duration_count:
                                            type: number
                                            description: >-
                                              Number of periods for which the coupon
                                              will be applied. Only applies to the
                                              `duration` coupon frequency.
                                          expires_at:
                                            type: string
                                            format: date-time
                                            description: >-
                                              Coupon expiration date. Only applies to
                                              the `custom` coupon frequency. UTC date
                                              time string in the [ISO
                                              8601](https://en.wikipedia.org/wiki/ISO_8601)
                                              format.
                                            example: '2024-12-20T16:04:11Z'
                                          apply_at:
                                            type: string
                                            format: date-time
                                            description: >-
                                              Coupon first application date. UTC date
                                              time string in the [ISO
                                              8601](https://en.wikipedia.org/wiki/ISO_8601)
                                              format.
                                            example: '2024-12-20T16:04:11Z'
                                          product_ids:
                                            type: array
                                            items:
                                              type: string
                                            description: >-
                                              Product IDs to which the coupon will be
                                              applied.
                            - type: object
                              properties:
                                trial:
                                  type: object
                                  properties:
                                    end_strategy:
                                      type: string
                                      enum:
                                        - manual
                                        - end_date
                                        - duration
                                      description: Defines how the free trial will end.
                                    starts_at:
                                      type: string
                                      format: date-time
                                      description: >-
                                        Free trial start date. UTC date time
                                        string in the [ISO
                                        8601](https://en.wikipedia.org/wiki/ISO_8601)
                                        format.
                                      example: '2024-12-20T16:04:11Z'
                                    ends_at:
                                      type: string
                                      format: date-time
                                      description: >-
                                        Free trial end date. Only applies if the
                                        end strategy is `end_date`. UTC date
                                        time string in the [ISO
                                        8601](https://en.wikipedia.org/wiki/ISO_8601)
                                        format.
                                      example: '2024-12-20T16:04:11Z'
                                    duration:
                                      type: object
                                      properties:
                                        period:
                                          type: string
                                          enum:
                                            - days
                                            - weeks
                                            - months
                                            - years
                                          description: >-
                                            Free trial duration period. Only applies
                                            if the end strategy is `duration`.
                                        count:
                                          type: number
                                          minimum: 1
                                          description: >-
                                            Free trial duration count. Only applies
                                            if the end strategy is `duration`.
                                      required:
                                        - period
                                        - count
                                  required:
                                    - end_strategy
                                  description: >-
                                    Create a free trial phase based on the plan
                                    configuration. Only applies if a `plan_id`
                                    is provided.
                          title: Without phases
                  description: The configuration of the subscription to transition to
              required:
                - source_subscription_id
                - application_schedule
                - target_subscription
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The unique identifier of the subscription transition
                  customer_id:
                    type: string
                    description: The ID of the customer associated with the transition
                  base_subscription_id:
                    type: string
                    description: >-
                      The ID of the original subscription from which this
                      transition is derived. It references the last active
                      version of the subscription.
                  source_subscription_id:
                    type: string
                    description: The ID of the subscription to transition from
                  target_subscription_id:
                    type:
                      - string
                      - 'null'
                    description: The ID of the subscription to transition to
                  status:
                    type: string
                    enum:
                      - scheduled
                      - completed
                      - failed
                      - draft
                      - cancelled
                      - pending_quote_signature
                    description: >-
                      The current status of the subscription transition.
                      Possible values are 'scheduled', 'completed', 'failed',
                      and 'draft'.
                  transitioned_at:
                    type:
                      - string
                      - 'null'
                    format: date
                    description: >-
                      The date and time when the transition was completed. Null
                      if the transition is not yet completed. UTC date time
                      string in the [ISO
                      8601](https://en.wikipedia.org/wiki/ISO_8601) format.
                  name:
                    type:
                      - string
                      - 'null'
                    description: An optional name for the transition
                  transition_date:
                    type:
                      - string
                      - 'null'
                    format: date
                    description: >-
                      The date at which the transition should occur. Only
                      applicable if the application schedule is 'scheduled'. Can
                      be a past date within the current billing period. UTC date
                      time string in the [ISO
                      8601](https://en.wikipedia.org/wiki/ISO_8601) format.
                  application_schedule:
                    type: string
                    enum:
                      - immediately
                      - scheduled
                      - next_renewal
                      - quote_signature
                      - scheduled_after_quote_signature
                    description: >-
                      Whether the transition should be applied 'immediately' or
                      'scheduled' for a specific date. Past dates within the
                      current billing period are supported and will be applied
                      immediately.
                  billing_cycle_transition_method:
                    type:
                      - string
                      - 'null'
                    enum:
                      - keep_current_billing_cycle
                      - align_to_new_billing_cycle
                    description: >-
                      The billing cycle transition method to use.
                      'keep_current_billing_cycle' will keep the current billing
                      cycle dates if possible. 'align_to_new_billing_cycle' will
                      align the billing cycle to the transition date.
                  calculation_method:
                    type:
                      - string
                      - 'null'
                    enum:
                      - do_not_charge
                      - pro_rata
                    description: >-
                      The calculation method to use for the transition.
                      'do_not_charge' will not generate any transition invoice.
                      'pro_rata' will generate a prorated invoice for the
                      remaining period.
                required:
                  - id
                  - customer_id
                  - base_subscription_id
                  - source_subscription_id
                  - target_subscription_id
                  - status
                  - transitioned_at
                  - name
                  - transition_date
                  - application_schedule
                  - billing_cycle_transition_method
                  - calculation_method
      security:
        - bearer: []
components:
  schemas:
    MeteringFilter:
      type:
        - object
        - 'null'
      properties:
        name:
          type: string
          description: Name of the metering filter.
          example: VISA credit cards
        configuration:
          $ref: '#/components/schemas/MeteringFilterConfiguration'
      required:
        - name
        - configuration
      description: Metering filter to scope eligible billable events.
    MeteringFilterConfiguration:
      type: object
      properties:
        conditional:
          type: string
          enum:
            - and
            - or
          description: >-
            Logical operator used to combine multiple filter fields. `and`
            requires all fields to match, `or` requires at least one.
        fields:
          type: array
          items:
            allOf:
              - type: object
                properties:
                  property:
                    type: string
                    description: Name of the event property to filter on.
                required:
                  - property
              - oneOf:
                  - type: object
                    properties:
                      operator:
                        type: string
                        enum:
                          - is_null
                          - is_not_null
                        description: Comparison operator to apply on the property value.
                    required:
                      - operator
                    title: Null check
                  - type: object
                    properties:
                      operator:
                        type: string
                        enum:
                          - in
                          - not_in
                        description: Comparison operator to apply on the property value.
                      value:
                        type: string
                    required:
                      - operator
                      - value
                    title: List match
                  - type: object
                    properties:
                      operator:
                        type: string
                        enum:
                          - gte
                          - gt
                          - lt
                          - lte
                        description: Comparison operator to apply on the property value.
                      value:
                        type: number
                    required:
                      - operator
                      - value
                    title: Numeric comparison
                  - type: object
                    properties:
                      operator:
                        type: string
                        enum:
                          - equals
                          - not_equal
                        description: Comparison operator to apply on the property value.
                      value:
                        anyOf:
                          - type: string
                          - type: number
                          - type: boolean
                    required:
                      - operator
                      - value
                    title: Equality check
      required:
        - conditional
        - fields
      description: Configuration of the rules used to filter eligible events.
      example:
        conditional: and
        fields:
          - property: card_type
            operator: equals
            value: visa
          - property: kind
            operator: equals
            value: credit_card
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````