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

# Update subscription

> Update subscription settings like payment configuration, billing options, etc.



## OpenAPI

````yaml https://api.meteroid.com/api-docs/openapi.json patch /api/v1/subscriptions/{subscription_id}
openapi: 3.1.0
info:
  title: meteroid
  description: ''
  license:
    name: LicenseRef-Proprietary
    identifier: LicenseRef-Proprietary
  version: 0.1.0
servers: []
security: []
tags:
  - name: Meteroid
    description: Meteroid API
  - name: Add-ons
  - name: Batch Jobs
  - name: Checkout Sessions
  - name: Connect
    description: Manage connected accounts (Express & Standard)
  - name: Coupons
  - name: Credit Notes
  - name: Customers
  - name: Entitlements
  - name: Events
  - name: Features
  - name: Invoices
  - name: Metrics
  - name: OAuth
    description: OAuth 2.0 token endpoints (public, client-credentials auth)
  - name: OAuth Apps
    description: Manage OAuth applications for Connect integrations
  - name: Plans
  - name: Product Families
  - name: Products
  - name: Subscriptions
  - name: Usage
paths:
  /api/v1/subscriptions/{subscription_id}:
    patch:
      tags:
        - Subscriptions
      summary: Update subscription
      description: >-
        Update subscription settings like payment configuration, billing
        options, etc.
      operationId: update_subscription
      parameters:
        - name: subscription_id
          in: path
          description: Subscription ID
          required: true
          schema:
            $ref: '#/components/schemas/SubscriptionId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionUpdateRequest'
        required: true
      responses:
        '200':
          description: Subscription updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionUpdateResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '404':
          description: Subscription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    SubscriptionId:
      type: string
      format: MeteroidId
      examples:
        - sub_7n42DGM5Tflk9n8mt7Fhc7
    SubscriptionUpdateRequest:
      type: object
      properties:
        auto_advance_invoices:
          type:
            - boolean
            - 'null'
          description: >-
            If false, invoices will stay in Draft until manually reviewed and
            finalized.
        charge_automatically:
          type:
            - boolean
            - 'null'
          description: >-
            Automatically try to charge the customer's configured payment method
            on finalize.
        invoice_memo:
          type:
            - string
            - 'null'
          description: Default memo for invoices
        net_terms:
          type:
            - integer
            - 'null'
          format: int32
          description: Payment terms in days (0 = due on issue)
          minimum: 0
        payment_methods_config:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PaymentMethodsConfig'
              description: >-
                Payment methods configuration (Online, BankTransfer, or
                External)
        purchase_order:
          type:
            - string
            - 'null'
          description: Purchase order number
    SubscriptionUpdateResponse:
      type: object
      required:
        - subscription
      properties:
        subscription:
          $ref: '#/components/schemas/SubscriptionDetails'
    RestErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
    PaymentMethodsConfig:
      oneOf:
        - $ref: '#/components/schemas/OnlinePaymentMethodConfig'
        - $ref: '#/components/schemas/BankTransferPaymentMethodConfig'
        - $ref: '#/components/schemas/ExternalPaymentMethodConfig'
      description: Online (card/direct debit), BankTransfer, or External.
      discriminator:
        propertyName: type
        mapping:
          bank_transfer:
            $ref: '#/components/schemas/BankTransferPaymentMethodConfig'
          external:
            $ref: '#/components/schemas/ExternalPaymentMethodConfig'
          online:
            $ref: '#/components/schemas/OnlinePaymentMethodConfig'
    SubscriptionDetails:
      type: object
      required:
        - id
        - customer_id
        - customer_name
        - billing_day_anchor
        - currency
        - plan_id
        - plan_name
        - plan_version_id
        - plan_version
        - status
        - start_date
        - current_period_start
        - net_terms
        - mrr_cents
        - period
        - created_at
        - auto_advance_invoices
        - charge_automatically
        - components
        - add_ons
        - applied_coupons
      properties:
        activated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the subscription was activated (first payment or activation
            condition met)
        add_ons:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionAddOn'
        applied_coupons:
          type: array
          items:
            $ref: '#/components/schemas/AppliedCouponDetailed'
        auto_advance_invoices:
          type: boolean
        billing_day_anchor:
          type: integer
          format: int32
        billing_start_date:
          type:
            - string
            - 'null'
          format: date
          description: When billing started (after any trial period)
        charge_automatically:
          type: boolean
        checkout_url:
          type:
            - string
            - 'null'
        components:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionComponent'
        created_at:
          type: string
          format: date-time
          description: When the subscription was created
        currency:
          $ref: '#/components/schemas/Currency'
        current_period_end:
          type:
            - string
            - 'null'
          format: date
          description: Current billing period end date
        current_period_start:
          type: string
          format: date
          description: Current billing period start date
        customer_alias:
          type:
            - string
            - 'null'
        customer_id:
          $ref: '#/components/schemas/CustomerId'
        customer_name:
          type: string
        end_date:
          type:
            - string
            - 'null'
          format: date
          description: When the subscription ends (if set)
        entitlements:
          type: array
          items:
            $ref: '#/components/schemas/Entitlement'
        id:
          $ref: '#/components/schemas/SubscriptionId'
        invoice_memo:
          type:
            - string
            - 'null'
          description: Default memo for invoices
        minimum_commitment:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/MinimumCommitment'
              description: >-
                Materialized minimum-commitment floor on this subscription (plan
                snapshot or operator

                override). Read-only here — set it at creation, or change it via
                a subscription amendment.
        mrr_cents:
          type: integer
          format: int64
          description: Monthly recurring revenue in cents
          minimum: 0
        net_terms:
          type: integer
          format: int32
          description: Payment terms in days (0 = due on issue)
          minimum: 0
        payment_methods_config:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PaymentMethodsConfig'
        period:
          $ref: '#/components/schemas/BillingPeriodEnum'
          description: Billing period (monthly, annual, etc.)
        plan_id:
          $ref: '#/components/schemas/PlanId'
        plan_name:
          type: string
        plan_version:
          type: integer
          format: int32
          minimum: 0
        plan_version_id:
          $ref: '#/components/schemas/PlanVersionId'
        purchase_order:
          type:
            - string
            - 'null'
        start_date:
          type: string
          format: date
          description: >-
            When the subscription contract starts (benefits apply from this
            date)
        status:
          $ref: '#/components/schemas/SubscriptionStatusEnum'
        trial_duration:
          type:
            - integer
            - 'null'
          format: int32
          description: Trial duration in days
          minimum: 0
    ErrorCode:
      type: string
      enum:
        - BAD_REQUEST
        - NOT_FOUND
        - CONFLICT
        - FORBIDDEN
        - UNAUTHORIZED
        - TOO_MANY_REQUESTS
        - INTERNAL_SERVER_ERROR
    OnlinePaymentMethodConfig:
      type: object
      properties:
        config:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OnlineMethodsConfig'
              description: If None, inherits all online providers from invoicing entity.
    BankTransferPaymentMethodConfig:
      type: object
      properties:
        account_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/BankAccountId'
    ExternalPaymentMethodConfig:
      type: object
    SubscriptionAddOn:
      type: object
      required:
        - name
        - period
        - fee
        - quantity
      properties:
        add_on_id:
          $ref: '#/components/schemas/AddOnId'
        fee:
          $ref: '#/components/schemas/SubscriptionFee'
        id:
          $ref: '#/components/schemas/SubscriptionAddOnId'
        name:
          type: string
        period:
          $ref: '#/components/schemas/SubscriptionFeeBillingPeriodEnum'
        quantity:
          type: integer
          format: int32
          minimum: 0
    AppliedCouponDetailed:
      type: object
      required:
        - coupon
        - applied_coupon
      properties:
        applied_coupon:
          $ref: '#/components/schemas/AppliedCoupon'
        coupon:
          $ref: '#/components/schemas/Coupon'
    SubscriptionComponent:
      type: object
      required:
        - name
        - period
        - fee
      properties:
        fee:
          $ref: '#/components/schemas/SubscriptionFee'
        name:
          type: string
        period:
          $ref: '#/components/schemas/SubscriptionFeeBillingPeriodEnum'
        price_component_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PriceComponentId'
        product_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ProductId'
    Currency:
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLP
        - CNH
        - CNY
        - COP
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLL
        - SOS
        - SRD
        - SSP
        - STD
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
        - ZWL
      examples:
        - EUR
    CustomerId:
      type: string
      format: MeteroidId
      examples:
        - cus_7n42DGM5Tflk9n8mt7Fhc7
    Entitlement:
      type: object
      description: >-
        A raw entitlement row attached to one entity (feature, plan version,
        add-on, or subscription).
      required:
        - id
        - feature_id
        - value
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          format: date-time
        feature_id:
          $ref: '#/components/schemas/FeatureId'
        id:
          $ref: '#/components/schemas/EntitlementId'
        updated_at:
          type: string
          format: date-time
        value:
          $ref: '#/components/schemas/EntitlementValue'
    MinimumCommitment:
      type: object
      required:
        - amount
        - scope
      properties:
        amount:
          type: string
          description: Decimal string in the plan currency, e.g. "100.00".
        scope:
          $ref: '#/components/schemas/MinimumCommitmentScope'
    BillingPeriodEnum:
      type: string
      enum:
        - MONTHLY
        - QUARTERLY
        - SEMIANNUAL
        - ANNUAL
    PlanId:
      type: string
      format: MeteroidId
      examples:
        - plan_7n42DGM5Tflk9n8mt7Fhc7
    PlanVersionId:
      type: string
      format: MeteroidId
      examples:
        - plv_7n42DGM5Tflk9n8mt7Fhc7
    SubscriptionStatusEnum:
      type: string
      title: SubscriptionStatus
      enum:
        - PENDING_ACTIVATION
        - PENDING_CHARGE
        - TRIAL_ACTIVE
        - ACTIVE
        - TRIAL_EXPIRED
        - PAUSED
        - SUSPENDED
        - CANCELLED
        - COMPLETED
        - SUPERSEDED
        - ERRORED
    OnlineMethodsConfig:
      type: object
      properties:
        card:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OnlineMethodConfig'
        direct_debit:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OnlineMethodConfig'
    BankAccountId:
      type: string
      format: MeteroidId
      examples:
        - ba_7n42DGM5Tflk9n8mt7Fhc7
    AddOnId:
      type: string
      format: MeteroidId
      examples:
        - add_7n42DGM5Tflk9n8mt7Fhc7
    SubscriptionFee:
      oneOf:
        - $ref: '#/components/schemas/RateFee'
        - $ref: '#/components/schemas/OneTimeFee'
        - $ref: '#/components/schemas/RecurringFee'
        - $ref: '#/components/schemas/CapacityFee'
        - $ref: '#/components/schemas/SlotFee'
        - $ref: '#/components/schemas/UsageFee'
      discriminator:
        propertyName: type
        mapping:
          CAPACITY:
            $ref: '#/components/schemas/CapacityFee'
          ONE_TIME:
            $ref: '#/components/schemas/OneTimeFee'
          RATE:
            $ref: '#/components/schemas/RateFee'
          RECURRING:
            $ref: '#/components/schemas/RecurringFee'
          SLOT:
            $ref: '#/components/schemas/SlotFee'
          USAGE:
            $ref: '#/components/schemas/UsageFee'
    SubscriptionAddOnId:
      type: string
      format: MeteroidId
      examples:
        - sub_add_7n42DGM5Tflk9n8mt7Fhc7
    SubscriptionFeeBillingPeriodEnum:
      type: string
      enum:
        - ONE_TIME
        - MONTHLY
        - QUARTERLY
        - SEMIANNUAL
        - ANNUAL
    AppliedCoupon:
      type: object
      required:
        - id
        - coupon_id
        - is_active
        - created_at
      properties:
        applied_amount:
          type:
            - string
            - 'null'
          format: decimal
        applied_count:
          type:
            - integer
            - 'null'
          format: int32
        coupon_id:
          $ref: '#/components/schemas/CouponId'
        created_at:
          type: string
          format: date-time
        id:
          $ref: '#/components/schemas/AppliedCouponId'
        is_active:
          type: boolean
        last_applied_at:
          type:
            - string
            - 'null'
          format: date-time
    Coupon:
      type: object
      required:
        - id
        - code
        - description
        - discount
        - reusable
        - disabled
      properties:
        code:
          type: string
        description:
          type: string
        disabled:
          type: boolean
        discount:
          $ref: '#/components/schemas/CouponDiscount'
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        id:
          $ref: '#/components/schemas/CouponId'
        recurring_value:
          type:
            - integer
            - 'null'
          format: int32
        redemption_limit:
          type:
            - integer
            - 'null'
          format: int32
        reusable:
          type: boolean
    PriceComponentId:
      type: string
      format: MeteroidId
      examples:
        - price_7n42DGM5Tflk9n8mt7Fhc7
    ProductId:
      type: string
      format: MeteroidId
      examples:
        - prd_7n42DGM5Tflk9n8mt7Fhc7
    FeatureId:
      type: string
      format: MeteroidId
      examples:
        - feat_7n42DGM5Tflk9n8mt7Fhc7
    EntitlementId:
      type: string
      format: MeteroidId
      examples:
        - ent_7n42DGM5Tflk9n8mt7Fhc7
    EntitlementValue:
      oneOf:
        - $ref: '#/components/schemas/BooleanEntitlementValue'
        - $ref: '#/components/schemas/MeteredEntitlementValue'
      discriminator:
        propertyName: type
        mapping:
          BOOLEAN:
            $ref: '#/components/schemas/BooleanEntitlementValue'
          METERED:
            $ref: '#/components/schemas/MeteredEntitlementValue'
    MinimumCommitmentScope:
      oneOf:
        - $ref: '#/components/schemas/AllComponentsScope'
        - $ref: '#/components/schemas/ProductsScope'
      discriminator:
        propertyName: type
        mapping:
          all_components:
            $ref: '#/components/schemas/AllComponentsScope'
          products:
            $ref: '#/components/schemas/ProductsScope'
    OnlineMethodConfig:
      type: object
      required:
        - enabled
      properties:
        enabled:
          type: boolean
    RateFee:
      type: object
      required:
        - rate
      properties:
        rate:
          type: string
          format: decimal
    OneTimeFee:
      type: object
      required:
        - rate
        - quantity
      properties:
        quantity:
          type: integer
          format: int32
          minimum: 0
        rate:
          type: string
          format: decimal
    RecurringFee:
      type: object
      required:
        - rate
        - quantity
        - billing_type
      properties:
        billing_type:
          $ref: '#/components/schemas/BillingTypeEnum'
        quantity:
          type: integer
          format: int32
          minimum: 0
        rate:
          type: string
          format: decimal
    CapacityFee:
      type: object
      required:
        - rate
        - included
        - overage_rate
        - metric_id
      properties:
        included:
          type: integer
          format: int64
          minimum: 0
        metric_id:
          $ref: '#/components/schemas/BillableMetricId'
        overage_rate:
          type: string
          format: decimal
        rate:
          type: string
          format: decimal
    SlotFee:
      type: object
      required:
        - unit
        - unit_rate
        - initial_slots
      properties:
        initial_slots:
          type: integer
          format: int32
          minimum: 0
        max_slots:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        min_slots:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        unit:
          type: string
        unit_rate:
          type: string
          format: decimal
    UsageFee:
      type: object
      required:
        - metric_id
        - model
      properties:
        metric_id:
          $ref: '#/components/schemas/BillableMetricId'
        model:
          $ref: '#/components/schemas/UsagePricingModel'
    CouponId:
      type: string
      format: MeteroidId
      examples:
        - cou_7n42DGM5Tflk9n8mt7Fhc7
    AppliedCouponId:
      type: string
      format: MeteroidId
      examples:
        - sub_cou_7n42DGM5Tflk9n8mt7Fhc7
    CouponDiscount:
      oneOf:
        - $ref: '#/components/schemas/PercentageDiscount'
        - $ref: '#/components/schemas/FixedDiscount'
      discriminator:
        propertyName: type
        mapping:
          FIXED:
            $ref: '#/components/schemas/FixedDiscount'
          PERCENTAGE:
            $ref: '#/components/schemas/PercentageDiscount'
    BooleanEntitlementValue:
      type: object
      required:
        - enabled
      properties:
        enabled:
          type: boolean
    MeteredEntitlementValue:
      type: object
      properties:
        enabled:
          type: boolean
          description: Per-entitlement kill switch. `false` means disabled.
        limit:
          type:
            - string
            - 'null'
          format: decimal
          description: Cap on usage. Null means unlimited.
        reset_period:
          $ref: '#/components/schemas/ResetPeriod'
    AllComponentsScope:
      type: object
      description: Every revenue line counts toward the floor.
    ProductsScope:
      type: object
      description: >-
        Only lines for the listed products count. A product is the identity
        shared by plan

        components, overrides and ad-hoc extras, so a subscription's billed set
        is matched uniformly.
      required:
        - product_ids
      properties:
        product_ids:
          type: array
          items:
            type: string
    BillingTypeEnum:
      type: string
      enum:
        - ADVANCE
        - ARREARS
    BillableMetricId:
      type: string
      format: MeteroidId
      examples:
        - bm_7n42DGM5Tflk9n8mt7Fhc7
    UsagePricingModel:
      oneOf:
        - $ref: '#/components/schemas/PerUnitPricing'
        - $ref: '#/components/schemas/TieredPricing'
        - $ref: '#/components/schemas/VolumePricing'
        - $ref: '#/components/schemas/PackagePricing'
        - $ref: '#/components/schemas/MatrixPricing'
      discriminator:
        propertyName: type
        mapping:
          MATRIX:
            $ref: '#/components/schemas/MatrixPricing'
          PACKAGE:
            $ref: '#/components/schemas/PackagePricing'
          PER_UNIT:
            $ref: '#/components/schemas/PerUnitPricing'
          TIERED:
            $ref: '#/components/schemas/TieredPricing'
          VOLUME:
            $ref: '#/components/schemas/VolumePricing'
    PercentageDiscount:
      type: object
      required:
        - percentage
      properties:
        percentage:
          type: string
    FixedDiscount:
      type: object
      required:
        - currency
        - amount
      properties:
        amount:
          type: string
        currency:
          type: string
    ResetPeriod:
      oneOf:
        - $ref: '#/components/schemas/BillingCycleResetPeriod'
          description: >-
            Resets each time your subscription renews — anchored to your billing
            cycle.
        - $ref: '#/components/schemas/CalendarResetPeriod'
          description: >-
            Resets on calendar boundaries (e.g. the 1st of every month) — not
            tied to subscription start date.
        - $ref: '#/components/schemas/FixedWindowResetPeriod'
          description: >-
            Resets at regular intervals — anchored to your subscription's exact
            activation time.
        - $ref: '#/components/schemas/SlidingWindowResetPeriod'
          description: >-
            Always ends at now — e.g. 30 days means the last 30 days, old usage
            drops off automatically.
        - $ref: '#/components/schemas/NeverResetPeriod'
          description: >-
            Never resets — counts all usage since the subscription was
            activated.
      discriminator:
        propertyName: type
        mapping:
          BILLING_CYCLE:
            $ref: '#/components/schemas/BillingCycleResetPeriod'
          CALENDAR:
            $ref: '#/components/schemas/CalendarResetPeriod'
          FIXED_WINDOW:
            $ref: '#/components/schemas/FixedWindowResetPeriod'
          NEVER:
            $ref: '#/components/schemas/NeverResetPeriod'
          SLIDING_WINDOW:
            $ref: '#/components/schemas/SlidingWindowResetPeriod'
    PerUnitPricing:
      type: object
      required:
        - rate
      properties:
        rate:
          type: string
          format: decimal
    TieredPricing:
      type: object
      required:
        - tiers
      properties:
        block_size:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/TierRow'
    VolumePricing:
      type: object
      required:
        - tiers
      properties:
        block_size:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/TierRow'
    PackagePricing:
      type: object
      required:
        - block_size
        - rate
      properties:
        block_size:
          type: integer
          format: int64
          minimum: 0
        rate:
          type: string
          format: decimal
    MatrixPricing:
      type: object
      required:
        - rates
      properties:
        rates:
          type: array
          items:
            $ref: '#/components/schemas/MatrixRow'
    BillingCycleResetPeriod:
      type: object
      description: >-
        Resets each time your subscription renews — anchored to your billing
        cycle.
    CalendarResetPeriod:
      type: object
      description: >-
        Resets on calendar boundaries (e.g. the 1st of every month) — not tied
        to subscription start date.
      required:
        - unit
        - interval
      properties:
        interval:
          type: integer
          format: int32
          minimum: 0
        unit:
          $ref: '#/components/schemas/CalendarUnit'
    FixedWindowResetPeriod:
      type: object
      description: >-
        Resets at regular intervals — anchored to your subscription's exact
        activation time.
      required:
        - unit
        - interval
      properties:
        interval:
          type: integer
          format: int32
          minimum: 0
        unit:
          $ref: '#/components/schemas/CalendarUnit'
    SlidingWindowResetPeriod:
      type: object
      description: >-
        Always ends at now — e.g. 30 days means the last 30 days, old usage
        drops off automatically.
      required:
        - unit
        - interval
      properties:
        interval:
          type: integer
          format: int32
          minimum: 0
        unit:
          $ref: '#/components/schemas/CalendarUnit'
    NeverResetPeriod:
      type: object
      description: Never resets — counts all usage since the subscription was activated.
    TierRow:
      type: object
      required:
        - first_unit
        - rate
        - flat_fee
        - flat_cap
      properties:
        first_unit:
          type: integer
          format: int64
          minimum: 0
        flat_cap:
          type: string
          format: decimal
        flat_fee:
          type: string
          format: decimal
        rate:
          type: string
          format: decimal
    MatrixRow:
      type: object
      required:
        - dimension1
        - per_unit_price
      properties:
        dimension1:
          $ref: '#/components/schemas/MatrixDimension'
        dimension2:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/MatrixDimension'
        per_unit_price:
          type: string
          format: decimal
    CalendarUnit:
      type: string
      enum:
        - HOUR
        - DAY
        - WEEK
        - MONTH
        - YEAR
    MatrixDimension:
      type: object
      required:
        - key
        - value
      properties:
        key:
          type: string
        value:
          type: string
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````