@commet/node 9.9.0 → 9.10.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 +813 -15
- package/dist/index.d.ts +813 -15
- package/dist/index.js +199 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +199 -6
- 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/generated-webhooks.md +2 -2
- package/docs/api-reference/index.md +3 -3
- package/docs/api-reference/plans.md +483 -6
- package/docs/api-reference/subscriptions.md +43 -3
- 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/plans/add-ons.md +14 -3
- package/docs/documentation/plans/consumption-models.md +3 -3
- package/docs/documentation/plans/create-plans.md +5 -1
- package/docs/documentation/plans/credit-packs.md +19 -9
- package/docs/documentation/plans/plan-groups.md +1 -1
- package/docs/documentation/plans/plan-versions.md +265 -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/index.md +8 -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 +191 -2
- package/docs/platform-documentation.md +1 -0
- package/docs/schemas.md +107 -0
- package/docs/webhooks/introduction.md +3 -1
- package/docs/webhooks.md +24 -0
- 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
|
|
|
@@ -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) — 94 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
|
|
@@ -2,6 +2,262 @@
|
|
|
2
2
|
|
|
3
3
|
API version: `2026-08-27`
|
|
4
4
|
|
|
5
|
+
## publishDraft
|
|
6
|
+
|
|
7
|
+
`commet.plans.publishDraft(params, options?)`
|
|
8
|
+
|
|
9
|
+
`POST /plans/{id}/drafts/{draftId}/publish` · operation `publish-plan-draft`
|
|
10
|
+
|
|
11
|
+
Publish a draft as the plan's current version, as a new experiment with its own code, or as the next version of the experiment it started from. A country missing a price, or removing the signup trial of the plan's group from the current version, stops the publication. With move, subscribers of earlier versions move at their renewal or now; if any of them does not fit the new version, nothing is published and the response lists each one with what would make it fit, to send back in changes. Paused subscribers stay where they are. Send preview to check without publishing.
|
|
12
|
+
|
|
13
|
+
### Parameters
|
|
14
|
+
|
|
15
|
+
- `id` (`string`, required)
|
|
16
|
+
- `draftId` (`string`, required)
|
|
17
|
+
- `publishAs` (`"current" | "experiment" | "experiment_version"`, required) — current sells the draft to every new buyer.
|
|
18
|
+
- `move` (`"keep" | "period_end" | "now"`, optional) — What happens to subscribers of earlier versions: keep them, move them at their next renewal, or move them now (features and balance change today, the price at renewal). Nobody moves unless every one of them fits or has a change below.
|
|
19
|
+
- `changes` (`Array<{ subscriptionId: string; keepOnVersion?: true; billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly"; seatLimit?: true; removeAddonIds?: Array<string> }>`, optional) — Per-subscriber changes that make each one fit, applied at its renewal.
|
|
20
|
+
- `preview` (`boolean`, optional) — Check everything without publishing.
|
|
21
|
+
- `experimentCode` (`string`, optional) — The experiment's own code, after the plan's code.
|
|
22
|
+
|
|
23
|
+
### Valid parameter combinations
|
|
24
|
+
|
|
25
|
+
- `publishAs`
|
|
26
|
+
- `publishAs` + `experimentCode`
|
|
27
|
+
- `publishAs`
|
|
28
|
+
|
|
29
|
+
### Request options
|
|
30
|
+
|
|
31
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
32
|
+
|
|
33
|
+
### Returns
|
|
34
|
+
|
|
35
|
+
`PlanDraftPublication`
|
|
36
|
+
|
|
37
|
+
## getDraft
|
|
38
|
+
|
|
39
|
+
`commet.plans.getDraft(params)`
|
|
40
|
+
|
|
41
|
+
`GET /plans/{id}/drafts/{draftId}` · operation `get-plan-draft`
|
|
42
|
+
|
|
43
|
+
Retrieve a draft with the version it started from and what it changes.
|
|
44
|
+
|
|
45
|
+
### Parameters
|
|
46
|
+
|
|
47
|
+
- `id` (`string`, required)
|
|
48
|
+
- `draftId` (`string`, required)
|
|
49
|
+
|
|
50
|
+
### Returns
|
|
51
|
+
|
|
52
|
+
`PlanDraft`
|
|
53
|
+
|
|
54
|
+
## updateDraft
|
|
55
|
+
|
|
56
|
+
`commet.plans.updateDraft(params, options?)`
|
|
57
|
+
|
|
58
|
+
`PATCH /plans/{id}/drafts/{draftId}` · operation `update-plan-draft`
|
|
59
|
+
|
|
60
|
+
Change a draft's prices per interval, trials, the interval shown first, countries with their currency and prices, and credit or balance rules, or undo single changes. Each block sent replaces that block; blocks left out stay as they are. Buyers and subscribers see nothing until the draft is published.
|
|
61
|
+
|
|
62
|
+
### Parameters
|
|
63
|
+
|
|
64
|
+
- `id` (`string`, required)
|
|
65
|
+
- `draftId` (`string`, required)
|
|
66
|
+
- `prices` (`Array<{ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time"; price: number; includedCredits?: number | null; includedBalance?: number | null; trialDays?: number | null; trialRequiresPaymentMethod?: boolean; isDefault?: boolean }>`, optional) — Every interval the draft sells. An interval the draft sold and this list leaves out is removed from the draft.
|
|
67
|
+
- `countries` (`Array<{ country: string; currency: string; exchangeRate?: number | null; prices: Array<{ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time"; price: number; includedBalance?: number } | { billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time"; followBase: true }>; topUpMinimum?: number | null; maxPlanBalance?: number | null; planBalanceLimit?: number | null; addonPrices?: Array<{ addonId: string; price: number } | { addonId: string; followBase: true }>; creditPackPrices?: Array<{ creditPackId: string; price: number } | { creditPackId: string; followBase: true }> }>`, optional) — Every country with its own currency or prices. A country the draft sold and this list leaves out is removed. A country missing a price blocks publishing.
|
|
68
|
+
- `rules` (`{ freeIncludedCredits?: number | null; freeIncludedBalance?: number | null; unusedPlanCredits?: "expire" | "roll_over"; maxPlanCredits?: number | null; planCreditLimit?: number | null; planCreditLimitInterval?: "day" | "week" | null; unusedPlanBalance?: "expire" | "roll_over"; maxPlanBalance?: number | null; planBalanceLimit?: number | null; planBalanceLimitInterval?: "day" | "week" | null; blockOnExhaustion?: boolean; purchasesEnabled?: boolean; creditPurchaseUnitPrice?: number | null; creditPurchaseMinimum?: number | null; topUpMinimum?: number | null }`, optional) — Credit or balance rules; fields left out stay as they are.
|
|
69
|
+
- `undo` (`Array<string>`, optional) — Change keys to put back as the version the draft started from had them.
|
|
70
|
+
|
|
71
|
+
### Request options
|
|
72
|
+
|
|
73
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
74
|
+
|
|
75
|
+
### Returns
|
|
76
|
+
|
|
77
|
+
`PlanDraft`
|
|
78
|
+
|
|
79
|
+
## deleteDraft
|
|
80
|
+
|
|
81
|
+
`commet.plans.deleteDraft(params, options?)`
|
|
82
|
+
|
|
83
|
+
`DELETE /plans/{id}/drafts/{draftId}` · operation `delete-plan-draft`
|
|
84
|
+
|
|
85
|
+
Discard a draft. Nothing it changed was ever sold.
|
|
86
|
+
|
|
87
|
+
### Parameters
|
|
88
|
+
|
|
89
|
+
- `id` (`string`, required)
|
|
90
|
+
- `draftId` (`string`, required)
|
|
91
|
+
|
|
92
|
+
### Returns
|
|
93
|
+
|
|
94
|
+
`DeletedObject`
|
|
95
|
+
|
|
96
|
+
## listDrafts
|
|
97
|
+
|
|
98
|
+
`commet.plans.listDrafts(params)`
|
|
99
|
+
|
|
100
|
+
`GET /plans/{id}/drafts` · operation `list-plan-drafts`
|
|
101
|
+
|
|
102
|
+
List the plan's open drafts, oldest first, each with the version it started from and what it changes. Drafts sell nothing until published.
|
|
103
|
+
|
|
104
|
+
### Parameters
|
|
105
|
+
|
|
106
|
+
- `id` (`string`, required)
|
|
107
|
+
|
|
108
|
+
### Returns
|
|
109
|
+
|
|
110
|
+
`{ object: "list"; data: Array<PlanDraft>; hasMore: boolean; nextCursor?: string }`
|
|
111
|
+
|
|
112
|
+
## createDraft
|
|
113
|
+
|
|
114
|
+
`commet.plans.createDraft(params, options?)`
|
|
115
|
+
|
|
116
|
+
`POST /plans/{id}/drafts` · operation `create-plan-draft`
|
|
117
|
+
|
|
118
|
+
Start a draft from a version of the plan: the current one, an experiment's version or an older one. A plan can have any number of drafts. Edit it, then publish it as the current version, as an experiment or as an experiment's next version; nothing changes for buyers or subscribers until then.
|
|
119
|
+
|
|
120
|
+
### Parameters
|
|
121
|
+
|
|
122
|
+
- `id` (`string`, required)
|
|
123
|
+
- `fromVersionId` (`string`, optional) — The version to start from: the current version, an experiment's version or an older version. Defaults to the current version.
|
|
124
|
+
|
|
125
|
+
### Request options
|
|
126
|
+
|
|
127
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
128
|
+
|
|
129
|
+
### Returns
|
|
130
|
+
|
|
131
|
+
`PlanDraft`
|
|
132
|
+
|
|
133
|
+
## archiveExperiment
|
|
134
|
+
|
|
135
|
+
`commet.plans.archiveExperiment(params, options?)`
|
|
136
|
+
|
|
137
|
+
`POST /plans/{id}/experiments/{code}/archive` · operation `archive-plan-experiment`
|
|
138
|
+
|
|
139
|
+
Stop selling the experiment. Its code sells the plan's current version from then on, so links already shared keep working. Choose what happens to its subscribers: keep them on its versions, or move them to the current version at their renewal or now. If any of them does not fit, nothing changes and the response lists each one with what would make it fit, to send back in changes.
|
|
140
|
+
|
|
141
|
+
### Parameters
|
|
142
|
+
|
|
143
|
+
- `id` (`string`, required)
|
|
144
|
+
- `code` (`string`, required)
|
|
145
|
+
- `subscribers` (`"keep" | "period_end" | "now"`, optional) — What happens to the experiment's subscribers: keep them on its versions, move them to the plan's current version at their next renewal, or move them now. Nobody moves, and the experiment keeps running, unless every one of them fits or has a change.
|
|
146
|
+
- `changes` (`Array<{ subscriptionId: string; keepOnVersion?: true; billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly"; seatLimit?: true; removeAddonIds?: Array<string> }>`, optional) — Per-subscriber changes that make each one fit, applied at its renewal.
|
|
147
|
+
- `preview` (`boolean`, optional) — Check the archive and the move without changing anything.
|
|
148
|
+
|
|
149
|
+
### Request options
|
|
150
|
+
|
|
151
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
152
|
+
|
|
153
|
+
### Returns
|
|
154
|
+
|
|
155
|
+
`PlanExperimentArchive`
|
|
156
|
+
|
|
157
|
+
## makeExperimentCurrent
|
|
158
|
+
|
|
159
|
+
`commet.plans.makeExperimentCurrent(params, options?)`
|
|
160
|
+
|
|
161
|
+
`POST /plans/{id}/experiments/{code}/make-current` · operation `make-plan-experiment-current`
|
|
162
|
+
|
|
163
|
+
Make the experiment's latest version the plan's current version, with exactly its content and the next version number. New buyers get it; its subscribers are already on it. The experiment closes, and its code sells the plan's current version from then on. Nobody else moves.
|
|
164
|
+
|
|
165
|
+
### Parameters
|
|
166
|
+
|
|
167
|
+
- `id` (`string`, required)
|
|
168
|
+
- `code` (`string`, required)
|
|
169
|
+
|
|
170
|
+
### Request options
|
|
171
|
+
|
|
172
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
173
|
+
|
|
174
|
+
### Returns
|
|
175
|
+
|
|
176
|
+
`PlanVersion`
|
|
177
|
+
|
|
178
|
+
## getExperiment
|
|
179
|
+
|
|
180
|
+
`commet.plans.getExperiment(params)`
|
|
181
|
+
|
|
182
|
+
`GET /plans/{id}/experiments/{code}` · operation `get-plan-experiment`
|
|
183
|
+
|
|
184
|
+
Get one experiment of a plan by its own code, with the version it sells and how many subscriptions are on it.
|
|
185
|
+
|
|
186
|
+
### Parameters
|
|
187
|
+
|
|
188
|
+
- `id` (`string`, required)
|
|
189
|
+
- `code` (`string`, required)
|
|
190
|
+
|
|
191
|
+
### Returns
|
|
192
|
+
|
|
193
|
+
`PlanExperiment`
|
|
194
|
+
|
|
195
|
+
## createExperimentVersion
|
|
196
|
+
|
|
197
|
+
`commet.plans.createExperimentVersion(params, options?)`
|
|
198
|
+
|
|
199
|
+
`POST /plans/{id}/experiments/{code}/versions` · operation `create-plan-experiment-version`
|
|
200
|
+
|
|
201
|
+
Publish the experiment's next version from its latest version with the changes given. Its code sells the new version from now on; subscribers on its earlier versions stay where they are until moved.
|
|
202
|
+
|
|
203
|
+
### Parameters
|
|
204
|
+
|
|
205
|
+
- `id` (`string`, required)
|
|
206
|
+
- `code` (`string`, required)
|
|
207
|
+
- `prices` (`Array<{ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time"; price: number; includedCredits?: number | null; includedBalance?: number | null; regionalPrices?: Array<{ currency: string; price: number; includedBalance?: number | null }> }>`, optional)
|
|
208
|
+
- `currencies` (`Array<{ currency: string; exchangeRate: number }>`, optional) — Currencies the current version does not sell, with the exchange rate (local units per USD) used for the amounts not listed, credit purchases, add-ons and overage.
|
|
209
|
+
- `maxPlanCredits` (`number | null`, optional) — Credits plans that roll over unused credits: the most plan credits a subscription can hold. Null removes the cap.
|
|
210
|
+
- `maxPlanBalance` (`number | null`, optional) — Balance plans that roll over unused balance: the most plan balance a subscription can hold, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. Null removes the cap.
|
|
211
|
+
|
|
212
|
+
### Request options
|
|
213
|
+
|
|
214
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
215
|
+
|
|
216
|
+
### Returns
|
|
217
|
+
|
|
218
|
+
`PlanVersion`
|
|
219
|
+
|
|
220
|
+
## listExperiments
|
|
221
|
+
|
|
222
|
+
`commet.plans.listExperiments(params)`
|
|
223
|
+
|
|
224
|
+
`GET /plans/{id}/experiments` · operation `list-plan-experiments`
|
|
225
|
+
|
|
226
|
+
List a plan's experiments, newest first, with the version each one sells and how many subscriptions are on them.
|
|
227
|
+
|
|
228
|
+
### Parameters
|
|
229
|
+
|
|
230
|
+
- `id` (`string`, required)
|
|
231
|
+
|
|
232
|
+
### Returns
|
|
233
|
+
|
|
234
|
+
`{ object: "list"; data: Array<PlanExperiment>; hasMore: boolean; nextCursor?: string }`
|
|
235
|
+
|
|
236
|
+
## createExperiment
|
|
237
|
+
|
|
238
|
+
`commet.plans.createExperiment(params, options?)`
|
|
239
|
+
|
|
240
|
+
`POST /plans/{id}/experiments` · operation `create-plan-experiment`
|
|
241
|
+
|
|
242
|
+
Start an experiment from the plan's current version with the changes given. It is sold only through its code (planCode `<plan code>:<code>`); new buyers of the plan keep getting the current version.
|
|
243
|
+
|
|
244
|
+
### Parameters
|
|
245
|
+
|
|
246
|
+
- `id` (`string`, required)
|
|
247
|
+
- `prices` (`Array<{ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time"; price: number; includedCredits?: number | null; includedBalance?: number | null; regionalPrices?: Array<{ currency: string; price: number; includedBalance?: number | null }> }>`, optional)
|
|
248
|
+
- `currencies` (`Array<{ currency: string; exchangeRate: number }>`, optional) — Currencies the current version does not sell, with the exchange rate (local units per USD) used for the amounts not listed, credit purchases, add-ons and overage.
|
|
249
|
+
- `maxPlanCredits` (`number | null`, optional) — Credits plans that roll over unused credits: the most plan credits a subscription can hold. Null removes the cap.
|
|
250
|
+
- `maxPlanBalance` (`number | null`, optional) — Balance plans that roll over unused balance: the most plan balance a subscription can hold, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. Null removes the cap.
|
|
251
|
+
- `code` (`string`, required) — The experiment's own code: lowercase letters, numbers, hyphens and underscores. It is sold as planCode `<plan code>:<code>` and is never reused in the plan.
|
|
252
|
+
|
|
253
|
+
### Request options
|
|
254
|
+
|
|
255
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
256
|
+
|
|
257
|
+
### Returns
|
|
258
|
+
|
|
259
|
+
`PlanExperiment`
|
|
260
|
+
|
|
5
261
|
## updateFeature
|
|
6
262
|
|
|
7
263
|
`commet.plans.updateFeature(params, options?)`
|
|
@@ -73,6 +329,150 @@ Attach a feature to a plan with limits, overage, and credits configuration.
|
|
|
73
329
|
|
|
74
330
|
`PlanFeature`
|
|
75
331
|
|
|
332
|
+
## cancelMove
|
|
333
|
+
|
|
334
|
+
`commet.plans.cancelMove(params, options?)`
|
|
335
|
+
|
|
336
|
+
`POST /plans/{id}/moves/{moveId}/cancel` · operation `cancel-plan-move`
|
|
337
|
+
|
|
338
|
+
Cancel a move for every subscriber who has not moved yet. They stay on their version; those already moved stay moved.
|
|
339
|
+
|
|
340
|
+
### Parameters
|
|
341
|
+
|
|
342
|
+
- `id` (`string`, required)
|
|
343
|
+
- `moveId` (`string`, required)
|
|
344
|
+
|
|
345
|
+
### Request options
|
|
346
|
+
|
|
347
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
348
|
+
|
|
349
|
+
### Returns
|
|
350
|
+
|
|
351
|
+
`PlanMove`
|
|
352
|
+
|
|
353
|
+
## getMove
|
|
354
|
+
|
|
355
|
+
`commet.plans.getMove(params)`
|
|
356
|
+
|
|
357
|
+
`GET /plans/{id}/moves/{moveId}` · operation `get-plan-move`
|
|
358
|
+
|
|
359
|
+
Read a move of subscribers between plan versions with each subscriber's status: moving, moved, needs a change, left out, canceled or kept on its version.
|
|
360
|
+
|
|
361
|
+
### Parameters
|
|
362
|
+
|
|
363
|
+
- `id` (`string`, required)
|
|
364
|
+
- `moveId` (`string`, required)
|
|
365
|
+
|
|
366
|
+
### Returns
|
|
367
|
+
|
|
368
|
+
`PlanMove`
|
|
369
|
+
|
|
370
|
+
## cancelMoveSubscription
|
|
371
|
+
|
|
372
|
+
`commet.plans.cancelMoveSubscription(params, options?)`
|
|
373
|
+
|
|
374
|
+
`POST /plans/{id}/moves/{moveId}/subscriptions/{subscriptionId}/cancel` · operation `cancel-plan-move-subscription`
|
|
375
|
+
|
|
376
|
+
Cancel a move for one subscriber who has not moved yet. It stays on its version; the rest of the move continues.
|
|
377
|
+
|
|
378
|
+
### Parameters
|
|
379
|
+
|
|
380
|
+
- `id` (`string`, required)
|
|
381
|
+
- `moveId` (`string`, required)
|
|
382
|
+
- `subscriptionId` (`string`, required)
|
|
383
|
+
|
|
384
|
+
### Request options
|
|
385
|
+
|
|
386
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
387
|
+
|
|
388
|
+
### Returns
|
|
389
|
+
|
|
390
|
+
`PlanMove`
|
|
391
|
+
|
|
392
|
+
## listMoves
|
|
393
|
+
|
|
394
|
+
`commet.plans.listMoves(params)`
|
|
395
|
+
|
|
396
|
+
`GET /plans/{id}/moves` · operation `list-plan-moves`
|
|
397
|
+
|
|
398
|
+
List a plan's latest moves of subscribers between versions, newest first, including the change of a single subscription, with how many are moving, moved, need a change, were left out, canceled or kept on their version.
|
|
399
|
+
|
|
400
|
+
### Parameters
|
|
401
|
+
|
|
402
|
+
- `id` (`string`, required)
|
|
403
|
+
|
|
404
|
+
### Returns
|
|
405
|
+
|
|
406
|
+
`{ object: "list"; data: Array<PlanMove>; hasMore: boolean; nextCursor?: string }`
|
|
407
|
+
|
|
408
|
+
## createMove
|
|
409
|
+
|
|
410
|
+
`commet.plans.createMove(params, options?)`
|
|
411
|
+
|
|
412
|
+
`POST /plans/{id}/moves` · operation `create-plan-move`
|
|
413
|
+
|
|
414
|
+
Move a list of subscriptions, or every subscription of another version, to a newer version of the plan, at their next renewal or now. Nobody moves unless every one of them fits or has a change in changes; otherwise the response lists each one with what would make it fit. Only active, trialing and past due subscriptions move. Paused ones, and listed subscriptions in another status or already on the destination, are left out. Send preview to check without moving anyone.
|
|
415
|
+
|
|
416
|
+
### Parameters
|
|
417
|
+
|
|
418
|
+
- `id` (`string`, required)
|
|
419
|
+
- `subscriptionIds` (`Array<string>`, optional) — Public IDs of the subscriptions to move.
|
|
420
|
+
- `toVersionId` (`string`, required) — The version subscribers move to.
|
|
421
|
+
- `effective` (`"now" | "period_end"`, required) — now changes features and the included amount today and the price at renewal; period_end moves each subscriber at its next renewal.
|
|
422
|
+
- `changes` (`Array<{ subscriptionId: string; keepOnVersion?: true; billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly"; seatLimit?: true; removeAddonIds?: Array<string> }>`, optional) — Per-subscriber changes that make each one fit, applied at its renewal.
|
|
423
|
+
- `preview` (`boolean`, optional) — Check every subscriber without moving anyone.
|
|
424
|
+
- `fromVersionId` (`string`, optional) — Move every active, trialing and past due subscription on this version of the plan.
|
|
425
|
+
|
|
426
|
+
### Valid parameter combinations
|
|
427
|
+
|
|
428
|
+
- `subscriptionIds` + `toVersionId` + `effective`
|
|
429
|
+
- `fromVersionId` + `toVersionId` + `effective`
|
|
430
|
+
|
|
431
|
+
### Request options
|
|
432
|
+
|
|
433
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
434
|
+
|
|
435
|
+
### Returns
|
|
436
|
+
|
|
437
|
+
`PlanMove`
|
|
438
|
+
|
|
439
|
+
## keepSubscriberOnVersion
|
|
440
|
+
|
|
441
|
+
`commet.plans.keepSubscriberOnVersion(params, options?)`
|
|
442
|
+
|
|
443
|
+
`POST /plans/{id}/needs-a-change/{subscriptionId}/keep` · operation `keep-plan-subscriber-on-version`
|
|
444
|
+
|
|
445
|
+
Leave a subscriber that needs a change on its version. It stops appearing among the subscribers that need a change; move it later like any other subscriber.
|
|
446
|
+
|
|
447
|
+
### Parameters
|
|
448
|
+
|
|
449
|
+
- `id` (`string`, required)
|
|
450
|
+
- `subscriptionId` (`string`, required)
|
|
451
|
+
|
|
452
|
+
### Request options
|
|
453
|
+
|
|
454
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
455
|
+
|
|
456
|
+
### Returns
|
|
457
|
+
|
|
458
|
+
`KeptOnVersion`
|
|
459
|
+
|
|
460
|
+
## listSubscribersNeedingAChange
|
|
461
|
+
|
|
462
|
+
`commet.plans.listSubscribersNeedingAChange(params)`
|
|
463
|
+
|
|
464
|
+
`GET /plans/{id}/needs-a-change` · operation `list-plan-subscribers-needing-a-change`
|
|
465
|
+
|
|
466
|
+
List the plan's subscribers whose move could not complete, with the version they stay on, the one they could not move to and why. Move them again with a change, or keep them on their version so they leave this list.
|
|
467
|
+
|
|
468
|
+
### Parameters
|
|
469
|
+
|
|
470
|
+
- `id` (`string`, required)
|
|
471
|
+
|
|
472
|
+
### Returns
|
|
473
|
+
|
|
474
|
+
`{ object: "list"; data: Array<SubscriberNeedingAChange>; hasMore: boolean; nextCursor?: string }`
|
|
475
|
+
|
|
76
476
|
## setDefaultPrice
|
|
77
477
|
|
|
78
478
|
`commet.plans.setDefaultPrice(params, options?)`
|
|
@@ -168,7 +568,7 @@ Update a base price or market price variant. Removing a base market override is
|
|
|
168
568
|
|
|
169
569
|
`DELETE /plans/{id}/prices/{priceId}` · operation `delete-plan-price`
|
|
170
570
|
|
|
171
|
-
Archive a price for new subscriptions.
|
|
571
|
+
Archive a price for new subscriptions. This publishes a new version of the plan; existing subscriptions that selected the price keep paying it on their version until moved.
|
|
172
572
|
|
|
173
573
|
### Parameters
|
|
174
574
|
|
|
@@ -269,11 +669,11 @@ Update a plan's name, description, visibility, default status, metadata, overage
|
|
|
269
669
|
- `description` (`string | null`, optional)
|
|
270
670
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
271
671
|
- `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.
|
|
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.
|
|
274
|
-
- `unusedPlanBalance` (`{ type: "expire" } | { type: "roll_over"; maxPlanBalance: number | null }`, optional) — Balance plans only. What happens to unused plan balance at each 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.
|
|
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.
|
|
672
|
+
- `unusedPlanCredits` (`{ type: "expire" } | { type: "roll_over"; maxPlanCredits: number | null }`, optional) — Credits plans only. What happens to unused plan credits at each reset. Changing it publishes a new version of the plan; each subscription stays on its version until moved.
|
|
673
|
+
- `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. Changing it publishes a new version of the plan; each subscription stays on its version until moved.
|
|
674
|
+
- `unusedPlanBalance` (`{ type: "expire" } | { type: "roll_over"; maxPlanBalance: number | null }`, optional) — Balance plans only. What happens to unused plan balance at each reset. Changing it publishes a new version of the plan; each subscription stays on its version until moved.
|
|
675
|
+
- `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. Changing it publishes a new version of the plan; each subscription stays on its version until moved.
|
|
676
|
+
- `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. Changing it publishes a new version of the plan; each subscription stays on its version until moved.
|
|
277
677
|
- `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.
|
|
278
678
|
|
|
279
679
|
### Request options
|
|
@@ -300,6 +700,83 @@ Soft-delete a plan.
|
|
|
300
700
|
|
|
301
701
|
`DeletedObject`
|
|
302
702
|
|
|
703
|
+
## compareVersions
|
|
704
|
+
|
|
705
|
+
`commet.plans.compareVersions(params)`
|
|
706
|
+
|
|
707
|
+
`GET /plans/{id}/versions/{versionId}/changes` · operation `compare-plan-versions`
|
|
708
|
+
|
|
709
|
+
List what changes from one version of a plan to another: prices, trials, features, rules, add-ons, credit packs and countries.
|
|
710
|
+
|
|
711
|
+
### Parameters
|
|
712
|
+
|
|
713
|
+
- `id` (`string`, required)
|
|
714
|
+
- `versionId` (`string`, required)
|
|
715
|
+
- `against` (`string`, required)
|
|
716
|
+
|
|
717
|
+
### Returns
|
|
718
|
+
|
|
719
|
+
`PlanVersionComparison`
|
|
720
|
+
|
|
721
|
+
## getVersion
|
|
722
|
+
|
|
723
|
+
`commet.plans.getVersion(params)`
|
|
724
|
+
|
|
725
|
+
`GET /plans/{id}/versions/{versionId}` · operation `get-plan-version`
|
|
726
|
+
|
|
727
|
+
Get one published version of a plan with its prices and how many subscriptions are on it.
|
|
728
|
+
|
|
729
|
+
### Parameters
|
|
730
|
+
|
|
731
|
+
- `id` (`string`, required)
|
|
732
|
+
- `versionId` (`string`, required)
|
|
733
|
+
|
|
734
|
+
### Returns
|
|
735
|
+
|
|
736
|
+
`PlanVersion`
|
|
737
|
+
|
|
738
|
+
## listVersions
|
|
739
|
+
|
|
740
|
+
`commet.plans.listVersions(params)`
|
|
741
|
+
|
|
742
|
+
`GET /plans/{id}/versions` · operation `list-plan-versions`
|
|
743
|
+
|
|
744
|
+
List a plan's published versions, newest first, with their prices and how many subscriptions are on each. Versions published before Commet recorded every term are not listed.
|
|
745
|
+
|
|
746
|
+
### Parameters
|
|
747
|
+
|
|
748
|
+
- `id` (`string`, required)
|
|
749
|
+
- `cursor` (`string`, optional)
|
|
750
|
+
- `limit` (`number`, optional)
|
|
751
|
+
|
|
752
|
+
### Returns
|
|
753
|
+
|
|
754
|
+
`{ object: "list"; data: Array<PlanVersion>; hasMore: boolean; nextCursor?: string }`
|
|
755
|
+
|
|
756
|
+
## createVersion
|
|
757
|
+
|
|
758
|
+
`commet.plans.createVersion(params, options?)`
|
|
759
|
+
|
|
760
|
+
`POST /plans/{id}/versions` · operation `create-plan-version`
|
|
761
|
+
|
|
762
|
+
Publish a new current version of the plan from its current version, changing prices per interval, included credits or balance, per-currency amounts and the rollover cap. New buyers get it; every subscriber stays on its version until moved. To try changes without selling them to everyone, create an experiment instead.
|
|
763
|
+
|
|
764
|
+
### Parameters
|
|
765
|
+
|
|
766
|
+
- `id` (`string`, required)
|
|
767
|
+
- `prices` (`Array<{ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time"; price: number; includedCredits?: number | null; includedBalance?: number | null; regionalPrices?: Array<{ currency: string; price: number; includedBalance?: number | null }> }>`, optional)
|
|
768
|
+
- `currencies` (`Array<{ currency: string; exchangeRate: number }>`, optional) — Currencies the current version does not sell, with the exchange rate (local units per USD) used for the amounts not listed, credit purchases, add-ons and overage.
|
|
769
|
+
- `maxPlanCredits` (`number | null`, optional) — Credits plans that roll over unused credits: the most plan credits a subscription can hold. Null removes the cap.
|
|
770
|
+
- `maxPlanBalance` (`number | null`, optional) — Balance plans that roll over unused balance: the most plan balance a subscription can hold, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. Null removes the cap.
|
|
771
|
+
|
|
772
|
+
### Request options
|
|
773
|
+
|
|
774
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
775
|
+
|
|
776
|
+
### Returns
|
|
777
|
+
|
|
778
|
+
`PlanVersion`
|
|
779
|
+
|
|
303
780
|
## setVisibility
|
|
304
781
|
|
|
305
782
|
`commet.plans.setVisibility(params, options?)`
|