cURL
curl --request POST 'https://api.integrateledger.com/v1/billing/downgrade/7/cancel?customerId=user_123' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.cancelScheduledDowngrade({ downgradeId: 7, customerId: "user_123" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.cancel_scheduled_downgrade(customer_id="user_123", downgrade_id=7){
"downgradeId": 123,
"status": "pending",
"fromPlanId": "<string>",
"planId": "<string>",
"timing": "period_end",
"refund": "none",
"oldPlanCredits": "keep",
"overageOnPlanChange": "carry_to_renewal",
"effectiveAt": "2023-11-07T05:31:56Z",
"refundAmountCents": 123,
"creditNoteId": "<string>"
}{
"error": "<string>",
"downgradeId": 123
}{
"error": "<string>",
"downgradeId": 123
}{
"error": "<string>",
"downgradeId": 123
}{
"error": "<string>",
"downgradeId": 123
}{
"error": "rate_limited"
}{
"error": "internal_error",
"request_id": "<string>"
}{
"error": "<string>",
"downgradeId": 123
}Billing
Undo a scheduled downgrade
Keep the customer on its current plan.
POST
/
v1
/
billing
/
downgrade
/
{downgradeId}
/
cancel
cURL
curl --request POST 'https://api.integrateledger.com/v1/billing/downgrade/7/cancel?customerId=user_123' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.cancelScheduledDowngrade({ downgradeId: 7, customerId: "user_123" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.cancel_scheduled_downgrade(customer_id="user_123", downgrade_id=7){
"downgradeId": 123,
"status": "pending",
"fromPlanId": "<string>",
"planId": "<string>",
"timing": "period_end",
"refund": "none",
"oldPlanCredits": "keep",
"overageOnPlanChange": "carry_to_renewal",
"effectiveAt": "2023-11-07T05:31:56Z",
"refundAmountCents": 123,
"creditNoteId": "<string>"
}{
"error": "<string>",
"downgradeId": 123
}{
"error": "<string>",
"downgradeId": 123
}{
"error": "<string>",
"downgradeId": 123
}{
"error": "<string>",
"downgradeId": 123
}{
"error": "rate_limited"
}{
"error": "internal_error",
"request_id": "<string>"
}{
"error": "<string>",
"downgradeId": 123
}Undoes a scheduled downgrade: Ledger releases its Stripe schedule, so the subscription renews on its current plan, and the downgrade is
closed. Undoing one that’s already closed returns it again. A downgrade that has already applied returns 409 downgrade_applied; upgrade instead.
A schedule released or canceled in Stripe’s Dashboard closes the downgrade the same way.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Required range:
x <= 2147483647Query Parameters
Required string length:
1 - 255Response
The downgrade, now closed; the subscription stays on its current plan
Available options:
pending, scheduled, applied, closed Available options:
period_end, immediately Available options:
none, prorated Available options:
keep, expire Available options:
carry_to_renewal, bill_now