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

# Fetch Subscription Payments

> Fetch all payments associated with a specific subscription reference ID.



## OpenAPI

````yaml get /api/v2/subscriptions/{subReferenceId}/payments
openapi: 3.0.0
info:
  title: Cashfree Subscription API
  description: >-
    Create and manage subscriptions and collect recurring payments from
    customers easily with Cashfree Subscriptions.
  version: v2
servers:
  - url: https://sandbox.cashfree.com
    description: Sandbox server
  - url: https://api.cashfree.com
    description: Production server
security: []
externalDocs:
  url: https://docs.cashfree.com/reference/postman-collection-1
  description: This url will have the information of all the APIs.
paths:
  /api/v2/subscriptions/{subReferenceId}/payments:
    get:
      tags:
        - Subscription
      summary: Fetch Subscription Payments
      description: Fetch all payments associated with a specific subscription reference ID.
      operationId: fetchSubscriptionPayments
      parameters:
        - name: X-Client-Id
          in: header
          required: true
          schema:
            type: string
            description: Client ID provided by Cashfree.
            example: asdf1234
        - name: X-Client-Secret
          in: header
          required: true
          schema:
            type: string
            description: Client Secret provided by Cashfree.
            example: qwer9876
        - name: subReferenceId
          in: path
          required: true
          schema:
            type: integer
            description: >-
              The reference ID of the subscription whose payments are to be
              fetched.
            example: 175124
        - name: lastId
          in: query
          required: false
          schema:
            type: integer
            description: >-
              The last payment ID from the previous fetch to continue retrieving
              payments.
            example: 3027869
        - name: count
          in: query
          required: false
          schema:
            type: integer
            description: The number of payments to fetch in the current request.
            example: 3
      responses:
        '200':
          description: Successful retrieval of subscription payments.
          content:
            application/json:
              examples:
                Fetch Subscription Payments Success:
                  value:
                    status: OK
                    message: Subscription Payments
                    payments:
                      - paymentId: 98456
                        cfOrderId: 2571132
                        orderId: SUB_test_checkout_123_AUTH_98456
                        referenceId: 885308845
                        subReferenceId: 73949
                        currency: INR
                        amount: 0
                        cycle: 0
                        status: SUCCESS
                        remarks: auth payment
                        addedOn: '2022-06-23 15:23:08'
                        scheduledOn: null
                        retryAttempts: 0
                        failureReason: null
                      - paymentId: 3027901
                        cfOrderId: 647464356
                        orderId: SUB_AUTH_98456
                        referenceId: 584317815
                        subReferenceId: 2568045
                        currency: INR
                        amount: 1
                        cycle: 0
                        status: PENDING
                        remarks: Scheduled payment
                        addedOn: '2021-10-25 12:33:01'
                        scheduledOn: null
                        retryAttempts: 0
                        failureReason: null
                      - paymentId: 3027869
                        cfOrderId: 647456025
                        orderId: SUB_TXN_836464
                        referenceId: 584310425
                        subReferenceId: 2568045
                        currency: INR
                        amount: 1
                        cycle: 0
                        status: FAILED
                        addedOn: '2021-10-25 12:26:47'
                        scheduledOn: null
                        retryAttempts: 0
                        failureReason: Update Enrolment failure with MmsApiException
                    lastId: 3027869
        '400':
          description: >-
            Bad request due to invalid parameters or missing required
            information.
          content:
            application/json:
              examples:
                Invalid Parameters:
                  value:
                    status: ERROR
                    subCode: '400'
                    message: Invalid parameters provided
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the API call.
                    example: ERROR
                  message:
                    type: string
                    description: Error message.
                    example: Server encountered an unexpected condition.

````