> ## 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.

# Get Subscription

> Get Subscription



## OpenAPI

````yaml openapi/v1-en.yaml GET /api/v1/subscription/{subscription_id}
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: Subscription
  - name: Price
    description: Price
  - name: Trade
    description: Trade
  - name: Payment
    description: Payment
  - name: Checkout Session
    description: Checkout Session
  - name: Customer
    description: Customer
  - name: Customer Portal
    description: Customer Portal
paths:
  /api/v1/subscription/{subscription_id}:
    get:
      tags:
        - Subscription
      summary: Get Subscription
      description: Get Subscription
      operationId: v1-subscription-get-subscription
      parameters:
        - name: subscription_id
          in: path
          description: Subscription ID
          required: true
          schema:
            type: string
        - name: merchant_id
          in: query
          description: Merchant unique identifier
          schema:
            type: string
        - $ref: '#/components/parameters/HeaderRequestID'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubscriptionResponse'
        '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:
    GetSubscriptionResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
        data:
          $ref: '#/components/schemas/GetSubscriptionResponse_Data'
    BaseResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
    GetSubscriptionResponse_Data:
      type: object
      properties:
        id:
          type: string
          description: Subscription unique identifier
        customer_id:
          type: string
          description: Subotiz customer unique identifier
        email:
          type: string
          description: Customer email
        cycle_index:
          type: integer
          description: Current cycle index of the subscription
          format: int32
        metadata:
          type: object
          additionalProperties:
            type: string
          description: >-
            A set of key-value pairs that can be attached to an object, allowing
            you to store additional information in a structured format.
        cancel_reason:
          type: string
          description: Cancel subscription reason
        sub_merchant_id:
          type: string
          description: Merchant unique identifier
        status:
          type: string
          description: |-
            Subscription business status:
            - init - Pending activation
            - trial - Trial period
            - active - Active
            - canceled - Canceled
            - incomplete - Incomplete
        price_id:
          type: string
          description: Product pricing plan unique identifier
        total_cycles:
          type: integer
          description: Total number of cycles (0 means unlimited)
          format: int32
        current_period_start:
          type: string
          description: Current billing period start time
        current_period_end:
          type: string
          description: Current billing period end time
        next_invoice_date:
          type: string
          description: Next renewal time
        created_at:
          type: string
          description: Creation time
        updated_at:
          type: string
          description: Update time
        cancel_at:
          type: string
          description: Cancel subscription time (optional)
        order_id:
          type: string
          description: >-
            Third-party order ID, same as the `order_id` passed when creating
            checkout session.
        source_trade_id:
          type: string
          description: Trade ID, subscription originated from this trade order.
        price_type:
          type: string
          description: Price Type
        usage_amount:
          type: string
          description: Usage Amount
        usage_unit:
          type: string
          description: Usage Unit
        model_type:
          type: string
          description: Model Type
        billing_threshold:
          type: string
          description: Billing Threshold
        is_canceling:
          type: boolean
          description: >-
            Whether it has entered the terminated state (including initiating
            termination but not terminating, as well as having been terminated
            and ended)
        launch_cancel_at:
          type: string
          description: Initiation termination time
        expected_cancel_at:
          type: string
          description: Expected termination time
        price_version_id:
          type: string
          description: Product pricing plan version unique identifier
        first_source_channel:
          type: string
          description: The source where this checkout session was initially created.
        last_source_channel:
          type: string
          description: The source where this checkout session was last accessed.
        is_renewable:
          type: boolean
          description: Whether it supports conversion to a continuous subscription
        current_period:
          type: integer
          description: Current subscription period index
          format: int32
        end_at:
          type: string
          description: Fixed-term subscription end time
        fixed_term:
          type: integer
          description: Fixed-term subscription length
          format: int32
  securitySchemes:
    sec0:
      type: http
      description: >-
        Bearer API Key authentication. Format: Authorization: Bearer
        {your_api_key}
      scheme: bearer

````