@commet/node 9.9.0 → 9.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +932 -59
- package/dist/index.d.ts +932 -59
- package/dist/index.js +209 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +209 -13
- package/dist/index.mjs.map +1 -1
- package/docs/ai-onboarding/mcp-server.md +2 -0
- package/docs/api-reference/addons.md +3 -1
- package/docs/api-reference/credit-packs.md +3 -1
- package/docs/api-reference/customers.md +3 -3
- package/docs/api-reference/generated-webhooks.md +2 -2
- package/docs/api-reference/index.md +3 -3
- package/docs/api-reference/invoices.md +4 -3
- package/docs/api-reference/plans.md +487 -6
- package/docs/api-reference/subscriptions.md +45 -4
- package/docs/api-reference/transactions.md +2 -1
- package/docs/documentation/api-versioning.md +8 -2
- package/docs/documentation/cli.md +4 -0
- package/docs/documentation/customers/customer-portal.md +2 -2
- package/docs/documentation/invoicing/manage-invoices.md +1 -1
- package/docs/documentation/plans/add-ons.md +16 -5
- package/docs/documentation/plans/balance-and-top-ups.md +1 -1
- package/docs/documentation/plans/consumption-models.md +23 -3
- package/docs/documentation/plans/create-plans.md +5 -1
- package/docs/documentation/plans/credit-packs.md +22 -10
- package/docs/documentation/plans/plan-groups.md +1 -1
- package/docs/documentation/plans/plan-versions.md +267 -0
- package/docs/documentation/sales/regional-prices.md +23 -9
- package/docs/documentation/sales/trial-periods.md +3 -3
- package/docs/documentation/subscriptions/manage-subscriptions.md +50 -13
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +2 -0
- package/docs/errors/addon_has_activations.md +2 -2
- package/docs/errors/addon_unavailable.md +22 -0
- package/docs/errors/credit_pack_unavailable.md +22 -0
- package/docs/errors/currency_held_by_balance_plan.md +22 -0
- package/docs/errors/currency_held_by_customer_credit.md +22 -0
- package/docs/errors/currency_held_by_fixed_amount_discount.md +22 -0
- package/docs/errors/currency_held_by_payment_method.md +22 -0
- package/docs/errors/currency_held_by_prepaid_period.md +22 -0
- package/docs/errors/currency_held_by_scheduled_pause.md +22 -0
- package/docs/errors/index.md +14 -2
- package/docs/errors/missing_regional_price.md +3 -3
- package/docs/errors/plan_experiment_not_found.md +22 -0
- package/docs/errors/plan_version_not_found.md +22 -0
- package/docs/errors/subscribers_do_not_fit.md +22 -0
- package/docs/errors/version_not_newer.md +22 -0
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +4 -3
- package/docs/knowledge-base/how-do-trial-periods-work.md +3 -3
- package/docs/knowledge-base/how-does-billing-work.md +26 -28
- package/docs/knowledge-base/how-does-quota-based-billing-work.md +12 -22
- package/docs/knowledge-base/how-does-seat-based-billing-work.md +12 -22
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +11 -8
- package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +34 -29
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -1
- package/docs/manifest.json +227 -2
- package/docs/platform-documentation.md +1 -0
- package/docs/schemas.md +128 -13
- package/docs/webhooks/introduction.md +3 -1
- package/docs/webhooks.md +27 -2
- package/docs/webhooks.openapi.json +231 -1
- package/package.json +1 -1
|
@@ -192,6 +192,8 @@ Each generated tool groups its input the same way:
|
|
|
192
192
|
|
|
193
193
|
Generated tools always execute the latest API version published by Commet. They do not read or change an older API version pinned for the organization's SDKs.
|
|
194
194
|
|
|
195
|
+
Tools that change a plan's prices, features or credit and balance rules publish a new current version of the plan. New buyers get it; existing subscriptions stay on their version until you move them with `api_change_subscription_version` or `api_create_plan_move`.
|
|
196
|
+
|
|
195
197
|
The following Commet-specific tools remain available:
|
|
196
198
|
|
|
197
199
|
| Tool | Description |
|
|
@@ -40,7 +40,7 @@ Retrieve an add-on by its public ID or slug.
|
|
|
40
40
|
|
|
41
41
|
`PATCH /addons/{id}` · operation `update-addon`
|
|
42
42
|
|
|
43
|
-
Update an add-on's name, description, or
|
|
43
|
+
Update an add-on's name, description, pricing, or the plans that sell it.
|
|
44
44
|
|
|
45
45
|
### Parameters
|
|
46
46
|
|
|
@@ -50,6 +50,7 @@ Update an add-on's name, description, or pricing.
|
|
|
50
50
|
- `basePrice` (`number`, optional)
|
|
51
51
|
- `includedUnits` (`number`, optional)
|
|
52
52
|
- `overageRate` (`number`, optional)
|
|
53
|
+
- `planIds` (`Array<string>`, optional) — Plans that sell the add-on, replacing the current ones. Empty means every plan; omitted keeps them. Removing a plan is rejected with addon_has_activations while a subscription of that plan has the add-on active.
|
|
53
54
|
|
|
54
55
|
### Request options
|
|
55
56
|
|
|
@@ -106,6 +107,7 @@ Create a new add-on linked to a feature. Each feature can only be assigned to on
|
|
|
106
107
|
- `description` (`string`, optional)
|
|
107
108
|
- `basePrice` (`number`, required)
|
|
108
109
|
- `featureId` (`string`, required)
|
|
110
|
+
- `planIds` (`Array<string>`, optional) — Plans that sell the add-on. Omitted or empty, every plan sells it. Plans created later sell it too.
|
|
109
111
|
- `consumptionModel` (`"boolean" | "metered" | "credits" | "balance"`, required)
|
|
110
112
|
- `includedUnits` (`number`, optional)
|
|
111
113
|
- `overageRate` (`number`, optional)
|
|
@@ -8,7 +8,7 @@ API version: `2026-08-27`
|
|
|
8
8
|
|
|
9
9
|
`PATCH /credit-packs/{id}` · operation `update-credit-pack`
|
|
10
10
|
|
|
11
|
-
Update a credit pack's name, description, credits, price, or
|
|
11
|
+
Update a credit pack's name, description, credits, price, active status, or the plans that sell it.
|
|
12
12
|
|
|
13
13
|
### Parameters
|
|
14
14
|
|
|
@@ -18,6 +18,7 @@ Update a credit pack's name, description, credits, price, or active status.
|
|
|
18
18
|
- `credits` (`number`, optional)
|
|
19
19
|
- `price` (`number`, optional)
|
|
20
20
|
- `isActive` (`boolean`, optional)
|
|
21
|
+
- `planIds` (`Array<string>`, optional) — Plans that sell the credit pack, replacing the current ones. Empty means every plan; omitted keeps them.
|
|
21
22
|
|
|
22
23
|
### Request options
|
|
23
24
|
|
|
@@ -70,6 +71,7 @@ Create a new credit pack.
|
|
|
70
71
|
- `credits` (`number`, required)
|
|
71
72
|
- `price` (`number`, required)
|
|
72
73
|
- `isActive` (`boolean`, optional)
|
|
74
|
+
- `planIds` (`Array<string>`, optional) — Plans that sell the credit pack. Omitted or empty, every plan sells it. Plans created later sell it too.
|
|
73
75
|
|
|
74
76
|
### Request options
|
|
75
77
|
|
|
@@ -194,7 +194,7 @@ Update a customer's name, external ID, or metadata.
|
|
|
194
194
|
- `email` (`string`, optional)
|
|
195
195
|
- `fullName` (`string`, optional)
|
|
196
196
|
- `taxDocument` (`string`, optional)
|
|
197
|
-
- `businessTaxId` (`string | null`, optional) — Business tax ID, such as an EU VAT number
|
|
197
|
+
- `businessTaxId` (`string | null`, optional) — Business tax ID, such as an EU VAT number, a Peruvian RUC or an Argentine CUIT, for the country of the customer's address; its type comes from that country. Where Commet collects tax and that ID exempts business buyers, a valid ID replaces consumer tax with the business treatment; elsewhere it is stored as sent and does not change any charge. Send null to remove it.
|
|
198
198
|
- `externalId` (`string`, optional)
|
|
199
199
|
- `timezone` (`Timezone`, optional)
|
|
200
200
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
@@ -218,7 +218,7 @@ Create up to 100 customers in a single request. With planGroupId, each customer
|
|
|
218
218
|
|
|
219
219
|
### Parameters
|
|
220
220
|
|
|
221
|
-
- `customers` (`Array<{ email: string; id?: string; externalId?: string; fullName?: string; taxDocument?: string; timezone?: Timezone; metadata?: Record<string, unknown>; address?: { line1: string; line2?: string; city: string; state?: string; postalCode: string; country: string; region?: string } }>`, required)
|
|
221
|
+
- `customers` (`Array<{ email: string; id?: string; externalId?: string; fullName?: string; taxDocument?: string; businessTaxId?: string; timezone?: Timezone; metadata?: Record<string, unknown>; address?: { line1: string; line2?: string; city: string; state?: string; postalCode: string; country: string; region?: string } }>`, required)
|
|
222
222
|
- `planGroupId` (`string`, optional) — Plan group whose starting plan the customer starts on when it has no open subscription: its signup trial, a trial without a payment method, when the group has one and the customer never had that plan, otherwise its default plan. A customer who already had the signup trial plan in a group without a default plan starts on none. Without it, no plan is assigned.
|
|
223
223
|
|
|
224
224
|
### Request options
|
|
@@ -261,7 +261,7 @@ Create a new customer. Idempotent when customerId is provided. With planGroupId,
|
|
|
261
261
|
- `externalId` (`string`, optional)
|
|
262
262
|
- `fullName` (`string`, optional)
|
|
263
263
|
- `taxDocument` (`string`, optional)
|
|
264
|
-
- `businessTaxId` (`string`, optional) — Business tax ID, such as an EU VAT number
|
|
264
|
+
- `businessTaxId` (`string`, optional) — Business tax ID, such as an EU VAT number, a Peruvian RUC or an Argentine CUIT, for the country of the customer's address; its type comes from that country. Where Commet collects tax and that ID exempts business buyers, a valid ID replaces consumer tax with the business treatment; elsewhere it is stored as sent and does not change any charge.
|
|
265
265
|
- `address` (`{ line1: string; line2?: string; city: string; state?: string; postalCode: string; country: string; region?: string }`, optional)
|
|
266
266
|
- `addressId` (`string`, optional)
|
|
267
267
|
- `email` (`string`, required)
|
|
@@ -30,7 +30,7 @@ Update a webhook endpoint. Only the provided fields change.
|
|
|
30
30
|
|
|
31
31
|
- `id` (`string`, required)
|
|
32
32
|
- `url` (`string`, optional)
|
|
33
|
-
- `events` (`Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">`, optional)
|
|
33
|
+
- `events` (`Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.version_changed" | "subscription.version_change_canceled" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">`, optional)
|
|
34
34
|
- `description` (`string | null`, optional)
|
|
35
35
|
- `isActive` (`boolean`, optional)
|
|
36
36
|
- `apiVersion` (`string`, optional)
|
|
@@ -107,7 +107,7 @@ Create a new webhook endpoint. The response includes the signing secret which is
|
|
|
107
107
|
### Parameters
|
|
108
108
|
|
|
109
109
|
- `url` (`string`, required)
|
|
110
|
-
- `events` (`Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">`, required)
|
|
110
|
+
- `events` (`Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.version_changed" | "subscription.version_change_canceled" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">`, required)
|
|
111
111
|
- `description` (`string`, optional)
|
|
112
112
|
- `apiVersion` (`string`, optional)
|
|
113
113
|
|
|
@@ -5,7 +5,7 @@ Generated from Commet API version `2026-08-27`.
|
|
|
5
5
|
Use this reference for the exact resources, methods, parameters, and return types available in the installed SDK.
|
|
6
6
|
|
|
7
7
|
- [Schemas](../schemas.md) — generated models and enums
|
|
8
|
-
- [API errors](../errors/index.md) —
|
|
8
|
+
- [API errors](../errors/index.md) — 100 version-matched error references
|
|
9
9
|
- [Addons](./addons.md) — 6 operations
|
|
10
10
|
- [Api Keys](./api-keys.md) — 3 operations
|
|
11
11
|
- [Provisioning](./provisioning.md) — 1 operations
|
|
@@ -19,11 +19,11 @@ Use this reference for the exact resources, methods, parameters, and return type
|
|
|
19
19
|
- [Payments](./payments.md) — 5 operations
|
|
20
20
|
- [Payouts](./payouts.md) — 3 operations
|
|
21
21
|
- [Plan Groups](./plan-groups.md) — 8 operations
|
|
22
|
-
- [Plans](./plans.md) —
|
|
22
|
+
- [Plans](./plans.md) — 39 operations
|
|
23
23
|
- [Portal](./portal.md) — 1 operations
|
|
24
24
|
- [Promo Codes](./promo-codes.md) — 4 operations
|
|
25
25
|
- [Seats](./seats.md) — 6 operations
|
|
26
|
-
- [Subscriptions](./subscriptions.md) —
|
|
26
|
+
- [Subscriptions](./subscriptions.md) — 28 operations
|
|
27
27
|
- [Test Clock](./test-clock.md) — 3 operations
|
|
28
28
|
- [Transactions](./transactions.md) — 4 operations
|
|
29
29
|
- [Usage](./usage.md) — 3 operations
|
|
@@ -64,12 +64,13 @@ Send the invoice to the customer via email.
|
|
|
64
64
|
|
|
65
65
|
`PATCH /invoices/{id}/status` · operation `update-invoice-status`
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
Deprecated. No longer changes the invoice. An invoice is paid when its charge settles: to collect a past-due subscription, reactivate it or send the customer a recovery link.
|
|
68
|
+
|
|
69
|
+
Deprecated.
|
|
68
70
|
|
|
69
71
|
### Parameters
|
|
70
72
|
|
|
71
73
|
- `id` (`string`, required)
|
|
72
|
-
- `status` (`"paid" | "void"`, required)
|
|
73
74
|
|
|
74
75
|
### Request options
|
|
75
76
|
|
|
@@ -77,7 +78,7 @@ Mark an outstanding invoice as "paid" or "void" and return the updated invoice.
|
|
|
77
78
|
|
|
78
79
|
### Returns
|
|
79
80
|
|
|
80
|
-
`
|
|
81
|
+
`void`
|
|
81
82
|
|
|
82
83
|
## list
|
|
83
84
|
|