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

# Update Subscription

> Update a subscription's details.



## OpenAPI

````yaml patch /subscriptions/{subscription_id}
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.105.0
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /subscriptions/{subscription_id}:
    patch:
      tags:
        - Subscriptions
      operationId: patch_subscription_handler
      parameters:
        - name: subscription_id
          in: path
          description: Subscription Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchSubscriptionRequest'
        required: true
      responses:
        '200':
          description: Subscription successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionResponse'
        '422':
          description: Invalid Request Object or Parameters
        '500':
          description: Something went wrong :(
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import DodoPayments from 'dodopayments';


            const client = new DodoPayments({
              bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });


            const subscription = await
            client.subscriptions.update('subscription_id');


            console.log(subscription.brand_id);
        - lang: Python
          source: |-
            import os
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            subscription = client.subscriptions.update(
                subscription_id="subscription_id",
            )
            print(subscription.brand_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tsubscription, err := client.Subscriptions.Update(\n\t\tcontext.TODO(),\n\t\t\"subscription_id\",\n\t\tdodopayments.SubscriptionUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", subscription.BrandID)\n}\n"
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import com.dodopayments.api.models.subscriptions.Subscription;

            import
            com.dodopayments.api.models.subscriptions.SubscriptionUpdateParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    Subscription subscription = client.subscriptions().update("subscription_id");
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import com.dodopayments.api.models.subscriptions.Subscription

            import
            com.dodopayments.api.models.subscriptions.SubscriptionUpdateParams


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val subscription: Subscription = client.subscriptions().update("subscription_id")
            }
        - lang: Ruby
          source: |-
            require "dodopayments"

            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )

            subscription = dodo_payments.subscriptions.update("subscription_id")

            puts(subscription)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;
            use Dodopayments\Misc\CountryCode;
            use Dodopayments\Subscriptions\CancellationFeedback;
            use Dodopayments\Subscriptions\TimeInterval;
            use Dodopayments\Subscriptions\SubscriptionStatus;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $subscription = $client->subscriptions->update(
                'subscription_id',
                billing: [
                  'country' => CountryCode::AF,
                  'city' => 'city',
                  'state' => 'state',
                  'street' => 'street',
                  'zipcode' => 'zipcode',
                ],
                cancelAtNextBillingDate: true,
                cancelReason: 'cancelled_by_customer',
                cancellationComment: 'cancellation_comment',
                cancellationFeedback: CancellationFeedback::TOO_EXPENSIVE,
                creditEntitlementCart: [
                  [
                    'creditEntitlementID' => 'credit_entitlement_id',
                    'creditsAmount' => 'credits_amount',
                    'expiresAfterDays' => 0,
                    'lowBalanceThresholdPercent' => 0,
                    'maxRolloverCount' => 0,
                    'overageEnabled' => true,
                    'overageLimit' => 'overage_limit',
                    'rolloverEnabled' => true,
                    'rolloverPercentage' => 0,
                    'rolloverTimeframeCount' => 0,
                    'rolloverTimeframeInterval' => TimeInterval::DAY,
                  ],
                ],
                customerBusinessName: 'customer_business_name',
                customerName: 'customer_name',
                disableOnDemand: [
                  'nextBillingDate' => new \DateTimeImmutable('2019-12-27T18:11:19.117Z')
                ],
                metadata: ['foo' => 'string'],
                nextBillingDate: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
                status: SubscriptionStatus::PENDING,
                taxID: 'tax_id',
              );

              var_dump($subscription);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using DodoPayments.Client;
            using DodoPayments.Client.Models.Subscriptions;

            DodoPaymentsClient client = new();

            SubscriptionUpdateParams parameters = new()
            {
                SubscriptionID = "subscription_id"
            };

            var subscription = await client.Subscriptions.Update(parameters);

            Console.WriteLine(subscription);
components:
  schemas:
    PatchSubscriptionRequest:
      type: object
      properties:
        billing:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/BillingAddress'
        cancel_at_next_billing_date:
          type:
            - boolean
            - 'null'
          description: >-
            When set, the subscription will remain active until the end of
            billing period
        cancel_reason:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CancelReason'
        cancellation_comment:
          type:
            - string
            - 'null'
          description: >-
            Free-text cancellation comment (only valid when cancelling or
            scheduling cancellation).
        cancellation_feedback:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CancellationFeedback'
              description: >-
                Customer-supplied churn reason (only valid when cancelling or
                scheduling cancellation).
        credit_entitlement_cart:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/UpdateCreditEntitlementCartItem'
          description: Update credit entitlement cart settings
        customer_business_name:
          type:
            - string
            - 'null'
          description: >-
            Optional business / legal name associated with the tax id. When
            provided

            together with a valid tax id for a B2B subscription, this name is
            rendered

            on the invoice instead of the customer's personal name. Send `null`
            to

            explicitly clear the business name.
        customer_name:
          type:
            - string
            - 'null'
        disable_on_demand:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DisableOnDemandReq'
        metadata:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Metadata'
        next_billing_date:
          type:
            - string
            - 'null'
          format: date-time
        status:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SubscriptionStatus'
        tax_id:
          type:
            - string
            - 'null'
    SubscriptionResponse:
      type: object
      description: Response struct representing subscription details
      required:
        - subscription_id
        - recurring_pre_tax_amount
        - tax_inclusive
        - currency
        - status
        - created_at
        - product_id
        - quantity
        - trial_period_days
        - subscription_period_interval
        - payment_frequency_interval
        - subscription_period_count
        - payment_frequency_count
        - next_billing_date
        - previous_billing_date
        - customer
        - metadata
        - cancel_at_next_billing_date
        - billing
        - on_demand
        - addons
        - meters
        - credit_entitlement_cart
        - meter_credit_entitlement_cart
        - brand_id
      properties:
        addons:
          type: array
          items:
            $ref: '#/components/schemas/AddonCartResponseItem'
          description: Addons associated with this subscription
        billing:
          $ref: '#/components/schemas/BillingAddress'
          description: Billing address details for payments
        brand_id:
          type: string
          description: Brand id this subscription belongs to
        cancel_at_next_billing_date:
          type: boolean
          description: Indicates if the subscription will cancel at the next billing date
        cancellation_comment:
          type:
            - string
            - 'null'
          description: Free-text cancellation comment, if any
        cancellation_feedback:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CancellationFeedback'
              description: Customer-supplied churn reason, if any
        cancelled_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Cancelled timestamp if the subscription is cancelled
        created_at:
          type: string
          format: date-time
          description: Timestamp when the subscription was created
        credit_entitlement_cart:
          type: array
          items:
            $ref: '#/components/schemas/CreditEntitlementCartResponse'
          description: Credit entitlement cart settings for this subscription
        currency:
          $ref: '#/components/schemas/Currency'
          description: Currency used for the subscription payments
        custom_field_responses:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/CustomFieldResponse'
          description: Customer's responses to custom fields collected during checkout
        customer:
          $ref: '#/components/schemas/CustomerLimitedDetailsResponse'
          description: Customer details associated with the subscription
        customer_business_name:
          type:
            - string
            - 'null'
          description: >-
            Business / legal name associated with the tax id (B2B). When set
            this is

            used on the invoice in place of the customer's personal name.
        discount_cycles_remaining:
          type:
            - integer
            - 'null'
          format: int32
          description: 'DEPRECATED: Use discounts[].cycles_remaining instead.'
        discount_id:
          type:
            - string
            - 'null'
          description: >-
            DEPRECATED: Use discounts instead. Returns the first discount's ID
            if present.
        discounts:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/DiscountDetailResponse'
          description: All stacked discounts applied, ordered by position
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the subscription will expire
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Additional custom data associated with the subscription
        meter_credit_entitlement_cart:
          type: array
          items:
            $ref: '#/components/schemas/MeterCreditEntitlementCartResponse'
          description: Meter credit entitlement cart settings for this subscription
        meters:
          type: array
          items:
            $ref: '#/components/schemas/MeterCartResponseItem'
          description: Meters associated with this subscription (for usage-based billing)
        next_billing_date:
          type: string
          format: date-time
          description: >-
            Timestamp of the next scheduled billing. Indicates the end of
            current billing period
        on_demand:
          type: boolean
          description: Wether the subscription is on-demand or not
        payment_frequency_count:
          type: integer
          format: int32
          description: Number of payment frequency intervals
        payment_frequency_interval:
          $ref: '#/components/schemas/TimeInterval'
          description: Time interval for payment frequency (e.g. month, year)
        payment_method_id:
          type:
            - string
            - 'null'
          description: Saved payment method id used for recurring charges
        previous_billing_date:
          type: string
          format: date-time
          description: >-
            Timestamp of the last payment. Indicates the start of current
            billing period
        product_id:
          type: string
          description: Identifier of the product associated with this subscription
        quantity:
          type: integer
          format: int32
          description: Number of units/items included in the subscription
        recurring_pre_tax_amount:
          type: integer
          format: int32
          description: >-
            Amount charged before tax for each recurring payment in the
            currency's smallest unit

            (cents for USD, yen for JPY, fils for KWD)
        scheduled_change:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ScheduledPlanChangeResponse'
              description: Scheduled plan change details, if any
        status:
          $ref: '#/components/schemas/SubscriptionStatus'
          description: Current status of the subscription
        subscription_id:
          type: string
          description: Unique identifier for the subscription
        subscription_period_count:
          type: integer
          format: int32
          description: Number of subscription period intervals
        subscription_period_interval:
          $ref: '#/components/schemas/TimeInterval'
          description: Time interval for the subscription period (e.g. month, year)
        tax_id:
          type:
            - string
            - 'null'
          description: Tax identifier provided for this subscription (if applicable)
        tax_inclusive:
          type: boolean
          description: Indicates if the recurring_pre_tax_amount is tax inclusive
        trial_period_days:
          type: integer
          format: int32
          description: Number of days in the trial period (0 if no trial)
    BillingAddress:
      type: object
      required:
        - country
      properties:
        city:
          type:
            - string
            - 'null'
          description: City name
        country:
          $ref: '#/components/schemas/CountryCodeAlpha2'
          description: Two-letter ISO country code (ISO 3166-1 alpha-2)
        state:
          type:
            - string
            - 'null'
          description: State or province name
        street:
          type:
            - string
            - 'null'
          description: >-
            Street address including house number and unit/apartment if
            applicable
        zipcode:
          type:
            - string
            - 'null'
          description: Postal code or ZIP code
    CancelReason:
      type: string
      enum:
        - cancelled_by_customer
        - cancelled_by_merchant
        - cancelled_by_merchant_send_dunning
        - dodo_team
    CancellationFeedback:
      type: string
      enum:
        - too_expensive
        - missing_features
        - switched_service
        - unused
        - customer_service
        - low_quality
        - too_complex
        - other
    UpdateCreditEntitlementCartItem:
      type: object
      required:
        - credit_entitlement_id
      properties:
        credit_entitlement_id:
          type: string
        credits_amount:
          type:
            - string
            - 'null'
        expires_after_days:
          type:
            - integer
            - 'null'
          format: int32
        low_balance_threshold_percent:
          type:
            - integer
            - 'null'
          format: int32
        max_rollover_count:
          type:
            - integer
            - 'null'
          format: int32
        overage_enabled:
          type:
            - boolean
            - 'null'
        overage_limit:
          type:
            - string
            - 'null'
        rollover_enabled:
          type:
            - boolean
            - 'null'
        rollover_percentage:
          type:
            - integer
            - 'null'
          format: int32
        rollover_timeframe_count:
          type:
            - integer
            - 'null'
          format: int32
        rollover_timeframe_interval:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimeInterval'
    DisableOnDemandReq:
      type: object
      title: Disable On Demand Request
      required:
        - next_billing_date
      properties:
        next_billing_date:
          type: string
          format: date-time
    Metadata:
      type: object
      additionalProperties:
        type: string
      propertyNames:
        type: string
    SubscriptionStatus:
      type: string
      enum:
        - pending
        - active
        - on_hold
        - cancelled
        - failed
        - expired
    AddonCartResponseItem:
      type: object
      title: Addon Cart Response Item
      description: Response struct representing subscription details
      required:
        - addon_id
        - quantity
      properties:
        addon_id:
          type: string
        quantity:
          type: integer
          format: int32
    CreditEntitlementCartResponse:
      type: object
      description: >-
        Response struct representing credit entitlement cart details for a
        subscription
      required:
        - credit_entitlement_id
        - credit_entitlement_name
        - unit
        - product_id
        - credits_amount
        - rollover_enabled
        - overage_enabled
        - overage_behavior
        - remaining_balance
        - overage_balance
      properties:
        credit_entitlement_id:
          type: string
        credit_entitlement_name:
          type: string
        credits_amount:
          type: string
        expires_after_days:
          type:
            - integer
            - 'null'
          format: int32
        low_balance_threshold_percent:
          type:
            - integer
            - 'null'
          format: int32
        max_rollover_count:
          type:
            - integer
            - 'null'
          format: int32
        overage_balance:
          type: string
          description: Customer's current overage balance for this entitlement
        overage_behavior:
          $ref: '#/components/schemas/CbbOverageBehavior'
        overage_enabled:
          type: boolean
        overage_limit:
          type:
            - string
            - 'null'
        product_id:
          type: string
        remaining_balance:
          type: string
          description: Customer's current remaining credit balance for this entitlement
        rollover_enabled:
          type: boolean
        rollover_percentage:
          type:
            - integer
            - 'null'
          format: int32
        rollover_timeframe_count:
          type:
            - integer
            - 'null'
          format: int32
        rollover_timeframe_interval:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimeInterval'
        unit:
          type: string
          description: Unit label for the credit entitlement (e.g., "API Calls", "Tokens")
    Currency:
      type: string
      enum:
        - AED
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BWP
        - BYN
        - BZD
        - CAD
        - CHF
        - CLP
        - CNY
        - COP
        - CRC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - 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
        - SEK
        - SGD
        - SHP
        - SLE
        - SLL
        - SOS
        - SRD
        - SSP
        - STN
        - SVC
        - SZL
        - THB
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
    CustomFieldResponse:
      type: object
      description: Customer's response to a custom field
      required:
        - key
        - value
      properties:
        key:
          type: string
          description: Key matching the custom field definition
        value:
          type: string
          description: Value provided by customer
    CustomerLimitedDetailsResponse:
      type: object
      required:
        - customer_id
        - name
        - email
      properties:
        customer_id:
          type: string
          description: Unique identifier for the customer
        email:
          type: string
          description: Email address of the customer
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Additional metadata associated with the customer
        name:
          type: string
          description: Full name of the customer
        phone_number:
          type:
            - string
            - 'null'
          description: Phone number of the customer
    DiscountDetailResponse:
      type: object
      description: |-
        Response struct for a discount with its position in a stack and optional
        cycle-tracking information (for subscriptions).
      required:
        - position
        - discount_id
        - business_id
        - type
        - code
        - amount
        - times_used
        - restricted_to
        - created_at
        - preserve_on_plan_change
        - metadata
      properties:
        amount:
          type: integer
          format: int32
          description: The discount amount in **basis points** (e.g., 540 => 5.4%).
        business_id:
          type: string
          description: The business this discount belongs to
        code:
          type: string
          description: The discount code
        created_at:
          type: string
          format: date-time
          description: Timestamp when the discount was created
        cycles_remaining:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Remaining billing cycles for this discount on this subscription
            (None for one-time payments)
        discount_id:
          type: string
          description: The unique discount ID
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Optional date/time after which discount is expired
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Additional metadata
        name:
          type:
            - string
            - 'null'
          description: Name for the Discount
        position:
          type: integer
          format: int32
          description: Position of this discount in the stack (0-based)
        preserve_on_plan_change:
          type: boolean
          description: >-
            Whether this discount should be preserved when a subscription
            changes plans
        restricted_to:
          type: array
          items:
            type: string
          description: List of product IDs to which this discount is restricted
        subscription_cycles:
          type:
            - integer
            - 'null'
          format: int32
          description: Number of subscription billing cycles this discount is valid for
        times_used:
          type: integer
          format: int32
          description: How many times this discount has been used
        type:
          $ref: '#/components/schemas/DiscountType'
          description: The type of discount
        usage_limit:
          type:
            - integer
            - 'null'
          format: int32
          description: Usage limit for this discount, if any
    MeterCreditEntitlementCartResponse:
      type: object
      description: >-
        Response struct representing meter-credit entitlement mapping cart
        details for a subscription
      required:
        - meter_id
        - meter_name
        - credit_entitlement_id
        - product_id
        - meter_units_per_credit
      properties:
        credit_entitlement_id:
          type: string
        meter_id:
          type: string
        meter_name:
          type: string
        meter_units_per_credit:
          type: string
        product_id:
          type: string
    MeterCartResponseItem:
      type: object
      description: >-
        Response struct representing usage-based meter cart details for a
        subscription
      required:
        - meter_id
        - free_threshold
        - currency
        - name
        - measurement_unit
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        description:
          type:
            - string
            - 'null'
        free_threshold:
          type: integer
          format: int64
        measurement_unit:
          type: string
        meter_id:
          type: string
        name:
          type: string
        price_per_unit:
          type:
            - string
            - 'null'
          example: '10.50'
    TimeInterval:
      type: string
      enum:
        - Day
        - Week
        - Month
        - Year
    ScheduledPlanChangeResponse:
      type: object
      required:
        - id
        - product_id
        - quantity
        - effective_at
        - created_at
        - addons
      properties:
        addons:
          type: array
          items:
            $ref: '#/components/schemas/ScheduledAddonResponse'
          description: Addons included in the scheduled change
        created_at:
          type: string
          format: date-time
          description: When this scheduled change was created
        effective_at:
          type: string
          format: date-time
          description: When the change will be applied
        id:
          type: string
          description: The scheduled plan change ID
        product_description:
          type:
            - string
            - 'null'
          description: Description of the product being changed to
        product_id:
          type: string
          description: The product ID the subscription will change to
        product_name:
          type:
            - string
            - 'null'
          description: Name of the product being changed to
        quantity:
          type: integer
          format: int32
          description: Quantity for the new plan
    CountryCodeAlpha2:
      type: string
      description: ISO country code alpha2 variant
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - KH
        - CM
        - CA
        - CV
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MK
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - SS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SZ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - UM
        - US
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
    CbbOverageBehavior:
      type: string
      description: >-
        Controls how overage is handled at the end of a billing cycle.


        | Preset                  | Charge at billing | Credits reduce overage |
        Preserve overage at reset |

        |-------------------------|:-----------------:|:---------------------:|:-------------------------:|

        | `forgive_at_reset`      | No                | No                    |
        No                        |

        | `invoice_at_billing`    | Yes               | No                    |
        No                        |

        | `carry_deficit`         | No                | No                    |
        Yes                       |

        | `carry_deficit_auto_repay` | No             | Yes                   |
        Yes                       |
      enum:
        - forgive_at_reset
        - invoice_at_billing
        - carry_deficit
        - carry_deficit_auto_repay
    DiscountType:
      type: string
      enum:
        - percentage
      x-stainless-const: true
    ScheduledAddonResponse:
      type: object
      required:
        - addon_id
        - name
        - quantity
      properties:
        addon_id:
          type: string
          description: The addon ID
        name:
          type: string
          description: Name of the addon
        quantity:
          type: integer
          format: int32
          description: Quantity of the addon
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````