> ## 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 invoices for a subscription

> Retrieves a paginated list of invoices for a specific subscription with optional filtering by status.



## OpenAPI

````yaml /api-reference/orchestrator-openapi.json get /v1/subscriptions/{id}/invoices
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/{id}/invoices:
    get:
      tags:
        - Subscription Invoice
      summary: List invoices for a subscription
      description: >-
        Retrieves a paginated list of invoices for a specific subscription with
        optional filtering by status.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Subscription unique identifier
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          description: Number of invoices to return per page (max 100)
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Page number (starts from 1)
        - name: status
          in: query
          schema:
            type: string
            enum:
              - DRAFT
              - OPEN
              - PAID
              - VOID
              - UNCOLLECTIBLE
          description: Filter by invoice status
      responses:
        '200':
          description: Invoices retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionInvoiceListResponse'
        '400':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '404':
          description: Subscription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
components:
  schemas:
    SubscriptionInvoiceListResponse:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionInvoiceResponse'
          description: List of subscription invoices
        pagination:
          type: object
          properties:
            total:
              type: integer
              description: Total number of invoices matching the filter
              example: 50
            limit:
              type: integer
              description: Number of invoices per page
              example: 20
            page:
              type: integer
              description: Current page number (starts from 1)
              example: 1
            hasMore:
              type: boolean
              description: Whether there are more invoices 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
    NotFoundError:
      type: object
      description: Not found error response
      properties:
        message:
          type: string
          description: Error message
          example: Merchant not found
      example:
        message: Merchant not found
    InternalError:
      type: object
      description: Error response
      properties:
        message:
          type: string
          description: Error message
          example: Error message
      example:
        message: Error message
    SubscriptionInvoiceResponse:
      type: object
      required:
        - id
        - subscriptionId
        - amount
        - currency
        - status
        - periodStart
        - periodEnd
        - dueDate
        - attemptCount
        - maxRetries
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: Unique invoice identifier
          example: 123e4567-e89b-12d3-a456-426614174000
        subscriptionId:
          type: string
          format: uuid
          description: Associated subscription ID
          example: 123e4567-e89b-12d3-a456-426614174001
        paymentOrderId:
          type: string
          format: uuid
          nullable: true
          description: Associated payment order ID
          example: 123e4567-e89b-12d3-a456-426614174002
        amount:
          type: string
          description: Invoice amount in smallest currency unit
          example: '9900'
        currency:
          type: string
          description: Currency code
          example: MXN
        status:
          type: string
          enum:
            - DRAFT
            - OPEN
            - PAID
            - VOID
            - UNCOLLECTIBLE
          description: Invoice status
          example: PAID
        periodStart:
          type: string
          format: date-time
          description: Billing period start
          example: '2025-01-01T00:00:00.000Z'
        periodEnd:
          type: string
          format: date-time
          description: Billing period end
          example: '2025-02-01T00:00:00.000Z'
        dueDate:
          type: string
          format: date-time
          description: Payment due date
          example: '2025-01-01T00:00:00.000Z'
        paidAt:
          type: string
          format: date-time
          nullable: true
          description: When the invoice was paid
          example: '2025-01-01T12:00:00.000Z'
        attemptCount:
          type: integer
          description: Number of payment attempts
          example: 1
        maxRetries:
          type: integer
          description: Maximum number of retry attempts
          example: 3
        nextRetryAt:
          type: string
          format: date-time
          nullable: true
          description: Next retry attempt date
          example: null
        lastFailureReason:
          type: string
          nullable: true
          description: Reason for the last failed payment attempt
          example: null
        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-01T12:00:00.000Z'
        subscription:
          type: object
          description: Associated subscription details
          properties:
            id:
              type: string
              format: uuid
              description: Subscription identifier
            customerId:
              type: string
              format: uuid
              description: Customer identifier
            planId:
              type: string
              format: uuid
              description: Plan identifier
            status:
              type: string
              description: Subscription status
            plan:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
  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)

````