@commet/node 9.9.0 → 9.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/index.d.mts +932 -59
  2. package/dist/index.d.ts +932 -59
  3. package/dist/index.js +209 -13
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +209 -13
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/ai-onboarding/mcp-server.md +2 -0
  8. package/docs/api-reference/addons.md +3 -1
  9. package/docs/api-reference/credit-packs.md +3 -1
  10. package/docs/api-reference/customers.md +3 -3
  11. package/docs/api-reference/generated-webhooks.md +2 -2
  12. package/docs/api-reference/index.md +3 -3
  13. package/docs/api-reference/invoices.md +4 -3
  14. package/docs/api-reference/plans.md +487 -6
  15. package/docs/api-reference/subscriptions.md +45 -4
  16. package/docs/api-reference/transactions.md +2 -1
  17. package/docs/documentation/api-versioning.md +8 -2
  18. package/docs/documentation/cli.md +4 -0
  19. package/docs/documentation/customers/customer-portal.md +2 -2
  20. package/docs/documentation/invoicing/manage-invoices.md +1 -1
  21. package/docs/documentation/plans/add-ons.md +16 -5
  22. package/docs/documentation/plans/balance-and-top-ups.md +1 -1
  23. package/docs/documentation/plans/consumption-models.md +23 -3
  24. package/docs/documentation/plans/create-plans.md +5 -1
  25. package/docs/documentation/plans/credit-packs.md +22 -10
  26. package/docs/documentation/plans/plan-groups.md +1 -1
  27. package/docs/documentation/plans/plan-versions.md +267 -0
  28. package/docs/documentation/sales/regional-prices.md +23 -9
  29. package/docs/documentation/sales/trial-periods.md +3 -3
  30. package/docs/documentation/subscriptions/manage-subscriptions.md +50 -13
  31. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +2 -0
  32. package/docs/errors/addon_has_activations.md +2 -2
  33. package/docs/errors/addon_unavailable.md +22 -0
  34. package/docs/errors/credit_pack_unavailable.md +22 -0
  35. package/docs/errors/currency_held_by_balance_plan.md +22 -0
  36. package/docs/errors/currency_held_by_customer_credit.md +22 -0
  37. package/docs/errors/currency_held_by_fixed_amount_discount.md +22 -0
  38. package/docs/errors/currency_held_by_payment_method.md +22 -0
  39. package/docs/errors/currency_held_by_prepaid_period.md +22 -0
  40. package/docs/errors/currency_held_by_scheduled_pause.md +22 -0
  41. package/docs/errors/index.md +14 -2
  42. package/docs/errors/missing_regional_price.md +3 -3
  43. package/docs/errors/plan_experiment_not_found.md +22 -0
  44. package/docs/errors/plan_version_not_found.md +22 -0
  45. package/docs/errors/subscribers_do_not_fit.md +22 -0
  46. package/docs/errors/version_not_newer.md +22 -0
  47. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +4 -3
  48. package/docs/knowledge-base/how-do-trial-periods-work.md +3 -3
  49. package/docs/knowledge-base/how-does-billing-work.md +26 -28
  50. package/docs/knowledge-base/how-does-quota-based-billing-work.md +12 -22
  51. package/docs/knowledge-base/how-does-seat-based-billing-work.md +12 -22
  52. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +11 -8
  53. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +34 -29
  54. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -1
  55. package/docs/manifest.json +227 -2
  56. package/docs/platform-documentation.md +1 -0
  57. package/docs/schemas.md +128 -13
  58. package/docs/webhooks/introduction.md +3 -1
  59. package/docs/webhooks.md +27 -2
  60. package/docs/webhooks.openapi.json +231 -1
  61. 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>; currency?: 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; unlimitedPlanCredits?: boolean; planCreditLimit?: number | null; planCreditLimitInterval?: "day" | "week" | null; unusedPlanBalance?: "expire" | "roll_over"; maxPlanBalance?: number | null; unlimitedPlanBalance?: boolean; 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>; currency?: 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>; currency?: 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. Existing subscriptions that selected it continue using its current catalog value.
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,13 @@ 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. 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.
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
+ - `unlimitedPlanCredits` (`boolean`, optional) — Credits plans only. true makes the plan credits unlimited: usage never spends them, only planCreditLimit caps it, and every price includes 0 credits. Changing it publishes a new version of the plan; each subscription stays on its version until moved.
674
+ - `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.
675
+ - `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.
676
+ - `unlimitedPlanBalance` (`boolean`, optional) — Balance plans only. true makes the plan balance unlimited: usage never spends it, only planBalanceLimit caps it, and every price and country includes no balance. Changing it publishes a new version of the plan; each subscription stays on its version until moved.
677
+ - `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.
678
+ - `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
679
  - `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
680
 
279
681
  ### Request options
@@ -300,6 +702,83 @@ Soft-delete a plan.
300
702
 
301
703
  `DeletedObject`
302
704
 
705
+ ## compareVersions
706
+
707
+ `commet.plans.compareVersions(params)`
708
+
709
+ `GET /plans/{id}/versions/{versionId}/changes` · operation `compare-plan-versions`
710
+
711
+ List what changes from one version of a plan to another: prices, trials, features, rules, add-ons, credit packs and countries.
712
+
713
+ ### Parameters
714
+
715
+ - `id` (`string`, required)
716
+ - `versionId` (`string`, required)
717
+ - `against` (`string`, required)
718
+
719
+ ### Returns
720
+
721
+ `PlanVersionComparison`
722
+
723
+ ## getVersion
724
+
725
+ `commet.plans.getVersion(params)`
726
+
727
+ `GET /plans/{id}/versions/{versionId}` · operation `get-plan-version`
728
+
729
+ Get one published version of a plan with its prices and how many subscriptions are on it.
730
+
731
+ ### Parameters
732
+
733
+ - `id` (`string`, required)
734
+ - `versionId` (`string`, required)
735
+
736
+ ### Returns
737
+
738
+ `PlanVersion`
739
+
740
+ ## listVersions
741
+
742
+ `commet.plans.listVersions(params)`
743
+
744
+ `GET /plans/{id}/versions` · operation `list-plan-versions`
745
+
746
+ 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.
747
+
748
+ ### Parameters
749
+
750
+ - `id` (`string`, required)
751
+ - `cursor` (`string`, optional)
752
+ - `limit` (`number`, optional)
753
+
754
+ ### Returns
755
+
756
+ `{ object: "list"; data: Array<PlanVersion>; hasMore: boolean; nextCursor?: string }`
757
+
758
+ ## createVersion
759
+
760
+ `commet.plans.createVersion(params, options?)`
761
+
762
+ `POST /plans/{id}/versions` · operation `create-plan-version`
763
+
764
+ 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.
765
+
766
+ ### Parameters
767
+
768
+ - `id` (`string`, required)
769
+ - `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)
770
+ - `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.
771
+ - `maxPlanCredits` (`number | null`, optional) — Credits plans that roll over unused credits: the most plan credits a subscription can hold. Null removes the cap.
772
+ - `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.
773
+
774
+ ### Request options
775
+
776
+ - `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
777
+
778
+ ### Returns
779
+
780
+ `PlanVersion`
781
+
303
782
  ## setVisibility
304
783
 
305
784
  `commet.plans.setVisibility(params, options?)`
@@ -355,8 +834,10 @@ Create a new plan with optional consumption model, visibility, plan group assign
355
834
  - `isFree` (`boolean`, optional)
356
835
  - `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
836
  - `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.
837
+ - `unlimitedPlanCredits` (`boolean`, optional) — Credits plans only. true makes the plan credits unlimited: usage never spends them, only planCreditLimit caps it, and every price includes 0 credits. Omitted means false.
358
838
  - `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
839
  - `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.
840
+ - `unlimitedPlanBalance` (`boolean`, optional) — Balance plans only. true makes the plan balance unlimited: usage never spends it, only planBalanceLimit caps it, and every price and country includes no balance. Omitted means false.
360
841
  - `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.
361
842
  - `planGroupId` (`string`, optional)
362
843
  - `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.
@@ -25,7 +25,7 @@ Deactivate an add-on from a subscription.
25
25
 
26
26
  `POST /subscriptions/{id}/addons` · operation `activate-addon`
27
27
 
28
- Activate an add-on on a subscription. Charges a prorated amount for the current billing period.
28
+ Activate an add-on on a subscription. Creates the activation invoice and charges a prorated amount for the current billing period; the add-on is active once the payment is confirmed. Rejected with 409 while the add-on is active or an activation of it is still processing. An add-on that the subscription's plan version does not sell is rejected with addon_unavailable.
29
29
 
30
30
  ### Parameters
31
31
 
@@ -110,7 +110,7 @@ Adjust a subscription's balance or credits by a signed amount. Positive adds, ne
110
110
 
111
111
  `POST /subscriptions/{id}/balance/topup` · operation `topup-balance`
112
112
 
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.
113
+ Top up a balance subscription. Creates the top-up invoice and charges the customer's payment method for the amount plus tax. Once the payment is confirmed, adds the amount to the subscription's purchased balance (after paying back any overage owed on the plan balance), marks the invoice paid 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.
114
114
 
115
115
  ### Parameters
116
116
 
@@ -176,13 +176,36 @@ Upgrade or change billing interval immediately, optionally applying an Offer by
176
176
 
177
177
  `PlanChange`
178
178
 
179
+ ## changeVersion
180
+
181
+ `commet.subscriptions.changeVersion(params, options?)`
182
+
183
+ `POST /subscriptions/{id}/change-version` · operation `change-subscription-version`
184
+
185
+ Move a subscription to a newer published version of its plan, now or at the end of the period, without proration; an older version is rejected with version_not_newer, and a subscription on a running experiment moves only to a later version of that experiment. The subscription keeps its currency and its price: a destination that does not sell its currency is rejected with missing_regional_price unless currency asks to charge it in USD from its renewal, and one that does not sell the price it pays with price_not_found. A free version moves only to a free version and a paid one only to a paid one (validation_error). A subscription whose usage does not fit the destination, or with an active add-on the destination does not sell, is not moved either, and the error says why. Each change is recorded as a move of this one subscription in the plan's moves. Repeating the same request changes nothing; a new one replaces the pending move.
186
+
187
+ ### Parameters
188
+
189
+ - `id` (`string`, required)
190
+ - `planVersionId` (`string`, required) — A published version of the subscription's plan.
191
+ - `effective` (`"now" | "period_end"`, required) — now changes features, limits and the included credits or balance at once (the included difference is added to or subtracted from the plan credits or plan balance: an increase first pays any plan-part debt, a decrease never creates new debt, and purchased credits and purchased balance are untouched) and charges the new price from the next renewal. period_end changes everything at the next renewal. There is never a proration charge or refund.
192
+ - `currency` (`string`, optional) — usd to charge the subscription in USD from its next renewal when the version does not sell the currency it pays, or the USD price of its country: it pays the version's USD price for its country, or the USD base price. The whole move then happens at that renewal, even with effective now. Rejected with missing_regional_price when the version still sells what the subscription pays or for another currency, and with a currency_held_by code naming what keeps it in its currency: currency_held_by_payment_method (it pays through dLocal), currency_held_by_customer_credit, currency_held_by_balance_plan, currency_held_by_fixed_amount_discount, currency_held_by_prepaid_period or currency_held_by_scheduled_pause.
193
+
194
+ ### Request options
195
+
196
+ - `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
197
+
198
+ ### Returns
199
+
200
+ `Subscription`
201
+
179
202
  ## purchaseCredits
180
203
 
181
204
  `commet.subscriptions.purchaseCredits(params, options?)`
182
205
 
183
206
  `POST /subscriptions/{id}/credits` · operation `purchase-credits`
184
207
 
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.
208
+ Purchase a fixed credit pack or choose a whole credit quantity at the subscription plan price and minimum. Creates the purchase invoice, charges the saved payment method and adds the purchased credits once the payment is confirmed. A credit pack that the subscription's plan version does not sell is rejected with credit_pack_unavailable.
186
209
 
187
210
  ### Parameters
188
211
 
@@ -466,6 +489,22 @@ Revoke the plan or interval change scheduled for the end of the period, so the s
466
489
 
467
490
  `Subscription`
468
491
 
492
+ ## revokeScheduledVersionChange
493
+
494
+ `commet.subscriptions.revokeScheduledVersionChange(params, options?)`
495
+
496
+ `DELETE /subscriptions/{id}/scheduled-version-change` · operation `revoke-scheduled-version-change`
497
+
498
+ Cancel the move to another plan version pending for the next renewal, so the subscription stays on its version, and send subscription.version_change_canceled with reason canceled_by_merchant. A move made now has nothing pending to revoke. With nothing pending it changes nothing. Returns the subscription.
499
+
500
+ ### Parameters
501
+
502
+ - `id` (`string`, required)
503
+
504
+ ### Returns
505
+
506
+ `Subscription`
507
+
469
508
  ## uncancel
470
509
 
471
510
  `commet.subscriptions.uncancel(params, options?)`
@@ -514,6 +553,7 @@ List all subscriptions. Filter by customer ID or status.
514
553
 
515
554
  - `customerId` (`string`, optional)
516
555
  - `status` (`SubscriptionStatus`, optional)
556
+ - `planVersionId` (`string`, optional)
517
557
 
518
558
  ### Returns
519
559
 
@@ -540,12 +580,13 @@ Create a subscription for a customer. Commet selects the default price when pric
540
580
  - `successUrl` (`string`, optional)
541
581
  - `prepaidPeriods` (`number`, optional) — Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true.
542
582
  - `cancelAtPeriodEnd` (`boolean`, optional) — Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method.
583
+ - `planVersionId` (`string`, optional) — Public ID of a published version of the plan, current or not, including an experiment's versions. The subscription is created on that version and stays on it: checkout charges its price and activation grants its credits, add-ons and credit packs. When omitted, the subscription gets the current version, or the version an experiment code (planCode `<plan code>:<experiment code>`) sells.
543
584
  - `offerId` (`string`, optional)
544
585
  - `promoCode` (`string`, optional)
545
586
  - `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.
546
587
  - `skipTrial` (`boolean`, optional)
547
588
  - `planId` (`string`, optional)
548
- - `planCode` (`string`, optional)
589
+ - `planCode` (`string`, optional) — The plan code, or an experiment code as `<plan code>:<experiment code>` to sell the version the experiment sells.
549
590
  - `cardPromotionId` (`string`, optional) — Public card promotion ID. The offer is shown immediately and remains conditional on card eligibility until checkout confirmation.
550
591
 
551
592
  ### Valid parameter combinations
@@ -8,11 +8,12 @@ API version: `2026-08-27`
8
8
 
9
9
  `POST /transactions/{id}/refund` · operation `refund-transaction`
10
10
 
11
- Issue a full refund and return the provider-neutral refund resource with its actual status.
11
+ Refund a positive amount in the payment currency’s smallest unit, or omit amount to refund the remaining amount. Returns the refund resource with its actual status.
12
12
 
13
13
  ### Parameters
14
14
 
15
15
  - `id` (`string`, required)
16
+ - `amount` (`number`, optional) — Amount returned to the customer, including tax, in the payment currency’s smallest unit. Omit to refund the remainder.
16
17
 
17
18
  ### Request options
18
19