> ## 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 /v1/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:
  /v1/customer/ledger:
    get:
      tags:
        - Customer
      summary: Get payment ledger
      operationId: 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/Payment_GET_Response'
        '400':
          description: Error in fetching payment details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerError'
components:
  schemas:
    Payment_GET_Response:
      type: object
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        ledger:
          type: array
          items:
            $ref: '#/components/schemas/LedgerRecord'
        closing_balance:
          type: number
          description: Closing Balance
          example: 100
        is_paid:
          type: boolean
          description: Is Fully paid
          example: true
        total_records:
          type: integer
          description: Total Records available
          example: 10
    CustomerError:
      type: object
      properties:
        success:
          type: boolean
          description: Success flag
          example: false
        error_code:
          type: string
          description: Error Code
          example: INVALID_CUSTOMER_ID
        message:
          type: string
          description: Response message
          example: Error Message
        errors:
          type: object
          properties: {}
          description: Validation errors
          example: List of errors
    LedgerRecord:
      type: object
      properties:
        serial_number:
          type: string
          description: Serial Number
          example: PAYIN-2
        total_amount:
          type: number
          description: Total Amount
          example: 100
        amount_pending:
          type: number
          description: Amount pending
          example: 0
        balance:
          type: number
          description: Balance as of this record
          example: -16795.8
        date:
          type: string
          description: Payment Date
          example: 13-06-2024
        mode:
          type: string
          description: Payment Mode
          example: UPI
        bank_details:
          $ref: '#/components/schemas/BankDetails'
        created_time:
          type: string
          description: 'Created Time of the Payment [YYYY-MM-DD HH:MM:SS] GMT '
          example: '2024-06-13T10:08:13.000Z'
        notes:
          type: string
          description: Notes
          example: ''
        status:
          type: string
          description: Payment Status
          example: Success
    BankDetails:
      required:
        - account_number
        - bank_name
        - branch
        - ifsc
      type: object
      properties:
        account_number:
          type: string
          description: Account Number
          example: '1234567890'
        ifsc:
          type: string
          description: IFSC Code
          example: SBIN0000001
        bank_name:
          type: string
          description: Bank Name
          example: State Bank of India
        branch:
          type: string
          description: Branch
          example: Mumbai
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.

````