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

# Get payment ledger



## OpenAPI

````yaml get /v2/customer/ledger
openapi: 3.0.1
info:
  title: SwipeAPI
  description: Partner API
  version: '2.0'
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
tags:
  - name: Document
    description: Document related operations
  - name: Customer
    description: Customer related operations
  - name: Payment
    description: Payment related operations
  - name: Product
    description: Product related operations
  - name: Utility
    description: Generic operations
  - name: Subscriptions
    description: Subscriptions related operations
  - name: Document V2
    description: Document related operations
  - name: Customer V2
    description: Customer related operations
  - name: Payment V2
    description: Payment related operations
  - name: Product V2
    description: Product related operations
  - name: Subscriptions V2
    description: Subscriptions related operations
  - name: Utility V2
    description: Generic operations
  - name: Vendor V2
    description: Vendor related operations
  - name: EwayBill
    description: EwayBill related operations
  - name: Inventory V2
    description: Inventory related operations
paths:
  /v2/customer/ledger:
    get:
      tags:
        - Customer V2
      summary: Get payment ledger
      operationId: v2_get_customer_ledger
      parameters:
        - name: start_date
          in: query
          description: Start date for the ledger, [DD-MM-YYYY]
          required: true
          schema:
            type: string
            default: 01-01-2024
        - name: end_date
          in: query
          description: End date for the ledger, [DD-MM-YYYY]
          required: true
          schema:
            type: string
            default: 31-12-2024
        - name: customer_id
          in: query
          description: Customer ID
          required: true
          schema:
            type: string
        - name: num_records
          in: query
          description: Number of records to fetch
          schema:
            type: integer
            default: 10
        - name: page
          in: query
          description: Page number
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: Payment details fetched successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LedgerDataResponseV2'
        '400':
          description: Error in fetching payment details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponseV2'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponseV2'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponseV2'
components:
  schemas:
    LedgerDataResponseV2:
      type: object
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        message:
          type: string
          description: Response message
          example: ''
        error_code:
          type: string
          description: Error Code
          example: ''
        errors:
          type: object
          properties: {}
          description: Errors
        data:
          $ref: '#/components/schemas/LedgerData'
    CustomerResponseV2:
      type: object
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        message:
          type: string
          description: Response message
          example: ''
        error_code:
          type: string
          description: Error Code
          example: ''
        errors:
          type: object
          properties: {}
          description: Errors
        data:
          $ref: '#/components/schemas/EmptyData'
    LedgerData:
      type: object
      properties:
        closing_balance:
          type: number
          description: Balance as of this record
          example: -16795.8
        is_paid:
          type: integer
          description: Paid
          example: 1
        total_records:
          type: integer
          description: Number of records
          example: 10
        ledger:
          type: array
          items:
            $ref: '#/components/schemas/Ledger'
    EmptyData:
      type: object
      properties:
        message:
          type: string
          description: Response message
          example: No data found!
    Ledger:
      type: object
      properties:
        amount_pending:
          type: number
          description: Amount pending
          example: 0
        balance:
          type: number
          description: Balance as of this record
          example: -16795.8
        notes:
          type: string
          description: Notes
          example: ''
        created_time:
          type: string
          description: 'Created Time of the Payment [YYYY-MM-DD HH:MM:SS] GMT '
          example: '2024-06-13T10:08:13.000Z'
        mode:
          type: string
          description: Payment Mode
          example: UPI
        date:
          type: string
          description: Payment Date
          example: 13-06-2024
        status:
          type: string
          description: Payment Status
          example: Success
        serial_number:
          type: string
          description: Serial Number
          example: PAYIN-2
        total_amount:
          type: number
          description: Total Amount
          example: 100
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.

````