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

# Get subscription by ID

> Get a subscription by its public ID, regardless of status (including pending_payment and past_due).

> [!NOTE]
>
> This reference describes API version `2026-06-23`. Send `Commet-Version: 2026-06-23` with your request.


## OpenAPI

````yaml /openapi/en/rest/2026-06-23.json get /subscriptions/{id}
openapi: 3.1.0
info:
  title: Commet API
  version: '2026-06-23'
  description: Billing and payments API for SaaS and AI products.
servers:
  - url: https://commet.co/api/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Test Clock
    description: >-
      Simulate the passage of time in sandbox to test billing flows. Mirrors
      Stripe test clocks: forward-only and sandbox-only.
  - name: Customers
  - name: Subscriptions
  - name: Plans
  - name: Promo Codes
  - name: Features
  - name: Usage
  - name: Seats
  - name: Quota
  - name: Add-ons
  - name: Portal
  - name: Credit Packs
  - name: Plan Groups
  - name: Invoices
  - name: Payments
    description: >-
      One-time payments with no subscription or plan. Charge a customer's saved
      payment method off-session, or create a payment link the customer opens to
      pay. Tax, invoice, and receipt are handled automatically.
  - name: Transactions
  - name: Webhooks
  - name: API Keys
  - name: Payouts
    description: >-
      Withdraw available balance to your bank and manage the payout account
      (verification + destination bank accounts).
  - name: Provisioning
    description: >-
      Take ownership of an organization an agent provisioned headlessly. The
      agent holds the API keys from the start; a human claims the account
      through a claim link.
paths:
  /subscriptions/{id}:
    get:
      tags:
        - Subscriptions
      summary: Get subscription by ID
      description: >-
        Get a subscription by its public ID, regardless of status (including
        pending_payment and past_due).
      operationId: get-subscription
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: Commet-Version
          in: header
          required: false
          description: >-
            API version used by this reference. Send this header to select this
            contract explicitly.
          schema:
            type: string
            default: '2026-06-23'
          example: '2026-06-23'
      responses:
        '200':
          description: Success
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            RateLimit-Limit:
              description: Maximum number of requests allowed in the current window.
              schema:
                type: string
            RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    const: true
                  data:
                    $ref: '#/components/schemas/Subscription'
                required:
                  - success
                  - data
        '400':
          description: Bad request
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            RateLimit-Limit:
              description: Maximum number of requests allowed in the current window.
              schema:
                type: string
            RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: string
            RateLimit-Reset:
              description: Seconds until the rate limit window resets.
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying the request.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  headers:
    RequestId:
      description: >-
        Server-generated identifier that correlates this response with Platform
        logs.
      schema:
        type: string
        format: uuid
  schemas:
    Subscription:
      type: object
      properties:
        id:
          type: string
        customerId:
          type: string
        plan:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            basePrice:
              type: number
          required:
            - id
            - name
            - basePrice
          additionalProperties: false
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - draft
            - pending_payment
            - trialing
            - active
            - past_due
            - canceled
        billingInterval:
          anyOf:
            - type: string
              enum:
                - weekly
                - monthly
                - quarterly
                - semiannual
                - yearly
                - one_time
            - type: 'null'
        trialEndsAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        currentPeriod:
          anyOf:
            - type: object
              properties:
                start:
                  type: string
                  format: date-time
                end:
                  type: string
                  format: date-time
                daysRemaining:
                  type: number
              required:
                - start
                - end
                - daysRemaining
              additionalProperties: false
            - type: 'null'
        cancellation:
          anyOf:
            - type: object
              properties:
                scheduledAt:
                  type: string
                  format: date-time
                reason:
                  type:
                    - string
                    - 'null'
                effectiveAt:
                  type: string
                  format: date-time
              required:
                - scheduledAt
                - reason
                - effectiveAt
              additionalProperties: false
            - type: 'null'
        cancelAtPeriodEnd:
          type: boolean
        scheduledPlanChange:
          anyOf:
            - type: object
              properties:
                changeType:
                  type: string
                  enum:
                    - plan_downgrade
                    - interval_change
                newPlanId:
                  type:
                    - string
                    - 'null'
                newPlanName:
                  type:
                    - string
                    - 'null'
                newBillingInterval:
                  type:
                    - string
                    - 'null'
                scheduledFor:
                  type: string
                  format: date-time
              required:
                - changeType
                - newPlanId
                - newPlanName
                - newBillingInterval
                - scheduledFor
              additionalProperties: false
            - type: 'null'
        startDate:
          type: string
          format: date-time
        endDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        billingDayOfMonth:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        nextBillingDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        checkoutUrl:
          type:
            - string
            - 'null'
        hasPaymentMethod:
          type: boolean
          description: >-
            Whether Commet can charge this subscription on its own at its next
            charge (the trial end or the renewal). A trial that started without
            a payment method reports false until the customer adds one for this
            subscription; a payment method saved for another subscription does
            not count. A subscription on a free plan reports false.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        planVersion:
          anyOf:
            - type: object
              properties:
                id:
                  type: string
                  description: Public plan version ID.
                label:
                  type: string
                  description: >-
                    Main versions are 1, 2, 3; an experiment's versions carry
                    its own code, like price-test 2.
              required:
                - id
                - label
              additionalProperties: false
            - type: 'null'
          description: >-
            The plan version whose terms the subscription has now. It keeps
            paying and receiving everything from this version until it is moved.
        scheduledVersionChange:
          anyOf:
            - type: object
              properties:
                planVersionId:
                  type: string
                label:
                  type: string
                effectiveAt:
                  type: string
                  format: date-time
              required:
                - planVersionId
                - label
                - effectiveAt
              additionalProperties: false
            - type: 'null'
          description: A move to another version of the plan pending for the next renewal.
        consumptionModel:
          anyOf:
            - type: string
              enum:
                - metered
                - credits
                - balance
            - type: 'null'
        features:
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  code:
                    type: string
                  name:
                    type: string
                  type:
                    type: string
                    const: boolean
                  enabled:
                    type: boolean
                required:
                  - code
                  - name
                  - type
                  - enabled
                additionalProperties: false
              - type: object
                properties:
                  code:
                    type: string
                  name:
                    type: string
                  type:
                    type: string
                    const: usage
                  usage:
                    type: object
                    properties:
                      current:
                        type: number
                      included:
                        type: number
                      overageQuantity:
                        type: number
                      overageUnitPrice:
                        type: number
                    required:
                      - current
                      - included
                      - overageQuantity
                    additionalProperties: false
                required:
                  - code
                  - name
                  - type
                additionalProperties: false
              - type: object
                properties:
                  code:
                    type: string
                  name:
                    type: string
                  type:
                    type: string
                    const: seats
                  usage:
                    type: object
                    properties:
                      current:
                        type: number
                      included:
                        type: number
                      overageQuantity:
                        type: number
                      overageUnitPrice:
                        type: number
                    required:
                      - current
                      - included
                      - overageQuantity
                    additionalProperties: false
                required:
                  - code
                  - name
                  - type
                  - usage
                additionalProperties: false
              - type: object
                properties:
                  code:
                    type: string
                  name:
                    type: string
                  type:
                    type: string
                    const: quota
                required:
                  - code
                  - name
                  - type
                additionalProperties: false
        credits:
          anyOf:
            - type: object
              properties:
                remaining:
                  type: number
                  description: Plan credits left. Kept for compatibility; equal to `plan`.
                included:
                  type: number
                purchased:
                  type: number
                  description: >-
                    Purchased credits: purchases and manual adjustments. Spent
                    after plan credits and kept until the subscription ends.
                plan:
                  type: number
                  description: >-
                    Plan credits left this period. Spent first and replaced or
                    rolled over at each reset; negative while overage is owed.
                total:
                  type: number
                  description: 'Credits available: `plan` plus `purchased`.'
              required:
                - remaining
                - included
                - purchased
                - plan
                - total
              additionalProperties: false
            - type: 'null'
        balance:
          anyOf:
            - type: object
              properties:
                remaining:
                  type: number
                  description: >-
                    Balance available in minor units of the subscription
                    currency. Kept for compatibility; equal to `total`.
                included:
                  type: number
                currency:
                  type: string
                plan:
                  type: number
                  description: >-
                    Plan balance left this period, in minor units. Spent first
                    and replaced or rolled over at each reset; negative while
                    overage is owed.
                purchased:
                  type: number
                  description: >-
                    Purchased balance in minor units: top-ups and manual
                    adjustments. Spent after the plan balance and kept until the
                    subscription ends.
                total:
                  type: number
                  description: 'Balance available in minor units: `plan` plus `purchased`.'
              required:
                - remaining
                - included
                - currency
                - plan
                - purchased
                - total
              additionalProperties: false
            - type: 'null'
        object:
          type: string
          const: subscription
        livemode:
          type: boolean
        discount:
          anyOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - percentage
                    - amount
                value:
                  type: number
                name:
                  anyOf:
                    - type: string
                    - type: 'null'
                endsAt:
                  anyOf:
                    - type: string
                      format: date-time
                    - type: 'null'
              required:
                - type
                - value
                - name
                - endsAt
              additionalProperties: false
            - type: 'null'
      required:
        - id
        - customerId
        - plan
        - name
        - description
        - status
        - billingInterval
        - trialEndsAt
        - currentPeriod
        - cancellation
        - cancelAtPeriodEnd
        - scheduledPlanChange
        - startDate
        - endDate
        - billingDayOfMonth
        - nextBillingDate
        - checkoutUrl
        - hasPaymentMethod
        - createdAt
        - updatedAt
        - planVersion
        - discount
        - scheduledVersionChange
        - consumptionModel
        - features
        - credits
        - balance
        - object
        - livemode
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          properties:
            type:
              type: string
            code:
              type: string
            message:
              type: string
            param:
              type: string
            details: {}
            doc_url:
              type: string
          required:
            - type
            - code
            - message
            - doc_url
          additionalProperties: false
      required:
        - success
        - error
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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