cURL
curl --request GET 'https://api.integrateledger.com/v1/plans/starter/versions' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.listPlanVersions({ id: "starter" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.list_plan_versions("starter"){
"planId": "<string>",
"versions": [
{
"version": 123,
"versionLabel": "<string>",
"status": "active",
"subscribers": 1,
"createdAt": "2023-11-07T05:31:56Z",
"terms": {
"name": "<string>",
"monthlyCredits": 123,
"priceCents": 123,
"billingInterval": "month",
"resetInterval": "month",
"overageUnitAmountCents": 123,
"overageBillingUnits": 123,
"overageCapCents": 123,
"items": [
{
"featureId": "<string>",
"included": 123,
"unlimited": true,
"overageUnitAmountCents": 123,
"overageBillingUnits": 123,
"overageTiers": [
{
"upTo": 123,
"unitAmountCents": 123,
"flatAmountCents": 123
}
],
"overageTiersMode": "graduated",
"price": {
"model": "per_unit",
"billingUnits": 123,
"unitAmountCents": 123,
"tiers": [
{
"upTo": 123,
"unitAmountCents": 123
}
],
"tiersMode": "graduated",
"includedQuantity": 123,
"proration": {
"onIncrease": "next_invoice",
"onDecrease": "next_invoice"
}
},
"rollover": {
"maxCredits": 123,
"maxPercent": 123,
"periods": 123
},
"trialIncluded": 123,
"prepaid": {
"billingUnits": 123,
"unitAmountCents": 123,
"maxQuantity": 123
}
}
],
"group": "<string>",
"addOn": true,
"maxQuantity": 123,
"entityGrants": "own",
"stripeSyncStatus": "pending",
"licenses": [
{
"planId": "<string>",
"seatFeatureId": "<string>",
"includedSeats": 1073741823,
"seatPriceCents": 123,
"maxSeats": 1073741823
}
],
"trial": {
"days": 123,
"cardRequired": true,
"onEnd": "bill",
"credits": 123
}
}
}
]
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "insufficient_permissions",
"requiredScope": "customers:read",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "rate_limited",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}Plans
List plan versions
Every version of a plan, with its status, terms and subscribers.
GET
/
v1
/
plans
/
{id}
/
versions
cURL
curl --request GET 'https://api.integrateledger.com/v1/plans/starter/versions' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.listPlanVersions({ id: "starter" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.list_plan_versions("starter"){
"planId": "<string>",
"versions": [
{
"version": 123,
"versionLabel": "<string>",
"status": "active",
"subscribers": 1,
"createdAt": "2023-11-07T05:31:56Z",
"terms": {
"name": "<string>",
"monthlyCredits": 123,
"priceCents": 123,
"billingInterval": "month",
"resetInterval": "month",
"overageUnitAmountCents": 123,
"overageBillingUnits": 123,
"overageCapCents": 123,
"items": [
{
"featureId": "<string>",
"included": 123,
"unlimited": true,
"overageUnitAmountCents": 123,
"overageBillingUnits": 123,
"overageTiers": [
{
"upTo": 123,
"unitAmountCents": 123,
"flatAmountCents": 123
}
],
"overageTiersMode": "graduated",
"price": {
"model": "per_unit",
"billingUnits": 123,
"unitAmountCents": 123,
"tiers": [
{
"upTo": 123,
"unitAmountCents": 123
}
],
"tiersMode": "graduated",
"includedQuantity": 123,
"proration": {
"onIncrease": "next_invoice",
"onDecrease": "next_invoice"
}
},
"rollover": {
"maxCredits": 123,
"maxPercent": 123,
"periods": 123
},
"trialIncluded": 123,
"prepaid": {
"billingUnits": 123,
"unitAmountCents": 123,
"maxQuantity": 123
}
}
],
"group": "<string>",
"addOn": true,
"maxQuantity": 123,
"entityGrants": "own",
"stripeSyncStatus": "pending",
"licenses": [
{
"planId": "<string>",
"seatFeatureId": "<string>",
"includedSeats": 1073741823,
"seatPriceCents": 123,
"maxSeats": 1073741823
}
],
"trial": {
"days": 123,
"cardRequired": true,
"onEnd": "bill",
"credits": 123
}
}
}
]
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "insufficient_permissions",
"requiredScope": "customers:read",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment.",
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "rate_limited",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}Lists a plan’s versions, oldest first.
status is active (what attach starts), draft (made but not sold) or legacy (an older version its subscribers keep). subscribers counts subscriptions on the version that haven’t ended. Plan versions explains each.
An ID no plan ever had returns 404 plan_not_found; an archived plan still lists its versions.
Needs the Catalog permission at Read.