@commet/node 9.8.0 → 9.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1021 -30
- package/dist/index.d.ts +1021 -30
- package/dist/index.js +204 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -11
- package/dist/index.mjs.map +1 -1
- package/docs/ai-onboarding/mcp-server.md +2 -0
- package/docs/api-reference/addons.md +3 -1
- package/docs/api-reference/credit-packs.md +3 -1
- package/docs/api-reference/customers.md +2 -0
- package/docs/api-reference/generated-webhooks.md +2 -2
- package/docs/api-reference/index.md +3 -3
- package/docs/api-reference/plans.md +488 -6
- package/docs/api-reference/subscriptions.md +50 -8
- package/docs/documentation/api-versioning.md +8 -2
- package/docs/documentation/cli.md +64 -49
- package/docs/documentation/create-api-key.md +3 -1
- package/docs/documentation/customers/customer-portal.md +10 -2
- package/docs/documentation/customers/manage-customers.md +2 -1
- package/docs/documentation/finance/payouts.md +11 -0
- package/docs/documentation/finance/supported-countries.md +5 -5
- package/docs/documentation/invoicing/handle-failed-payments.md +9 -9
- package/docs/documentation/payments/accept-one-time-payments.md +1 -1
- package/docs/documentation/payments/payment-orchestration.md +2 -0
- package/docs/documentation/payments/payment-providers.md +46 -0
- package/docs/documentation/payments/transactions-refunds-and-retries.md +1 -1
- package/docs/documentation/plans/add-ons.md +15 -4
- package/docs/documentation/plans/consumption-models.md +44 -9
- package/docs/documentation/plans/create-plans.md +5 -1
- package/docs/documentation/plans/credit-packs.md +61 -3
- package/docs/documentation/plans/one-time-payments.md +3 -3
- package/docs/documentation/plans/plan-groups.md +46 -10
- package/docs/documentation/plans/plan-versions.md +265 -0
- package/docs/documentation/platform/dashboard-metrics-and-events.md +40 -9
- package/docs/documentation/sales/connect-dub-affiliates.md +52 -0
- package/docs/documentation/sales/introductory-offers.md +7 -13
- package/docs/documentation/sales/offers.md +10 -6
- package/docs/documentation/sales/promo-codes.md +47 -17
- package/docs/documentation/sales/promotional-offers.md +6 -7
- package/docs/documentation/sales/regional-prices.md +38 -8
- package/docs/documentation/sales/trial-periods.md +67 -40
- package/docs/documentation/subscriptions/manage-subscriptions.md +114 -14
- package/docs/documentation/subscriptions/pay-in-advance.md +4 -7
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +22 -2
- package/docs/documentation/testing-sandbox.md +2 -0
- package/docs/documentation/usage/track-usage.md +23 -0
- package/docs/errors/addon_has_activations.md +2 -2
- package/docs/errors/addon_unavailable.md +22 -0
- package/docs/errors/credit_pack_unavailable.md +22 -0
- package/docs/errors/index.md +9 -2
- package/docs/errors/missing_regional_price.md +3 -3
- package/docs/errors/plan_balance_limit_reached.md +22 -0
- package/docs/errors/plan_experiment_not_found.md +22 -0
- package/docs/errors/plan_version_not_found.md +22 -0
- package/docs/errors/subscribers_do_not_fit.md +22 -0
- package/docs/errors/version_not_newer.md +22 -0
- package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +8 -8
- package/docs/knowledge-base/how-do-discounts-work.md +7 -5
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +18 -11
- package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +1 -1
- package/docs/knowledge-base/how-do-trial-periods-work.md +31 -25
- package/docs/knowledge-base/how-does-billing-work.md +26 -27
- package/docs/knowledge-base/how-does-quota-based-billing-work.md +12 -22
- package/docs/knowledge-base/how-does-seat-based-billing-work.md +12 -22
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +11 -8
- package/docs/knowledge-base/what-happens-when-a-payment-fails.md +11 -9
- package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +34 -29
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -1
- package/docs/manifest.json +201 -2
- package/docs/platform-documentation.md +2 -0
- package/docs/schemas.md +134 -14
- package/docs/webhooks/introduction.md +17 -13
- package/docs/webhooks.md +66 -6
- package/docs/webhooks.openapi.json +1218 -876
- package/package.json +1 -1
|
@@ -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.
|
|
@@ -97,24 +97,29 @@ $createdSubscription = $commet->subscriptions->create(
|
|
|
97
97
|
);
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
For a paid plan, redirect the customer to `checkoutUrl`. Free plans
|
|
100
|
+
For a paid plan, redirect the customer to `checkoutUrl`. Free plans and [trials without a payment method](/docs/trial-periods#start-a-trial-without-a-payment-method) start without checkout and return `checkoutUrl: null`; `hasPaymentMethod` tells whether Commet can charge the subscription on its own.
|
|
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
|
|
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
|
|
|
@@ -402,6 +409,8 @@ $subscription = $commet->subscriptions->cancel(id: 'sub_xxx');
|
|
|
402
409
|
|
|
403
410
|
A normal paid active subscription schedules cancellation at period end unless `immediate: true` is sent. Free, pending-payment, and past-due relationships cancel immediately. Cancellation does not erase the stored subscription balance.
|
|
404
411
|
|
|
412
|
+
The API cancels even when the plan group has a [default plan](/docs/plan-groups#default-plan-and-signup-trial). A paid plan canceled from the Customer Portal moves to that default plan at period end instead.
|
|
413
|
+
|
|
405
414
|
Canceling a paused subscription is immediate and discards its preserved time. Pending usage, overage, or seat adjustments may still produce a final invoice. To cancel while a future pause is scheduled, revoke that pause first.
|
|
406
415
|
|
|
407
416
|
## Reverse a scheduled cancellation
|
|
@@ -467,9 +476,98 @@ $subscription = $commet->subscriptions->uncancel(id: 'sub_xxx');
|
|
|
467
476
|
|
|
468
477
|
`uncancel` works only before an end-of-period cancellation takes effect. It keeps the same subscription and current period.
|
|
469
478
|
|
|
479
|
+
## Revoke a scheduled plan change
|
|
480
|
+
|
|
481
|
+
Keep the current plan when a downgrade or interval change is scheduled for the end of the period:
|
|
482
|
+
|
|
483
|
+
**TypeScript**
|
|
484
|
+
|
|
485
|
+
```typescript
|
|
486
|
+
import { Commet } from "@commet/node";
|
|
487
|
+
|
|
488
|
+
const commet = new Commet({ apiKey: "ck_xxx" });
|
|
489
|
+
|
|
490
|
+
const subscription = await commet.subscriptions.revokeScheduledPlanChange({ id: "sub_xxx" });
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
**Python**
|
|
494
|
+
|
|
495
|
+
```python
|
|
496
|
+
from commet import Commet
|
|
497
|
+
|
|
498
|
+
commet = Commet("ck_xxx")
|
|
499
|
+
|
|
500
|
+
subscription = commet.subscriptions.revoke_scheduled_plan_change("sub_xxx")
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
**Go**
|
|
504
|
+
|
|
505
|
+
```go
|
|
506
|
+
client, err := commet.New("ck_xxx")
|
|
507
|
+
if err != nil {
|
|
508
|
+
log.Fatal(err)
|
|
509
|
+
}
|
|
510
|
+
ctx := context.Background()
|
|
511
|
+
|
|
512
|
+
subscription, err := client.Subscriptions.RevokeScheduledPlanChange(ctx, "sub_xxx")
|
|
513
|
+
if err != nil {
|
|
514
|
+
log.Fatal(err)
|
|
515
|
+
}
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
**Java**
|
|
519
|
+
|
|
520
|
+
```java
|
|
521
|
+
import co.commet.Commet;
|
|
522
|
+
|
|
523
|
+
var commet = Commet.builder().apiKey("ck_xxx").build();
|
|
524
|
+
|
|
525
|
+
var subscription = commet.subscriptions().revokeScheduledPlanChange("sub_xxx");
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
**PHP**
|
|
529
|
+
|
|
530
|
+
```php
|
|
531
|
+
use Commet\Commet;
|
|
532
|
+
|
|
533
|
+
$commet = new Commet('ck_xxx');
|
|
534
|
+
|
|
535
|
+
$subscription = $commet->subscriptions->revokeScheduledPlanChange(id: 'sub_xxx');
|
|
536
|
+
```
|
|
537
|
+
|
|
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`.
|
|
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
|
+
|
|
470
568
|
## Recover a past-due subscription
|
|
471
569
|
|
|
472
|
-
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:
|
|
473
571
|
|
|
474
572
|
**TypeScript**
|
|
475
573
|
|
|
@@ -597,4 +695,6 @@ Automatic dunning retries are anchored to the original decline on days 1, 3, 5,
|
|
|
597
695
|
|
|
598
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.
|
|
599
697
|
|
|
600
|
-
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.
|
|
@@ -13,7 +13,7 @@ Paying in advance doesn't decide whether the subscription renews afterward. To s
|
|
|
13
13
|
|
|
14
14
|
> **Warning**
|
|
15
15
|
>
|
|
16
|
-
> **Free trials don't combine with paying in advance.** With `prepaidPeriods` above `1` or `cancelAtPeriodEnd: true`,
|
|
16
|
+
> **Free trials don't combine with paying in advance.** With `prepaidPeriods` above `1` or `cancelAtPeriodEnd: true`, `customTrialDays` above `0` returns `400` and the price's trial is skipped.
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
curl -X POST https://commet.co/api/v1/subscriptions \
|
|
@@ -66,10 +66,10 @@ Commet voids an unpaid link and emits [`invoice.voided`](/docs/webhooks/invoice-
|
|
|
66
66
|
| Response | Cause |
|
|
67
67
|
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
68
|
| `400 validation_error` | The price is one-time or the plan is free |
|
|
69
|
-
| `400 validation_error` | `offerId`
|
|
69
|
+
| `400 validation_error` | `offerId` is unavailable or was sent for a `pending_payment` subscription. `param` is `offerId` |
|
|
70
70
|
| `400 validation_error` | An Offer bills on another interval. See [Offers billed on another interval](#offers-billed-on-another-interval) |
|
|
71
71
|
| `400 validation_error` | The total is below the minimum charge, such as with a 100% Offer. `param` is `offerId` when you sent one, `periods` otherwise. The previous unpaid link stays payable |
|
|
72
|
-
| `409 invalid_subscription_status` | The subscription isn't `active` or awaiting its first payment, it
|
|
72
|
+
| `409 invalid_subscription_status` | The subscription isn't `active` or awaiting its first payment, it starts with a free trial, or a pause is scheduled |
|
|
73
73
|
| `409 charge_in_progress` | A payment for the link being replaced couldn't be canceled, such as a generated OXXO voucher |
|
|
74
74
|
|
|
75
75
|
## How each period is priced
|
|
@@ -89,10 +89,7 @@ Payment → $20
|
|
|
89
89
|
|
|
90
90
|
For the first payment, the currency and country price are resolved at checkout, as for any subscription. Offers run for their full configured duration starting at the first paid period. An Offer assigned with `PUT /v1/subscriptions/{id}/offer` to a subscription with paid periods left starts at the first renewal that charges, after the last paid period.
|
|
91
91
|
|
|
92
|
-
[Card Promotions](/docs/card-promotions) behave as on any subscription. [Promo Codes](/docs/promo-codes) do too, with
|
|
93
|
-
|
|
94
|
-
- A link that adds periods to an active subscription keeps the price it was created with, so a Promo Code entered there is rejected with "Promo codes can't be used on a link that adds billing periods".
|
|
95
|
-
- A trial Promo Code entered on a checkout that pays several periods or on a one-time purchase is rejected with "Trial codes can't be used when paying in advance".
|
|
92
|
+
[Card Promotions](/docs/card-promotions) behave as on any subscription. [Promo Codes](/docs/promo-codes) do too, with one exception: a link that adds periods to an active subscription keeps the price it was created with, so a Promo Code entered there is rejected with "Promo codes can't be used on a link that adds billing periods".
|
|
96
93
|
|
|
97
94
|
### Offers billed on another interval
|
|
98
95
|
|
|
@@ -14,15 +14,35 @@ Customers change plans through the [Customer Portal](/docs/customer-portal) or f
|
|
|
14
14
|
| **Interval change (up)** | Applied immediately | Monthly → Yearly |
|
|
15
15
|
| **Interval change (down)** | Takes effect at next renewal | Yearly → Monthly |
|
|
16
16
|
|
|
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
|
|
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
|
+
|
|
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
|
+
|
|
21
|
+
Immediate changes accept an `offerId` or a [`promoCode`](/docs/promo-codes#apply-a-code-on-a-plan-change). Scheduled changes accept neither.
|
|
18
22
|
|
|
19
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.
|
|
20
24
|
|
|
25
|
+
During a trial without a payment method, an immediate change returns `409 no_payment_method`. Scheduled changes still apply.
|
|
26
|
+
|
|
21
27
|
If you need to expand features or limits temporarily without changing the subscription's plan, price, or billing cycle, use a [Plan Grant](/docs/plan-grants) instead.
|
|
22
28
|
|
|
29
|
+
## Revoke a scheduled plan change
|
|
30
|
+
|
|
31
|
+
A scheduled downgrade or interval change can be revoked before it takes effect, so the subscription stays on its current plan:
|
|
32
|
+
|
|
33
|
+
- Customers choose **Keep current plan** in the portal.
|
|
34
|
+
- In the dashboard, open the subscription and choose **Revert plan change**.
|
|
35
|
+
- Through the API, call `DELETE /subscriptions/{id}/scheduled-plan-change`.
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
await commet.subscriptions.revokeScheduledPlanChange({ id: 'sub_xxx' })
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
A subscription with nothing scheduled returns `409 no_scheduled_plan_change`. One whose payment authorization must be renewed first returns `409 no_payment_method`.
|
|
42
|
+
|
|
23
43
|
## Dashboard
|
|
24
44
|
|
|
25
|
-
From a customer's subscription detail page, click **Change
|
|
45
|
+
From a customer's subscription detail page, click **Change plan** and select the new plan. The same upgrade/downgrade rules apply.
|
|
26
46
|
|
|
27
47
|
## Learn more
|
|
28
48
|
|
|
@@ -30,6 +30,8 @@ await commet.usage.track({
|
|
|
30
30
|
})
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
Commet doesn't send emails whose recipients are all on reserved domains: `example.com`, `example.net`, `example.org` and their subdomains, and the `.example`, `.test`, `.invalid`, and `.localhost` domains. They still show as sent. Use a real inbox to check customer emails.
|
|
34
|
+
|
|
33
35
|
## Dev Tools Panel
|
|
34
36
|
|
|
35
37
|
A floating widget that appears on all sandbox pages. The [**Test Clock**](#test-clock) tab is available everywhere. The [**Test Data**](#test-data) tab (address and card presets) only appears on checkout pages.
|
|
@@ -273,3 +273,26 @@ $usageCheck = $commet->usage->check(
|
|
|
273
273
|
featureCode: 'api_calls',
|
|
274
274
|
);
|
|
275
275
|
```
|
|
276
|
+
|
|
277
|
+
## Limit plan credit spending
|
|
278
|
+
|
|
279
|
+
When a credits plan has a [plan credit limit](/docs/consumption-models#limit-plan-credit-spending), an event that would spend more plan credits than the current day or week allows, and that purchased credits can't cover, is rejected with `402 plan_credit_limit_reached`. Nothing is deducted.
|
|
280
|
+
|
|
281
|
+
Usage Check reports the same case before you consume:
|
|
282
|
+
|
|
283
|
+
```json
|
|
284
|
+
{
|
|
285
|
+
"allowed": false,
|
|
286
|
+
"reason": "plan_credit_limit_reached",
|
|
287
|
+
"consumptionModel": "credits",
|
|
288
|
+
"planCreditLimit": {
|
|
289
|
+
"credits": 100,
|
|
290
|
+
"interval": "day",
|
|
291
|
+
"spent": 100,
|
|
292
|
+
"remaining": 0,
|
|
293
|
+
"resetsAt": "2026-11-03T14:00:00.000Z"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Only plan credits count toward the limit. Accepted events return the updated limit in `consumption.planCreditLimit`. Show `remaining` and `resetsAt` to the customer, or let them [buy credits](/docs/credit-packs#buy-a-chosen-quantity-of-credits), which the limit never caps.
|
|
@@ -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.
|
|
@@ -33,7 +36,8 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
|
|
|
33
36
|
- [`insufficient_seats`](./insufficient_seats.md) — The requested seat removal exceeds the subscription's available seat balance.
|
|
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.
|
|
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.
|
|
37
41
|
- [`payment_failed`](./payment_failed.md) — The operation could not complete its payment or required tax calculation.
|
|
38
42
|
- [`payment_not_found`](./payment_not_found.md) — The requested payment does not exist in this organization.
|
|
39
43
|
- [`payment_method_not_found`](./payment_method_not_found.md) — The requested or required payment method could not be found.
|
|
@@ -55,6 +59,7 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
|
|
|
55
59
|
- [`idempotency_unavailable`](./idempotency_unavailable.md) — Platform could not safely establish, release, or persist the idempotent response for this operation.
|
|
56
60
|
- [`seat_limit_exceeded`](./seat_limit_exceeded.md) — The requested plan change would exceed the available seat limit.
|
|
57
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.
|
|
58
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.
|
|
59
64
|
- [`free_plan_change_not_supported`](./free_plan_change_not_supported.md) — This plan-change operation does not support the selected free plan.
|
|
60
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.
|
|
@@ -62,12 +67,14 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
|
|
|
62
67
|
- [`addon_not_found`](./addon_not_found.md) — The requested add-on does not exist in this organization.
|
|
63
68
|
- [`addon_already_active`](./addon_already_active.md) — The add-on is already active on this subscription.
|
|
64
69
|
- [`addon_not_active`](./addon_not_active.md) — The add-on is not active on this subscription.
|
|
65
|
-
- [`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.
|
|
66
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.
|
|
67
73
|
- [`feature_in_use`](./feature_in_use.md) — The feature cannot be deleted while a plan or add-on uses it.
|
|
68
74
|
- [`model_not_found`](./model_not_found.md) — The requested AI model does not exist in the current model catalog.
|
|
69
75
|
- [`pricing_mode_mismatch`](./pricing_mode_mismatch.md) — The submitted usage shape does not match the feature's configured pricing mode.
|
|
70
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.
|
|
71
78
|
- [`plan_group_not_found`](./plan_group_not_found.md) — The requested plan group does not exist in this organization.
|
|
72
79
|
- [`offer_not_found`](./offer_not_found.md) — The requested offer does not exist or is not compatible with the selected operation.
|
|
73
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_balance_limit_reached
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
- **Error type:** `billing_error`
|
|
6
|
+
- **`code`:** `plan_balance_limit_reached`
|
|
7
|
+
- **API version:** `2026-08-27`
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## What to do
|
|
11
|
+
|
|
12
|
+
Use the planBalanceLimit details to show what remains and when the window resets, or let the customer top up, which the limit never caps.
|
|
13
|
+
|
|
14
|
+
The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
|
|
15
|
+
|
|
16
|
+
## Retry behavior
|
|
17
|
+
|
|
18
|
+
Retry after planBalanceLimit.resetsAt or once purchased balance covers the usage.
|
|
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_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.
|
|
@@ -5,15 +5,15 @@ description: Choose the correct credit mechanism based on what the customer rece
|
|
|
5
5
|
|
|
6
6
|
These mechanisms share a name but affect different ledgers.
|
|
7
7
|
|
|
8
|
-
| Mechanism
|
|
9
|
-
|
|
|
10
|
-
| **Plan credits**
|
|
11
|
-
| **
|
|
12
|
-
| **Customer credit**
|
|
13
|
-
| **Plan grant**
|
|
8
|
+
| Mechanism | Represents | Reset or expiry | Used by |
|
|
9
|
+
| --------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
10
|
+
| **Plan credits** | Recurring product units included in a Credits plan | Expire at each reset, or [roll over](/docs/consumption-models#roll-over-unused-plan-credits) up to a cap | Usage events, within an optional daily or weekly limit |
|
|
11
|
+
| **Purchased credits** | Product units the customer buys as a pack, a chosen quantity, or an automatic top-up | Persist across plan resets | Usage events after plan credits, never limited |
|
|
12
|
+
| **Customer credit** | Money that reduces eligible recurring invoices in one currency | Optional expiration; consumed FIFO | Invoice calculation before tax |
|
|
13
|
+
| **Plan grant** | Temporary access beyond the subscribed plan | Ends when revoked or expired | Feature access, not a credit ledger |
|
|
14
14
|
|
|
15
|
-
Use plan
|
|
15
|
+
Use plan and purchased credits when the customer thinks in actions such as generations or exports. Use customer credit when the adjustment is monetary, such as USD 25 after a service incident. Use a plan grant when no invoice should exist at all.
|
|
16
16
|
|
|
17
|
-
Revoking unused customer credit does not rewrite invoices that already consumed it. Purchased
|
|
17
|
+
Revoking unused customer credit does not rewrite invoices that already consumed it. Purchased credits do not disappear at the next plan reset.
|
|
18
18
|
|
|
19
19
|
See [Credit Packs](/docs/credit-packs), [Customer Credits](/docs/customer-credits), and [Plan Grants](/docs/plan-grants) for implementation.
|
|
@@ -17,13 +17,13 @@ A direct Offer does not need a prior association with the selected plan or price
|
|
|
17
17
|
|
|
18
18
|
## Eligibility and exclusivity
|
|
19
19
|
|
|
20
|
-
Automatic introductory selection
|
|
20
|
+
Automatic introductory selection excludes customers with an `active`, `past_due`, or `paused` subscription in the organization. Other historical statuses do not create a lifetime ban.
|
|
21
21
|
|
|
22
|
-
An explicit `offerId` overrides automatic introductory selection. A Promo Code is rejected with `intro_offer_active` while an eligible introductory placement applies. `offerId`, `promoCode`, `customTrialDays
|
|
22
|
+
An explicit `offerId` overrides automatic introductory selection. A Promo Code is rejected with `intro_offer_active` while an eligible introductory placement applies. `offerId`, `promoCode`, and `cardPromotionId` are mutually exclusive. `customTrialDays` and `skipTrial` combine with `offerId` and `promoCode`, not with `cardPromotionId`. A trial without a payment method starts with none of the three.
|
|
23
23
|
|
|
24
24
|
## Duration and phases
|
|
25
25
|
|
|
26
|
-
An Offer
|
|
26
|
+
An Offer combines ordered discount or fixed-price phases. A finite `durationCycles` counts billing periods, not calendar months. A yearly Offer phase with `durationCycles: 2` lasts two yearly billing cycles.
|
|
27
27
|
|
|
28
28
|
```
|
|
29
29
|
Pro costs $99/month with 50% off for 3 cycles:
|
|
@@ -34,11 +34,13 @@ Cycle 3: $49.50
|
|
|
34
34
|
Cycle 4: $99.00
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
The final discount phase may use `durationCycles: null` to remain active until the accepted application ends. Promo Codes
|
|
37
|
+
The final discount phase may use `durationCycles: null` to remain active until the accepted application ends. Promo Codes can reference the same Offers. Introductory placement is narrower: exactly one finite `percentage` or `amount_off` phase.
|
|
38
|
+
|
|
39
|
+
Trials are not Offer phases. When the price has a [trial](/docs/trial-periods), the discount starts with the first invoice after it.
|
|
38
40
|
|
|
39
41
|
## Plan changes
|
|
40
42
|
|
|
41
|
-
The Offer Application belongs to the price target accepted by the subscription. An immediate plan change ends that application. The change may pass a new `offerId`; otherwise the new plan begins at its normal price. Scheduled plan changes
|
|
43
|
+
The Offer Application belongs to the price target accepted by the subscription. An immediate plan change ends that application. The change may pass a new `offerId` or a `promoCode`; otherwise the new plan begins at its normal price. Scheduled plan changes accept neither.
|
|
42
44
|
|
|
43
45
|
## What gets discounted
|
|
44
46
|
|