@commet/node 9.7.0 → 9.9.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 (64) hide show
  1. package/dist/index.d.mts +413 -52
  2. package/dist/index.d.ts +413 -52
  3. package/dist/index.js +39 -12
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +39 -12
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/ai-onboarding/mcp-server.md +1 -1
  8. package/docs/api-reference/customers.md +6 -2
  9. package/docs/api-reference/generated-webhooks.md +2 -2
  10. package/docs/api-reference/index.md +2 -2
  11. package/docs/api-reference/offers.md +2 -2
  12. package/docs/api-reference/plans.md +16 -3
  13. package/docs/api-reference/promo-codes.md +3 -1
  14. package/docs/api-reference/subscriptions.md +84 -9
  15. package/docs/api-reference/usage.md +0 -4
  16. package/docs/documentation/cli.md +60 -49
  17. package/docs/documentation/create-api-key.md +3 -1
  18. package/docs/documentation/customers/customer-portal.md +10 -2
  19. package/docs/documentation/customers/manage-customers.md +2 -1
  20. package/docs/documentation/finance/payouts.md +11 -0
  21. package/docs/documentation/finance/supported-countries.md +5 -5
  22. package/docs/documentation/invoicing/handle-failed-payments.md +9 -9
  23. package/docs/documentation/payments/accept-one-time-payments.md +1 -1
  24. package/docs/documentation/payments/payment-orchestration.md +2 -0
  25. package/docs/documentation/payments/payment-providers.md +46 -0
  26. package/docs/documentation/payments/transactions-refunds-and-retries.md +1 -1
  27. package/docs/documentation/plans/add-ons.md +1 -1
  28. package/docs/documentation/plans/consumption-models.md +44 -9
  29. package/docs/documentation/plans/credit-packs.md +49 -1
  30. package/docs/documentation/plans/one-time-payments.md +3 -3
  31. package/docs/documentation/plans/plan-groups.md +46 -10
  32. package/docs/documentation/platform/dashboard-metrics-and-events.md +40 -9
  33. package/docs/documentation/sales/connect-dub-affiliates.md +52 -0
  34. package/docs/documentation/sales/introductory-offers.md +7 -13
  35. package/docs/documentation/sales/offers.md +10 -6
  36. package/docs/documentation/sales/promo-codes.md +47 -17
  37. package/docs/documentation/sales/promotional-offers.md +6 -7
  38. package/docs/documentation/sales/regional-prices.md +16 -0
  39. package/docs/documentation/sales/trial-periods.md +67 -40
  40. package/docs/documentation/subscriptions/manage-subscriptions.md +65 -2
  41. package/docs/documentation/subscriptions/pay-in-advance.md +4 -7
  42. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +20 -2
  43. package/docs/documentation/testing-sandbox.md +2 -0
  44. package/docs/documentation/usage/track-usage.md +23 -0
  45. package/docs/errors/customer_deleted.md +22 -0
  46. package/docs/errors/index.md +5 -0
  47. package/docs/errors/managed_by_integration.md +22 -0
  48. package/docs/errors/no_scheduled_plan_change.md +22 -0
  49. package/docs/errors/plan_balance_limit_reached.md +22 -0
  50. package/docs/errors/plan_credit_limit_reached.md +22 -0
  51. package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +8 -8
  52. package/docs/knowledge-base/how-do-discounts-work.md +7 -5
  53. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +14 -8
  54. package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +1 -1
  55. package/docs/knowledge-base/how-do-trial-periods-work.md +30 -24
  56. package/docs/knowledge-base/how-does-billing-work.md +1 -0
  57. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +11 -9
  58. package/docs/manifest.json +54 -2
  59. package/docs/platform-documentation.md +1 -0
  60. package/docs/schemas.md +51 -9
  61. package/docs/webhooks/introduction.md +14 -12
  62. package/docs/webhooks.md +53 -17
  63. package/docs/webhooks.openapi.json +857 -745
  64. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -194,6 +194,11 @@ interface BalanceTopup {
194
194
  object: "balance_topup";
195
195
  livemode: boolean;
196
196
  }
197
+ interface BusinessTaxId {
198
+ country: string;
199
+ type: string;
200
+ value: string;
201
+ }
197
202
  interface ClaimLink {
198
203
  url: string;
199
204
  /** @format date-time */
@@ -254,6 +259,8 @@ interface CreatedSubscription {
254
259
  billingDayOfMonth: number | null;
255
260
  nextBillingDate: string | null;
256
261
  checkoutUrl: string | null;
262
+ /** Whether Commet can charge this subscription on its own at its next charge (the trial end or the renewal). A trial that started without a payment method reports false until the customer adds one for this subscription; a payment method saved for another subscription does not count. A subscription on a free plan reports false. */
263
+ hasPaymentMethod: boolean;
257
264
  /** @format date-time */
258
265
  createdAt: string;
259
266
  /** @format date-time */
@@ -331,6 +338,7 @@ interface Customer {
331
338
  email: string;
332
339
  taxDocument: string | null;
333
340
  documentType: string | null;
341
+ businessTaxId: BusinessTaxId | null;
334
342
  timezone: string | null;
335
343
  metadata: Record<string, unknown> | null;
336
344
  /** @format date-time */
@@ -761,6 +769,7 @@ interface InvoiceListItem {
761
769
  object: "invoice";
762
770
  livemode: boolean;
763
771
  }
772
+ type ManagedBy = "dub" | null;
764
773
  interface Market {
765
774
  id: string;
766
775
  name: string;
@@ -777,9 +786,6 @@ interface Offer {
777
786
  id: string;
778
787
  name: string;
779
788
  phases: Array<{
780
- type: "free_trial";
781
- durationDays: number;
782
- } | {
783
789
  type: "percentage";
784
790
  durationCycles: number | null;
785
791
  /** Unit the phase duration is counted in. Only a fixed-price phase may set it, because its amount is declared rather than derived from the plan. Defaults to the plan's own billing interval. */
@@ -811,6 +817,8 @@ interface Offer {
811
817
  startsAt: string | null;
812
818
  endsAt: string | null;
813
819
  active: boolean;
820
+ /** Integration that manages this record, or null when the merchant does. While an integration manages it, its terms change only in that integration and edits answer 409 managed_by_integration. */
821
+ managedBy: ManagedBy;
814
822
  /** @format date-time */
815
823
  createdAt: string;
816
824
  /** @format date-time */
@@ -899,7 +907,38 @@ interface Plan {
899
907
  isPublic: boolean;
900
908
  isDefault: boolean;
901
909
  isFree: boolean;
910
+ /** 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. */
902
911
  blockOnExhaustion: boolean | null;
912
+ /** 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. */
913
+ unusedPlanCredits: {
914
+ type: "expire";
915
+ } | {
916
+ type: "roll_over";
917
+ /** The most plan credits a subscription holds after a reset, including the credits that reset grants; credits above it expire. At least the included credits of every price. null means no limit other than the largest storable balance, 2,147,483,647 plan credits. */
918
+ maxPlanCredits: number | null;
919
+ } | null;
920
+ /** Credits plans only. The most plan credits a subscription spends per day or per week; null means no limit. */
921
+ planCreditLimit: {
922
+ /** The most plan credits a subscription spends in one window. */
923
+ credits: number;
924
+ /** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
925
+ interval: "day" | "week";
926
+ } | null;
927
+ /** 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. */
928
+ unusedPlanBalance: {
929
+ type: "expire";
930
+ } | {
931
+ type: "roll_over";
932
+ /** The most plan balance a subscription holds after a reset, in USD cents, including the balance that reset grants; balance above it expires. At least the included balance of every price. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. null means no limit other than the largest storable amount, 2,147,483,647 cents. */
933
+ maxPlanBalance: number | null;
934
+ } | null;
935
+ /** Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; null means no limit. */
936
+ planBalanceLimit: {
937
+ /** The most plan balance a subscription spends in one window, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. */
938
+ amount: number;
939
+ /** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
940
+ interval: "day" | "week";
941
+ } | null;
903
942
  sortOrder: number;
904
943
  planGroupId: string | null;
905
944
  metadata: Record<string, unknown> | null;
@@ -934,6 +973,8 @@ interface Plan {
934
973
  price: number;
935
974
  isDefault: boolean;
936
975
  trialDays: number;
976
+ /** Whether the price's free trial needs a payment method to start. When false, a new subscription starts trialing right away without checkout; without a payment method added by the trial end, the customer moves to the plan group's default plan, or the subscription is canceled when there is none. Null when the price has no trial. */
977
+ trialRequiresPaymentMethod: boolean | null;
937
978
  includedBalance: number | null;
938
979
  includedCredits: number | null;
939
980
  /** Automatic introductory offer for this price. Pass a Promotional Offer ID when creating a subscription to override it. */
@@ -1215,6 +1256,8 @@ interface PlanPrice {
1215
1256
  price: number;
1216
1257
  isDefault: boolean;
1217
1258
  trialDays: number;
1259
+ /** Whether the price's free trial needs a payment method to start. When false, a new subscription starts trialing right away without checkout; without a payment method added by the trial end, the customer moves to the plan group's default plan, or the subscription is canceled when there is none. Null when the price has no trial. */
1260
+ trialRequiresPaymentMethod: boolean | null;
1218
1261
  includedBalance: number | null;
1219
1262
  includedCredits: number | null;
1220
1263
  /** Automatic introductory offer for this price. */
@@ -1342,6 +1385,10 @@ interface PromoCode {
1342
1385
  expiresAt: string | null;
1343
1386
  isActive: boolean;
1344
1387
  redemptionCount: number;
1388
+ /** Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription. */
1389
+ firstPurchaseOnly: boolean;
1390
+ /** Integration that manages this record, or null when the merchant does. While an integration manages it, its terms change only in that integration and edits answer 409 managed_by_integration. */
1391
+ managedBy: ManagedBy;
1345
1392
  /** @format date-time */
1346
1393
  createdAt: string;
1347
1394
  /** @format date-time */
@@ -1520,6 +1567,8 @@ interface Subscription {
1520
1567
  billingDayOfMonth: number | null;
1521
1568
  nextBillingDate: string | null;
1522
1569
  checkoutUrl: string | null;
1570
+ /** Whether Commet can charge this subscription on its own at its next charge (the trial end or the renewal). A trial that started without a payment method reports false until the customer adds one for this subscription; a payment method saved for another subscription does not count. A subscription on a free plan reports false. */
1571
+ hasPaymentMethod: boolean;
1523
1572
  /** @format date-time */
1524
1573
  createdAt: string;
1525
1574
  /** @format date-time */
@@ -1609,14 +1658,27 @@ interface Subscription {
1609
1658
  } | null;
1610
1659
  }>;
1611
1660
  credits: {
1661
+ /** Plan credits left. Kept for compatibility; equal to `plan`. */
1612
1662
  remaining: number;
1613
1663
  included: number;
1664
+ /** Purchased credits: purchases and manual adjustments. Spent after plan credits and kept until the subscription ends. */
1614
1665
  purchased: number;
1666
+ /** Plan credits left this period. Spent first and replaced or rolled over at each reset; negative while overage is owed. */
1667
+ plan: number;
1668
+ /** Credits available: `plan` plus `purchased`. */
1669
+ total: number;
1615
1670
  } | null;
1616
1671
  balance: {
1672
+ /** Balance available in minor units of the subscription currency. Kept for compatibility; equal to `total`. */
1617
1673
  remaining: number;
1618
1674
  included: number;
1619
1675
  currency: string;
1676
+ /** Plan balance left this period, in minor units. Spent first and replaced or rolled over at each reset; negative while overage is owed. */
1677
+ plan: number;
1678
+ /** Purchased balance in minor units: top-ups and manual adjustments. Spent after the plan balance and kept until the subscription ends. */
1679
+ purchased: number;
1680
+ /** Balance available in minor units: `plan` plus `purchased`. */
1681
+ total: number;
1620
1682
  } | null;
1621
1683
  priceId: string | null;
1622
1684
  object: "subscription";
@@ -1629,6 +1691,32 @@ interface SubscriptionAddon {
1629
1691
  object: "subscription_addon";
1630
1692
  livemode: boolean;
1631
1693
  }
1694
+ interface SubscriptionAutoTopUp {
1695
+ /** Whether top-ups run automatically: credits bought on a credits plan, balance added on a balance plan. Always false when the plan does not sell credits or has balance top-ups turned off. */
1696
+ enabled: boolean;
1697
+ /** The available amount at or below which a top-up runs, or null when never configured: credits (plan plus purchased) on a credits plan, minor units of the subscription currency (plan plus purchased balance) on a balance plan. */
1698
+ threshold: number | null;
1699
+ /** Credits each top-up buys on a credits plan, or null when never configured or on a balance plan. */
1700
+ quantity: number | null;
1701
+ /** Minor units of the subscription currency each top-up adds on a balance plan, charged plus tax, or null when never configured or on a credits plan. */
1702
+ amount: number | null;
1703
+ /** Maximum top-ups per renewal period, or null when never configured. */
1704
+ maxPerPeriod: number | null;
1705
+ /** active tops up when the available amount reaches the threshold; paused stops after three consecutive failed top-ups, or after one whose charge could not be refunded, until the payment method changes, a credit purchase or balance top-up succeeds or it is saved enabled again; off tops up nothing. */
1706
+ status: "active" | "paused" | "off";
1707
+ /** Top-ups made in the current renewal period. */
1708
+ topUpsThisPeriod: number;
1709
+ /** When the top-up count of the period resets, or null before the subscription starts its first period. */
1710
+ periodResetsAt: string | null;
1711
+ /** The last top-up that failed, or null when none has failed. */
1712
+ lastFailure: {
1713
+ reason: "payment_declined" | "no_payment_method" | "quantity_below_minimum" | "amount_below_minimum" | "purchase_failed";
1714
+ /** @format date-time */
1715
+ at: string;
1716
+ } | null;
1717
+ object: "subscription_auto_top_up";
1718
+ livemode: boolean;
1719
+ }
1632
1720
  interface SubscriptionOfferApplication {
1633
1721
  id: string;
1634
1722
  name: string;
@@ -1731,6 +1819,8 @@ interface SubscriptionSummary {
1731
1819
  billingDayOfMonth: number | null;
1732
1820
  nextBillingDate: string | null;
1733
1821
  checkoutUrl: string | null;
1822
+ /** Whether Commet can charge this subscription on its own at its next charge (the trial end or the renewal). A trial that started without a payment method reports false until the customer adds one for this subscription; a payment method saved for another subscription does not count. A subscription on a free plan reports false. */
1823
+ hasPaymentMethod: boolean;
1734
1824
  /** @format date-time */
1735
1825
  createdAt: string;
1736
1826
  /** @format date-time */
@@ -1957,6 +2047,23 @@ type UsageCheck = {
1957
2047
  planCredits: number;
1958
2048
  purchasedCredits: number;
1959
2049
  totalCredits: number;
2050
+ planCreditLimit: {
2051
+ /** The most plan credits the subscription spends per window. */
2052
+ credits: number;
2053
+ /** The window length: 24 hours for `day`, 7 days for `week`. */
2054
+ interval: "day" | "week";
2055
+ /** Plan credits spent in the current window. */
2056
+ spent: number;
2057
+ /** Plan credits the subscription can still spend in the current window. Purchased credits are not limited. */
2058
+ remaining: number;
2059
+ /**
2060
+ * When the next window starts and spending resets.
2061
+ * @format date-time
2062
+ */
2063
+ resetsAt: string;
2064
+ } | null;
2065
+ /** Whether usage stops when plan and purchased credits run out. False only when the plan allows overage, which is billed at its price per credit; trials and free plans always stop. */
2066
+ blockOnExhaustion: boolean;
1960
2067
  object: "usage_check";
1961
2068
  livemode: boolean;
1962
2069
  } | {
@@ -1969,7 +2076,29 @@ type UsageCheck = {
1969
2076
  consumptionModel: "balance";
1970
2077
  unitPrice: number;
1971
2078
  estimatedAmount: number;
2079
+ /** The available balance, plan plus purchased, in rate scale (10000 = 1.00 of the subscription currency). Equal to totalBalance. */
1972
2080
  currentBalance: number;
2081
+ /** The plan part of the balance in rate scale. Consumed first, replaced or rolled over at each reset, and negative while overage is owed. */
2082
+ planBalance: number;
2083
+ /** The purchased part of the balance in rate scale: top-ups and adjustments. Consumed after the plan part and kept until the subscription ends. */
2084
+ purchasedBalance: number;
2085
+ /** planBalance plus purchasedBalance, in rate scale. */
2086
+ totalBalance: number;
2087
+ planBalanceLimit: {
2088
+ /** The most plan balance the subscription spends per window, in rate scale (10000 = 1.00 of the subscription currency). */
2089
+ amount: number;
2090
+ /** The window length: 24 hours for `day`, 7 days for `week`. */
2091
+ interval: "day" | "week";
2092
+ /** Plan balance spent in the current window, in rate scale. */
2093
+ spent: number;
2094
+ /** Plan balance the subscription can still spend in the current window, in rate scale. Purchased balance is not limited. */
2095
+ remaining: number;
2096
+ /**
2097
+ * When the next window starts and spending resets.
2098
+ * @format date-time
2099
+ */
2100
+ resetsAt: string;
2101
+ } | null;
1973
2102
  blockOnExhaustion: boolean;
1974
2103
  currency: string;
1975
2104
  object: "usage_check";
@@ -1994,6 +2123,38 @@ interface UsageEvent {
1994
2123
  deducted: number;
1995
2124
  remaining: number;
1996
2125
  blocked: boolean;
2126
+ /** Credits consumption only, omitted for balance. The plan credit limit after this event; null when the plan has no limit. */
2127
+ planCreditLimit?: {
2128
+ /** The most plan credits the subscription spends per window. */
2129
+ credits: number;
2130
+ /** The window length: 24 hours for `day`, 7 days for `week`. */
2131
+ interval: "day" | "week";
2132
+ /** Plan credits spent in the current window. */
2133
+ spent: number;
2134
+ /** Plan credits the subscription can still spend in the current window. Purchased credits are not limited. */
2135
+ remaining: number;
2136
+ /**
2137
+ * When the next window starts and spending resets.
2138
+ * @format date-time
2139
+ */
2140
+ resetsAt: string;
2141
+ } | null;
2142
+ /** Balance consumption on a plan with a plan balance limit: the limit after this event. Omitted for credits and for plans without a limit. */
2143
+ planBalanceLimit?: {
2144
+ /** The most plan balance the subscription spends per window, in rate scale (10000 = 1.00 of the subscription currency). */
2145
+ amount: number;
2146
+ /** The window length: 24 hours for `day`, 7 days for `week`. */
2147
+ interval: "day" | "week";
2148
+ /** Plan balance spent in the current window, in rate scale. */
2149
+ spent: number;
2150
+ /** Plan balance the subscription can still spend in the current window, in rate scale. Purchased balance is not limited. */
2151
+ remaining: number;
2152
+ /**
2153
+ * When the next window starts and spending resets.
2154
+ * @format date-time
2155
+ */
2156
+ resetsAt: string;
2157
+ } | null;
1997
2158
  };
1998
2159
  object: "usage_event";
1999
2160
  livemode: boolean;
@@ -2040,7 +2201,14 @@ interface WebhookAddonRef {
2040
2201
  name: string;
2041
2202
  }
2042
2203
  interface WebhookBalance {
2204
+ /** The available balance, plan plus purchased, in rate scale. Equal to totalBalance. */
2043
2205
  currentBalance: number;
2206
+ /** The plan part in rate scale: spent first, replaced or rolled over at each reset, negative while overage is owed. */
2207
+ planBalance: number;
2208
+ /** The purchased part in rate scale: top-ups and manual adjustments, spent after the plan part and kept until the subscription ends. */
2209
+ purchasedBalance: number;
2210
+ /** planBalance plus purchasedBalance, in rate scale. */
2211
+ totalBalance: number;
2044
2212
  }
2045
2213
  interface WebhookBankRef {
2046
2214
  bankName: string | null;
@@ -2366,6 +2534,8 @@ interface UpdateCustomerParams {
2366
2534
  email?: string;
2367
2535
  fullName?: string;
2368
2536
  taxDocument?: string;
2537
+ /** Business tax ID, such as an EU VAT number or a Peruvian RUC, for the country of the customer's address. Accepted only where Commet collects tax; a valid ID replaces consumer tax with the business treatment. Send null to remove it. */
2538
+ businessTaxId?: string | null;
2369
2539
  externalId?: string;
2370
2540
  timezone?: Timezone;
2371
2541
  metadata?: Record<string, unknown>;
@@ -2398,6 +2568,8 @@ interface BatchCreateCustomersParams {
2398
2568
  region?: string;
2399
2569
  };
2400
2570
  }>;
2571
+ /** Plan group whose starting plan the customer starts on when it has no open subscription: its signup trial, a trial without a payment method, when the group has one and the customer never had that plan, otherwise its default plan. A customer who already had the signup trial plan in a group without a default plan starts on none. Without it, no plan is assigned. */
2572
+ planGroupId?: string;
2401
2573
  }
2402
2574
  interface ListCustomersParams {
2403
2575
  cursor?: string;
@@ -2409,6 +2581,8 @@ interface CreateCustomerParams {
2409
2581
  externalId?: string;
2410
2582
  fullName?: string;
2411
2583
  taxDocument?: string;
2584
+ /** Business tax ID, such as an EU VAT number or a Peruvian RUC, for the country of the customer's address. Accepted only where Commet collects tax; a valid ID replaces consumer tax with the business treatment. */
2585
+ businessTaxId?: string;
2412
2586
  address?: {
2413
2587
  line1: string;
2414
2588
  line2?: string;
@@ -2422,6 +2596,8 @@ interface CreateCustomerParams {
2422
2596
  email: string;
2423
2597
  timezone?: Timezone;
2424
2598
  metadata?: Record<string, unknown>;
2599
+ /** Plan group whose starting plan the customer starts on when it has no open subscription: its signup trial, a trial without a payment method, when the group has one and the customer never had that plan, otherwise its default plan. A customer who already had the signup trial plan in a group without a default plan starts on none. Without it, no plan is assigned. */
2600
+ planGroupId?: string;
2425
2601
  }
2426
2602
  declare class CustomersResource {
2427
2603
  private httpClient;
@@ -2454,7 +2630,7 @@ declare class CustomersResource {
2454
2630
  get(params: GetCustomerParams, options?: RequestOptions): Promise<Customer>;
2455
2631
  /** Update a customer's name, external ID, or metadata. */
2456
2632
  update(params: UpdateCustomerParams, options?: RequestOptions): Promise<Customer>;
2457
- /** Create up to 100 customers in a single request. */
2633
+ /** Create up to 100 customers in a single request. With planGroupId, each customer without an open subscription starts on that group's starting plan (see planGroupId), and the entry of a deleted customer fails with customer_deleted. */
2458
2634
  createBatch(params: BatchCreateCustomersParams, options?: RequestOptions): Promise<CustomerBatch>;
2459
2635
  /** List customers with cursor-based pagination. */
2460
2636
  list(params?: ListCustomersParams, options?: RequestOptions): Promise<{
@@ -2463,7 +2639,7 @@ declare class CustomersResource {
2463
2639
  hasMore: boolean;
2464
2640
  nextCursor?: string;
2465
2641
  }>;
2466
- /** Create a new customer. Idempotent when customerId is provided. */
2642
+ /** Create a new customer. Idempotent when customerId is provided. With planGroupId, a customer without an open subscription starts on that group's starting plan (see planGroupId), and the externalId of a deleted customer is rejected. */
2467
2643
  create(params: CreateCustomerParams, options?: RequestOptions): Promise<Customer>;
2468
2644
  }
2469
2645
 
@@ -2619,9 +2795,6 @@ interface UpdateOfferParams {
2619
2795
  id: string;
2620
2796
  name: string;
2621
2797
  phases: Array<{
2622
- type: "free_trial";
2623
- durationDays: number;
2624
- } | {
2625
2798
  type: "percentage";
2626
2799
  durationCycles: number | null;
2627
2800
  /** Unit the phase duration is counted in. Only a fixed-price phase may set it, because its amount is declared rather than derived from the plan. Defaults to the plan's own billing interval. */
@@ -2665,9 +2838,6 @@ interface ListOffersParams {
2665
2838
  interface CreateOfferParams {
2666
2839
  name: string;
2667
2840
  phases: Array<{
2668
- type: "free_trial";
2669
- durationDays: number;
2670
- } | {
2671
2841
  type: "percentage";
2672
2842
  durationCycles: number | null;
2673
2843
  /** Unit the phase duration is counted in. Only a fixed-price phase may set it, because its amount is declared rather than derived from the plan. Defaults to the plan's own billing interval. */
@@ -2904,6 +3074,8 @@ interface UpdatePlanPriceParams {
2904
3074
  price?: number;
2905
3075
  isDefault?: boolean;
2906
3076
  trialDays?: number;
3077
+ /** Set to false so the price's free trial starts without a payment method. Requires trialDays on the price. */
3078
+ trialRequiresPaymentMethod?: boolean;
2907
3079
  includedBalance?: number | null;
2908
3080
  includedCredits?: number | null;
2909
3081
  /** Metadata keys to merge into the existing price metadata. */
@@ -2924,6 +3096,8 @@ type AddPlanPriceParams = {
2924
3096
  metadata?: Record<string, unknown>;
2925
3097
  price: number;
2926
3098
  trialDays?: number;
3099
+ /** Set to false so the price's free trial starts without a payment method. Requires trialDays on the price. */
3100
+ trialRequiresPaymentMethod?: boolean;
2927
3101
  isDefault?: boolean;
2928
3102
  includedBalance?: number | null;
2929
3103
  includedCredits?: number | null;
@@ -2972,6 +3146,40 @@ interface UpdatePlanParams {
2972
3146
  description?: string | null;
2973
3147
  metadata?: Record<string, unknown>;
2974
3148
  isPublic?: boolean;
3149
+ /** Credits plans only. What happens to unused plan credits at each reset. Existing subscriptions apply it from their next reset. */
3150
+ unusedPlanCredits?: {
3151
+ type: "expire";
3152
+ } | {
3153
+ type: "roll_over";
3154
+ /** The most plan credits a subscription holds after a reset, including the credits that reset grants; credits above it expire. At least the included credits of every price. null means no limit other than the largest storable balance, 2,147,483,647 plan credits. */
3155
+ maxPlanCredits: number | null;
3156
+ };
3157
+ /** Credits plans only. The most plan credits a subscription spends per day or per week; null removes the limit. Raising or removing it applies to existing subscriptions at once; lowering it, adding it or changing its interval applies from their next period. */
3158
+ planCreditLimit?: {
3159
+ /** The most plan credits a subscription spends in one window. */
3160
+ credits: number;
3161
+ /** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
3162
+ interval: "day" | "week";
3163
+ } | null;
3164
+ /** Balance plans only. What happens to unused plan balance at each reset. Existing subscriptions apply it from their next reset. */
3165
+ unusedPlanBalance?: {
3166
+ type: "expire";
3167
+ } | {
3168
+ type: "roll_over";
3169
+ /** The most plan balance a subscription holds after a reset, in USD cents, including the balance that reset grants; balance above it expires. At least the included balance of every price. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. null means no limit other than the largest storable amount, 2,147,483,647 cents. */
3170
+ maxPlanBalance: number | null;
3171
+ };
3172
+ /** Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; null removes the limit. Raising or removing it applies to existing subscriptions at once; lowering it, adding it or changing its interval applies from their next period. */
3173
+ planBalanceLimit?: {
3174
+ /** The most plan balance a subscription spends in one window, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. */
3175
+ amount: number;
3176
+ /** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
3177
+ interval: "day" | "week";
3178
+ } | null;
3179
+ /** Credits and balance plans only. false lets usage continue past the plan and purchased amounts and bills the missing amount as overage at the next renewal; a credits plan bills it at the price per credit and needs one. Trials and free plans always stop, so free plans accept only true. Existing subscriptions apply it from their next reset. */
3180
+ blockOnExhaustion?: boolean;
3181
+ /** Make this plan the default plan of its plan group: customers created with that planGroupId start on it, and a paid plan of the group that ends from the customer portal, a revoked payment authorization or exhausted dunning moves to it instead of canceling. Requires a free plan in a plan group; replaces the group's previous default plan. false unmarks it. */
3182
+ isDefault?: boolean;
2975
3183
  }
2976
3184
  interface DeletePlanParams {
2977
3185
  id: string;
@@ -2990,8 +3198,41 @@ interface CreatePlanParams {
2990
3198
  consumptionModel?: "metered" | "credits" | "balance";
2991
3199
  isPublic?: boolean;
2992
3200
  isFree?: boolean;
3201
+ /** Credits and balance plans. Omitted, credits plans and free plans stop usage when the plan and purchased amounts run out, and paid balance plans bill the missing balance as overage. A new credits plan always stops usage: it allows overage only with a price per credit, which is set after creation, and then `PATCH /v1/plans/{id}` turns overage on. */
2993
3202
  blockOnExhaustion?: boolean;
3203
+ /** Credits plans only. What happens to unused plan credits at each reset; omitted means they expire. */
3204
+ unusedPlanCredits?: {
3205
+ type: "expire";
3206
+ } | {
3207
+ type: "roll_over";
3208
+ /** The most plan credits a subscription holds after a reset, including the credits that reset grants; credits above it expire. At least the included credits of every price. null means no limit other than the largest storable balance, 2,147,483,647 plan credits. */
3209
+ maxPlanCredits: number | null;
3210
+ };
3211
+ /** Credits plans only. The most plan credits a subscription spends per day or per week; omitted or null means no limit. */
3212
+ planCreditLimit?: {
3213
+ /** The most plan credits a subscription spends in one window. */
3214
+ credits: number;
3215
+ /** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
3216
+ interval: "day" | "week";
3217
+ } | null;
3218
+ /** Balance plans only. What happens to unused plan balance at each reset; omitted means it expires. */
3219
+ unusedPlanBalance?: {
3220
+ type: "expire";
3221
+ } | {
3222
+ type: "roll_over";
3223
+ /** The most plan balance a subscription holds after a reset, in USD cents, including the balance that reset grants; balance above it expires. At least the included balance of every price. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. null means no limit other than the largest storable amount, 2,147,483,647 cents. */
3224
+ maxPlanBalance: number | null;
3225
+ };
3226
+ /** Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; omitted or null means no limit. */
3227
+ planBalanceLimit?: {
3228
+ /** The most plan balance a subscription spends in one window, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. */
3229
+ amount: number;
3230
+ /** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
3231
+ interval: "day" | "week";
3232
+ } | null;
2994
3233
  planGroupId?: string;
3234
+ /** Make this plan the default plan of its plan group: customers created with that planGroupId start on it, and a paid plan of the group that ends from the customer portal, a revoked payment authorization or exhausted dunning moves to it instead of canceling. Requires a free plan with a planGroupId; replaces the group's previous default plan. */
3235
+ isDefault?: boolean;
2995
3236
  metadata?: Record<string, unknown>;
2996
3237
  }
2997
3238
  declare class PlansResource {
@@ -3019,7 +3260,7 @@ declare class PlansResource {
3019
3260
  setRegionalPricing(params: SetPlanRegionalPricingParams, options?: RequestOptions): Promise<PlanRegionalPricingResult>;
3020
3261
  /** Get a plan with public price IDs and their automatic introductory offer IDs. */
3021
3262
  get(params: GetPlanParams, options?: RequestOptions): Promise<Plan>;
3022
- /** Update a plan's name, description, visibility, or metadata. */
3263
+ /** Update a plan's name, description, visibility, default status, metadata, overage behavior, what happens to its unused plan credits or plan balance, or its plan credit or plan balance limit. */
3023
3264
  update(params: UpdatePlanParams, options?: RequestOptions): Promise<Plan>;
3024
3265
  /** Soft-delete a plan. */
3025
3266
  delete(params: DeletePlanParams, options?: RequestOptions): Promise<DeletedObject>;
@@ -3032,7 +3273,7 @@ declare class PlansResource {
3032
3273
  hasMore: boolean;
3033
3274
  nextCursor?: string;
3034
3275
  }>;
3035
- /** Create a new plan with optional consumption model, visibility, and plan group assignment. */
3276
+ /** Create a new plan with optional consumption model, visibility, plan group assignment, overage behavior, and the rollover and spend limit of its plan credits or plan balance. */
3036
3277
  create(params: CreatePlanParams, options?: RequestOptions): Promise<Plan>;
3037
3278
  }
3038
3279
 
@@ -3060,6 +3301,8 @@ interface UpdatePromoCodeParams {
3060
3301
  expiresAt?: string | null;
3061
3302
  active?: boolean;
3062
3303
  planIds?: Array<string>;
3304
+ /** Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription. */
3305
+ firstPurchaseOnly?: boolean;
3063
3306
  }
3064
3307
  interface ListPromoCodesParams {
3065
3308
  cursor?: string;
@@ -3073,6 +3316,8 @@ interface CreatePromoCodeParams {
3073
3316
  /** @format date-time */
3074
3317
  expiresAt?: string;
3075
3318
  planIds?: Array<string>;
3319
+ /** Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription. Defaults to false. */
3320
+ firstPurchaseOnly?: boolean;
3076
3321
  }
3077
3322
  declare class PromoCodesResource {
3078
3323
  private httpClient;
@@ -3088,7 +3333,7 @@ declare class PromoCodesResource {
3088
3333
  hasMore: boolean;
3089
3334
  nextCursor?: string;
3090
3335
  }>;
3091
- /** Create a distribution code for an existing Offer with one or more sequential discount phases and an optional leading trial. The code owns redemption restrictions. */
3336
+ /** Create a distribution code for an existing Offer with one or more sequential discount phases. The code owns redemption restrictions. */
3092
3337
  create(params: CreatePromoCodeParams, options?: RequestOptions): Promise<PromoCode>;
3093
3338
  }
3094
3339
 
@@ -3209,6 +3454,19 @@ interface ActivateAddonParams {
3209
3454
  id: string;
3210
3455
  addonId: string;
3211
3456
  }
3457
+ interface GetSubscriptionAutoTopUpParams {
3458
+ id: string;
3459
+ }
3460
+ interface UpdateSubscriptionAutoTopUpParams {
3461
+ id: string;
3462
+ enabled?: boolean;
3463
+ threshold?: number;
3464
+ /** Credits each top-up buys. Credits plans only. */
3465
+ quantity?: number;
3466
+ /** Minor units of the subscription currency each top-up adds. Balance plans only. */
3467
+ amount?: number;
3468
+ maxPerPeriod?: number;
3469
+ }
3212
3470
  interface AdjustBalanceParams {
3213
3471
  id: string;
3214
3472
  amount: number;
@@ -3217,6 +3475,7 @@ interface AdjustBalanceParams {
3217
3475
  }
3218
3476
  interface TopupBalanceParams {
3219
3477
  id: string;
3478
+ /** The amount to add, in minor units of the subscription currency (cents; whole units for zero-decimal currencies). */
3220
3479
  amount: number;
3221
3480
  }
3222
3481
  interface CancelSubscriptionParams {
@@ -3224,17 +3483,30 @@ interface CancelSubscriptionParams {
3224
3483
  reason?: string;
3225
3484
  immediate?: boolean;
3226
3485
  }
3227
- interface ChangePlanParams {
3486
+ type ChangePlanParams = {
3228
3487
  id: string;
3229
3488
  newPlanId?: string;
3230
3489
  newBillingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
3231
3490
  successUrl?: string;
3232
3491
  offerId?: string;
3233
- }
3234
- interface PurchaseCreditsParams {
3492
+ promoCode?: never;
3493
+ } | {
3494
+ id: string;
3495
+ newPlanId?: string;
3496
+ newBillingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
3497
+ successUrl?: string;
3498
+ offerId?: never;
3499
+ /** Promo code whose Offer prices the change, validated with the checkout's rules: a code the checkout would refuse returns 400 validation_error with the checkout's reason in details.reason. Cannot be combined with offerId. */
3500
+ promoCode: string;
3501
+ };
3502
+ type PurchaseCreditsParams = {
3235
3503
  id: string;
3236
3504
  creditPackId: string;
3237
- }
3505
+ quantity?: never;
3506
+ } | {
3507
+ id: string;
3508
+ quantity: number;
3509
+ };
3238
3510
  interface ApplySubscriptionOfferParams {
3239
3511
  id: string;
3240
3512
  offerId: string;
@@ -3268,12 +3540,20 @@ interface CreatePrepaidPeriodsCheckoutParams {
3268
3540
  offerId?: string;
3269
3541
  successUrl?: string;
3270
3542
  }
3271
- interface PreviewChangePlanParams {
3543
+ type PreviewChangePlanParams = {
3272
3544
  id: string;
3273
3545
  planId: string;
3274
3546
  billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
3275
3547
  offerId?: string;
3276
- }
3548
+ promoCode?: never;
3549
+ } | {
3550
+ id: string;
3551
+ planId: string;
3552
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
3553
+ offerId?: never;
3554
+ /** Promo code whose Offer prices the change, validated with the checkout's rules: a code the checkout would refuse returns 400 validation_error with the checkout's reason in details.reason. Cannot be combined with offerId. */
3555
+ promoCode: string;
3556
+ };
3277
3557
  interface ReactivateSubscriptionParams {
3278
3558
  id: string;
3279
3559
  offerId?: string;
@@ -3287,6 +3567,9 @@ interface ResumeSubscriptionParams {
3287
3567
  interface GetSubscriptionParams {
3288
3568
  id: string;
3289
3569
  }
3570
+ interface RevokeScheduledPlanChangeParams {
3571
+ id: string;
3572
+ }
3290
3573
  interface UncancelSubscriptionParams {
3291
3574
  id: string;
3292
3575
  }
@@ -3305,6 +3588,8 @@ type CreateSubscriptionParams = {
3305
3588
  initialSeats?: Record<string, number>;
3306
3589
  /** Payment provider name or exact public payment connection ID for the initial checkout. Overrides country routing when present. */
3307
3590
  provider?: "stripe" | "commet" | "dlocal" | string;
3591
+ /** Payment methods the initial checkout may offer. Restricts what the checkout already offers for the buyer's country, currency and payment connection; it never enables a method the connection does not have and never changes routing. When none of them is available to the buyer, the checkout shows that it cannot accept payments. */
3592
+ paymentMethodTypes?: Array<"card" | "oxxo" | "mercado_pago" | "google_pay" | "smartpix">;
3308
3593
  name?: string;
3309
3594
  /** @format date-time */
3310
3595
  startDate?: string;
@@ -3315,6 +3600,7 @@ type CreateSubscriptionParams = {
3315
3600
  cancelAtPeriodEnd?: boolean;
3316
3601
  offerId?: never;
3317
3602
  promoCode?: string;
3603
+ /** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
3318
3604
  customTrialDays?: number;
3319
3605
  skipTrial?: boolean;
3320
3606
  planId: string;
@@ -3326,6 +3612,8 @@ type CreateSubscriptionParams = {
3326
3612
  initialSeats?: Record<string, number>;
3327
3613
  /** Payment provider name or exact public payment connection ID for the initial checkout. Overrides country routing when present. */
3328
3614
  provider?: "stripe" | "commet" | "dlocal" | string;
3615
+ /** Payment methods the initial checkout may offer. Restricts what the checkout already offers for the buyer's country, currency and payment connection; it never enables a method the connection does not have and never changes routing. When none of them is available to the buyer, the checkout shows that it cannot accept payments. */
3616
+ paymentMethodTypes?: Array<"card" | "oxxo" | "mercado_pago" | "google_pay" | "smartpix">;
3329
3617
  name?: string;
3330
3618
  /** @format date-time */
3331
3619
  startDate?: string;
@@ -3336,6 +3624,7 @@ type CreateSubscriptionParams = {
3336
3624
  cancelAtPeriodEnd?: boolean;
3337
3625
  offerId?: never;
3338
3626
  promoCode?: string;
3627
+ /** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
3339
3628
  customTrialDays?: number;
3340
3629
  skipTrial?: boolean;
3341
3630
  planCode: string;
@@ -3347,6 +3636,8 @@ type CreateSubscriptionParams = {
3347
3636
  initialSeats?: Record<string, number>;
3348
3637
  /** Payment provider name or exact public payment connection ID for the initial checkout. Overrides country routing when present. */
3349
3638
  provider?: "stripe" | "commet" | "dlocal" | string;
3639
+ /** Payment methods the initial checkout may offer. Restricts what the checkout already offers for the buyer's country, currency and payment connection; it never enables a method the connection does not have and never changes routing. When none of them is available to the buyer, the checkout shows that it cannot accept payments. */
3640
+ paymentMethodTypes?: Array<"card" | "oxxo" | "mercado_pago" | "google_pay" | "smartpix">;
3350
3641
  name?: string;
3351
3642
  /** @format date-time */
3352
3643
  startDate?: string;
@@ -3357,8 +3648,9 @@ type CreateSubscriptionParams = {
3357
3648
  cancelAtPeriodEnd?: boolean;
3358
3649
  offerId: string;
3359
3650
  promoCode?: never;
3360
- customTrialDays?: never;
3361
- skipTrial?: false;
3651
+ /** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
3652
+ customTrialDays?: number;
3653
+ skipTrial?: boolean;
3362
3654
  planId: string;
3363
3655
  } | {
3364
3656
  customerId: string;
@@ -3368,6 +3660,8 @@ type CreateSubscriptionParams = {
3368
3660
  initialSeats?: Record<string, number>;
3369
3661
  /** Payment provider name or exact public payment connection ID for the initial checkout. Overrides country routing when present. */
3370
3662
  provider?: "stripe" | "commet" | "dlocal" | string;
3663
+ /** Payment methods the initial checkout may offer. Restricts what the checkout already offers for the buyer's country, currency and payment connection; it never enables a method the connection does not have and never changes routing. When none of them is available to the buyer, the checkout shows that it cannot accept payments. */
3664
+ paymentMethodTypes?: Array<"card" | "oxxo" | "mercado_pago" | "google_pay" | "smartpix">;
3371
3665
  name?: string;
3372
3666
  /** @format date-time */
3373
3667
  startDate?: string;
@@ -3378,8 +3672,9 @@ type CreateSubscriptionParams = {
3378
3672
  cancelAtPeriodEnd?: boolean;
3379
3673
  offerId: string;
3380
3674
  promoCode?: never;
3381
- customTrialDays?: never;
3382
- skipTrial?: false;
3675
+ /** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
3676
+ customTrialDays?: number;
3677
+ skipTrial?: boolean;
3383
3678
  planCode: string;
3384
3679
  } | {
3385
3680
  customerId: string;
@@ -3389,6 +3684,8 @@ type CreateSubscriptionParams = {
3389
3684
  initialSeats?: Record<string, number>;
3390
3685
  /** Payment provider name or exact public payment connection ID for the initial checkout. Overrides country routing when present. */
3391
3686
  provider?: "stripe" | "commet" | "dlocal" | string;
3687
+ /** Payment methods the initial checkout may offer. Restricts what the checkout already offers for the buyer's country, currency and payment connection; it never enables a method the connection does not have and never changes routing. When none of them is available to the buyer, the checkout shows that it cannot accept payments. */
3688
+ paymentMethodTypes?: Array<"card" | "oxxo" | "mercado_pago" | "google_pay" | "smartpix">;
3392
3689
  name?: string;
3393
3690
  /** @format date-time */
3394
3691
  startDate?: string;
@@ -3412,6 +3709,8 @@ type CreateSubscriptionParams = {
3412
3709
  initialSeats?: Record<string, number>;
3413
3710
  /** Payment provider name or exact public payment connection ID for the initial checkout. Overrides country routing when present. */
3414
3711
  provider?: "stripe" | "commet" | "dlocal" | string;
3712
+ /** Payment methods the initial checkout may offer. Restricts what the checkout already offers for the buyer's country, currency and payment connection; it never enables a method the connection does not have and never changes routing. When none of them is available to the buyer, the checkout shows that it cannot accept payments. */
3713
+ paymentMethodTypes?: Array<"card" | "oxxo" | "mercado_pago" | "google_pay" | "smartpix">;
3415
3714
  name?: string;
3416
3715
  /** @format date-time */
3417
3716
  startDate?: string;
@@ -3435,17 +3734,21 @@ declare class SubscriptionsResource {
3435
3734
  deactivateAddon(params: DeactivateAddonParams, options?: RequestOptions): Promise<DeletedSubscriptionAddon>;
3436
3735
  /** Activate an add-on on a subscription. Charges a prorated amount for the current billing period. */
3437
3736
  activateAddon(params: ActivateAddonParams, options?: RequestOptions): Promise<SubscriptionAddon>;
3737
+ /** Read whether the subscription tops up automatically with its saved payment method when its available credits or balance reach a threshold, with the top-ups used this period and the last failure. */
3738
+ getAutoTopUp(params: GetSubscriptionAutoTopUpParams, options?: RequestOptions): Promise<SubscriptionAutoTopUp>;
3739
+ /** Turn automatic top-ups on or off and set the threshold, the size of each top-up and the maximum top-ups per period. Send only the fields that change. On a credits plan each top-up buys `quantity` credits; on a balance plan it adds `amount` in minor units of the subscription currency, plus tax, and `threshold` is in the same minor units. Enabling requires a plan that sells credits or has balance top-ups on. The size must be at least the plan's minimum when auto top-up is enabled or when the size changes, so turning it off keeps working after the minimum rises. Saving it enabled resumes a paused auto top-up. */
3740
+ updateAutoTopUp(params: UpdateSubscriptionAutoTopUpParams, options?: RequestOptions): Promise<SubscriptionAutoTopUp>;
3438
3741
  /** Adjust a subscription's balance or credits by a signed amount. Positive adds, negative subtracts. */
3439
3742
  adjustBalance(params: AdjustBalanceParams, options?: RequestOptions): Promise<BalanceAdjustment>;
3440
- /** Top up a subscription's balance. Charges the customer's payment method for the specified amount. */
3743
+ /** Top up a balance subscription. Charges the customer's payment method for the amount plus tax, adds it to the subscription's purchased balance (after paying back any overage owed on the plan balance), creates its invoice and emits `balance.topped_up`. Purchased balance is spent after the plan balance and is kept until the subscription ends. Rejected with 400 when the subscription is not on a balance plan, its plan has top-ups turned off, or the amount is below the effective minimum: the plan's minimum top-up in the subscription currency, raised to the currency's minimum charge. */
3441
3744
  topupBalance(params: TopupBalanceParams, options?: RequestOptions): Promise<BalanceTopup>;
3442
3745
  /** Cancel immediately or at period end and return the updated subscription. */
3443
3746
  cancel(params: CancelSubscriptionParams, options?: RequestOptions): Promise<Subscription>;
3444
- /** Upgrade or change billing interval immediately, optionally applying an Offer. Scheduled changes do not accept offers. */
3747
+ /** Upgrade or change billing interval immediately, optionally applying an Offer by offerId or the Offer of a promoCode. Scheduled changes accept neither offerId nor promoCode. From a free plan, a promoCode opens the checkout with the code applied and counts its use when the checkout is paid; without offerId or promoCode, a destination price whose free trial requires no payment method starts that trial right away without checkout. During a trial without a payment method, an immediate change returns 409 no_payment_method; scheduled changes still apply. */
3445
3748
  changePlan(params: ChangePlanParams, options?: RequestOptions): Promise<PlanChange>;
3446
- /** Purchase a credit pack for a subscription. Charges the customer and adds credits to their balance. */
3749
+ /** Purchase a fixed credit pack or choose a whole credit quantity at the subscription plan price and minimum. Charges the saved payment method and adds purchased credits. */
3447
3750
  purchaseCredits(params: PurchaseCreditsParams, options?: RequestOptions): Promise<CreditGrant>;
3448
- /** Apply a direct Offer to a subscription. On a pending payment checkout it quotes or replaces the checkout discount and the existing checkout URL remains unchanged. On an active subscription it applies the Offer immediately with its discount phases starting at the next billing cycle; the call is rejected while another applied Offer still has active or upcoming discount phases. Offers with a free trial phase cannot be applied after checkout creation. */
3751
+ /** Apply a direct Offer to a subscription. On a pending checkout it quotes or replaces the checkout discount, which starts after the plan price trial when there is one, and the existing checkout URL remains unchanged. On an active subscription it applies the Offer immediately with its discount phases starting at the next billing cycle; the call is rejected while another applied Offer still has active or upcoming discount phases. */
3449
3752
  applyOffer(params: ApplySubscriptionOfferParams, options?: RequestOptions): Promise<Subscription>;
3450
3753
  /** Remove the quoted direct Offer from a subscription's pending payment checkout. The existing checkout URL remains unchanged and returns to its undiscounted price. */
3451
3754
  removeOffer(params: RemoveSubscriptionOfferParams, options?: RequestOptions): Promise<Subscription>;
@@ -3459,7 +3762,7 @@ declare class SubscriptionsResource {
3459
3762
  updatePaymentMethod(params: UpdatePaymentMethodParams, options?: RequestOptions): Promise<PaymentMethodUpdateCheckout>;
3460
3763
  /** Creates a hosted checkout to pay billing periods of a recurring subscription in advance with any payment method. On an active subscription the paid periods start after the last paid period and replace any open prepaid-periods checkout. On a pending-payment subscription the first payment covers the requested periods and replaces its pending checkout. The billing interval does not change. */
3461
3764
  createPrepaidPeriodsCheckout(params: CreatePrepaidPeriodsCheckoutParams, options?: RequestOptions): Promise<PrepaidPeriodsCheckout>;
3462
- /** Preview proration details for an immediate plan change without applying it. Free-to-paid changes are never scheduled and the change-plan endpoint always returns hosted checkout for them. For paid plans, interval direction takes precedence: a longer interval is immediate and a shorter interval is scheduled. When the interval is unchanged, a higher-sort-order plan is immediate and a lower-sort-order plan is scheduled. A paid-to-free change is always scheduled. Returns credit, charge, and net amount. The target plan must belong to the same plan group as the current plan, otherwise a 400 with code `plans_not_in_same_group` is returned. A change between two free plans has nothing to prorate and returns a zero-amount estimate. Scheduled changes return a 400 with code `plan_change_scheduled`; apply those via the change-plan endpoint. Pass offerId to quote the destination plan with an Offer. */
3765
+ /** Preview proration details for an immediate plan change without applying it. Free-to-paid changes are never scheduled and the change-plan endpoint returns hosted checkout for them, except a change without offerId or promoCode to a price whose free trial needs no payment method, for a customer who never had that plan: it starts the trial at once, so the preview reports nothing due today. For paid plans, interval direction takes precedence: a longer interval is immediate and a shorter interval is scheduled. When the interval is unchanged, a higher-sort-order plan is immediate and a lower-sort-order plan is scheduled. A paid-to-free change is always scheduled. Returns credit, charge, and net amount. The target plan must belong to the same plan group as the current plan, otherwise a 400 with code `plans_not_in_same_group` is returned. A change between two free plans has nothing to prorate and returns a zero-amount estimate. Scheduled changes return a 400 with code `plan_change_scheduled`; apply those via the change-plan endpoint. Pass offerId to quote the destination plan with an Offer, or promoCode to quote it with the Offer of a promo code validated with the checkout's rules. */
3463
3766
  previewChange(params: PreviewChangePlanParams, options?: RequestOptions): Promise<PreviewChange>;
3464
3767
  /** Reactivates a subscription. A past_due subscription retries its outstanding renewal charge (recovering to active on success). A canceled subscription generates a fresh invoice, charges the saved card, and resets the billing period. On a successful charge the subscription becomes active; a declined charge returns an error with a recoveryUrl in the error details that can be sent to the customer to update their card. A canceled subscription may apply an Offer by offerId; past-due recovery cannot. */
3465
3768
  reactivate(params: ReactivateSubscriptionParams, options?: RequestOptions): Promise<ReactivatedSubscription>;
@@ -3469,6 +3772,8 @@ declare class SubscriptionsResource {
3469
3772
  resume(params: ResumeSubscriptionParams, options?: RequestOptions): Promise<SubscriptionResume>;
3470
3773
  /** Get a subscription by its public ID, regardless of status (including pending_payment and past_due). */
3471
3774
  get(params: GetSubscriptionParams, options?: RequestOptions): Promise<Subscription>;
3775
+ /** Revoke the plan or interval change scheduled for the end of the period, so the subscription stays on its current plan. Returns the updated subscription. */
3776
+ revokeScheduledPlanChange(params: RevokeScheduledPlanChangeParams, options?: RequestOptions): Promise<Subscription>;
3472
3777
  /** Revert a scheduled cancellation and return the updated subscription. Only works before cancellation takes effect. */
3473
3778
  uncancel(params: UncancelSubscriptionParams, options?: RequestOptions): Promise<Subscription>;
3474
3779
  /** Get the active subscription for a customer. Returns null if none. */
@@ -3480,7 +3785,7 @@ declare class SubscriptionsResource {
3480
3785
  hasMore: boolean;
3481
3786
  nextCursor?: string;
3482
3787
  }>;
3483
- /** Create a subscription for a customer. Commet selects the default price when priceId is omitted. The subscription starts at the base USD price; market and currency are resolved from the buyer's request country when the checkout opens. Without an offer override, Commet applies the price's automatic introductory Offer. Pass offerId to apply an active compatible Offer directly, or cardPromotionId to preselect a card-eligible Promotional Offer for the initial checkout when card promotions are enabled for the organization. For the initial checkout, provider accepts either a processor name or an exact payment connection ID. */
3788
+ /** Create a subscription for a customer. Commet selects the default price when priceId is omitted. The subscription starts at the base USD price; market and currency are resolved from the buyer's request country when the checkout opens. Without an offer override, Commet applies the price's automatic introductory Offer. Pass offerId to apply an active compatible Offer directly, or cardPromotionId to preselect a card-eligible Promotional Offer for the initial checkout when card promotions are enabled for the organization. For the initial checkout, provider accepts either a processor name or an exact payment connection ID. When the price's free trial requires no payment method, the subscription starts trialing right away with no checkout (checkoutUrl null, hasPaymentMethod false); it cannot be combined with offerId, promoCode, cardPromotionId or provider, and an organization that cannot charge yet receives 403. */
3484
3789
  create(params: CreateSubscriptionParams, options?: RequestOptions): Promise<CreatedSubscription>;
3485
3790
  }
3486
3791
 
@@ -3618,8 +3923,8 @@ declare class GeneratedResources {
3618
3923
  protected initResources(http: CommetHTTPClient): void;
3619
3924
  }
3620
3925
 
3621
- type WebhookEvent = "subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.topped_up" | "balance.low" | "balance.depleted" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed";
3622
- /** Fired when a subscription record is created with status pending_payment. The first charge has not been confirmed yet — do NOT grant access here. Wait for subscription.activated. */
3926
+ type WebhookEvent = "subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed";
3927
+ /** Fired when a subscription record is created, usually with status pending_payment: the first charge has not been confirmed yet — do NOT grant access here; wait for subscription.activated. A trial whose price requires no payment method is created already trialing, together with trial.started. */
3623
3928
  interface SubscriptionCreatedData {
3624
3929
  /** The subscription ID. */
3625
3930
  subscriptionId: string;
@@ -3791,7 +4096,7 @@ interface SubscriptionCanceledData {
3791
4096
  status: string;
3792
4097
  /** ISO 8601 datetime when the cancellation was requested or triggered. */
3793
4098
  canceledAt?: string;
3794
- /** The reason for cancellation, if provided. Set to "dunning_exhausted" when all payment retries fail. Historical refund-triggered cancellations may have "refund". */
4099
+ /** The reason for cancellation, if provided. Set to "dunning_exhausted" when all payment retries fail, and to "trial_ended_without_payment_method" when a trial without a payment method ends with no card and no default plan. Historical refund-triggered cancellations may have "refund". */
3795
4100
  cancelReason: string | null;
3796
4101
  /** ISO 8601 datetime when the subscription ended. Matches the billing period end for scheduled cancellations; for immediate terminations it is the moment of termination. */
3797
4102
  endDate?: string;
@@ -3875,7 +4180,7 @@ interface SubscriptionPlanChangeScheduledData {
3875
4180
  /** ISO 8601 datetime when the change executes (the billing period end). */
3876
4181
  effectiveAt: string;
3877
4182
  }
3878
- /** Fired when a scheduled plan change is replaced by a different one before it executes. The replacement also fires subscription.plan_change_scheduled with the new target plan. */
4183
+ /** Fired when a scheduled plan change will no longer take effect: it was revoked through the API, the dashboard or the customer portal, an immediate plan change or an immediate cancellation voided it, or a different change replaced it. A replacement also fires subscription.plan_change_scheduled with the new target plan. */
3879
4184
  interface SubscriptionPlanChangeRevokedData {
3880
4185
  /** The subscription ID. */
3881
4186
  subscriptionId: string;
@@ -3905,7 +4210,7 @@ interface SubscriptionPastDueData {
3905
4210
  /** The human-readable invoice number. */
3906
4211
  invoiceNumber: string;
3907
4212
  }
3908
- /** Fired when a subscription enters its trial period after checkout. Grant access here — trialing subscriptions have full access until trialEndsAt. */
4213
+ /** Fired when a subscription enters its trial period: after checkout, or right away when the price's trial requires no payment method. Grant access here — trialing subscriptions have full access until trialEndsAt. */
3909
4214
  interface TrialStartedData {
3910
4215
  /** The subscription ID. */
3911
4216
  subscriptionId: string;
@@ -3933,7 +4238,7 @@ interface TrialConvertedData {
3933
4238
  /** The plan name. */
3934
4239
  planName: string;
3935
4240
  }
3936
- /** Fired when a trial period runs out and the billing cycle activates the subscription. The first regular invoice is generated right after — this is the natural trial-to-paid transition. */
4241
+ /** Fired when a trial period runs out. With a payment method the billing cycle activates the subscription and generates the first regular invoice right after — the natural trial-to-paid transition. A trial without a payment method instead moves to the plan group's default plan (subscription.plan_changed) or is canceled with cancelReason trial_ended_without_payment_method (subscription.canceled), without an invoice. */
3937
4242
  interface TrialExpiredData {
3938
4243
  /** The subscription ID. */
3939
4244
  subscriptionId: string;
@@ -3963,7 +4268,7 @@ interface TrialWillEndData {
3963
4268
  /** ISO 8601 datetime when the trial will end. */
3964
4269
  trialEndsAt: string;
3965
4270
  }
3966
- /** Fired when a trial checkout link is ready to share with the customer. Completing this checkout saves a payment method and starts the trial (trial.started) — the customer is not charged until the trial ends. */
4271
+ /** Fired when a trial checkout link is ready to share with the customer. Completing this checkout saves a payment method and starts the trial (trial.started) — the customer is not charged until the trial ends. Not fired for a trial whose price requires no payment method, which starts without checkout. */
3967
4272
  interface TrialCheckoutReadyData {
3968
4273
  /** The subscription ID. */
3969
4274
  subscriptionId: string;
@@ -4410,6 +4715,17 @@ interface PaymentMethodUpdatedData {
4410
4715
  /** 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. */
4411
4716
  card: WebhookCardInfo | null;
4412
4717
  }
4718
+ /** Fired when a saved payment method is removed from a customer: the customer unlinked it at the payment provider (for example, revoking a Mercado Pago authorization), or removed it through the customer portal. Removing a method never changes the customer's subscriptions; a renewal that finds no usable method follows the usual failed-payment recovery. */
4719
+ interface PaymentMethodDetachedData {
4720
+ /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
4721
+ customerId: string;
4722
+ /** The payment method: card, oxxo, or mercado_pago. Null when unknown. */
4723
+ paymentMethod: PaymentMethod | null;
4724
+ /** 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. */
4725
+ card: WebhookCardInfo | null;
4726
+ /** 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. */
4727
+ reason: "unlinked_at_provider" | "removed_by_customer";
4728
+ }
4413
4729
  /** Fired when a customer is created, via the API (including batch create), SDK, or dashboard. The payload is the customer resource exactly as GET /customers returns it. */
4414
4730
  interface CustomerCreatedData {
4415
4731
  /** The Commet customer ID (cus_...). */
@@ -4424,6 +4740,15 @@ interface CustomerCreatedData {
4424
4740
  taxDocument: string | null;
4425
4741
  /** The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided. */
4426
4742
  documentType: string | null;
4743
+ /** The business tax ID saved for the customer (EU VAT number, Peruvian RUC), or null when the customer has none. */
4744
+ businessTaxId: {
4745
+ /** ISO-2 country the tax ID belongs to. */
4746
+ country: string;
4747
+ /** Tax ID type (e.g. eu_vat, pe_ruc). */
4748
+ type: string;
4749
+ /** The normalized tax ID. */
4750
+ value: string;
4751
+ } | null;
4427
4752
  /** The customer's timezone. */
4428
4753
  timezone: string | null;
4429
4754
  /** Custom key-value metadata you attached to the customer. */
@@ -4447,6 +4772,15 @@ interface CustomerUpdatedData {
4447
4772
  taxDocument: string | null;
4448
4773
  /** The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided. */
4449
4774
  documentType: string | null;
4775
+ /** The business tax ID saved for the customer (EU VAT number, Peruvian RUC), or null when the customer has none. */
4776
+ businessTaxId: {
4777
+ /** ISO-2 country the tax ID belongs to. */
4778
+ country: string;
4779
+ /** Tax ID type (e.g. eu_vat, pe_ruc). */
4780
+ type: string;
4781
+ /** The normalized tax ID. */
4782
+ value: string;
4783
+ } | null;
4450
4784
  /** The customer's timezone. */
4451
4785
  timezone: string | null;
4452
4786
  /** Custom key-value metadata you attached to the customer. */
@@ -4698,7 +5032,7 @@ interface CustomerStateChangedData {
4698
5032
  seats: Array<WebhookSeatSummary>;
4699
5033
  /** For credits plans: planCredits, purchasedCredits, totalCredits. Null otherwise. */
4700
5034
  credits: WebhookCreditsBalance | null;
4701
- /** For balance plans: currentBalance in rate scale (10000 = $1.00). Null otherwise. */
5035
+ /** For balance plans, in rate scale (10000 = 1.00 of the subscription currency): currentBalance (the available total), planBalance, purchasedBalance and totalBalance. Null otherwise. */
4702
5036
  balance: WebhookBalance | null;
4703
5037
  }
4704
5038
  /** Fired after a plan grant is durably created. The payload is the grant snapshot at creation. */
@@ -4885,7 +5219,7 @@ interface PlanGrantRevokedData {
4885
5219
  /** The grant timeline through the represented transition. */
4886
5220
  events: Array<WebhookPlanGrantTimelineEvent>;
4887
5221
  }
4888
- /** Fired when non-purchase credits are granted to a subscription: plan-included credits at the start of each billing period, or a manual adjustment from the dashboard. Credit pack purchases fire credits.purchased instead. */
5222
+ /** Fired when non-purchase credits are granted to a subscription: plan-included credits at the start of each billing period, or a manual adjustment from the dashboard. Credit purchases through the API, automatic top-ups, or the customer portal fire credits.purchased instead. */
4889
5223
  interface CreditsGrantedData {
4890
5224
  /** The subscription ID. */
4891
5225
  subscriptionId: string;
@@ -4896,7 +5230,7 @@ interface CreditsGrantedData {
4896
5230
  /** Why the credits were granted: period_reset or manual_adjustment. */
4897
5231
  reason: string;
4898
5232
  }
4899
- /** Fired when a customer buys a credit pack through the customer portal and the payment succeeds. Purchased credits never expire — unlike plan credits, they survive period resets. Plan-included credit grants fire credits.granted instead. */
5233
+ /** Fired when a customer buys a credit pack or a chosen quantity of credits through the API, an automatic top-up, or the customer portal and the payment succeeds. Purchased credits never expire — unlike plan credits, they survive period resets. Plan-included credit grants fire credits.granted instead. */
4900
5234
  interface CreditsPurchasedData {
4901
5235
  /** The subscription ID. */
4902
5236
  subscriptionId: string;
@@ -4906,12 +5240,12 @@ interface CreditsPurchasedData {
4906
5240
  invoiceId: string;
4907
5241
  /** The human-readable invoice number. */
4908
5242
  invoiceNumber: string;
4909
- /** The purchased credit pack's name. */
5243
+ /** The purchased credit pack's name, or Credit purchase for a chosen quantity of credits. */
4910
5244
  creditPackName: string;
4911
5245
  /** The number of credits purchased. */
4912
5246
  credits: number;
4913
5247
  }
4914
- /** Fired when a subscription's remaining credits cross below 10% of the credits granted for the current period. Emitted once per billing period, when the crossing happens. */
5248
+ /** Fired when a subscription's available credits (plan plus purchased) cross below 10% of their last refill: a period reset, a purchase or a manual adjustment. Emitted once per crossing, the same rule as balance.low. */
4915
5249
  interface CreditsLowData {
4916
5250
  /** The subscription ID. */
4917
5251
  subscriptionId: string;
@@ -4919,12 +5253,12 @@ interface CreditsLowData {
4919
5253
  customerId: string;
4920
5254
  /** Total credits remaining (plan plus purchased). */
4921
5255
  remainingCredits: number;
4922
- /** The low-credit threshold that was crossed: 10% of the period's granted plan credits. */
5256
+ /** The low-credit threshold that was crossed: 10% of the last refill. */
4923
5257
  thresholdCredits: number;
4924
- /** The plan credits granted at the last period reset. */
5258
+ /** The credits added by the last refill: a period reset, a purchase or a manual adjustment. */
4925
5259
  periodCredits: number;
4926
5260
  }
4927
- /** Fired when a subscription's credits hit zero. Usage requests that need more credits than remain are rejected from this point. Also fires customer.state_changed with trigger credits_depleted. */
5261
+ /** Fired each time a subscription's available credits cross to zero or below. Usage that needs more credits than remain is rejected from this point, unless the plan allows overage, which is billed at its price per credit at the next renewal. Also fires customer.state_changed with trigger credits_depleted. */
4928
5262
  interface CreditsDepletedData {
4929
5263
  /** The subscription ID. */
4930
5264
  subscriptionId: string;
@@ -4933,16 +5267,29 @@ interface CreditsDepletedData {
4933
5267
  /** Credits remaining after depletion. Always 0. */
4934
5268
  remainingCredits: number;
4935
5269
  }
4936
- /** Fired at the period reset when unused plan credits from the previous period are discarded. Plan credits expire at period end; purchased credits never expire and are not affected. */
5270
+ /** 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. */
4937
5271
  interface CreditsExpiredData {
4938
5272
  /** The subscription ID. */
4939
5273
  subscriptionId: string;
4940
5274
  /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
4941
5275
  customerId: string;
4942
- /** The unused plan credits that were discarded. */
5276
+ /** The plan credits that were discarded. */
4943
5277
  expiredCredits: number;
4944
5278
  }
4945
- /** Fired when a customer on a balance plan tops up their prepaid balance through the customer portal and the payment succeeds. */
5279
+ /** Fired when non-purchase balance is granted to a subscription: the plan balance at the start of each billing period, or a manual adjustment from the dashboard or the API, which goes to the purchased balance. Balance top-ups fire balance.topped_up instead. */
5280
+ interface BalanceGrantedData {
5281
+ /** The subscription ID. */
5282
+ subscriptionId: string;
5283
+ /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
5284
+ customerId: string;
5285
+ /** The balance granted in rate scale (10000 = 1.00 of the subscription currency). */
5286
+ amount: number;
5287
+ /** The subscription currency. */
5288
+ currency: string;
5289
+ /** Why the balance was granted: period_reset or manual_adjustment. */
5290
+ reason: string;
5291
+ }
5292
+ /** Fired when a balance top-up succeeds: through the API, an automatic top-up or the customer portal. The amount goes to the purchased balance, which is spent after the plan balance and kept until the subscription ends. */
4946
5293
  interface BalanceToppedUpData {
4947
5294
  /** The subscription ID. */
4948
5295
  subscriptionId: string;
@@ -4981,6 +5328,17 @@ interface BalanceDepletedData {
4981
5328
  /** The subscription currency. */
4982
5329
  currency: string;
4983
5330
  }
5331
+ /** Fired at a reset when unused plan balance is discarded. On a plan whose unused plan balance expires, all of it expires at each reset. On a plan that rolls it over, a reset keeps it, up to the plan's maxPlanBalance when it has one, and only the excess expires. An overage debt invoiced at the renewal counts as nothing left over. Purchased balance never expires and is not affected. */
5332
+ interface BalanceExpiredData {
5333
+ /** The subscription ID. */
5334
+ subscriptionId: string;
5335
+ /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
5336
+ customerId: string;
5337
+ /** The plan balance that was discarded, in rate scale (10000 = 1.00 of the subscription currency). */
5338
+ expiredAmount: number;
5339
+ /** The subscription currency. */
5340
+ currency: string;
5341
+ }
4984
5342
  /** Fired when a metered feature's usage crosses 80% of its included quantity for the current period. Emitted once per feature per billing period, when the crossing happens. */
4985
5343
  interface QuotaThresholdReachedData {
4986
5344
  /** The subscription ID. */
@@ -5157,7 +5515,7 @@ interface WebhookEventEnvelope<E extends WebhookEvent, D> {
5157
5515
  apiVersion: string;
5158
5516
  data: D;
5159
5517
  }
5160
- type WebhookEventPayload = WebhookEventEnvelope<"subscription.created", SubscriptionCreatedData> | WebhookEventEnvelope<"subscription.activated", SubscriptionActivatedData> | WebhookEventEnvelope<"subscription.reactivated", SubscriptionReactivatedData> | WebhookEventEnvelope<"subscription.pause_scheduled", SubscriptionPauseScheduledData> | WebhookEventEnvelope<"subscription.pause_updated", SubscriptionPauseUpdatedData> | WebhookEventEnvelope<"subscription.pause_revoked", SubscriptionPauseRevokedData> | WebhookEventEnvelope<"subscription.paused", SubscriptionPausedData> | WebhookEventEnvelope<"subscription.resumed", SubscriptionResumedData> | WebhookEventEnvelope<"subscription.resume_failed", SubscriptionResumeFailedData> | WebhookEventEnvelope<"subscription.canceled", SubscriptionCanceledData> | WebhookEventEnvelope<"subscription.updated", SubscriptionUpdatedData> | WebhookEventEnvelope<"subscription.plan_changed", SubscriptionPlanChangedData> | WebhookEventEnvelope<"subscription.cancellation_scheduled", SubscriptionCancellationScheduledData> | WebhookEventEnvelope<"subscription.cancellation_revoked", SubscriptionCancellationRevokedData> | WebhookEventEnvelope<"subscription.plan_change_scheduled", SubscriptionPlanChangeScheduledData> | WebhookEventEnvelope<"subscription.plan_change_revoked", SubscriptionPlanChangeRevokedData> | WebhookEventEnvelope<"subscription.past_due", SubscriptionPastDueData> | WebhookEventEnvelope<"trial.started", TrialStartedData> | WebhookEventEnvelope<"trial.converted", TrialConvertedData> | WebhookEventEnvelope<"trial.expired", TrialExpiredData> | WebhookEventEnvelope<"trial.will_end", TrialWillEndData> | WebhookEventEnvelope<"trial.checkout_ready", TrialCheckoutReadyData> | WebhookEventEnvelope<"checkout.ready", CheckoutReadyData> | WebhookEventEnvelope<"payment.received", PaymentReceivedData> | WebhookEventEnvelope<"payment.failed", PaymentFailedData> | WebhookEventEnvelope<"payment.recovered", PaymentRecoveredData> | WebhookEventEnvelope<"payment.retry_failed", PaymentRetryFailedData> | WebhookEventEnvelope<"payment.refunded", PaymentRefundedData> | WebhookEventEnvelope<"payment.disputed", PaymentDisputedData> | WebhookEventEnvelope<"payment.dispute_resolved", PaymentDisputeResolvedData> | WebhookEventEnvelope<"payment_link.created", PaymentLinkCreatedData> | WebhookEventEnvelope<"payment_link.completed", PaymentLinkCompletedData> | WebhookEventEnvelope<"payment_link.failed", PaymentLinkFailedData> | WebhookEventEnvelope<"payment_link.canceled", PaymentLinkCanceledData> | WebhookEventEnvelope<"invoice.created", InvoiceCreatedData> | WebhookEventEnvelope<"invoice.voided", InvoiceVoidedData> | WebhookEventEnvelope<"invoice.overdue", InvoiceOverdueData> | WebhookEventEnvelope<"invoice.upcoming", InvoiceUpcomingData> | WebhookEventEnvelope<"payment_method.attached", PaymentMethodAttachedData> | WebhookEventEnvelope<"payment_method.updated", PaymentMethodUpdatedData> | WebhookEventEnvelope<"customer.created", CustomerCreatedData> | WebhookEventEnvelope<"customer.updated", CustomerUpdatedData> | WebhookEventEnvelope<"customer.state_changed", CustomerStateChangedData> | WebhookEventEnvelope<"plan_grant.created", PlanGrantCreatedData> | WebhookEventEnvelope<"plan_grant.updated", PlanGrantUpdatedData> | WebhookEventEnvelope<"plan_grant.expired", PlanGrantExpiredData> | WebhookEventEnvelope<"plan_grant.revoked", PlanGrantRevokedData> | WebhookEventEnvelope<"credits.granted", CreditsGrantedData> | WebhookEventEnvelope<"credits.purchased", CreditsPurchasedData> | WebhookEventEnvelope<"credits.low", CreditsLowData> | WebhookEventEnvelope<"credits.depleted", CreditsDepletedData> | WebhookEventEnvelope<"credits.expired", CreditsExpiredData> | WebhookEventEnvelope<"balance.topped_up", BalanceToppedUpData> | WebhookEventEnvelope<"balance.low", BalanceLowData> | WebhookEventEnvelope<"balance.depleted", BalanceDepletedData> | WebhookEventEnvelope<"quota.threshold_reached", QuotaThresholdReachedData> | WebhookEventEnvelope<"quota.exceeded", QuotaExceededData> | WebhookEventEnvelope<"seats.updated", SeatsUpdatedData> | WebhookEventEnvelope<"seats.limit_reached", SeatsLimitReachedData> | WebhookEventEnvelope<"addon.activated", AddonActivatedData> | WebhookEventEnvelope<"addon.deactivated", AddonDeactivatedData> | WebhookEventEnvelope<"usage.recorded", UsageRecordedData> | WebhookEventEnvelope<"payout.available", PayoutAvailableData> | WebhookEventEnvelope<"payout.created", PayoutCreatedData> | WebhookEventEnvelope<"payout.paid", PayoutPaidData> | WebhookEventEnvelope<"payout.failed", PayoutFailedData>;
5518
+ type WebhookEventPayload = WebhookEventEnvelope<"subscription.created", SubscriptionCreatedData> | WebhookEventEnvelope<"subscription.activated", SubscriptionActivatedData> | WebhookEventEnvelope<"subscription.reactivated", SubscriptionReactivatedData> | WebhookEventEnvelope<"subscription.pause_scheduled", SubscriptionPauseScheduledData> | WebhookEventEnvelope<"subscription.pause_updated", SubscriptionPauseUpdatedData> | WebhookEventEnvelope<"subscription.pause_revoked", SubscriptionPauseRevokedData> | WebhookEventEnvelope<"subscription.paused", SubscriptionPausedData> | WebhookEventEnvelope<"subscription.resumed", SubscriptionResumedData> | WebhookEventEnvelope<"subscription.resume_failed", SubscriptionResumeFailedData> | WebhookEventEnvelope<"subscription.canceled", SubscriptionCanceledData> | WebhookEventEnvelope<"subscription.updated", SubscriptionUpdatedData> | WebhookEventEnvelope<"subscription.plan_changed", SubscriptionPlanChangedData> | WebhookEventEnvelope<"subscription.cancellation_scheduled", SubscriptionCancellationScheduledData> | WebhookEventEnvelope<"subscription.cancellation_revoked", SubscriptionCancellationRevokedData> | WebhookEventEnvelope<"subscription.plan_change_scheduled", SubscriptionPlanChangeScheduledData> | WebhookEventEnvelope<"subscription.plan_change_revoked", SubscriptionPlanChangeRevokedData> | WebhookEventEnvelope<"subscription.past_due", SubscriptionPastDueData> | WebhookEventEnvelope<"trial.started", TrialStartedData> | WebhookEventEnvelope<"trial.converted", TrialConvertedData> | WebhookEventEnvelope<"trial.expired", TrialExpiredData> | WebhookEventEnvelope<"trial.will_end", TrialWillEndData> | WebhookEventEnvelope<"trial.checkout_ready", TrialCheckoutReadyData> | WebhookEventEnvelope<"checkout.ready", CheckoutReadyData> | WebhookEventEnvelope<"payment.received", PaymentReceivedData> | WebhookEventEnvelope<"payment.failed", PaymentFailedData> | WebhookEventEnvelope<"payment.recovered", PaymentRecoveredData> | WebhookEventEnvelope<"payment.retry_failed", PaymentRetryFailedData> | WebhookEventEnvelope<"payment.refunded", PaymentRefundedData> | WebhookEventEnvelope<"payment.disputed", PaymentDisputedData> | WebhookEventEnvelope<"payment.dispute_resolved", PaymentDisputeResolvedData> | WebhookEventEnvelope<"payment_link.created", PaymentLinkCreatedData> | WebhookEventEnvelope<"payment_link.completed", PaymentLinkCompletedData> | WebhookEventEnvelope<"payment_link.failed", PaymentLinkFailedData> | WebhookEventEnvelope<"payment_link.canceled", PaymentLinkCanceledData> | WebhookEventEnvelope<"invoice.created", InvoiceCreatedData> | WebhookEventEnvelope<"invoice.voided", InvoiceVoidedData> | WebhookEventEnvelope<"invoice.overdue", InvoiceOverdueData> | WebhookEventEnvelope<"invoice.upcoming", InvoiceUpcomingData> | WebhookEventEnvelope<"payment_method.attached", PaymentMethodAttachedData> | WebhookEventEnvelope<"payment_method.updated", PaymentMethodUpdatedData> | WebhookEventEnvelope<"payment_method.detached", PaymentMethodDetachedData> | WebhookEventEnvelope<"customer.created", CustomerCreatedData> | WebhookEventEnvelope<"customer.updated", CustomerUpdatedData> | WebhookEventEnvelope<"customer.state_changed", CustomerStateChangedData> | WebhookEventEnvelope<"plan_grant.created", PlanGrantCreatedData> | WebhookEventEnvelope<"plan_grant.updated", PlanGrantUpdatedData> | WebhookEventEnvelope<"plan_grant.expired", PlanGrantExpiredData> | WebhookEventEnvelope<"plan_grant.revoked", PlanGrantRevokedData> | WebhookEventEnvelope<"credits.granted", CreditsGrantedData> | WebhookEventEnvelope<"credits.purchased", CreditsPurchasedData> | WebhookEventEnvelope<"credits.low", CreditsLowData> | WebhookEventEnvelope<"credits.depleted", CreditsDepletedData> | WebhookEventEnvelope<"credits.expired", CreditsExpiredData> | WebhookEventEnvelope<"balance.granted", BalanceGrantedData> | WebhookEventEnvelope<"balance.topped_up", BalanceToppedUpData> | WebhookEventEnvelope<"balance.low", BalanceLowData> | WebhookEventEnvelope<"balance.depleted", BalanceDepletedData> | WebhookEventEnvelope<"balance.expired", BalanceExpiredData> | WebhookEventEnvelope<"quota.threshold_reached", QuotaThresholdReachedData> | WebhookEventEnvelope<"quota.exceeded", QuotaExceededData> | WebhookEventEnvelope<"seats.updated", SeatsUpdatedData> | WebhookEventEnvelope<"seats.limit_reached", SeatsLimitReachedData> | WebhookEventEnvelope<"addon.activated", AddonActivatedData> | WebhookEventEnvelope<"addon.deactivated", AddonDeactivatedData> | WebhookEventEnvelope<"usage.recorded", UsageRecordedData> | WebhookEventEnvelope<"payout.available", PayoutAvailableData> | WebhookEventEnvelope<"payout.created", PayoutCreatedData> | WebhookEventEnvelope<"payout.paid", PayoutPaidData> | WebhookEventEnvelope<"payout.failed", PayoutFailedData>;
5161
5519
  interface WebhookEventDataMap {
5162
5520
  "subscription.created": SubscriptionCreatedData;
5163
5521
  "subscription.activated": SubscriptionActivatedData;
@@ -5199,6 +5557,7 @@ interface WebhookEventDataMap {
5199
5557
  "invoice.upcoming": InvoiceUpcomingData;
5200
5558
  "payment_method.attached": PaymentMethodAttachedData;
5201
5559
  "payment_method.updated": PaymentMethodUpdatedData;
5560
+ "payment_method.detached": PaymentMethodDetachedData;
5202
5561
  "customer.created": CustomerCreatedData;
5203
5562
  "customer.updated": CustomerUpdatedData;
5204
5563
  "customer.state_changed": CustomerStateChangedData;
@@ -5211,9 +5570,11 @@ interface WebhookEventDataMap {
5211
5570
  "credits.low": CreditsLowData;
5212
5571
  "credits.depleted": CreditsDepletedData;
5213
5572
  "credits.expired": CreditsExpiredData;
5573
+ "balance.granted": BalanceGrantedData;
5214
5574
  "balance.topped_up": BalanceToppedUpData;
5215
5575
  "balance.low": BalanceLowData;
5216
5576
  "balance.depleted": BalanceDepletedData;
5577
+ "balance.expired": BalanceExpiredData;
5217
5578
  "quota.threshold_reached": QuotaThresholdReachedData;
5218
5579
  "quota.exceeded": QuotaExceededData;
5219
5580
  "seats.updated": SeatsUpdatedData;
@@ -5257,7 +5618,7 @@ interface GetWebhookEndpointParams {
5257
5618
  interface UpdateWebhookEndpointParams {
5258
5619
  id: string;
5259
5620
  url?: string;
5260
- events?: Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.topped_up" | "balance.low" | "balance.depleted" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">;
5621
+ events?: Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">;
5261
5622
  description?: string | null;
5262
5623
  isActive?: boolean;
5263
5624
  apiVersion?: string;
@@ -5274,7 +5635,7 @@ interface ListWebhookEndpointsParams {
5274
5635
  }
5275
5636
  interface CreateWebhookEndpointParams {
5276
5637
  url: string;
5277
- events: Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.topped_up" | "balance.low" | "balance.depleted" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">;
5638
+ events: Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">;
5278
5639
  description?: string;
5279
5640
  apiVersion?: string;
5280
5641
  }
@@ -5312,4 +5673,4 @@ declare function registerIntegration(name: string, version: string): void;
5312
5673
  declare const API_VERSION = "2026-08-27";
5313
5674
  declare const SDK_VERSION: string;
5314
5675
 
5315
- export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AddonActivatedData, type AddonDeactivatedData, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApplySubscriptionOfferParams, type BalanceAdjustment, type BalanceDepletedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSetSeatsParams, type CancelPaymentParams, type CancelSubscriptionParams, type ChangePlanParams, type ChargePaymentParams, type CheckUsageAvailabilityParams, type CheckoutReadyData, type ClaimLink, Commet, CommetAPIError, type CommetClientOptions, CommetError, type CommetErrorContext, CommetValidationError, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerCreditParams, type CreateCustomerParams, type CreateFeatureParams, type CreateMarketParams, type CreateOfferParams, type CreatePaymentParams, type CreatePlanGrantParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePrepaidPeriodsCheckoutParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookEndpointParams, type CreatedApiKey, type CreatedSubscription, type CreatedWebhook, type CreditGrant, type CreditPack, type CreditPackListItem, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerCredit, type CustomerCreditRevocation, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeleteMarketParams, type DeleteOfferParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookEndpointParams, type DeletedObject, type DeletedOffer, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DownloadInvoiceParams, type Feature, type FeatureAccess, type FeatureDef, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetMarketParams, type GetOfferParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookEndpointParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceListItem, type InvoiceOverdueData, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomerCreditsParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListOffersParams, type ListPaymentsParams, type ListPlanGrantsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhookEndpointsParams, type Market, type Offer, type PauseSubscriptionParams, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethod, type PaymentMethodAttachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGrant, type PlanGrantCreatedData, type PlanGrantExpiredData, type PlanGrantRevokedData, type PlanGrantUpdatedData, type PlanGroup, type PlanGroupDetail, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PortalAccess, type PrepaidPeriodsCheckout, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type Refund, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemoveSubscriptionOfferParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type ResumeSubscriptionParams, type RetryTransactionParams, type RevokeCustomerCreditParams, type RevokePlanGrantParams, type RevokeSubscriptionPauseParams, SDK_VERSION, type SeatBalance, type SeatBalanceCollection, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type SetUsageParams, type SubPaymentMethod, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionOfferApplication, type SubscriptionOfferApplicationPhase, type SubscriptionPastDueData, type SubscriptionPauseRevokedData, type SubscriptionPauseScheduledData, type SubscriptionPauseUpdatedData, type SubscriptionPausedData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionResume, type SubscriptionResumeFailedData, type SubscriptionResumedData, type SubscriptionStatus, type SubscriptionSummary, type SubscriptionUpdatedData, type TestClock, type TestClockRun, type TestWebhookEndpointParams, type Timezone, type TopupBalanceParams, type TrackUsageParams, type Transaction, type TransactionListItem, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdateMarketParams, type UpdateOfferParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGrantParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateSubscriptionPauseParams, type UpdateWebhookEndpointParams, type UpsertRegionalPricesParams, type UsageAdjustment, type UsageCheck, type UsageEvent, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type Webhook, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookPayload, type WebhookPlanGrantTimelineEvent, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTest, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
5676
+ export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AddonActivatedData, type AddonDeactivatedData, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApplySubscriptionOfferParams, type BalanceAdjustment, type BalanceDepletedData, type BalanceExpiredData, type BalanceGrantedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSetSeatsParams, type BusinessTaxId, type CancelPaymentParams, type CancelSubscriptionParams, type ChangePlanParams, type ChargePaymentParams, type CheckUsageAvailabilityParams, type CheckoutReadyData, type ClaimLink, Commet, CommetAPIError, type CommetClientOptions, CommetError, type CommetErrorContext, CommetValidationError, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerCreditParams, type CreateCustomerParams, type CreateFeatureParams, type CreateMarketParams, type CreateOfferParams, type CreatePaymentParams, type CreatePlanGrantParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePrepaidPeriodsCheckoutParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookEndpointParams, type CreatedApiKey, type CreatedSubscription, type CreatedWebhook, type CreditGrant, type CreditPack, type CreditPackListItem, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerCredit, type CustomerCreditRevocation, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeleteMarketParams, type DeleteOfferParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookEndpointParams, type DeletedObject, type DeletedOffer, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DownloadInvoiceParams, type Feature, type FeatureAccess, type FeatureDef, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetMarketParams, type GetOfferParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionAutoTopUpParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookEndpointParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceListItem, type InvoiceOverdueData, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomerCreditsParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListOffersParams, type ListPaymentsParams, type ListPlanGrantsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhookEndpointsParams, type ManagedBy, type Market, type Offer, type PauseSubscriptionParams, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethod, type PaymentMethodAttachedData, type PaymentMethodDetachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGrant, type PlanGrantCreatedData, type PlanGrantExpiredData, type PlanGrantRevokedData, type PlanGrantUpdatedData, type PlanGroup, type PlanGroupDetail, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PortalAccess, type PrepaidPeriodsCheckout, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type Refund, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemoveSubscriptionOfferParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type ResumeSubscriptionParams, type RetryTransactionParams, type RevokeCustomerCreditParams, type RevokePlanGrantParams, type RevokeScheduledPlanChangeParams, type RevokeSubscriptionPauseParams, SDK_VERSION, type SeatBalance, type SeatBalanceCollection, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type SetUsageParams, type SubPaymentMethod, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionAutoTopUp, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionOfferApplication, type SubscriptionOfferApplicationPhase, type SubscriptionPastDueData, type SubscriptionPauseRevokedData, type SubscriptionPauseScheduledData, type SubscriptionPauseUpdatedData, type SubscriptionPausedData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionResume, type SubscriptionResumeFailedData, type SubscriptionResumedData, type SubscriptionStatus, type SubscriptionSummary, type SubscriptionUpdatedData, type TestClock, type TestClockRun, type TestWebhookEndpointParams, type Timezone, type TopupBalanceParams, type TrackUsageParams, type Transaction, type TransactionListItem, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdateMarketParams, type UpdateOfferParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGrantParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateSubscriptionAutoTopUpParams, type UpdateSubscriptionPauseParams, type UpdateWebhookEndpointParams, type UpsertRegionalPricesParams, type UsageAdjustment, type UsageCheck, type UsageEvent, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type Webhook, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookPayload, type WebhookPlanGrantTimelineEvent, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTest, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };