@commet/node 9.10.0 → 9.12.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 (39) hide show
  1. package/dist/index.d.mts +167 -73
  2. package/dist/index.d.ts +167 -73
  3. package/dist/index.js +16 -13
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +16 -13
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/api-reference/customers.md +3 -3
  8. package/docs/api-reference/features.md +1 -1
  9. package/docs/api-reference/index.md +1 -1
  10. package/docs/api-reference/invoices.md +4 -3
  11. package/docs/api-reference/plans.md +8 -4
  12. package/docs/api-reference/subscriptions.md +10 -6
  13. package/docs/api-reference/transactions.md +2 -1
  14. package/docs/documentation/error-handling.md +11 -0
  15. package/docs/documentation/invoicing/manage-invoices.md +1 -1
  16. package/docs/documentation/plans/add-ons.md +4 -2
  17. package/docs/documentation/plans/balance-and-top-ups.md +3 -1
  18. package/docs/documentation/plans/consumption-models.md +29 -1
  19. package/docs/documentation/plans/credit-packs.md +28 -8
  20. package/docs/documentation/plans/plan-versions.md +9 -7
  21. package/docs/documentation/sales/promotional-offers.md +1 -1
  22. package/docs/documentation/sales/regional-prices.md +1 -1
  23. package/docs/documentation/subscriptions/manage-subscriptions.md +1 -1
  24. package/docs/documentation/subscriptions/plan-grants.md +22 -6
  25. package/docs/errors/currency_held_by_balance_plan.md +22 -0
  26. package/docs/errors/currency_held_by_customer_credit.md +22 -0
  27. package/docs/errors/currency_held_by_fixed_amount_discount.md +22 -0
  28. package/docs/errors/currency_held_by_payment_method.md +22 -0
  29. package/docs/errors/currency_held_by_prepaid_period.md +22 -0
  30. package/docs/errors/currency_held_by_scheduled_pause.md +22 -0
  31. package/docs/errors/index.md +7 -1
  32. package/docs/errors/missing_regional_price.md +3 -3
  33. package/docs/knowledge-base/how-do-discounts-work.md +19 -1
  34. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +1 -1
  35. package/docs/manifest.json +37 -1
  36. package/docs/schemas.md +30 -16
  37. package/docs/webhooks.md +18 -17
  38. package/docs/webhooks.openapi.json +63 -37
  39. package/package.json +1 -1
@@ -0,0 +1,22 @@
1
+ # currency_held_by_fixed_amount_discount
2
+
3
+ The subscription has a fixed-amount discount in the currency it pays still running, so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_fixed_amount_discount`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version, or move it once that discount ends.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
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
+ # currency_held_by_payment_method
2
+
3
+ The subscription pays through a provider that cannot charge it in USD (dLocal: Mercado Pago, Pix, OXXO or a card), so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_payment_method`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version, or move it once it pays with a method that can be charged in USD.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
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
+ # currency_held_by_prepaid_period
2
+
3
+ The subscription has a prepaid period paid in the currency it pays that it has not used, so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_prepaid_period`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version, or move it once that prepaid period is used.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
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
+ # currency_held_by_scheduled_pause
2
+
3
+ The subscription has a pause scheduled, so a version move cannot charge it in USD.
4
+
5
+ - **Error type:** `billing_error`
6
+ - **`code`:** `currency_held_by_scheduled_pause`
7
+ - **API version:** `2026-08-27`
8
+
9
+
10
+ ## What to do
11
+
12
+ Keep the subscription on its version, or move it once the pause is revoked or the subscription resumes.
13
+
14
+ The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
+
16
+ ## Retry behavior
17
+
18
+ Retry with currency usd once the reason no longer applies; a scheduled move that meets it at renewal is canceled with this code as its reason.
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.
@@ -37,7 +37,13 @@ Use the response `code` to open the matching local reference. Preserve `x-reques
37
37
  - [`included_limit_reached`](./included_limit_reached.md) — The requested usage exceeds the plan's included usage limit.
38
38
  - [`plan_credit_limit_reached`](./plan_credit_limit_reached.md) — The usage event would spend more plan credits than the plan's credit limit allows in the current day or week, and purchased credits do not cover the rest.
39
39
  - [`plan_balance_limit_reached`](./plan_balance_limit_reached.md) — The usage event would spend more plan balance than the plan's balance limit allows in the current day or week, and purchased balance does not cover the rest.
40
- - [`missing_regional_price`](./missing_regional_price.md) — The plan, or the plan version a subscription is moving to, has no price for the subscription's currency or resolved market. A version move never changes the subscription's currency.
40
+ - [`missing_regional_price`](./missing_regional_price.md) — The plan, or the plan version a subscription is moving to, has no price for the subscription's currency or resolved market. A version move keeps the subscription's currency unless it asks to charge it in USD from its renewal; asking for another currency, or for USD when the version still sells what the subscription pays, is refused with this code, and what keeps a subscription in its currency has its own currency_held_by code.
41
+ - [`currency_held_by_payment_method`](./currency_held_by_payment_method.md) — The subscription pays through a provider that cannot charge it in USD (dLocal: Mercado Pago, Pix, OXXO or a card), so a version move cannot charge it in USD.
42
+ - [`currency_held_by_customer_credit`](./currency_held_by_customer_credit.md) — The customer holds credit in the currency the subscription pays, which applies only to invoices in that currency, so a version move cannot charge it in USD.
43
+ - [`currency_held_by_balance_plan`](./currency_held_by_balance_plan.md) — The subscription is on a balance plan, and its balance is in the currency it pays, so a version move cannot charge it in USD.
44
+ - [`currency_held_by_fixed_amount_discount`](./currency_held_by_fixed_amount_discount.md) — The subscription has a fixed-amount discount in the currency it pays still running, so a version move cannot charge it in USD.
45
+ - [`currency_held_by_prepaid_period`](./currency_held_by_prepaid_period.md) — The subscription has a prepaid period paid in the currency it pays that it has not used, so a version move cannot charge it in USD.
46
+ - [`currency_held_by_scheduled_pause`](./currency_held_by_scheduled_pause.md) — The subscription has a pause scheduled, so a version move cannot charge it in USD.
41
47
  - [`payment_failed`](./payment_failed.md) — The operation could not complete its payment or required tax calculation.
42
48
  - [`payment_not_found`](./payment_not_found.md) — The requested payment does not exist in this organization.
43
49
  - [`payment_method_not_found`](./payment_method_not_found.md) — The requested or required payment method could not be found.
@@ -1,6 +1,6 @@
1
1
  # missing_regional_price
2
2
 
3
- The plan, or the plan version a subscription is moving to, has no price for the subscription's currency or resolved market. A version move never changes the subscription's currency.
3
+ The plan, or the plan version a subscription is moving to, has no price for the subscription's currency or resolved market. A version move keeps the subscription's currency unless it asks to charge it in USD from its renewal; asking for another currency, or for USD when the version still sells what the subscription pays, is refused with this code, and what keeps a subscription in its currency has its own currency_held_by code.
4
4
 
5
5
  - **Error type:** `billing_error`
6
6
  - **`code`:** `missing_regional_price`
@@ -9,13 +9,13 @@ The plan, or the plan version a subscription is moving to, has no price for the
9
9
 
10
10
  ## What to do
11
11
 
12
- Configure the missing regional or currency price identified by the response, or move the subscription to a version that sells its currency.
12
+ Configure the missing regional or currency price identified by the response, move the subscription to a version that sells its currency, or ask to charge it in USD from its renewal.
13
13
 
14
14
  The response `message`, `param`, and `details` fields describe the condition observed by the specific operation.
15
15
 
16
16
  ## Retry behavior
17
17
 
18
- Retry after the required price is configured, or with a version that sells the subscription's currency.
18
+ Retry after the required price is configured, with a version that sells the subscription's currency, or with currency usd when the version does not sell it.
19
19
 
20
20
  ## Correlate the request
21
21
 
@@ -40,7 +40,25 @@ Trials are not Offer phases. When the price has a [trial](/docs/trial-periods),
40
40
 
41
41
  ## Plan changes
42
42
 
43
- The Offer Application belongs to the price target accepted by the subscription. An immediate plan change ends that application. The change may pass a new `offerId` or a `promoCode`; otherwise the new plan begins at its normal price. Scheduled plan changes accept neither.
43
+ A discount belongs to the subscription, not to the plan. When the customer changes to another paid plan or billing interval, the same Offer Application keeps going on the new plan with the billing periods it still had to discount. The charge for the change is the next of those periods, so no cycle is added and none is lost. A discount without an end keeps applying.
44
+
45
+ ```
46
+ Starter costs $20/month with 50% off for 3 cycles.
47
+ The customer pays cycle 1 and upgrades to Pro ($40/month):
48
+
49
+ Change to Pro: $20.00 (cycle 2), minus the credit for unused Starter time
50
+ Next renewal: $20.00 (cycle 3)
51
+ Renewal after: $40.00
52
+ ```
53
+
54
+ - A percentage is the same percentage of the new price. An amount off is the same amount.
55
+ - A `fixed_price` phase, free cycles included, is the price of the plan it was accepted on: it ends with the change, and the other phases of the Offer continue.
56
+ - When the billing interval changes, the discount keeps the time it had left. With two monthly cycles left, a yearly charge made within those two months is discounted in full and the next yearly renewal is not.
57
+ - A Promo Code or Card Promotion restricted to plans or to a billing interval ends with the change when the new plan or interval is outside its restriction.
58
+ - A change that passes its own `offerId` or `promoCode` applies that Offer with its full duration and ends the previous one. Scheduled plan changes accept neither.
59
+ - A move to a free plan ends the discount.
60
+
61
+ Plan-change previews and the Customer Portal quote the new plan with the discount the change will charge.
44
62
 
45
63
  ## What gets discounted
46
64
 
@@ -69,4 +69,4 @@ When you publish a draft in the dashboard, choose whether subscribers of earlier
69
69
 
70
70
  A move at the next renewal changes nothing before it. A subscription that ends or changes to another plan by that renewal never moves.
71
71
 
72
- A move never prorates or refunds, and it never changes a subscription's currency. A move made now changes features and limits today and the price from the next renewal. See [Move subscribers](/docs/plan-versions#move-subscribers).
72
+ A move never prorates or refunds, and it keeps a subscription's currency unless you charge it in USD from its next renewal. A move made now changes features and limits today and the price from the next renewal. See [Move subscribers](/docs/plan-versions#move-subscribers).
@@ -116,7 +116,7 @@
116
116
  },
117
117
  "errorReferences": {
118
118
  "index": "errors/index.md",
119
- "count": 94,
119
+ "count": 100,
120
120
  "entries": [
121
121
  {
122
122
  "code": "validation_error",
@@ -322,6 +322,42 @@
322
322
  "documentation": "errors/missing_regional_price.md",
323
323
  "canonicalUrl": "/docs/api-reference/2026-08-27/errors/missing_regional_price.md"
324
324
  },
325
+ {
326
+ "code": "currency_held_by_payment_method",
327
+ "type": "billing_error",
328
+ "documentation": "errors/currency_held_by_payment_method.md",
329
+ "canonicalUrl": "/docs/api-reference/2026-08-27/errors/currency_held_by_payment_method.md"
330
+ },
331
+ {
332
+ "code": "currency_held_by_customer_credit",
333
+ "type": "billing_error",
334
+ "documentation": "errors/currency_held_by_customer_credit.md",
335
+ "canonicalUrl": "/docs/api-reference/2026-08-27/errors/currency_held_by_customer_credit.md"
336
+ },
337
+ {
338
+ "code": "currency_held_by_balance_plan",
339
+ "type": "billing_error",
340
+ "documentation": "errors/currency_held_by_balance_plan.md",
341
+ "canonicalUrl": "/docs/api-reference/2026-08-27/errors/currency_held_by_balance_plan.md"
342
+ },
343
+ {
344
+ "code": "currency_held_by_fixed_amount_discount",
345
+ "type": "billing_error",
346
+ "documentation": "errors/currency_held_by_fixed_amount_discount.md",
347
+ "canonicalUrl": "/docs/api-reference/2026-08-27/errors/currency_held_by_fixed_amount_discount.md"
348
+ },
349
+ {
350
+ "code": "currency_held_by_prepaid_period",
351
+ "type": "billing_error",
352
+ "documentation": "errors/currency_held_by_prepaid_period.md",
353
+ "canonicalUrl": "/docs/api-reference/2026-08-27/errors/currency_held_by_prepaid_period.md"
354
+ },
355
+ {
356
+ "code": "currency_held_by_scheduled_pause",
357
+ "type": "billing_error",
358
+ "documentation": "errors/currency_held_by_scheduled_pause.md",
359
+ "canonicalUrl": "/docs/api-reference/2026-08-27/errors/currency_held_by_scheduled_pause.md"
360
+ },
325
361
  {
326
362
  "code": "payment_failed",
327
363
  "type": "billing_error",
package/docs/schemas.md CHANGED
@@ -47,6 +47,8 @@ Generated from Commet API version `2026-08-27`.
47
47
  - `"mercado_pago"`
48
48
  - `"google_pay"`
49
49
  - `"smartpix"`
50
+ - `"apple_pay"`
51
+ - `"link"`
50
52
 
51
53
  ### PaymentProvider
52
54
 
@@ -166,6 +168,8 @@ Generated from Commet API version `2026-08-27`.
166
168
  ### BalanceTopup
167
169
 
168
170
  - `amount` (`number`, required)
171
+ - `status` (`"succeeded" | "processing" | "requires_checkout"`, required) — `succeeded` when the payment was confirmed and the balance was added. `processing` when the payment method confirms later: the balance is added once the payment is confirmed, and nothing is added if it is declined. `requires_checkout` when the subscription has no saved payment method and `successUrl` was sent: the balance is added once the customer pays at `checkoutUrl`.
172
+ - `checkoutUrl` (`string`, optional) — Hosted checkout where the customer pays the purchase and saves the payment method. Present only when `status` is `requires_checkout`.
169
173
  - `object` (`"balance_topup"`, required)
170
174
  - `livemode` (`boolean`, required)
171
175
 
@@ -239,6 +243,8 @@ Generated from Commet API version `2026-08-27`.
239
243
  ### CreditGrant
240
244
 
241
245
  - `credits` (`number`, required)
246
+ - `status` (`"succeeded" | "processing" | "requires_checkout"`, required) — `succeeded` when the payment was confirmed and the credits were added. `processing` when the payment method confirms later: the credits are added once the payment is confirmed, and nothing is added if it is declined. `requires_checkout` when the subscription has no saved payment method and `successUrl` was sent: the credits are added once the customer pays at `checkoutUrl`.
247
+ - `checkoutUrl` (`string`, optional) — Hosted checkout where the customer pays the purchase and saves the payment method. Present only when `status` is `requires_checkout`.
242
248
  - `object` (`"credit_grant"`, required)
243
249
  - `livemode` (`boolean`, required)
244
250
 
@@ -287,7 +293,7 @@ Generated from Commet API version `2026-08-27`.
287
293
  ### CustomerBatch
288
294
 
289
295
  - `successful` (`Array<{ id: string; externalId: string | null; email: string }>`, required)
290
- - `failed` (`Array<{ index: number; error: string; data: { id?: string; externalId?: string; email: string; fullName?: string | null; taxDocument?: string | null; timezone?: string; metadata?: Record<string, unknown> | null; address?: { line1: string; line2?: string; city: string; state?: string; postalCode: string; country: string; region?: string } } }>`, required)
296
+ - `failed` (`Array<{ index: number; error: string; data: { id?: string; externalId?: string; email: string; fullName?: string | null; taxDocument?: string | null; businessTaxId?: string; timezone?: string; metadata?: Record<string, unknown> | null; address?: { line1: string; line2?: string; city: string; state?: string; postalCode: string; country: string; region?: string } } }>`, required)
291
297
  - `object` (`"customer_batch"`, required)
292
298
  - `livemode` (`boolean`, required)
293
299
 
@@ -361,7 +367,7 @@ Generated from Commet API version `2026-08-27`.
361
367
  Variants:
362
368
 
363
369
  - `{ code: string; name: string; unitName: string | null; allowed: boolean; type: "boolean"; enabled: boolean; baseAccess?: { enabled: boolean } | null; object: "feature_access"; livemode: boolean }`
364
- - `{ code: string; name: string; unitName: string | null; allowed: boolean; type: "usage"; consumption: { model: "metered"; period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } } } | { model: "credits"; period: { start: string; end: string }; unitsUsed: number; creditsPerUnit: number; creditsConsumed: number; availableUnits: number } | { model: "balance"; period: { start: string; end: string }; unitsUsed: number; spent: { amount: number; currency: string }; availableUnits?: number; unitPrice?: { amount: number; currency: string; scale: 10000 } }; baseAccess?: { includedUnits: number; unlimited: boolean } | null; object: "feature_access"; livemode: boolean }`
370
+ - `{ code: string; name: string; unitName: string | null; allowed: boolean; type: "usage"; consumption: { model: "metered"; period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } } } | { model: "credits"; period: { start: string; end: string }; unitsUsed: number; creditsPerUnit: number; creditsConsumed: number; unlimited: boolean; availableUnits?: number } | { model: "balance"; period: { start: string; end: string }; unitsUsed: number; spent: { amount: number; currency: string }; unlimited: boolean; availableUnits?: number; unitPrice?: { amount: number; currency: string; scale: 10000 } }; baseAccess?: { includedUnits: number; unlimited: boolean } | null; object: "feature_access"; livemode: boolean }`
365
371
  - `{ code: string; name: string; unitName: string | null; allowed: boolean; type: "seats"; usage: { period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } } }; baseAccess?: { includedUnits: number; unlimited: boolean } | null; object: "feature_access"; livemode: boolean }`
366
372
  - `{ code: string; name: string; unitName: string | null; allowed: boolean; type: "quota"; usage: { period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } }; billedUnits: number }; baseAccess?: { includedUnits: number; unlimited: boolean } | null; object: "feature_access"; livemode: boolean }`
367
373
 
@@ -534,8 +540,10 @@ Variants:
534
540
  - `isFree` (`boolean`, required)
535
541
  - `blockOnExhaustion` (`boolean | null`, required) — Credits and balance plans: true stops usage when the plan and purchased amounts run out; false lets usage continue and bills the missing amount as overage at the next renewal (credits at the price per credit). Trials and free plans always stop.
536
542
  - `unusedPlanCredits` (`{ type: "expire" } | { type: "roll_over"; maxPlanCredits: number | null } | null`, required) — Credits plans only; null for other consumption models. What happens to unused plan credits at each reset. Purchased credits never expire and never count toward maxPlanCredits.
543
+ - `unlimitedPlanCredits` (`boolean | null`, required) — Credits plans only; null for other consumption models. true when the plan credits are unlimited: usage never spends them and only planCreditLimit caps it.
537
544
  - `planCreditLimit` (`{ credits: number; interval: "day" | "week" } | null`, required) — Credits plans only. The most plan credits a subscription spends per day or per week; null means no limit.
538
545
  - `unusedPlanBalance` (`{ type: "expire" } | { type: "roll_over"; maxPlanBalance: number | null } | null`, required) — Balance plans only; null for other consumption models. What happens to unused plan balance at each reset. Purchased balance never expires and never counts toward maxPlanBalance.
546
+ - `unlimitedPlanBalance` (`boolean | null`, required) — Balance plans only; null for other consumption models. true when the plan balance is unlimited: usage never spends it and only planBalanceLimit caps it.
539
547
  - `planBalanceLimit` (`{ amount: number; interval: "day" | "week" } | null`, required) — Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; null means no limit.
540
548
  - `sortOrder` (`number`, required)
541
549
  - `planGroupId` (`string | null`, required)
@@ -553,6 +561,7 @@ Variants:
553
561
 
554
562
  Variants:
555
563
 
564
+ - `{ outcome: "processing"; invoiceId: string; object: "plan_change"; livemode: boolean }`
556
565
  - `{ outcome: "requires_checkout"; requiresCheckout: true; checkoutUrl: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
557
566
  - `{ outcome: "scheduled"; id: string; scheduled: true; scheduledFor: string; changeType: "subscription.plan_downgrade" | "subscription.interval_change" | "subscription.cancel"; customerId: string; newPlanId?: string; newPlanName?: string; newBillingInterval?: string; seatLimitWarning?: { featureCode: string; featureName: string; currentSeats: number; included: number; newPlanName: string; effectiveDate: string }; object: "plan_change"; livemode: boolean }`
558
567
  - `{ outcome: "completed"; id: string; scheduled: false; customerId: string; previousPlan: { id: string; name: string }; currentPlan: { id: string; name: string; price: number }; billingInterval: string; billing: { credit: number; creditsApplied: number; charge: number; taxAmount: number; netAmount: number; totalCharged: number; remainingCreditBalance: number }; invoiceId?: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
@@ -893,12 +902,12 @@ Variants:
893
902
  - `planVersion` (`{ id: string; label: string } | null`, required) — The plan version whose terms the subscription has now. It keeps paying and receiving everything from this version until it is moved.
894
903
  - `offerApplications` (`Array<SubscriptionOfferApplication>`, required)
895
904
  - `pause` (`{ status: "scheduled"; mode: "period_end"; requestedAt: string; effectiveAt: string; resumeAt: string | null } | { status: "active"; mode: "immediate" | "period_end"; requestedAt: string; effectiveAt: string; resumeAt: string | null } | null`, required)
896
- - `scheduledVersionChange` (`{ planVersionId: string; label: string; effectiveAt: string } | null`, required) — A move to another version of the plan pending for the next renewal.
905
+ - `scheduledVersionChange` (`{ planVersionId: string; label: string; effectiveAt: string; currency: string } | null`, required) — A move to another version of the plan pending for the next renewal.
897
906
  - `planGrant` (`{ id: string; plan: { id: string; name: string }; expiresAt: string | null }`, optional)
898
907
  - `consumptionModel` (`ConsumptionModel | null`, required)
899
908
  - `features` (`Array<{ code: string; name: string; type: "boolean"; enabled: boolean; baseAccess?: { enabled: boolean } | null } | { code: string; name: string; type: "usage"; usage?: { current: number; included: number; overageQuantity: number; overageUnitPrice?: number; unlimited?: boolean }; baseAccess?: { included: number; unlimited: boolean } | null } | { code: string; name: string; type: "seats"; usage: { current: number; included: number; overageQuantity: number; overageUnitPrice?: number; unlimited?: boolean }; baseAccess?: { included: number; unlimited: boolean } | null } | { code: string; name: string; type: "quota"; usage?: { current: number; included: number; overageQuantity: number; overageUnitPrice?: number; unlimited?: boolean }; baseAccess?: { included: number; unlimited: boolean } | null }>`, required)
900
- - `credits` (`{ remaining: number; included: number; purchased: number; plan: number; total: number } | null`, required)
901
- - `balance` (`{ remaining: number; included: number; currency: string; plan: number; purchased: number; total: number } | null`, required)
909
+ - `credits` (`{ unlimited: boolean; remaining?: number; included: number; purchased: number; plan?: number; total?: number } | null`, required)
910
+ - `balance` (`{ unlimited: boolean; remaining?: number; included: number; currency: string; plan?: number; purchased: number; total?: number } | null`, required)
902
911
  - `priceId` (`string | null`, required)
903
912
  - `object` (`"subscription"`, required)
904
913
  - `livemode` (`boolean`, required)
@@ -906,8 +915,9 @@ Variants:
906
915
  ### SubscriptionAddon
907
916
 
908
917
  - `addonId` (`string`, required)
909
- - `status` (`"active"`, required)
918
+ - `status` (`"active" | "processing" | "requires_checkout"`, required) — `active` when the add-on is active. `processing` when the payment method confirms later: the add-on is activated once the payment is confirmed, and stays inactive if it is declined. `requires_checkout` when the subscription has no saved payment method and `successUrl` was sent: the add-on is activated once the customer pays at `checkoutUrl`.
910
919
  - `proratedCharge` (`number`, required)
920
+ - `checkoutUrl` (`string`, optional) — Hosted checkout where the customer pays the purchase and saves the payment method. Present only when `status` is `requires_checkout`.
911
921
  - `object` (`"subscription_addon"`, required)
912
922
  - `livemode` (`boolean`, required)
913
923
 
@@ -1020,9 +1030,10 @@ Variants:
1020
1030
  - `subtotal` (`number | null`, required) — Subtotal in USD cents (gross minus tax). Null when grossAmount is null.
1021
1031
  - `taxAmount` (`number | null`, required)
1022
1032
  - `presentmentAmount` (`number | null`, required) — Amount in the charge currency's smallest unit, as presented to the customer. Set for non-USD charges; null when the charge was made in USD.
1033
+ - `amountRefunded` (`number`, required) — Cumulative confirmed refunds in the payment currency’s smallest unit.
1023
1034
  - `currency` (`string`, required)
1024
1035
  - `provider` (`PaymentProvider`, required) — The payment provider the charge was routed to: stripe, commet, or dlocal.
1025
- - `paymentMethod` (`PaymentMethod | null`, required) — The method used for this charge: card, oxxo, or mercado_pago. Null when unknown.
1036
+ - `paymentMethod` (`PaymentMethod | null`, required) — The method used for this charge: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
1026
1037
  - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
1027
1038
  - `status` (`TransactionStatus`, required)
1028
1039
  - `customerEmail` (`string | null`, required)
@@ -1043,9 +1054,10 @@ Variants:
1043
1054
  - `subtotal` (`number | null`, required) — Subtotal in USD cents (gross minus tax). Null when grossAmount is null.
1044
1055
  - `taxAmount` (`number | null`, required)
1045
1056
  - `presentmentAmount` (`number | null`, required) — Amount in the charge currency's smallest unit, as presented to the customer. Set for non-USD charges; null when the charge was made in USD.
1057
+ - `amountRefunded` (`number`, required) — Cumulative confirmed refunds in the payment currency’s smallest unit.
1046
1058
  - `currency` (`string`, required)
1047
1059
  - `provider` (`PaymentProvider`, required) — The payment provider the charge was routed to: stripe, commet, or dlocal.
1048
- - `paymentMethod` (`PaymentMethod | null`, required) — The method used for this charge: card, oxxo, or mercado_pago. Null when unknown.
1060
+ - `paymentMethod` (`PaymentMethod | null`, required) — The method used for this charge: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
1049
1061
  - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
1050
1062
  - `status` (`TransactionStatus`, required)
1051
1063
  - `customerEmail` (`string | null`, required)
@@ -1083,8 +1095,8 @@ Variants:
1083
1095
  Variants:
1084
1096
 
1085
1097
  - `{ allowed: boolean; subscriptionStatus: string; featureCode: string; quantity: number; reason?: string; message?: string; consumptionModel: "metered"; current: number; remaining: number; unlimited: boolean; included: number; overageEnabled: boolean; overageUnitPrice: number | null; object: "usage_check"; livemode: boolean }`
1086
- - `{ allowed: boolean; subscriptionStatus: string; featureCode: string; quantity: number; reason?: string; message?: string; consumptionModel: "credits"; creditsPerUnit: number; estimatedCredits: number; planCredits: number; purchasedCredits: number; totalCredits: number; planCreditLimit: { credits: number; interval: "day" | "week"; spent: number; remaining: number; resetsAt: string } | null; blockOnExhaustion: boolean; object: "usage_check"; livemode: boolean }`
1087
- - `{ allowed: boolean; subscriptionStatus: string; featureCode: string; quantity: number; reason?: string; message?: string; consumptionModel: "balance"; unitPrice: number; estimatedAmount: number; currentBalance: number; planBalance: number; purchasedBalance: number; totalBalance: number; planBalanceLimit: { amount: number; interval: "day" | "week"; spent: number; remaining: number; resetsAt: string } | null; blockOnExhaustion: boolean; currency: string; object: "usage_check"; livemode: boolean }`
1098
+ - `{ allowed: boolean; subscriptionStatus: string; featureCode: string; quantity: number; reason?: string; message?: string; consumptionModel: "credits"; creditsPerUnit: number; estimatedCredits: number; unlimited: boolean; planCredits?: number; purchasedCredits: number; totalCredits?: number; planCreditLimit: { credits: number; interval: "day" | "week"; spent: number; remaining: number; resetsAt: string } | null; blockOnExhaustion: boolean; object: "usage_check"; livemode: boolean }`
1099
+ - `{ allowed: boolean; subscriptionStatus: string; featureCode: string; quantity: number; reason?: string; message?: string; consumptionModel: "balance"; unitPrice: number; estimatedAmount: number; unlimited: boolean; currentBalance?: number; planBalance?: number; purchasedBalance: number; totalBalance?: number; planBalanceLimit: { amount: number; interval: "day" | "week"; spent: number; remaining: number; resetsAt: string } | null; blockOnExhaustion: boolean; currency: string; object: "usage_check"; livemode: boolean }`
1088
1100
 
1089
1101
  ### UsageEvent
1090
1102
 
@@ -1096,7 +1108,7 @@ Variants:
1096
1108
  - `ts` (`string`, required)
1097
1109
  - `createdAt` (`string`, required)
1098
1110
  - `properties` (`Array<{ property: string; value: string }>`, required)
1099
- - `consumption` (`{ model: "credits" | "balance"; deducted: number; remaining: number; blocked: boolean; planCreditLimit?: { credits: number; interval: "day" | "week"; spent: number; remaining: number; resetsAt: string } | null; planBalanceLimit?: { amount: number; interval: "day" | "week"; spent: number; remaining: number; resetsAt: string } | null }`, optional)
1111
+ - `consumption` (`{ model: "credits" | "balance"; deducted: number; unlimited: boolean; remaining?: number; blocked: boolean; planCreditLimit?: { credits: number; interval: "day" | "week"; spent: number; remaining: number; resetsAt: string } | null; planBalanceLimit?: { amount: number; interval: "day" | "week"; spent: number; remaining: number; resetsAt: string } | null }`, optional)
1100
1112
  - `object` (`"usage_event"`, required)
1101
1113
  - `livemode` (`boolean`, required)
1102
1114
 
@@ -1144,10 +1156,11 @@ Variants:
1144
1156
 
1145
1157
  ### WebhookBalance
1146
1158
 
1147
- - `currentBalance` (`number`, required) — The available balance, plan plus purchased, in rate scale. Equal to totalBalance.
1148
- - `planBalance` (`number`, required) — The plan part in rate scale: spent first, replaced or rolled over at each reset, negative while overage is owed.
1159
+ - `unlimited` (`boolean`, required) — true when the plan balance is unlimited: usage never spends it and only the plan balance limit caps it.
1160
+ - `currentBalance` (`number`, optional) — The available balance, plan plus purchased, in rate scale. Equal to totalBalance. Omitted when unlimited is true.
1161
+ - `planBalance` (`number`, optional) — The plan part in rate scale: spent first, replaced or rolled over at each reset, negative while overage is owed. Omitted when unlimited is true.
1149
1162
  - `purchasedBalance` (`number`, required) — The purchased part in rate scale: top-ups and manual adjustments, spent after the plan part and kept until the subscription ends.
1150
- - `totalBalance` (`number`, required) — planBalance plus purchasedBalance, in rate scale.
1163
+ - `totalBalance` (`number`, optional) — planBalance plus purchasedBalance, in rate scale. Omitted when unlimited is true.
1151
1164
 
1152
1165
  ### WebhookBankRef
1153
1166
 
@@ -1163,9 +1176,10 @@ Variants:
1163
1176
 
1164
1177
  ### WebhookCreditsBalance
1165
1178
 
1166
- - `planCredits` (`number`, required)
1179
+ - `unlimited` (`boolean`, required) — true when the plan credits are unlimited: usage never spends them and only the plan credit limit caps it.
1180
+ - `planCredits` (`number`, optional) — Plan credits left. Omitted when unlimited is true.
1167
1181
  - `purchasedCredits` (`number`, required)
1168
- - `totalCredits` (`number`, required)
1182
+ - `totalCredits` (`number`, optional) — planCredits plus purchasedCredits. Omitted when unlimited is true.
1169
1183
 
1170
1184
  ### WebhookPlanGrantTimelineEvent
1171
1185
 
package/docs/webhooks.md CHANGED
@@ -38,7 +38,7 @@ Fired once, when the subscription's first charge succeeds and it becomes active
38
38
 
39
39
  ## subscription.reactivated
40
40
 
41
- Fired when a canceled subscription is reactivated and its reactivation charge succeeds. The subscription returns to active with a fresh invoice and a billing period anchored to the reactivation date. Distinct from subscription.activated (first activation) and payment.recovered (past_due recovery, which keeps the original anchor).
41
+ Fired when a canceled subscription is reactivated: its reactivation charge succeeds, or its reactivation invoice totals zero and is paid without a charge. The subscription returns to active with a fresh invoice and a billing period anchored to the reactivation date. Distinct from subscription.activated (first activation) and payment.recovered (past_due recovery, which keeps the original anchor).
42
42
 
43
43
  ### Data
44
44
 
@@ -52,7 +52,7 @@ Fired when a canceled subscription is reactivated and its reactivation charge su
52
52
  - `invoiceNumber` (`string`, required) — The human-readable invoice number.
53
53
  - `invoiceTotal` (`number`, required) — Invoice total in cents (100 = $1.00).
54
54
  - `invoiceCurrency` (`string`, required) — The invoice currency code.
55
- - `provider` (`"stripe" | "commet" | "dlocal"`, required) — The payment provider that processed the reactivation charge: stripe, commet, or dlocal.
55
+ - `provider` (`"stripe" | "commet" | "dlocal"`, required) — The subscription's payment provider, which processed the reactivation charge: stripe, commet, or dlocal. A reactivation whose invoice totals zero runs no charge and still carries the subscription's provider.
56
56
 
57
57
  ## subscription.pause_scheduled
58
58
 
@@ -243,7 +243,7 @@ Fired when a scheduled move to another plan version will no longer take effect b
243
243
  - `subscriptionId` (`string`, required) — The subscription ID.
244
244
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
245
245
  - `toVersionId` (`string`, required) — The version the subscription was going to move to.
246
- - `reason` (`string`, required) — Why the move was canceled: canceled_by_merchant, version_change_failed when the move could not be applied at renewal, or the code of what the subscription no longer fits (addon_unavailable, seat_limit_exceeded, price_not_found, missing_regional_price).
246
+ - `reason` (`string`, required) — Why the move was canceled: canceled_by_merchant, version_change_failed when the move could not be applied at renewal, the code of what the subscription no longer fits (addon_unavailable, seat_limit_exceeded, price_not_found, missing_regional_price), or, for a move that charges it in USD, what keeps it in its currency (currency_held_by_payment_method, currency_held_by_customer_credit, currency_held_by_balance_plan, currency_held_by_fixed_amount_discount, currency_held_by_prepaid_period, currency_held_by_scheduled_pause).
247
247
 
248
248
  ## subscription.past_due
249
249
 
@@ -297,7 +297,7 @@ Fired when a trial period runs out. With a payment method the billing cycle acti
297
297
 
298
298
  ## trial.will_end
299
299
 
300
- Predictive event fired once, 3 days before a trial ends. Use it to remind the customer that billing starts soon. Emitted by a daily scan with a deterministic idempotency key, so it never fires twice for the same trial end date.
300
+ Predictive event fired once, 3 days before a trial ends. Use it to remind the customer that billing starts soon. Emitted by a recurring scan with a deterministic idempotency key, so it never fires twice for the same trial end date.
301
301
 
302
302
  ### Data
303
303
 
@@ -348,7 +348,7 @@ Fired every time a payment settles successfully — the first payment and every
348
348
  - `subscriptionId` (`string | null`, required) — The subscription ID.
349
349
  - `paymentTransactionId` (`string | null`, required) — The payment transaction ID.
350
350
  - `provider` (`"stripe" | "commet" | "dlocal" | null`, required) — The payment provider the charge was routed to: stripe, commet, or dlocal. Null for billing-only charges with no Commet ledger row.
351
- - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
351
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
352
352
  - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
353
353
  - `grossAmount` (`number | null`, required) — Gross amount in cents before fees.
354
354
  - `currency` (`string | null`, required) — The payment currency code.
@@ -368,7 +368,7 @@ Fired when an invoice-linked subscription charge fails.
368
368
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
369
369
  - `subscriptionId` (`string | null`, required) — The subscription ID, if the invoice is linked to a subscription.
370
370
  - `provider` (`"stripe" | "commet" | "dlocal"`, required) — The payment provider the charge was routed to: stripe, commet, or dlocal.
371
- - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
371
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
372
372
  - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
373
373
  - `failureCode` (`string`, required) — The failure code from the payment processor.
374
374
  - `failureMessage` (`string`, required) — A human-readable failure message.
@@ -386,7 +386,7 @@ Fired when an outstanding invoice that previously failed is successfully paid
386
386
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
387
387
  - `subscriptionId` (`string | null`, required) — The subscription ID, if the invoice is linked to a subscription.
388
388
  - `provider` (`"stripe" | "commet" | "dlocal" | null`, required) — The payment provider that recovered the payment, or null when the invoice was recovered without a processor charge.
389
- - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
389
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
390
390
  - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
391
391
 
392
392
  ## payment.retry_failed
@@ -415,6 +415,7 @@ Fired when a payment is refunded, fully or partially. A refund does not change t
415
415
  - `invoiceNumber` (`string | null`, required) — The human-readable invoice number, if available.
416
416
  - `customerId` (`string | null`, required) — The customer ID, when the payment is linked to an invoice. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
417
417
  - `subscriptionId` (`string | null`, required) — The subscription ID, if the invoice is linked to a subscription.
418
+ - `amountRefunded` (`number`, required) — Cumulative confirmed refunds in the payment currency’s smallest unit.
418
419
  - `refundAmount` (`number`, required) — The refunded amount in cents (100 = $1.00).
419
420
  - `currency` (`string`, required) — The refund currency code.
420
421
 
@@ -482,7 +483,7 @@ Fired when a payment link is paid. The charge settled and a one-time invoice was
482
483
  - `invoiceId` (`string`, required) — The one-time invoice generated for this payment.
483
484
  - `invoiceNumber` (`string`, required) — The human-readable invoice number.
484
485
  - `paymentTransactionId` (`string | null`, required) — The payment transaction ID for the settled charge.
485
- - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
486
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
486
487
  - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
487
488
 
488
489
  ## payment_link.failed
@@ -500,7 +501,7 @@ Fired when a payment link charge attempt is declined. The link stays open and ca
500
501
  - `customerId` (`string | null`, required) — The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
501
502
  - `failureCode` (`string`, required) — The failure code from the payment processor.
502
503
  - `failureMessage` (`string`, required) — A human-readable failure message.
503
- - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
504
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
504
505
  - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
505
506
 
506
507
  ## payment_link.canceled
@@ -537,7 +538,7 @@ Fired when a new invoice is generated for a subscription, typically at the start
537
538
 
538
539
  ## invoice.voided
539
540
 
540
- Fired when an invoice is voided — nullified before collection, either manually or automatically when its subscription is canceled. Voiding is terminal: a void invoice is never retried or collected.
541
+ Fired when an invoice is voided — nullified before collection, for example when its subscription is canceled. Voiding is terminal: a void invoice is never retried or collected.
541
542
 
542
543
  ### Data
543
544
 
@@ -556,7 +557,7 @@ Fired when an invoice is voided — nullified before collection, either manually
556
557
 
557
558
  ## invoice.overdue
558
559
 
559
- Fired once when an outstanding invoice passes its due date without payment. The invoice keeps its outstanding status — overdue is a fact about the due date, not a new status. Use it to start your own dunning flow.
560
+ Fired once when an invoice is still outstanding 24 hours after its due date. The invoice keeps its outstanding status — overdue is a fact about the due date, not a new status. Use it to start your own dunning flow.
560
561
 
561
562
  ### Data
562
563
 
@@ -575,7 +576,7 @@ Fired once when an outstanding invoice passes its due date without payment. The
575
576
 
576
577
  ## invoice.upcoming
577
578
 
578
- Predictive event fired once, 3 days before an active subscription renews. Use it to notify the customer before they are charged. Carries no amount — usage-based charges are only final at renewal, when invoice.created delivers the actual invoice.
579
+ Predictive event fired once, 3 days before an active subscription renews. A subscription on a free plan issues no renewal invoice and does not fire it. Use it to notify the customer before they are charged. Carries no amount — usage-based charges are only final at renewal, when invoice.created delivers the actual invoice.
579
580
 
580
581
  ### Data
581
582
 
@@ -595,7 +596,7 @@ Fired when Commet records a payment method for a subscription: after a paid chec
595
596
 
596
597
  - `subscriptionId` (`string`, required) — The subscription the payment method was saved for.
597
598
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
598
- - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
599
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
599
600
  - `card` (`WebhookCardInfo | null`, required) — Card display metadata: brand, last4, expMonth, expYear. Null when the method is not a card or its details cannot be retrieved.
600
601
 
601
602
  ## payment_method.updated
@@ -605,7 +606,7 @@ Fired when a customer replaces their default payment method through the customer
605
606
  ### Data
606
607
 
607
608
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
608
- - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
609
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
609
610
  - `card` (`WebhookCardInfo | null`, required) — Card display metadata for the new method: brand, last4, expMonth, expYear. Null when the method is not a card or its details cannot be retrieved.
610
611
 
611
612
  ## payment_method.detached
@@ -615,7 +616,7 @@ Fired when a saved payment method is removed from a customer: the customer unlin
615
616
  ### Data
616
617
 
617
618
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
618
- - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
619
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown.
619
620
  - `card` (`WebhookCardInfo | null`, required) — Card display metadata of the removed method: brand, last4, expMonth, expYear. Null when the method is not a card or its details cannot be retrieved.
620
621
  - `reason` (`"unlinked_at_provider" | "removed_by_customer"`, required) — Why the method was removed: `unlinked_at_provider` when the customer revoked it at the payment provider, `removed_by_customer` when the customer removed it through the customer portal.
621
622
 
@@ -668,7 +669,7 @@ Aggregate entitlement event answering one question: what can this customer acces
668
669
  - `plan` (`WebhookPlanRef | null`, required) — The current plan (id and name), or null when status is none.
669
670
  - `billingInterval` (`string | null`, required) — The current billing interval.
670
671
  - `consumptionModel` (`string | null`, required) — The plan's consumption model: metered, credits, or balance.
671
- - `features` (`Array<{ code: string; name: string; unitName: string | null; allowed: boolean; type: "boolean"; enabled: boolean } | { code: string; name: string; unitName: string | null; allowed: boolean; type: "usage"; consumption: { model: "metered"; period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } } } | { model: "credits"; period: { start: string; end: string }; unitsUsed: number; creditsPerUnit: number; creditsConsumed: number; availableUnits: number } | { model: "balance"; period: { start: string; end: string }; unitsUsed: number; spent: { amount: number; currency: string }; availableUnits?: number; unitPrice?: { amount: number; currency: string; scale: 10000 } } } | { code: string; name: string; unitName: string | null; allowed: boolean; type: "seats"; usage: { period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } } } } | { code: string; name: string; unitName: string | null; allowed: boolean; type: "quota"; usage: { period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } }; billedUnits: number } }>`, required) — Current feature access, discriminated by type. Boolean features expose enabled; usage features expose model-specific consumption; seats and quota expose usage allowances.
672
+ - `features` (`Array<{ code: string; name: string; unitName: string | null; allowed: boolean; type: "boolean"; enabled: boolean } | { code: string; name: string; unitName: string | null; allowed: boolean; type: "usage"; consumption: { model: "metered"; period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } } } | { model: "credits"; period: { start: string; end: string }; unitsUsed: number; creditsPerUnit: number; creditsConsumed: number; unlimited: boolean; availableUnits?: number } | { model: "balance"; period: { start: string; end: string }; unitsUsed: number; spent: { amount: number; currency: string }; unlimited: boolean; availableUnits?: number; unitPrice?: { amount: number; currency: string; scale: 10000 } } } | { code: string; name: string; unitName: string | null; allowed: boolean; type: "seats"; usage: { period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } } } } | { code: string; name: string; unitName: string | null; allowed: boolean; type: "quota"; usage: { period: { start: string; end: string }; unitsUsed: number; includedUnits: number; remainingUnits?: number; unlimited: boolean; overage: { enabled: boolean; units: number; unitPrice?: { amount: number; currency: string; scale: 10000 } }; billedUnits: number } }>`, required) — Current feature access, discriminated by type. Boolean features expose enabled; usage features expose model-specific consumption; seats and quota expose usage allowances.
672
673
  - `seats` (`Array<WebhookSeatSummary>`, required) — Summary of seats-type features: code, current, included, remaining, unlimited.
673
674
  - `credits` (`WebhookCreditsBalance | null`, required) — For credits plans: planCredits, purchasedCredits, totalCredits. Null otherwise.
674
675
  - `balance` (`WebhookBalance | null`, required) — For balance plans, in rate scale (10000 = 1.00 of the subscription currency): currentBalance (the available total), planBalance, purchasedBalance and totalBalance. Null otherwise.
@@ -817,7 +818,7 @@ Fired each time a subscription's available credits cross to zero or below. Usage
817
818
 
818
819
  ## credits.expired
819
820
 
820
- Fired at a reset when unused plan credits are discarded. On a plan whose unused plan credits expire, every unused plan credit expires at each reset. On a plan that rolls them over, a reset keeps them, up to the plan's maxPlanCredits when it has one, and only the excess expires. A change to another credits plan applies the new plan's terms the same way. Purchased credits never expire and are not affected.
821
+ Fired at a reset when unused plan credits are discarded. On a plan whose unused plan credits expire, every unused plan credit expires at each reset. On a plan that rolls them over, a reset keeps them, up to the plan's maxPlanCredits when it has one, and only the excess expires. A change to another credits plan applies the new plan's terms the same way, and an immediate change also discards the credits the previous plan gave for the period it cuts short. Purchased credits never expire and are not affected.
821
822
 
822
823
  ### Data
823
824