@commet/node 9.6.0 → 9.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/index.d.mts +258 -51
  2. package/dist/index.d.ts +258 -51
  3. package/dist/index.js +47 -11
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +47 -11
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/ai-onboarding/commet-skill.md +1 -1
  8. package/docs/ai-onboarding/mcp-server.md +2 -2
  9. package/docs/api-reference/customers.md +4 -2
  10. package/docs/api-reference/index.md +2 -2
  11. package/docs/api-reference/offers.md +2 -2
  12. package/docs/api-reference/plans.md +9 -1
  13. package/docs/api-reference/promo-codes.md +3 -1
  14. package/docs/api-reference/subscriptions.md +106 -8
  15. package/docs/api-reference/usage.md +0 -4
  16. package/docs/documentation/better-auth.md +1 -8
  17. package/docs/documentation/customers/customer-portal.md +1 -7
  18. package/docs/documentation/customers/manage-customers.md +0 -6
  19. package/docs/documentation/error-handling.md +1 -1
  20. package/docs/documentation/finance/acceptable-use.md +1 -6
  21. package/docs/documentation/finance/finance-overview.md +0 -5
  22. package/docs/documentation/finance/local-currency-taxes.md +0 -6
  23. package/docs/documentation/finance/merchant-of-record.md +0 -7
  24. package/docs/documentation/finance/payouts-verification.md +0 -5
  25. package/docs/documentation/finance/payouts.md +0 -6
  26. package/docs/documentation/finance/supported-countries.md +1 -6
  27. package/docs/documentation/go/integrate-with-encore.md +1 -8
  28. package/docs/documentation/go/integrate-with-go.md +1 -8
  29. package/docs/documentation/invoicing/handle-failed-payments.md +3 -9
  30. package/docs/documentation/invoicing/invoices-and-billing-cycles.md +0 -6
  31. package/docs/documentation/java/integrate-with-java.md +1 -5
  32. package/docs/documentation/nodejs/integrate-with-astro.md +1 -8
  33. package/docs/documentation/nodejs/integrate-with-bun.md +1 -8
  34. package/docs/documentation/nodejs/integrate-with-express.md +1 -8
  35. package/docs/documentation/nodejs/integrate-with-hono.md +1 -8
  36. package/docs/documentation/nodejs/integrate-with-nextjs.md +1 -8
  37. package/docs/documentation/nodejs/integrate-with-nuxt.md +1 -8
  38. package/docs/documentation/nodejs/integrate-with-remix.md +1 -8
  39. package/docs/documentation/nodejs/integrate-with-sveltekit.md +1 -8
  40. package/docs/documentation/payments/accept-one-time-payments.md +0 -8
  41. package/docs/documentation/payments/payment-orchestration.md +0 -6
  42. package/docs/documentation/payments/payment-providers.md +0 -6
  43. package/docs/documentation/php/integrate-with-laravel.md +1 -8
  44. package/docs/documentation/php/integrate-with-php.md +1 -7
  45. package/docs/documentation/php/integrate-with-symfony.md +1 -8
  46. package/docs/documentation/plans/add-ons.md +0 -8
  47. package/docs/documentation/plans/configure-features.md +1 -8
  48. package/docs/documentation/plans/consumption-models.md +0 -7
  49. package/docs/documentation/plans/create-plans.md +0 -9
  50. package/docs/documentation/plans/credit-packs.md +0 -7
  51. package/docs/documentation/plans/one-time-payments.md +36 -7
  52. package/docs/documentation/plans/plan-groups.md +0 -6
  53. package/docs/documentation/python/integrate-with-django.md +1 -8
  54. package/docs/documentation/python/integrate-with-fastapi.md +1 -8
  55. package/docs/documentation/python/integrate-with-flask.md +1 -8
  56. package/docs/documentation/python/integrate-with-python.md +1 -8
  57. package/docs/documentation/sales/introductory-offers.md +1 -9
  58. package/docs/documentation/sales/offers.md +0 -8
  59. package/docs/documentation/sales/promo-codes.md +0 -7
  60. package/docs/documentation/sales/promotional-offers.md +0 -7
  61. package/docs/documentation/sales/regional-prices.md +0 -7
  62. package/docs/documentation/sales/trial-periods.md +0 -8
  63. package/docs/documentation/sdk-reference.md +1 -1
  64. package/docs/documentation/subscriptions/manage-subscriptions.md +2 -9
  65. package/docs/documentation/subscriptions/pay-in-advance.md +161 -0
  66. package/docs/documentation/subscriptions/plan-grants.md +0 -6
  67. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +1 -7
  68. package/docs/documentation/testing-sandbox.md +1 -1
  69. package/docs/documentation/usage/ai-token-billing.md +0 -6
  70. package/docs/documentation/usage/quota-management.md +1 -7
  71. package/docs/documentation/usage/seat-management.md +1 -7
  72. package/docs/documentation/usage/track-usage.md +1 -7
  73. package/docs/errors/customer_deleted.md +22 -0
  74. package/docs/errors/index.md +4 -0
  75. package/docs/errors/managed_by_integration.md +22 -0
  76. package/docs/errors/no_scheduled_plan_change.md +22 -0
  77. package/docs/errors/plan_credit_limit_reached.md +22 -0
  78. package/docs/knowledge-base/how-do-discounts-work.md +0 -8
  79. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +1 -7
  80. package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +0 -6
  81. package/docs/knowledge-base/how-do-trial-periods-work.md +1 -8
  82. package/docs/knowledge-base/how-does-billing-work.md +1 -1
  83. package/docs/knowledge-base/how-does-quota-based-billing-work.md +1 -7
  84. package/docs/knowledge-base/how-does-seat-based-billing-work.md +1 -7
  85. package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +0 -6
  86. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +0 -6
  87. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +1 -7
  88. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +1 -7
  89. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -7
  90. package/docs/manifest.json +51 -2
  91. package/docs/platform-documentation.md +1 -0
  92. package/docs/schemas.md +46 -8
  93. package/docs/webhooks/introduction.md +3 -3
  94. package/docs/webhooks.md +15 -15
  95. package/docs/webhooks.openapi.json +15 -5
  96. package/package.json +1 -1
@@ -0,0 +1,161 @@
1
+ ---
2
+ title: Pay in Advance
3
+ description: Let a customer pay several billing periods of a subscription in one payment with any checkout method.
4
+ ---
5
+
6
+ Paying in advance lets a customer cover several billing periods of a subscription in one payment, with card, OXXO, or any other checkout method.
7
+
8
+ It works on weekly, monthly, quarterly, semiannual, and yearly prices. The interval never changes: each paid period renews at `$0` as a regular renewal.
9
+
10
+ Paying in advance doesn't decide whether the subscription renews afterward. To sell periods that end on their own, combine it with `cancelAtPeriodEnd: true`, described in [One-Time Payments](/docs/one-time-payments#sell-a-period-without-renewal).
11
+
12
+ ## Charge several periods in the first payment
13
+
14
+ > **Warning**
15
+ >
16
+ > **Free trials don't combine with paying in advance.** With `prepaidPeriods` above `1` or `cancelAtPeriodEnd: true`, an explicit trial (`customTrialDays`, a trial Offer, or a trial Promo Code) returns `400`, and the plan's automatic introductory trial is skipped.
17
+
18
+ ```bash
19
+ curl -X POST https://commet.co/api/v1/subscriptions \
20
+ -H "x-api-key: $COMMET_API_KEY" \
21
+ -H "commet-version: 2026-08-27" \
22
+ -H "Content-Type: application/json" \
23
+ -d '{"customerId":"user_123","planId":"pln_xxx","prepaidPeriods":3}'
24
+ ```
25
+
26
+ Redirect the customer to `checkoutUrl`. The first payment covers 3 periods of the price's interval, including the current one: 3 months on a monthly price, 3 quarters on a quarterly one.
27
+
28
+ | Parameter | Type | Required | Description |
29
+ | ------------------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
+ | `prepaidPeriods` | `integer` | No | Total billing periods the first payment covers, including the current one. `1` to `60`. Default: `1` |
31
+ | `cancelAtPeriodEnd` | `boolean` | No | `true` ends the subscription after its last paid period, with no renewal. See [One-Time Payments](/docs/one-time-payments#sell-a-period-without-renewal) |
32
+
33
+ `prepaidPeriods` above `1` requires a paid recurring price. One-time prices and free plans return `400 validation_error` with `param: "prepaidPeriods"`.
34
+
35
+ ## Add periods to an existing subscription
36
+
37
+ ```bash
38
+ curl -X POST https://commet.co/api/v1/subscriptions/sub_xxx/prepaid-periods \
39
+ -H "x-api-key: $COMMET_API_KEY" \
40
+ -H "commet-version: 2026-08-27" \
41
+ -H "Content-Type: application/json" \
42
+ -d '{"periods":3}'
43
+ ```
44
+
45
+ Send the returned `checkoutUrl` to the customer. It opens a hosted checkout for those periods.
46
+
47
+ | Parameter | Type | Required | Description |
48
+ | ------------ | --------- | -------- | ----------------------------------------------------------------------------------------------------- |
49
+ | `periods` | `integer` | Yes | Billing periods to pay. `1` to `60`. Its meaning depends on the subscription status |
50
+ | `offerId` | `string` | No | Offer applied from the first added period for its full configured duration. Active subscriptions only |
51
+ | `successUrl` | `string` | No | Where the customer lands after paying |
52
+
53
+ The subscription status decides what `periods` means:
54
+
55
+ | Status | `periods` | The new link |
56
+ | ------------------------------------------- | ------------------------------------------------------------------------------- | ---------------------------------- |
57
+ | `active` | Periods added after the last paid period, priced in the subscription's currency | Replaces any previous unpaid link |
58
+ | `pending_payment`, before its first payment | Total periods the first payment covers, including the first one | Replaces the pending checkout link |
59
+
60
+ A `pending_payment` subscription that already paid and is awaiting a renewal returns `409`. A canceled subscription also returns `409`; to bring the customer back, create a new subscription with `prepaidPeriods`.
61
+
62
+ If the customer already generated an OXXO voucher for the pending checkout, Commet cancels it with the provider first. To apply an Offer to a pending subscription, send `offerId` when [creating the subscription](/docs/manage-subscriptions#create), or assign it with `PUT /subscriptions/{id}/offer` before or after this call: the checkout prices each paid period with that Offer.
63
+
64
+ Commet voids an unpaid link and emits [`invoice.voided`](/docs/webhooks/invoice-voided) when you create a new link, the plan or billing interval changes (immediately or as scheduled), or the subscription is paused, canceled immediately, or ends, including when failed payment retries cancel it. If the customer pays an OXXO voucher from a voided link, Commet refunds it automatically.
65
+
66
+ | Response | Cause |
67
+ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68
+ | `400 validation_error` | The price is one-time or the plan is free |
69
+ | `400 validation_error` | `offerId` has a free trial or was sent for a `pending_payment` subscription. `param` is `offerId` |
70
+ | `400 validation_error` | An Offer bills on another interval. See [Offers billed on another interval](#offers-billed-on-another-interval) |
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 has a free trial, or a pause is scheduled |
73
+ | `409 charge_in_progress` | A payment for the link being replaced couldn't be canceled, such as a generated OXXO voucher |
74
+
75
+ ## How each period is priced
76
+
77
+ Each period costs the price of the subscription's interval for the buyer's country and currency, minus the discount of the Offer phase that applies to that period.
78
+
79
+ ```text
80
+ Plan: $10/month
81
+ Offer: 50% off for 2 months
82
+ Periods: 3
83
+
84
+ Period 1 → $5
85
+ Period 2 → $5
86
+ Period 3 → $10
87
+ Payment → $20
88
+ ```
89
+
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
+
92
+ [Card Promotions](/docs/card-promotions) behave as on any subscription. [Promo Codes](/docs/promo-codes) do too, with two exceptions:
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".
96
+
97
+ ### Offers billed on another interval
98
+
99
+ An Offer with a phase billed on a different interval than the subscription, such as `$5/month for 3 months` on a yearly price, can't combine with paying in advance. These requests return `400 validation_error`:
100
+
101
+ | Request | `param` |
102
+ | ----------------------------------------------------------------------------------------------------------------- | ------------------- |
103
+ | `POST /v1/subscriptions` with `prepaidPeriods` above `1` and that Offer through `offerId` or `promoCode` | `prepaidPeriods` |
104
+ | `POST /v1/subscriptions/{id}/prepaid-periods` with that `offerId`, or with that Offer already assigned or running | `offerId` when sent |
105
+ | `PUT /v1/subscriptions/{id}/offer` on a subscription with unused paid periods or an unpaid link | `offerId` |
106
+
107
+ A Promo Code for that Offer entered on a prepaid checkout is rejected with "This promo code can't be used when paying several billing periods in advance".
108
+
109
+ ## What the customer sees at checkout
110
+
111
+ | Purchase | Checkout shows |
112
+ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
113
+ | Renews after the paid periods | `3 months · then $10.00/mo` or `2 quarters · then $30.00/qtr` |
114
+ | One-time purchase, a subscription scheduled to end, or a first payment with a method that can't renew (OXXO) | `3 months · one-time payment, doesn't renew` |
115
+
116
+ On a link that adds periods to an active subscription, the label follows whether the subscription renews, not the method chosen in that checkout. An OXXO payment on a card subscription shows `then …`.
117
+
118
+ ## End OXXO subscriptions after their paid periods
119
+
120
+ When a subscription is paid with OXXO and has no other saved payment method, Commet schedules its cancellation at the end of its paid periods.
121
+
122
+ - The API shows `cancelAtPeriodEnd: true` and `cancellation.effectiveAt` right after the payment.
123
+ - [`subscription.updated`](/docs/webhooks/subscription-updated) and [`subscription.cancellation_scheduled`](/docs/webhooks/subscription-cancellation-scheduled) fire, with `effectiveAt` at the end of the paid periods and `cancelReason: null`.
124
+ - The subscription isn't renewed or charged, and [`subscription.canceled`](/docs/webhooks/subscription-canceled) fires when it ends.
125
+
126
+ To keep it, the customer adds a card through the [payment method update link](/docs/handle-failed-payments#update-the-payment-method) (`POST /v1/subscriptions/{id}/payment-method/update`) or **Keep subscription** in the [Customer Portal](/docs/customer-portal). The subscription then renews normally with that card.
127
+
128
+ `POST /v1/subscriptions/{id}/uncancel` without a saved card returns `409 subscription_uncancel_failed`.
129
+
130
+ ## Track paid periods after payment
131
+
132
+ - `currentPeriod` stays one billing period.
133
+ - `nextBillingDate` is the next real charge, after the last paid period.
134
+ - Each paid period renews with a paid `$0` invoice, with no charge and no payment link, also for OXXO.
135
+ - Features, credits, and balances reset on their usual schedule.
136
+
137
+ Paying in advance uses existing webhook events:
138
+
139
+ - [`payment.received`](/docs/webhooks/payment-received) and [`subscription.updated`](/docs/webhooks/subscription-updated): the periods were paid.
140
+ - [`invoice.created`](/docs/webhooks/invoice-created): a paid period renewed with a `$0` invoice.
141
+ - [`invoice.voided`](/docs/webhooks/invoice-voided): an unpaid link was voided.
142
+ - [`subscription.canceled`](/docs/webhooks/subscription-canceled): a one-time purchase or an OXXO subscription without a card ended.
143
+
144
+ ## Cancel, pause, or change plan
145
+
146
+ - Cancel: paid periods aren't refunded, and a scheduled cancellation takes effect after the last paid period.
147
+ - Pause: rejected while paid periods remain.
148
+ - Plan or billing interval change: unused paid periods become [Customer Credits](/docs/customer-credits) at the price paid.
149
+
150
+ ## Pay in advance from the Dashboard
151
+
152
+ Open the subscription detail, choose **Pay in advance**, enter the number of periods, and choose **Copy payment link**. The field is labeled with the unit of the subscription's interval, such as **Months** or **Quarters**.
153
+
154
+ Send the copied link to the customer. The subscription detail shows **Paid through** with the date the paid periods end.
155
+
156
+ ## Limitations
157
+
158
+ - `prepaidPeriods` and `periods` accept `1` to `60` for every interval.
159
+ - Only paid recurring prices. One-time prices and free plans return `400`.
160
+ - Free trials don't combine with `prepaidPeriods` above `1` or with `cancelAtPeriodEnd`.
161
+ - Usage overage, seats, and add-ons aren't prepaid: they're billed on their usual schedule, and a renewal with a non-zero total follows the normal payment path.
@@ -115,9 +115,3 @@ curl https://commet.co/api/v1/customers/cus_xxx/plan-grants \
115
115
  ```
116
116
 
117
117
  See the [Plan Grants API reference](/docs/api-reference/customers/list-plan-grants) for exact request and response schemas.
118
-
119
- ## Related
120
-
121
- - [Manage Subscriptions](/docs/manage-subscriptions)
122
- - [Introductory Offers](/docs/introductory-offers)
123
- - [Customer State Changed](/docs/webhooks/customer-state-changed)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Upgrade and Downgrade Plans
3
- description: How customers change plans through the Customer Portal and dashboard.
3
+ description: Upgrades apply immediately with proration and downgrades wait for renewal, whether customers change plans in the portal or you do it in the dashboard.
4
4
  ---
5
5
 
6
6
  Customers change plans through the [Customer Portal](/docs/customer-portal) or from the dashboard. Commet handles proration, feature transitions, and billing adjustments automatically.
@@ -28,9 +28,3 @@ From a customer's subscription detail page, click **Change Plan** and select the
28
28
 
29
29
  - [What Happens When a Customer Changes Plans](/docs/what-happens-when-a-customer-changes-plans)
30
30
  - [How Is Proration Calculated](/docs/how-is-proration-calculated-when-changing-plans)
31
-
32
- ## Related
33
-
34
- - [Manage Subscriptions](/docs/manage-subscriptions) — Create, get, and cancel subscriptions
35
- - [Plan Groups](/docs/plan-groups) — Group plans together for self-service upgrades
36
- - [Customer Portal](/docs/customer-portal) — Self-service billing portal for customers
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Testing
3
- description: Test safely with sandbox environment
3
+ description: "Test billing in an isolated sandbox: simulate renewals with the Test Clock and try test cards, failed payments and 3D Secure."
4
4
  ---
5
5
 
6
6
  Sandbox is the default environment — completely isolated from production.
@@ -285,9 +285,3 @@ Supported providers include OpenAI, Anthropic, Google, Meta, Mistral, Cohere, an
285
285
  ## AI Costs dashboard
286
286
 
287
287
  View all AI token costs in the dashboard under **AI Costs**. Each entry shows the model used, token breakdown, cost calculation, margin applied, and total charged.
288
-
289
- ## Related
290
-
291
- - [Consumption Models](/docs/consumption-models) — How Balance model works
292
- - [Track Usage](/docs/track-usage) — Standard usage tracking
293
- - [Configure Features](/docs/configure-features) — Create metered features
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Quota Management
3
- description: Manage durable quota balances with the Commet SDK.
3
+ description: Track durable quota balances such as tasks or automations with the Commet SDK, and let Commet bill the units above the included amount.
4
4
  ---
5
5
 
6
6
  Quota tracks a durable, countable balance that rises and falls as customers create and delete — tasks, WhatsApp numbers, parallel automations. Commet includes an amount with the plan and bills per-unit overage automatically.
@@ -332,9 +332,3 @@ curl "https://commet.co/api/v1/usage/quota/all?customerId=user_123" \
332
332
  ## Learn more
333
333
 
334
334
  - [How Does Quota-Based Billing Work](/docs/how-does-quota-based-billing-work)
335
-
336
- ## Related
337
-
338
- - [Configure Features](/docs/configure-features) — Create quota features on your plans
339
- - [Manage Plans](/docs/create-plans) — Plans that include quota-based pricing
340
- - [Track Usage](/docs/track-usage) — Send usage events for metered features
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Seat Management
3
- description: Manage seat-based licenses with the Commet SDK.
3
+ description: Add, remove or set seats with the Commet SDK, with included seats billed at the start of the period and extra seats prorated.
4
4
  ---
5
5
 
6
6
  Seats are per-user licenses that let you charge based on team size. Commet tracks seat changes and bills them automatically — included seats at the start of the period, additional seats prorated.
@@ -368,9 +368,3 @@ curl "https://commet.co/api/v1/seats/balances?customerId=user_123" \
368
368
  ## Learn more
369
369
 
370
370
  - [How Does Seat-Based Billing Work](/docs/how-does-seat-based-billing-work)
371
-
372
- ## Related
373
-
374
- - [Configure Features](/docs/configure-features) — Create seat features on your plans
375
- - [Manage Plans](/docs/create-plans) — Plans that include seat-based pricing
376
- - [Manage Subscriptions](/docs/manage-subscriptions) — Assign plans with initial seats
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Track Usage
3
- description: Record metered consumption with the current Commet SDKs.
3
+ description: Record metered usage with one feature code per event, avoid duplicates with an idempotency key, and correct period totals.
4
4
  ---
5
5
 
6
6
  Every metered feature has one code. Send that code as `featureCode`; Commet aggregates events for access, credits, balance, and billing.
@@ -273,9 +273,3 @@ $usageCheck = $commet->usage->check(
273
273
  featureCode: 'api_calls',
274
274
  );
275
275
  ```
276
-
277
- ## Related
278
-
279
- - [Configure Features](/docs/configure-features)
280
- - [AI Token Billing](/docs/ai-token-billing)
281
- - [Consumption Models](/docs/consumption-models)
@@ -0,0 +1,22 @@
1
+ # customer_deleted
2
+
3
+ The externalId belongs to a deleted customer, so the plan group's default plan cannot start for it.
4
+
5
+ - **Error type:** `conflict_error`
6
+ - **`code`:** `customer_deleted`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Create the customer with a different externalId, or send the request without planGroupId.
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 request.
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.
@@ -12,6 +12,7 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
12
12
  - [`payouts_not_available_in_sandbox`](./payouts_not_available_in_sandbox.md) — Payout operations are not available in sandbox mode.
13
13
  - [`not_found`](./not_found.md) — The requested endpoint or resource could not be found in the current organization, mode, or API version.
14
14
  - [`customer_not_found`](./customer_not_found.md) — The requested customer does not exist in this organization.
15
+ - [`customer_deleted`](./customer_deleted.md) — The externalId belongs to a deleted customer, so the plan group's default plan cannot start for it.
15
16
  - [`feature_not_found`](./feature_not_found.md) — The requested feature, seat feature, or quota feature does not exist in this organization.
16
17
  - [`plan_not_found`](./plan_not_found.md) — The requested plan does not exist or is not available in this organization.
17
18
  - [`subscription_not_found`](./subscription_not_found.md) — The requested subscription does not exist in this organization.
@@ -31,6 +32,7 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
31
32
  - [`insufficient_credits`](./insufficient_credits.md) — The subscription does not have enough credits for the usage event.
32
33
  - [`insufficient_seats`](./insufficient_seats.md) — The requested seat removal exceeds the subscription's available seat balance.
33
34
  - [`included_limit_reached`](./included_limit_reached.md) — The requested usage exceeds the plan's included usage limit.
35
+ - [`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.
34
36
  - [`missing_regional_price`](./missing_regional_price.md) — The plan has no price for the subscription's currency or resolved market.
35
37
  - [`payment_failed`](./payment_failed.md) — The operation could not complete its payment or required tax calculation.
36
38
  - [`payment_not_found`](./payment_not_found.md) — The requested payment does not exist in this organization.
@@ -56,6 +58,7 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
56
58
  - [`plans_not_in_same_group`](./plans_not_in_same_group.md) — The current and target plans do not belong to the same plan group.
57
59
  - [`free_plan_change_not_supported`](./free_plan_change_not_supported.md) — This plan-change operation does not support the selected free plan.
58
60
  - [`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.
61
+ - [`no_scheduled_plan_change`](./no_scheduled_plan_change.md) — The subscription has no scheduled plan change to revoke.
59
62
  - [`addon_not_found`](./addon_not_found.md) — The requested add-on does not exist in this organization.
60
63
  - [`addon_already_active`](./addon_already_active.md) — The add-on is already active on this subscription.
61
64
  - [`addon_not_active`](./addon_not_active.md) — The add-on is not active on this subscription.
@@ -77,6 +80,7 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
77
80
  - [`transaction_not_found`](./transaction_not_found.md) — The requested transaction does not exist in this organization.
78
81
  - [`price_not_found`](./price_not_found.md) — The requested price does not exist on the selected plan or no price matches the operation.
79
82
  - [`price_in_use`](./price_in_use.md) — The price cannot be removed or changed while it is in use.
83
+ - [`managed_by_integration`](./managed_by_integration.md) — The record is managed by an integration (its managedBy field), so its terms change only in that integration.
80
84
  - [`market_not_found`](./market_not_found.md) — The requested market does not exist in this organization.
81
85
  - [`market_in_use`](./market_in_use.md) — The market cannot be deleted while a price or subscription uses it.
82
86
  - [`market_group_not_found`](./market_group_not_found.md) — The requested market group does not exist in this organization.
@@ -0,0 +1,22 @@
1
+ # managed_by_integration
2
+
3
+ The record is managed by an integration (its managedBy field), so its terms change only in that integration.
4
+
5
+ - **Error type:** `conflict_error`
6
+ - **`code`:** `managed_by_integration`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Make the change in the integration, such as Dub. Here you can still rename an Offer and activate or deactivate a promo code.
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 change; it is rejected while the integration manages the record.
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
+ # no_scheduled_plan_change
2
+
3
+ The subscription has no scheduled plan change to revoke.
4
+
5
+ - **Error type:** `conflict_error`
6
+ - **`code`:** `no_scheduled_plan_change`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Read the subscription's scheduledPlanChange before revoking a plan change.
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 unless a plan change is scheduled first.
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_credit_limit_reached
2
+
3
+ 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.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `plan_credit_limit_reached`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Use the planCreditLimit details to show what remains and when the window resets, or let the customer buy credits, 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 planCreditLimit.resetsAt or once purchased credits cover 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.
@@ -54,11 +54,3 @@ Total: $130.00
54
54
  > **Note**
55
55
  >
56
56
  > Accepted phases are stored in an immutable Offer Application. Editing, deactivating, or archiving the catalog Offer changes future applications only.
57
-
58
- ## Related
59
-
60
- - [Offers](/docs/offers)
61
- - [Introductory Offers](/docs/introductory-offers)
62
- - [Promotional Offers](/docs/promotional-offers)
63
- - [Promo Codes](/docs/promo-codes)
64
- - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Free Plans
3
- description: How free plans work for your customers
3
+ description: Free plans activate without checkout and reset usage every month, and usage stops at the included limit instead of charging overage.
4
4
  ---
5
5
 
6
6
  A free plan has no price and no checkout. When you assign a customer to a free plan, they're activated immediately. Their usage resets every month, just like a paid plan.
@@ -79,9 +79,3 @@ Credit from free plan: $0 (it's free)
79
79
  They pay: $99 (full month)
80
80
  Invoices, payment method, and billing info appear in their portal.
81
81
  ```
82
-
83
- ## Related
84
-
85
- - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — Upgrades, downgrades, and switching
86
- - [Trials](/docs/how-do-trial-periods-work) — Another way to let customers try before paying
87
- - [Invoices](/docs/what-invoices-do-customers-receive-and-when) — What invoices your customers receive
@@ -68,9 +68,3 @@ They upgrade to Plan B at $600/quarter on February 15.
68
68
  → They're charged Plan B's full price minus that credit.
69
69
  → Their new cycle starts February 15, next renewal May 15.
70
70
  ```
71
-
72
- ## Related
73
-
74
- - [Invoices](/docs/what-invoices-do-customers-receive-and-when) — What invoices your customers receive and when
75
- - [Proration](/docs/how-is-proration-calculated-when-changing-plans) — How mid-cycle charges are calculated
76
- - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — Upgrades, downgrades, and switching
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Trials
3
- description: How free-trial Offer phases work and what customers experience
3
+ description: "A free trial is an Offer phase: checkout saves the payment method without charging it, and the first charge waits until the trial ends."
4
4
  ---
5
5
 
6
6
  A trial is a `free_trial` phase in an Offer. It delays the first charge; the Offer's application channel determines whether Commet selects it automatically or your integration assigns it directly.
@@ -44,10 +44,3 @@ Use `customTrialDays` for terms exclusive to one subscription. Commet records th
44
44
  | Credit, balance, and add-on purchases | Available after checkout captures the payment method |
45
45
  | Metered usage reset | Monthly on the billing day for trials longer than a month |
46
46
  | Included balance and credits | Granted once when the trial starts |
47
-
48
- ## Related
49
-
50
- - [Trial Periods](/docs/trial-periods)
51
- - [Offers](/docs/offers)
52
- - [Free Plans](/docs/how-do-free-plans-work-without-payment)
53
- - [Payment Failures](/docs/what-happens-when-a-payment-fails)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: How Billing Works
3
- description: How your billing behaves based on what you and your customers do
3
+ description: How the catalog, subscriptions, usage, invoices and transactions fit together, and what each change you or your customers make does to billing.
4
4
  ---
5
5
 
6
6
  Commet measures what a customer can consume and charges according to the plan they accepted. Your catalog defines the terms, the subscription stores the active relationship, usage records consumption, invoices calculate what is owed, and transactions record payment attempts.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Quota
3
- description: How quota-based billing works for your customers
3
+ description: Quota plans include units of a durable resource and bill extra units at the highest balance held in the period, so deleting units never lowers the charge.
4
4
  ---
5
5
 
6
6
  Plans can include a quota of a durable resource at no extra cost — tasks, WhatsApp numbers, parallel automations. When your customer goes over the included amount, they're charged per extra unit. Unlike a usage meter that only counts up, a quota balance rises and falls as customers create and delete.
@@ -97,9 +97,3 @@ They pay today: $64.50
97
97
  > **Note**
98
98
  >
99
99
  > Your customer's 25 tasks are now covered by the Scale plan's 50 included tasks. They stop paying for extra tasks entirely.
100
-
101
- ## Related
102
-
103
- - [Proration](/docs/how-is-proration-calculated-when-changing-plans) — How mid-cycle charges are calculated
104
- - [Pricing Changes](/docs/what-happens-when-you-change-your-prices) — How price changes apply to existing customers
105
- - [Billing Intervals](/docs/how-do-monthly-quarterly-and-yearly-billing-work) — When quota is charged on quarterly and yearly plans
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Seats
3
- description: How seat-based billing works for your customers
3
+ description: How included and extra seats are charged, when changes to seats or seat prices take effect, and how upgrades treat seats.
4
4
  ---
5
5
 
6
6
  Plans can include a number of seats at no extra cost. When your customer uses more seats than included, they're charged per extra seat.
@@ -79,9 +79,3 @@ They pay today: $249.50
79
79
  > **Note**
80
80
  >
81
81
  > Your customer's 8 seats are now covered by the Business plan's 10 included seats. If they had 12 seats, the 2 above the included 10 would be billed for the full new period in advance: 2 × $20 = $40.
82
-
83
- ## Related
84
-
85
- - [Proration](/docs/how-is-proration-calculated-when-changing-plans) — How mid-cycle charges are calculated
86
- - [Pricing Changes](/docs/what-happens-when-you-change-your-prices) — How price changes apply to existing customers
87
- - [Billing Intervals](/docs/how-do-monthly-quarterly-and-yearly-billing-work) — When seats are charged on quarterly and yearly plans
@@ -80,9 +80,3 @@ Downgrades take effect **at renewal**. Your customer already paid for the curren
80
80
  ## Why Free → Paid Isn't Prorated
81
81
 
82
82
  When your customer moves from a free plan to a paid plan, there's no credit to give — the free plan costs $0. They simply pay the full price of the new plan from that day.
83
-
84
- ## Related
85
-
86
- - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — When proration applies and when it doesn't
87
- - [Seats](/docs/how-does-seat-based-billing-work) — How seat-based billing works with upgrades
88
- - [Invoices](/docs/what-invoices-do-customers-receive-and-when) — What invoices your customers receive
@@ -103,9 +103,3 @@ You raise Plan Pro from 5,000 API calls to 10,000.
103
103
 
104
104
  All customers — new and existing — get 10,000 right away.
105
105
  ```
106
-
107
- ## Related
108
-
109
- - [Proration](/docs/how-is-proration-calculated-when-changing-plans) — Exactly how mid-cycle charges are calculated
110
- - [Pricing Changes](/docs/what-happens-when-you-change-your-prices) — What happens when you change prices without changing plans
111
- - [Billing Intervals](/docs/how-do-monthly-quarterly-and-yearly-billing-work) — How quarterly and yearly billing works
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Payment Failures
3
- description: What happens when your customer's payment fails
3
+ description: Usage and seats keep working while Commet retries a failed charge on days 1, 3, 5 and 7, and the subscription is canceled if every retry fails.
4
4
  ---
5
5
 
6
6
  When a payment fails, your customer's usage and seats keep working while Commet retries the charge — but new purchases are blocked. If all retries fail, their subscription is canceled.
@@ -31,9 +31,3 @@ All retries fail
31
31
  ## First Charge After a Trial
32
32
 
33
33
  A retryable provider decline on the first paid invoice follows the same `past_due` dunning schedule. If the charge cannot start because the payment method is missing or the customer must take an action, the subscription remains `pending_payment` and checkout is used to complete payment instead of starting dunning.
34
-
35
- ## Related
36
-
37
- - [Invoices](/docs/what-invoices-do-customers-receive-and-when) — What invoices your customers receive
38
- - [Trials](/docs/how-do-trial-periods-work) — What happens if the first charge after a trial fails
39
- - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — How a canceled customer can come back
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Pricing Changes
3
- description: What happens to your customers when you change your prices
3
+ description: New customers pay new prices at once; existing customers get decreases now and increases at renewal, and base plan prices always change at renewal.
4
4
  ---
5
5
 
6
6
  When you change a price, **new customers pay the new price immediately**. For existing customers, the rule is asymmetric: **decreases apply immediately, increases apply at renewal**.
@@ -65,9 +65,3 @@ You lower it from $35/seat to $25/seat.
65
65
 
66
66
  This month → 3 × $25 = $75 — applied immediately
67
67
  ```
68
-
69
- ## Related
70
-
71
- - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — What happens when your customer upgrades or downgrades
72
- - [Proration](/docs/how-is-proration-calculated-when-changing-plans) — How mid-cycle charges are calculated
73
- - [Seats](/docs/how-does-seat-based-billing-work) — How seat-based billing works
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Invoices
3
- description: What invoices your customers receive and when
3
+ description: Every invoice your customers can receive, from recurring and overage invoices to plan changes, credit purchases and top-ups, and when each is issued.
4
4
  ---
5
5
 
6
6
  Your customers receive invoices automatically based on what happens in their subscription. Here's every type of invoice they might see and when it's generated.
@@ -92,9 +92,3 @@ Every invoice is built from these line types:
92
92
  - `balance_overage`: Balance spent past zero, when the plan allows it.
93
93
  - `addon_base`: Add-on charge at renewal.
94
94
  - `one_time`: Standalone one-time payment.
95
-
96
- ## Related
97
-
98
- - [Billing Intervals](/docs/how-do-monthly-quarterly-and-yearly-billing-work) — When quarterly, semiannual, and yearly customers get charged
99
- - [Proration](/docs/how-is-proration-calculated-when-changing-plans) — How mid-cycle charges are calculated
100
- - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — When plan change invoices are created