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

# Preview Multi Attach

> Previews the billing changes that would occur when attaching multiple plans, without actually making any changes.

Use this endpoint to show customers what they will be charged before confirming a multi-plan subscription.

export const DynamicResponseExample = ({json, statusCode = "200"}) => {
  const toCamelCase = str => {
    return str.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
  };
  const convertKeysToCamelCase = obj => {
    if (Array.isArray(obj)) {
      return obj.map(item => convertKeysToCamelCase(item));
    }
    if (obj !== null && typeof obj === "object") {
      return Object.keys(obj).reduce((acc, key) => {
        const camelKey = toCamelCase(key);
        acc[camelKey] = convertKeysToCamelCase(obj[key]);
        return acc;
      }, {});
    }
    return obj;
  };
  const [isTypeScript, setIsTypeScript] = useState(() => {
    if (typeof window !== "undefined") {
      try {
        const lang = localStorage.getItem("code");
        return JSON.parse(lang) === "typescript";
      } catch {
        return true;
      }
    }
    return true;
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      if (event.detail?.key === "code") {
        try {
          const value = JSON.parse(event.detail.value);
          setIsTypeScript(value === "typescript");
        } catch {}
      }
    };
    const pollInterval = setInterval(() => {
      try {
        const lang = localStorage.getItem("code");
        const value = JSON.parse(lang);
        setIsTypeScript(value === "typescript");
      } catch {}
    }, 300);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, []);
  const camelCaseJson = useMemo(() => convertKeysToCamelCase(json), [json]);
  const snakeCaseString = JSON.stringify(json, null, 2);
  const camelCaseString = JSON.stringify(camelCaseJson, null, 2);
  return <ResponseExample>
			{isTypeScript ? <CodeBlock language="json" filename={statusCode}>
					{camelCaseString}
				</CodeBlock> : <CodeBlock language="json" filename={statusCode}>
					{snakeCaseString}
				</CodeBlock>}
		</ResponseExample>;
};

export const DynamicResponseField = ({children, name, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedName = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(name) : name;
    } catch {
      return name;
    }
  }, [name, lang]);
  return <ResponseField name={resolvedName} {...props}>
			{children}
		</ResponseField>;
};

export const DynamicParamField = ({children, body, path, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedBody = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(body) : body;
    } catch {
      return body;
    }
  }, [body, lang]);
  const resolvedPath = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(path) : path;
    } catch {
      return path;
    }
  }, [path, lang]);
  return <ParamField body={resolvedBody} path={resolvedPath} {...props}>
			{children}
		</ParamField>;
};

### Body Parameters

<DynamicParamField body="customer_id" type="string" required>
  The ID of the customer to attach the plans to.
</DynamicParamField>

<DynamicParamField body="entity_id" type="string">
  The ID of the entity to attach the plans to.
</DynamicParamField>

<DynamicParamField body="plans" type="object[]" required>
  The list of plans to attach to the customer.

  <Expandable title="properties">
    <DynamicParamField body="plan_id" type="string" required>
      The ID of the plan to attach.
    </DynamicParamField>

    <DynamicParamField body="customize" type="object">
      Customize the plan to attach. Can override the price, items, or licenses.

      <Expandable title="properties">
        <DynamicParamField body="price" type="object | null">
          Base price configuration for a plan.

          <Expandable title="properties">
            <DynamicParamField body="amount" type="number" required>
              Base price amount for the plan.
            </DynamicParamField>

            <DynamicParamField body="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'" required>
              Billing interval (e.g. 'month', 'year').
            </DynamicParamField>

            <DynamicParamField body="interval_count" type="number">
              Number of intervals per billing cycle. Defaults to 1.
            </DynamicParamField>

            <DynamicParamField body="additional_currencies" type="object[]">
              Base price amounts in additional currencies. The base 'amount' is in the org's default currency.

              <Expandable title="properties">
                <DynamicParamField body="currency" type="string" required>
                  Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                </DynamicParamField>

                <DynamicParamField body="amount" type="number" required>
                  Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                </DynamicParamField>
              </Expandable>
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>

        <DynamicParamField body="items" type="object[]">
          Override the items in the plan.

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string" required>
              The ID of the feature to configure.
            </DynamicParamField>

            <DynamicParamField body="included" type="number">
              Number of free units included. Balance resets to this each interval for consumable features.
            </DynamicParamField>

            <DynamicParamField body="unlimited" type="boolean">
              If true, customer has unlimited access to this feature.
            </DynamicParamField>

            <DynamicParamField body="reset" type="object">
              Reset configuration for consumable features. Omit for non-consumable features like seats.

              <Expandable title="properties">
                <DynamicParamField body="interval" type="'one_off' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'" required>
                  Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
                </DynamicParamField>

                <DynamicParamField body="interval_count" type="number">
                  Number of intervals between resets. Defaults to 1.
                </DynamicParamField>
              </Expandable>
            </DynamicParamField>

            <DynamicParamField body="price" type="object">
              Pricing for usage beyond included units. Omit for free features.

              <Expandable title="properties">
                <DynamicParamField body="amount" type="number">
                  Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
                </DynamicParamField>

                <DynamicParamField body="additional_currencies" type="object[]">
                  Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.

                  <Expandable title="properties">
                    <DynamicParamField body="currency" type="string" required>
                      Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                    </DynamicParamField>

                    <DynamicParamField body="amount" type="number" required>
                      Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                    </DynamicParamField>
                  </Expandable>
                </DynamicParamField>

                <DynamicParamField body="tiers" type="object[]">
                  Tiered pricing. Either 'amount' or 'tiers' is required.

                  <Expandable title="properties">
                    <DynamicParamField body="to" type="number" required />

                    <DynamicParamField body="amount" type="number" />

                    <DynamicParamField body="flat_amount" type="number" />

                    <DynamicParamField body="additional_currencies" type="object[]">
                      Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.

                      <Expandable title="properties">
                        <DynamicParamField body="currency" type="any" />

                        <DynamicParamField body="amount" type="any" />

                        <DynamicParamField body="flat_amount" type="any" />
                      </Expandable>
                    </DynamicParamField>
                  </Expandable>
                </DynamicParamField>

                <DynamicParamField body="tier_behavior" type="'graduated' | 'volume'" />

                <DynamicParamField body="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'" required>
                  Billing interval. For consumable features, should match reset.interval.
                </DynamicParamField>

                <DynamicParamField body="interval_count" type="number">
                  Number of intervals per billing cycle. Defaults to 1.
                </DynamicParamField>

                <DynamicParamField body="billing_units" type="number">
                  Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
                </DynamicParamField>

                <DynamicParamField body="billing_method" type="'prepaid' | 'usage_based'" required>
                  'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
                </DynamicParamField>

                <DynamicParamField body="max_purchase" type="number | null">
                  Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
                </DynamicParamField>
              </Expandable>
            </DynamicParamField>

            <DynamicParamField body="proration" type="object">
              Proration settings for prepaid features. Controls mid-cycle quantity change billing.

              <Expandable title="properties">
                <DynamicParamField body="on_increase" type="'bill_immediately' | 'prorate_immediately' | 'prorate_next_cycle' | 'bill_next_cycle'" required>
                  Billing behavior when quantity increases mid-cycle.
                </DynamicParamField>

                <DynamicParamField body="on_decrease" type="'prorate' | 'prorate_immediately' | 'prorate_next_cycle' | 'none' | 'no_prorations'" required>
                  Credit behavior when quantity decreases mid-cycle.
                </DynamicParamField>
              </Expandable>
            </DynamicParamField>

            <DynamicParamField body="rollover" type="object">
              Rollover config for unused units. If set, unused included units carry over.

              <Expandable title="properties">
                <DynamicParamField body="max" type="number">
                  Max rollover units. Omit for unlimited rollover.
                </DynamicParamField>

                <DynamicParamField body="max_percentage" type="number">
                  Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
                </DynamicParamField>

                <DynamicParamField body="expiry_duration_type" type="'month' | 'forever'" required>
                  When rolled over units expire.
                </DynamicParamField>

                <DynamicParamField body="expiry_duration_length" type="number">
                  Number of periods before expiry.
                </DynamicParamField>
              </Expandable>
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>
      </Expandable>
    </DynamicParamField>

    <DynamicParamField body="feature_quantities" type="object[]">
      If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature.

      <Expandable title="properties">
        <DynamicParamField body="feature_id" type="string" required>
          The ID of the feature to set quantity for.
        </DynamicParamField>

        <DynamicParamField body="quantity" type="number">
          The quantity of the feature.
        </DynamicParamField>

        <DynamicParamField body="adjustable" type="boolean">
          Whether the customer can adjust the quantity.
        </DynamicParamField>
      </Expandable>
    </DynamicParamField>

    <DynamicParamField body="version" type="number">
      The version of the plan to attach.
    </DynamicParamField>

    <DynamicParamField body="subscription_id" type="string">
      A unique ID to identify this subscription. Useful when attaching the same plan multiple times.
    </DynamicParamField>
  </Expandable>
</DynamicParamField>

<DynamicParamField body="free_trial" type="object | null">
  Free trial configuration for a plan.

  <Expandable title="properties">
    <DynamicParamField body="duration_length" type="number" required>
      Number of duration\_type periods the trial lasts.
    </DynamicParamField>

    <DynamicParamField body="duration_type" type="'day' | 'month' | 'year'">
      Unit of time for the trial ('day', 'month', 'year').
    </DynamicParamField>

    <DynamicParamField body="card_required" type="boolean">
      If true, payment method required to start trial. Customer is charged after trial ends.
    </DynamicParamField>

    <DynamicParamField body="on_end" type="'bill' | 'revert'">
      Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
    </DynamicParamField>
  </Expandable>
</DynamicParamField>

<DynamicParamField body="currency" type="string">
  Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
</DynamicParamField>

<DynamicParamField body="invoice_mode" type="object">
  Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.

  <Expandable title="properties">
    <DynamicParamField body="enabled" type="boolean" required>
      When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send\_invoice collection method.
    </DynamicParamField>

    <DynamicParamField body="enable_plan_immediately" type="boolean">
      If true, enables the plan immediately even though the invoice is not paid yet.
    </DynamicParamField>

    <DynamicParamField body="finalize" type="boolean">
      If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review.
    </DynamicParamField>

    <DynamicParamField body="invoice_template_id" type="string">
      ID of an invoice template (configured in billing settings) whose footer (e.g. bank details) is applied to the invoice.
    </DynamicParamField>

    <DynamicParamField body="net_terms_days" type="integer">
      Number of days the customer has to pay the invoice before it is due (Stripe days\_until\_due).
    </DynamicParamField>
  </Expandable>
</DynamicParamField>

<DynamicParamField body="discounts" type="object[]">
  List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.

  <Expandable title="properties">
    <DynamicParamField body="reward_id" type="string">
      The ID of the reward to apply as a discount.
    </DynamicParamField>

    <DynamicParamField body="promotion_code" type="string">
      The promotion code to apply as a discount.
    </DynamicParamField>
  </Expandable>
</DynamicParamField>

<DynamicParamField body="success_url" type="string">
  URL to redirect to after successful checkout.
</DynamicParamField>

<DynamicParamField body="checkout_session_params" type="object">
  Additional parameters to pass into the creation of the Stripe checkout session.
</DynamicParamField>

<DynamicParamField body="redirect_mode" type="'always' | 'if_required' | 'never'">
  Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if\_required' only when payment action is needed, 'never' disables redirects.
</DynamicParamField>

<DynamicParamField body="new_billing_subscription" type="boolean">
  Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.
</DynamicParamField>

<DynamicParamField body="enable_plan_immediately" type="boolean">
  If true, the cusProducts are activated immediately even when payment is pending via Stripe checkout.
</DynamicParamField>

<DynamicParamField body="customer_data" type="object">
  Customer details to set when creating a customer

  <Expandable title="properties">
    <DynamicParamField body="name" type="string | null">
      Customer's name
    </DynamicParamField>

    <DynamicParamField body="email" type="string | null">
      Customer's email address
    </DynamicParamField>

    <DynamicParamField body="fingerprint" type="string | null">
      Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse
    </DynamicParamField>

    <DynamicParamField body="metadata" type="object | null">
      Additional metadata for the customer
    </DynamicParamField>

    <DynamicParamField body="stripe_id" type="string | null">
      Stripe customer ID if you already have one
    </DynamicParamField>

    <DynamicParamField body="create_in_stripe" type="boolean">
      Whether to create the customer in Stripe
    </DynamicParamField>

    <DynamicParamField body="auto_enable_plan_id" type="string">
      The ID of the free plan to auto-enable for the customer
    </DynamicParamField>

    <DynamicParamField body="send_email_receipts" type="boolean">
      Whether to send email receipts to this customer
    </DynamicParamField>

    <DynamicParamField body="currency" type="string | null">
      Currency to bill this customer in (e.g. usd, eur). Defaults to the organization's default currency.
    </DynamicParamField>

    <DynamicParamField body="billing_controls" type="object">
      Billing controls for the customer (auto top-ups, etc.)

      <Expandable title="properties">
        <DynamicParamField body="auto_topups" type="object[]">
          List of auto top-up configurations per feature.

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string" required>
              The ID of the feature (credit balance) to auto top-up.
            </DynamicParamField>

            <DynamicParamField body="enabled" type="boolean">
              Whether auto top-up is enabled.
            </DynamicParamField>

            <DynamicParamField body="threshold" type="number" required>
              When the balance drops below this threshold, an auto top-up will be purchased.
            </DynamicParamField>

            <DynamicParamField body="quantity" type="number" required>
              Amount of credits to add per auto top-up.
            </DynamicParamField>

            <DynamicParamField body="purchase_limit" type="object">
              Optional rate limit to cap how often auto top-ups occur.

              <Expandable title="properties">
                <DynamicParamField body="interval" type="'hour' | 'day' | 'week' | 'month'" required>
                  The time interval for the purchase limit window.
                </DynamicParamField>

                <DynamicParamField body="interval_count" type="number">
                  Number of intervals in the purchase limit window.
                </DynamicParamField>

                <DynamicParamField body="limit" type="number" required>
                  Maximum number of auto top-ups allowed within the interval.
                </DynamicParamField>
              </Expandable>
            </DynamicParamField>

            <DynamicParamField body="invoice_mode" type="boolean">
              When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>

        <DynamicParamField body="spend_limits" type="object[]">
          List of overage spend limits per feature (caps overage spend).

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string">
              Optional feature ID this spend limit applies to.
            </DynamicParamField>

            <DynamicParamField body="enabled" type="boolean">
              Whether the overage spend limit is enabled.
            </DynamicParamField>

            <DynamicParamField body="limit_type" type="'absolute' | 'usage_percentage'">
              How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
            </DynamicParamField>

            <DynamicParamField body="overage_limit" type="number">
              Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
            </DynamicParamField>

            <DynamicParamField body="skip_overage_billing" type="boolean">
              When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>

        <DynamicParamField body="usage_limits" type="object[]">
          List of hard usage caps per feature (max units per interval).

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string" required>
              The feature this usage limit applies to.
            </DynamicParamField>

            <DynamicParamField body="enabled" type="boolean">
              Whether this usage limit is enabled.
            </DynamicParamField>

            <DynamicParamField body="limit" type="number" required>
              Maximum units allowed per interval.
            </DynamicParamField>

            <DynamicParamField body="interval" type="'day' | 'week' | 'month' | 'year'" required>
              Interval for the cap, aligned to the customer's billing cycle.
            </DynamicParamField>

            <DynamicParamField body="filter" type="object">
              When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.

              <Expandable title="properties">
                <DynamicParamField body="properties.{key}" type="string" required />
              </Expandable>
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>

        <DynamicParamField body="usage_alerts" type="object[]">
          List of usage alert configurations per feature.

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string">
              The feature ID this alert applies to.
            </DynamicParamField>

            <DynamicParamField body="enabled" type="boolean">
              Whether this usage alert is enabled.
            </DynamicParamField>

            <DynamicParamField body="threshold" type="number" required>
              The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
            </DynamicParamField>

            <DynamicParamField body="threshold_type" type="'usage' | 'usage_percentage' | 'remaining' | 'remaining_percentage'" required>
              Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
            </DynamicParamField>

            <DynamicParamField body="name" type="string">
              Optional user-defined label to distinguish multiple alerts on the same feature.
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>

        <DynamicParamField body="overage_allowed" type="object[]">
          List of overage allowed controls per feature. When enabled, usage can exceed balance.

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string" required>
              The feature ID this overage allowed control applies to.
            </DynamicParamField>

            <DynamicParamField body="enabled" type="boolean">
              Whether overage is allowed for this feature.
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>
      </Expandable>
    </DynamicParamField>

    <DynamicParamField body="config" type="object">
      Miscellaneous configurations for the customer.

      <Expandable title="properties">
        <DynamicParamField body="disable_pooled_balance" type="boolean">
          Whether to disable the shared customer-level pool for entities.
        </DynamicParamField>

        <DynamicParamField body="disable_overage_billing" type="boolean">
          Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
        </DynamicParamField>
      </Expandable>
    </DynamicParamField>
  </Expandable>
</DynamicParamField>

<DynamicParamField body="entity_data" type="object">
  <Expandable title="properties">
    <DynamicParamField body="feature_id" type="string" required>
      The feature ID that this entity is associated with
    </DynamicParamField>

    <DynamicParamField body="name" type="string">
      Name of the entity
    </DynamicParamField>

    <DynamicParamField body="billing_controls" type="object">
      Billing controls for the entity.

      <Expandable title="properties">
        <DynamicParamField body="spend_limits" type="object[]">
          List of spend limits per feature. Each entry caps overage (overage\_limit) and/or per-interval usage (usage\_limit).

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string">
              Optional feature ID this spend limit applies to.
            </DynamicParamField>

            <DynamicParamField body="enabled" type="boolean">
              Whether the overage spend limit is enabled.
            </DynamicParamField>

            <DynamicParamField body="limit_type" type="'absolute' | 'usage_percentage'">
              How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
            </DynamicParamField>

            <DynamicParamField body="overage_limit" type="number">
              Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
            </DynamicParamField>

            <DynamicParamField body="skip_overage_billing" type="boolean">
              When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>

        <DynamicParamField body="usage_limits" type="object[]">
          List of hard usage caps per feature for this entity. An entity entry overrides the customer's for that feature.

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string" required>
              The feature this usage limit applies to.
            </DynamicParamField>

            <DynamicParamField body="enabled" type="boolean">
              Whether this usage limit is enabled.
            </DynamicParamField>

            <DynamicParamField body="limit" type="number" required>
              Maximum units allowed per interval.
            </DynamicParamField>

            <DynamicParamField body="interval" type="'day' | 'week' | 'month' | 'year'" required>
              Interval for the cap, aligned to the customer's billing cycle.
            </DynamicParamField>

            <DynamicParamField body="filter" type="object">
              When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.

              <Expandable title="properties">
                <DynamicParamField body="properties.{key}" type="string" required />
              </Expandable>
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>

        <DynamicParamField body="usage_alerts" type="object[]">
          List of usage alert configurations per feature.

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string">
              The feature ID this alert applies to.
            </DynamicParamField>

            <DynamicParamField body="enabled" type="boolean">
              Whether this usage alert is enabled.
            </DynamicParamField>

            <DynamicParamField body="threshold" type="number" required>
              The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
            </DynamicParamField>

            <DynamicParamField body="threshold_type" type="'usage' | 'usage_percentage' | 'remaining' | 'remaining_percentage'" required>
              Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
            </DynamicParamField>

            <DynamicParamField body="name" type="string">
              Optional user-defined label to distinguish multiple alerts on the same feature.
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>

        <DynamicParamField body="overage_allowed" type="object[]">
          List of overage allowed controls per feature. When enabled, usage can exceed balance.

          <Expandable title="properties">
            <DynamicParamField body="feature_id" type="string" required>
              The feature ID this overage allowed control applies to.
            </DynamicParamField>

            <DynamicParamField body="enabled" type="boolean">
              Whether overage is allowed for this feature.
            </DynamicParamField>
          </Expandable>
        </DynamicParamField>
      </Expandable>
    </DynamicParamField>
  </Expandable>
</DynamicParamField>

### Response

<DynamicResponseField name="customer_id" type="string">
  The ID of the customer.
</DynamicResponseField>

<DynamicResponseField name="line_items" type="object[]">
  <Expandable title="properties">
    <DynamicResponseField name="display_name" type="string">
      The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
    </DynamicResponseField>

    <DynamicResponseField name="description" type="string">
      A detailed description of the line item.
    </DynamicResponseField>

    <DynamicResponseField name="subtotal" type="number">
      The amount in cents before discounts and tax for this line item.
    </DynamicResponseField>

    <DynamicResponseField name="total" type="number">
      The final amount in cents after discounts and tax for this line item.
    </DynamicResponseField>

    <DynamicResponseField name="discounts" type="object[]">
      List of discounts applied to this line item.

      <Expandable title="properties">
        <DynamicResponseField name="amount_off" type="number" />

        <DynamicResponseField name="percent_off" type="number" />

        <DynamicResponseField name="reward_id" type="string" />

        <DynamicResponseField name="reward_name" type="string" />
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="plan_id" type="string">
      The ID of the plan that this line item belongs to.
    </DynamicResponseField>

    <DynamicResponseField name="feature_id" type="string | null">
      The ID of the feature that this line item belongs to.
    </DynamicResponseField>

    <DynamicResponseField name="period" type="object">
      The period of time that this line item is being charged for.

      <Expandable title="properties">
        <DynamicResponseField name="start" type="number">
          The start of the period in milliseconds since the Unix epoch.
        </DynamicResponseField>

        <DynamicResponseField name="end" type="number">
          The end of the period in milliseconds since the Unix epoch.
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="quantity" type="number">
      The quantity of the line item.
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="subtotal" type="number">
  The total amount in cents before discounts and tax for the current billing period.
</DynamicResponseField>

<DynamicResponseField name="total" type="number">
  The final amount in cents after discounts and tax for the current billing period.
</DynamicResponseField>

<DynamicResponseField name="currency" type="string">
  The three-letter ISO currency code (e.g., 'usd').
</DynamicResponseField>

<DynamicResponseField name="next_cycle" type="object">
  Preview of the next billing cycle, if applicable. This shows what the customer will be charged in subsequent cycles.

  <Expandable title="properties">
    <DynamicResponseField name="starts_at" type="number">
      Unix timestamp (milliseconds) when the next billing cycle starts.
    </DynamicResponseField>

    <DynamicResponseField name="subtotal" type="number">
      The total amount in cents before discounts and tax for the next cycle.
    </DynamicResponseField>

    <DynamicResponseField name="total" type="number">
      The final amount in cents after discounts and tax for the next cycle.
    </DynamicResponseField>

    <DynamicResponseField name="line_items" type="object[]">
      List of line items for the next billing cycle.

      <Expandable title="properties">
        <DynamicResponseField name="display_name" type="string">
          The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
        </DynamicResponseField>

        <DynamicResponseField name="description" type="string">
          A detailed description of the line item.
        </DynamicResponseField>

        <DynamicResponseField name="subtotal" type="number">
          The amount in cents before discounts and tax for this line item.
        </DynamicResponseField>

        <DynamicResponseField name="total" type="number">
          The final amount in cents after discounts and tax for this line item.
        </DynamicResponseField>

        <DynamicResponseField name="discounts" type="object[]">
          List of discounts applied to this line item.

          <Expandable title="properties">
            <DynamicResponseField name="amount_off" type="number" />

            <DynamicResponseField name="percent_off" type="number" />

            <DynamicResponseField name="reward_id" type="string" />

            <DynamicResponseField name="reward_name" type="string" />
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="plan_id" type="string">
          The ID of the plan that this line item belongs to.
        </DynamicResponseField>

        <DynamicResponseField name="feature_id" type="string | null">
          The ID of the feature that this line item belongs to.
        </DynamicResponseField>

        <DynamicResponseField name="period" type="object">
          The period of time that this line item is being charged for.

          <Expandable title="properties">
            <DynamicResponseField name="start" type="number">
              The start of the period in milliseconds since the Unix epoch.
            </DynamicResponseField>

            <DynamicResponseField name="end" type="number">
              The end of the period in milliseconds since the Unix epoch.
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="quantity" type="number">
          The quantity of the line item.
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="usage_line_items" type="object[]">
      List of line items for usage-based features in the next cycle.

      <Expandable title="properties">
        <DynamicResponseField name="display_name" type="string">
          The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
        </DynamicResponseField>

        <DynamicResponseField name="plan_id" type="string">
          The ID of the plan that this line item belongs to.
        </DynamicResponseField>

        <DynamicResponseField name="feature_id" type="string | null">
          The ID of the feature that this line item belongs to.
        </DynamicResponseField>

        <DynamicResponseField name="period" type="object">
          The period of time that this line item is being charged for.

          <Expandable title="properties">
            <DynamicResponseField name="start" type="number">
              The start of the period in milliseconds since the Unix epoch.
            </DynamicResponseField>

            <DynamicResponseField name="end" type="number">
              The end of the period in milliseconds since the Unix epoch.
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="expand" type="string[]">
  Expand the response with additional data.
</DynamicResponseField>

<DynamicResponseField name="incoming" type="object[]">
  Products or subscription changes being added or updated.

  <Expandable title="properties">
    <DynamicResponseField name="plan_id" type="string">
      The ID of the plan affected by this preview change.
    </DynamicResponseField>

    <DynamicResponseField name="plan" type="object">
      The full plan object if it was expanded in the response.

      <Expandable title="properties">
        <DynamicResponseField name="id" type="string">
          Unique identifier for the plan.
        </DynamicResponseField>

        <DynamicResponseField name="name" type="string">
          Display name of the plan.
        </DynamicResponseField>

        <DynamicResponseField name="description" type="string | null">
          Optional description of the plan.
        </DynamicResponseField>

        <DynamicResponseField name="group" type="string | null">
          Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
        </DynamicResponseField>

        <DynamicResponseField name="version" type="number">
          Version number of the plan. Incremented when plan configuration changes.
        </DynamicResponseField>

        <DynamicResponseField name="add_on" type="boolean">
          Whether this is an add-on plan that can be attached alongside a main plan.
        </DynamicResponseField>

        <DynamicResponseField name="auto_enable" type="boolean">
          If true, this plan is automatically attached when a customer is created. Used for free plans.
        </DynamicResponseField>

        <DynamicResponseField name="price" type="object | null">
          Base recurring price for the plan. Null for free plans or usage-only plans.

          <Expandable title="properties">
            <DynamicResponseField name="amount" type="number">
              Base price amount for the plan.
            </DynamicResponseField>

            <DynamicResponseField name="additional_currencies" type="object[]">
              Base price amounts in additional currencies. The base 'amount' is in the org's default currency.

              <Expandable title="properties">
                <DynamicResponseField name="currency" type="string">
                  Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                </DynamicResponseField>

                <DynamicResponseField name="amount" type="number">
                  Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
              Billing interval (e.g. 'month', 'year').
            </DynamicResponseField>

            <DynamicResponseField name="interval_count" type="number">
              Number of intervals per billing cycle. Defaults to 1.
            </DynamicResponseField>

            <DynamicResponseField name="display" type="object">
              Display text for showing this price in pricing pages.

              <Expandable title="properties">
                <DynamicResponseField name="primary_text" type="string">
                  Main display text (e.g. '\$10' or '100 messages').
                </DynamicResponseField>

                <DynamicResponseField name="secondary_text" type="string">
                  Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="items" type="object[]">
          Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.

          <Expandable title="properties">
            <DynamicResponseField name="feature_id" type="string">
              The ID of the feature this item configures.
            </DynamicResponseField>

            <DynamicResponseField name="feature" type="object">
              The full feature object if expanded.

              <Expandable title="properties">
                <DynamicResponseField name="id" type="string">
                  The ID of the feature, used to refer to it in other API calls like /track or /check.
                </DynamicResponseField>

                <DynamicResponseField name="name" type="string | null">
                  The name of the feature.
                </DynamicResponseField>

                <DynamicResponseField name="type" type="'static' | 'boolean' | 'single_use' | 'continuous_use' | 'credit_system' | 'ai_credit_system'">
                  The type of the feature
                </DynamicResponseField>

                <DynamicResponseField name="display" type="object | null">
                  Singular and plural display names for the feature.

                  <Expandable title="properties">
                    <DynamicResponseField name="singular" type="string">
                      The singular display name for the feature.
                    </DynamicResponseField>

                    <DynamicResponseField name="plural" type="string">
                      The plural display name for the feature.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="credit_schema" type="object[] | null">
                  Credit cost schema for credit system features.

                  <Expandable title="properties">
                    <DynamicResponseField name="metered_feature_id" type="string">
                      The ID of the metered feature (should be a single\_use feature).
                    </DynamicResponseField>

                    <DynamicResponseField name="credit_cost" type="number">
                      The credit cost of the metered feature.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="archived" type="boolean | null">
                  Whether or not the feature is archived.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="included" type="number">
              Number of free units included. For consumable features, balance resets to this number each interval.
            </DynamicResponseField>

            <DynamicResponseField name="unlimited" type="boolean">
              Whether the customer has unlimited access to this feature.
            </DynamicResponseField>

            <DynamicResponseField name="reset" type="object | null">
              Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.

              <Expandable title="properties">
                <DynamicResponseField name="interval" type="'one_off' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                  The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
                </DynamicResponseField>

                <DynamicResponseField name="interval_count" type="number">
                  Number of intervals between resets. Defaults to 1.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="price" type="object | null">
              Pricing configuration for usage beyond included units. Null if feature is entirely free.

              <Expandable title="properties">
                <DynamicResponseField name="amount" type="number">
                  Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
                </DynamicResponseField>

                <DynamicResponseField name="additional_currencies" type="object[]">
                  Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).

                  <Expandable title="properties">
                    <DynamicResponseField name="currency" type="string">
                      Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                    </DynamicResponseField>

                    <DynamicResponseField name="amount" type="number">
                      Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="tiers" type="object[]">
                  Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.

                  <Expandable title="properties">
                    <DynamicResponseField name="to" type="number" />

                    <DynamicResponseField name="amount" type="number" />

                    <DynamicResponseField name="flat_amount" type="number" />

                    <DynamicResponseField name="additional_currencies" type="object[]">
                      <Expandable title="properties">
                        <DynamicResponseField name="currency" type="string">
                          Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                        </DynamicResponseField>

                        <DynamicResponseField name="amount" type="number">
                          Per-unit amount for this tier in this currency.
                        </DynamicResponseField>

                        <DynamicResponseField name="flat_amount" type="number">
                          Flat amount for this tier in this currency, if the tier uses one.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="tier_behavior" type="'graduated' | 'volume'" />

                <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                  Billing interval for this price. For consumable features, should match reset.interval.
                </DynamicResponseField>

                <DynamicResponseField name="interval_count" type="number">
                  Number of intervals per billing cycle. Defaults to 1.
                </DynamicResponseField>

                <DynamicResponseField name="billing_units" type="number">
                  Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
                </DynamicResponseField>

                <DynamicResponseField name="billing_method" type="'prepaid' | 'usage_based'">
                  'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
                </DynamicResponseField>

                <DynamicResponseField name="max_purchase" type="number | null">
                  Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="display" type="object">
              Display text for showing this item in pricing pages.

              <Expandable title="properties">
                <DynamicResponseField name="primary_text" type="string">
                  Main display text (e.g. '\$10' or '100 messages').
                </DynamicResponseField>

                <DynamicResponseField name="secondary_text" type="string">
                  Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="rollover" type="object">
              Rollover configuration for unused units. If set, unused included units roll over to the next period.

              <Expandable title="properties">
                <DynamicResponseField name="max" type="number | null">
                  Maximum rollover units. Null for unlimited rollover.
                </DynamicResponseField>

                <DynamicResponseField name="max_percentage" type="number | null">
                  Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
                </DynamicResponseField>

                <DynamicResponseField name="expiry_duration_type" type="'month' | 'forever'">
                  When rolled over units expire.
                </DynamicResponseField>

                <DynamicResponseField name="expiry_duration_length" type="number">
                  Number of periods before expiry.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="free_trial" type="object">
          Free trial configuration. If set, new customers can try this plan before being charged.

          <Expandable title="properties">
            <DynamicResponseField name="duration_length" type="number">
              Number of duration\_type periods the trial lasts.
            </DynamicResponseField>

            <DynamicResponseField name="duration_type" type="'day' | 'month' | 'year'">
              Unit of time for the trial duration ('day', 'month', 'year').
            </DynamicResponseField>

            <DynamicResponseField name="card_required" type="boolean">
              Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
            </DynamicResponseField>

            <DynamicResponseField name="on_end" type="'bill' | 'revert'">
              Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="created_at" type="number">
          Unix timestamp (ms) when the plan was created.
        </DynamicResponseField>

        <DynamicResponseField name="env" type="'sandbox' | 'live'">
          Environment this plan belongs to ('sandbox' or 'live').
        </DynamicResponseField>

        <DynamicResponseField name="archived" type="boolean">
          Whether the plan is archived. Archived plans cannot be attached to new customers.
        </DynamicResponseField>

        <DynamicResponseField name="base_variant_id" type="string | null">
          Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
        </DynamicResponseField>

        <DynamicResponseField name="variant_details" type="object">
          Details about how this variant relates to its latest base plan.

          <Expandable title="properties">
            <DynamicResponseField name="base_plan_id" type="string">
              The ID of the base plan this variant was derived from.
            </DynamicResponseField>

            <DynamicResponseField name="customize" type="object">
              The customization that transforms the base plan into this variant.

              <Expandable title="properties">
                <DynamicResponseField name="price" type="object | null">
                  Base price configuration for a plan.

                  <Expandable title="properties">
                    <DynamicResponseField name="amount" type="number">
                      Base price amount for the plan.
                    </DynamicResponseField>

                    <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                      Billing interval (e.g. 'month', 'year').
                    </DynamicResponseField>

                    <DynamicResponseField name="interval_count" type="number">
                      Number of intervals per billing cycle. Defaults to 1.
                    </DynamicResponseField>

                    <DynamicResponseField name="additional_currencies" type="object[]">
                      Base price amounts in additional currencies. The base 'amount' is in the org's default currency.

                      <Expandable title="properties">
                        <DynamicResponseField name="currency" type="string">
                          Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                        </DynamicResponseField>

                        <DynamicResponseField name="amount" type="number">
                          Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="add_items" type="object[]">
                  Items to add to the plan.

                  <Expandable title="properties">
                    <DynamicResponseField name="feature_id" type="string">
                      The ID of the feature to configure.
                    </DynamicResponseField>

                    <DynamicResponseField name="included" type="number">
                      Number of free units included. Balance resets to this each interval for consumable features.
                    </DynamicResponseField>

                    <DynamicResponseField name="unlimited" type="boolean">
                      If true, customer has unlimited access to this feature.
                    </DynamicResponseField>

                    <DynamicResponseField name="reset" type="object">
                      Reset configuration for consumable features. Omit for non-consumable features like seats.

                      <Expandable title="properties">
                        <DynamicResponseField name="interval" type="'one_off' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                          Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
                        </DynamicResponseField>

                        <DynamicResponseField name="interval_count" type="number">
                          Number of intervals between resets. Defaults to 1.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="price" type="object">
                      Pricing for usage beyond included units. Omit for free features.

                      <Expandable title="properties">
                        <DynamicResponseField name="amount" type="number">
                          Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
                        </DynamicResponseField>

                        <DynamicResponseField name="additional_currencies" type="object[]">
                          Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.

                          <Expandable title="properties">
                            <DynamicResponseField name="currency" type="string">
                              Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                            </DynamicResponseField>

                            <DynamicResponseField name="amount" type="number">
                              Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                            </DynamicResponseField>
                          </Expandable>
                        </DynamicResponseField>

                        <DynamicResponseField name="tiers" type="object[]">
                          Tiered pricing. Either 'amount' or 'tiers' is required.

                          <Expandable title="properties">
                            <DynamicResponseField name="to" type="number" />

                            <DynamicResponseField name="amount" type="number" />

                            <DynamicResponseField name="flat_amount" type="number" />

                            <DynamicResponseField name="additional_currencies" type="object[]">
                              <Expandable title="properties">
                                <DynamicResponseField name="currency" type="string">
                                  Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                                </DynamicResponseField>

                                <DynamicResponseField name="amount" type="number">
                                  Per-unit amount for this tier in this currency.
                                </DynamicResponseField>

                                <DynamicResponseField name="flat_amount" type="number">
                                  Flat amount for this tier in this currency, if the tier uses one.
                                </DynamicResponseField>
                              </Expandable>
                            </DynamicResponseField>
                          </Expandable>
                        </DynamicResponseField>

                        <DynamicResponseField name="tier_behavior" type="'graduated' | 'volume'" />

                        <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                          Billing interval. For consumable features, should match reset.interval.
                        </DynamicResponseField>

                        <DynamicResponseField name="interval_count" type="number">
                          Number of intervals per billing cycle. Defaults to 1.
                        </DynamicResponseField>

                        <DynamicResponseField name="billing_units" type="number">
                          Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
                        </DynamicResponseField>

                        <DynamicResponseField name="billing_method" type="'prepaid' | 'usage_based'">
                          'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
                        </DynamicResponseField>

                        <DynamicResponseField name="max_purchase" type="number | null">
                          Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="proration" type="object">
                      Proration settings for prepaid features. Controls mid-cycle quantity change billing.

                      <Expandable title="properties">
                        <DynamicResponseField name="on_increase" type="'bill_immediately' | 'prorate_immediately' | 'prorate_next_cycle' | 'bill_next_cycle'">
                          Billing behavior when quantity increases mid-cycle.
                        </DynamicResponseField>

                        <DynamicResponseField name="on_decrease" type="'prorate' | 'prorate_immediately' | 'prorate_next_cycle' | 'none' | 'no_prorations'">
                          Credit behavior when quantity decreases mid-cycle.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="rollover" type="object">
                      Rollover config for unused units. If set, unused included units carry over.

                      <Expandable title="properties">
                        <DynamicResponseField name="max" type="number">
                          Max rollover units. Omit for unlimited rollover.
                        </DynamicResponseField>

                        <DynamicResponseField name="max_percentage" type="number">
                          Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
                        </DynamicResponseField>

                        <DynamicResponseField name="expiry_duration_type" type="'month' | 'forever'">
                          When rolled over units expire.
                        </DynamicResponseField>

                        <DynamicResponseField name="expiry_duration_length" type="number">
                          Number of periods before expiry.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="remove_items" type="object[]">
                  Filters selecting items to remove from the plan.

                  <Expandable title="properties">
                    <DynamicResponseField name="feature_id" type="string">
                      Match items linked to this feature.
                    </DynamicResponseField>

                    <DynamicResponseField name="billing_method" type="'prepaid' | 'usage_based'">
                      Match items with this billing method (prepaid or usage\_based).
                    </DynamicResponseField>

                    <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                      Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
                    </DynamicResponseField>

                    <DynamicResponseField name="interval_count" type="integer">
                      Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="free_trial" type="object | null">
                  Free trial configuration for a plan.

                  <Expandable title="properties">
                    <DynamicResponseField name="duration_length" type="number">
                      Number of duration\_type periods the trial lasts.
                    </DynamicResponseField>

                    <DynamicResponseField name="duration_type" type="'day' | 'month' | 'year'">
                      Unit of time for the trial ('day', 'month', 'year').
                    </DynamicResponseField>

                    <DynamicResponseField name="card_required" type="boolean">
                      If true, payment method required to start trial. Customer is charged after trial ends.
                    </DynamicResponseField>

                    <DynamicResponseField name="on_end" type="'bill' | 'revert'">
                      Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="billing_controls" type="object">
                  Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.

                  <Expandable title="properties">
                    <DynamicResponseField name="auto_topups" type="object[]">
                      List of auto top-up configurations per feature.

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          The ID of the feature (credit balance) to auto top-up.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether auto top-up is enabled.
                        </DynamicResponseField>

                        <DynamicResponseField name="threshold" type="number">
                          When the balance drops below this threshold, an auto top-up will be purchased.
                        </DynamicResponseField>

                        <DynamicResponseField name="quantity" type="number">
                          Amount of credits to add per auto top-up.
                        </DynamicResponseField>

                        <DynamicResponseField name="purchase_limit" type="object">
                          Optional rate limit to cap how often auto top-ups occur.

                          <Expandable title="properties">
                            <DynamicResponseField name="interval" type="'hour' | 'day' | 'week' | 'month'">
                              The time interval for the purchase limit window.
                            </DynamicResponseField>

                            <DynamicResponseField name="interval_count" type="number">
                              Number of intervals in the purchase limit window.
                            </DynamicResponseField>

                            <DynamicResponseField name="limit" type="number">
                              Maximum number of auto top-ups allowed within the interval.
                            </DynamicResponseField>
                          </Expandable>
                        </DynamicResponseField>

                        <DynamicResponseField name="invoice_mode" type="boolean">
                          When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="spend_limits" type="object[]">
                      List of overage spend limits per feature (caps overage spend).

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          Optional feature ID this spend limit applies to.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether the overage spend limit is enabled.
                        </DynamicResponseField>

                        <DynamicResponseField name="limit_type" type="'absolute' | 'usage_percentage'">
                          How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
                        </DynamicResponseField>

                        <DynamicResponseField name="overage_limit" type="number">
                          Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
                        </DynamicResponseField>

                        <DynamicResponseField name="skip_overage_billing" type="boolean">
                          When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="usage_limits" type="object[]">
                      List of hard usage caps per feature (max units per interval).

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          The feature this usage limit applies to.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether this usage limit is enabled.
                        </DynamicResponseField>

                        <DynamicResponseField name="limit" type="number">
                          Maximum units allowed per interval.
                        </DynamicResponseField>

                        <DynamicResponseField name="interval" type="'day' | 'week' | 'month' | 'year'">
                          Interval for the cap, aligned to the customer's billing cycle.
                        </DynamicResponseField>

                        <DynamicResponseField name="filter" type="object">
                          When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.

                          <Expandable title="properties">
                            <DynamicResponseField name="properties" type="object" />
                          </Expandable>
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="usage_alerts" type="object[]">
                      List of usage alert configurations per feature.

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          The feature ID this alert applies to.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether this usage alert is enabled.
                        </DynamicResponseField>

                        <DynamicResponseField name="threshold" type="number">
                          The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
                        </DynamicResponseField>

                        <DynamicResponseField name="threshold_type" type="'usage' | 'usage_percentage' | 'remaining' | 'remaining_percentage'">
                          Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
                        </DynamicResponseField>

                        <DynamicResponseField name="name" type="string">
                          Optional user-defined label to distinguish multiple alerts on the same feature.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="overage_allowed" type="object[]">
                      List of overage allowed controls per feature. When enabled, usage can exceed balance.

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          The feature ID this overage allowed control applies to.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether overage is allowed for this feature.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="config" type="object">
          Miscellaneous plan-level configuration flags.

          <Expandable title="properties">
            <DynamicResponseField name="ignore_past_due" type="boolean">
              If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="billing_controls" type="object">
          Plan-level billing controls used as customer defaults.

          <Expandable title="properties">
            <DynamicResponseField name="auto_topups" type="object[]">
              List of auto top-up configurations per feature.

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  The ID of the feature (credit balance) to auto top-up.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether auto top-up is enabled.
                </DynamicResponseField>

                <DynamicResponseField name="threshold" type="number">
                  When the balance drops below this threshold, an auto top-up will be purchased.
                </DynamicResponseField>

                <DynamicResponseField name="quantity" type="number">
                  Amount of credits to add per auto top-up.
                </DynamicResponseField>

                <DynamicResponseField name="purchase_limit" type="object">
                  Optional rate limit to cap how often auto top-ups occur.

                  <Expandable title="properties">
                    <DynamicResponseField name="interval" type="'hour' | 'day' | 'week' | 'month'">
                      The time interval for the purchase limit window.
                    </DynamicResponseField>

                    <DynamicResponseField name="interval_count" type="number">
                      Number of intervals in the purchase limit window.
                    </DynamicResponseField>

                    <DynamicResponseField name="limit" type="number">
                      Maximum number of auto top-ups allowed within the interval.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="invoice_mode" type="boolean">
                  When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="spend_limits" type="object[]">
              List of overage spend limits per feature (caps overage spend).

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  Optional feature ID this spend limit applies to.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether the overage spend limit is enabled.
                </DynamicResponseField>

                <DynamicResponseField name="limit_type" type="'absolute' | 'usage_percentage'">
                  How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
                </DynamicResponseField>

                <DynamicResponseField name="overage_limit" type="number">
                  Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
                </DynamicResponseField>

                <DynamicResponseField name="skip_overage_billing" type="boolean">
                  When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="usage_limits" type="object[]">
              List of hard usage caps per feature (max units per interval).

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  The feature this usage limit applies to.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether this usage limit is enabled.
                </DynamicResponseField>

                <DynamicResponseField name="limit" type="number">
                  Maximum units allowed per interval.
                </DynamicResponseField>

                <DynamicResponseField name="interval" type="'day' | 'week' | 'month' | 'year'">
                  Interval for the cap, aligned to the customer's billing cycle.
                </DynamicResponseField>

                <DynamicResponseField name="filter" type="object">
                  When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.

                  <Expandable title="properties">
                    <DynamicResponseField name="properties" type="object" />
                  </Expandable>
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="usage_alerts" type="object[]">
              List of usage alert configurations per feature.

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  The feature ID this alert applies to.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether this usage alert is enabled.
                </DynamicResponseField>

                <DynamicResponseField name="threshold" type="number">
                  The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
                </DynamicResponseField>

                <DynamicResponseField name="threshold_type" type="'usage' | 'usage_percentage' | 'remaining' | 'remaining_percentage'">
                  Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
                </DynamicResponseField>

                <DynamicResponseField name="name" type="string">
                  Optional user-defined label to distinguish multiple alerts on the same feature.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="overage_allowed" type="object[]">
              List of overage allowed controls per feature. When enabled, usage can exceed balance.

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  The feature ID this overage allowed control applies to.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether overage is allowed for this feature.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="metadata" type="object">
          Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
        </DynamicResponseField>

        <DynamicResponseField name="customer_eligibility" type="object">
          <Expandable title="properties">
            <DynamicResponseField name="trial_available" type="boolean">
              Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
            </DynamicResponseField>

            <DynamicResponseField name="status" type="'active' | 'scheduled'">
              The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
            </DynamicResponseField>

            <DynamicResponseField name="canceling" type="boolean">
              Whether the customer's active instance of this plan is set to cancel.
            </DynamicResponseField>

            <DynamicResponseField name="trialing" type="boolean">
              Whether the customer is currently on a free trial of this plan.
            </DynamicResponseField>

            <DynamicResponseField name="attach_action" type="'activate' | 'upgrade' | 'downgrade' | 'none' | 'purchase'">
              The action that would occur if this plan were attached to the customer.
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="feature_quantities" type="object[]">
      The feature quantity selections associated with this plan change.

      <Expandable title="properties">
        <DynamicResponseField name="feature_id" type="string">
          The ID of the adjustable feature included in this change.
        </DynamicResponseField>

        <DynamicResponseField name="quantity" type="number">
          The quantity that will apply for this feature in the change.
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="effective_at" type="number | null">
      When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
    </DynamicResponseField>

    <DynamicResponseField name="canceled_at" type="number | null">
      When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
    </DynamicResponseField>

    <DynamicResponseField name="expires_at" type="number | null">
      When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="outgoing" type="object[]">
  Products or subscription changes being removed or ended.

  <Expandable title="properties">
    <DynamicResponseField name="plan_id" type="string">
      The ID of the plan affected by this preview change.
    </DynamicResponseField>

    <DynamicResponseField name="plan" type="object">
      The full plan object if it was expanded in the response.

      <Expandable title="properties">
        <DynamicResponseField name="id" type="string">
          Unique identifier for the plan.
        </DynamicResponseField>

        <DynamicResponseField name="name" type="string">
          Display name of the plan.
        </DynamicResponseField>

        <DynamicResponseField name="description" type="string | null">
          Optional description of the plan.
        </DynamicResponseField>

        <DynamicResponseField name="group" type="string | null">
          Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
        </DynamicResponseField>

        <DynamicResponseField name="version" type="number">
          Version number of the plan. Incremented when plan configuration changes.
        </DynamicResponseField>

        <DynamicResponseField name="add_on" type="boolean">
          Whether this is an add-on plan that can be attached alongside a main plan.
        </DynamicResponseField>

        <DynamicResponseField name="auto_enable" type="boolean">
          If true, this plan is automatically attached when a customer is created. Used for free plans.
        </DynamicResponseField>

        <DynamicResponseField name="price" type="object | null">
          Base recurring price for the plan. Null for free plans or usage-only plans.

          <Expandable title="properties">
            <DynamicResponseField name="amount" type="number">
              Base price amount for the plan.
            </DynamicResponseField>

            <DynamicResponseField name="additional_currencies" type="object[]">
              Base price amounts in additional currencies. The base 'amount' is in the org's default currency.

              <Expandable title="properties">
                <DynamicResponseField name="currency" type="string">
                  Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                </DynamicResponseField>

                <DynamicResponseField name="amount" type="number">
                  Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
              Billing interval (e.g. 'month', 'year').
            </DynamicResponseField>

            <DynamicResponseField name="interval_count" type="number">
              Number of intervals per billing cycle. Defaults to 1.
            </DynamicResponseField>

            <DynamicResponseField name="display" type="object">
              Display text for showing this price in pricing pages.

              <Expandable title="properties">
                <DynamicResponseField name="primary_text" type="string">
                  Main display text (e.g. '\$10' or '100 messages').
                </DynamicResponseField>

                <DynamicResponseField name="secondary_text" type="string">
                  Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="items" type="object[]">
          Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.

          <Expandable title="properties">
            <DynamicResponseField name="feature_id" type="string">
              The ID of the feature this item configures.
            </DynamicResponseField>

            <DynamicResponseField name="feature" type="object">
              The full feature object if expanded.

              <Expandable title="properties">
                <DynamicResponseField name="id" type="string">
                  The ID of the feature, used to refer to it in other API calls like /track or /check.
                </DynamicResponseField>

                <DynamicResponseField name="name" type="string | null">
                  The name of the feature.
                </DynamicResponseField>

                <DynamicResponseField name="type" type="'static' | 'boolean' | 'single_use' | 'continuous_use' | 'credit_system' | 'ai_credit_system'">
                  The type of the feature
                </DynamicResponseField>

                <DynamicResponseField name="display" type="object | null">
                  Singular and plural display names for the feature.

                  <Expandable title="properties">
                    <DynamicResponseField name="singular" type="string">
                      The singular display name for the feature.
                    </DynamicResponseField>

                    <DynamicResponseField name="plural" type="string">
                      The plural display name for the feature.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="credit_schema" type="object[] | null">
                  Credit cost schema for credit system features.

                  <Expandable title="properties">
                    <DynamicResponseField name="metered_feature_id" type="string">
                      The ID of the metered feature (should be a single\_use feature).
                    </DynamicResponseField>

                    <DynamicResponseField name="credit_cost" type="number">
                      The credit cost of the metered feature.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="archived" type="boolean | null">
                  Whether or not the feature is archived.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="included" type="number">
              Number of free units included. For consumable features, balance resets to this number each interval.
            </DynamicResponseField>

            <DynamicResponseField name="unlimited" type="boolean">
              Whether the customer has unlimited access to this feature.
            </DynamicResponseField>

            <DynamicResponseField name="reset" type="object | null">
              Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.

              <Expandable title="properties">
                <DynamicResponseField name="interval" type="'one_off' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                  The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
                </DynamicResponseField>

                <DynamicResponseField name="interval_count" type="number">
                  Number of intervals between resets. Defaults to 1.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="price" type="object | null">
              Pricing configuration for usage beyond included units. Null if feature is entirely free.

              <Expandable title="properties">
                <DynamicResponseField name="amount" type="number">
                  Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
                </DynamicResponseField>

                <DynamicResponseField name="additional_currencies" type="object[]">
                  Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).

                  <Expandable title="properties">
                    <DynamicResponseField name="currency" type="string">
                      Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                    </DynamicResponseField>

                    <DynamicResponseField name="amount" type="number">
                      Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="tiers" type="object[]">
                  Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.

                  <Expandable title="properties">
                    <DynamicResponseField name="to" type="number" />

                    <DynamicResponseField name="amount" type="number" />

                    <DynamicResponseField name="flat_amount" type="number" />

                    <DynamicResponseField name="additional_currencies" type="object[]">
                      <Expandable title="properties">
                        <DynamicResponseField name="currency" type="string">
                          Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                        </DynamicResponseField>

                        <DynamicResponseField name="amount" type="number">
                          Per-unit amount for this tier in this currency.
                        </DynamicResponseField>

                        <DynamicResponseField name="flat_amount" type="number">
                          Flat amount for this tier in this currency, if the tier uses one.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="tier_behavior" type="'graduated' | 'volume'" />

                <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                  Billing interval for this price. For consumable features, should match reset.interval.
                </DynamicResponseField>

                <DynamicResponseField name="interval_count" type="number">
                  Number of intervals per billing cycle. Defaults to 1.
                </DynamicResponseField>

                <DynamicResponseField name="billing_units" type="number">
                  Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
                </DynamicResponseField>

                <DynamicResponseField name="billing_method" type="'prepaid' | 'usage_based'">
                  'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
                </DynamicResponseField>

                <DynamicResponseField name="max_purchase" type="number | null">
                  Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="display" type="object">
              Display text for showing this item in pricing pages.

              <Expandable title="properties">
                <DynamicResponseField name="primary_text" type="string">
                  Main display text (e.g. '\$10' or '100 messages').
                </DynamicResponseField>

                <DynamicResponseField name="secondary_text" type="string">
                  Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="rollover" type="object">
              Rollover configuration for unused units. If set, unused included units roll over to the next period.

              <Expandable title="properties">
                <DynamicResponseField name="max" type="number | null">
                  Maximum rollover units. Null for unlimited rollover.
                </DynamicResponseField>

                <DynamicResponseField name="max_percentage" type="number | null">
                  Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
                </DynamicResponseField>

                <DynamicResponseField name="expiry_duration_type" type="'month' | 'forever'">
                  When rolled over units expire.
                </DynamicResponseField>

                <DynamicResponseField name="expiry_duration_length" type="number">
                  Number of periods before expiry.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="free_trial" type="object">
          Free trial configuration. If set, new customers can try this plan before being charged.

          <Expandable title="properties">
            <DynamicResponseField name="duration_length" type="number">
              Number of duration\_type periods the trial lasts.
            </DynamicResponseField>

            <DynamicResponseField name="duration_type" type="'day' | 'month' | 'year'">
              Unit of time for the trial duration ('day', 'month', 'year').
            </DynamicResponseField>

            <DynamicResponseField name="card_required" type="boolean">
              Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
            </DynamicResponseField>

            <DynamicResponseField name="on_end" type="'bill' | 'revert'">
              Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="created_at" type="number">
          Unix timestamp (ms) when the plan was created.
        </DynamicResponseField>

        <DynamicResponseField name="env" type="'sandbox' | 'live'">
          Environment this plan belongs to ('sandbox' or 'live').
        </DynamicResponseField>

        <DynamicResponseField name="archived" type="boolean">
          Whether the plan is archived. Archived plans cannot be attached to new customers.
        </DynamicResponseField>

        <DynamicResponseField name="base_variant_id" type="string | null">
          Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
        </DynamicResponseField>

        <DynamicResponseField name="variant_details" type="object">
          Details about how this variant relates to its latest base plan.

          <Expandable title="properties">
            <DynamicResponseField name="base_plan_id" type="string">
              The ID of the base plan this variant was derived from.
            </DynamicResponseField>

            <DynamicResponseField name="customize" type="object">
              The customization that transforms the base plan into this variant.

              <Expandable title="properties">
                <DynamicResponseField name="price" type="object | null">
                  Base price configuration for a plan.

                  <Expandable title="properties">
                    <DynamicResponseField name="amount" type="number">
                      Base price amount for the plan.
                    </DynamicResponseField>

                    <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                      Billing interval (e.g. 'month', 'year').
                    </DynamicResponseField>

                    <DynamicResponseField name="interval_count" type="number">
                      Number of intervals per billing cycle. Defaults to 1.
                    </DynamicResponseField>

                    <DynamicResponseField name="additional_currencies" type="object[]">
                      Base price amounts in additional currencies. The base 'amount' is in the org's default currency.

                      <Expandable title="properties">
                        <DynamicResponseField name="currency" type="string">
                          Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                        </DynamicResponseField>

                        <DynamicResponseField name="amount" type="number">
                          Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="add_items" type="object[]">
                  Items to add to the plan.

                  <Expandable title="properties">
                    <DynamicResponseField name="feature_id" type="string">
                      The ID of the feature to configure.
                    </DynamicResponseField>

                    <DynamicResponseField name="included" type="number">
                      Number of free units included. Balance resets to this each interval for consumable features.
                    </DynamicResponseField>

                    <DynamicResponseField name="unlimited" type="boolean">
                      If true, customer has unlimited access to this feature.
                    </DynamicResponseField>

                    <DynamicResponseField name="reset" type="object">
                      Reset configuration for consumable features. Omit for non-consumable features like seats.

                      <Expandable title="properties">
                        <DynamicResponseField name="interval" type="'one_off' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                          Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
                        </DynamicResponseField>

                        <DynamicResponseField name="interval_count" type="number">
                          Number of intervals between resets. Defaults to 1.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="price" type="object">
                      Pricing for usage beyond included units. Omit for free features.

                      <Expandable title="properties">
                        <DynamicResponseField name="amount" type="number">
                          Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
                        </DynamicResponseField>

                        <DynamicResponseField name="additional_currencies" type="object[]">
                          Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.

                          <Expandable title="properties">
                            <DynamicResponseField name="currency" type="string">
                              Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                            </DynamicResponseField>

                            <DynamicResponseField name="amount" type="number">
                              Price amount in this currency. Set explicitly per currency, not converted from the base amount.
                            </DynamicResponseField>
                          </Expandable>
                        </DynamicResponseField>

                        <DynamicResponseField name="tiers" type="object[]">
                          Tiered pricing. Either 'amount' or 'tiers' is required.

                          <Expandable title="properties">
                            <DynamicResponseField name="to" type="number" />

                            <DynamicResponseField name="amount" type="number" />

                            <DynamicResponseField name="flat_amount" type="number" />

                            <DynamicResponseField name="additional_currencies" type="object[]">
                              <Expandable title="properties">
                                <DynamicResponseField name="currency" type="string">
                                  Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
                                </DynamicResponseField>

                                <DynamicResponseField name="amount" type="number">
                                  Per-unit amount for this tier in this currency.
                                </DynamicResponseField>

                                <DynamicResponseField name="flat_amount" type="number">
                                  Flat amount for this tier in this currency, if the tier uses one.
                                </DynamicResponseField>
                              </Expandable>
                            </DynamicResponseField>
                          </Expandable>
                        </DynamicResponseField>

                        <DynamicResponseField name="tier_behavior" type="'graduated' | 'volume'" />

                        <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                          Billing interval. For consumable features, should match reset.interval.
                        </DynamicResponseField>

                        <DynamicResponseField name="interval_count" type="number">
                          Number of intervals per billing cycle. Defaults to 1.
                        </DynamicResponseField>

                        <DynamicResponseField name="billing_units" type="number">
                          Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
                        </DynamicResponseField>

                        <DynamicResponseField name="billing_method" type="'prepaid' | 'usage_based'">
                          'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
                        </DynamicResponseField>

                        <DynamicResponseField name="max_purchase" type="number | null">
                          Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="proration" type="object">
                      Proration settings for prepaid features. Controls mid-cycle quantity change billing.

                      <Expandable title="properties">
                        <DynamicResponseField name="on_increase" type="'bill_immediately' | 'prorate_immediately' | 'prorate_next_cycle' | 'bill_next_cycle'">
                          Billing behavior when quantity increases mid-cycle.
                        </DynamicResponseField>

                        <DynamicResponseField name="on_decrease" type="'prorate' | 'prorate_immediately' | 'prorate_next_cycle' | 'none' | 'no_prorations'">
                          Credit behavior when quantity decreases mid-cycle.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="rollover" type="object">
                      Rollover config for unused units. If set, unused included units carry over.

                      <Expandable title="properties">
                        <DynamicResponseField name="max" type="number">
                          Max rollover units. Omit for unlimited rollover.
                        </DynamicResponseField>

                        <DynamicResponseField name="max_percentage" type="number">
                          Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
                        </DynamicResponseField>

                        <DynamicResponseField name="expiry_duration_type" type="'month' | 'forever'">
                          When rolled over units expire.
                        </DynamicResponseField>

                        <DynamicResponseField name="expiry_duration_length" type="number">
                          Number of periods before expiry.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="remove_items" type="object[]">
                  Filters selecting items to remove from the plan.

                  <Expandable title="properties">
                    <DynamicResponseField name="feature_id" type="string">
                      Match items linked to this feature.
                    </DynamicResponseField>

                    <DynamicResponseField name="billing_method" type="'prepaid' | 'usage_based'">
                      Match items with this billing method (prepaid or usage\_based).
                    </DynamicResponseField>

                    <DynamicResponseField name="interval" type="'one_off' | 'week' | 'month' | 'quarter' | 'semi_annual' | 'year'">
                      Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
                    </DynamicResponseField>

                    <DynamicResponseField name="interval_count" type="integer">
                      Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="free_trial" type="object | null">
                  Free trial configuration for a plan.

                  <Expandable title="properties">
                    <DynamicResponseField name="duration_length" type="number">
                      Number of duration\_type periods the trial lasts.
                    </DynamicResponseField>

                    <DynamicResponseField name="duration_type" type="'day' | 'month' | 'year'">
                      Unit of time for the trial ('day', 'month', 'year').
                    </DynamicResponseField>

                    <DynamicResponseField name="card_required" type="boolean">
                      If true, payment method required to start trial. Customer is charged after trial ends.
                    </DynamicResponseField>

                    <DynamicResponseField name="on_end" type="'bill' | 'revert'">
                      Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="billing_controls" type="object">
                  Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.

                  <Expandable title="properties">
                    <DynamicResponseField name="auto_topups" type="object[]">
                      List of auto top-up configurations per feature.

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          The ID of the feature (credit balance) to auto top-up.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether auto top-up is enabled.
                        </DynamicResponseField>

                        <DynamicResponseField name="threshold" type="number">
                          When the balance drops below this threshold, an auto top-up will be purchased.
                        </DynamicResponseField>

                        <DynamicResponseField name="quantity" type="number">
                          Amount of credits to add per auto top-up.
                        </DynamicResponseField>

                        <DynamicResponseField name="purchase_limit" type="object">
                          Optional rate limit to cap how often auto top-ups occur.

                          <Expandable title="properties">
                            <DynamicResponseField name="interval" type="'hour' | 'day' | 'week' | 'month'">
                              The time interval for the purchase limit window.
                            </DynamicResponseField>

                            <DynamicResponseField name="interval_count" type="number">
                              Number of intervals in the purchase limit window.
                            </DynamicResponseField>

                            <DynamicResponseField name="limit" type="number">
                              Maximum number of auto top-ups allowed within the interval.
                            </DynamicResponseField>
                          </Expandable>
                        </DynamicResponseField>

                        <DynamicResponseField name="invoice_mode" type="boolean">
                          When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="spend_limits" type="object[]">
                      List of overage spend limits per feature (caps overage spend).

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          Optional feature ID this spend limit applies to.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether the overage spend limit is enabled.
                        </DynamicResponseField>

                        <DynamicResponseField name="limit_type" type="'absolute' | 'usage_percentage'">
                          How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
                        </DynamicResponseField>

                        <DynamicResponseField name="overage_limit" type="number">
                          Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
                        </DynamicResponseField>

                        <DynamicResponseField name="skip_overage_billing" type="boolean">
                          When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="usage_limits" type="object[]">
                      List of hard usage caps per feature (max units per interval).

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          The feature this usage limit applies to.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether this usage limit is enabled.
                        </DynamicResponseField>

                        <DynamicResponseField name="limit" type="number">
                          Maximum units allowed per interval.
                        </DynamicResponseField>

                        <DynamicResponseField name="interval" type="'day' | 'week' | 'month' | 'year'">
                          Interval for the cap, aligned to the customer's billing cycle.
                        </DynamicResponseField>

                        <DynamicResponseField name="filter" type="object">
                          When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.

                          <Expandable title="properties">
                            <DynamicResponseField name="properties" type="object" />
                          </Expandable>
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="usage_alerts" type="object[]">
                      List of usage alert configurations per feature.

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          The feature ID this alert applies to.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether this usage alert is enabled.
                        </DynamicResponseField>

                        <DynamicResponseField name="threshold" type="number">
                          The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
                        </DynamicResponseField>

                        <DynamicResponseField name="threshold_type" type="'usage' | 'usage_percentage' | 'remaining' | 'remaining_percentage'">
                          Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
                        </DynamicResponseField>

                        <DynamicResponseField name="name" type="string">
                          Optional user-defined label to distinguish multiple alerts on the same feature.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>

                    <DynamicResponseField name="overage_allowed" type="object[]">
                      List of overage allowed controls per feature. When enabled, usage can exceed balance.

                      <Expandable title="properties">
                        <DynamicResponseField name="feature_id" type="string">
                          The feature ID this overage allowed control applies to.
                        </DynamicResponseField>

                        <DynamicResponseField name="enabled" type="boolean">
                          Whether overage is allowed for this feature.
                        </DynamicResponseField>
                      </Expandable>
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="config" type="object">
          Miscellaneous plan-level configuration flags.

          <Expandable title="properties">
            <DynamicResponseField name="ignore_past_due" type="boolean">
              If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="billing_controls" type="object">
          Plan-level billing controls used as customer defaults.

          <Expandable title="properties">
            <DynamicResponseField name="auto_topups" type="object[]">
              List of auto top-up configurations per feature.

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  The ID of the feature (credit balance) to auto top-up.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether auto top-up is enabled.
                </DynamicResponseField>

                <DynamicResponseField name="threshold" type="number">
                  When the balance drops below this threshold, an auto top-up will be purchased.
                </DynamicResponseField>

                <DynamicResponseField name="quantity" type="number">
                  Amount of credits to add per auto top-up.
                </DynamicResponseField>

                <DynamicResponseField name="purchase_limit" type="object">
                  Optional rate limit to cap how often auto top-ups occur.

                  <Expandable title="properties">
                    <DynamicResponseField name="interval" type="'hour' | 'day' | 'week' | 'month'">
                      The time interval for the purchase limit window.
                    </DynamicResponseField>

                    <DynamicResponseField name="interval_count" type="number">
                      Number of intervals in the purchase limit window.
                    </DynamicResponseField>

                    <DynamicResponseField name="limit" type="number">
                      Maximum number of auto top-ups allowed within the interval.
                    </DynamicResponseField>
                  </Expandable>
                </DynamicResponseField>

                <DynamicResponseField name="invoice_mode" type="boolean">
                  When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="spend_limits" type="object[]">
              List of overage spend limits per feature (caps overage spend).

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  Optional feature ID this spend limit applies to.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether the overage spend limit is enabled.
                </DynamicResponseField>

                <DynamicResponseField name="limit_type" type="'absolute' | 'usage_percentage'">
                  How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
                </DynamicResponseField>

                <DynamicResponseField name="overage_limit" type="number">
                  Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
                </DynamicResponseField>

                <DynamicResponseField name="skip_overage_billing" type="boolean">
                  When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="usage_limits" type="object[]">
              List of hard usage caps per feature (max units per interval).

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  The feature this usage limit applies to.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether this usage limit is enabled.
                </DynamicResponseField>

                <DynamicResponseField name="limit" type="number">
                  Maximum units allowed per interval.
                </DynamicResponseField>

                <DynamicResponseField name="interval" type="'day' | 'week' | 'month' | 'year'">
                  Interval for the cap, aligned to the customer's billing cycle.
                </DynamicResponseField>

                <DynamicResponseField name="filter" type="object">
                  When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.

                  <Expandable title="properties">
                    <DynamicResponseField name="properties" type="object" />
                  </Expandable>
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="usage_alerts" type="object[]">
              List of usage alert configurations per feature.

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  The feature ID this alert applies to.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether this usage alert is enabled.
                </DynamicResponseField>

                <DynamicResponseField name="threshold" type="number">
                  The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
                </DynamicResponseField>

                <DynamicResponseField name="threshold_type" type="'usage' | 'usage_percentage' | 'remaining' | 'remaining_percentage'">
                  Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
                </DynamicResponseField>

                <DynamicResponseField name="name" type="string">
                  Optional user-defined label to distinguish multiple alerts on the same feature.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>

            <DynamicResponseField name="overage_allowed" type="object[]">
              List of overage allowed controls per feature. When enabled, usage can exceed balance.

              <Expandable title="properties">
                <DynamicResponseField name="feature_id" type="string">
                  The feature ID this overage allowed control applies to.
                </DynamicResponseField>

                <DynamicResponseField name="enabled" type="boolean">
                  Whether overage is allowed for this feature.
                </DynamicResponseField>
              </Expandable>
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>

        <DynamicResponseField name="metadata" type="object">
          Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
        </DynamicResponseField>

        <DynamicResponseField name="customer_eligibility" type="object">
          <Expandable title="properties">
            <DynamicResponseField name="trial_available" type="boolean">
              Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
            </DynamicResponseField>

            <DynamicResponseField name="status" type="'active' | 'scheduled'">
              The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
            </DynamicResponseField>

            <DynamicResponseField name="canceling" type="boolean">
              Whether the customer's active instance of this plan is set to cancel.
            </DynamicResponseField>

            <DynamicResponseField name="trialing" type="boolean">
              Whether the customer is currently on a free trial of this plan.
            </DynamicResponseField>

            <DynamicResponseField name="attach_action" type="'activate' | 'upgrade' | 'downgrade' | 'none' | 'purchase'">
              The action that would occur if this plan were attached to the customer.
            </DynamicResponseField>
          </Expandable>
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="feature_quantities" type="object[]">
      The feature quantity selections associated with this plan change.

      <Expandable title="properties">
        <DynamicResponseField name="feature_id" type="string">
          The ID of the adjustable feature included in this change.
        </DynamicResponseField>

        <DynamicResponseField name="quantity" type="number">
          The quantity that will apply for this feature in the change.
        </DynamicResponseField>
      </Expandable>
    </DynamicResponseField>

    <DynamicResponseField name="effective_at" type="number | null">
      When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
    </DynamicResponseField>

    <DynamicResponseField name="canceled_at" type="number | null">
      When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
    </DynamicResponseField>

    <DynamicResponseField name="expires_at" type="number | null">
      When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="redirect_to_checkout" type="boolean">
  Whether the customer will be redirected to a checkout page if attach is called.
</DynamicResponseField>

<DynamicResponseField name="checkout_type" type="'stripe_checkout' | 'autumn_checkout'">
  The type of checkout that will be used if the customer is redirected to a checkout page.
</DynamicResponseField>

<DynamicResponseField name="tax" type="object">
  Tax preview for the immediate charge. Contact us to enable the tax flag on your organisation. Shows only with flag enabled, a Stripe customer exists and has a location.

  <Expandable title="properties">
    <DynamicResponseField name="total" type="number">
      Total tax amount in major currency units.
    </DynamicResponseField>

    <DynamicResponseField name="amount_inclusive" type="number">
      Tax included in line item subtotals.
    </DynamicResponseField>

    <DynamicResponseField name="amount_exclusive" type="number">
      Tax added on top of subtotals.
    </DynamicResponseField>

    <DynamicResponseField name="currency" type="string">
      Three-letter currency code.
    </DynamicResponseField>

    <DynamicResponseField name="status" type="'complete' | 'incomplete'">
      Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="invoice_credits" type="object">
  Stripe customer invoice credits preview.

  <Expandable title="properties">
    <DynamicResponseField name="balance" type="number">
      Stripe customer credit balance available, expressed as a positive number in major currency units.
    </DynamicResponseField>

    <DynamicResponseField name="currency" type="string">
      Three-letter currency code.
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "customerId": "charles",
    "lineItems": [
      {
        "display_name": "Pro seed",
        "description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)",
        "subtotal": 20,
        "total": 20,
        "discounts": []
      }
    ],
    "subtotal": 20,
    "total": 20,
    "currency": "usd"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi POST /v1/billing.preview_multi_attach
openapi: 3.1.0
info:
  title: Autumn API
  version: 2.3.0
servers:
  - url: https://api.useautumn.com
    description: Production server
security:
  - secretKey: []
paths:
  /v1/billing.preview_multi_attach:
    post:
      tags:
        - billing
      description: >-
        Previews the billing changes that would occur when attaching multiple
        plans, without actually making any changes.


        Use this endpoint to show customers what they will be charged before
        confirming a multi-plan subscription.
      operationId: previewMultiAttach
      parameters:
        - name: x-api-version
          in: header
          required: true
          schema:
            type: string
            default: 2.3.0
          x-speakeasy-globals-hidden: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  description: The ID of the customer to attach the plans to.
                entity_id:
                  type: string
                  description: The ID of the entity to attach the plans to.
                plans:
                  type: array
                  minItems: 1
                  items:
                    type: object
                    properties:
                      plan_id:
                        type: string
                        description: The ID of the plan to attach.
                      customize:
                        type: object
                        properties:
                          price:
                            anyOf:
                              - type: object
                                properties:
                                  amount:
                                    type: number
                                    description: Base price amount for the plan.
                                  interval:
                                    enum:
                                      - one_off
                                      - week
                                      - month
                                      - quarter
                                      - semi_annual
                                      - year
                                    type: string
                                    description: Billing interval (e.g. 'month', 'year').
                                  interval_count:
                                    type: number
                                    description: >-
                                      Number of intervals per billing cycle.
                                      Defaults to 1.
                                  additional_currencies:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        currency:
                                          type: string
                                          description: >-
                                            Three-letter Stripe-supported currency
                                            code (e.g. 'eur', 'gbp').
                                        amount:
                                          type: number
                                          description: >-
                                            Price amount in this currency. Set
                                            explicitly per currency, not converted
                                            from the base amount.
                                      required:
                                        - currency
                                        - amount
                                    description: >-
                                      Base price amounts in additional
                                      currencies. The base 'amount' is in the
                                      org's default currency.
                                required:
                                  - amount
                                  - interval
                                title: BasePrice
                                description: Base price configuration for a plan.
                              - type: 'null'
                            description: >-
                              Override the base price of the plan. Pass null to
                              remove the base price.
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                feature_id:
                                  type: string
                                  description: The ID of the feature to configure.
                                included:
                                  type: number
                                  description: >-
                                    Number of free units included. Balance
                                    resets to this each interval for consumable
                                    features.
                                unlimited:
                                  type: boolean
                                  description: >-
                                    If true, customer has unlimited access to
                                    this feature.
                                reset:
                                  type: object
                                  properties:
                                    interval:
                                      enum:
                                        - one_off
                                        - minute
                                        - hour
                                        - day
                                        - week
                                        - month
                                        - quarter
                                        - semi_annual
                                        - year
                                      type: string
                                      description: >-
                                        Interval at which balance resets (e.g.
                                        'month', 'year'). For consumable
                                        features only.
                                    interval_count:
                                      type: number
                                      description: >-
                                        Number of intervals between resets.
                                        Defaults to 1.
                                  required:
                                    - interval
                                  description: >-
                                    Reset configuration for consumable features.
                                    Omit for non-consumable features like seats.
                                price:
                                  type: object
                                  properties:
                                    amount:
                                      type: number
                                      description: >-
                                        Price per billing_units after included
                                        usage. Either 'amount' or 'tiers' is
                                        required.
                                    additional_currencies:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          currency:
                                            type: string
                                            description: >-
                                              Three-letter Stripe-supported currency
                                              code (e.g. 'eur', 'gbp').
                                          amount:
                                            type: number
                                            description: >-
                                              Price amount in this currency. Set
                                              explicitly per currency, not converted
                                              from the base amount.
                                        required:
                                          - currency
                                          - amount
                                      description: >-
                                        Amounts in additional currencies for
                                        this flat price. The base 'amount' is in
                                        the org's default currency. Only valid
                                        with 'amount', not 'tiers'.
                                    tiers:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          to:
                                            anyOf:
                                              - type: number
                                              - const: inf
                                          amount:
                                            type: number
                                          flat_amount:
                                            type: number
                                          additional_currencies:
                                            type: array
                                            items:
                                              type: object
                                              properties:
                                                currency: {}
                                                amount: {}
                                                flat_amount: {}
                                            description: >-
                                              Per-currency amounts for this tier. Tier
                                              boundaries ('to') are shared across all
                                              currencies.
                                        required:
                                          - to
                                      description: >-
                                        Tiered pricing.  Either 'amount' or
                                        'tiers' is required.
                                    tier_behavior:
                                      enum:
                                        - graduated
                                        - volume
                                      type: string
                                    interval:
                                      enum:
                                        - one_off
                                        - week
                                        - month
                                        - quarter
                                        - semi_annual
                                        - year
                                      type: string
                                      description: >-
                                        Billing interval. For consumable
                                        features, should match reset.interval.
                                    interval_count:
                                      type: number
                                      default: 1
                                      description: >-
                                        Number of intervals per billing cycle.
                                        Defaults to 1.
                                    billing_units:
                                      type: number
                                      default: 1
                                      description: >-
                                        Units per price increment. Usage is
                                        rounded UP when billed (e.g.
                                        billing_units=100 means 101 rounds to
                                        200).
                                    billing_method:
                                      enum:
                                        - prepaid
                                        - usage_based
                                      type: string
                                      description: >-
                                        'prepaid' for upfront payment (seats),
                                        'usage_based' for pay-as-you-go.
                                    max_purchase:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      description: >-
                                        Max units purchasable beyond included.
                                        E.g. included=100, max_purchase=300
                                        allows 400 total. Null for no limit.
                                  required:
                                    - interval
                                    - billing_method
                                  description: >-
                                    Pricing for usage beyond included units.
                                    Omit for free features.
                                proration:
                                  type: object
                                  properties:
                                    on_increase:
                                      enum:
                                        - bill_immediately
                                        - prorate_immediately
                                        - prorate_next_cycle
                                        - bill_next_cycle
                                      type: string
                                      description: >-
                                        Billing behavior when quantity increases
                                        mid-cycle.
                                    on_decrease:
                                      enum:
                                        - prorate
                                        - prorate_immediately
                                        - prorate_next_cycle
                                        - none
                                        - no_prorations
                                      type: string
                                      description: >-
                                        Credit behavior when quantity decreases
                                        mid-cycle.
                                  required:
                                    - on_increase
                                    - on_decrease
                                  description: >-
                                    Proration settings for prepaid features.
                                    Controls mid-cycle quantity change billing.
                                rollover:
                                  type: object
                                  properties:
                                    max:
                                      type: number
                                      description: >-
                                        Max rollover units. Omit for unlimited
                                        rollover.
                                    max_percentage:
                                      type: number
                                      description: >-
                                        Maximum rollover as a percentage (0-100)
                                        of included + prepaid grant. Mutually
                                        exclusive with max.
                                    expiry_duration_type:
                                      enum:
                                        - month
                                        - forever
                                      type: string
                                      description: When rolled over units expire.
                                    expiry_duration_length:
                                      type: number
                                      description: Number of periods before expiry.
                                  required:
                                    - expiry_duration_type
                                  description: >-
                                    Rollover config for unused units. If set,
                                    unused included units carry over.
                              required:
                                - feature_id
                              title: PlanItem
                              description: >-
                                Configuration for a feature item in a plan,
                                including usage limits, pricing, and rollover
                                settings.
                            description: Override the items in the plan.
                        description: >-
                          Customize the plan to attach. Can override the price,
                          items, or licenses.
                      feature_quantities:
                        type: array
                        items:
                          type: object
                          properties:
                            feature_id:
                              type: string
                              description: The ID of the feature to set quantity for.
                            quantity:
                              type: number
                              minimum: 0
                              description: The quantity of the feature.
                            adjustable:
                              type: boolean
                              description: Whether the customer can adjust the quantity.
                          required:
                            - feature_id
                          title: FeatureQuantity
                          description: Quantity configuration for a prepaid feature.
                        description: >-
                          If this plan contains prepaid features, use this field
                          to specify the quantity of each prepaid feature.
                      version:
                        type: number
                        description: The version of the plan to attach.
                      subscription_id:
                        type: string
                        description: >-
                          A unique ID to identify this subscription. Useful when
                          attaching the same plan multiple times.
                    required:
                      - plan_id
                  description: The list of plans to attach to the customer.
                free_trial:
                  anyOf:
                    - type: object
                      properties:
                        duration_length:
                          type: number
                          description: Number of duration_type periods the trial lasts.
                        duration_type:
                          enum:
                            - day
                            - month
                            - year
                          type: string
                          default: month
                          description: Unit of time for the trial ('day', 'month', 'year').
                        card_required:
                          type: boolean
                          default: true
                          description: >-
                            If true, payment method required to start trial.
                            Customer is charged after trial ends.
                        on_end:
                          enum:
                            - bill
                            - revert
                          type: string
                          description: >-
                            Behavior when the trial ends. 'bill' charges the
                            customer (default). 'revert' expires the trial and
                            restores the customer's previous plan.
                      required:
                        - duration_length
                      title: FreeTrialParams
                      description: Free trial configuration for a plan.
                    - type: 'null'
                  description: >-
                    Free trial configuration applied to all plans. Pass an
                    object to set a custom trial, or null to remove any trial.
                currency:
                  type: string
                  description: >-
                    Currency to bill this multi-attach in (e.g. usd, eur). Must
                    match the customer's currency if they are already locked to
                    one, and every plan must offer a paid price in it. Defaults
                    to the customer's currency, then the org default.
                invoice_mode:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                      description: >-
                        When true, creates an invoice and sends it to the
                        customer instead of charging their card immediately.
                        Uses Stripe's send_invoice collection method.
                    enable_plan_immediately:
                      type: boolean
                      default: false
                      description: >-
                        If true, enables the plan immediately even though the
                        invoice is not paid yet.
                    finalize:
                      type: boolean
                      default: true
                      description: >-
                        If true, finalizes the invoice so it can be sent to the
                        customer. If false, keeps it as a draft for manual
                        review.
                    invoice_template_id:
                      type: string
                      description: >-
                        ID of an invoice template (configured in billing
                        settings) whose footer (e.g. bank details) is applied to
                        the invoice.
                    net_terms_days:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      exclusiveMinimum: 0
                      description: >-
                        Number of days the customer has to pay the invoice
                        before it is due (Stripe days_until_due).
                  required:
                    - enabled
                  description: >-
                    Invoice mode creates a draft or open invoice and sends it to
                    the customer, instead of charging their card immediately.
                discounts:
                  type: array
                  items:
                    type: object
                    properties:
                      reward_id:
                        type: string
                        description: The ID of the reward to apply as a discount.
                      promotion_code:
                        type: string
                        description: The promotion code to apply as a discount.
                    title: AttachDiscount
                    description: >-
                      A discount to apply. Can be either a reward ID or a
                      promotion code.
                  description: >-
                    List of discounts to apply. Each discount can be an Autumn
                    reward ID, Stripe coupon ID, or Stripe promotion code.
                success_url:
                  type: string
                  description: URL to redirect to after successful checkout.
                checkout_session_params:
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties: {}
                  description: >-
                    Additional parameters to pass into the creation of the
                    Stripe checkout session.
                redirect_mode:
                  enum:
                    - always
                    - if_required
                    - never
                  type: string
                  description: >-
                    Controls when to return a checkout URL. 'always' returns a
                    URL even if payment succeeds, 'if_required' only when
                    payment action is needed, 'never' disables redirects.
                  default: if_required
                new_billing_subscription:
                  type: boolean
                  description: >-
                    Only applicable when the customer has an existing Stripe
                    subscription. If true, creates a new separate subscription
                    instead of merging into the existing one.
                enable_plan_immediately:
                  type: boolean
                  description: >-
                    If true, the cusProducts are activated immediately even when
                    payment is pending via Stripe checkout.
                customer_data:
                  $ref: '#/components/schemas/CustomerData'
                entity_data:
                  type: object
                  properties:
                    feature_id:
                      type: string
                      description: The feature ID that this entity is associated with
                    name:
                      type: string
                      description: Name of the entity
                    billing_controls:
                      type: object
                      properties:
                        spend_limits:
                          type: array
                          items:
                            type: object
                            properties:
                              feature_id:
                                type: string
                                description: >-
                                  Optional feature ID this spend limit applies
                                  to.
                              enabled:
                                type: boolean
                                default: false
                                description: Whether the overage spend limit is enabled.
                              limit_type:
                                enum:
                                  - absolute
                                  - usage_percentage
                                type: string
                                description: >-
                                  How overage_limit is interpreted: an absolute
                                  overage cap (default) or a percentage of the
                                  main-plan allowance.
                              overage_limit:
                                type: number
                                minimum: 0
                                description: >-
                                  Overage cap for the feature: absolute units,
                                  or a percent (e.g. 120) when limit_type is
                                  usage_percentage.
                              skip_overage_billing:
                                type: boolean
                                description: >-
                                  When true, overage for this feature is not
                                  posted to Stripe. Usage tracking and balance
                                  resets still behave normally.
                          description: >-
                            List of spend limits per feature. Each entry caps
                            overage (overage_limit) and/or per-interval usage
                            (usage_limit).
                        usage_limits:
                          type: array
                          items:
                            type: object
                            properties:
                              feature_id:
                                type: string
                                description: The feature this usage limit applies to.
                              enabled:
                                type: boolean
                                default: true
                                description: Whether this usage limit is enabled.
                              limit:
                                type: number
                                minimum: 0
                                description: Maximum units allowed per interval.
                              interval:
                                enum:
                                  - day
                                  - week
                                  - month
                                  - year
                                type: string
                                description: >-
                                  Interval for the cap, aligned to the
                                  customer's billing cycle.
                              filter:
                                type: object
                                properties:
                                  properties:
                                    type: object
                                    propertyNames:
                                      type: string
                                      minLength: 1
                                      maxLength: 64
                                    additionalProperties:
                                      anyOf:
                                        - type: string
                                          minLength: 1
                                          maxLength: 128
                                        - type: number
                                        - type: boolean
                                required:
                                  - properties
                                description: >-
                                  When set, only usage from events whose
                                  properties match counts toward this cap. Omit
                                  to count all usage of the feature.
                            required:
                              - feature_id
                              - limit
                              - interval
                          description: >-
                            List of hard usage caps per feature for this entity.
                            An entity entry overrides the customer's for that
                            feature.
                        usage_alerts:
                          type: array
                          items:
                            type: object
                            properties:
                              feature_id:
                                type: string
                                description: The feature ID this alert applies to.
                              enabled:
                                type: boolean
                                default: true
                                description: Whether this usage alert is enabled.
                              threshold:
                                type: number
                                minimum: 0
                                description: >-
                                  The threshold value that triggers the alert.
                                  For usage or remaining, this is an absolute
                                  count. For usage_percentage or
                                  remaining_percentage, this is a percentage
                                  (0-100).
                              threshold_type:
                                enum:
                                  - usage
                                  - usage_percentage
                                  - remaining
                                  - remaining_percentage
                                type: string
                                description: >-
                                  Whether the threshold is an absolute count or
                                  a percentage of the usage allowance or
                                  remaining balance.
                              name:
                                type: string
                                description: >-
                                  Optional user-defined label to distinguish
                                  multiple alerts on the same feature.
                            required:
                              - threshold
                              - threshold_type
                          description: List of usage alert configurations per feature.
                        overage_allowed:
                          type: array
                          items:
                            type: object
                            properties:
                              feature_id:
                                type: string
                                description: >-
                                  The feature ID this overage allowed control
                                  applies to.
                              enabled:
                                type: boolean
                                default: false
                                description: Whether overage is allowed for this feature.
                            required:
                              - feature_id
                          description: >-
                            List of overage allowed controls per feature. When
                            enabled, usage can exceed balance.
                      description: Billing controls for the entity.
                  required:
                    - feature_id
              required:
                - customer_id
                - plans
              title: PreviewMultiAttachParams
              examples:
                - customer_id: cus_123
                  plans:
                    - plan_id: pro_plan
                    - plan_id: addon_seats
                      feature_quantities:
                        - feature_id: seats
                          quantity: 5
            example:
              customer_id: cus_123
              plans:
                - plan_id: pro_plan
                - plan_id: addon_seats
                  feature_quantities:
                    - feature_id: seats
                      quantity: 5
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  customer_id:
                    type: string
                    description: The ID of the customer.
                  line_items:
                    type: array
                    items:
                      type: object
                      properties:
                        display_name:
                          type: string
                          description: >-
                            The name of the line item to display to the customer
                            if you're building a UI. It will either be the plan
                            name or the feature name.
                        description:
                          type: string
                          description: A detailed description of the line item.
                        subtotal:
                          type: number
                          description: >-
                            The amount in cents before discounts and tax for
                            this line item.
                        total:
                          type: number
                          description: >-
                            The final amount in cents after discounts and tax
                            for this line item.
                        discounts:
                          type: array
                          items:
                            type: object
                            properties:
                              amount_off:
                                type: number
                              percent_off:
                                type: number
                              reward_id:
                                type: string
                              reward_name:
                                type: string
                            required:
                              - amount_off
                          default: []
                          description: List of discounts applied to this line item.
                        plan_id:
                          type: string
                          description: The ID of the plan that this line item belongs to.
                        feature_id:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            The ID of the feature that this line item belongs
                            to.
                        period:
                          type: object
                          properties:
                            start:
                              type: number
                              description: >-
                                The start of the period in milliseconds since
                                the Unix epoch.
                            end:
                              type: number
                              description: >-
                                The end of the period in milliseconds since the
                                Unix epoch.
                          required:
                            - start
                            - end
                          description: >-
                            The period of time that this line item is being
                            charged for.
                        quantity:
                          type: number
                          description: The quantity of the line item.
                      required:
                        - display_name
                        - description
                        - subtotal
                        - total
                        - plan_id
                        - feature_id
                        - quantity
                  subtotal:
                    type: number
                    description: >-
                      The total amount in cents before discounts and tax for the
                      current billing period.
                  total:
                    type: number
                    description: >-
                      The final amount in cents after discounts and tax for the
                      current billing period.
                  currency:
                    type: string
                    description: The three-letter ISO currency code (e.g., 'usd').
                  next_cycle:
                    type: object
                    properties:
                      starts_at:
                        type: number
                        description: >-
                          Unix timestamp (milliseconds) when the next billing
                          cycle starts.
                      subtotal:
                        type: number
                        description: >-
                          The total amount in cents before discounts and tax for
                          the next cycle.
                      total:
                        type: number
                        description: >-
                          The final amount in cents after discounts and tax for
                          the next cycle.
                      line_items:
                        type: array
                        items:
                          type: object
                          properties:
                            display_name:
                              type: string
                              description: >-
                                The name of the line item to display to the
                                customer if you're building a UI. It will either
                                be the plan name or the feature name.
                            description:
                              type: string
                              description: A detailed description of the line item.
                            subtotal:
                              type: number
                              description: >-
                                The amount in cents before discounts and tax for
                                this line item.
                            total:
                              type: number
                              description: >-
                                The final amount in cents after discounts and
                                tax for this line item.
                            discounts:
                              type: array
                              items:
                                type: object
                                properties:
                                  amount_off:
                                    type: number
                                  percent_off:
                                    type: number
                                  reward_id:
                                    type: string
                                  reward_name:
                                    type: string
                                required:
                                  - amount_off
                              default: []
                              description: List of discounts applied to this line item.
                            plan_id:
                              type: string
                              description: >-
                                The ID of the plan that this line item belongs
                                to.
                            feature_id:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                The ID of the feature that this line item
                                belongs to.
                            period:
                              type: object
                              properties:
                                start:
                                  type: number
                                  description: >-
                                    The start of the period in milliseconds
                                    since the Unix epoch.
                                end:
                                  type: number
                                  description: >-
                                    The end of the period in milliseconds since
                                    the Unix epoch.
                              required:
                                - start
                                - end
                              description: >-
                                The period of time that this line item is being
                                charged for.
                            quantity:
                              type: number
                              description: The quantity of the line item.
                          required:
                            - display_name
                            - description
                            - subtotal
                            - total
                            - plan_id
                            - feature_id
                            - quantity
                        description: List of line items for the next billing cycle.
                      usage_line_items:
                        type: array
                        items:
                          type: object
                          properties:
                            display_name:
                              type: string
                              description: >-
                                The name of the line item to display to the
                                customer if you're building a UI. It will either
                                be the plan name or the feature name.
                            plan_id:
                              type: string
                              description: >-
                                The ID of the plan that this line item belongs
                                to.
                            feature_id:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                The ID of the feature that this line item
                                belongs to.
                            period:
                              type: object
                              properties:
                                start:
                                  type: number
                                  description: >-
                                    The start of the period in milliseconds
                                    since the Unix epoch.
                                end:
                                  type: number
                                  description: >-
                                    The end of the period in milliseconds since
                                    the Unix epoch.
                              required:
                                - start
                                - end
                              description: >-
                                The period of time that this line item is being
                                charged for.
                          required:
                            - display_name
                            - plan_id
                            - feature_id
                        description: >-
                          List of line items for usage-based features in the
                          next cycle.
                    required:
                      - starts_at
                      - subtotal
                      - total
                      - line_items
                      - usage_line_items
                    description: >-
                      Preview of the next billing cycle, if applicable. This
                      shows what the customer will be charged in subsequent
                      cycles.
                  expand:
                    type: array
                    items:
                      type: string
                    description: Expand the response with additional data.
                  incoming:
                    type: array
                    items:
                      type: object
                      properties:
                        plan_id:
                          type: string
                          description: The ID of the plan affected by this preview change.
                        plan:
                          $ref: '#/components/schemas/Plan'
                          description: >-
                            The full plan object if it was expanded in the
                            response.
                        feature_quantities:
                          type: array
                          items:
                            type: object
                            properties:
                              feature_id:
                                type: string
                                description: >-
                                  The ID of the adjustable feature included in
                                  this change.
                              quantity:
                                type: number
                                description: >-
                                  The quantity that will apply for this feature
                                  in the change.
                            required:
                              - feature_id
                              - quantity
                          description: >-
                            The feature quantity selections associated with this
                            plan change.
                        effective_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            When this change takes effect, in milliseconds since
                            the Unix epoch, or null if it applies immediately.
                        canceled_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            When this plan was canceled, in milliseconds since
                            the Unix epoch, or null if it is not canceled.
                        expires_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            When this plan expires, in milliseconds since the
                            Unix epoch, or null if it does not expire.
                      required:
                        - plan_id
                        - feature_quantities
                        - effective_at
                        - canceled_at
                        - expires_at
                    description: Products or subscription changes being added or updated.
                  outgoing:
                    type: array
                    items:
                      type: object
                      properties:
                        plan_id:
                          type: string
                          description: The ID of the plan affected by this preview change.
                        plan:
                          $ref: '#/components/schemas/Plan'
                          description: >-
                            The full plan object if it was expanded in the
                            response.
                        feature_quantities:
                          type: array
                          items:
                            type: object
                            properties:
                              feature_id:
                                type: string
                                description: >-
                                  The ID of the adjustable feature included in
                                  this change.
                              quantity:
                                type: number
                                description: >-
                                  The quantity that will apply for this feature
                                  in the change.
                            required:
                              - feature_id
                              - quantity
                          description: >-
                            The feature quantity selections associated with this
                            plan change.
                        effective_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            When this change takes effect, in milliseconds since
                            the Unix epoch, or null if it applies immediately.
                        canceled_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            When this plan was canceled, in milliseconds since
                            the Unix epoch, or null if it is not canceled.
                        expires_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            When this plan expires, in milliseconds since the
                            Unix epoch, or null if it does not expire.
                      required:
                        - plan_id
                        - feature_quantities
                        - effective_at
                        - canceled_at
                        - expires_at
                    description: Products or subscription changes being removed or ended.
                  redirect_to_checkout:
                    type: boolean
                    description: >-
                      Whether the customer will be redirected to a checkout page
                      if attach is called.
                  checkout_type:
                    anyOf:
                      - enum:
                          - stripe_checkout
                          - autumn_checkout
                        type: string
                      - type: 'null'
                    description: >-
                      The type of checkout that will be used if the customer is
                      redirected to a checkout page.
                  tax:
                    type: object
                    properties:
                      total:
                        type: number
                        description: Total tax amount in major currency units.
                      amount_inclusive:
                        type: number
                        description: Tax included in line item subtotals.
                      amount_exclusive:
                        type: number
                        description: Tax added on top of subtotals.
                      currency:
                        type: string
                        description: Three-letter currency code.
                      status:
                        enum:
                          - complete
                          - incomplete
                        type: string
                        description: >-
                          Calculation status ('complete' when Stripe Tax
                          succeeds or 'incomplete' when Stripe Tax returned 0 or
                          errored).
                    required:
                      - total
                      - amount_inclusive
                      - amount_exclusive
                      - currency
                      - status
                    description: >-
                      Tax preview for the immediate charge. Contact us to enable
                      the tax flag on your organisation. Shows only with flag
                      enabled, a Stripe customer exists and has a location.
                  invoice_credits:
                    type: object
                    properties:
                      balance:
                        type: number
                        description: >-
                          Stripe customer credit balance available, expressed as
                          a positive number in major currency units.
                      currency:
                        type: string
                        description: Three-letter currency code.
                    required:
                      - balance
                      - currency
                    description: Stripe customer invoice credits preview.
                required:
                  - customer_id
                  - line_items
                  - subtotal
                  - total
                  - currency
                  - incoming
                  - outgoing
                  - redirect_to_checkout
                  - checkout_type
                examples:
                  - customerId: charles
                    lineItems:
                      - display_name: Pro seed
                        description: >-
                          Pro seed - Base Price (from 18 Feb 2026 to 18 Mar
                          2026)
                        subtotal: 20
                        total: 20
                        discounts: []
                    subtotal: 20
                    total: 20
                    currency: usd
              example:
                customerId: charles
                lineItems:
                  - display_name: Pro seed
                    description: Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)
                    subtotal: 20
                    total: 20
                    discounts: []
                subtotal: 20
                total: 20
                currency: usd
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Autumn } from 'autumn-js'

            const autumn = new Autumn()

            const result = await autumn.billing.previewMultiAttach({
              customerId: "cus_123",
              plans: [
                {
                  planId: "pro_plan",
                },
                {
                  planId: "addon_seats",
                  featureQuantities: [
                    {
                      featureId: "seats",
                      quantity: 5,
                    },
                  ],
                },
              ],
            });
        - lang: python
          label: Python (SDK)
          source: |-
            from autumn_sdk import Autumn

            autumn = Autumn(secret_key="am_sk_test...")

            res = autumn.billing.preview_multi_attach(
                customer_id="cus_123",
                plans=[
                    {
                        "plan_id": "pro_plan",
                    },
                    {
                        "plan_id": "addon_seats",
                        "feature_quantities": [
                            {
                                "feature_id": "seats",
                                "quantity": 5,
                            },
                        ],
                    },
                ],
                redirect_mode="if_required",
            )
components:
  schemas:
    CustomerData:
      type: object
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: Customer's name
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          description: Customer's email address
        fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Unique identifier (eg, serial number) to detect duplicate customers
            and prevent free trial abuse
        metadata:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties: {}
            - type: 'null'
          description: Additional metadata for the customer
        stripe_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Stripe customer ID if you already have one
        create_in_stripe:
          type: boolean
          description: Whether to create the customer in Stripe
        auto_enable_plan_id:
          type: string
          description: The ID of the free plan to auto-enable for the customer
        send_email_receipts:
          type: boolean
          description: Whether to send email receipts to this customer
        currency:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Currency to bill this customer in (e.g. usd, eur). Defaults to the
            organization's default currency.
        billing_controls:
          type: object
          properties:
            auto_topups:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The ID of the feature (credit balance) to auto top-up.
                  enabled:
                    type: boolean
                    default: false
                    description: Whether auto top-up is enabled.
                  threshold:
                    type: number
                    minimum: 0
                    description: >-
                      When the balance drops below this threshold, an auto
                      top-up will be purchased.
                  quantity:
                    type: number
                    minimum: 1
                    description: Amount of credits to add per auto top-up.
                  purchase_limit:
                    type: object
                    properties:
                      interval:
                        enum:
                          - hour
                          - day
                          - week
                          - month
                        type: string
                        description: The time interval for the purchase limit window.
                      interval_count:
                        type: number
                        minimum: 1
                        default: 1
                        description: Number of intervals in the purchase limit window.
                      limit:
                        type: number
                        minimum: 1
                        description: >-
                          Maximum number of auto top-ups allowed within the
                          interval.
                    required:
                      - interval
                      - limit
                    description: Optional rate limit to cap how often auto top-ups occur.
                  invoice_mode:
                    type: boolean
                    description: >-
                      When true, auto top-up creates a send_invoice invoice
                      instead of auto-charging.
                required:
                  - feature_id
                  - threshold
                  - quantity
              description: List of auto top-up configurations per feature.
            spend_limits:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: Optional feature ID this spend limit applies to.
                  enabled:
                    type: boolean
                    default: false
                    description: Whether the overage spend limit is enabled.
                  limit_type:
                    enum:
                      - absolute
                      - usage_percentage
                    type: string
                    description: >-
                      How overage_limit is interpreted: an absolute overage cap
                      (default) or a percentage of the main-plan allowance.
                  overage_limit:
                    type: number
                    minimum: 0
                    description: >-
                      Overage cap for the feature: absolute units, or a percent
                      (e.g. 120) when limit_type is usage_percentage.
                  skip_overage_billing:
                    type: boolean
                    description: >-
                      When true, overage for this feature is not posted to
                      Stripe. Usage tracking and balance resets still behave
                      normally.
              description: List of overage spend limits per feature (caps overage spend).
            usage_limits:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The feature this usage limit applies to.
                  enabled:
                    type: boolean
                    default: true
                    description: Whether this usage limit is enabled.
                  limit:
                    type: number
                    minimum: 0
                    description: Maximum units allowed per interval.
                  interval:
                    enum:
                      - day
                      - week
                      - month
                      - year
                    type: string
                    description: >-
                      Interval for the cap, aligned to the customer's billing
                      cycle.
                  filter:
                    type: object
                    properties:
                      properties:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties:
                          anyOf:
                            - type: string
                              minLength: 1
                              maxLength: 128
                            - type: number
                            - type: boolean
                    required:
                      - properties
                    description: >-
                      When set, only usage from events whose properties match
                      counts toward this cap. Omit to count all usage of the
                      feature.
                required:
                  - feature_id
                  - limit
                  - interval
              description: List of hard usage caps per feature (max units per interval).
            usage_alerts:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The feature ID this alert applies to.
                  enabled:
                    type: boolean
                    default: true
                    description: Whether this usage alert is enabled.
                  threshold:
                    type: number
                    minimum: 0
                    description: >-
                      The threshold value that triggers the alert. For usage or
                      remaining, this is an absolute count. For usage_percentage
                      or remaining_percentage, this is a percentage (0-100).
                  threshold_type:
                    enum:
                      - usage
                      - usage_percentage
                      - remaining
                      - remaining_percentage
                    type: string
                    description: >-
                      Whether the threshold is an absolute count or a percentage
                      of the usage allowance or remaining balance.
                  name:
                    type: string
                    description: >-
                      Optional user-defined label to distinguish multiple alerts
                      on the same feature.
                required:
                  - threshold
                  - threshold_type
              description: List of usage alert configurations per feature.
            overage_allowed:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The feature ID this overage allowed control applies to.
                  enabled:
                    type: boolean
                    default: false
                    description: Whether overage is allowed for this feature.
                required:
                  - feature_id
              description: >-
                List of overage allowed controls per feature. When enabled,
                usage can exceed balance.
          description: Billing controls for the customer (auto top-ups, etc.)
        config:
          type: object
          properties:
            disable_pooled_balance:
              type: boolean
              description: Whether to disable the shared customer-level pool for entities.
            disable_overage_billing:
              type: boolean
              description: >-
                Stops Autumn from posting usage-overage line items to Stripe for
                this customer. Check/track and balance resets still behave
                normally. When set, this overrides the organization-level
                disable_overage_billing setting.
          description: Miscellaneous configurations for the customer.
      title: CustomerData
      description: Customer details to set when creating a customer
    Plan:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the plan.
        name:
          type: string
          description: Display name of the plan.
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional description of the plan.
        group:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Group identifier for organizing related plans. Plans in the same
            group are mutually exclusive.
        version:
          type: number
          description: >-
            Version number of the plan. Incremented when plan configuration
            changes.
        add_on:
          type: boolean
          description: >-
            Whether this is an add-on plan that can be attached alongside a main
            plan.
        auto_enable:
          type: boolean
          description: >-
            If true, this plan is automatically attached when a customer is
            created. Used for free plans.
        price:
          anyOf:
            - type: object
              properties:
                amount:
                  type: number
                  description: Base price amount for the plan.
                additional_currencies:
                  type: array
                  items:
                    type: object
                    properties:
                      currency:
                        type: string
                        description: >-
                          Three-letter Stripe-supported currency code (e.g.
                          'eur', 'gbp').
                      amount:
                        type: number
                        description: >-
                          Price amount in this currency. Set explicitly per
                          currency, not converted from the base amount.
                    required:
                      - currency
                      - amount
                  description: >-
                    Base price amounts in additional currencies. The base
                    'amount' is in the org's default currency.
                interval:
                  enum:
                    - one_off
                    - week
                    - month
                    - quarter
                    - semi_annual
                    - year
                  type: string
                  description: Billing interval (e.g. 'month', 'year').
                interval_count:
                  type: number
                  description: Number of intervals per billing cycle. Defaults to 1.
                display:
                  type: object
                  properties:
                    primary_text:
                      type: string
                      description: Main display text (e.g. '$10' or '100 messages').
                    secondary_text:
                      type: string
                      description: >-
                        Secondary display text (e.g. 'per month' or 'then $0.5
                        per 100').
                  required:
                    - primary_text
                  description: Display text for showing this price in pricing pages.
              required:
                - amount
                - interval
            - type: 'null'
          description: >-
            Base recurring price for the plan. Null for free plans or usage-only
            plans.
        items:
          type: array
          items:
            type: object
            properties:
              feature_id:
                type: string
                description: The ID of the feature this item configures.
              feature:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      The ID of the feature, used to refer to it in other API
                      calls like /track or /check.
                  name:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: The name of the feature.
                  type:
                    enum:
                      - static
                      - boolean
                      - single_use
                      - continuous_use
                      - credit_system
                      - ai_credit_system
                    type: string
                    description: The type of the feature
                  display:
                    anyOf:
                      - type: object
                        properties:
                          singular:
                            type: string
                            description: The singular display name for the feature.
                          plural:
                            type: string
                            description: The plural display name for the feature.
                        required:
                          - singular
                          - plural
                      - type: 'null'
                    description: Singular and plural display names for the feature.
                  credit_schema:
                    anyOf:
                      - type: array
                        items:
                          type: object
                          properties:
                            metered_feature_id:
                              type: string
                              description: >-
                                The ID of the metered feature (should be a
                                single_use feature).
                            credit_cost:
                              type: number
                              description: The credit cost of the metered feature.
                          required:
                            - metered_feature_id
                            - credit_cost
                      - type: 'null'
                    description: Credit cost schema for credit system features.
                  archived:
                    anyOf:
                      - type: boolean
                      - type: 'null'
                    description: Whether or not the feature is archived.
                required:
                  - id
                  - type
                description: The full feature object if expanded.
              included:
                type: number
                description: >-
                  Number of free units included. For consumable features,
                  balance resets to this number each interval.
              unlimited:
                type: boolean
                description: Whether the customer has unlimited access to this feature.
              reset:
                anyOf:
                  - type: object
                    properties:
                      interval:
                        enum:
                          - one_off
                          - minute
                          - hour
                          - day
                          - week
                          - month
                          - quarter
                          - semi_annual
                          - year
                        type: string
                        description: >-
                          The interval at which the feature balance resets (e.g.
                          'month', 'year'). For consumable features, usage
                          resets to 0 and included units are restored.
                      interval_count:
                        type: number
                        description: Number of intervals between resets. Defaults to 1.
                    required:
                      - interval
                  - type: 'null'
                description: >-
                  Reset configuration for consumable features. Null for
                  non-consumable features like seats where usage persists across
                  billing cycles.
              price:
                anyOf:
                  - type: object
                    properties:
                      amount:
                        type: number
                        description: >-
                          Price per billing_units after included usage is
                          consumed. Mutually exclusive with tiers.
                      additional_currencies:
                        type: array
                        items:
                          type: object
                          properties:
                            currency:
                              type: string
                              description: >-
                                Three-letter Stripe-supported currency code
                                (e.g. 'eur', 'gbp').
                            amount:
                              type: number
                              description: >-
                                Price amount in this currency. Set explicitly
                                per currency, not converted from the base
                                amount.
                          required:
                            - currency
                            - amount
                        description: >-
                          Amounts in additional currencies for this flat price.
                          The base 'amount' is in the org's default currency.
                          Only valid with 'amount', not 'tiers' (tiered prices
                          carry per-currency amounts on each tier).
                      tiers:
                        type: array
                        items:
                          type: object
                          properties:
                            to:
                              anyOf:
                                - type: number
                                - const: inf
                            amount:
                              type: number
                            flat_amount:
                              type: number
                            additional_currencies:
                              type: array
                              items:
                                type: object
                                properties:
                                  currency:
                                    type: string
                                    description: >-
                                      Three-letter Stripe-supported currency
                                      code (e.g. 'eur', 'gbp').
                                  amount:
                                    type: number
                                    description: >-
                                      Per-unit amount for this tier in this
                                      currency.
                                  flat_amount:
                                    type: number
                                    description: >-
                                      Flat amount for this tier in this
                                      currency, if the tier uses one.
                                required:
                                  - currency
                          required:
                            - to
                            - amount
                        description: >-
                          Tiered pricing configuration. Each tier's 'to'
                          INCLUDES the included amount. Either 'tiers' or
                          'amount' is required.
                      tier_behavior:
                        enum:
                          - graduated
                          - volume
                        type: string
                      interval:
                        enum:
                          - one_off
                          - week
                          - month
                          - quarter
                          - semi_annual
                          - year
                        type: string
                        description: >-
                          Billing interval for this price. For consumable
                          features, should match reset.interval.
                      interval_count:
                        type: number
                        description: Number of intervals per billing cycle. Defaults to 1.
                      billing_units:
                        type: number
                        description: >-
                          Number of units per price increment. Usage is rounded
                          UP to the nearest billing_units when billed (e.g.
                          billing_units=100 means 101 usage rounds to 200).
                      billing_method:
                        enum:
                          - prepaid
                          - usage_based
                        type: string
                        description: >-
                          'prepaid' for features like seats where customers pay
                          upfront, 'usage_based' for pay-as-you-go after
                          included usage.
                      max_purchase:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: >-
                          Maximum units a customer can purchase beyond included.
                          E.g. if included=100 and max_purchase=300, customer
                          can use up to 400 total before usage is capped. Null
                          for no limit.
                    required:
                      - interval
                      - billing_units
                      - billing_method
                      - max_purchase
                  - type: 'null'
                description: >-
                  Pricing configuration for usage beyond included units. Null if
                  feature is entirely free.
              display:
                type: object
                properties:
                  primary_text:
                    type: string
                    description: Main display text (e.g. '$10' or '100 messages').
                  secondary_text:
                    type: string
                    description: >-
                      Secondary display text (e.g. 'per month' or 'then $0.5 per
                      100').
                required:
                  - primary_text
                description: Display text for showing this item in pricing pages.
              rollover:
                type: object
                properties:
                  max:
                    anyOf:
                      - type: number
                      - type: 'null'
                    description: Maximum rollover units. Null for unlimited rollover.
                  max_percentage:
                    anyOf:
                      - type: number
                      - type: 'null'
                    description: >-
                      Maximum rollover as a percentage (0-100) of included +
                      prepaid grant. Mutually exclusive with max.
                  expiry_duration_type:
                    enum:
                      - month
                      - forever
                    type: string
                    description: When rolled over units expire.
                  expiry_duration_length:
                    type: number
                    description: Number of periods before expiry.
                required:
                  - max
                  - expiry_duration_type
                description: >-
                  Rollover configuration for unused units. If set, unused
                  included units roll over to the next period.
            required:
              - feature_id
              - included
              - unlimited
              - reset
              - price
          description: >-
            Feature configurations included in this plan. Each item defines
            included units, pricing, and reset behavior for a feature.
        free_trial:
          type: object
          properties:
            duration_length:
              type: number
              description: Number of duration_type periods the trial lasts.
            duration_type:
              enum:
                - day
                - month
                - year
              type: string
              description: Unit of time for the trial duration ('day', 'month', 'year').
            card_required:
              type: boolean
              description: >-
                Whether a payment method is required to start the trial. If
                true, customer will be charged after trial ends.
            on_end:
              anyOf:
                - enum:
                    - bill
                    - revert
                  type: string
                - type: 'null'
              description: >-
                Behavior when the trial ends. 'bill' charges the customer
                (default). 'revert' expires the trial and restores the
                customer's previous plan.
          required:
            - duration_length
            - duration_type
            - card_required
          description: >-
            Free trial configuration. If set, new customers can try this plan
            before being charged.
        created_at:
          type: number
          description: Unix timestamp (ms) when the plan was created.
        env:
          enum:
            - sandbox
            - live
          type: string
          description: Environment this plan belongs to ('sandbox' or 'live').
        archived:
          type: boolean
          description: >-
            Whether the plan is archived. Archived plans cannot be attached to
            new customers.
        base_variant_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Deprecated. Use variant_details.base_plan_id instead. If this is a
            variant, the ID of the base plan it was created from.
        variant_details:
          type: object
          properties:
            base_plan_id:
              type: string
              description: The ID of the base plan this variant was derived from.
            customize:
              type: object
              properties:
                price:
                  anyOf:
                    - type: object
                      properties:
                        amount:
                          type: number
                          description: Base price amount for the plan.
                        interval:
                          enum:
                            - one_off
                            - week
                            - month
                            - quarter
                            - semi_annual
                            - year
                          type: string
                          description: Billing interval (e.g. 'month', 'year').
                        interval_count:
                          type: number
                          description: >-
                            Number of intervals per billing cycle. Defaults to
                            1.
                        additional_currencies:
                          type: array
                          items:
                            type: object
                            properties:
                              currency:
                                type: string
                                description: >-
                                  Three-letter Stripe-supported currency code
                                  (e.g. 'eur', 'gbp').
                              amount:
                                type: number
                                description: >-
                                  Price amount in this currency. Set explicitly
                                  per currency, not converted from the base
                                  amount.
                            required:
                              - currency
                              - amount
                          description: >-
                            Base price amounts in additional currencies. The
                            base 'amount' is in the org's default currency.
                      required:
                        - amount
                        - interval
                      title: BasePrice
                      description: Base price configuration for a plan.
                    - type: 'null'
                  description: >-
                    Override the base price of the plan. Pass null to remove the
                    base price.
                add_items:
                  type: array
                  items:
                    type: object
                    properties:
                      feature_id:
                        type: string
                        description: The ID of the feature to configure.
                      included:
                        type: number
                        description: >-
                          Number of free units included. Balance resets to this
                          each interval for consumable features.
                      unlimited:
                        type: boolean
                        description: >-
                          If true, customer has unlimited access to this
                          feature.
                      reset:
                        type: object
                        properties:
                          interval:
                            enum:
                              - one_off
                              - minute
                              - hour
                              - day
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                            description: >-
                              Interval at which balance resets (e.g. 'month',
                              'year'). For consumable features only.
                          interval_count:
                            type: number
                            description: Number of intervals between resets. Defaults to 1.
                        required:
                          - interval
                        description: >-
                          Reset configuration for consumable features. Omit for
                          non-consumable features like seats.
                      price:
                        type: object
                        properties:
                          amount:
                            type: number
                            description: >-
                              Price per billing_units after included usage.
                              Either 'amount' or 'tiers' is required.
                          additional_currencies:
                            type: array
                            items:
                              type: object
                              properties:
                                currency:
                                  type: string
                                  description: >-
                                    Three-letter Stripe-supported currency code
                                    (e.g. 'eur', 'gbp').
                                amount:
                                  type: number
                                  description: >-
                                    Price amount in this currency. Set
                                    explicitly per currency, not converted from
                                    the base amount.
                              required:
                                - currency
                                - amount
                            description: >-
                              Amounts in additional currencies for this flat
                              price. The base 'amount' is in the org's default
                              currency. Only valid with 'amount', not 'tiers'.
                          tiers:
                            type: array
                            items:
                              type: object
                              properties:
                                to:
                                  anyOf:
                                    - type: number
                                    - const: inf
                                amount:
                                  type: number
                                flat_amount:
                                  type: number
                                additional_currencies:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      currency:
                                        type: string
                                        description: >-
                                          Three-letter Stripe-supported currency
                                          code (e.g. 'eur', 'gbp').
                                      amount:
                                        type: number
                                        description: >-
                                          Per-unit amount for this tier in this
                                          currency.
                                      flat_amount:
                                        type: number
                                        description: >-
                                          Flat amount for this tier in this
                                          currency, if the tier uses one.
                                    required:
                                      - currency
                              required:
                                - to
                                - amount
                            description: >-
                              Tiered pricing.  Either 'amount' or 'tiers' is
                              required.
                          tier_behavior:
                            enum:
                              - graduated
                              - volume
                            type: string
                          interval:
                            enum:
                              - one_off
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                            description: >-
                              Billing interval. For consumable features, should
                              match reset.interval.
                          interval_count:
                            type: number
                            default: 1
                            description: >-
                              Number of intervals per billing cycle. Defaults to
                              1.
                          billing_units:
                            type: number
                            default: 1
                            description: >-
                              Units per price increment. Usage is rounded UP
                              when billed (e.g. billing_units=100 means 101
                              rounds to 200).
                          billing_method:
                            enum:
                              - prepaid
                              - usage_based
                            type: string
                            description: >-
                              'prepaid' for upfront payment (seats),
                              'usage_based' for pay-as-you-go.
                          max_purchase:
                            anyOf:
                              - type: number
                              - type: 'null'
                            description: >-
                              Max units purchasable beyond included. E.g.
                              included=100, max_purchase=300 allows 400 total.
                              Null for no limit.
                        required:
                          - interval
                          - billing_method
                        description: >-
                          Pricing for usage beyond included units. Omit for free
                          features.
                      proration:
                        type: object
                        properties:
                          on_increase:
                            enum:
                              - bill_immediately
                              - prorate_immediately
                              - prorate_next_cycle
                              - bill_next_cycle
                            type: string
                            description: >-
                              Billing behavior when quantity increases
                              mid-cycle.
                          on_decrease:
                            enum:
                              - prorate
                              - prorate_immediately
                              - prorate_next_cycle
                              - none
                              - no_prorations
                            type: string
                            description: Credit behavior when quantity decreases mid-cycle.
                        required:
                          - on_increase
                          - on_decrease
                        description: >-
                          Proration settings for prepaid features. Controls
                          mid-cycle quantity change billing.
                      rollover:
                        type: object
                        properties:
                          max:
                            type: number
                            description: Max rollover units. Omit for unlimited rollover.
                          max_percentage:
                            type: number
                            description: >-
                              Maximum rollover as a percentage (0-100) of
                              included + prepaid grant. Mutually exclusive with
                              max.
                          expiry_duration_type:
                            enum:
                              - month
                              - forever
                            type: string
                            description: When rolled over units expire.
                          expiry_duration_length:
                            type: number
                            description: Number of periods before expiry.
                        required:
                          - expiry_duration_type
                        description: >-
                          Rollover config for unused units. If set, unused
                          included units carry over.
                    required:
                      - feature_id
                    title: PlanItem
                    description: >-
                      Configuration for a feature item in a plan, including
                      usage limits, pricing, and rollover settings.
                  description: Items to add to the plan.
                remove_items:
                  type: array
                  items:
                    type: object
                    properties:
                      feature_id:
                        type: string
                        description: Match items linked to this feature.
                      billing_method:
                        enum:
                          - prepaid
                          - usage_based
                        type: string
                        description: >-
                          Match items with this billing method (prepaid or
                          usage_based).
                      interval:
                        anyOf:
                          - enum:
                              - one_off
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                          - enum:
                              - one_off
                              - minute
                              - hour
                              - day
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                        description: >-
                          Match items with this interval. Accepts either a
                          BillingInterval (price-side) or a ResetInterval
                          (reset-side, includes day/hour/minute) so price-less
                          items keyed by reset.interval can be disambiguated.
                      interval_count:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        exclusiveMinimum: 0
                        description: >-
                          Match items with this interval_count. Disambiguates
                          between items that share an interval but differ in
                          count.
                    title: PlanItemFilter
                    description: >-
                      Filter for matching plan items. All provided fields must
                      match (AND).
                  description: Filters selecting items to remove from the plan.
                free_trial:
                  anyOf:
                    - type: object
                      properties:
                        duration_length:
                          type: number
                          description: Number of duration_type periods the trial lasts.
                        duration_type:
                          enum:
                            - day
                            - month
                            - year
                          type: string
                          default: month
                          description: Unit of time for the trial ('day', 'month', 'year').
                        card_required:
                          type: boolean
                          default: true
                          description: >-
                            If true, payment method required to start trial.
                            Customer is charged after trial ends.
                        on_end:
                          enum:
                            - bill
                            - revert
                          type: string
                          description: >-
                            Behavior when the trial ends. 'bill' charges the
                            customer (default). 'revert' expires the trial and
                            restores the customer's previous plan.
                      required:
                        - duration_length
                      title: FreeTrialParams
                      description: Free trial configuration for a plan.
                    - type: 'null'
                  description: >-
                    Override the plan's default free trial. Pass an object to
                    set a custom trial, or null to remove the trial entirely.
                billing_controls:
                  type: object
                  properties:
                    auto_topups:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: >-
                              The ID of the feature (credit balance) to auto
                              top-up.
                          enabled:
                            type: boolean
                            default: false
                            description: Whether auto top-up is enabled.
                          threshold:
                            type: number
                            minimum: 0
                            description: >-
                              When the balance drops below this threshold, an
                              auto top-up will be purchased.
                          quantity:
                            type: number
                            minimum: 1
                            description: Amount of credits to add per auto top-up.
                          purchase_limit:
                            type: object
                            properties:
                              interval:
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                type: string
                                description: >-
                                  The time interval for the purchase limit
                                  window.
                              interval_count:
                                type: number
                                minimum: 1
                                default: 1
                                description: >-
                                  Number of intervals in the purchase limit
                                  window.
                              limit:
                                type: number
                                minimum: 1
                                description: >-
                                  Maximum number of auto top-ups allowed within
                                  the interval.
                            required:
                              - interval
                              - limit
                            description: >-
                              Optional rate limit to cap how often auto top-ups
                              occur.
                          invoice_mode:
                            type: boolean
                            description: >-
                              When true, auto top-up creates a send_invoice
                              invoice instead of auto-charging.
                        required:
                          - feature_id
                          - threshold
                          - quantity
                      description: List of auto top-up configurations per feature.
                    spend_limits:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: Optional feature ID this spend limit applies to.
                          enabled:
                            type: boolean
                            default: false
                            description: Whether the overage spend limit is enabled.
                          limit_type:
                            enum:
                              - absolute
                              - usage_percentage
                            type: string
                            description: >-
                              How overage_limit is interpreted: an absolute
                              overage cap (default) or a percentage of the
                              main-plan allowance.
                          overage_limit:
                            type: number
                            minimum: 0
                            description: >-
                              Overage cap for the feature: absolute units, or a
                              percent (e.g. 120) when limit_type is
                              usage_percentage.
                          skip_overage_billing:
                            type: boolean
                            description: >-
                              When true, overage for this feature is not posted
                              to Stripe. Usage tracking and balance resets still
                              behave normally.
                      description: >-
                        List of overage spend limits per feature (caps overage
                        spend).
                    usage_limits:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: The feature this usage limit applies to.
                          enabled:
                            type: boolean
                            default: true
                            description: Whether this usage limit is enabled.
                          limit:
                            type: number
                            minimum: 0
                            description: Maximum units allowed per interval.
                          interval:
                            enum:
                              - day
                              - week
                              - month
                              - year
                            type: string
                            description: >-
                              Interval for the cap, aligned to the customer's
                              billing cycle.
                          filter:
                            type: object
                            properties:
                              properties:
                                type: object
                                propertyNames:
                                  type: string
                                  minLength: 1
                                  maxLength: 64
                                additionalProperties: {}
                            required:
                              - properties
                            description: >-
                              When set, only usage from events whose properties
                              match counts toward this cap. Omit to count all
                              usage of the feature.
                        required:
                          - feature_id
                          - limit
                          - interval
                      description: >-
                        List of hard usage caps per feature (max units per
                        interval).
                    usage_alerts:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: The feature ID this alert applies to.
                          enabled:
                            type: boolean
                            default: true
                            description: Whether this usage alert is enabled.
                          threshold:
                            type: number
                            minimum: 0
                            description: >-
                              The threshold value that triggers the alert. For
                              usage or remaining, this is an absolute count. For
                              usage_percentage or remaining_percentage, this is
                              a percentage (0-100).
                          threshold_type:
                            enum:
                              - usage
                              - usage_percentage
                              - remaining
                              - remaining_percentage
                            type: string
                            description: >-
                              Whether the threshold is an absolute count or a
                              percentage of the usage allowance or remaining
                              balance.
                          name:
                            type: string
                            description: >-
                              Optional user-defined label to distinguish
                              multiple alerts on the same feature.
                        required:
                          - threshold
                          - threshold_type
                      description: List of usage alert configurations per feature.
                    overage_allowed:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: >-
                              The feature ID this overage allowed control
                              applies to.
                          enabled:
                            type: boolean
                            default: false
                            description: Whether overage is allowed for this feature.
                        required:
                          - feature_id
                      description: >-
                        List of overage allowed controls per feature. When
                        enabled, usage can exceed balance.
                  description: >-
                    Override the plan's billing controls (auto top-ups, spend
                    limits, usage limits, usage alerts, overage allowed) for
                    this customer.
              additionalProperties: false
              description: >-
                The customization that transforms the base plan into this
                variant.
          required:
            - base_plan_id
          description: Details about how this variant relates to its latest base plan.
        config:
          type: object
          properties:
            ignore_past_due:
              type: boolean
              default: false
              description: >-
                If true, entitlements attached to this plan will still reset on
                schedule even when the customer's product is in a past_due
                state.
          description: Miscellaneous plan-level configuration flags.
        billing_controls:
          type: object
          properties:
            auto_topups:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The ID of the feature (credit balance) to auto top-up.
                  enabled:
                    type: boolean
                    default: false
                    description: Whether auto top-up is enabled.
                  threshold:
                    type: number
                    minimum: 0
                    description: >-
                      When the balance drops below this threshold, an auto
                      top-up will be purchased.
                  quantity:
                    type: number
                    minimum: 1
                    description: Amount of credits to add per auto top-up.
                  purchase_limit:
                    type: object
                    properties:
                      interval:
                        enum:
                          - hour
                          - day
                          - week
                          - month
                        type: string
                        description: The time interval for the purchase limit window.
                      interval_count:
                        type: number
                        minimum: 1
                        default: 1
                        description: Number of intervals in the purchase limit window.
                      limit:
                        type: number
                        minimum: 1
                        description: >-
                          Maximum number of auto top-ups allowed within the
                          interval.
                    required:
                      - interval
                      - limit
                    description: Optional rate limit to cap how often auto top-ups occur.
                  invoice_mode:
                    type: boolean
                    description: >-
                      When true, auto top-up creates a send_invoice invoice
                      instead of auto-charging.
                required:
                  - feature_id
                  - threshold
                  - quantity
              description: List of auto top-up configurations per feature.
            spend_limits:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: Optional feature ID this spend limit applies to.
                  enabled:
                    type: boolean
                    default: false
                    description: Whether the overage spend limit is enabled.
                  limit_type:
                    enum:
                      - absolute
                      - usage_percentage
                    type: string
                    description: >-
                      How overage_limit is interpreted: an absolute overage cap
                      (default) or a percentage of the main-plan allowance.
                  overage_limit:
                    type: number
                    minimum: 0
                    description: >-
                      Overage cap for the feature: absolute units, or a percent
                      (e.g. 120) when limit_type is usage_percentage.
                  skip_overage_billing:
                    type: boolean
                    description: >-
                      When true, overage for this feature is not posted to
                      Stripe. Usage tracking and balance resets still behave
                      normally.
              description: List of overage spend limits per feature (caps overage spend).
            usage_limits:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The feature this usage limit applies to.
                  enabled:
                    type: boolean
                    default: true
                    description: Whether this usage limit is enabled.
                  limit:
                    type: number
                    minimum: 0
                    description: Maximum units allowed per interval.
                  interval:
                    enum:
                      - day
                      - week
                      - month
                      - year
                    type: string
                    description: >-
                      Interval for the cap, aligned to the customer's billing
                      cycle.
                  filter:
                    type: object
                    properties:
                      properties:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties: {}
                    required:
                      - properties
                    description: >-
                      When set, only usage from events whose properties match
                      counts toward this cap. Omit to count all usage of the
                      feature.
                required:
                  - feature_id
                  - limit
                  - interval
              description: List of hard usage caps per feature (max units per interval).
            usage_alerts:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The feature ID this alert applies to.
                  enabled:
                    type: boolean
                    default: true
                    description: Whether this usage alert is enabled.
                  threshold:
                    type: number
                    minimum: 0
                    description: >-
                      The threshold value that triggers the alert. For usage or
                      remaining, this is an absolute count. For usage_percentage
                      or remaining_percentage, this is a percentage (0-100).
                  threshold_type:
                    enum:
                      - usage
                      - usage_percentage
                      - remaining
                      - remaining_percentage
                    type: string
                    description: >-
                      Whether the threshold is an absolute count or a percentage
                      of the usage allowance or remaining balance.
                  name:
                    type: string
                    description: >-
                      Optional user-defined label to distinguish multiple alerts
                      on the same feature.
                required:
                  - threshold
                  - threshold_type
              description: List of usage alert configurations per feature.
            overage_allowed:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The feature ID this overage allowed control applies to.
                  enabled:
                    type: boolean
                    default: false
                    description: Whether overage is allowed for this feature.
                required:
                  - feature_id
              description: >-
                List of overage allowed controls per feature. When enabled,
                usage can exceed balance.
          description: Plan-level billing controls used as customer defaults.
        metadata:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
          description: >-
            Arbitrary key-value metadata defined by you for your own use. Shared
            across all versions of the plan.
        customer_eligibility:
          type: object
          properties:
            trial_available:
              type: boolean
              description: >-
                Whether the trial on this plan is available to this customer.
                For example, if the customer used the trial in the past, this
                will be false.
            status:
              enum:
                - active
                - scheduled
              type: string
              description: >-
                The customer's current status with this plan. 'active' if
                attached, 'scheduled' if pending activation.
            canceling:
              type: boolean
              description: >-
                Whether the customer's active instance of this plan is set to
                cancel.
            trialing:
              type: boolean
              description: Whether the customer is currently on a free trial of this plan.
            attach_action:
              enum:
                - activate
                - upgrade
                - downgrade
                - none
                - purchase
              type: string
              description: >-
                The action that would occur if this plan were attached to the
                customer.
          required:
            - attach_action
      required:
        - id
        - name
        - description
        - group
        - version
        - add_on
        - auto_enable
        - price
        - items
        - created_at
        - env
        - archived
        - base_variant_id
        - config
        - metadata
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````