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

# List subscription history

> Lists the account's subscription plans, newest first, including a scheduled plan change if there is one (it has `subscriptionPlanReservation`). The current plan also includes the number of technical tickets opened in the current period. With `teamID`, it lists the team's subscriptions.



## OpenAPI

````yaml /spec/platform-billing.yaml get /v1/subscription
openapi: 3.0.1
info:
  title: Billing & Subscription
  version: 1.0.0
  description: |
    Check your balance and costs, add credit, download invoices and receipts,
    manage your subscription plan, and apply discount codes.

    All amounts are in Toman (IRT).

    With `teamID`, these endpoints work on the team's billing. Most of them
    need the `billing.manage` permission in the team; the description of each
    endpoint says which permission it needs.
servers:
  - url: https://api.liara.ir
security:
  - bearerAuth: []
tags:
  - name: Balance & Usage
    description: Balance, current costs and service counts.
  - name: Payments
    description: Add credit and list past payments.
  - name: Invoices & Receipts
    description: Monthly billing invoices and payment receipts.
  - name: Subscription
    description: View and change the account's subscription plan.
  - name: Discount Codes
    description: Check and apply discount codes.
paths:
  /v1/subscription:
    get:
      tags:
        - Subscription
      summary: List subscription history
      description: >-
        Lists the account's subscription plans, newest first, including a
        scheduled plan change if there is one (it has
        `subscriptionPlanReservation`). The current plan also includes the
        number of technical tickets opened in the current period. With `teamID`,
        it lists the team's subscriptions.
      operationId: listSubscriptions
      parameters:
        - $ref: '#/components/parameters/TeamID'
      responses:
        '200':
          description: Subscription history.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Subscription'
              example:
                - _id: '000000000000000000000003'
                  type: subscription
                  userID: '000000000000000000000001'
                  subscriptionPlanID: standard
                  subscriptionPlanExpiration: '2026-02-01T08:00:00.000Z'
                  maxTechnicalTicketsPerMonth: infinite
                  subscriptionDurationType: monthly
                  technicalTicketsCount: 2
                  createdAt: '2026-01-01T08:00:00.000Z'
                  updatedAt: '2026-01-01T08:00:00.000Z'
        '400':
          $ref: '#/components/responses/InvalidTeamID'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/TeamNotFound'
components:
  parameters:
    TeamID:
      name: teamID
      in: query
      required: false
      description: >-
        Run the request in the context of a team you belong to, instead of your
        personal account.
      schema:
        $ref: '#/components/schemas/ObjectID'
      example: '000000000000000000000002'
  schemas:
    Subscription:
      type: object
      properties:
        _id:
          type: string
        type:
          type: string
          enum:
            - subscription
        userID:
          type: string
        subscriptionPlanID:
          type: string
          enum:
            - free
            - standard
            - enterprise
        subscriptionPlanExpiration:
          type: string
          format: date-time
        subscriptionPlanReservation:
          type: string
          format: date-time
          description: Only on a scheduled plan change; when it starts.
        subscriptionDurationType:
          type: string
          enum:
            - monthly
            - yearly
        maxTechnicalTicketsPerMonth:
          description: Monthly technical ticket allowance, or `infinite`.
          oneOf:
            - type: integer
            - type: string
              enum:
                - infinite
        technicalTicketsCount:
          type: integer
          description: >-
            Only on the current plan. Technical support tickets opened in the
            current period.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ObjectID:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: 24-character hexadecimal ID.
    Error:
      type: object
      description: Standard error body.
      properties:
        statusCode:
          type: integer
        error:
          type: string
          description: HTTP status text.
        message:
          type: string
          description: What went wrong.
        data:
          type: object
          nullable: true
          description: >-
            Extra details. When present, `code` is a stable, machine-readable
            error code.
          properties:
            code:
              type: string
    AuthError:
      type: object
      description: Error body returned when the API token is rejected.
      properties:
        error:
          type: string
  responses:
    InvalidTeamID:
      description: '`teamID` isn''t a valid ID.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            error: Bad Request
            message: Invalid team ID.
            data: null
    Unauthorized:
      description: The API token is missing, invalid or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
          example:
            error: Unauthorized.
    TeamNotFound:
      description: You sent a `teamID` for a team you aren't a member of.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            error: Forbidden
            message: Team not found
            data:
              code: team_not_found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your API token as `Authorization: Bearer <api-token>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.