cURL
curl --request GET 'https://api.integrateledger.com/v1/customers/subscriptions?customerId=user_123' \
-H "Authorization: Bearer $LEDGER_API_KEY"import os
from ledger_sdk import Ledger
ledger = Ledger(api_key=os.environ["LEDGER_API_KEY"])
ledger.list_customer_subscriptions(customer_id="user_123")import { Ledger } from "@ledger/sdk";
const ledger = new Ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await ledger.listCustomerSubscriptions({ customerId: "user_123" });const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.integrateledger.com/v1/customers/subscriptions', 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.integrateledger.com/v1/customers/subscriptions",
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.integrateledger.com/v1/customers/subscriptions"
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.integrateledger.com/v1/customers/subscriptions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.integrateledger.com/v1/customers/subscriptions")
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{
"items": [
{
"id": 123,
"planId": "<string>",
"planName": "<string>",
"monthlyPriceCents": 123,
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"currentPeriodStart": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"cancellation": {
"cancelAtPeriodEnd": true,
"scheduledEnd": true,
"manageable": true,
"cancelsAt": "2023-11-07T05:31:56Z"
}
}
],
"hasMore": true,
"nextCursor": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Customers and usage
List customer subscriptions
Read a customer’s plan history and renewal state with a scoped API key.
GET
/
v1
/
customers
/
subscriptions
cURL
curl --request GET 'https://api.integrateledger.com/v1/customers/subscriptions?customerId=user_123' \
-H "Authorization: Bearer $LEDGER_API_KEY"import os
from ledger_sdk import Ledger
ledger = Ledger(api_key=os.environ["LEDGER_API_KEY"])
ledger.list_customer_subscriptions(customer_id="user_123")import { Ledger } from "@ledger/sdk";
const ledger = new Ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await ledger.listCustomerSubscriptions({ customerId: "user_123" });const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.integrateledger.com/v1/customers/subscriptions', 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.integrateledger.com/v1/customers/subscriptions",
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.integrateledger.com/v1/customers/subscriptions"
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.integrateledger.com/v1/customers/subscriptions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.integrateledger.com/v1/customers/subscriptions")
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{
"items": [
{
"id": 123,
"planId": "<string>",
"planName": "<string>",
"monthlyPriceCents": 123,
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"currentPeriodStart": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"cancellation": {
"cancelAtPeriodEnd": true,
"scheduledEnd": true,
"manageable": true,
"cancelsAt": "2023-11-07T05:31:56Z"
}
}
],
"hasMore": true,
"nextCursor": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Pass the exact opaque
customerId as a URL-encoded query value. The API key selects the organization and Sandbox or Live environment. Results are ordered newest first and can be paged with limit and the returned nextCursor; hasMore indicates that older rows remain.
Each item identifies the plan, status, creation time, and current billing period. Active paid subscriptions include a cancellation state when Stripe can verify it. If that state is unavailable, do not infer that renewal is enabled from a local active status. Use Stop or resume renewal to change a verified paid subscription. Free and pending Checkout subscriptions cannot be managed through that endpoint.
Use Get a customer for the current credit balance. A customer’s separately purchased credit packs appear under List customer purchases.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Required string length:
1 - 255Required range:
1 <= x <= 100Required range:
x <= 2147483647