@commet/node 9.0.0 → 9.1.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 (294) hide show
  1. package/README.md +2 -0
  2. package/dist/index.d.mts +333 -111
  3. package/dist/index.d.ts +333 -111
  4. package/dist/index.js +162 -40
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +162 -40
  7. package/dist/index.mjs.map +1 -1
  8. package/docs/README.md +20 -0
  9. package/docs/ai-onboarding/ai-onboarding.md +90 -0
  10. package/docs/ai-onboarding/billing-best-practices-skill.md +29 -0
  11. package/docs/ai-onboarding/commet-skill.md +58 -0
  12. package/docs/ai-onboarding/mcp-server.md +207 -0
  13. package/docs/ai-onboarding/meta.json +17 -0
  14. package/docs/ai-onboarding/pricing-models-skill.md +29 -0
  15. package/docs/ai-onboarding/subscription-patterns-skill.md +29 -0
  16. package/docs/api-reference/addons.md +127 -0
  17. package/docs/api-reference/api-keys.md +57 -0
  18. package/docs/api-reference/credit-packs.md +80 -0
  19. package/docs/api-reference/customers.md +274 -0
  20. package/docs/api-reference/feature-access.md +36 -0
  21. package/docs/api-reference/features.md +94 -0
  22. package/docs/api-reference/generated-webhooks.md +120 -0
  23. package/docs/api-reference/index.md +31 -0
  24. package/docs/api-reference/invoices.md +123 -0
  25. package/docs/api-reference/markets.md +92 -0
  26. package/docs/api-reference/meta.json +7 -0
  27. package/docs/api-reference/offers.md +104 -0
  28. package/docs/api-reference/payments.md +106 -0
  29. package/docs/api-reference/payouts.md +66 -0
  30. package/docs/api-reference/plan-groups.md +157 -0
  31. package/docs/api-reference/plans.md +358 -0
  32. package/docs/api-reference/portal.md +30 -0
  33. package/docs/api-reference/promo-codes.md +86 -0
  34. package/docs/api-reference/provisioning.md +19 -0
  35. package/docs/api-reference/quota.md +120 -0
  36. package/docs/api-reference/seats.md +123 -0
  37. package/docs/api-reference/subscriptions.md +387 -0
  38. package/docs/api-reference/test-clock.md +59 -0
  39. package/docs/api-reference/transactions.md +78 -0
  40. package/docs/api-reference/usage.md +83 -0
  41. package/docs/documentation/api-versioning.md +100 -0
  42. package/docs/documentation/better-auth.md +361 -0
  43. package/docs/documentation/choose-a-billing-model.md +38 -0
  44. package/docs/documentation/cli.md +1024 -0
  45. package/docs/documentation/create-api-key.md +47 -0
  46. package/docs/documentation/customers/customer-credits.md +48 -0
  47. package/docs/documentation/customers/customer-portal.md +107 -0
  48. package/docs/documentation/customers/manage-customers.md +346 -0
  49. package/docs/documentation/customers/meta.json +5 -0
  50. package/docs/documentation/error-handling.md +239 -0
  51. package/docs/documentation/examples.md +37 -0
  52. package/docs/documentation/finance/acceptable-use.md +145 -0
  53. package/docs/documentation/finance/finance-overview.md +32 -0
  54. package/docs/documentation/finance/local-currency-taxes.md +40 -0
  55. package/docs/documentation/finance/merchant-of-record.md +48 -0
  56. package/docs/documentation/finance/meta.json +13 -0
  57. package/docs/documentation/finance/payouts-verification.md +186 -0
  58. package/docs/documentation/finance/payouts.md +41 -0
  59. package/docs/documentation/finance/supported-countries.md +28 -0
  60. package/docs/documentation/go/integrate-with-encore.md +229 -0
  61. package/docs/documentation/go/integrate-with-go.md +258 -0
  62. package/docs/documentation/go/meta.json +5 -0
  63. package/docs/documentation/introduction.md +58 -0
  64. package/docs/documentation/invoicing/handle-failed-payments.md +283 -0
  65. package/docs/documentation/invoicing/invoices-and-billing-cycles.md +73 -0
  66. package/docs/documentation/invoicing/manage-invoices.md +340 -0
  67. package/docs/documentation/invoicing/meta.json +9 -0
  68. package/docs/documentation/java/integrate-with-java.md +117 -0
  69. package/docs/documentation/java/meta.json +5 -0
  70. package/docs/documentation/meta.json +36 -0
  71. package/docs/documentation/nodejs/integrate-with-astro.md +129 -0
  72. package/docs/documentation/nodejs/integrate-with-bun.md +113 -0
  73. package/docs/documentation/nodejs/integrate-with-express.md +127 -0
  74. package/docs/documentation/nodejs/integrate-with-hono.md +141 -0
  75. package/docs/documentation/nodejs/integrate-with-nextjs.md +118 -0
  76. package/docs/documentation/nodejs/integrate-with-nuxt.md +125 -0
  77. package/docs/documentation/nodejs/integrate-with-remix.md +136 -0
  78. package/docs/documentation/nodejs/integrate-with-sveltekit.md +127 -0
  79. package/docs/documentation/nodejs/meta.json +14 -0
  80. package/docs/documentation/payments/accept-one-time-payments.md +314 -0
  81. package/docs/documentation/payments/meta.json +10 -0
  82. package/docs/documentation/payments/payment-orchestration.md +43 -0
  83. package/docs/documentation/payments/payment-providers.md +59 -0
  84. package/docs/documentation/payments/transactions-refunds-and-retries.md +199 -0
  85. package/docs/documentation/php/integrate-with-laravel.md +222 -0
  86. package/docs/documentation/php/integrate-with-php.md +103 -0
  87. package/docs/documentation/php/integrate-with-symfony.md +214 -0
  88. package/docs/documentation/php/meta.json +9 -0
  89. package/docs/documentation/plans/add-ons.md +257 -0
  90. package/docs/documentation/plans/balance-and-top-ups.md +169 -0
  91. package/docs/documentation/plans/configure-features.md +335 -0
  92. package/docs/documentation/plans/consumption-models.md +93 -0
  93. package/docs/documentation/plans/create-plans.md +162 -0
  94. package/docs/documentation/plans/credit-packs.md +89 -0
  95. package/docs/documentation/plans/meta.json +14 -0
  96. package/docs/documentation/plans/one-time-payments.md +142 -0
  97. package/docs/documentation/plans/plan-groups.md +31 -0
  98. package/docs/documentation/platform/custom-domains.md +27 -0
  99. package/docs/documentation/platform/dashboard-metrics-and-events.md +25 -0
  100. package/docs/documentation/platform/members-and-permissions.md +21 -0
  101. package/docs/documentation/platform/meta.json +10 -0
  102. package/docs/documentation/platform/organization-settings.md +29 -0
  103. package/docs/documentation/python/integrate-with-django.md +161 -0
  104. package/docs/documentation/python/integrate-with-fastapi.md +164 -0
  105. package/docs/documentation/python/integrate-with-flask.md +153 -0
  106. package/docs/documentation/python/integrate-with-python.md +90 -0
  107. package/docs/documentation/python/meta.json +10 -0
  108. package/docs/documentation/sales/card-promotions.md +41 -0
  109. package/docs/documentation/sales/introductory-offers.md +64 -0
  110. package/docs/documentation/sales/meta.json +13 -0
  111. package/docs/documentation/sales/offers.md +65 -0
  112. package/docs/documentation/sales/promo-codes.md +65 -0
  113. package/docs/documentation/sales/promotional-offers.md +58 -0
  114. package/docs/documentation/sales/regional-prices.md +100 -0
  115. package/docs/documentation/sales/trial-periods.md +88 -0
  116. package/docs/documentation/sdk-reference.md +68 -0
  117. package/docs/documentation/subscriptions/manage-subscriptions.md +505 -0
  118. package/docs/documentation/subscriptions/meta.json +9 -0
  119. package/docs/documentation/subscriptions/plan-grants.md +132 -0
  120. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +35 -0
  121. package/docs/documentation/testing-sandbox.md +251 -0
  122. package/docs/documentation/usage/ai-token-billing.md +294 -0
  123. package/docs/documentation/usage/meta.json +10 -0
  124. package/docs/documentation/usage/quota-management.md +341 -0
  125. package/docs/documentation/usage/seat-management.md +377 -0
  126. package/docs/documentation/usage/track-usage.md +282 -0
  127. package/docs/errors/addon_already_active.md +22 -0
  128. package/docs/errors/addon_has_activations.md +22 -0
  129. package/docs/errors/addon_not_active.md +22 -0
  130. package/docs/errors/addon_not_found.md +22 -0
  131. package/docs/errors/already_has_active_subscription.md +22 -0
  132. package/docs/errors/already_scheduled.md +22 -0
  133. package/docs/errors/api_key_not_found.md +22 -0
  134. package/docs/errors/card_promotions_not_available.md +22 -0
  135. package/docs/errors/charge_failed.md +22 -0
  136. package/docs/errors/charge_in_progress.md +22 -0
  137. package/docs/errors/claim_not_pending.md +22 -0
  138. package/docs/errors/credit_pack_not_found.md +22 -0
  139. package/docs/errors/customer_not_found.md +22 -0
  140. package/docs/errors/duplicate.md +22 -0
  141. package/docs/errors/endpoint_deprecated.md +22 -0
  142. package/docs/errors/endpoint_not_available.md +22 -0
  143. package/docs/errors/feature_already_exists.md +22 -0
  144. package/docs/errors/feature_disabled.md +22 -0
  145. package/docs/errors/feature_in_use.md +22 -0
  146. package/docs/errors/feature_not_found.md +22 -0
  147. package/docs/errors/feature_not_in_plan.md +22 -0
  148. package/docs/errors/forbidden.md +22 -0
  149. package/docs/errors/free_plan_change_not_supported.md +22 -0
  150. package/docs/errors/idempotency_in_progress.md +22 -0
  151. package/docs/errors/idempotency_key_mismatch.md +22 -0
  152. package/docs/errors/idempotency_unavailable.md +22 -0
  153. package/docs/errors/included_limit_reached.md +22 -0
  154. package/docs/errors/index.md +89 -0
  155. package/docs/errors/insufficient_balance.md +22 -0
  156. package/docs/errors/insufficient_credits.md +22 -0
  157. package/docs/errors/insufficient_seats.md +22 -0
  158. package/docs/errors/internal_error.md +22 -0
  159. package/docs/errors/invalid_json.md +22 -0
  160. package/docs/errors/invalid_subscription_status.md +22 -0
  161. package/docs/errors/invoice_not_found.md +22 -0
  162. package/docs/errors/market_group_in_use.md +22 -0
  163. package/docs/errors/market_group_not_found.md +22 -0
  164. package/docs/errors/market_in_use.md +22 -0
  165. package/docs/errors/market_not_found.md +22 -0
  166. package/docs/errors/missing_regional_price.md +22 -0
  167. package/docs/errors/model_not_found.md +22 -0
  168. package/docs/errors/no_active_subscription.md +22 -0
  169. package/docs/errors/no_change_requested.md +22 -0
  170. package/docs/errors/no_outstanding_invoice.md +22 -0
  171. package/docs/errors/no_payment_method.md +22 -0
  172. package/docs/errors/no_prices_configured.md +22 -0
  173. package/docs/errors/not_found.md +22 -0
  174. package/docs/errors/not_scheduled_for_cancellation.md +22 -0
  175. package/docs/errors/offer_not_applicable.md +22 -0
  176. package/docs/errors/offer_not_found.md +22 -0
  177. package/docs/errors/one_time_subscription_not_cancelable.md +22 -0
  178. package/docs/errors/organization_already_claimed.md +22 -0
  179. package/docs/errors/payment_failed.md +22 -0
  180. package/docs/errors/payment_method_not_found.md +22 -0
  181. package/docs/errors/payment_not_cancelable.md +22 -0
  182. package/docs/errors/payment_not_found.md +22 -0
  183. package/docs/errors/payouts_not_available_in_sandbox.md +22 -0
  184. package/docs/errors/plan_change_scheduled.md +22 -0
  185. package/docs/errors/plan_group_not_found.md +22 -0
  186. package/docs/errors/plan_not_found.md +22 -0
  187. package/docs/errors/plan_unavailable.md +22 -0
  188. package/docs/errors/plans_not_in_same_group.md +22 -0
  189. package/docs/errors/price_in_use.md +22 -0
  190. package/docs/errors/price_not_found.md +22 -0
  191. package/docs/errors/pricing_mode_mismatch.md +22 -0
  192. package/docs/errors/promo_code_expired.md +22 -0
  193. package/docs/errors/promo_code_not_found.md +22 -0
  194. package/docs/errors/provider_unsupported.md +22 -0
  195. package/docs/errors/rate_limited.md +22 -0
  196. package/docs/errors/sandbox_only.md +22 -0
  197. package/docs/errors/seat_limit_exceeded.md +22 -0
  198. package/docs/errors/subscription_activation_failed.md +22 -0
  199. package/docs/errors/subscription_already_canceled.md +22 -0
  200. package/docs/errors/subscription_cancel_failed.md +22 -0
  201. package/docs/errors/subscription_creation_failed.md +22 -0
  202. package/docs/errors/subscription_has_open_dispute.md +22 -0
  203. package/docs/errors/subscription_not_active.md +22 -0
  204. package/docs/errors/subscription_not_found.md +22 -0
  205. package/docs/errors/subscription_required.md +22 -0
  206. package/docs/errors/subscription_uncancel_failed.md +22 -0
  207. package/docs/errors/transaction_not_found.md +22 -0
  208. package/docs/errors/unauthorized.md +22 -0
  209. package/docs/errors/validation_error.md +22 -0
  210. package/docs/errors/webhook_not_found.md +22 -0
  211. package/docs/errors.md +34 -0
  212. package/docs/getting-started.md +35 -0
  213. package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +22 -0
  214. package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +20 -0
  215. package/docs/knowledge-base/how-do-discounts-work.md +65 -0
  216. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +88 -0
  217. package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +77 -0
  218. package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +20 -0
  219. package/docs/knowledge-base/how-do-trial-periods-work.md +54 -0
  220. package/docs/knowledge-base/how-does-billing-work.md +73 -0
  221. package/docs/knowledge-base/how-does-payment-routing-work.md +17 -0
  222. package/docs/knowledge-base/how-does-quota-based-billing-work.md +106 -0
  223. package/docs/knowledge-base/how-does-seat-based-billing-work.md +88 -0
  224. package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +89 -0
  225. package/docs/knowledge-base/meta.json +29 -0
  226. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +110 -0
  227. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +40 -0
  228. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +74 -0
  229. package/docs/knowledge-base/what-happens-when-you-refund-or-retry-a-transaction.md +21 -0
  230. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +101 -0
  231. package/docs/manifest.json +1677 -0
  232. package/docs/meta.json +11 -0
  233. package/docs/platform-documentation.md +175 -0
  234. package/docs/schemas.md +995 -0
  235. package/docs/webhooks/addon-activated.md +44 -0
  236. package/docs/webhooks/addon-deactivated.md +40 -0
  237. package/docs/webhooks/balance-depleted.md +37 -0
  238. package/docs/webhooks/balance-low.md +39 -0
  239. package/docs/webhooks/balance-topped-up.md +41 -0
  240. package/docs/webhooks/checkout-ready.md +43 -0
  241. package/docs/webhooks/credits-depleted.md +35 -0
  242. package/docs/webhooks/credits-expired.md +35 -0
  243. package/docs/webhooks/credits-granted.md +37 -0
  244. package/docs/webhooks/credits-low.md +39 -0
  245. package/docs/webhooks/credits-purchased.md +41 -0
  246. package/docs/webhooks/customer-created.md +49 -0
  247. package/docs/webhooks/customer-state-changed.md +134 -0
  248. package/docs/webhooks/customer-updated.md +49 -0
  249. package/docs/webhooks/introduction.md +499 -0
  250. package/docs/webhooks/invoice-created.md +45 -0
  251. package/docs/webhooks/invoice-overdue.md +53 -0
  252. package/docs/webhooks/invoice-upcoming.md +43 -0
  253. package/docs/webhooks/invoice-voided.md +53 -0
  254. package/docs/webhooks/meta.json +78 -0
  255. package/docs/webhooks/payment-dispute-resolved.md +52 -0
  256. package/docs/webhooks/payment-disputed.md +49 -0
  257. package/docs/webhooks/payment-failed.md +37 -0
  258. package/docs/webhooks/payment-link-canceled.md +41 -0
  259. package/docs/webhooks/payment-link-completed.md +47 -0
  260. package/docs/webhooks/payment-link-created.md +41 -0
  261. package/docs/webhooks/payment-link-failed.md +45 -0
  262. package/docs/webhooks/payment-method-attached.md +40 -0
  263. package/docs/webhooks/payment-method-updated.md +38 -0
  264. package/docs/webhooks/payment-received.md +45 -0
  265. package/docs/webhooks/payment-recovered.md +39 -0
  266. package/docs/webhooks/payment-refunded.md +47 -0
  267. package/docs/webhooks/payment-retry-failed.md +39 -0
  268. package/docs/webhooks/payout-available.md +33 -0
  269. package/docs/webhooks/payout-created.md +48 -0
  270. package/docs/webhooks/payout-failed.md +52 -0
  271. package/docs/webhooks/payout-paid.md +48 -0
  272. package/docs/webhooks/quota-exceeded.md +44 -0
  273. package/docs/webhooks/quota-threshold-reached.md +41 -0
  274. package/docs/webhooks/seats-limit-reached.md +39 -0
  275. package/docs/webhooks/seats-updated.md +39 -0
  276. package/docs/webhooks/subscription-activated.md +43 -0
  277. package/docs/webhooks/subscription-canceled.md +57 -0
  278. package/docs/webhooks/subscription-cancellation-revoked.md +37 -0
  279. package/docs/webhooks/subscription-cancellation-scheduled.md +45 -0
  280. package/docs/webhooks/subscription-created.md +35 -0
  281. package/docs/webhooks/subscription-past-due.md +43 -0
  282. package/docs/webhooks/subscription-plan-change-revoked.md +50 -0
  283. package/docs/webhooks/subscription-plan-change-scheduled.md +55 -0
  284. package/docs/webhooks/subscription-plan-changed.md +43 -0
  285. package/docs/webhooks/subscription-reactivated.md +53 -0
  286. package/docs/webhooks/subscription-updated.md +39 -0
  287. package/docs/webhooks/trial-checkout-ready.md +39 -0
  288. package/docs/webhooks/trial-converted.md +39 -0
  289. package/docs/webhooks/trial-expired.md +39 -0
  290. package/docs/webhooks/trial-started.md +46 -0
  291. package/docs/webhooks/trial-will-end.md +41 -0
  292. package/docs/webhooks/usage-recorded.md +41 -0
  293. package/docs/webhooks.md +782 -0
  294. package/package.json +2 -1
package/docs/errors.md ADDED
@@ -0,0 +1,34 @@
1
+ # Errors and request IDs
2
+
3
+ API failures throw `CommetAPIError`. Validation failures throw `CommetValidationError`, which is also a `CommetAPIError`.
4
+
5
+ ```ts
6
+ import { CommetAPIError } from "@commet/node";
7
+
8
+ try {
9
+ await commet.subscriptions.create(params, {
10
+ idempotencyKey: "subscription:user_123:pro",
11
+ });
12
+ } catch (error) {
13
+ if (error instanceof CommetAPIError) {
14
+ console.error(error.code);
15
+ console.error(error.requestId);
16
+ console.error(error.docUrl);
17
+ }
18
+ }
19
+ ```
20
+
21
+ Error fields:
22
+
23
+ - `type`: broad API error category.
24
+ - `code`: stable machine-readable error code.
25
+ - `message`: operation-specific explanation.
26
+ - `statusCode`: HTTP status.
27
+ - `param`: invalid request parameter when provided.
28
+ - `details`: structured diagnostic data when provided.
29
+ - `requestId`: exact `x-request-id` returned by Platform. It is absent if no server identifier was received and is never fabricated locally.
30
+ - `docUrl`: versioned Markdown reference for the error code.
31
+
32
+ `JSON.stringify(error)` serializes the fields above without adding stack traces, credentials, request headers, or request bodies. It preserves API-provided `details` because they are part of the public diagnostic contract.
33
+
34
+ Do not retry a write merely because its HTTP status is usually transient. Follow the version-matched retry guidance at `docUrl`, preserve the same idempotency key when a retry is permitted, and inspect the current resource state when the outcome is uncertain.
@@ -0,0 +1,35 @@
1
+ # Getting started
2
+
3
+ Install the core SDK:
4
+
5
+ ```bash
6
+ npm install @commet/node
7
+ ```
8
+
9
+ Create one server-side client. Never expose an API key to browser code.
10
+
11
+ ```ts
12
+ import { Commet } from "@commet/node";
13
+
14
+ const commet = new Commet({
15
+ apiKey: process.env.COMMET_API_KEY,
16
+ });
17
+ ```
18
+
19
+ The installed SDK sends the API version recorded in [`manifest.json`](./manifest.json). You can inspect the same value from code:
20
+
21
+ ```ts
22
+ import { API_VERSION } from "@commet/node";
23
+
24
+ console.log(API_VERSION);
25
+ ```
26
+
27
+ Every resource and method available in this release is generated from the versioned OpenAPI contract. Read the [generated API reference](./api-reference/index.md) instead of relying on remembered method names.
28
+
29
+ Before a mutation:
30
+
31
+ 1. Confirm the organization and whether it is sandbox or live.
32
+ 2. Use a stable idempotency key when the caller may repeat the same write.
33
+ 3. Preserve the returned error code and request ID when diagnosing failures.
34
+
35
+ The local SDK and CLI never infer permission to mutate billing from documentation or agent setup.
@@ -0,0 +1,22 @@
1
+ ---
2
+ lastModified: 2026-08-16
3
+ title: Balance and Top-Ups
4
+ description: Understand recurring balance, paid top-ups, administrative adjustments, and reset behavior.
5
+ ---
6
+
7
+ A Balance plan includes a monetary allowance that usage draws down. The balance amount is part of the subscription's consumption model; it is not invoice credit.
8
+
9
+ ## What changes the balance?
10
+
11
+ - A plan reset restores the configured plan amount.
12
+ - A paid top-up charges the saved payment method and adds balance.
13
+ - An administrative adjustment adds or removes balance without charging.
14
+ - A usage event subtracts the feature's calculated monetary cost.
15
+
16
+ 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.**
17
+
18
+ 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.
19
+
20
+ Before expensive work, check the current allowance. Track the event only after the work completes and use an idempotency key so retries do not deduct twice.
21
+
22
+ See [Balance and Top-Ups](/docs/balance-and-top-ups) for dashboard and API steps.
@@ -0,0 +1,20 @@
1
+ ---
2
+ lastModified: 2026-08-16
3
+ title: Credits, Credit Packs, and Customer Credits
4
+ description: Choose the correct credit mechanism based on what the customer receives and how it expires.
5
+ ---
6
+
7
+ These mechanisms share a name but affect different ledgers.
8
+
9
+ | Mechanism | Represents | Reset or expiry | Used by |
10
+ | ------------------- | -------------------------------------------------------------- | ---------------------------------- | ------------------------------------ |
11
+ | **Plan credits** | Recurring product units included in a Credits plan | Reset with the plan allowance | Usage events |
12
+ | **Credit pack** | Product units the customer buys | Persists across plan resets | Usage events after recurring credits |
13
+ | **Customer credit** | Money that reduces eligible recurring invoices in one currency | Optional expiration; consumed FIFO | Invoice calculation before tax |
14
+ | **Plan grant** | Access to a paid plan without billing | Ends when revoked or expired | Feature access, not a credit ledger |
15
+
16
+ Use plan credits and packs 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.
17
+
18
+ Revoking unused customer credit does not rewrite invoices that already consumed it. Purchased credit packs do not disappear at the next plan reset.
19
+
20
+ See [Credit Packs](/docs/credit-packs), [Customer Credits](/docs/customer-credits), and [Plan Grants](/docs/plan-grants) for implementation.
@@ -0,0 +1,65 @@
1
+ ---
2
+ lastModified: 2026-07-31
3
+ title: Discounts
4
+ description: How Offers, introductory placement, direct assignment, and Promo Codes work together
5
+ ---
6
+
7
+ Commet stores discount terms in independent Offers. Introductory, Promotional, and Promo Code describe **how one Offer is selected**, not different discount entities.
8
+
9
+ ## Selection channels
10
+
11
+ | Channel | Configuration | Selection | Typical use |
12
+ | ------------ | ------------------------------------------------ | ------------------------------------ | -------------------------------------------- |
13
+ | Introductory | Attach a compatible Offer to one base plan price | Automatic for an eligible customer | Acquisition and onboarding |
14
+ | Promotional | Keep the Offer independent | Your integration passes `offerId` | Campaigns, retention, and experiments |
15
+ | Promo Code | Reference a compatible Offer from a code | Customer enters the code at checkout | Public distribution with redemption controls |
16
+
17
+ A direct Offer does not need a prior association with the selected plan or price.
18
+
19
+ ## Eligibility and exclusivity
20
+
21
+ Automatic introductory selection currently excludes customers with an `active` or `past_due` subscription in the organization. Other historical statuses do not create a lifetime ban.
22
+
23
+ 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`, and `skipTrial: true` are mutually exclusive selection controls.
24
+
25
+ ## Duration and phases
26
+
27
+ An Offer may combine a free trial with 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.
28
+
29
+ ```
30
+ Pro costs $99/month with 50% off for 3 cycles:
31
+
32
+ Cycle 1: $49.50
33
+ Cycle 2: $49.50
34
+ Cycle 3: $49.50
35
+ Cycle 4: $99.00
36
+ ```
37
+
38
+ The final discount phase may use `durationCycles: null` to remain active until the accepted application ends. Promo Codes are intentionally narrower: they can reference only one `percentage` or `amount_off` phase.
39
+
40
+ ## Plan changes
41
+
42
+ 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 do not accept an Offer.
43
+
44
+ ## What gets discounted
45
+
46
+ Current subscription Offer channels apply to the plan base price. Overage, add-on, credit-pack, and seat-overage charges remain at their normal prices.
47
+
48
+ ```
49
+ Plan base: $100.00
50
+ 20% Offer: −$20.00
51
+ Overage: $50.00
52
+ Total: $130.00
53
+ ```
54
+
55
+ > **Note**
56
+ >
57
+ > Accepted phases are stored in an immutable Offer Application. Editing, deactivating, or archiving the catalog Offer changes future applications only.
58
+
59
+ ## Related
60
+
61
+ - [Offers](/docs/offers)
62
+ - [Introductory Offers](/docs/introductory-offers)
63
+ - [Promotional Offers](/docs/promotional-offers)
64
+ - [Promo Codes](/docs/promo-codes)
65
+ - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans)
@@ -0,0 +1,88 @@
1
+ ---
2
+ lastModified: 2026-07-10
3
+ title: Free Plans
4
+ description: How free plans work for your customers
5
+ ---
6
+
7
+ 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.
8
+
9
+ ## How Free Plans Differ from Paid Plans
10
+
11
+ | | Paid plan | Free plan |
12
+ | -------------- | ----------------------------- | ---------------------------------------------------------- |
13
+ | Price | Has a price | $0 |
14
+ | Billing | Monthly, quarterly, or yearly | No charges — usage resets monthly |
15
+ | How they start | Checkout + payment | **Activated immediately** |
16
+ | Invoices | Yes | Only for purchases (credits, balance, add-ons) |
17
+ | Overage | Configurable per feature | **Never allowed** — usage is blocked at the included limit |
18
+ | Usage resets | Every month | Every month |
19
+
20
+ ## Monthly Usage Resets
21
+
22
+ Even though there's no billing cycle, your customer's usage resets **every month** — the same cadence as a paid monthly plan. If you give a free plan 1,000 API calls or $50 in balance, that allowance refreshes on their billing day each month.
23
+
24
+ When a customer hits their included limit, they're blocked until the next reset. Overage is never charged on a free plan.
25
+
26
+ ### Example
27
+
28
+ ```
29
+ Your free plan includes $100 in balance.
30
+ Your customer uses $100 by day 15.
31
+
32
+ → They're blocked for the rest of the month.
33
+ → On their billing day, balance resets to $100.
34
+ ```
35
+
36
+ ## What Your Customer Sees in the Portal
37
+
38
+ The Customer Portal adapts when someone is on a free plan:
39
+
40
+ | Section | Paid plan | Free plan |
41
+ | ----------------------- | ------------------------------------------------- | -------------------------------------------- |
42
+ | Subscription | Shows plan, price, and next billing date | Shows plan and status only — no billing date |
43
+ | Invoices | Visible | Visible only if they've made purchases |
44
+ | Payment method | Visible | Visible only if they've added one |
45
+ | MRR | Shows amount | Shows $0.00/mo |
46
+ | Usage (balance/credits) | Visible, with "Add Funds" or "Buy Credits" button | Visible, with purchase buttons |
47
+
48
+ ## Purchasing on a Free Plan
49
+
50
+ Free plan customers can purchase add-ons, credit packs, and balance top-ups — the same one-off purchases available on paid plans. Since they didn't go through checkout, they don't have a card on file. The first purchase prompts them to enter a payment method, which is saved for future purchases.
51
+
52
+ > **Note**
53
+ >
54
+ > The plan itself is free. Purchases are optional extras that customers choose to buy.
55
+
56
+ ## Changing a Free Plan's Included Balance or Credits
57
+
58
+ If you change the included balance or credits on a free plan, the change applies at **each customer's next monthly reset**. Balances already granted for the current month don't change.
59
+
60
+ ### Example
61
+
62
+ ```
63
+ You increase the free plan's included balance from $100 to $150.
64
+
65
+ A customer whose billing day is the 20th keeps their current balance until the 20th.
66
+ On the 20th, their monthly reset grants $150.
67
+ ```
68
+
69
+ ## When Your Customer Upgrades to a Paid Plan
70
+
71
+ The upgrade is always **immediate**. Since the free plan costs $0, there's no credit to give — your customer simply pays the full price of the new plan from that day.
72
+
73
+ ### Example
74
+
75
+ ```
76
+ Your customer is on a Free plan with $100 included balance.
77
+ They upgrade to Pro at $99/mo.
78
+
79
+ Credit from free plan: $0 (it's free)
80
+ They pay: $99 (full month)
81
+ Invoices, payment method, and billing info appear in their portal.
82
+ ```
83
+
84
+ ## Related
85
+
86
+ - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — Upgrades, downgrades, and switching
87
+ - [Trials](/docs/how-do-trial-periods-work) — Another way to let customers try before paying
88
+ - [Invoices](/docs/what-invoices-do-customers-receive-and-when) — What invoices your customers receive
@@ -0,0 +1,77 @@
1
+ ---
2
+ lastModified: 2026-07-28
3
+ title: Billing Intervals
4
+ description: How weekly, monthly, quarterly, and yearly billing works and when your customers get charged
5
+ ---
6
+
7
+ 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.
8
+
9
+ ## Weekly Plans
10
+
11
+ Your customer is billed every 7 days. The billing period, consumption resets, and invoicing all happen on a weekly cycle.
12
+
13
+ - Plan base charged every week
14
+ - Usage (credits, balance, metered) resets every week
15
+ - Extra seats charged every week
16
+ - The billing day anchors to the day of the week the subscription started (e.g., every Monday)
17
+
18
+ > **Note**
19
+ >
20
+ > Weekly plans reset consumption **every 7 days**, not monthly. A customer on a weekly plan with 1,000 included API calls gets 1,000 calls each week.
21
+
22
+ ## Monthly Plans
23
+
24
+ Straightforward: your customer is billed every month for their plan base, extra usage, and extra seats.
25
+
26
+ ## Quarterly and Yearly Plans
27
+
28
+ Your customer pays the plan base every 3 or 12 months, but **usage charges can happen every month**. Here's how it works:
29
+
30
+ ### Example: Quarterly plan at $300/quarter
31
+
32
+ ```
33
+ Month 1:
34
+ → Your customer used extra API calls? They get a small invoice for just the overage.
35
+ → No extra usage? No invoice at all.
36
+
37
+ Month 2:
38
+ → Same thing — only charged if they had extra usage.
39
+
40
+ Month 3 (renewal month):
41
+ → Full invoice: plan base ($300) + any extra usage + any extra seats.
42
+ → Billing cycle resets for the next quarter.
43
+ ```
44
+
45
+ > **Warning**
46
+ >
47
+ > 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.
48
+
49
+ ## What Your Customer Sees
50
+
51
+ | | Months between renewals | Renewal month |
52
+ | --------------------- | ----------------------- | ----------------------- |
53
+ | Plan base | Not charged | Charged |
54
+ | Extra usage | Charged (if any) | Charged |
55
+ | Extra seats | Not charged | Charged |
56
+ | No extra usage at all | No invoice | Invoice (has plan base) |
57
+
58
+ ## Plan Changes Mid-Cycle
59
+
60
+ 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.
61
+
62
+ ### Example
63
+
64
+ ```
65
+ Your customer is on Plan A at $300/quarter (January 1 – April 1).
66
+ They upgrade to Plan B at $600/quarter on February 15.
67
+
68
+ → They get credit for the unused portion of Plan A.
69
+ → They're charged Plan B's full price minus that credit.
70
+ → Their new cycle starts February 15, next renewal May 15.
71
+ ```
72
+
73
+ ## Related
74
+
75
+ - [Invoices](/docs/what-invoices-do-customers-receive-and-when) — What invoices your customers receive and when
76
+ - [Proration](/docs/how-is-proration-calculated-when-changing-plans) — How mid-cycle charges are calculated
77
+ - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — Upgrades, downgrades, and switching
@@ -0,0 +1,20 @@
1
+ ---
2
+ lastModified: 2026-08-16
3
+ title: Offers, Promo Codes, and Card Promotions
4
+ description: Understand where commercial terms live and how each distribution channel selects them.
5
+ ---
6
+
7
+ An Offer owns the economic terms: trial, percentage discount, amount off, or temporary fixed price. Introductory Offers, direct Promotional Offers, Promo Codes, and Card Promotions decide how those terms reach a customer.
8
+
9
+ | Channel | Who selects it | Additional rule |
10
+ | ---------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
11
+ | **Introductory** | Commet selects it from the plan price | New-customer eligibility |
12
+ | **Direct Promotional** | Your application sends `offerId` | Your application decides the audience |
13
+ | **Promo Code** | Customer enters a code | Plan, interval, expiration, and redemption limits |
14
+ | **Card Promotion** | Your application preselects `cardPromotionId`, or Commet discovers an auto-apply promotion; checkout verifies the card | BIN, billing interval, and Offer compatibility |
15
+
16
+ Only one channel applies to the initial checkout. An explicit Offer overrides automatic introductory selection. A Promo Code cannot combine with an explicit Offer, and a Card Promotion must remain conditional until the entered card is verified.
17
+
18
+ When terms are accepted, Commet stores an immutable Offer Application. Editing the catalog Offer changes future applications, not the phases already accepted by an existing subscription.
19
+
20
+ See [Offers](/docs/offers) and [Card Promotions](/docs/card-promotions) for setup.
@@ -0,0 +1,54 @@
1
+ ---
2
+ lastModified: 2026-07-31
3
+ title: Trials
4
+ description: How free-trial Offer phases work and what customers experience
5
+ ---
6
+
7
+ 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.
8
+
9
+ ## What the customer experiences
10
+
11
+ | | Regular checkout | Trial checkout |
12
+ | -------------- | --------------------------- | ----------------------------------------- |
13
+ | Payment | Charged immediately | Payment method saved, no immediate charge |
14
+ | Primary action | Pay | Start free trial |
15
+ | After checkout | Subscription becomes active | Subscription becomes `trialing` |
16
+
17
+ The trial starts after payment-method setup succeeds. If the card requires 3D Secure, the customer completes verification before the trial begins.
18
+
19
+ ## How it works
20
+
21
+ ```
22
+ 1. Commet resolves an Offer with a free_trial phase.
23
+ 2. Checkout saves the payment method without charging it.
24
+ 3. The subscription becomes trialing and records trialEndsAt.
25
+ 4. At the end, Commet charges the selected price's current catalog value.
26
+ 5. The next accepted Offer phase starts, if one exists.
27
+ ```
28
+
29
+ > **Warning**
30
+ >
31
+ > The accepted Offer phases are immutable, but the selected catalog price is not. A price change during the trial changes the first paid charge.
32
+
33
+ ## Reusable and customer-specific trials
34
+
35
+ Use a catalog Offer when the trial should have a reusable name and distribution strategy. It can be attached to a base price as introductory or passed directly with `offerId`.
36
+
37
+ Use `customTrialDays` for terms exclusive to one subscription. Commet records those accepted terms as a custom Offer Application. Use `skipTrial: true` to bypass automatic introductory selection.
38
+
39
+ ## During the trial
40
+
41
+ | Behavior | During trial |
42
+ | ------------------------------------- | --------------------------------------------------------- |
43
+ | Plan features | Available |
44
+ | Overage | Blocked at included limits |
45
+ | Credit, balance, and add-on purchases | Available after checkout captures the payment method |
46
+ | Metered usage reset | Monthly on the billing day for trials longer than a month |
47
+ | Included balance and credits | Granted once when the trial starts |
48
+
49
+ ## Related
50
+
51
+ - [Trial Periods](/docs/trial-periods)
52
+ - [Offers](/docs/offers)
53
+ - [Free Plans](/docs/how-do-free-plans-work-without-payment)
54
+ - [Payment Failures](/docs/what-happens-when-a-payment-fails)
@@ -0,0 +1,73 @@
1
+ ---
2
+ lastModified: 2026-08-16
3
+ title: How Billing Works
4
+ description: How your billing behaves based on what you and your customers do
5
+ ---
6
+
7
+ 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.
8
+
9
+ Those layers change at different times. Commet separates catalog changes, subscription changes, and billing recovery. Each has an explicit rule; there is no single price-based heuristic for every operation.
10
+
11
+ | Layer | Source of truth | Typical question |
12
+ | ------------ | -------------------------------------------------------- | ----------------------------------------------- |
13
+ | Catalog | Plans, prices, features, Offers, and Markets | What can a new customer buy? |
14
+ | Subscription | Selected plan, price, accepted Offer, period, and status | What did this customer accept? |
15
+ | Consumption | Usage, seats, quota, credits, or balance | What did the customer use? |
16
+ | Invoice | Line items, tax, credits, and amount due | What does the customer owe? |
17
+ | Transaction | Provider-neutral payment attempt | Did the charge succeed, fail, retry, or refund? |
18
+
19
+ ## Quick Reference
20
+
21
+ ### When You Make Changes
22
+
23
+ | What you do | What happens to existing customers |
24
+ | --------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
25
+ | Change the selected base or variant price | Current paid period stays unchanged; renewal uses that catalog row's current value |
26
+ | Lower a per-unit price (usage, seats, quota) | **Applies immediately** — this period is billed at the cheaper price |
27
+ | Raise a per-unit price (usage, seats, quota) | New price applies starting next period |
28
+ | Increase included units, enable a feature, or make it unlimited | **Updates the current-period snapshot** |
29
+ | Reduce included units, disable a feature, or remove it | Existing snapshot remains until renewal |
30
+ | Hide or soft-delete a plan | Existing subscriptions keep it; new selection is blocked |
31
+ | Archive a price | New selection is blocked; subscriptions already bound to it continue |
32
+ | Change a free plan's included balance/credits | Applies at each customer's next monthly reset |
33
+
34
+ ### When Your Customer Makes Changes
35
+
36
+ | What they do | What happens |
37
+ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
38
+ | Move to a higher-`sortOrder` plan in the same group without changing interval | **Immediate** — charged the new plan's full price minus a credit for unused days; the cycle restarts |
39
+ | Move to a lower-`sortOrder` plan in the same group without changing interval | Keeps current plan until renewal, then switches |
40
+ | Switch from free to paid | **Immediate** — pays full price, no credit (free = $0) |
41
+ | Switch from paid to free | Keeps current plan until renewal, then switches |
42
+ | Switch to a longer interval | **Immediate** |
43
+ | Switch to a shorter interval | Takes effect at renewal |
44
+
45
+ ### Automatic Events
46
+
47
+ | What happens | What your customer experiences |
48
+ | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
49
+ | Trial starts | They use the product, no charge. **Overage is blocked** — usage stops at included limits |
50
+ | Trial ends | They're charged the current price, overage activates normally |
51
+ | Renewal or retryable first-trial charge fails | Subscription becomes `past_due`; usage continues while retries run and purchases are blocked |
52
+ | First-trial charge needs a payment method or customer action | Subscription remains `pending_payment` so checkout can complete |
53
+ | Canceled subscription | Can be reactivated — fresh invoice at the current price, new billing period starts that day |
54
+
55
+ ## The Boundaries That Matter
56
+
57
+ - Interval direction determines timing first. When the interval is unchanged, the plan group's order defines upgrade and downgrade direction, not the amount. Paid-to-free changes are always scheduled.
58
+ - The subscription stores the selected price ID. Renewal reads that row's current catalog value.
59
+ - Current-period feature snapshots protect already-started periods from harmful feature changes while allowing beneficial changes immediately.
60
+ - Accepted Offer phases are immutable snapshots; base prices are not.
61
+ - Recovery retries the same outstanding invoice instead of creating a new sale.
62
+
63
+ ## Explore Each Topic
64
+
65
+ - [Pricing Changes](/docs/what-happens-when-you-change-your-prices) — What happens when you change your prices
66
+ - [Plan Changes](/docs/what-happens-when-a-customer-changes-plans) — Upgrades, downgrades, and switching plans
67
+ - [Billing Intervals](/docs/how-do-monthly-quarterly-and-yearly-billing-work) — Monthly, quarterly, and yearly billing
68
+ - [Invoices](/docs/what-invoices-do-customers-receive-and-when) — What invoices your customers receive and when
69
+ - [Proration](/docs/how-is-proration-calculated-when-changing-plans) — How mid-cycle charges are calculated
70
+ - [Trials](/docs/how-do-trial-periods-work) — How trial periods work
71
+ - [Free Plans](/docs/how-do-free-plans-work-without-payment) — How free plans work
72
+ - [Payment Failures](/docs/what-happens-when-a-payment-fails) — What happens when a payment fails
73
+ - [Seats](/docs/how-does-seat-based-billing-work) — How seat-based billing works
@@ -0,0 +1,17 @@
1
+ ---
2
+ lastModified: 2026-08-16
3
+ title: Payment Routing
4
+ description: Understand how Commet chooses a provider and why existing saved methods stay on their original connection.
5
+ ---
6
+
7
+ For a new checkout, Commet uses the payment connection assigned to the customer's country. If no country route matches, it uses the organization's default connection.
8
+
9
+ Once a subscription stores a payment method, renewals and retries continue through that same connection. Changing a country route or the default affects new selection; it does not copy an existing card between Commet, Stripe, and dLocal.
10
+
11
+ This means routing is not automatic failover. A provider decline or outage is recorded as a failure. Commet does not silently move the charge to another provider account.
12
+
13
+ To move an existing customer, collect a new payment method through checkout or the Customer Portal on the intended connection. That is a new setup, not a database migration of card credentials.
14
+
15
+ Use the dashboard under **Settings → Payments** to connect providers, assign countries, and choose the default. Inspect the provider and connection on **Transactions** when diagnosing a payment.
16
+
17
+ See [Payment Orchestration](/docs/payment-orchestration) for configuration.
@@ -0,0 +1,106 @@
1
+ ---
2
+ lastModified: 2026-07-28
3
+ title: Quota
4
+ description: How quota-based billing works for your customers
5
+ ---
6
+
7
+ 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.
8
+
9
+ ## How it works
10
+
11
+ Units above the included amount at the start of a period are billed for the **full period in advance**.
12
+
13
+ ```
14
+ Plan Pro: 15 included tasks, $0.75/extra task
15
+ Your customer starts the period holding 25 tasks
16
+
17
+ Included: 15 tasks (no charge)
18
+ Extra: 10 tasks × $0.75 = $7.50 — billed in advance for the full period
19
+ ```
20
+
21
+ ## Quota rises and falls
22
+
23
+ The balance moves during the period, but billing follows the **high-water mark** — the highest quota held during the period. Each increase above the mark is billed from the day of the increase to the **end of the period**; deleting units never reduces the charge.
24
+
25
+ ```
26
+ Your customer starts the month at 15 tasks.
27
+ They create 10 more on day 15 (25 total), then delete them on day 20.
28
+
29
+ Extra: 10 tasks billed from day 15 to the end of the period
30
+ 10 × $0.75 × (15/30) = $3.75
31
+ ```
32
+
33
+ The charge is the same whether they keep the 10 tasks until the end of the period or delete them on day 20. Re-creating units below the high-water mark costs nothing — they're already billed.
34
+
35
+ These charges land on the next renewal invoice.
36
+
37
+ ## What happens when you change the included amount
38
+
39
+ ### Adding more included units
40
+
41
+ More included units **benefits your customers**, so it applies right away.
42
+
43
+ ```
44
+ You increase Plan Pro from 15 to 30 included tasks.
45
+ Your customer has 25 tasks (was paying for 10 extra at $7.50/mo).
46
+
47
+ After the change:
48
+ → All 25 tasks are now within the 30 included
49
+ → Extra charges drop to $0
50
+ → Your customer sees the change immediately
51
+ ```
52
+
53
+ ### Reducing included units
54
+
55
+ Fewer included units harms your customers, so it applies **at renewal**.
56
+
57
+ ```
58
+ You decrease Plan Pro from 30 to 15 included tasks.
59
+ Your customer has 25 tasks (all included, $0 extra).
60
+
61
+ This period: Still 25 within the included amount, $0 extra
62
+ At renewal: 15 included + 10 extra = $7.50/mo
63
+ ```
64
+
65
+ ## What happens when you change the price
66
+
67
+ Quota unit prices use current-period snapshots: a lower price applies immediately, while a higher price starts next period.
68
+
69
+ | Change | What your customer pays |
70
+ | --------------- | -------------------------------------------- |
71
+ | Lower the price | New lower price in the current period |
72
+ | Raise the price | Old price this period; new price next period |
73
+
74
+ ## Quota and upgrades
75
+
76
+ On an upgrade, your customer is charged the new plan's **full price** and credited for the unused days of the old plan's **base price**. Extra-unit charges already paid are not credited.
77
+
78
+ ### Example
79
+
80
+ ```
81
+ Your customer is on Pro ($29/mo, 15 included tasks, $0.75/extra task).
82
+ They have 25 tasks — paying $36.50/mo total (15 included + 10 extra).
83
+
84
+ They upgrade to Scale ($79/mo, 50 included tasks, $0.50/extra task).
85
+ On day 15 of their cycle.
86
+
87
+ Charge:
88
+ New plan: $79 (full price — the billing cycle restarts today)
89
+ Extra tasks: $0 — their 25 tasks are within the 50 included
90
+
91
+ Credit:
92
+ Plan base: $29 × (15/30) = $14.50
93
+ Extra tasks: $0 — extra-unit charges already paid are not credited
94
+
95
+ They pay today: $64.50
96
+ ```
97
+
98
+ > **Note**
99
+ >
100
+ > Your customer's 25 tasks are now covered by the Scale plan's 50 included tasks. They stop paying for extra tasks entirely.
101
+
102
+ ## Related
103
+
104
+ - [Proration](/docs/how-is-proration-calculated-when-changing-plans) — How mid-cycle charges are calculated
105
+ - [Pricing Changes](/docs/what-happens-when-you-change-your-prices) — How price changes apply to existing customers
106
+ - [Billing Intervals](/docs/how-do-monthly-quarterly-and-yearly-billing-work) — When quota is charged on quarterly and yearly plans