cURL
curl --request POST 'https://api.integrateledger.com/v1/plans/starter/versions/{version}/promote' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.promotePlanVersion({ id: "starter", version: "2" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.promote_plan_version("starter", 2){
"planId": "<string>",
"changed": true,
"active": {
"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
}
}
},
"stripeSync": "synced"
}{
"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
Promote a plan version
Make a draft or an older version the plan’s active version.
POST
/
v1
/
plans
/
{id}
/
versions
/
{version}
/
promote
cURL
curl --request POST 'https://api.integrateledger.com/v1/plans/starter/versions/{version}/promote' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.promotePlanVersion({ id: "starter", version: "2" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.promote_plan_version("starter", 2){
"planId": "<string>",
"changed": true,
"active": {
"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
}
}
},
"stripeSync": "synced"
}{
"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."
}Makes the version named by number (
2) or label (2027-q1) the one attach starts. The version that was active becomes legacy; every subscriber keeps the version they have. Promoting an older version back is a rollback, and promoting the active version changes nothing ("changed": false). No version is made.
Needs the Catalog permission at Write.