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

Create subscription

Create a subscription for a customer. Requires either planId/planCode and customerId/externalId.

Change plan POST

Upgrade, downgrade, or change billing interval.

Get active subscription GET

Get the active subscription for a customer. Returns null if none.

POST
/subscriptions

Authorization

ApiKeyAuth
x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

planId?string
Length1 <= length
planCode?string
customerId*string
Length1 <= length <= 200
billingInterval?|
Value in"monthly" | "quarterly" | "yearly" | null
initialSeats?
skipTrial?boolean
Defaultfalse
name?string
startDate?string
Formatdate-time
successUrl?string
Formaturi

Response Body

application/json

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

application/json

application/json

application/json

application/json

Create a subscription for a customer. Requires either planId/planCode and customerId/externalId.

{
  "success": true,
  "data": {
    "id": "string",
    "customerId": "string",
    "planId": "string",
    "planName": "string",
    "name": "string",
    "status": "string",
    "billingInterval": "string",
    "trialEndsAt"













{
  "success": true,
  "data": {
    "id": "string",
    "customerId": "string",
    "planId": "string",
    "planName": "string",
    "name": "string",
    "status": "string",
    "billingInterval": "string",
    "trialEndsAt"













{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}
{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}
{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}
:
"string"
,
"startDate": "2019-08-24T14:15:22Z",
"endDate": "string",
"currentPeriodStart": "string",
"currentPeriodEnd": "string",
"billingDayOfMonth": 0,
"checkoutUrl": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"discountType": "string",
"discountValue": 0,
"discountEndsAt": "string",
"discountName": "string"
}
}
:
"string"
,
"startDate": "2019-08-24T14:15:22Z",
"endDate": "string",
"currentPeriodStart": "string",
"currentPeriodEnd": "string",
"billingDayOfMonth": 0,
"checkoutUrl": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"discountType": "string",
"discountValue": 0,
"discountEndsAt": "string",
"discountName": "string"
}
}