@commet/node 9.8.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 +1021 -30
- package/dist/index.d.ts +1021 -30
- package/dist/index.js +204 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -11
- package/dist/index.mjs.map +1 -1
- package/docs/ai-onboarding/mcp-server.md +2 -0
- package/docs/api-reference/addons.md +3 -1
- package/docs/api-reference/credit-packs.md +3 -1
- package/docs/api-reference/customers.md +2 -0
- package/docs/api-reference/generated-webhooks.md +2 -2
- package/docs/api-reference/index.md +3 -3
- package/docs/api-reference/plans.md +488 -6
- package/docs/api-reference/subscriptions.md +50 -8
- package/docs/documentation/api-versioning.md +8 -2
- package/docs/documentation/cli.md +64 -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 +15 -4
- package/docs/documentation/plans/consumption-models.md +44 -9
- package/docs/documentation/plans/create-plans.md +5 -1
- package/docs/documentation/plans/credit-packs.md +61 -3
- package/docs/documentation/plans/one-time-payments.md +3 -3
- package/docs/documentation/plans/plan-groups.md +46 -10
- package/docs/documentation/plans/plan-versions.md +265 -0
- 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 +38 -8
- package/docs/documentation/sales/trial-periods.md +67 -40
- package/docs/documentation/subscriptions/manage-subscriptions.md +114 -14
- package/docs/documentation/subscriptions/pay-in-advance.md +4 -7
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +22 -2
- package/docs/documentation/testing-sandbox.md +2 -0
- package/docs/documentation/usage/track-usage.md +23 -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 +9 -2
- package/docs/errors/missing_regional_price.md +3 -3
- package/docs/errors/plan_balance_limit_reached.md +22 -0
- 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-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 +18 -11
- 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 +31 -25
- package/docs/knowledge-base/how-does-billing-work.md +26 -27
- 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-a-payment-fails.md +11 -9
- 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 +201 -2
- package/docs/platform-documentation.md +2 -0
- package/docs/schemas.md +134 -14
- package/docs/webhooks/introduction.md +17 -13
- package/docs/webhooks.md +66 -6
- package/docs/webhooks.openapi.json +1218 -876
- package/package.json +1 -1
|
@@ -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
|
|
|
@@ -260,7 +660,7 @@ Get a plan with public price IDs and their automatic introductory offer IDs.
|
|
|
260
660
|
|
|
261
661
|
`PATCH /plans/{id}` · operation `update-plan`
|
|
262
662
|
|
|
263
|
-
Update a plan's name, description, visibility, default status, metadata, what happens to its unused plan credits, or its plan credit limit.
|
|
663
|
+
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.
|
|
264
664
|
|
|
265
665
|
### Parameters
|
|
266
666
|
|
|
@@ -269,8 +669,11 @@ Update a plan's name, description, visibility, default status, metadata, what ha
|
|
|
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.
|
|
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.
|
|
274
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.
|
|
275
678
|
|
|
276
679
|
### Request options
|
|
@@ -297,6 +700,83 @@ Soft-delete a plan.
|
|
|
297
700
|
|
|
298
701
|
`DeletedObject`
|
|
299
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
|
+
|
|
300
780
|
## setVisibility
|
|
301
781
|
|
|
302
782
|
`commet.plans.setVisibility(params, options?)`
|
|
@@ -340,7 +820,7 @@ List plans with public price IDs and their automatic introductory offer IDs.
|
|
|
340
820
|
|
|
341
821
|
`POST /plans` · operation `create-plan`
|
|
342
822
|
|
|
343
|
-
Create a new plan with optional consumption model, visibility, and plan
|
|
823
|
+
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.
|
|
344
824
|
|
|
345
825
|
### Parameters
|
|
346
826
|
|
|
@@ -350,9 +830,11 @@ Create a new plan with optional consumption model, visibility, and plan group as
|
|
|
350
830
|
- `consumptionModel` (`"metered" | "credits" | "balance"`, optional)
|
|
351
831
|
- `isPublic` (`boolean`, optional)
|
|
352
832
|
- `isFree` (`boolean`, optional)
|
|
353
|
-
- `blockOnExhaustion` (`boolean`, optional)
|
|
833
|
+
- `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.
|
|
354
834
|
- `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.
|
|
355
835
|
- `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.
|
|
836
|
+
- `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.
|
|
837
|
+
- `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.
|
|
356
838
|
- `planGroupId` (`string`, optional)
|
|
357
839
|
- `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.
|
|
358
840
|
- `metadata` (`Record<string, unknown>`, optional)
|