Commet
  • Pricing
Log InTry out
Cancel subscription POSTChange plan POSTCreate subscription POSTGet active subscription GETList subscriptions GET
DocumentationKnowledge BaseBuild with AIAPI ReferenceWebhooks

Change plan

Upgrade, downgrade, or change billing interval.

Cancel subscription POST

Cancel immediately or at period end.

Create subscription POST

Create a subscription for a customer. Requires planId or planCode plus customerId.

POST
/subscriptions/{id}/change-plan

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"monthly" | "quarterly" | "yearly"

Response Body

application/json

curl -X POST "https://commet.co/api/subscriptions/string/change-plan" \  -H "Content-Type: application/json" \  -d '{}'

application/json

application/json

application/json

Upgrade, downgrade, or change billing interval.

{
  "success": true,
  "data": {
    "requiresCheckout": true,
    "checkoutUrl": "string"
  }
}
{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}
{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}
{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}