List all customers
GET
https://api.ledgerline.dev /v2/customers Returns a list of your customers, sorted by creation date.
Parameters
limitintegerqueryA limit on the number of objects to be returned, between 1 and 100.
starting_afterstringqueryA cursor for pagination: an object ID that defines your place in the list.
Code samples
cURL
curl -X GET "https://api.ledgerline.dev/v2/customers?limit=&starting_after="TypeScript
const res = await fetch('https://api.ledgerline.dev/v2/customers?limit=&starting_after=', {
method: 'GET',
});
const data = await res.json();Python
import requests
res = requests.request(
"GET",
"https://api.ledgerline.dev/v2/customers?limit=&starting_after=",
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.ledgerline.dev/v2/customers?limit=&starting_after=", nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.ledgerline.dev/v2/customers?limit=&starting_after=');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.ledgerline.dev/v2/customers?limit=&starting_after=')
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ledgerline.dev/v2/customers?limit=&starting_after="))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
200 Returns the object if the request succeeded.
{
"object": "list",
"has_more": false,
"data": [
{
"id": "cus_Qm8xT2vLp0aZ",
"object": "customer",
"email": "jenny.rosen@example.com",
"name": "Jenny Rosen",
"balance": 0,
"created": 1791787234,
"metadata": {}
}
]
}402 The request was valid but failed (for example, the card was declined).
Updated
Was this page helpful?