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 either planId/planCode and customerId/externalId.

Authorization

ApiKeyAuth
x-api-key<token>

In: header

Path Parameters

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

POST
/subscriptions/{id}/change-plan

application/json

id*string
newPlanId?string
Length1 <= length
newBillingInterval?string
Value in"monthly" | "quarterly" | "yearly"
curl -X POST "https://commet.co/api/subscriptions/string/change-plan" \  -H "Content-Type: application/json" \  -d '{}'

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
}