> ## 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

> **v1 is deprecated — use the v2 endpoint instead.** Returns a customer's payment ledger over a required date range — documents, payments, and the running balance.



## OpenAPI

````yaml get /v1/customer/ledger
openapi: 3.0.1
info:
  title: SwipeAPI
  version: '2.0'
  description: >-
    The Swipe Partner API — invoicing, payments, and GST compliance for your
    application. Create GST invoices and other documents, manage customers,
    vendors, products and inventory, record payments, and generate e-invoices
    and e-way bills.


    - Docs & guides: https://developers.getswipe.in

    - Quickstart: https://developers.getswipe.in/quickstart

    - Rate limit: 1 request/second per API key

    - All dates are DD-MM-YYYY
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
paths:
  /v1/customer/ledger:
    get:
      tags:
        - Customer
      summary: Get payment ledger
      description: >-
        **v1 is deprecated — use the v2 endpoint instead.** Returns a customer's
        payment ledger over a required date range — documents, payments, and the
        running balance.
      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:
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        ledger:
          type: array
          items:
            $ref: '#/components/schemas/LedgerRecordV1'
        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
      type: object
    CustomerError:
      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
          description: Validation errors
          example: List of errors
      type: object
    LedgerRecordV1:
      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-13 10:08:13'
        notes:
          type: string
          description: Notes
          example: ''
        status:
          type: string
          description: Payment Status
          example: Success
      type: object
    BankDetails:
      required:
        - account_number
        - bank_name
        - branch
        - ifsc
      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
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is an API key from the [API
        Integration](https://app.getswipe.in/user?tab=api_integration) section
        of your dashboard. Keys are scoped to the company they are generated in
        — for testing, [add a separate test
        company](https://community.getswipe.in/t/how-to-add-new-company-on-web/1191)
        and generate the key there, so requests never touch your real books.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.