@commet/node 9.9.0 → 9.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +813 -15
- package/dist/index.d.ts +813 -15
- package/dist/index.js +199 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +199 -6
- package/dist/index.mjs.map +1 -1
- package/docs/ai-onboarding/mcp-server.md +2 -0
- package/docs/api-reference/addons.md +3 -1
- package/docs/api-reference/credit-packs.md +3 -1
- package/docs/api-reference/generated-webhooks.md +2 -2
- package/docs/api-reference/index.md +3 -3
- package/docs/api-reference/plans.md +483 -6
- package/docs/api-reference/subscriptions.md +43 -3
- package/docs/documentation/api-versioning.md +8 -2
- package/docs/documentation/cli.md +4 -0
- package/docs/documentation/customers/customer-portal.md +2 -2
- package/docs/documentation/plans/add-ons.md +14 -3
- package/docs/documentation/plans/consumption-models.md +3 -3
- package/docs/documentation/plans/create-plans.md +5 -1
- package/docs/documentation/plans/credit-packs.md +19 -9
- package/docs/documentation/plans/plan-groups.md +1 -1
- package/docs/documentation/plans/plan-versions.md +265 -0
- package/docs/documentation/sales/regional-prices.md +23 -9
- package/docs/documentation/sales/trial-periods.md +3 -3
- package/docs/documentation/subscriptions/manage-subscriptions.md +50 -13
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +2 -0
- package/docs/errors/addon_has_activations.md +2 -2
- package/docs/errors/addon_unavailable.md +22 -0
- package/docs/errors/credit_pack_unavailable.md +22 -0
- package/docs/errors/index.md +8 -2
- package/docs/errors/missing_regional_price.md +3 -3
- package/docs/errors/plan_experiment_not_found.md +22 -0
- package/docs/errors/plan_version_not_found.md +22 -0
- package/docs/errors/subscribers_do_not_fit.md +22 -0
- package/docs/errors/version_not_newer.md +22 -0
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +4 -3
- package/docs/knowledge-base/how-do-trial-periods-work.md +3 -3
- package/docs/knowledge-base/how-does-billing-work.md +26 -28
- package/docs/knowledge-base/how-does-quota-based-billing-work.md +12 -22
- package/docs/knowledge-base/how-does-seat-based-billing-work.md +12 -22
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +11 -8
- package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +34 -29
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -1
- package/docs/manifest.json +191 -2
- package/docs/platform-documentation.md +1 -0
- package/docs/schemas.md +107 -0
- package/docs/webhooks/introduction.md +3 -1
- package/docs/webhooks.md +24 -0
- package/docs/webhooks.openapi.json +231 -1
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Markets and Regional Pricing
|
|
3
|
-
description:
|
|
3
|
+
description: Set plan prices per currency or per country, group countries into reusable Markets, and offer selectable price variants.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Commet has
|
|
6
|
+
Commet has these complementary pricing layers:
|
|
7
7
|
|
|
8
|
-
| Layer | Use it for
|
|
9
|
-
| -------------------- |
|
|
10
|
-
| **Currency Pricing** | Define plan, balance, and overage values in one presentment currency
|
|
11
|
-
| **
|
|
8
|
+
| Layer | Use it for |
|
|
9
|
+
| -------------------- | ----------------------------------------------------------------------------------- |
|
|
10
|
+
| **Currency Pricing** | Define plan, balance, and overage values in one presentment currency |
|
|
11
|
+
| **Country prices** | Give a country its own currency and prices in a [plan version](/docs/plan-versions) |
|
|
12
|
+
| **Markets** | Group countries that should resolve explicit price and currency overrides |
|
|
12
13
|
|
|
13
14
|
Currency Pricing remains the fallback. Add Markets when country segmentation or selectable variants require it.
|
|
14
15
|
|
|
@@ -22,12 +23,24 @@ await commet.plans.setRegionalPricing({
|
|
|
22
23
|
})
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
With only `currency` and `exchangeRate`, Commet derives every price, included balance, and overage from the USD values. Send `prices` or `features` to set exact amounts instead.
|
|
26
|
+
With only `currency` and `exchangeRate`, Commet derives every price, included balance, and overage from the USD values. Send `prices` or `features` to set exact amounts instead. Each change publishes a new [plan version](/docs/plan-versions); existing subscribers keep theirs until you move them.
|
|
26
27
|
|
|
27
28
|
Supported currencies: USD, ARS, BOB, BRL, CAD, CLP, CNY, COP, EUR, GBP, HKD, INR, JPY, KRW, MXN, PEN, PYG, SGD, THB, TWD, and UYU.
|
|
28
29
|
|
|
29
30
|
A currency applies to the countries that use it. Buyers in the United Kingdom pay in GBP, and EUR covers the euro countries. Buyers in a country without a configured currency pay the USD base price.
|
|
30
31
|
|
|
32
|
+
## Set prices by country
|
|
33
|
+
|
|
34
|
+
In the dashboard, the plan's **Regional prices** tab sets prices country by country in a draft:
|
|
35
|
+
|
|
36
|
+
1. Choose **Add a country** and the currency it pays in, USD included.
|
|
37
|
+
2. Set each price **By hand**, or follow the USD base at an exchange rate.
|
|
38
|
+
3. Set the country's prices for the add-ons and credit packs the plan sells, the same way.
|
|
39
|
+
|
|
40
|
+
Publishing the draft publishes every country together in one plan version. A country missing a price blocks publishing. Through the API, the `countries` block of `PATCH /plans/{id}/drafts/{draftId}` sets the same terms.
|
|
41
|
+
|
|
42
|
+
A subscriber pays the prices of its own country in its version; a buyer from a country the version doesn't list pays the USD base price. A move to another version never changes a subscription's currency, and a version that doesn't sell it can't receive the subscription. The same applies when a canceled subscription is reactivated on the latest version of what was bought: if that version doesn't sell its currency, reactivation returns `422 missing_regional_price`.
|
|
43
|
+
|
|
31
44
|
## Create a Market
|
|
32
45
|
|
|
33
46
|
A Market is a top-level Sales resource. It does not require a plan or price.
|
|
@@ -95,8 +108,9 @@ Omitting `priceId` keeps normal default-price and Market resolution.
|
|
|
95
108
|
|
|
96
109
|
## Renewal and archival
|
|
97
110
|
|
|
98
|
-
- A subscription stores the selected price identity.
|
|
99
|
-
- Renewals use
|
|
111
|
+
- A subscription stores the selected price identity and its plan version.
|
|
112
|
+
- Renewals use the price of the subscription's plan version. Market prices are not versioned: renewals use the Market price's current value.
|
|
113
|
+
- A version move keeps a subscriber's Market price, and a draft can't drop a currency that a Market price uses.
|
|
100
114
|
- A variant inherits every Market it does not override.
|
|
101
115
|
- Archiving hides a price from new selection without breaking existing subscriptions.
|
|
102
116
|
- A referenced Market cannot be deleted.
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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, never changes the subscription's currency, 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
|
|
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.
|
package/docs/errors/index.md
CHANGED
|
@@ -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,7 @@ 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 never changes the subscription's currency.
|
|
38
41
|
- [`payment_failed`](./payment_failed.md) — The operation could not complete its payment or required tax calculation.
|
|
39
42
|
- [`payment_not_found`](./payment_not_found.md) — The requested payment does not exist in this organization.
|
|
40
43
|
- [`payment_method_not_found`](./payment_method_not_found.md) — The requested or required payment method could not be found.
|
|
@@ -56,6 +59,7 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
|
|
|
56
59
|
- [`idempotency_unavailable`](./idempotency_unavailable.md) — Platform could not safely establish, release, or persist the idempotent response for this operation.
|
|
57
60
|
- [`seat_limit_exceeded`](./seat_limit_exceeded.md) — The requested plan change would exceed the available seat limit.
|
|
58
61
|
- [`no_change_requested`](./no_change_requested.md) — The request would not change the current subscription state.
|
|
62
|
+
- [`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
63
|
- [`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
64
|
- [`free_plan_change_not_supported`](./free_plan_change_not_supported.md) — This plan-change operation does not support the selected free plan.
|
|
61
65
|
- [`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 +67,14 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
|
|
|
63
67
|
- [`addon_not_found`](./addon_not_found.md) — The requested add-on does not exist in this organization.
|
|
64
68
|
- [`addon_already_active`](./addon_already_active.md) — The add-on is already active on this subscription.
|
|
65
69
|
- [`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.
|
|
70
|
+
- [`addon_has_activations`](./addon_has_activations.md) — The add-on cannot be deleted, or removed from a plan, while subscriptions use it.
|
|
71
|
+
- [`addon_unavailable`](./addon_unavailable.md) — The plan version the subscription is on, or is moving to, does not sell the add-on.
|
|
67
72
|
- [`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
73
|
- [`feature_in_use`](./feature_in_use.md) — The feature cannot be deleted while a plan or add-on uses it.
|
|
69
74
|
- [`model_not_found`](./model_not_found.md) — The requested AI model does not exist in the current model catalog.
|
|
70
75
|
- [`pricing_mode_mismatch`](./pricing_mode_mismatch.md) — The submitted usage shape does not match the feature's configured pricing mode.
|
|
71
76
|
- [`credit_pack_not_found`](./credit_pack_not_found.md) — The requested credit pack does not exist in this organization.
|
|
77
|
+
- [`credit_pack_unavailable`](./credit_pack_unavailable.md) — The subscription's plan version does not sell the credit pack.
|
|
72
78
|
- [`plan_group_not_found`](./plan_group_not_found.md) — The requested plan group does not exist in this organization.
|
|
73
79
|
- [`offer_not_found`](./offer_not_found.md) — The requested offer does not exist or is not compatible with the selected operation.
|
|
74
80
|
- [`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 never changes the subscription's currency.
|
|
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, or move the subscription to a version that sells its currency.
|
|
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, or with a version that sells the subscription's currency.
|
|
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
|
|
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
|
|
65
|
-
|
|
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
|
|
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
|
-
> **
|
|
31
|
+
> **Note**
|
|
32
32
|
>
|
|
33
|
-
> The subscription keeps its accepted trial days
|
|
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
|
|
|
@@ -7,28 +7,26 @@ Commet measures what a customer can consume and charges according to the plan th
|
|
|
7
7
|
|
|
8
8
|
Those layers change at different times. Commet separates catalog changes, subscription changes, and billing recovery. Each has an explicit rule; there is no single price-based heuristic for every operation.
|
|
9
9
|
|
|
10
|
-
| Layer | Source of truth
|
|
11
|
-
| ------------ |
|
|
12
|
-
| Catalog | Plans, prices, features, Offers, and Markets
|
|
13
|
-
| Subscription | Selected plan, price, accepted Offer, period, and status | What did this customer accept? |
|
|
14
|
-
| Consumption | Usage, seats, quota, credits, or balance
|
|
15
|
-
| Invoice | Line items, tax, credits, and amount due
|
|
16
|
-
| Transaction | Provider-neutral payment attempt
|
|
10
|
+
| Layer | Source of truth | Typical question |
|
|
11
|
+
| ------------ | ---------------------------------------------------------------------- | ----------------------------------------------- |
|
|
12
|
+
| Catalog | Plans, prices, features, Offers, and Markets | What can a new customer buy? |
|
|
13
|
+
| Subscription | Selected plan, plan version, price, accepted Offer, period, and status | What did this customer accept? |
|
|
14
|
+
| Consumption | Usage, seats, quota, credits, or balance | What did the customer use? |
|
|
15
|
+
| Invoice | Line items, tax, credits, and amount due | What does the customer owe? |
|
|
16
|
+
| Transaction | Provider-neutral payment attempt | Did the charge succeed, fail, retry, or refund? |
|
|
17
17
|
|
|
18
18
|
## Quick Reference
|
|
19
19
|
|
|
20
20
|
### When You Make Changes
|
|
21
21
|
|
|
22
|
-
| What you do
|
|
23
|
-
|
|
|
24
|
-
| Change
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
| Archive a price | New selection is blocked; subscriptions already bound to it continue |
|
|
31
|
-
| Change a free plan's included balance/credits | Applies at each customer's next monthly reset |
|
|
22
|
+
| What you do | What happens to existing customers |
|
|
23
|
+
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
24
|
+
| Change prices, features, included amounts, or credit and balance rules | Publishes a new [plan version](/docs/plan-versions). Existing subscribers keep their version, also at renewal, until you move them |
|
|
25
|
+
| Move subscribers to a newer version | At their next renewal, or now: features and limits change today and the price from the next renewal |
|
|
26
|
+
| Change a Market price | Subscribers who pay it get the new value at their next renewal |
|
|
27
|
+
| Hide or soft-delete a plan | Existing subscriptions keep it; new selection is blocked |
|
|
28
|
+
| Archive a price | New selection is blocked; subscriptions already bound to it continue |
|
|
29
|
+
| Change a free plan's included balance/credits | Publishes a new version. Moved customers get it from their next monthly reset |
|
|
32
30
|
|
|
33
31
|
### When Your Customer Makes Changes
|
|
34
32
|
|
|
@@ -43,21 +41,21 @@ Those layers change at different times. Commet separates catalog changes, subscr
|
|
|
43
41
|
|
|
44
42
|
### Automatic Events
|
|
45
43
|
|
|
46
|
-
| What happens | What your customer experiences
|
|
47
|
-
| ------------------------------------------------------------ |
|
|
48
|
-
| Trial starts | They use the product, no charge. **Overage is blocked** — usage stops at included limits
|
|
49
|
-
| Trial ends | They're charged the
|
|
50
|
-
| Trial without a payment method ends without a card | No charge; the subscription moves to the plan group's default plan or is canceled
|
|
51
|
-
| Renewal or retryable first-trial charge fails | Subscription becomes `past_due`; usage continues while retries run and purchases are blocked
|
|
52
|
-
| First-trial charge needs a payment method or customer action | Subscription remains `pending_payment` so checkout can complete
|
|
53
|
-
| Canceled subscription | Can be reactivated — fresh invoice at the
|
|
44
|
+
| What happens | What your customer experiences |
|
|
45
|
+
| ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
46
|
+
| Trial starts | They use the product, no charge. **Overage is blocked** — usage stops at included limits |
|
|
47
|
+
| Trial ends | They're charged the price of their plan version, overage activates normally |
|
|
48
|
+
| Trial without a payment method ends without a card | No charge; the subscription moves to the plan group's default plan or is canceled |
|
|
49
|
+
| Renewal or retryable first-trial charge fails | Subscription becomes `past_due`; usage continues while retries run and purchases are blocked |
|
|
50
|
+
| First-trial charge needs a payment method or customer action | Subscription remains `pending_payment` so checkout can complete |
|
|
51
|
+
| Canceled subscription | Can be reactivated — fresh invoice at the price of the latest version of what was bought, new billing period starts that day |
|
|
54
52
|
|
|
55
53
|
## The Boundaries That Matter
|
|
56
54
|
|
|
57
55
|
- Interval direction determines timing first. When the interval is unchanged, the plan group's order defines upgrade and downgrade direction, not the amount. Paid-to-free changes are always scheduled.
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
- Accepted Offer phases
|
|
56
|
+
- Each subscription is pinned to one plan version. Renewal reads that version's prices, features, and rules, and only a move changes it.
|
|
57
|
+
- Market prices are not versioned. Renewal reads the current value of the Market price a subscription pays.
|
|
58
|
+
- Accepted Offer phases and published plan versions are immutable.
|
|
61
59
|
- Recovery retries the same outstanding invoice instead of creating a new sale.
|
|
62
60
|
|
|
63
61
|
## Explore Each Topic
|