@commet/node 9.5.0 → 9.6.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 +39 -39
- package/dist/index.d.ts +39 -39
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/docs/api-reference/offers.md +2 -2
- package/docs/api-reference/plans.md +1 -1
- package/docs/api-reference/promo-codes.md +2 -2
- package/docs/api-reference/subscriptions.md +3 -3
- package/docs/documentation/api-versioning.md +1 -0
- package/docs/documentation/cli.md +13 -13
- package/docs/documentation/invoicing/invoices-and-billing-cycles.md +10 -9
- package/docs/documentation/plans/balance-and-top-ups.md +1 -1
- package/docs/documentation/plans/consumption-models.md +7 -7
- package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +1 -1
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +8 -8
- package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +6 -6
- package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +1 -1
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +2 -0
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +13 -13
- package/docs/schemas.md +10 -9
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ Replace reusable offer terms. Existing applications keep their immutable accepte
|
|
|
30
30
|
|
|
31
31
|
- `id` (`string`, required)
|
|
32
32
|
- `name` (`string`, required)
|
|
33
|
-
- `phases` (`Array<{ type: "free_trial"; durationDays: number } | { type: "percentage"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
33
|
+
- `phases` (`Array<{ type: "free_trial"; durationDays: number } | { type: "percentage"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
34
34
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
35
35
|
- `startsAt` (`string | null`, optional)
|
|
36
36
|
- `endsAt` (`string | null`, optional)
|
|
@@ -89,7 +89,7 @@ Create reusable offer terms without assigning a plan, price, eligibility rule, o
|
|
|
89
89
|
### Parameters
|
|
90
90
|
|
|
91
91
|
- `name` (`string`, required)
|
|
92
|
-
- `phases` (`Array<{ type: "free_trial"; durationDays: number } | { type: "percentage"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
92
|
+
- `phases` (`Array<{ type: "free_trial"; durationDays: number } | { type: "percentage"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
93
93
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
94
94
|
- `startsAt` (`string | null`, optional)
|
|
95
95
|
- `endsAt` (`string | null`, optional)
|
|
@@ -189,7 +189,7 @@ Add a base price or a selectable market price variant. Variants inherit their ba
|
|
|
189
189
|
### Parameters
|
|
190
190
|
|
|
191
191
|
- `id` (`string`, required)
|
|
192
|
-
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "yearly" | "one_time"`, required)
|
|
192
|
+
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time"`, required)
|
|
193
193
|
- `metadata` (`Record<string, unknown>`, optional)
|
|
194
194
|
- `price` (`number`, optional)
|
|
195
195
|
- `trialDays` (`number`, optional)
|
|
@@ -29,7 +29,7 @@ Update a promo code's billing interval, redemption limits, expiration, active st
|
|
|
29
29
|
### Parameters
|
|
30
30
|
|
|
31
31
|
- `id` (`string`, required)
|
|
32
|
-
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null`, optional)
|
|
32
|
+
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null`, optional)
|
|
33
33
|
- `maxRedemptions` (`number | null`, optional)
|
|
34
34
|
- `expiresAt` (`string | null`, optional)
|
|
35
35
|
- `active` (`boolean`, optional)
|
|
@@ -72,7 +72,7 @@ Create a distribution code for an existing Offer with one or more sequential dis
|
|
|
72
72
|
|
|
73
73
|
- `code` (`string`, required)
|
|
74
74
|
- `offerId` (`string`, required)
|
|
75
|
-
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null`, optional)
|
|
75
|
+
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null`, optional)
|
|
76
76
|
- `maxRedemptions` (`number`, optional)
|
|
77
77
|
- `expiresAt` (`string`, optional)
|
|
78
78
|
- `planIds` (`Array<string>`, optional)
|
|
@@ -118,7 +118,7 @@ Upgrade or change billing interval immediately, optionally applying an Offer. Sc
|
|
|
118
118
|
|
|
119
119
|
- `id` (`string`, required)
|
|
120
120
|
- `newPlanId` (`string`, optional)
|
|
121
|
-
- `newBillingInterval` (`"weekly" | "monthly" | "quarterly" | "yearly"`, optional)
|
|
121
|
+
- `newBillingInterval` (`"weekly" | "monthly" | "quarterly" | "semiannual" | "yearly"`, optional)
|
|
122
122
|
- `successUrl` (`string`, optional)
|
|
123
123
|
- `offerId` (`string`, optional)
|
|
124
124
|
|
|
@@ -281,7 +281,7 @@ Preview proration details for an immediate plan change without applying it. Free
|
|
|
281
281
|
|
|
282
282
|
- `id` (`string`, required)
|
|
283
283
|
- `planId` (`string`, required)
|
|
284
|
-
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "yearly" | "one_time"`, optional)
|
|
284
|
+
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time"`, optional)
|
|
285
285
|
- `offerId` (`string`, optional)
|
|
286
286
|
|
|
287
287
|
### Request options
|
|
@@ -433,7 +433,7 @@ Create a subscription for a customer. Commet selects the default price when pric
|
|
|
433
433
|
### Parameters
|
|
434
434
|
|
|
435
435
|
- `customerId` (`string`, required)
|
|
436
|
-
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null`, optional)
|
|
436
|
+
- `billingInterval` (`"weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null`, optional)
|
|
437
437
|
- `priceId` (`string`, optional) — Public price ID. When omitted, Commet selects the default price for the billing interval and still applies its market pricing.
|
|
438
438
|
- `initialSeats` (`Record<string, number>`, optional)
|
|
439
439
|
- `provider` (`"stripe" | "commet" | "dlocal" | string`, optional) — Payment provider name or exact public payment connection ID for the initial checkout. Overrides country routing when present.
|
|
@@ -48,6 +48,7 @@ Non-breaking changes ship continuously and never require a version bump:
|
|
|
48
48
|
- New event types
|
|
49
49
|
- New API endpoints
|
|
50
50
|
- New optional request parameters
|
|
51
|
+
- New values in existing enums, such as a new billing interval. Your integration should accept values it does not recognize instead of failing
|
|
51
52
|
|
|
52
53
|
## Backward compatibility policy
|
|
53
54
|
|
|
@@ -273,7 +273,7 @@ commet subscriptions create \
|
|
|
273
273
|
| `--customer-id <id>` | Yes | Customer ID |
|
|
274
274
|
| `--plan-code <code>` | One of `plan-code` / `plan-id` | Plan code |
|
|
275
275
|
| `--plan-id <id>` | One of `plan-code` / `plan-id` | Plan ID |
|
|
276
|
-
| `--billing-interval <interval>` | No | `weekly`, `monthly`, `quarterly`, `yearly`, `one_time`
|
|
276
|
+
| `--billing-interval <interval>` | No | `weekly`, `monthly`, `quarterly`, `semiannual`, `yearly`, `one_time` |
|
|
277
277
|
| `--price-id <id>` | No | Selectable plan price. Omit it to use the interval default and its market pricing |
|
|
278
278
|
| `--initial-seats <json>` | No | Initial seats as JSON: `{featureCode: count}` |
|
|
279
279
|
| `--skip-trial <bool>` | No | Skip trial period |
|
|
@@ -404,18 +404,18 @@ commet plans add-price \
|
|
|
404
404
|
--trial-days 14
|
|
405
405
|
```
|
|
406
406
|
|
|
407
|
-
| Flag | Required | Description
|
|
408
|
-
| ------------------------------- | ----------------------------------------- |
|
|
409
|
-
| `--plan-id <id>` | Yes | Plan ID
|
|
410
|
-
| `--billing-interval <interval>` | Yes | `weekly`, `monthly`, `quarterly`, `yearly`, `one_time`
|
|
411
|
-
| `--price <n>` | One of `price` / `inherits-from-price-id` | Base price in the currency's minor unit
|
|
412
|
-
| `--inherits-from-price-id <id>` | One of `price` / `inherits-from-price-id` | Base price inherited by a selectable variant
|
|
413
|
-
| `--trial-days <n>` | No | Trial period in days
|
|
414
|
-
| `--is-default <bool>` | No | Set as default price
|
|
415
|
-
| `--included-balance <n>` | No | Included balance amount
|
|
416
|
-
| `--included-credits <n>` | No | Included credits amount
|
|
417
|
-
| `--market-prices <json>` | Required for a variant | Market prices as `{marketGroupId, currency, price}` objects
|
|
418
|
-
| `--metadata <json>` | No | Price metadata
|
|
407
|
+
| Flag | Required | Description |
|
|
408
|
+
| ------------------------------- | ----------------------------------------- | -------------------------------------------------------------------- |
|
|
409
|
+
| `--plan-id <id>` | Yes | Plan ID |
|
|
410
|
+
| `--billing-interval <interval>` | Yes | `weekly`, `monthly`, `quarterly`, `semiannual`, `yearly`, `one_time` |
|
|
411
|
+
| `--price <n>` | One of `price` / `inherits-from-price-id` | Base price in the currency's minor unit |
|
|
412
|
+
| `--inherits-from-price-id <id>` | One of `price` / `inherits-from-price-id` | Base price inherited by a selectable variant |
|
|
413
|
+
| `--trial-days <n>` | No | Trial period in days |
|
|
414
|
+
| `--is-default <bool>` | No | Set as default price |
|
|
415
|
+
| `--included-balance <n>` | No | Included balance amount |
|
|
416
|
+
| `--included-credits <n>` | No | Included credits amount |
|
|
417
|
+
| `--market-prices <json>` | Required for a variant | Market prices as `{marketGroupId, currency, price}` objects |
|
|
418
|
+
| `--metadata <json>` | No | Price metadata |
|
|
419
419
|
|
|
420
420
|
Create a selectable variant that changes only Argentina and inherits the rest of the base price:
|
|
421
421
|
|
|
@@ -10,7 +10,7 @@ Invoices are the financial records Commet generates automatically whenever a sub
|
|
|
10
10
|
| Type | When Generated | Example |
|
|
11
11
|
| --------------------- | ------------------------------------------------------- | ------------------------------------------ |
|
|
12
12
|
| **Recurring** | Every billing cycle | $99 plan base + $12.50 overage |
|
|
13
|
-
| **Overage** | Between cycles (quarterly
|
|
13
|
+
| **Overage** | Between cycles (quarterly, semiannual, and yearly only) | 15k extra API calls billed monthly |
|
|
14
14
|
| **Plan change** | Customer upgrades mid-cycle | Starter to Pro, prorated $45 |
|
|
15
15
|
| **Credit purchase** | Customer buys a credit pack | 500 credits for $40 |
|
|
16
16
|
| **Balance top-up** | Customer adds funds | $50 balance top-up |
|
|
@@ -50,15 +50,16 @@ Each invoice is made of typed lines. The line type tells you what the charge is
|
|
|
50
50
|
|
|
51
51
|
## Billing intervals
|
|
52
52
|
|
|
53
|
-
| Interval
|
|
54
|
-
|
|
|
55
|
-
| **Weekly**
|
|
56
|
-
| **Monthly**
|
|
57
|
-
| **Quarterly**
|
|
58
|
-
| **
|
|
59
|
-
| **
|
|
53
|
+
| Interval | Base Invoice | Overage Invoice | Consumption Reset | Example |
|
|
54
|
+
| -------------- | ------------------------- | --------------------------------- | ----------------- | ----------------------------------------- |
|
|
55
|
+
| **Weekly** | Every 7 days | Included in recurring invoice | Every 7 days | $25/week every Monday |
|
|
56
|
+
| **Monthly** | Every month | Included in recurring invoice | Every month | $99/month on the 1st |
|
|
57
|
+
| **Quarterly** | Every 3 months | Monthly | Every month | $297 base quarterly, overage monthly |
|
|
58
|
+
| **Semiannual** | Every 6 months | Monthly | Every month | $540 base every 6 months, overage monthly |
|
|
59
|
+
| **Yearly** | Every 12 months | Monthly | Every month | $899 base yearly, overage monthly |
|
|
60
|
+
| **One-time** | Single charge at checkout | At period end (if overage exists) | Never | $299 lifetime, no recurring charges |
|
|
60
61
|
|
|
61
|
-
For quarterly and yearly plans, overage is calculated and invoiced monthly even though the base charge is less frequent. For weekly plans, everything runs on a 7-day cycle. For one-time plans, the customer pays once at checkout and never receives a recurring invoice — only overage charges if applicable. See [One-Time Payments](/docs/one-time-payments) for details.
|
|
62
|
+
For quarterly, semiannual, and yearly plans, overage is calculated and invoiced monthly even though the base charge is less frequent. For weekly plans, everything runs on a 7-day cycle. For one-time plans, the customer pays once at checkout and never receives a recurring invoice — only overage charges if applicable. See [One-Time Payments](/docs/one-time-payments) for details.
|
|
62
63
|
|
|
63
64
|
## Learn more
|
|
64
65
|
|
|
@@ -9,7 +9,7 @@ The Balance consumption model gives a subscription a monetary allowance. Billabl
|
|
|
9
9
|
|
|
10
10
|
In **Plans**, choose **Balance**, set the amount included at each reset, and add billable features. Use [AI Token Billing](/docs/ai-token-billing) when model token cost and margin determine the charge.
|
|
11
11
|
|
|
12
|
-
Plan balance resets monthly for monthly, quarterly, yearly, free, and one-time plans. Weekly plans reset every seven days. Purchased top-ups do not survive the next reset.
|
|
12
|
+
Plan balance resets monthly for monthly, quarterly, semiannual, yearly, free, and one-time plans. Weekly plans reset every seven days. Purchased top-ups do not survive the next reset.
|
|
13
13
|
|
|
14
14
|
## Adjust balance without charging
|
|
15
15
|
|
|
@@ -62,13 +62,13 @@ Set a margin percentage instead of a fixed price. Commet looks up the model's to
|
|
|
62
62
|
|
|
63
63
|
## Comparison
|
|
64
64
|
|
|
65
|
-
| Aspect | Metered
|
|
66
|
-
| -------------------- |
|
|
67
|
-
| **When exceeded** | Overage at period end
|
|
68
|
-
| **Reset behavior** | Usage resets to 0 each period
|
|
69
|
-
| **Purchased extras** | N/A
|
|
70
|
-
| **Reset frequency** | Weekly plans reset every 7 days. Monthly, quarterly, yearly, one-time, and free plans reset monthly | Same | Same |
|
|
71
|
-
| **Customer portal** | View usage
|
|
65
|
+
| Aspect | Metered | Credits | Balance |
|
|
66
|
+
| -------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------ | ----------------------------------------- |
|
|
67
|
+
| **When exceeded** | Overage at period end | Blocked or buy packs | Overage at period end |
|
|
68
|
+
| **Reset behavior** | Usage resets to 0 each period | Plan credits reset each period | Balance resets to plan amount each period |
|
|
69
|
+
| **Purchased extras** | N/A | Credits persist forever | Top-ups reset at period |
|
|
70
|
+
| **Reset frequency** | Weekly plans reset every 7 days. Monthly, quarterly, semiannual, yearly, one-time, and free plans reset monthly | Same | Same |
|
|
71
|
+
| **Customer portal** | View usage | Buy credit packs | Add balance (top-up) |
|
|
72
72
|
|
|
73
73
|
## Overage restrictions by plan type
|
|
74
74
|
|
|
@@ -12,7 +12,7 @@ A Balance plan includes a monetary allowance that usage draws down. The balance
|
|
|
12
12
|
- An administrative adjustment adds or removes balance without charging.
|
|
13
13
|
- A usage event subtracts the feature's calculated monetary cost.
|
|
14
14
|
|
|
15
|
-
Plan balance resets monthly for monthly, quarterly, yearly, free, and one-time plans. Weekly plans reset every seven days. **Top-ups reset with the plan balance; they do not persist like credit packs.**
|
|
15
|
+
Plan balance resets monthly for monthly, quarterly, semiannual, yearly, free, and one-time plans. Weekly plans reset every seven days. **Top-ups reset with the plan balance; they do not persist like credit packs.**
|
|
16
16
|
|
|
17
17
|
Use Credits instead when purchased units must remain across resets. Use Customer Credits when the goal is to reduce an invoice rather than fund product usage.
|
|
18
18
|
|
|
@@ -7,14 +7,14 @@ A free plan has no price and no checkout. When you assign a customer to a free p
|
|
|
7
7
|
|
|
8
8
|
## How Free Plans Differ from Paid Plans
|
|
9
9
|
|
|
10
|
-
| | Paid plan
|
|
11
|
-
| -------------- |
|
|
12
|
-
| Price | Has a price
|
|
13
|
-
| Billing | Monthly, quarterly, or yearly | No charges — usage resets monthly |
|
|
14
|
-
| How they start | Checkout + payment
|
|
15
|
-
| Invoices | Yes
|
|
16
|
-
| Overage | Configurable per feature
|
|
17
|
-
| Usage resets | Every month
|
|
10
|
+
| | Paid plan | Free plan |
|
|
11
|
+
| -------------- | ----------------------------------------- | ---------------------------------------------------------- |
|
|
12
|
+
| Price | Has a price | $0 |
|
|
13
|
+
| Billing | Monthly, quarterly, semiannual, or yearly | No charges — usage resets monthly |
|
|
14
|
+
| How they start | Checkout + payment | **Activated immediately** |
|
|
15
|
+
| Invoices | Yes | Only for purchases (credits, balance, add-ons) |
|
|
16
|
+
| Overage | Configurable per feature | **Never allowed** — usage is blocked at the included limit |
|
|
17
|
+
| Usage resets | Every month | Every month |
|
|
18
18
|
|
|
19
19
|
## Monthly Usage Resets
|
|
20
20
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Billing Intervals
|
|
3
|
-
description: How weekly, monthly, quarterly, and yearly billing works and when your customers get charged
|
|
3
|
+
description: How weekly, monthly, quarterly, semiannual, and yearly billing works and when your customers get charged
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Plans can be billed weekly, monthly, quarterly, or yearly. Even on quarterly and yearly plans, Commet checks for usage charges **every month**. Here's what your customers can expect.
|
|
6
|
+
Plans can be billed weekly, monthly, quarterly, semiannually (every 6 months), or yearly. Even on quarterly, semiannual, and yearly plans, Commet checks for usage charges **every month**. Here's what your customers can expect.
|
|
7
7
|
|
|
8
8
|
## Weekly Plans
|
|
9
9
|
|
|
@@ -22,9 +22,9 @@ Your customer is billed every 7 days. The billing period, consumption resets, an
|
|
|
22
22
|
|
|
23
23
|
Straightforward: your customer is billed every month for their plan base, extra usage, and extra seats.
|
|
24
24
|
|
|
25
|
-
## Quarterly and Yearly Plans
|
|
25
|
+
## Quarterly, Semiannual, and Yearly Plans
|
|
26
26
|
|
|
27
|
-
Your customer pays the plan base every 3 or 12 months, but **usage charges can happen every month**. Here's how it works:
|
|
27
|
+
Your customer pays the plan base every 3, 6, or 12 months, but **usage charges can happen every month**. Here's how it works:
|
|
28
28
|
|
|
29
29
|
### Example: Quarterly plan at $300/quarter
|
|
30
30
|
|
|
@@ -43,7 +43,7 @@ Month 3 (renewal month):
|
|
|
43
43
|
|
|
44
44
|
> **Warning**
|
|
45
45
|
>
|
|
46
|
-
> Usage resets **every month**, not every quarter or year. A customer on a quarterly plan with 10,000 included API calls gets 10,000 calls each month — they don't accumulate.
|
|
46
|
+
> Usage resets **every month**, not every quarter, half-year, or year. A customer on a quarterly plan with 10,000 included API calls gets 10,000 calls each month — they don't accumulate.
|
|
47
47
|
|
|
48
48
|
## What Your Customer Sees
|
|
49
49
|
|
|
@@ -56,7 +56,7 @@ Month 3 (renewal month):
|
|
|
56
56
|
|
|
57
57
|
## Plan Changes Mid-Cycle
|
|
58
58
|
|
|
59
|
-
If your customer upgrades a quarterly or yearly plan mid-cycle, they get credit for the unused portion and start a new cycle from the change date. See [Proration](/docs/how-is-proration-calculated-when-changing-plans) for the exact calculation.
|
|
59
|
+
If your customer upgrades a quarterly, semiannual, or yearly plan mid-cycle, they get credit for the unused portion and start a new cycle from the change date. See [Proration](/docs/how-is-proration-calculated-when-changing-plans) for the exact calculation.
|
|
60
60
|
|
|
61
61
|
### Example
|
|
62
62
|
|
|
@@ -55,7 +55,7 @@ On January 15 (15 days remaining)
|
|
|
55
55
|
>
|
|
56
56
|
> Your customer's 8 seats are now fully covered by the Business plan's 10 included seats, so they stop paying for extra seats. If they had more seats than the new plan includes, the excess would be billed for the full new period in advance.
|
|
57
57
|
|
|
58
|
-
## Quarterly and Yearly Plans
|
|
58
|
+
## Quarterly, Semiannual, and Yearly Plans
|
|
59
59
|
|
|
60
60
|
The same calculation applies — the only difference is the cycle length.
|
|
61
61
|
|
|
@@ -56,6 +56,8 @@ They pay today: $99 (full month)
|
|
|
56
56
|
| Shorter → longer interval, such as monthly → yearly | **Immediate** |
|
|
57
57
|
| Longer → shorter interval, such as yearly → monthly | At renewal |
|
|
58
58
|
|
|
59
|
+
Intervals go from shortest to longest: weekly, monthly, quarterly, semiannual, yearly.
|
|
60
|
+
|
|
59
61
|
Interval direction takes precedence over `sortOrder` when both the plan and interval change. A paid-to-free change is always scheduled, even if the destination plan has a higher `sortOrder`.
|
|
60
62
|
|
|
61
63
|
## Deprecating a Plan
|
|
@@ -7,17 +7,17 @@ Your customers receive invoices automatically based on what happens in their sub
|
|
|
7
7
|
|
|
8
8
|
## Types of Invoices
|
|
9
9
|
|
|
10
|
-
| Invoice | When your customer receives it
|
|
11
|
-
| ----------------- |
|
|
12
|
-
| Recurring | Every billing cycle — includes plan base, extra usage, and extra seats
|
|
13
|
-
| Overage | Between billing cycles (quarterly
|
|
14
|
-
| Plan change | When they upgrade or switch plans mid-cycle
|
|
15
|
-
| Credit purchase | When they buy a credit pack
|
|
16
|
-
| Balance top-up | When they add funds to their balance
|
|
17
|
-
| Add-on activation | When they activate an add-on mid-cycle (prorated)
|
|
18
|
-
| One-time payment | When they pay a payment link or a standalone charge
|
|
19
|
-
| Reactivation | When a canceled subscription is reactivated
|
|
20
|
-
| Adjustment | When you manually issue a correction or one-off charge
|
|
10
|
+
| Invoice | When your customer receives it |
|
|
11
|
+
| ----------------- | --------------------------------------------------------------------------------------------- |
|
|
12
|
+
| Recurring | Every billing cycle — includes plan base, extra usage, and extra seats |
|
|
13
|
+
| Overage | Between billing cycles (quarterly, semiannual, and yearly plans only) if they had extra usage |
|
|
14
|
+
| Plan change | When they upgrade or switch plans mid-cycle |
|
|
15
|
+
| Credit purchase | When they buy a credit pack |
|
|
16
|
+
| Balance top-up | When they add funds to their balance |
|
|
17
|
+
| Add-on activation | When they activate an add-on mid-cycle (prorated) |
|
|
18
|
+
| One-time payment | When they pay a payment link or a standalone charge |
|
|
19
|
+
| Reactivation | When a canceled subscription is reactivated |
|
|
20
|
+
| Adjustment | When you manually issue a correction or one-off charge |
|
|
21
21
|
|
|
22
22
|
## Recurring
|
|
23
23
|
|
|
@@ -40,7 +40,7 @@ Monthly invoice for a customer on Plan Pro at $99/mo:
|
|
|
40
40
|
|
|
41
41
|
## Overage
|
|
42
42
|
|
|
43
|
-
For customers on quarterly or yearly plans, if they go over their included usage **between billing cycles**, they receive a smaller invoice covering just the extra usage. No plan base or seat charges — just the overage.
|
|
43
|
+
For customers on quarterly, semiannual, or yearly plans, if they go over their included usage **between billing cycles**, they receive a smaller invoice covering just the extra usage. No plan base or seat charges — just the overage.
|
|
44
44
|
|
|
45
45
|
### Example
|
|
46
46
|
|
|
@@ -95,6 +95,6 @@ Every invoice is built from these line types:
|
|
|
95
95
|
|
|
96
96
|
## Related
|
|
97
97
|
|
|
98
|
-
- [Billing Intervals](/docs/how-do-monthly-quarterly-and-yearly-billing-work) — When quarterly and yearly customers get charged
|
|
98
|
+
- [Billing Intervals](/docs/how-do-monthly-quarterly-and-yearly-billing-work) — When quarterly, semiannual, and yearly customers get charged
|
|
99
99
|
- [Proration](/docs/how-is-proration-calculated-when-changing-plans) — How mid-cycle charges are calculated
|
|
100
100
|
- [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — When plan change invoices are created
|
package/docs/schemas.md
CHANGED
|
@@ -9,6 +9,7 @@ Generated from Commet API version `2026-08-27`.
|
|
|
9
9
|
- `"weekly"`
|
|
10
10
|
- `"monthly"`
|
|
11
11
|
- `"quarterly"`
|
|
12
|
+
- `"semiannual"`
|
|
12
13
|
- `"yearly"`
|
|
13
14
|
- `"one_time"`
|
|
14
15
|
|
|
@@ -424,7 +425,7 @@ Variants:
|
|
|
424
425
|
|
|
425
426
|
- `id` (`string`, required)
|
|
426
427
|
- `name` (`string`, required)
|
|
427
|
-
- `phases` (`Array<{ type: "free_trial"; durationDays: number } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
428
|
+
- `phases` (`Array<{ type: "free_trial"; durationDays: number } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
428
429
|
- `metadata` (`Record<string, unknown>`, required)
|
|
429
430
|
- `startsAt` (`string | null`, required)
|
|
430
431
|
- `endsAt` (`string | null`, required)
|
|
@@ -517,9 +518,9 @@ Variants:
|
|
|
517
518
|
|
|
518
519
|
Variants:
|
|
519
520
|
|
|
520
|
-
- `{ outcome: "requires_checkout"; requiresCheckout: true; checkoutUrl: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
|
|
521
|
+
- `{ outcome: "requires_checkout"; requiresCheckout: true; checkoutUrl: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
|
|
521
522
|
- `{ outcome: "scheduled"; id: string; scheduled: true; scheduledFor: string; changeType: "subscription.plan_downgrade" | "subscription.interval_change" | "subscription.cancel"; customerId: string; newPlanId?: string; newPlanName?: string; newBillingInterval?: string; seatLimitWarning?: { featureCode: string; featureName: string; currentSeats: number; included: number; newPlanName: string; effectiveDate: string }; object: "plan_change"; livemode: boolean }`
|
|
522
|
-
- `{ outcome: "completed"; id: string; scheduled: false; customerId: string; previousPlan: { id: string; name: string }; currentPlan: { id: string; name: string; price: number }; billingInterval: string; billing: { credit: number; creditsApplied: number; charge: number; taxAmount: number; netAmount: number; totalCharged: number; remainingCreditBalance: number }; invoiceId?: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
|
|
523
|
+
- `{ outcome: "completed"; id: string; scheduled: false; customerId: string; previousPlan: { id: string; name: string }; currentPlan: { id: string; name: string; price: number }; billingInterval: string; billing: { credit: number; creditsApplied: number; charge: number; taxAmount: number; netAmount: number; totalCharged: number; remainingCreditBalance: number }; invoiceId?: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
|
|
523
524
|
|
|
524
525
|
### PlanFeature
|
|
525
526
|
|
|
@@ -632,7 +633,7 @@ Variants:
|
|
|
632
633
|
- `daysRemaining` (`number`, required)
|
|
633
634
|
- `totalDays` (`number`, required)
|
|
634
635
|
- `isUpgrade` (`boolean`, required)
|
|
635
|
-
- `offerApplication` (`{ id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }`, optional)
|
|
636
|
+
- `offerApplication` (`{ id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }`, optional)
|
|
636
637
|
- `object` (`"plan_change_preview"`, required)
|
|
637
638
|
- `livemode` (`boolean`, required)
|
|
638
639
|
|
|
@@ -656,7 +657,7 @@ Variants:
|
|
|
656
657
|
- `subscriptionId` (`string`, required)
|
|
657
658
|
- `invoiceId` (`string`, required)
|
|
658
659
|
- `status` (`"processing" | "succeeded"`, required)
|
|
659
|
-
- `offerApplication` (`{ id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }`, optional)
|
|
660
|
+
- `offerApplication` (`{ id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }`, optional)
|
|
660
661
|
- `object` (`"subscription_reactivation"`, required)
|
|
661
662
|
- `livemode` (`boolean`, required)
|
|
662
663
|
|
|
@@ -792,10 +793,10 @@ Variants:
|
|
|
792
793
|
|
|
793
794
|
Variants:
|
|
794
795
|
|
|
795
|
-
- `{ type: "free_trial"; durationDays: number; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null }`
|
|
796
|
-
- `{ type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; percentage: number; startsAt: string | null; endsAt: string | null }`
|
|
797
|
-
- `{ type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; amount: number; startsAt: string | null; endsAt: string | null }`
|
|
798
|
-
- `{ type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; price: number; startsAt: string | null; endsAt: string | null }`
|
|
796
|
+
- `{ type: "free_trial"; durationDays: number; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null }`
|
|
797
|
+
- `{ type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; percentage: number; startsAt: string | null; endsAt: string | null }`
|
|
798
|
+
- `{ type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; amount: number; startsAt: string | null; endsAt: string | null }`
|
|
799
|
+
- `{ type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; price: number; startsAt: string | null; endsAt: string | null }`
|
|
799
800
|
|
|
800
801
|
### SubscriptionResume
|
|
801
802
|
|