@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
@@ -7,7 +7,7 @@ A trial is a number of free days set on a plan price. [Offers](/docs/offers) hol
7
7
 
8
8
  ## Set trial days on a price
9
9
 
10
- In the dashboard, open **Plans**, select the plan, and choose **Edit price**. Enter the **Free trial** days and choose whether to **Require a payment method**.
10
+ In the dashboard, open **Plans**, select the plan, and open the price. Enter the **Free trial** days, choose whether to **Require a payment method**, and choose **Save to draft**. The trial applies to new subscriptions once you [publish the draft](/docs/plan-versions#edit-in-the-dashboard).
11
11
 
12
12
  ```typescript
13
13
  await commet.plans.updatePrice({
@@ -24,7 +24,7 @@ await commet.plans.updatePrice({
24
24
 
25
25
  Price variants inherit the trial of their base price. One-time prices can't have a trial.
26
26
 
27
- A subscription keeps the trial days it accepted. Changing `trialDays` affects only new subscriptions.
27
+ A subscription keeps the trial days it accepted. Changing `trialDays` publishes a new plan version and affects only new subscriptions.
28
28
 
29
29
  ## Start a trial with a payment method
30
30
 
@@ -37,7 +37,7 @@ const { checkoutUrl } = await commet.subscriptions.create({
37
37
 
38
38
  Redirect the customer to `checkoutUrl`. Checkout saves the payment method without charging it, and the subscription becomes `trialing` with `trialEndsAt` set.
39
39
 
40
- When the trial ends, Commet charges the current value of the selected price and the subscription becomes `active`. A promo code typed in the trial checkout discounts the first invoice after the trial.
40
+ When the trial ends, Commet charges the selected price of the subscription's plan version and the subscription becomes `active`. A promo code typed in the trial checkout discounts the first invoice after the trial.
41
41
 
42
42
  ## Start a trial without a payment method
43
43
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Manage Subscriptions
3
- description: Create, retrieve, pause, resume, cancel, and reactivate subscriptions.
3
+ description: Create, retrieve, pause, resume, cancel, and reactivate subscriptions, and move them to a newer version of their plan.
4
4
  ---
5
5
 
6
6
  Install the Commet Skill so your coding agent can implement the current subscription lifecycle and verify the result.
@@ -101,20 +101,25 @@ For a paid plan, redirect the customer to `checkoutUrl`. Free plans and [trials
101
101
 
102
102
  The normal path needs only `customerId` and either `planCode` or `planId`. Optional selection fields are:
103
103
 
104
- | Field | When to send it |
105
- | -------------------------------- | ------------------------------------------------------------------------------------------ |
106
- | `billingInterval` | The customer selected a non-default interval |
107
- | `priceId` | The customer selected a concrete price variant |
108
- | `offerId` | Your application selected an Offer directly; it overrides automatic introductory selection |
109
- | `promoCode` | The customer entered a Promo Code |
110
- | `initialSeats` | You know the initial seat quantities at creation |
111
- | `skipTrial` or `customTrialDays` | You intentionally override the price's [trial](/docs/trial-periods) |
104
+ | Field | When to send it |
105
+ | -------------------------------- | -------------------------------------------------------------------------------------------- |
106
+ | `billingInterval` | The customer selected a non-default interval |
107
+ | `priceId` | The customer selected a concrete price variant |
108
+ | `offerId` | Your application selected an Offer directly; it overrides automatic introductory selection |
109
+ | `promoCode` | The customer entered a Promo Code |
110
+ | `initialSeats` | You know the initial seat quantities at creation |
111
+ | `skipTrial` or `customTrialDays` | You intentionally override the price's [trial](/docs/trial-periods) |
112
+ | `planVersionId` | You sell a specific published [plan version](/docs/plan-versions) instead of the current one |
112
113
 
113
114
  Omitting `priceId` preserves default price and Market resolution. Omitting `offerId` preserves automatic Introductory Offer selection.
114
115
 
116
+ To sell an [experiment](/docs/plan-versions#run-an-experiment), send `planCode` as `<plan code>:<experiment code>`, such as `pro:price-test`. An experiment code already chooses the version, so it can't be combined with `planVersionId`.
117
+
115
118
  To charge several billing periods in the first payment, see [Pay in Advance](/docs/pay-in-advance). To sell a period that doesn't renew, see [One-Time Payments](/docs/one-time-payments#sell-a-period-without-renewal).
116
119
 
117
- A compatible `pending_payment` checkout may be reused. An incompatible pending selection can be replaced without duplicating a paid subscription.
120
+ A compatible `pending_payment` checkout may be reused: repeating the same request returns `200` with the same subscription ID and `checkoutUrl`. An incompatible pending selection can be replaced without duplicating a paid subscription.
121
+
122
+ An unpaid checkout follows the latest version of what was requested: the plan's current version for a plan code, the experiment's latest version for an experiment code, and that version for `planVersionId`. After you edit the plan, its link and a repeated request charge that latest version. Another plan, experiment, version, interval, or price replaces it: its invoice is voided and the previous link stops working. See [Unpaid checkouts](/docs/plan-versions#unpaid-checkouts).
118
123
 
119
124
  Omitting a `promoCode` or `offerId` that the pending checkout carries, including an Offer assigned through `PUT /subscriptions/{id}/offer`, replaces it with a new subscription and checkout without that benefit. Redirect to the returned `checkoutUrl`; the previous link stops working. To keep the Offer, send it again or assign it to the returned subscription ID.
120
125
 
@@ -239,6 +244,8 @@ $subscription = $commet->subscriptions->get(id: 'sub_xxx');
239
244
 
240
245
  Use `get` with a public subscription ID to retrieve any persisted status, including `pending_payment`, `past_due`, and `canceled`.
241
246
 
247
+ Every subscription includes `planVersion`, the [plan version](/docs/plan-versions) it is on, and `scheduledVersionChange`, the move pending for its next renewal or `null`. Filter `GET /subscriptions` by version with `planVersionId`.
248
+
242
249
  ## Pause and resume
243
250
 
244
251
  A pause temporarily stops subscription access and renewals without canceling the subscription. You can pause a paid recurring subscription in `active` or `trialing` status. Free, one-time, pending-payment, past-due, and canceled subscriptions are not eligible. Resolve any scheduled cancellation, scheduled plan change, or pending plan-change checkout before creating a pause.
@@ -324,7 +331,7 @@ The response includes `subscriptionId`, `invoiceId`, and `status`. An immediate
324
331
 
325
332
  A declined resume keeps its invoice outstanding. Automatic payment retries follow days 1, 3, 5, and 7 from the original failure and reuse that invoice. The subscription stays paused during retries. If all retries fail, it is canceled and the resume invoice becomes uncollectible. Manual resume attempts do not consume automatic retry slots.
326
333
 
327
- A period-end resume uses the current base price when its new invoice is created. An outstanding resume invoice keeps its original amounts and included credits or balance on retry, even if the catalog changes again. Accepted Introductory Offers and discounts preserve their unconsumed terms; resume does not grant a new Introductory Offer or redeem a promo code again.
334
+ A period-end resume uses the base price of the subscription's plan version when its new invoice is created. An outstanding resume invoice keeps its original amounts and included credits or balance on retry, even if the catalog changes again. Accepted Introductory Offers and discounts preserve their unconsumed terms; resume does not grant a new Introductory Offer or redeem a promo code again.
328
335
 
329
336
  See the [Pause API reference](/docs/api-reference/subscriptions/pause-subscription) and [Resume API reference](/docs/api-reference/subscriptions/resume-subscription) for the complete schemas.
330
337
 
@@ -530,9 +537,37 @@ $subscription = $commet->subscriptions->revokeScheduledPlanChange(id: 'sub_xxx')
530
537
 
531
538
  This also revokes a scheduled move to the plan group's default plan. A subscription with nothing scheduled returns `409 no_scheduled_plan_change`.
532
539
 
540
+ ## Change the plan version
541
+
542
+ Move a subscription to a newer version of its plan, at its next renewal or now:
543
+
544
+ ```bash
545
+ curl -X POST https://commet.co/api/v1/subscriptions/sub_xxx/change-version \
546
+ -H "x-api-key: $COMMET_API_KEY" \
547
+ -H "commet-version: 2026-08-27" \
548
+ -H "Content-Type: application/json" \
549
+ -d '{"planVersionId":"plr_xxx","effective":"period_end"}'
550
+ ```
551
+
552
+ `period_end` changes everything at the next renewal and nothing before it. `now` changes features, limits, and included credits or balance today and the price from the next renewal. A version change never prorates, keeps the subscription's currency unless `currency: "usd"` charges it in USD from its next renewal (then the whole move happens at that renewal, even with `now`), and keeps a free subscription on a free version and a paid one on a paid version. The response is the subscription: after a move made now, `planVersion` shows the new version; after a move at renewal, `scheduledVersionChange` shows the pending one.
553
+
554
+ A trialing subscription moves when its trial ends, so its first charge is on the new version. A past-due one, once it pays, moves at the end of the period it's paying for. `scheduledVersionChange.effectiveAt` shows that date. If the subscription ends or changes to another plan first, it never moves and no version webhook is sent. A one-time subscription never renews, so `period_end` returns `409 invalid_subscription_status`; move it with `now`.
555
+
556
+ Each change is recorded as a move of this one subscriber, listed in the plan's moves with `GET /plans/{id}/moves` and in the plan's **Moves** tab. See [When a move at renewal applies](/docs/plan-versions#when-a-move-at-renewal-applies).
557
+
558
+ Revoke a pending move before the renewal:
559
+
560
+ ```bash
561
+ curl -X DELETE https://commet.co/api/v1/subscriptions/sub_xxx/scheduled-version-change \
562
+ -H "x-api-key: $COMMET_API_KEY" \
563
+ -H "commet-version: 2026-08-27"
564
+ ```
565
+
566
+ The subscription stays on its version, and [`subscription.version_change_canceled`](/docs/webhooks/subscription-version-change-canceled) fires with `reason: "canceled_by_merchant"`. With nothing pending, the request changes nothing. To move many subscriptions at once, see [Move subscribers](/docs/plan-versions#move-subscribers).
567
+
533
568
  ## Recover a past-due subscription
534
569
 
535
- Reactivate retries the outstanding renewal charge and keeps the original billing relationship:
570
+ Reactivate retries the outstanding renewal charge and keeps the original billing relationship and plan version:
536
571
 
537
572
  **TypeScript**
538
573
 
@@ -660,4 +695,6 @@ Automatic dunning retries are anchored to the original decline on days 1, 3, 5,
660
695
 
661
696
  The same `reactivate` operation charges the saved payment method, reuses the subscription record, and starts a fresh period anchored to the reactivation date. You may pass an `offerId`; accepted phases are persisted as an immutable Offer Application.
662
697
 
663
- The selected price is not snapshotted. Future renewals use its current catalog value. Archiving that price prevents new selection but does not break the existing subscription.
698
+ The subscription returns on the latest version of what was bought: the plan's current version for a plan code, the experiment's latest version for an experiment code (the plan's current version once the experiment is no longer running), and the same version for `planVersionId`. Add-ons that version doesn't sell are deactivated. If it doesn't sell the subscription's currency, reactivation returns `422 missing_regional_price`.
699
+
700
+ The selected price is not snapshotted. Future renewals use its price in the subscription's plan version, or the current value of the Market price it pays. Archiving that price prevents new selection but does not break the existing subscription.
@@ -16,6 +16,8 @@ Customers change plans through the [Customer Portal](/docs/customer-portal) or f
16
16
 
17
17
  Both plans must be in the same [Plan Group](/docs/plan-groups) for customers to change plans themselves through the portal. Free-to-paid changes open a checkout for the customer to pay. When the new price has a [trial without a payment method](/docs/trial-periods#start-a-trial-without-a-payment-method) and the customer never had that plan, the trial starts at once instead.
18
18
 
19
+ A change to another plan lands on that plan's current [version](/docs/plan-versions). The destination must sell the customer's currency in their country: otherwise the change and its preview return `422 missing_regional_price`, and the portal doesn't offer that plan. To move a customer to a newer version of the same plan, [change its version](/docs/manage-subscriptions#change-the-plan-version) instead.
20
+
19
21
  Immediate changes accept an `offerId` or a [`promoCode`](/docs/promo-codes#apply-a-code-on-a-plan-change). Scheduled changes accept neither.
20
22
 
21
23
  An immediate upgrade is rejected with a seat-limit error when the customer's current seats exceed the target plan's included seats for a seat feature that is not unlimited and has overage disabled. Reduce seats first, or pick a plan with enough included seats. Interval-only changes and scheduled downgrades are not affected.
@@ -1,6 +1,6 @@
1
1
  # addon_has_activations
2
2
 
3
- The add-on cannot be deleted while subscriptions use it.
3
+ The add-on cannot be deleted, or removed from a plan, while subscriptions use it.
4
4
 
5
5
  - **Error type:** `conflict_error`
6
6
  - **`code`:** `addon_has_activations`
@@ -9,7 +9,7 @@ The add-on cannot be deleted while subscriptions use it.
9
9
 
10
10
  ## What to do
11
11
 
12
- Remove or migrate its active subscription assignments before deleting the add-on.
12
+ Remove or migrate its active subscription assignments before deleting the add-on or removing the plan from it.
13
13
 
14
14
  The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
15
 
@@ -0,0 +1,22 @@
1
+ # addon_unavailable
2
+
3
+ The plan version the subscription is on, or is moving to, does not sell the add-on.
4
+
5
+ - **Error type:** `conflict_error`
6
+ - **`code`:** `addon_unavailable`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Activate an add-on the version sells, move the subscription to a version that sells it, or deactivate the add-on before moving the subscription.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Do not retry with the same add-on and version.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # credit_pack_unavailable
2
+
3
+ The subscription's plan version does not sell the credit pack.
4
+
5
+ - **Error type:** `conflict_error`
6
+ - **`code`:** `credit_pack_unavailable`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Buy a credit pack the version sells, or move the subscription to a version that sells it.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Do not retry with the same unavailable credit pack.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # currency_held_by_balance_plan
2
+
3
+ The subscription is on a balance plan, and its balance is in the currency it pays, so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_balance_plan`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # currency_held_by_customer_credit
2
+
3
+ The customer holds credit in the currency the subscription pays, which applies only to invoices in that currency, so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_customer_credit`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version, or move it once that credit is used or revoked.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # currency_held_by_fixed_amount_discount
2
+
3
+ The subscription has a fixed-amount discount in the currency it pays still running, so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_fixed_amount_discount`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version, or move it once that discount ends.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # currency_held_by_payment_method
2
+
3
+ The subscription pays through a provider that cannot charge it in USD (dLocal: Mercado Pago, Pix, OXXO or a card), so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_payment_method`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version, or move it once it pays with a method that can be charged in USD.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # currency_held_by_prepaid_period
2
+
3
+ The subscription has a prepaid period paid in the currency it pays that it has not used, so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_prepaid_period`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version, or move it once that prepaid period is used.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # currency_held_by_scheduled_pause
2
+
3
+ The subscription has a pause scheduled, so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_scheduled_pause`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version, or move it once the pause is revoked or the subscription resumes.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -15,6 +15,8 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
15
15
  - [`customer_deleted`](./customer_deleted.md) — The externalId belongs to a deleted customer, so the plan group's default plan cannot start for it.
16
16
  - [`feature_not_found`](./feature_not_found.md) — The requested feature, seat feature, or quota feature does not exist in this organization.
17
17
  - [`plan_not_found`](./plan_not_found.md) — The requested plan does not exist or is not available in this organization.
18
+ - [`plan_version_not_found`](./plan_version_not_found.md) — The requested plan version does not exist, is not published, or belongs to another plan.
19
+ - [`plan_experiment_not_found`](./plan_experiment_not_found.md) — The plan has no experiment with that code, or the plan belongs to another organization.
18
20
  - [`subscription_not_found`](./subscription_not_found.md) — The requested subscription does not exist in this organization.
19
21
  - [`no_active_subscription`](./no_active_subscription.md) — The customer has no subscription that is active for this operation.
20
22
  - [`no_prices_configured`](./no_prices_configured.md) — The selected plan has no price available for the request.
@@ -26,6 +28,7 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
26
28
  - [`no_payment_method`](./no_payment_method.md) — The subscription has no reusable payment method for this operation.
27
29
  - [`duplicate`](./duplicate.md) — The request conflicts with an existing resource, unique value, or previously recorded event.
28
30
  - [`already_scheduled`](./already_scheduled.md) — The requested subscription action is already scheduled.
31
+ - [`subscribers_do_not_fit`](./subscribers_do_not_fit.md) — Some subscribers of earlier versions do not fit the version being published, so nothing was published and nobody moved.
29
32
  - [`feature_not_in_plan`](./feature_not_in_plan.md) — The requested feature is not included in the customer's plan or subscription.
30
33
  - [`feature_disabled`](./feature_disabled.md) — The requested feature is disabled for the customer's subscription.
31
34
  - [`insufficient_balance`](./insufficient_balance.md) — The operation cannot be charged against the available balance, or the required regional overage price is missing.
@@ -34,7 +37,13 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
34
37
  - [`included_limit_reached`](./included_limit_reached.md) — The requested usage exceeds the plan's included usage limit.
35
38
  - [`plan_credit_limit_reached`](./plan_credit_limit_reached.md) — The usage event would spend more plan credits than the plan's credit limit allows in the current day or week, and purchased credits do not cover the rest.
36
39
  - [`plan_balance_limit_reached`](./plan_balance_limit_reached.md) — The usage event would spend more plan balance than the plan's balance limit allows in the current day or week, and purchased balance does not cover the rest.
37
- - [`missing_regional_price`](./missing_regional_price.md) — The plan has no price for the subscription's currency or resolved market.
40
+ - [`missing_regional_price`](./missing_regional_price.md) — The plan, or the plan version a subscription is moving to, has no price for the subscription's currency or resolved market. A version move keeps the subscription's currency unless it asks to charge it in USD from its renewal; asking for another currency, or for USD when the version still sells what the subscription pays, is refused with this code, and what keeps a subscription in its currency has its own currency_held_by code.
41
+ - [`currency_held_by_payment_method`](./currency_held_by_payment_method.md) — The subscription pays through a provider that cannot charge it in USD (dLocal: Mercado Pago, Pix, OXXO or a card), so a version move cannot charge it in USD.
42
+ - [`currency_held_by_customer_credit`](./currency_held_by_customer_credit.md) — The customer holds credit in the currency the subscription pays, which applies only to invoices in that currency, so a version move cannot charge it in USD.
43
+ - [`currency_held_by_balance_plan`](./currency_held_by_balance_plan.md) — The subscription is on a balance plan, and its balance is in the currency it pays, so a version move cannot charge it in USD.
44
+ - [`currency_held_by_fixed_amount_discount`](./currency_held_by_fixed_amount_discount.md) — The subscription has a fixed-amount discount in the currency it pays still running, so a version move cannot charge it in USD.
45
+ - [`currency_held_by_prepaid_period`](./currency_held_by_prepaid_period.md) — The subscription has a prepaid period paid in the currency it pays that it has not used, so a version move cannot charge it in USD.
46
+ - [`currency_held_by_scheduled_pause`](./currency_held_by_scheduled_pause.md) — The subscription has a pause scheduled, so a version move cannot charge it in USD.
38
47
  - [`payment_failed`](./payment_failed.md) — The operation could not complete its payment or required tax calculation.
39
48
  - [`payment_not_found`](./payment_not_found.md) — The requested payment does not exist in this organization.
40
49
  - [`payment_method_not_found`](./payment_method_not_found.md) — The requested or required payment method could not be found.
@@ -56,6 +65,7 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
56
65
  - [`idempotency_unavailable`](./idempotency_unavailable.md) — Platform could not safely establish, release, or persist the idempotent response for this operation.
57
66
  - [`seat_limit_exceeded`](./seat_limit_exceeded.md) — The requested plan change would exceed the available seat limit.
58
67
  - [`no_change_requested`](./no_change_requested.md) — The request would not change the current subscription state.
68
+ - [`version_not_newer`](./version_not_newer.md) — Subscriptions move only to a newer version than the one they are on. A subscription on a running experiment moves only to a later version of the same experiment until the experiment is archived or made current.
59
69
  - [`plans_not_in_same_group`](./plans_not_in_same_group.md) — The current and target plans do not belong to the same plan group.
60
70
  - [`free_plan_change_not_supported`](./free_plan_change_not_supported.md) — This plan-change operation does not support the selected free plan.
61
71
  - [`plan_change_scheduled`](./plan_change_scheduled.md) — The requested plan change takes effect at the end of the current billing period instead of being prorated immediately.
@@ -63,12 +73,14 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
63
73
  - [`addon_not_found`](./addon_not_found.md) — The requested add-on does not exist in this organization.
64
74
  - [`addon_already_active`](./addon_already_active.md) — The add-on is already active on this subscription.
65
75
  - [`addon_not_active`](./addon_not_active.md) — The add-on is not active on this subscription.
66
- - [`addon_has_activations`](./addon_has_activations.md) — The add-on cannot be deleted while subscriptions use it.
76
+ - [`addon_has_activations`](./addon_has_activations.md) — The add-on cannot be deleted, or removed from a plan, while subscriptions use it.
77
+ - [`addon_unavailable`](./addon_unavailable.md) — The plan version the subscription is on, or is moving to, does not sell the add-on.
67
78
  - [`feature_already_exists`](./feature_already_exists.md) — A feature with the same code or name already exists, or the feature is already assigned where uniqueness is required.
68
79
  - [`feature_in_use`](./feature_in_use.md) — The feature cannot be deleted while a plan or add-on uses it.
69
80
  - [`model_not_found`](./model_not_found.md) — The requested AI model does not exist in the current model catalog.
70
81
  - [`pricing_mode_mismatch`](./pricing_mode_mismatch.md) — The submitted usage shape does not match the feature's configured pricing mode.
71
82
  - [`credit_pack_not_found`](./credit_pack_not_found.md) — The requested credit pack does not exist in this organization.
83
+ - [`credit_pack_unavailable`](./credit_pack_unavailable.md) — The subscription's plan version does not sell the credit pack.
72
84
  - [`plan_group_not_found`](./plan_group_not_found.md) — The requested plan group does not exist in this organization.
73
85
  - [`offer_not_found`](./offer_not_found.md) — The requested offer does not exist or is not compatible with the selected operation.
74
86
  - [`offer_not_applicable`](./offer_not_applicable.md) — The selected offer does not satisfy the eligibility or lifecycle conditions for this operation.
@@ -1,6 +1,6 @@
1
1
  # missing_regional_price
2
2
 
3
- The plan has no price for the subscription's currency or resolved market.
3
+ The plan, or the plan version a subscription is moving to, has no price for the subscription's currency or resolved market. A version move keeps the subscription's currency unless it asks to charge it in USD from its renewal; asking for another currency, or for USD when the version still sells what the subscription pays, is refused with this code, and what keeps a subscription in its currency has its own currency_held_by code.
4
4
 
5
5
  - **Error type:** `billing_error`
6
6
  - **`code`:** `missing_regional_price`
@@ -9,13 +9,13 @@ The plan has no price for the subscription's currency or resolved market.
9
9
 
10
10
  ## What to do
11
11
 
12
- Configure the missing regional or currency price identified by the response.
12
+ Configure the missing regional or currency price identified by the response, move the subscription to a version that sells its currency, or ask to charge it in USD from its renewal.
13
13
 
14
14
  The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
15
 
16
16
  ## Retry behavior
17
17
 
18
- Retry after the required price is configured.
18
+ Retry after the required price is configured, with a version that sells the subscription's currency, or with currency usd when the version does not sell it.
19
19
 
20
20
  ## Correlate the request
21
21
 
@@ -0,0 +1,22 @@
1
+ # plan_experiment_not_found
2
+
3
+ The plan has no experiment with that code, or the plan belongs to another organization.
4
+
5
+ - **Error type:** `not_found_error`
6
+ - **`code`:** `plan_experiment_not_found`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ List the plan's experiments with GET /plans/{id}/experiments and use one of their codes.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry only with an existing experiment code of the same plan.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # plan_version_not_found
2
+
3
+ The requested plan version does not exist, is not published, or belongs to another plan.
4
+
5
+ - **Error type:** `not_found_error`
6
+ - **`code`:** `plan_version_not_found`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ List the plan's versions with GET /plans/{id}/versions and use one of their IDs.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry only with a published version of the same plan.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # subscribers_do_not_fit
2
+
3
+ Some subscribers of earlier versions do not fit the version being published, so nothing was published and nobody moved.
4
+
5
+ - **Error type:** `conflict_error`
6
+ - **`code`:** `subscribers_do_not_fit`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Read details.conflicts: for each subscriber, send a change that makes it fit (an interval, seats at the limit or add-ons to remove), keep it on its version, or publish without moving subscribers.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with the changes; the same request fails the same way.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -0,0 +1,22 @@
1
+ # version_not_newer
2
+
3
+ Subscriptions move only to a newer version than the one they are on. A subscription on a running experiment moves only to a later version of the same experiment until the experiment is archived or made current.
4
+
5
+ - **Error type:** `validation_error`
6
+ - **`code`:** `version_not_newer`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Choose a newer version of the plan, or archive or make current the experiment first.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Do not retry the same move.
19
+
20
+ ## Correlate the request
21
+
22
+ Keep the `x-request-id` response header when reporting or investigating this error. Platform records the same identifier in its request event, so Commet can locate the exact execution without customer data or credentials.
@@ -54,15 +54,16 @@ Free plan customers can purchase add-ons, credit packs, and balance top-ups —
54
54
 
55
55
  ## Changing a Free Plan's Included Balance or Credits
56
56
 
57
- If you change the included balance or credits on a free plan, the change applies at **each customer's next monthly reset**. Balances already granted for the current month don't change.
57
+ If you change the included balance or credits on a free plan, Commet publishes a new [plan version](/docs/plan-versions). New customers get the new amount at once. Existing customers keep their version's amount until you move them: a move at their next renewal grants it at that monthly reset, and a move made now adds or removes the difference today.
58
58
 
59
59
  ### Example
60
60
 
61
61
  ```
62
62
  You increase the free plan's included balance from $100 to $150.
63
63
 
64
- A customer whose billing day is the 20th keeps their current balance until the 20th.
65
- On the 20th, their monthly reset grants $150.
64
+ A new customer gets $150 from the start.
65
+ A customer whose billing day is the 20th keeps getting $100 until you move them.
66
+ Moved at their next renewal, their reset on the 20th grants $150.
66
67
  ```
67
68
 
68
69
  ## When Your Customer Upgrades to a Paid Plan
@@ -23,14 +23,14 @@ The trial with a payment method starts after setup succeeds. If the card require
23
23
  2. With a payment method required, checkout saves it without charging.
24
24
  Without one, the subscription starts trialing at once.
25
25
  3. The subscription is trialing and records trialEndsAt.
26
- 4. At the end, Commet charges the current value of the selected price.
26
+ 4. At the end, Commet charges the selected price of the subscription's plan version.
27
27
  Without a card, it moves to the default plan or is canceled, with no invoice.
28
28
  5. A discount from an Offer starts with the first invoice after the trial.
29
29
  ```
30
30
 
31
- > **Warning**
31
+ > **Note**
32
32
  >
33
- > The subscription keeps its accepted trial days, but the selected catalog price can change. A price change during the trial changes the first paid charge.
33
+ > The subscription keeps its accepted trial days and its [plan version](/docs/plan-versions). A price change during the trial publishes a new version and doesn't change the first paid charge, unless you move the subscription.
34
34
 
35
35
  ## Customer-specific trials
36
36