Commet
  • Pricing
Log InTry out
Adjust balance POSTCancel subscription POSTChange plan POSTCreate a recovery payment link for a past due subscription POSTCreate subscription POSTGet active subscription GETGet subscription by ID GETList subscriptions GETPreview plan change POSTReactivate a past due or canceled subscription POSTTop up balance POSTRevert scheduled cancellation POSTUpdate payment method POST
System status
DocumentationKnowledge BaseBuild with AIAPI ReferenceWebhooks

Change plan

Upgrade, downgrade, or change billing interval.

POST
/subscriptions/{id}/change-plan

Upgrade, downgrade, or change billing interval.

Authorization

ApiKeyAuth
x-api-key<token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

newPlanId?string
Length1 <= length
newBillingInterval?string

Value in

  • "weekly"
  • "monthly"
  • "quarterly"
  • "yearly"
successUrl?string
Formaturi

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/subscriptions/string/change-plan" \  -H "Content-Type: application/json" \  -d '{}'
{  "success": true,  "data": {    "requiresCheckout": true,    "checkoutUrl": "string",    "id": "string",    "scheduled": true,    "scheduledFor": "2019-08-24T14:15:22Z",    "changeType": "subscription.plan_downgrade",    "customerId": "string",    "newPlanId": "string",    "newPlanName": "string",    "newBillingInterval": "string",    "previousPlan": {      "id": "string",      "name": "string"    },    "currentPlan": {      "id": "string",      "name": "string",      "price": -9007199254740991    },    "billingInterval": "string",    "billing": {      "credit": -9007199254740991,      "creditsApplied": -9007199254740991,      "charge": -9007199254740991,      "taxAmount": -9007199254740991,      "netAmount": -9007199254740991,      "totalCharged": -9007199254740991,      "remainingCreditBalance": -9007199254740991    },    "invoiceId": "string",    "seatLimitWarning": {      "featureCode": "string",      "featureName": "string",      "currentSeats": -9007199254740991,      "included": -9007199254740991,      "newPlanName": "string",      "effectiveDate": "2019-08-24T14:15:22Z"    },    "object": "subscription",    "livemode": true  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}

Cancel subscription POST

Cancel immediately or at period end.

Create a recovery payment link for a past due subscription POST

Generates a hosted, signed recovery link that lets the customer pay the outstanding renewal charge for a past_due subscription. Unlike reactivate, which charges server-to-server, this returns a link the merchant can deliver through their own email, SMS, or dashboard. The link carries a self-contained signed token and stays valid until the charge is paid or the subscription is no longer past due.