Skip to main content
GET
/
v1
/
customer
/
ledger
Get payment ledger
curl --request GET \
  --url https://app.getswipe.in/api/partner/v1/customer/ledger \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://app.getswipe.in/api/partner/v1/customer/ledger"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://app.getswipe.in/api/partner/v1/customer/ledger', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://app.getswipe.in/api/partner/v1/customer/ledger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://app.getswipe.in/api/partner/v1/customer/ledger"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://app.getswipe.in/api/partner/v1/customer/ledger")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.getswipe.in/api/partner/v1/customer/ledger")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "success": true,
  "ledger": [
    {
      "serial_number": "PAYIN-2",
      "total_amount": 100,
      "amount_pending": 0,
      "balance": -16795.8,
      "date": "13-06-2024",
      "mode": "UPI",
      "bank_details": {
        "account_number": "1234567890",
        "ifsc": "SBIN0000001",
        "bank_name": "State Bank of India",
        "branch": "Mumbai"
      },
      "created_time": "2024-06-13T10:08:13.000Z",
      "notes": "",
      "status": "Success"
    }
  ],
  "closing_balance": 100,
  "is_paid": true,
  "total_records": 10
}
{
"success": false,
"error_code": "INVALID_CUSTOMER_ID",
"message": "Error Message",
"errors": "List of errors"
}
{
"success": false,
"error_code": "INVALID_CUSTOMER_ID",
"message": "Error Message",
"errors": "List of errors"
}
{
"success": false,
"error_code": "INVALID_CUSTOMER_ID",
"message": "Error Message",
"errors": "List of errors"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer , where is your auth token.

Query Parameters

start_date
string
default:01-01-2024
required

Start date for the ledger, [DD-MM-YYYY]

end_date
string
default:31-12-2024
required

End date for the ledger, [DD-MM-YYYY]

customer_id
string
required

Customer ID

num_records
integer
default:10

Number of records to fetch

page
integer
default:1

Page number

Response

Payment details fetched successfully

success
boolean

Success flag

Example:

true

ledger
object[]
closing_balance
number

Closing Balance

Example:

100

is_paid
boolean

Is Fully paid

Example:

true

total_records
integer

Total Records available

Example:

10