Commet
  • Pricing
Log InTry out
Adjust balance POSTCancel subscription POSTChange plan POSTCreate subscription POSTGet active subscription GETList subscriptions GETPreview plan change POSTTop up balance POSTRevert scheduled cancellation POST
DocumentationKnowledge BaseBuild with AIAPI ReferenceWebhooks

Preview plan change

Preview proration details for a plan change without applying it. Returns credit, charge, and net amount.

List subscriptions GET

List all subscriptions. Filter by customer ID or status.

Top up balance POST

Top up a subscription's balance. Charges the customer's payment method for the specified amount.

POST
/subscriptions/{id}/preview-change

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.

planId*string
Length1 <= length
billingInterval?string
Value in"weekly" | "monthly" | "quarterly" | "yearly" | "one_time"

Response Body

application/json

application/json

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

application/json

Target plan public ID

Billing interval for the new plan. Defaults to current subscription interval.

Preview proration details for a plan change without applying it. Returns credit, charge, and net amount.

Subscription public ID

{
  "success": true,
  "data": {
    "object": "subscription",
    "livemode": true,
    "currentPlanCredit": 0,
    "newPlanCharge": 0,
    "estimatedTotal": 0,
    "effectiveDate": "2019-08-24T14:15:22Z",
    "daysRemaining": 0,



{
  "success": false,
  "error": {
    "type": "validation_error",
    "code": "string",
    "message": "string",
    "doc_url": "string",
    "param": "string"
  }
}
{
  "success": false,
  "error": {
    "type": "validation_error",
    "code": "string",
    "message": "string",
    "doc_url": "string",
    "param": "string"
  }
}
"totalDays"
:
0
,
"isUpgrade": true
}
}