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

# Preview Subscription Quantity

> Read-only preview of the estimated amount for the next cycle at a given quantity, intended to be shown before a seat change. Only supported for active subscriptions with billing_dimension=quantity. Has no side effects.

Read-only preview of the estimated amount for the next cycle at a given quantity, intended to be shown before a seat change. Only supported for active subscriptions with billing\_dimension=quantity. Has no side effects.


## OpenAPI

````yaml openapi/v1-en.yaml GET /api/v1/subscription/{subscription_id}/quantity-preview
openapi: 3.0.3
info:
  title: Subotiz API
  description: Subotiz OpenAPI
  version: 1.0.0
servers:
  - url: https://{api}.subotiz.com
    variables:
      api:
        default: api
security:
  - sec0: []
tags:
  - name: Subscription
    description: 订阅
  - name: Price
    description: 商品定价方案
  - name: Trade
    description: 交易单
  - name: Payment
    description: 支付流水
  - name: Checkout Session
    description: 结账会话
  - name: Customer
    description: 顾客
  - name: Customer Portal
    description: 顾客门户
paths:
  /api/v1/subscription/{subscription_id}/quantity-preview:
    get:
      tags:
        - Subscription
      summary: Preview Subscription Quantity
      description: >-
        Read-only preview of the estimated amount for the next cycle at a given
        quantity, intended to be shown before a seat change. Only supported for
        active subscriptions with billing_dimension=quantity. Has no side
        effects.
      operationId: v1-subscription-preview-subscription-quantity
      parameters:
        - name: subscription_id
          in: path
          description: Subscription ID (path)
          required: true
          schema:
            type: string
        - name: quantity
          in: query
          description: Target quantity to preview (query, 1-999999999)
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/HeaderRequestID'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewSubscriptionQuantityResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
              example:
                code: system_error
                message: Internal server error.
components:
  parameters:
    HeaderRequestID:
      name: Request-Id
      in: header
      description: The unique identifier of the request
      required: true
      schema:
        type: string
        default: 008e3967-a1b5-48bb-be14-d5bff5092e61
  schemas:
    PreviewSubscriptionQuantityResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
        data:
          $ref: '#/components/schemas/PreviewSubscriptionQuantityResponse_Data'
      description: Quantity change preview response
    BaseResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
    PreviewSubscriptionQuantityResponse_Data:
      type: object
      properties:
        quantity:
          type: string
          description: Previewed quantity (echoed back)
        cycle_index:
          type: integer
          description: Billing cycle this preview applies to (subscription.cycle_index + 1)
          format: int32
        effective_at:
          type: string
          description: Effective time (end of the current cycle)
        next_amount:
          type: string
          description: >-
            Estimated amount for the next cycle (calculated for the given
            quantity via solution-billing Calculate; for display only, not an
            immediate charge)
        breakdown:
          type: array
          items:
            $ref: '#/components/schemas/TierBreakdown'
          description: >-
            Per-tier amount breakdown (passed through from the Calculate
            breakdown)
      description: Quantity change preview response
    TierBreakdown:
      type: object
      properties:
        tier_order:
          type: integer
          description: Tier order, starting from 1
          format: uint32
        quantity_min:
          type: string
          description: Lower bound of this tier
        quantity_max:
          type: string
          description: Upper bound of this tier; empty means unlimited
        units_in_tier:
          type: string
          description: Quantity / usage that falls into this tier
        unit_price:
          type: string
          description: Unit price for this tier
        flat_amount:
          type: string
          description: >-
            Flat fee for this tier (same name as the flat_amount column in
            pricing storage)
        subtotal:
          type: string
          description: Subtotal for this tier
      description: >-
        Per-tier calculation breakdown returned when billing is computed across
        tiers
  securitySchemes:
    sec0:
      type: http
      description: >-
        Bearer API Key authentication. Format: Authorization: Bearer
        {your_api_key}
      scheme: bearer

````