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

# Get a subscription

> A single subscription, with its collected total and days active.



## OpenAPI

````yaml GET /developer/v1/subscription/{id}
openapi: 3.1.0
info:
  title: Compago API
  version: 1.0.0
  description: >-
    Public and private API endpoints for Compago's payment infrastructure. This
    specification currently includes endpoints for one-time payments. More
    endpoints will be added as the platform evolves.
servers:
  - url: https://demo-api-harmony.compago.com/api
  - url: https://api-harmony.compago.com/api
security: []
tags:
  - name: OneTimePayment
    description: Endpoints for creating and processing one-time payment links
  - name: PaymentMethod
    description: >-
      Endpoints for saving cards, charging saved payment methods, holding and
      capturing funds, and processing refunds
  - name: PaymentIntent
    description: >-
      Endpoints for creating and managing card-present payment intents for POS
      terminal integrations
  - name: Payments
    description: Read the payments your organization has taken
  - name: Subscriptions
    description: Read and manage recurring billing agreements
  - name: PaymentLinks
    description: Create, edit and retire hosted checkout links
  - name: Products
    description: Manage the catalogue behind product-based payment links
  - name: Promotions
    description: Read the promotions your organization funds or benefits from
  - name: Salespeople
    description: Read the point-of-sale operators in your organization
  - name: Organization
    description: Read your organization profile and its members
  - name: SavedCards
    description: Read saved payment methods and their payments
paths:
  /developer/v1/subscription/{id}:
    get:
      tags:
        - Subscriptions
      summary: Get a subscription
      description: A single subscription, with its collected total and days active.
      operationId: getPublicSubscription
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicSubscription'
        '400':
          description: Invalid request. A query parameter failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '401':
          description: Unauthorized. The `x-api-key` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '403':
          description: >-
            Forbidden. The key is not bound to an organization, or the
            organization is not a merchant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '404':
          description: Not found, or the resource belongs to another organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '429':
          description: >-
            Rate limit exceeded. See the `Retry-After` and `X-RateLimit-*`
            headers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PublicSubscription:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - ACTIVE
            - FAILING
            - PAUSED
            - CANCELLED
            - COMPLETED
        amount:
          type: number
        currency:
          type: string
        billingPeriod:
          type: string
          enum:
            - WEEKLY
            - BIWEEKLY
            - MONTHLY
            - QUARTERLY
            - SEMIANNUAL
            - YEARLY
        chargedPeriods:
          type: integer
        maxBillingCycles:
          type:
            - integer
            - 'null'
          description: Null means it runs until cancelled.
        failedAttempts:
          type: integer
          description: Consecutive failures within the current cycle.
        maxFailedAttempts:
          type: integer
        failedBillingCycles:
          type: integer
        maxFailedBillingCycles:
          type: integer
          description: The subscription is cancelled when this is reached.
        nextBillingDate:
          type:
            - string
            - 'null'
          format: date-time
        lastBillingDate:
          type:
            - string
            - 'null'
          format: date-time
        startedAt:
          type: string
          format: date-time
        cancelledAt:
          type:
            - string
            - 'null'
          format: date-time
        endedAt:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        paymentLinkId:
          type:
            - string
            - 'null'
          format: uuid
        paymentLink:
          oneOf:
            - type: object
              properties:
                id:
                  type: string
                  format: uuid
                title:
                  type:
                    - string
                    - 'null'
                description:
                  type:
                    - string
                    - 'null'
            - type: 'null'
        customer:
          oneOf:
            - $ref: '#/components/schemas/PublicCustomer'
            - type: 'null'
        card:
          oneOf:
            - $ref: '#/components/schemas/PublicCard'
            - type: 'null'
        totalCollected:
          type: number
          description: Detail endpoint only. Sum of every pending and confirmed payment.
        daysActive:
          type: integer
          description: Detail endpoint only.
      required:
        - id
        - status
        - amount
        - currency
        - billingPeriod
    PublicError:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description.
        code:
          type: string
          description: Stable machine-readable code. Branch on this, not on `message`.
      required:
        - message
    PublicCustomer:
      type: object
      properties:
        firstName:
          type:
            - string
            - 'null'
        lastName:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        phoneNumber:
          type:
            - string
            - 'null'
    PublicCard:
      type: object
      properties:
        lastFourDigits:
          type:
            - string
            - 'null'
        network:
          type:
            - string
            - 'null'
        fundingSource:
          type:
            - string
            - 'null'
        issuingBank:
          type:
            - string
            - 'null'
      description: >-
        The card, masked. The full number and the stored token are never
        returned.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````