@commet/node 9.7.0 → 9.9.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 +413 -52
- package/dist/index.d.ts +413 -52
- package/dist/index.js +39 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -12
- package/dist/index.mjs.map +1 -1
- package/docs/ai-onboarding/mcp-server.md +1 -1
- package/docs/api-reference/customers.md +6 -2
- package/docs/api-reference/generated-webhooks.md +2 -2
- package/docs/api-reference/index.md +2 -2
- package/docs/api-reference/offers.md +2 -2
- package/docs/api-reference/plans.md +16 -3
- package/docs/api-reference/promo-codes.md +3 -1
- package/docs/api-reference/subscriptions.md +84 -9
- package/docs/api-reference/usage.md +0 -4
- package/docs/documentation/cli.md +60 -49
- package/docs/documentation/create-api-key.md +3 -1
- package/docs/documentation/customers/customer-portal.md +10 -2
- package/docs/documentation/customers/manage-customers.md +2 -1
- package/docs/documentation/finance/payouts.md +11 -0
- package/docs/documentation/finance/supported-countries.md +5 -5
- package/docs/documentation/invoicing/handle-failed-payments.md +9 -9
- package/docs/documentation/payments/accept-one-time-payments.md +1 -1
- package/docs/documentation/payments/payment-orchestration.md +2 -0
- package/docs/documentation/payments/payment-providers.md +46 -0
- package/docs/documentation/payments/transactions-refunds-and-retries.md +1 -1
- package/docs/documentation/plans/add-ons.md +1 -1
- package/docs/documentation/plans/consumption-models.md +44 -9
- package/docs/documentation/plans/credit-packs.md +49 -1
- package/docs/documentation/plans/one-time-payments.md +3 -3
- package/docs/documentation/plans/plan-groups.md +46 -10
- package/docs/documentation/platform/dashboard-metrics-and-events.md +40 -9
- package/docs/documentation/sales/connect-dub-affiliates.md +52 -0
- package/docs/documentation/sales/introductory-offers.md +7 -13
- package/docs/documentation/sales/offers.md +10 -6
- package/docs/documentation/sales/promo-codes.md +47 -17
- package/docs/documentation/sales/promotional-offers.md +6 -7
- package/docs/documentation/sales/regional-prices.md +16 -0
- package/docs/documentation/sales/trial-periods.md +67 -40
- package/docs/documentation/subscriptions/manage-subscriptions.md +65 -2
- package/docs/documentation/subscriptions/pay-in-advance.md +4 -7
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +20 -2
- package/docs/documentation/testing-sandbox.md +2 -0
- package/docs/documentation/usage/track-usage.md +23 -0
- package/docs/errors/customer_deleted.md +22 -0
- package/docs/errors/index.md +5 -0
- package/docs/errors/managed_by_integration.md +22 -0
- package/docs/errors/no_scheduled_plan_change.md +22 -0
- package/docs/errors/plan_balance_limit_reached.md +22 -0
- package/docs/errors/plan_credit_limit_reached.md +22 -0
- package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +8 -8
- package/docs/knowledge-base/how-do-discounts-work.md +7 -5
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +14 -8
- package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +1 -1
- package/docs/knowledge-base/how-do-trial-periods-work.md +30 -24
- package/docs/knowledge-base/how-does-billing-work.md +1 -0
- package/docs/knowledge-base/what-happens-when-a-payment-fails.md +11 -9
- package/docs/manifest.json +54 -2
- package/docs/platform-documentation.md +1 -0
- package/docs/schemas.md +51 -9
- package/docs/webhooks/introduction.md +14 -12
- package/docs/webhooks.md +53 -17
- package/docs/webhooks.openapi.json +857 -745
- package/package.json +1 -1
|
@@ -199,7 +199,7 @@ The following Commet-specific tools remain available:
|
|
|
199
199
|
| `get_current_organization` | Get the organization used by API tools |
|
|
200
200
|
| `search_docs` | Search the live Commet documentation by semantic query |
|
|
201
201
|
|
|
202
|
-
The previous
|
|
202
|
+
The previous endpoint, `https://commet.co/mcp`, is retired. It no longer exposes tools: it tells the connected agent to reconnect at `https://commet.co/mcp/v2`. Replace the URL in your client configuration and sign in again.
|
|
203
203
|
|
|
204
204
|
> **Warning**
|
|
205
205
|
>
|
|
@@ -194,6 +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 or a Peruvian RUC, for the country of the customer's address. Accepted only where Commet collects tax; a valid ID replaces consumer tax with the business treatment. Send null to remove it.
|
|
197
198
|
- `externalId` (`string`, optional)
|
|
198
199
|
- `timezone` (`Timezone`, optional)
|
|
199
200
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
@@ -213,11 +214,12 @@ Update a customer's name, external ID, or metadata.
|
|
|
213
214
|
|
|
214
215
|
`POST /customers/batch` · operation `batch-create-customers`
|
|
215
216
|
|
|
216
|
-
Create up to 100 customers in a single request.
|
|
217
|
+
Create up to 100 customers in a single request. With planGroupId, each customer without an open subscription starts on that group's starting plan (see planGroupId), and the entry of a deleted customer fails with customer_deleted.
|
|
217
218
|
|
|
218
219
|
### Parameters
|
|
219
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)
|
|
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.
|
|
221
223
|
|
|
222
224
|
### Request options
|
|
223
225
|
|
|
@@ -251,7 +253,7 @@ List customers with cursor-based pagination.
|
|
|
251
253
|
|
|
252
254
|
`POST /customers` · operation `create-customer`
|
|
253
255
|
|
|
254
|
-
Create a new customer. Idempotent when customerId is provided.
|
|
256
|
+
Create a new customer. Idempotent when customerId is provided. With planGroupId, a customer without an open subscription starts on that group's starting plan (see planGroupId), and the externalId of a deleted customer is rejected.
|
|
255
257
|
|
|
256
258
|
### Parameters
|
|
257
259
|
|
|
@@ -259,11 +261,13 @@ Create a new customer. Idempotent when customerId is provided.
|
|
|
259
261
|
- `externalId` (`string`, optional)
|
|
260
262
|
- `fullName` (`string`, optional)
|
|
261
263
|
- `taxDocument` (`string`, optional)
|
|
264
|
+
- `businessTaxId` (`string`, optional) — Business tax ID, such as an EU VAT number or a Peruvian RUC, for the country of the customer's address. Accepted only where Commet collects tax; a valid ID replaces consumer tax with the business treatment.
|
|
262
265
|
- `address` (`{ line1: string; line2?: string; city: string; state?: string; postalCode: string; country: string; region?: string }`, optional)
|
|
263
266
|
- `addressId` (`string`, optional)
|
|
264
267
|
- `email` (`string`, required)
|
|
265
268
|
- `timezone` (`Timezone`, optional)
|
|
266
269
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
270
|
+
- `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.
|
|
267
271
|
|
|
268
272
|
### Request options
|
|
269
273
|
|
|
@@ -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" | "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.topped_up" | "balance.low" | "balance.depleted" | "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.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" | "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.topped_up" | "balance.low" | "balance.depleted" | "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.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) — 88 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
|
|
@@ -23,7 +23,7 @@ Use this reference for the exact resources, methods, parameters, and return type
|
|
|
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) — 26 operations
|
|
27
27
|
- [Test Clock](./test-clock.md) — 3 operations
|
|
28
28
|
- [Transactions](./transactions.md) — 4 operations
|
|
29
29
|
- [Usage](./usage.md) — 3 operations
|
|
@@ -30,7 +30,7 @@ Replace reusable offer terms. Existing applications keep their immutable accepte
|
|
|
30
30
|
|
|
31
31
|
- `id` (`string`, required)
|
|
32
32
|
- `name` (`string`, required)
|
|
33
|
-
- `phases` (`Array<{ type: "
|
|
33
|
+
- `phases` (`Array<{ type: "percentage"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
34
34
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
35
35
|
- `startsAt` (`string | null`, optional)
|
|
36
36
|
- `endsAt` (`string | null`, optional)
|
|
@@ -89,7 +89,7 @@ Create reusable offer terms without assigning a plan, price, eligibility rule, o
|
|
|
89
89
|
### Parameters
|
|
90
90
|
|
|
91
91
|
- `name` (`string`, required)
|
|
92
|
-
- `phases` (`Array<{ type: "
|
|
92
|
+
- `phases` (`Array<{ type: "percentage"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
93
93
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
94
94
|
- `startsAt` (`string | null`, optional)
|
|
95
95
|
- `endsAt` (`string | null`, optional)
|
|
@@ -148,6 +148,7 @@ Update a base price or market price variant. Removing a base market override is
|
|
|
148
148
|
- `price` (`number`, optional)
|
|
149
149
|
- `isDefault` (`boolean`, optional)
|
|
150
150
|
- `trialDays` (`number`, optional)
|
|
151
|
+
- `trialRequiresPaymentMethod` (`boolean`, optional) — Set to false so the price's free trial starts without a payment method. Requires trialDays on the price.
|
|
151
152
|
- `includedBalance` (`number | null`, optional)
|
|
152
153
|
- `includedCredits` (`number | null`, optional)
|
|
153
154
|
- `metadata` (`Record<string, unknown>`, optional) — Metadata keys to merge into the existing price metadata.
|
|
@@ -193,6 +194,7 @@ Add a base price or a selectable market price variant. Variants inherit their ba
|
|
|
193
194
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
194
195
|
- `price` (`number`, optional)
|
|
195
196
|
- `trialDays` (`number`, optional)
|
|
197
|
+
- `trialRequiresPaymentMethod` (`boolean`, optional) — Set to false so the price's free trial starts without a payment method. Requires trialDays on the price.
|
|
196
198
|
- `isDefault` (`boolean`, optional)
|
|
197
199
|
- `includedBalance` (`number | null`, optional)
|
|
198
200
|
- `includedCredits` (`number | null`, optional)
|
|
@@ -258,7 +260,7 @@ Get a plan with public price IDs and their automatic introductory offer IDs.
|
|
|
258
260
|
|
|
259
261
|
`PATCH /plans/{id}` · operation `update-plan`
|
|
260
262
|
|
|
261
|
-
Update a plan's name, description, visibility, or
|
|
263
|
+
Update a plan's name, description, visibility, default status, metadata, overage behavior, what happens to its unused plan credits or plan balance, or its plan credit or plan balance limit.
|
|
262
264
|
|
|
263
265
|
### Parameters
|
|
264
266
|
|
|
@@ -267,6 +269,12 @@ Update a plan's name, description, visibility, or metadata.
|
|
|
267
269
|
- `description` (`string | null`, optional)
|
|
268
270
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
269
271
|
- `isPublic` (`boolean`, optional)
|
|
272
|
+
- `unusedPlanCredits` (`{ type: "expire" } | { type: "roll_over"; maxPlanCredits: number | null }`, optional) — Credits plans only. What happens to unused plan credits at each reset. Existing subscriptions apply it from their next reset.
|
|
273
|
+
- `planCreditLimit` (`{ credits: number; interval: "day" | "week" } | null`, optional) — Credits plans only. The most plan credits a subscription spends per day or per week; null removes the limit. Raising or removing it applies to existing subscriptions at once; lowering it, adding it or changing its interval applies from their next period.
|
|
274
|
+
- `unusedPlanBalance` (`{ type: "expire" } | { type: "roll_over"; maxPlanBalance: number | null }`, optional) — Balance plans only. What happens to unused plan balance at each reset. Existing subscriptions apply it from their next reset.
|
|
275
|
+
- `planBalanceLimit` (`{ amount: number; interval: "day" | "week" } | null`, optional) — Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; null removes the limit. Raising or removing it applies to existing subscriptions at once; lowering it, adding it or changing its interval applies from their next period.
|
|
276
|
+
- `blockOnExhaustion` (`boolean`, optional) — Credits and balance plans only. false lets usage continue past the plan and purchased amounts and bills the missing amount as overage at the next renewal; a credits plan bills it at the price per credit and needs one. Trials and free plans always stop, so free plans accept only true. Existing subscriptions apply it from their next reset.
|
|
277
|
+
- `isDefault` (`boolean`, optional) — Make this plan the default plan of its plan group: customers created with that planGroupId start on it, and a paid plan of the group that ends from the customer portal, a revoked payment authorization or exhausted dunning moves to it instead of canceling. Requires a free plan in a plan group; replaces the group's previous default plan. false unmarks it.
|
|
270
278
|
|
|
271
279
|
### Request options
|
|
272
280
|
|
|
@@ -335,7 +343,7 @@ List plans with public price IDs and their automatic introductory offer IDs.
|
|
|
335
343
|
|
|
336
344
|
`POST /plans` · operation `create-plan`
|
|
337
345
|
|
|
338
|
-
Create a new plan with optional consumption model, visibility, and plan
|
|
346
|
+
Create a new plan with optional consumption model, visibility, plan group assignment, overage behavior, and the rollover and spend limit of its plan credits or plan balance.
|
|
339
347
|
|
|
340
348
|
### Parameters
|
|
341
349
|
|
|
@@ -345,8 +353,13 @@ Create a new plan with optional consumption model, visibility, and plan group as
|
|
|
345
353
|
- `consumptionModel` (`"metered" | "credits" | "balance"`, optional)
|
|
346
354
|
- `isPublic` (`boolean`, optional)
|
|
347
355
|
- `isFree` (`boolean`, optional)
|
|
348
|
-
- `blockOnExhaustion` (`boolean`, optional)
|
|
356
|
+
- `blockOnExhaustion` (`boolean`, optional) — Credits and balance plans. Omitted, credits plans and free plans stop usage when the plan and purchased amounts run out, and paid balance plans bill the missing balance as overage. A new credits plan always stops usage: it allows overage only with a price per credit, which is set after creation, and then `PATCH /v1/plans/{id}` turns overage on.
|
|
357
|
+
- `unusedPlanCredits` (`{ type: "expire" } | { type: "roll_over"; maxPlanCredits: number | null }`, optional) — Credits plans only. What happens to unused plan credits at each reset; omitted means they expire.
|
|
358
|
+
- `planCreditLimit` (`{ credits: number; interval: "day" | "week" } | null`, optional) — Credits plans only. The most plan credits a subscription spends per day or per week; omitted or null means no limit.
|
|
359
|
+
- `unusedPlanBalance` (`{ type: "expire" } | { type: "roll_over"; maxPlanBalance: number | null }`, optional) — Balance plans only. What happens to unused plan balance at each reset; omitted means it expires.
|
|
360
|
+
- `planBalanceLimit` (`{ amount: number; interval: "day" | "week" } | null`, optional) — Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; omitted or null means no limit.
|
|
349
361
|
- `planGroupId` (`string`, optional)
|
|
362
|
+
- `isDefault` (`boolean`, optional) — Make this plan the default plan of its plan group: customers created with that planGroupId start on it, and a paid plan of the group that ends from the customer portal, a revoked payment authorization or exhausted dunning moves to it instead of canceling. Requires a free plan with a planGroupId; replaces the group's previous default plan.
|
|
350
363
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
351
364
|
|
|
352
365
|
### Request options
|
|
@@ -34,6 +34,7 @@ Update a promo code's billing interval, redemption limits, expiration, active st
|
|
|
34
34
|
- `expiresAt` (`string | null`, optional)
|
|
35
35
|
- `active` (`boolean`, optional)
|
|
36
36
|
- `planIds` (`Array<string>`, optional)
|
|
37
|
+
- `firstPurchaseOnly` (`boolean`, optional) — Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription.
|
|
37
38
|
|
|
38
39
|
### Request options
|
|
39
40
|
|
|
@@ -66,7 +67,7 @@ List promo codes with cursor-based pagination.
|
|
|
66
67
|
|
|
67
68
|
`POST /promo-codes` · operation `create-promo-code`
|
|
68
69
|
|
|
69
|
-
Create a distribution code for an existing Offer with one or more sequential discount phases
|
|
70
|
+
Create a distribution code for an existing Offer with one or more sequential discount phases. The code owns redemption restrictions.
|
|
70
71
|
|
|
71
72
|
### Parameters
|
|
72
73
|
|
|
@@ -76,6 +77,7 @@ Create a distribution code for an existing Offer with one or more sequential dis
|
|
|
76
77
|
- `maxRedemptions` (`number`, optional)
|
|
77
78
|
- `expiresAt` (`string`, optional)
|
|
78
79
|
- `planIds` (`Array<string>`, optional)
|
|
80
|
+
- `firstPurchaseOnly` (`boolean`, optional) — Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription. Defaults to false.
|
|
79
81
|
|
|
80
82
|
### Request options
|
|
81
83
|
|
|
@@ -40,6 +40,47 @@ Activate an add-on on a subscription. Charges a prorated amount for the current
|
|
|
40
40
|
|
|
41
41
|
`SubscriptionAddon`
|
|
42
42
|
|
|
43
|
+
## getAutoTopUp
|
|
44
|
+
|
|
45
|
+
`commet.subscriptions.getAutoTopUp(params)`
|
|
46
|
+
|
|
47
|
+
`GET /subscriptions/{id}/auto-top-up` · operation `get-subscription-auto-top-up`
|
|
48
|
+
|
|
49
|
+
Read whether the subscription tops up automatically with its saved payment method when its available credits or balance reach a threshold, with the top-ups used this period and the last failure.
|
|
50
|
+
|
|
51
|
+
### Parameters
|
|
52
|
+
|
|
53
|
+
- `id` (`string`, required)
|
|
54
|
+
|
|
55
|
+
### Returns
|
|
56
|
+
|
|
57
|
+
`SubscriptionAutoTopUp`
|
|
58
|
+
|
|
59
|
+
## updateAutoTopUp
|
|
60
|
+
|
|
61
|
+
`commet.subscriptions.updateAutoTopUp(params, options?)`
|
|
62
|
+
|
|
63
|
+
`PATCH /subscriptions/{id}/auto-top-up` · operation `update-subscription-auto-top-up`
|
|
64
|
+
|
|
65
|
+
Turn automatic top-ups on or off and set the threshold, the size of each top-up and the maximum top-ups per period. Send only the fields that change. On a credits plan each top-up buys `quantity` credits; on a balance plan it adds `amount` in minor units of the subscription currency, plus tax, and `threshold` is in the same minor units. Enabling requires a plan that sells credits or has balance top-ups on. The size must be at least the plan's minimum when auto top-up is enabled or when the size changes, so turning it off keeps working after the minimum rises. Saving it enabled resumes a paused auto top-up.
|
|
66
|
+
|
|
67
|
+
### Parameters
|
|
68
|
+
|
|
69
|
+
- `id` (`string`, required)
|
|
70
|
+
- `enabled` (`boolean`, optional)
|
|
71
|
+
- `threshold` (`number`, optional)
|
|
72
|
+
- `quantity` (`number`, optional) — Credits each top-up buys. Credits plans only.
|
|
73
|
+
- `amount` (`number`, optional) — Minor units of the subscription currency each top-up adds. Balance plans only.
|
|
74
|
+
- `maxPerPeriod` (`number`, optional)
|
|
75
|
+
|
|
76
|
+
### Request options
|
|
77
|
+
|
|
78
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
79
|
+
|
|
80
|
+
### Returns
|
|
81
|
+
|
|
82
|
+
`SubscriptionAutoTopUp`
|
|
83
|
+
|
|
43
84
|
## adjustBalance
|
|
44
85
|
|
|
45
86
|
`commet.subscriptions.adjustBalance(params, options?)`
|
|
@@ -69,12 +110,12 @@ Adjust a subscription's balance or credits by a signed amount. Positive adds, ne
|
|
|
69
110
|
|
|
70
111
|
`POST /subscriptions/{id}/balance/topup` · operation `topup-balance`
|
|
71
112
|
|
|
72
|
-
Top up a subscription
|
|
113
|
+
Top up a balance subscription. Charges the customer's payment method for the amount plus tax, adds it to the subscription's purchased balance (after paying back any overage owed on the plan balance), creates its invoice and emits `balance.topped_up`. Purchased balance is spent after the plan balance and is kept until the subscription ends. Rejected with 400 when the subscription is not on a balance plan, its plan has top-ups turned off, or the amount is below the effective minimum: the plan's minimum top-up in the subscription currency, raised to the currency's minimum charge.
|
|
73
114
|
|
|
74
115
|
### Parameters
|
|
75
116
|
|
|
76
117
|
- `id` (`string`, required)
|
|
77
|
-
- `amount` (`number`, required)
|
|
118
|
+
- `amount` (`number`, required) — The amount to add, in minor units of the subscription currency (cents; whole units for zero-decimal currencies).
|
|
78
119
|
|
|
79
120
|
### Request options
|
|
80
121
|
|
|
@@ -112,7 +153,7 @@ Cancel immediately or at period end and return the updated subscription.
|
|
|
112
153
|
|
|
113
154
|
`POST /subscriptions/{id}/change-plan` · operation `change-plan`
|
|
114
155
|
|
|
115
|
-
Upgrade or change billing interval immediately, optionally applying an Offer. Scheduled changes
|
|
156
|
+
Upgrade or change billing interval immediately, optionally applying an Offer by offerId or the Offer of a promoCode. Scheduled changes accept neither offerId nor promoCode. From a free plan, a promoCode opens the checkout with the code applied and counts its use when the checkout is paid; without offerId or promoCode, a destination price whose free trial requires no payment method starts that trial right away without checkout. During a trial without a payment method, an immediate change returns 409 no_payment_method; scheduled changes still apply.
|
|
116
157
|
|
|
117
158
|
### Parameters
|
|
118
159
|
|
|
@@ -121,6 +162,11 @@ Upgrade or change billing interval immediately, optionally applying an Offer. Sc
|
|
|
121
162
|
- `newBillingInterval` (`"weekly" | "monthly" | "quarterly" | "semiannual" | "yearly"`, optional)
|
|
122
163
|
- `successUrl` (`string`, optional)
|
|
123
164
|
- `offerId` (`string`, optional)
|
|
165
|
+
- `promoCode` (`string`, optional)
|
|
166
|
+
|
|
167
|
+
### Valid parameter combinations
|
|
168
|
+
|
|
169
|
+
- `promoCode`
|
|
124
170
|
|
|
125
171
|
### Request options
|
|
126
172
|
|
|
@@ -136,12 +182,18 @@ Upgrade or change billing interval immediately, optionally applying an Offer. Sc
|
|
|
136
182
|
|
|
137
183
|
`POST /subscriptions/{id}/credits` · operation `purchase-credits`
|
|
138
184
|
|
|
139
|
-
Purchase a credit pack
|
|
185
|
+
Purchase a fixed credit pack or choose a whole credit quantity at the subscription plan price and minimum. Charges the saved payment method and adds purchased credits.
|
|
140
186
|
|
|
141
187
|
### Parameters
|
|
142
188
|
|
|
143
189
|
- `id` (`string`, required)
|
|
144
|
-
- `creditPackId` (`string`,
|
|
190
|
+
- `creditPackId` (`string`, optional)
|
|
191
|
+
- `quantity` (`number`, optional)
|
|
192
|
+
|
|
193
|
+
### Valid parameter combinations
|
|
194
|
+
|
|
195
|
+
- `creditPackId`
|
|
196
|
+
- `quantity`
|
|
145
197
|
|
|
146
198
|
### Request options
|
|
147
199
|
|
|
@@ -157,7 +209,7 @@ Purchase a credit pack for a subscription. Charges the customer and adds credits
|
|
|
157
209
|
|
|
158
210
|
`PUT /subscriptions/{id}/offer` · operation `apply-subscription-offer`
|
|
159
211
|
|
|
160
|
-
Apply a direct Offer to a subscription. On a pending
|
|
212
|
+
Apply a direct Offer to a subscription. On a pending checkout it quotes or replaces the checkout discount, which starts after the plan price trial when there is one, and the existing checkout URL remains unchanged. On an active subscription it applies the Offer immediately with its discount phases starting at the next billing cycle; the call is rejected while another applied Offer still has active or upcoming discount phases.
|
|
161
213
|
|
|
162
214
|
### Parameters
|
|
163
215
|
|
|
@@ -298,7 +350,7 @@ Creates a hosted checkout to pay billing periods of a recurring subscription in
|
|
|
298
350
|
|
|
299
351
|
`POST /subscriptions/{id}/preview-change` · operation `preview-change-plan`
|
|
300
352
|
|
|
301
|
-
Preview proration details for an immediate plan change without applying it. Free-to-paid changes are never scheduled and the change-plan endpoint
|
|
353
|
+
Preview proration details for an immediate plan change without applying it. Free-to-paid changes are never scheduled and the change-plan endpoint returns hosted checkout for them, except a change without offerId or promoCode to a price whose free trial needs no payment method, for a customer who never had that plan: it starts the trial at once, so the preview reports nothing due today. For paid plans, interval direction takes precedence: a longer interval is immediate and a shorter interval is scheduled. When the interval is unchanged, a higher-sort-order plan is immediate and a lower-sort-order plan is scheduled. A paid-to-free change is always scheduled. Returns credit, charge, and net amount. The target plan must belong to the same plan group as the current plan, otherwise a 400 with code `plans_not_in_same_group` is returned. A change between two free plans has nothing to prorate and returns a zero-amount estimate. Scheduled changes return a 400 with code `plan_change_scheduled`; apply those via the change-plan endpoint. Pass offerId to quote the destination plan with an Offer, or promoCode to quote it with the Offer of a promo code validated with the checkout's rules.
|
|
302
354
|
|
|
303
355
|
### Parameters
|
|
304
356
|
|
|
@@ -306,6 +358,12 @@ Preview proration details for an immediate plan change without applying it. Free
|
|
|
306
358
|
- `planId` (`string`, required)
|
|
307
359
|
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time"`, optional)
|
|
308
360
|
- `offerId` (`string`, optional)
|
|
361
|
+
- `promoCode` (`string`, optional)
|
|
362
|
+
|
|
363
|
+
### Valid parameter combinations
|
|
364
|
+
|
|
365
|
+
- `planId`
|
|
366
|
+
- `planId` + `promoCode`
|
|
309
367
|
|
|
310
368
|
### Request options
|
|
311
369
|
|
|
@@ -392,6 +450,22 @@ Get a subscription by its public ID, regardless of status (including pending_pay
|
|
|
392
450
|
|
|
393
451
|
`Subscription`
|
|
394
452
|
|
|
453
|
+
## revokeScheduledPlanChange
|
|
454
|
+
|
|
455
|
+
`commet.subscriptions.revokeScheduledPlanChange(params, options?)`
|
|
456
|
+
|
|
457
|
+
`DELETE /subscriptions/{id}/scheduled-plan-change` · operation `revoke-scheduled-plan-change`
|
|
458
|
+
|
|
459
|
+
Revoke the plan or interval change scheduled for the end of the period, so the subscription stays on its current plan. Returns the updated subscription.
|
|
460
|
+
|
|
461
|
+
### Parameters
|
|
462
|
+
|
|
463
|
+
- `id` (`string`, required)
|
|
464
|
+
|
|
465
|
+
### Returns
|
|
466
|
+
|
|
467
|
+
`Subscription`
|
|
468
|
+
|
|
395
469
|
## uncancel
|
|
396
470
|
|
|
397
471
|
`commet.subscriptions.uncancel(params, options?)`
|
|
@@ -451,7 +525,7 @@ List all subscriptions. Filter by customer ID or status.
|
|
|
451
525
|
|
|
452
526
|
`POST /subscriptions` · operation `create-subscription`
|
|
453
527
|
|
|
454
|
-
Create a subscription for a customer. Commet selects the default price when priceId is omitted. The subscription starts at the base USD price; market and currency are resolved from the buyer's request country when the checkout opens. Without an offer override, Commet applies the price's automatic introductory Offer. Pass offerId to apply an active compatible Offer directly, or cardPromotionId to preselect a card-eligible Promotional Offer for the initial checkout when card promotions are enabled for the organization. For the initial checkout, provider accepts either a processor name or an exact payment connection ID.
|
|
528
|
+
Create a subscription for a customer. Commet selects the default price when priceId is omitted. The subscription starts at the base USD price; market and currency are resolved from the buyer's request country when the checkout opens. Without an offer override, Commet applies the price's automatic introductory Offer. Pass offerId to apply an active compatible Offer directly, or cardPromotionId to preselect a card-eligible Promotional Offer for the initial checkout when card promotions are enabled for the organization. For the initial checkout, provider accepts either a processor name or an exact payment connection ID. When the price's free trial requires no payment method, the subscription starts trialing right away with no checkout (checkoutUrl null, hasPaymentMethod false); it cannot be combined with offerId, promoCode, cardPromotionId or provider, and an organization that cannot charge yet receives 403.
|
|
455
529
|
|
|
456
530
|
### Parameters
|
|
457
531
|
|
|
@@ -460,6 +534,7 @@ Create a subscription for a customer. Commet selects the default price when pric
|
|
|
460
534
|
- `priceId` (`string`, optional) — Public price ID. When omitted, Commet selects the default price for the billing interval and still applies its market pricing.
|
|
461
535
|
- `initialSeats` (`Record<string, number>`, optional)
|
|
462
536
|
- `provider` (`"stripe" | "commet" | "dlocal" | string`, optional) — Payment provider name or exact public payment connection ID for the initial checkout. Overrides country routing when present.
|
|
537
|
+
- `paymentMethodTypes` (`Array<"card" | "oxxo" | "mercado_pago" | "google_pay" | "smartpix">`, optional) — Payment methods the initial checkout may offer. Restricts what the checkout already offers for the buyer's country, currency and payment connection; it never enables a method the connection does not have and never changes routing. When none of them is available to the buyer, the checkout shows that it cannot accept payments.
|
|
463
538
|
- `name` (`string`, optional)
|
|
464
539
|
- `startDate` (`string`, optional)
|
|
465
540
|
- `successUrl` (`string`, optional)
|
|
@@ -467,7 +542,7 @@ Create a subscription for a customer. Commet selects the default price when pric
|
|
|
467
542
|
- `cancelAtPeriodEnd` (`boolean`, optional) — Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method.
|
|
468
543
|
- `offerId` (`string`, optional)
|
|
469
544
|
- `promoCode` (`string`, optional)
|
|
470
|
-
- `customTrialDays` (`number`, optional)
|
|
545
|
+
- `customTrialDays` (`number`, optional) — Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout.
|
|
471
546
|
- `skipTrial` (`boolean`, optional)
|
|
472
547
|
- `planId` (`string`, optional)
|
|
473
548
|
- `planCode` (`string`, optional)
|
|
@@ -16,10 +16,6 @@ Check if a customer can consume a feature before actual consumption. Returns ava
|
|
|
16
16
|
- `featureCode` (`string`, required)
|
|
17
17
|
- `quantity` (`number`, optional)
|
|
18
18
|
|
|
19
|
-
### Request options
|
|
20
|
-
|
|
21
|
-
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
22
|
-
|
|
23
19
|
### Returns
|
|
24
20
|
|
|
25
21
|
`UsageCheck`
|
|
@@ -222,17 +222,18 @@ commet customers create \
|
|
|
222
222
|
--metadata '{"plan":"enterprise"}'
|
|
223
223
|
```
|
|
224
224
|
|
|
225
|
-
| Flag | Required | Description
|
|
226
|
-
| ------------------------ | -------- |
|
|
227
|
-
| `--email <email>` | Yes | Billing email
|
|
228
|
-
| `--id <id>` | No | Custom customer ID
|
|
229
|
-
| `--external-id <id>` | No | ID from your system
|
|
230
|
-
| `--full-name <name>` | No | Full name
|
|
231
|
-
| `--tax-document <value>` | No | Tax document
|
|
232
|
-
| `--timezone <tz>` | No | Timezone
|
|
233
|
-
| `--metadata <json>` | No | Metadata as JSON object
|
|
234
|
-
| `--address <json>` | No | Address as JSON: `{line1, city, postalCode, country}`
|
|
235
|
-
| `--address-id <id>` | No | Existing customer address ID
|
|
225
|
+
| Flag | Required | Description |
|
|
226
|
+
| ------------------------ | -------- | -------------------------------------------------------------- |
|
|
227
|
+
| `--email <email>` | Yes | Billing email |
|
|
228
|
+
| `--id <id>` | No | Custom customer ID |
|
|
229
|
+
| `--external-id <id>` | No | ID from your system |
|
|
230
|
+
| `--full-name <name>` | No | Full name |
|
|
231
|
+
| `--tax-document <value>` | No | Tax document |
|
|
232
|
+
| `--timezone <tz>` | No | Timezone |
|
|
233
|
+
| `--metadata <json>` | No | Metadata as JSON object |
|
|
234
|
+
| `--address <json>` | No | Address as JSON: `{line1, city, postalCode, country}` |
|
|
235
|
+
| `--address-id <id>` | No | Existing customer address ID |
|
|
236
|
+
| `--plan-group-id <id>` | No | Start the customer on the group's signup trial or default plan |
|
|
236
237
|
|
|
237
238
|
```bash
|
|
238
239
|
commet customers get --id cus_xxx # Get a customer by ID
|
|
@@ -276,9 +277,9 @@ commet subscriptions create \
|
|
|
276
277
|
| `--billing-interval <interval>` | No | `weekly`, `monthly`, `quarterly`, `semiannual`, `yearly`, `one_time` |
|
|
277
278
|
| `--price-id <id>` | No | Selectable plan price. Omit it to use the interval default and its market pricing |
|
|
278
279
|
| `--initial-seats <json>` | No | Initial seats as JSON: `{featureCode: count}` |
|
|
279
|
-
| `--skip-trial <bool>` | No |
|
|
280
|
-
| `--custom-trial-days <n>` | No |
|
|
281
|
-
| `--offer-id <id>` | No | Apply an Offer directly. Cannot be combined with `promo-code`
|
|
280
|
+
| `--skip-trial <bool>` | No | Start without the price's trial |
|
|
281
|
+
| `--custom-trial-days <n>` | No | Trial days replacing the price's trial |
|
|
282
|
+
| `--offer-id <id>` | No | Apply an Offer directly. Cannot be combined with `promo-code` |
|
|
282
283
|
| `--promo-code <code>` | No | Apply the Offer referenced by a customer-entered code |
|
|
283
284
|
| `--provider <provider>` | No | Initial checkout provider override: `stripe`, `commet`, or `dlocal` |
|
|
284
285
|
| `--name <name>` | No | Subscription name |
|
|
@@ -308,6 +309,8 @@ commet subscriptions get-active --customer-id user_123 # Get active su
|
|
|
308
309
|
commet subscriptions uncancel --id sub_xxx # Revert pending cancellation
|
|
309
310
|
commet subscriptions reactivate --id sub_xxx --offer-id ofr_xxx # Reactivate a canceled subscription with a direct Offer
|
|
310
311
|
commet subscriptions change-plan --id sub_xxx --new-plan-id pln_xxx --new-billing-interval yearly # Change plan
|
|
312
|
+
commet subscriptions change-plan --id sub_xxx --new-plan-id pln_xxx --promo-code LAUNCH50 # Change plan with a promo code
|
|
313
|
+
commet subscriptions revoke-scheduled-plan-change --id sub_xxx # Keep the current plan
|
|
311
314
|
commet subscriptions list # List all subscriptions
|
|
312
315
|
commet subscriptions list --customer-id user_123 --status active # Filter by customer/status
|
|
313
316
|
commet subscriptions preview-change --id sub_xxx --plan-id pln_xxx --billing-interval yearly # Preview proration
|
|
@@ -316,6 +319,9 @@ commet subscriptions deactivate-addon --id sub_xxx --addon-id adn_xxx
|
|
|
316
319
|
commet subscriptions adjust-balance --id sub_xxx --amount 1000 --type balance --reason "Courtesy credit"
|
|
317
320
|
commet subscriptions topup-balance --id sub_xxx --amount 5000
|
|
318
321
|
commet subscriptions purchase-credits --id sub_xxx --credit-pack-id cpk_xxx
|
|
322
|
+
commet subscriptions purchase-credits --id sub_xxx --quantity 500
|
|
323
|
+
commet subscriptions get-auto-top-up --id sub_xxx
|
|
324
|
+
commet subscriptions update-auto-top-up --id sub_xxx --enabled true --threshold 100 --quantity 500 --max-per-period 3
|
|
319
325
|
```
|
|
320
326
|
|
|
321
327
|
## Plans
|
|
@@ -339,17 +345,20 @@ commet plans create \
|
|
|
339
345
|
--block-on-exhaustion true
|
|
340
346
|
```
|
|
341
347
|
|
|
342
|
-
| Flag | Required | Description
|
|
343
|
-
| ------------------------------ | -------- |
|
|
344
|
-
| `--name <name>` | Yes | Plan name
|
|
345
|
-
| `--code <code>` | Yes | Plan code
|
|
346
|
-
| `--description <desc>` | No | Plan description
|
|
347
|
-
| `--consumption-model <model>` | No | `metered`, `credits`, or `balance`
|
|
348
|
-
| `--is-public <bool>` | No | Whether plan is publicly visible
|
|
349
|
-
| `--is-free <bool>` | No | Whether plan is free
|
|
350
|
-
| `--block-on-exhaustion <bool>` | No | Block usage when balance/credits exhausted
|
|
351
|
-
| `--plan-group-id <id>` | No | Plan group ID
|
|
352
|
-
| `--
|
|
348
|
+
| Flag | Required | Description |
|
|
349
|
+
| ------------------------------ | -------- | ---------------------------------------------------------------------------------- |
|
|
350
|
+
| `--name <name>` | Yes | Plan name |
|
|
351
|
+
| `--code <code>` | Yes | Plan code |
|
|
352
|
+
| `--description <desc>` | No | Plan description |
|
|
353
|
+
| `--consumption-model <model>` | No | `metered`, `credits`, or `balance` |
|
|
354
|
+
| `--is-public <bool>` | No | Whether plan is publicly visible |
|
|
355
|
+
| `--is-free <bool>` | No | Whether plan is free |
|
|
356
|
+
| `--block-on-exhaustion <bool>` | No | Block usage when balance/credits exhausted |
|
|
357
|
+
| `--plan-group-id <id>` | No | Plan group ID |
|
|
358
|
+
| `--is-default <bool>` | No | Make this free plan the default plan of its group |
|
|
359
|
+
| `--unused-plan-credits <json>` | No | Credits plans: `{"type":"expire"}` or `{"type":"roll_over","maxPlanCredits":5000}` |
|
|
360
|
+
| `--plan-credit-limit <json>` | No | Credits plans: `{"credits":100,"interval":"day"}` |
|
|
361
|
+
| `--metadata <json>` | No | Metadata as JSON object |
|
|
353
362
|
|
|
354
363
|
**`commet plans add-feature`**
|
|
355
364
|
|
|
@@ -404,18 +413,19 @@ commet plans add-price \
|
|
|
404
413
|
--trial-days 14
|
|
405
414
|
```
|
|
406
415
|
|
|
407
|
-
| Flag
|
|
408
|
-
|
|
|
409
|
-
| `--plan-id <id>`
|
|
410
|
-
| `--billing-interval <interval>`
|
|
411
|
-
| `--price <n>`
|
|
412
|
-
| `--inherits-from-price-id <id>`
|
|
413
|
-
| `--trial-days <n>`
|
|
414
|
-
| `--
|
|
415
|
-
| `--
|
|
416
|
-
| `--included-
|
|
417
|
-
| `--
|
|
418
|
-
| `--
|
|
416
|
+
| Flag | Required | Description |
|
|
417
|
+
| ---------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------- |
|
|
418
|
+
| `--plan-id <id>` | Yes | Plan ID |
|
|
419
|
+
| `--billing-interval <interval>` | Yes | `weekly`, `monthly`, `quarterly`, `semiannual`, `yearly`, `one_time` |
|
|
420
|
+
| `--price <n>` | One of `price` / `inherits-from-price-id` | Base price in the currency's minor unit |
|
|
421
|
+
| `--inherits-from-price-id <id>` | One of `price` / `inherits-from-price-id` | Base price inherited by a selectable variant |
|
|
422
|
+
| `--trial-days <n>` | No | Free trial days, `0` to `730` |
|
|
423
|
+
| `--trial-requires-payment-method <bool>` | No | `false` starts the trial without checkout |
|
|
424
|
+
| `--is-default <bool>` | No | Set as default price |
|
|
425
|
+
| `--included-balance <n>` | No | Included balance amount |
|
|
426
|
+
| `--included-credits <n>` | No | Included credits amount |
|
|
427
|
+
| `--market-prices <json>` | Required for a variant | Market prices as `{marketGroupId, currency, price}` objects |
|
|
428
|
+
| `--metadata <json>` | No | Price metadata |
|
|
419
429
|
|
|
420
430
|
Create a selectable variant that changes only Argentina and inherits the rest of the base price:
|
|
421
431
|
|
|
@@ -736,11 +746,11 @@ Create reusable Offers independently from plans and distribution channels.
|
|
|
736
746
|
|
|
737
747
|
```bash
|
|
738
748
|
commet offers create \
|
|
739
|
-
--name "
|
|
740
|
-
--phases '[{"type":"
|
|
749
|
+
--name "25% off for 3 cycles" \
|
|
750
|
+
--phases '[{"type":"percentage","percentage":2500,"durationCycles":3}]'
|
|
741
751
|
```
|
|
742
752
|
|
|
743
|
-
`percentage` uses basis points, so `2500` means 25%. Other phase types are `
|
|
753
|
+
`percentage` uses basis points, so `2500` means 25%. Other phase types are `amount_off` and `fixed_price`. Set trials on the plan price with `--trial-days`.
|
|
744
754
|
|
|
745
755
|
```bash
|
|
746
756
|
commet offers list --active true
|
|
@@ -749,7 +759,7 @@ commet offers update --id ofr_xxx --name "Launch offer" --phases '[{"type":"fixe
|
|
|
749
759
|
commet offers delete --id ofr_xxx
|
|
750
760
|
```
|
|
751
761
|
|
|
752
|
-
An Offer does not contain `purpose` or plan-price associations. Attach a compatible Offer to a base price in the Dashboard for automatic introductory selection, pass its ID directly as `offerId`, or reference
|
|
762
|
+
An Offer does not contain `purpose` or plan-price associations. Attach a compatible Offer to a base price in the Dashboard for automatic introductory selection, pass its ID directly as `offerId`, or reference it from a Promo Code.
|
|
753
763
|
|
|
754
764
|
## Promo Codes
|
|
755
765
|
|
|
@@ -775,14 +785,15 @@ commet promo-codes create \
|
|
|
775
785
|
--expires-at 2026-12-31
|
|
776
786
|
```
|
|
777
787
|
|
|
778
|
-
| Flag | Required | Description
|
|
779
|
-
| ------------------------------- | -------- |
|
|
780
|
-
| `--code <code>` | Yes | Promo code string
|
|
781
|
-
| `--offer-id <id>` | Yes | Offer ID
|
|
782
|
-
| `--billing-interval <interval>` | No | Restrict redemption to one billing interval
|
|
783
|
-
| `--max-redemptions <n>` | No | Maximum number of redemptions
|
|
784
|
-
| `--expires-at <date>` | No | Expiration date (ISO 8601)
|
|
785
|
-
| `--plan-ids <json>` | No | Restrict to specific plan IDs (JSON array)
|
|
788
|
+
| Flag | Required | Description |
|
|
789
|
+
| ------------------------------- | -------- | ----------------------------------------------------- |
|
|
790
|
+
| `--code <code>` | Yes | Promo code string |
|
|
791
|
+
| `--offer-id <id>` | Yes | Offer ID |
|
|
792
|
+
| `--billing-interval <interval>` | No | Restrict redemption to one billing interval |
|
|
793
|
+
| `--max-redemptions <n>` | No | Maximum number of redemptions |
|
|
794
|
+
| `--expires-at <date>` | No | Expiration date (ISO 8601) |
|
|
795
|
+
| `--plan-ids <json>` | No | Restrict to specific plan IDs (JSON array) |
|
|
796
|
+
| `--first-purchase-only <bool>` | No | Only for a customer's first purchase. Default `false` |
|
|
786
797
|
|
|
787
798
|
```bash
|
|
788
799
|
commet promo-codes list # List all promo codes
|
|
@@ -16,7 +16,7 @@ Choose the path that fits where you are working. You only need one to get starte
|
|
|
16
16
|
1. Select your **sandbox organization** in the dashboard.
|
|
17
17
|
2. Go to **Settings → API Keys** and click **Create API Key**.
|
|
18
18
|
3. Choose **Full Access** for a backend or **AI Agents** to select resource permissions.
|
|
19
|
-
4. Enter a descriptive name, such as `Local development`, and choose **Expires In (Days)**. The dashboard accepts **1–365 days** and defaults to **365**.
|
|
19
|
+
4. Enter a descriptive name of up to 32 characters, such as `Local development`, and choose **Expires In (Days)**. The dashboard accepts **1–365 days** and defaults to **365**.
|
|
20
20
|
5. Create the key and copy it before closing the dialog. The full secret is shown only once.
|
|
21
21
|
|
|
22
22
|
### CLI
|
|
@@ -117,6 +117,8 @@ Use a separate key for each application or deployment that needs independent rot
|
|
|
117
117
|
3. Verify a successful read with the replacement and confirm the application is using it.
|
|
118
118
|
4. Delete the old key from **Settings → API Keys** or through [Delete API key](/docs/api-reference/api-keys/delete-api-key).
|
|
119
119
|
|
|
120
|
+
A deleted key stops authenticating within about 5 seconds. A key's last use, **Last used** in the dashboard and `lastUsedAt` in [List API keys](/docs/api-reference/api-keys/list-api-keys), can lag up to 5 minutes.
|
|
121
|
+
|
|
120
122
|
For production, create a key in your **live organization** and store it separately from sandbox credentials. Do not copy sandbox customer, plan, or subscription IDs into live configuration. Before switching, verify checkout, webhooks, and a renewal in sandbox with the [Test Clock](/docs/testing-sandbox).
|
|
121
123
|
|
|
122
124
|
Next, follow the [quickstart](/docs/choose-a-billing-model) to complete your first subscription payment in sandbox.
|