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

# List Subscriptions

> List Subscriptions



## OpenAPI

````yaml openapi/v1-en.yaml GET /api/v1/subscription
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:
    get:
      tags:
        - Subscription
      summary: List Subscriptions
      description: List Subscriptions
      operationId: v1-subscription-list-subscription
      parameters:
        - name: ids
          in: query
          description: >-
            Subscription ID array, filter subscription records whose IDs belong
            to this array
          schema:
            type: array
            items:
              type: string
        - name: status
          in: query
          description: |-
            Subscription business status:
            - init - Pending activation
            - trial - Trial period
            - active - Active
            - canceled - Canceled
            - incomplete - Incomplete
          schema:
            type: string
        - name: starting_after
          in: query
          description: >-
            Cursor for pagination. `starting_after` is the object ID that
            defines your position in the list. For example, if you want to get
            the next page, you can use the last object's ID as the parameter
            value after getting the object list for the first time. Cannot be
            used together with `ending_before`
          schema:
            type: string
        - name: ending_before
          in: query
          description: >-
            Cursor for pagination. `ending_before` is the object ID that defines
            your position in the list. For example, if you want to get the
            previous page, you can use the first object's ID as the parameter
            value after getting the object list for the first time. Cannot be
            used together with `starting_after`
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            Pagination parameter, number of items per page, default: 10,
            interface defaults to sorting by creation time in descending order.
            Limit: [1, 100]
          schema:
            type: integer
            format: int32
        - name: merchant_id
          in: query
          description: Merchant unique identifier
          schema:
            type: string
        - name: order_ids
          in: query
          description: >-
            The order_ids of you platform, filter the subscription records where
            the `order_id` belongs to this array.
          schema:
            type: array
            items:
              type: string
        - name: source_trade_ids
          in: query
          description: >-
            The `source_trade_id` array, filter subscriptions where
            source_trade_id belongs to this array
          schema:
            type: array
            items:
              type: string
        - name: billing_cycle_unit
          in: query
          description: |-
            Subscription business billing cycle unit:
            - week
            - month
            - quarter
            - year
            - customer-initiated
            - over_threshold
          schema:
            type: array
            items:
              type: string
        - name: search_type
          in: query
          description: >-
            The `search_type` belongs to one of the fields such as
            subscription_id,trade_id,refund_id,invoice_id, and customer_id
          schema:
            type: string
        - name: search_value
          in: query
          description: The `search_value` is the value corresponding to search_type
          schema:
            type: string
        - name: created_at.gt
          in: query
          description: >-
            Minimum value to filter by (exclusive, UTC time in RFC3339 format,
            such as '2025-01-01T00:00:00Z')
          schema:
            type: string
        - name: created_at.gte
          in: query
          description: >-
            Minimum value to filter by (inclusive, UTC time in RFC3339 format,
            such as '2025-01-01T00:00:00Z')
          schema:
            type: string
        - name: created_at.lt
          in: query
          description: >-
            Maximum value to filter by (exclusive, UTC time in RFC3339 format,
            such as '2025-01-01T00:00:00Z')
          schema:
            type: string
        - name: created_at.lte
          in: query
          description: >-
            Maximum value to filter by (inclusive, UTC time in RFC3339 format,
            such as '2025-01-01T00:00:00Z')
          schema:
            type: string
        - $ref: '#/components/parameters/HeaderRequestID'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSubscriptionsResponse'
        '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:
    ListSubscriptionsResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
        data:
          $ref: '#/components/schemas/ListSubscriptionsResponse_Data'
    BaseResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
    ListSubscriptionsResponse_Data:
      type: object
      properties:
        has_more:
          type: boolean
          description: Whether there is more data
        list:
          type: array
          items:
            $ref: '#/components/schemas/Subscription'
          description: Subscription record list
    Subscription:
      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
        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.
  securitySchemes:
    sec0:
      type: http
      description: >-
        Bearer API Key authentication. Format: Authorization: Bearer
        {your_api_key}
      scheme: bearer

````