curl --request GET \
--url https://api.paygentic.io/v0/creditPools/{id}/ledger \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/creditPools/{id}/ledger"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/creditPools/{id}/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://api.paygentic.io/v0/creditPools/{id}/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://api.paygentic.io/v0/creditPools/{id}/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://api.paygentic.io/v0/creditPools/{id}/ledger")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/creditPools/{id}/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{
"startingBalance": 123,
"endingBalance": 123,
"entries": [
{
"id": "<string>",
"object": "ledgerEntry",
"entryType": "increment",
"ledgerSequenceNumber": 123,
"at": "2023-11-07T05:31:56Z",
"amount": 123,
"startingBalance": 123,
"endingBalance": 123,
"grant": {
"id": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"conversionRate": "<string>"
}
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Get ledger
Returns a chronologically-ordered ledger of the pool’s balance history within a required time window: increment (a grant funded the pool, including recurrence refills), decrement (usage drawdown), void (a grant was cancelled early), and expiration (a grant’s unused balance lapsed at expiry). Each entry carries the pool’s running balance immediately before and after it, and the response reports the window’s boundary balances at the top level. Pass granularity to receive calendar-aligned buckets instead of itemized entries. There is no full-history view in a single call — page through successive windows to see a pool’s complete history.
curl --request GET \
--url https://api.paygentic.io/v0/creditPools/{id}/ledger \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/creditPools/{id}/ledger"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/creditPools/{id}/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://api.paygentic.io/v0/creditPools/{id}/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://api.paygentic.io/v0/creditPools/{id}/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://api.paygentic.io/v0/creditPools/{id}/ledger")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/creditPools/{id}/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{
"startingBalance": 123,
"endingBalance": 123,
"entries": [
{
"id": "<string>",
"object": "ledgerEntry",
"entryType": "increment",
"ledgerSequenceNumber": 123,
"at": "2023-11-07T05:31:56Z",
"amount": 123,
"startingBalance": 123,
"endingBalance": 123,
"grant": {
"id": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"conversionRate": "<string>"
}
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Query Parameters
Restrict the response to a single entry type: increment (grant funding, including recurrence refills), decrement (usage drawdown), void (early grant termination), or expiration (unused balance lapsing at a grant's expiry). When granularity is also set, this filter scopes which entries feed each bucket's net fields and entryCount, but never the reported balances.
increment, decrement, void, expiration Roll the ledger up into calendar-aligned buckets (UTC) instead of itemized entries. Calendar periods with no activity are omitted from the response. To see the individual entries behind a bucket, request the itemized ledger (omit granularity) with the same entryType filter and from/to narrowed to that bucket's period.
hour, day, month Response
Pool ledger for the requested window. The shape depends on whether granularity was set: unset returns itemized entries, set returns rolled-up buckets.
- Option 1
- Option 2
Was this page helpful?