Commet is now fully headless. Everything you can do in the dashboard, you can now do through the SDK. v5 ships across all five languages with the same resources, methods, and types.
Every API version ever released still works. From v1 to v5, every version is accepted and will continue to be.
New resources
These were dashboard-only before. Now you can manage them programmatically:
- Plans — create, update, delete, manage features and prices, set visibility, configure regional pricing
- Invoices — list, get details, download PDF, send to customer, update status, create adjustments
- Transactions — list, get details, refund, retry failed payments
- Plan Groups — organize plans into groups, reorder, manage membership
- Promo Codes — create and manage discount codes
- Credit Packs — create and manage credit pack offerings
- API Keys — create, list, delete keys programmatically
- Webhooks — create, list, delete endpoints and trigger test deliveries
- Addons — full CRUD for addon definitions, plus activate/deactivate on a subscription
Existing resources also got new methods:
- Subscriptions —
list(),previewChange(),activateAddon(),deactivateAddon(),adjustBalance(),topupBalance(),purchaseCredits() - Features —
create(),update(),delete()
Simpler method signatures
seatType → featureCode
Seats are features. The parameter name now reflects that.
// v4
commet.seats.add({ customerId: userId, seatType: "member", count: 1 });
// v5
commet.seats.add({ customerId: userId, featureCode: "member" });count defaults to 1 — no need to pass it for single seat operations.
subscriptions.get() → getActive()
The name now says what it does.
// v4
const sub = await commet.subscriptions.get(userId);
// v5
const sub = await commet.subscriptions.getActive({ customerId: userId });No more customer() context
All methods now take customerId as a direct parameter. Less indirection, easier to understand.
// v4
const customer = commet.customer(userId);
await customer.features.canUse("editor");
await customer.seats.add("member");
// v5
await commet.features.canUse({ customerId: userId, code: "editor" });
await commet.seats.add({ customerId: userId, featureCode: "member" });externalId removed
If you were passing externalId to identify customers on seats, usage, or subscriptions — use customerId instead. For customer creation, keep using id.
// v4 — externalId on various resources
commet.usage.track({ feature: "api_calls", externalId: userId });
// v5 — customerId everywhere
commet.usage.track({ feature: "api_calls", customerId: userId });Better error details
API errors now include type, param, and doc_url when available, so you can build better error handling.
try {
await commet.subscriptions.create({ customerId, planCode: "pro" });
} catch (error) {
if (error instanceof CommetAPIError) {
console.log(error.type); // "invalid_request_error"
console.log(error.param); // "planCode"
console.log(error.docUrl); // link to docs
}
}Debug mode
Pass debug: true to see every request and response in your console. Useful when integrating.
const commet = new Commet({ apiKey: "ck_...", debug: true });
// [Commet SDK] POST https://commet.co/api/v1/subscriptions
// [Commet SDK] Response status: 201 CreatedCLI resource commands
Every SDK method is now available from the terminal. No code needed — create customers, plans, subscriptions, issue refunds, all from the command line.
commet customers create --email user@example.com --id user_123
commet plans create --name "Pro" --code pro
commet plans add-price --plan-id pln_abc --billing-interval monthly --price 2900
commet subscriptions create --customer-id user_123 --plan-code pro
commet invoices list --customer-id user_123
commet transactions refund --id txn_abc15 resources, 86 commands. Same structure everywhere: commet <resource> <action> [--flags].
--output agent returns raw JSON. --help at every level shows available actions and flags. Errors always tell you what went wrong and what values are valid.
commet link now auto-generates an API key for your org — no extra step needed.
5 SDKs, same API
Node, Python, Go, Java, and PHP — all at v5.0.0, all with the same 15 resources and identical method signatures.
npm install @commet/node@5
pip install commet-sdk==5.0.0
go get github.com/commet-labs/commet-go/v5
composer require commet/commet-php:^5.0
implementation("co.commet:commet-java:5.0.0") // Gradle