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

# List subscriptions

> Retrieves a paginated list of subscriptions with optional filtering by customer, plan, and status.



## OpenAPI

````yaml /api-reference/orchestrator-openapi.json get /v1/subscriptions
openapi: 3.0.0
info:
  title: Payment Orchestrator API
  description: API documentation for the Payment Orchestrator service
  version: 1.0.0
servers:
  - url: https://api.sandbox.cheqpay.mx/pos
    description: Sandbox environment
  - url: https://prod.cheqpay.mx/pos
    description: Production environment
security:
  - ApiKeyAuth: []
    MerchantIdAuth: []
tags:
  - name: Customer
    description: Customer management endpoints (v1)
  - name: Customer V2
    description: >-
      Customer management endpoints (v2) - merchant-scoped, no external ID
      required
  - name: Payment Order
    description: Payment order management endpoints
  - name: Checkout
    description: Payment checkout endpoints
  - name: Payment Method
    description: Payment method management endpoints
  - name: Subscription Plan
    description: Subscription plan management endpoints for recurring payments
  - name: Subscription
    description: Subscription management endpoints for recurring billing
  - name: Subscription Invoice
    description: Subscription invoice management endpoints
paths:
  /v1/subscriptions:
    get:
      tags:
        - Subscription
      summary: List subscriptions
      description: >-
        Retrieves a paginated list of subscriptions with optional filtering by
        customer, plan, and status.
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          description: Number of subscriptions to return per page (max 100)
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Page number (starts from 1)
        - name: customerId
          in: query
          schema:
            type: string
            format: uuid
          description: Filter by customer ID
        - name: planId
          in: query
          schema:
            type: string
            format: uuid
          description: Filter by plan ID
        - name: status
          in: query
          schema:
            type: string
            enum:
              - TRIALING
              - ACTIVE
              - PAST_DUE
              - CANCELED
              - UNPAID
          description: Filter by subscription status
      responses:
        '200':
          description: Subscriptions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionListResponse'
        '400':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
components:
  schemas:
    SubscriptionListResponse:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionResponse'
          description: List of subscriptions
        pagination:
          type: object
          properties:
            total:
              type: integer
              description: Total number of subscriptions matching the filter
              example: 100
            limit:
              type: integer
              description: Number of subscriptions per page
              example: 20
            page:
              type: integer
              description: Current page number (starts from 1)
              example: 1
            hasMore:
              type: boolean
              description: Whether there are more subscriptions available
              example: true
    ValidationError:
      type: object
      description: Validation error response
      required:
        - message
        - errors
      properties:
        message:
          type: string
          description: Error message
          example: Validation failed
        errors:
          type: array
          description: List of validation errors
          items:
            type: object
            properties:
              field:
                type: string
                description: Field that failed validation
                example: name
              message:
                type: string
                description: Validation error message
                example: Required
      example:
        message: Validation failed
        errors:
          - field: name
            message: Required
    UnauthorizedError:
      type: object
      description: Unauthorized error response
      properties:
        message:
          type: string
          description: Error message
          example: Invalid api key
      example:
        message: Invalid api key
    InternalError:
      type: object
      description: Error response
      properties:
        message:
          type: string
          description: Error message
          example: Error message
      example:
        message: Error message
    SubscriptionResponse:
      type: object
      required:
        - id
        - merchantId
        - customerId
        - planId
        - paymentMethodId
        - status
        - currentPeriodStart
        - currentPeriodEnd
        - cancelAtPeriodEnd
        - nextBillingDate
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: Unique subscription identifier
          example: 123e4567-e89b-12d3-a456-426614174000
        merchantId:
          type: string
          description: Merchant identifier
          example: merchant_123
        customerId:
          type: string
          format: uuid
          description: Customer identifier
          example: 123e4567-e89b-12d3-a456-426614174001
        planId:
          type: string
          format: uuid
          description: Plan identifier
          example: 123e4567-e89b-12d3-a456-426614174002
        paymentMethodId:
          type: string
          format: uuid
          description: Payment method identifier
          example: 123e4567-e89b-12d3-a456-426614174003
        status:
          type: string
          enum:
            - TRIALING
            - ACTIVE
            - PAST_DUE
            - CANCELED
            - UNPAID
          description: Subscription status
          example: ACTIVE
        currentPeriodStart:
          type: string
          format: date-time
          description: Start of the current billing period
          example: '2025-01-01T00:00:00.000Z'
        currentPeriodEnd:
          type: string
          format: date-time
          description: End of the current billing period
          example: '2025-02-01T00:00:00.000Z'
        trialStart:
          type: string
          format: date-time
          nullable: true
          description: Trial period start date
          example: '2025-01-01T00:00:00.000Z'
        trialEnd:
          type: string
          format: date-time
          nullable: true
          description: Trial period end date
          example: '2025-01-15T00:00:00.000Z'
        cancelAtPeriodEnd:
          type: boolean
          description: Whether the subscription will cancel at period end
          example: false
        canceledAt:
          type: string
          format: date-time
          nullable: true
          description: When the subscription was canceled
          example: null
        endedAt:
          type: string
          format: date-time
          nullable: true
          description: When the subscription ended
          example: null
        nextBillingDate:
          type: string
          format: date-time
          description: >-
            Date of the next billing charge (trial end date while trialing,
            otherwise the current period end date)
          example: '2025-02-01T00:00:00.000Z'
        metadata:
          type: object
          additionalProperties: true
          nullable: true
          description: Additional metadata
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
          example: '2025-01-01T00:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
          example: '2025-01-15T10:00:00.000Z'
        plan:
          type: object
          description: Associated plan details
          properties:
            id:
              type: string
              format: uuid
              description: Plan identifier
            name:
              type: string
              description: Plan name
            amount:
              type: string
              description: Plan amount
            currency:
              type: string
              description: Plan currency
            interval:
              type: string
              enum:
                - DAY
                - WEEK
                - MONTH
                - YEAR
              description: Billing interval
            intervalCount:
              type: integer
              description: Number of intervals
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication (required)
    MerchantIdAuth:
      type: apiKey
      in: header
      name: x-merchant-id
      description: Merchant ID for identifying the merchant (required)

````