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

# Get Subscription

> Get detailed information about a specific subscription



## OpenAPI

````yaml GET /subscription/{id}
openapi: 3.1.0
info:
  title: Clink API
  description: >-
    Official API documentation for Clink's payment processing platform. This API
    enables merchants to create and manage payment sessions, handle
    subscriptions, and process transactions.
  version: 1.0.0
servers:
  - url: https://uat-api.clinkbill.com/api/
security:
  - ApiKeyAuth: []
paths:
  /subscription/{id}:
    get:
      description: Get detailed information about a specific subscription
      operationId: retrieveSubscription
      parameters:
        - $ref: '#/components/parameters/TimestampHeader'
        - name: id
          in: path
          description: Unique identifier of the subscription
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Subscription details retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubsGetRes'
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionApiResponse'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                type: string
components:
  parameters:
    TimestampHeader:
      name: X-Timestamp
      in: header
      required: true
      description: >-
        Current timestamp in milliseconds since Unix epoch (required for request
        signing)
      schema:
        type: string
        example: '1783513683000'
  schemas:
    SubsGetRes:
      type: object
      properties:
        code:
          type: integer
          description: Response status code, 200 when success
          format: int32
          example: 200
        msg:
          type: string
          example: success
          description: Brief description of what happened, 'success' when happy case
        data:
          $ref: '#/components/schemas/SubApiVo'
    SubscriptionApiResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
        msg:
          type: string
        data:
          $ref: '#/components/schemas/SubscriptionApiData'
    SubApiVo:
      type: object
      description: Subscription data object containing all subscription details
      required:
        - billing
        - createTime
        - customerId
        - paymentInstrumentId
        - paymentMethodType
        - priceId
        - priceSnapshotId
        - productId
        - quantity
        - status
        - subscriptionId
      properties:
        merchantReference:
          type: string
          description: >-
            Your internal reference ID for tracking (non-unique identifier, does
            not guarantee idempotency)
        subscriptionId:
          type: string
          description: Unique identifier for the subscription
        customerId:
          type: string
          description: Unique identifier for the customer
        productId:
          type: string
          description: Unique identifier for the subscribed product
        priceId:
          type: string
          description: Unique identifier for the price configuration
        priceSnapshotId:
          type: string
          description: Identifier for the immutable price snapshot at subscription creation
        createTime:
          type: integer
          example: 1754819711382
          description: Unix timestamp when the subscription was created
          format: int64
        quantity:
          type: integer
          example: 1
          description: Number of units purchased in this subscription
          format: int32
        paymentMethodType:
          type: string
          example: CARD
          description: Payment method used (e.g., 'CARD')
        paymentInstrumentId:
          type: string
          description: Identifier for the specific payment instrument
        trialStart:
          type: integer
          example: 1754819707000
          description: Unix timestamp when the trial period begins
          format: int64
        trialEnd:
          type: integer
          example: 1755078907000
          description: Unix timestamp when the trial period ends
          format: int64
        currentPeriodStart:
          type: integer
          example: 1754819706689
          description: Unix timestamp for the start of the current billing period
          format: int64
        currentPeriodEnd:
          type: integer
          example: 1755078906689
          description: Unix timestamp for the end of the current billing period
          format: int64
        cancelAt:
          type: integer
          description: Unix timestamp when the subscription will automatically cancel
          format: int64
        cancelAtPeriodEnd:
          type: boolean
          description: >-
            Whether the subscription will cancel at the end of the current
            billing period
        canceledAt:
          type: integer
          description: Unix timestamp when cancellation was requested
          format: int64
        cancelReason:
          type: string
          description: Reason provided for subscription cancellation
        status:
          type: string
          enum:
            - incomplete
            - free_trial
            - active
            - incomplete_expired
            - past_due
            - cancelled
          description: >-
            Current subscription status: 'incomplete' (waiting for a payment),
            'free_trial' (trialing), 'active', 'incomplete_expired' (timed out
            without a payment), 'past_due' (no payment received on renewal),
            'cancelled'
        billing:
          type: string
          enum:
            - charge_automatically
            - send_invoice
          description: 'Billing method: ''charge_automatically'' or ''send_invoice'''
        currency:
          type: string
          description: ISO currency code for subscription pricing
          enum:
            - USD
            - EUR
            - JPY
            - GBP
            - AUD
            - CAD
            - CNY
            - HKD
            - SGD
            - KRW
            - AED
            - THB
            - IDR
            - PHP
            - MYR
            - BRL
            - INR
        recurringInvoiceItem:
          $ref: '#/components/schemas/InvoiceItem'
          description: >-
            Current recurring price and billing cycle information for the active
            subscription.
        upcomingInvoiceItem:
          $ref: '#/components/schemas/InvoiceItem'
          description: >-
            Preview of the next billing cycle's invoice item. Only available
            when a subscription is pending activation or scheduled for a plan
            change in the next billing cycle.
        scheduledPhases:
          type: array
          description: >-
            Remaining scheduled subscription plan changes that have not taken
            effect yet.
          items:
            $ref: '#/components/schemas/ScheduledPhase'
        elapsedCycles:
          type: integer
          description: >-
            Number of billing period boundaries already crossed. Compare this
            with scheduledPhases.effectiveCycle to determine when a remaining
            phase takes effect.
          format: int32
        sessionId:
          type: string
          description: Unique identifier for the checkout session
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Set of key-value pairs that you can attach to an object
    SubscriptionApiData:
      required:
        - billing
        - createTime
        - customerId
        - paymentInstrumentId
        - paymentMethodType
        - priceId
        - priceSnapshotId
        - productId
        - quantity
        - recurringInvoiceItem
        - status
        - subscriptionId
      type: object
      properties:
        merchantReference:
          type: string
        subscriptionId:
          type: string
        sessionId:
          type: string
        customerId:
          type: string
        productId:
          type: string
        priceId:
          type: string
        priceSnapshotId:
          type: string
        createTime:
          type: integer
          format: int64
        quantity:
          type: integer
          format: int32
        paymentMethodType:
          type: string
        paymentInstrumentId:
          type: string
        trialStart:
          type: integer
          format: int64
        trialEnd:
          type: integer
          format: int64
        currentPeriodStart:
          type: integer
          format: int64
        currentPeriodEnd:
          type: integer
          format: int64
        cancelAt:
          type: integer
          format: int64
        cancelAtPeriodEnd:
          type: boolean
        canceledAt:
          type: integer
          format: int64
        cancelReason:
          type: string
        status:
          type: string
        billing:
          type: string
        currency:
          type: string
          enum:
            - USD
            - EUR
            - JPY
            - GBP
            - AUD
            - CAD
            - CNY
            - HKD
            - SGD
            - KRW
            - AED
            - THB
            - IDR
            - PHP
            - MYR
            - BRL
            - INR
        recurringInvoiceItem:
          $ref: '#/components/schemas/InvoiceItemVo'
        upcomingInvoiceItem:
          $ref: '#/components/schemas/InvoiceItemVo'
        scheduledPhases:
          type: array
          description: >-
            Remaining scheduled subscription plan changes that have not taken
            effect yet.
          items:
            $ref: '#/components/schemas/ScheduledPhase'
        elapsedCycles:
          type: integer
          description: >-
            Number of billing period boundaries already crossed. Compare this
            with scheduledPhases.effectiveCycle to determine when a remaining
            phase takes effect.
          format: int32
        metadata:
          type: object
          additionalProperties:
            type: string
    InvoiceItem:
      type: object
      description: Individual line item within an invoice
      properties:
        invoiceItemId:
          type: string
          description: Unique identifier for the invoice line item
        amount:
          type: number
          example: 9.99
          description: Total amount for this line item
        currency:
          type: string
          description: ISO currency code for this line item
          enum:
            - USD
            - EUR
            - JPY
            - GBP
            - AUD
            - CAD
            - CNY
            - HKD
            - SGD
            - KRW
            - AED
            - THB
            - IDR
            - PHP
            - MYR
            - BRL
            - INR
        description:
          type: string
          description: Human-readable description of the line item
        periodStart:
          type: integer
          example: 1754819706689
          description: Unix timestamp for the start of the period covered by this item
          format: int64
        periodEnd:
          type: integer
          example: 1755078906689
          description: Unix timestamp for the end of the period covered by this item
          format: int64
        proration:
          type: boolean
          description: Whether this item represents a prorated amount
        price:
          $ref: '#/components/schemas/InvoiceItemPrice'
    ScheduledPhase:
      required:
        - sequence
        - effectiveCycle
        - priceSnapshotId
        - quantity
      type: object
      description: >-
        A scheduled subscription plan change that takes effect at a future
        billing period boundary.
      properties:
        sequence:
          minimum: 1
          type: integer
          description: >-
            Position of this phase in the schedule. Values must be strictly
            increasing.
          format: int32
        effectiveCycle:
          minimum: 1
          type: integer
          description: >-
            The renewal boundary when this phase takes effect, counted from
            subscription creation. Values must be strictly increasing.
          format: int32
        priceSnapshotId:
          type: string
          description: >-
            Target subscription price snapshot ID. The snapshot must exist, have
            priceType=SUBSCRIBE with valid recurring details, and support the
            subscription payment currency.
        quantity:
          minimum: 1
          type: integer
          description: Target quantity for the scheduled phase.
          format: int32
        metadata:
          type: object
          description: >-
            Optional metadata for this scheduled phase. Maximum 20 keys. Key
            length must be 40 characters or fewer and string value length must
            be 500 characters or fewer.
          maxProperties: 20
          propertyNames:
            maxLength: 40
          additionalProperties:
            type: string
            maxLength: 500
    InvoiceItemVo:
      type: object
      properties:
        invoiceItemId:
          type: string
        amount:
          type: number
        discountAmount:
          type: number
        paymentAmount:
          type: number
        couponTerms:
          type: string
        promotionCode:
          type: string
        currency:
          type: string
          enum:
            - USD
            - EUR
            - JPY
            - GBP
            - AUD
            - CAD
            - CNY
            - HKD
            - SGD
            - KRW
            - AED
            - THB
            - IDR
            - PHP
            - MYR
            - BRL
            - INR
        periodStart:
          type: integer
          format: int64
        periodEnd:
          type: integer
          format: int64
        proration:
          type: boolean
        price:
          $ref: '#/components/schemas/PriceVo'
    InvoiceItemPrice:
      type: object
      description: Price information for an invoice line item
      properties:
        productId:
          type: string
          description: Unique identifier for the product
        productName:
          type: string
          description: Display name of the product
        priceId:
          type: string
          description: Unique identifier for the price configuration
        priceSnapshotId:
          type: string
          description: Identifier for the immutable price snapshot at time of invoicing
        unitAmount:
          type: number
          example: 9.99
          description: Per-unit price amount
        quantity:
          type: integer
          example: 1
          description: Number of units included in this line item
          format: int32
        recurring:
          $ref: '#/components/schemas/Recurring'
    PriceVo:
      type: object
      properties:
        productId:
          type: string
        productName:
          type: string
        priceId:
          type: string
        priceSnapshotId:
          type: string
        unitAmount:
          type: number
        quantity:
          type: integer
          format: int32
        recurring:
          $ref: '#/components/schemas/Recurring'
    Recurring:
      required:
        - interval
        - pricingModel
        - tiersMode
      type: object
      properties:
        interval:
          type: string
          enum:
            - week
            - month
            - year
            - day
            - quarter
            - half_year
            - custom
          description: >-
            Frequency of recurring charges. `quarter` bills every 3 months,
            `half_year` bills every 6 months, and `custom` uses interval count
            to define the cycle.
        trialPeriodDays:
          type: integer
          description: Number of days in the trial period
          format: int32
        pricingModel:
          type: string
          enum:
            - flat_rate
            - per_seat
          description: >-
            Billing model (flat_rate, per_seat, with tiered and usage_based
            models coming soon)
        tiersMode:
          type: string
          enum:
            - volume
            - graduated
          description: >-
            Coming soon. Tiered pricing mode, can be volume (quantity-based) or
            graduated (incremental tiers)
        intervalCount:
          type: integer
          description: >-
            Number of interval units per billing cycle. For custom intervals,
            this value represents the number of days.
          format: int32
      description: Recurring billing configuration information
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Your secret API key obtained from the Clink dashboard (Developers
        section)

````