@commet/node 9.5.0 → 9.7.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 (93) hide show
  1. package/dist/index.d.mts +90 -51
  2. package/dist/index.d.ts +90 -51
  3. package/dist/index.js +11 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +11 -2
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/ai-onboarding/commet-skill.md +1 -1
  8. package/docs/ai-onboarding/mcp-server.md +1 -1
  9. package/docs/api-reference/index.md +1 -1
  10. package/docs/api-reference/offers.md +2 -2
  11. package/docs/api-reference/plans.md +1 -1
  12. package/docs/api-reference/promo-codes.md +2 -2
  13. package/docs/api-reference/subscriptions.md +29 -4
  14. package/docs/documentation/api-versioning.md +1 -0
  15. package/docs/documentation/better-auth.md +1 -8
  16. package/docs/documentation/cli.md +13 -13
  17. package/docs/documentation/customers/customer-portal.md +1 -7
  18. package/docs/documentation/customers/manage-customers.md +0 -6
  19. package/docs/documentation/error-handling.md +1 -1
  20. package/docs/documentation/finance/acceptable-use.md +1 -6
  21. package/docs/documentation/finance/finance-overview.md +0 -5
  22. package/docs/documentation/finance/local-currency-taxes.md +0 -6
  23. package/docs/documentation/finance/merchant-of-record.md +0 -7
  24. package/docs/documentation/finance/payouts-verification.md +0 -5
  25. package/docs/documentation/finance/payouts.md +0 -6
  26. package/docs/documentation/finance/supported-countries.md +1 -6
  27. package/docs/documentation/go/integrate-with-encore.md +1 -8
  28. package/docs/documentation/go/integrate-with-go.md +1 -8
  29. package/docs/documentation/invoicing/handle-failed-payments.md +3 -9
  30. package/docs/documentation/invoicing/invoices-and-billing-cycles.md +10 -15
  31. package/docs/documentation/java/integrate-with-java.md +1 -5
  32. package/docs/documentation/nodejs/integrate-with-astro.md +1 -8
  33. package/docs/documentation/nodejs/integrate-with-bun.md +1 -8
  34. package/docs/documentation/nodejs/integrate-with-express.md +1 -8
  35. package/docs/documentation/nodejs/integrate-with-hono.md +1 -8
  36. package/docs/documentation/nodejs/integrate-with-nextjs.md +1 -8
  37. package/docs/documentation/nodejs/integrate-with-nuxt.md +1 -8
  38. package/docs/documentation/nodejs/integrate-with-remix.md +1 -8
  39. package/docs/documentation/nodejs/integrate-with-sveltekit.md +1 -8
  40. package/docs/documentation/payments/accept-one-time-payments.md +0 -8
  41. package/docs/documentation/payments/payment-orchestration.md +0 -6
  42. package/docs/documentation/payments/payment-providers.md +0 -6
  43. package/docs/documentation/php/integrate-with-laravel.md +1 -8
  44. package/docs/documentation/php/integrate-with-php.md +1 -7
  45. package/docs/documentation/php/integrate-with-symfony.md +1 -8
  46. package/docs/documentation/plans/add-ons.md +0 -8
  47. package/docs/documentation/plans/balance-and-top-ups.md +1 -1
  48. package/docs/documentation/plans/configure-features.md +1 -8
  49. package/docs/documentation/plans/consumption-models.md +7 -14
  50. package/docs/documentation/plans/create-plans.md +0 -9
  51. package/docs/documentation/plans/credit-packs.md +0 -7
  52. package/docs/documentation/plans/one-time-payments.md +36 -7
  53. package/docs/documentation/plans/plan-groups.md +0 -6
  54. package/docs/documentation/python/integrate-with-django.md +1 -8
  55. package/docs/documentation/python/integrate-with-fastapi.md +1 -8
  56. package/docs/documentation/python/integrate-with-flask.md +1 -8
  57. package/docs/documentation/python/integrate-with-python.md +1 -8
  58. package/docs/documentation/sales/introductory-offers.md +1 -9
  59. package/docs/documentation/sales/offers.md +0 -8
  60. package/docs/documentation/sales/promo-codes.md +0 -7
  61. package/docs/documentation/sales/promotional-offers.md +0 -7
  62. package/docs/documentation/sales/regional-prices.md +0 -7
  63. package/docs/documentation/sales/trial-periods.md +0 -8
  64. package/docs/documentation/sdk-reference.md +1 -1
  65. package/docs/documentation/subscriptions/manage-subscriptions.md +2 -9
  66. package/docs/documentation/subscriptions/pay-in-advance.md +161 -0
  67. package/docs/documentation/subscriptions/plan-grants.md +0 -6
  68. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +1 -7
  69. package/docs/documentation/testing-sandbox.md +1 -1
  70. package/docs/documentation/usage/ai-token-billing.md +0 -6
  71. package/docs/documentation/usage/quota-management.md +1 -7
  72. package/docs/documentation/usage/seat-management.md +1 -7
  73. package/docs/documentation/usage/track-usage.md +1 -7
  74. package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +1 -1
  75. package/docs/knowledge-base/how-do-discounts-work.md +0 -8
  76. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +9 -15
  77. package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +6 -12
  78. package/docs/knowledge-base/how-do-trial-periods-work.md +1 -8
  79. package/docs/knowledge-base/how-does-billing-work.md +1 -1
  80. package/docs/knowledge-base/how-does-quota-based-billing-work.md +1 -7
  81. package/docs/knowledge-base/how-does-seat-based-billing-work.md +1 -7
  82. package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +1 -7
  83. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +2 -6
  84. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +1 -7
  85. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +1 -7
  86. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +13 -19
  87. package/docs/manifest.json +8 -1
  88. package/docs/platform-documentation.md +1 -0
  89. package/docs/schemas.md +23 -13
  90. package/docs/webhooks/introduction.md +3 -3
  91. package/docs/webhooks.md +4 -4
  92. package/docs/webhooks.openapi.json +15 -5
  93. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ type FeatureDef = {
14
14
  description?: string;
15
15
  };
16
16
  interface PriceDef {
17
- interval: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time";
17
+ interval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
18
18
  /** Rate scale: 10000 = $1.00 */
19
19
  amount: number;
20
20
  trialDays?: number;
@@ -123,11 +123,11 @@ type ResolvedPlanCode<TConfig> = [InferPlanCodes<TConfig>] extends [
123
123
  never
124
124
  ] ? string : InferPlanCodes<TConfig>;
125
125
 
126
- type BillingInterval = "weekly" | "monthly" | "quarterly" | "yearly" | "one_time";
126
+ type BillingInterval = "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
127
127
  type ConsumptionModel = "metered" | "credits" | "balance";
128
128
  type FeatureType = "boolean" | "usage" | "seats" | "quota";
129
- type InvoiceType = "recurring" | "overage" | "plan_change" | "adjustment" | "credit_purchase" | "balance_topup" | "addon_activation" | "one_time_payment" | "reactivation" | "resume";
130
- type PaymentMethod = "card" | "oxxo" | "mercado_pago";
129
+ type InvoiceType = "recurring" | "overage" | "plan_change" | "adjustment" | "credit_purchase" | "balance_topup" | "addon_activation" | "one_time_payment" | "reactivation" | "resume" | "prepayment";
130
+ type PaymentMethod = "card" | "oxxo" | "mercado_pago" | "google_pay" | "smartpix";
131
131
  type PaymentProvider = "stripe" | "commet" | "dlocal";
132
132
  type SubPaymentMethod = "credit_card" | "debit_card" | "prepaid_card" | "bank_transfer" | "account_money";
133
133
  type SubscriptionStatus = "draft" | "pending_payment" | "trialing" | "active" | "past_due" | "paused" | "canceled";
@@ -708,7 +708,7 @@ interface Invoice {
708
708
  poNumber: string | null;
709
709
  reference: string | null;
710
710
  lineItems: Array<{
711
- lineType: "plan_base" | "feature_overage" | "feature_seats" | "feature_quota" | "discount" | "promo_code_discount" | "credit" | "balance_overage" | "addon_base" | "one_time";
711
+ lineType: "plan_base" | "feature_overage" | "feature_seats" | "feature_quota" | "discount" | "promo_code_discount" | "credit" | "balance_overage" | "addon_base" | "one_time" | "prepaid_period";
712
712
  featureName: string | null;
713
713
  description: string;
714
714
  quantity: number;
@@ -783,14 +783,14 @@ interface Offer {
783
783
  type: "percentage";
784
784
  durationCycles: number | null;
785
785
  /** 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. */
786
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
786
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
787
787
  /** Discount in basis points. 5000 means 50%. */
788
788
  percentage: number;
789
789
  } | {
790
790
  type: "amount_off";
791
791
  durationCycles: number | null;
792
792
  /** 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. */
793
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
793
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
794
794
  amounts: Array<{
795
795
  currency: string;
796
796
  /** Amount in the currency's minor unit (for example, cents for USD). */
@@ -800,7 +800,7 @@ interface Offer {
800
800
  type: "fixed_price";
801
801
  durationCycles: number | null;
802
802
  /** 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. */
803
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
803
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
804
804
  prices: Array<{
805
805
  currency: string;
806
806
  /** Amount in the currency's minor unit (for example, cents for USD). */
@@ -822,7 +822,7 @@ interface Payment {
822
822
  /** Charge context captured for new payments. Null for historical payments with no captured context. */
823
823
  paymentContext: {
824
824
  /** The original reason for the charge. Recovery never replaces this reason. */
825
- reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
825
+ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
826
826
  /** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
827
827
  paymentLinkId: string | null;
828
828
  recovery: {
@@ -988,7 +988,7 @@ type PlanChange = {
988
988
  } | {
989
989
  type: "percentage";
990
990
  durationCycles: number | null;
991
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
991
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
992
992
  startsAt: string | null;
993
993
  endsAt: string | null;
994
994
  /** Discount in basis points. 5000 means 50%. */
@@ -996,7 +996,7 @@ type PlanChange = {
996
996
  } | {
997
997
  type: "amount_off";
998
998
  durationCycles: number | null;
999
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
999
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1000
1000
  startsAt: string | null;
1001
1001
  endsAt: string | null;
1002
1002
  /** Discount in the application currency's minor unit. */
@@ -1004,7 +1004,7 @@ type PlanChange = {
1004
1004
  } | {
1005
1005
  type: "fixed_price";
1006
1006
  durationCycles: number | null;
1007
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1007
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1008
1008
  startsAt: string | null;
1009
1009
  endsAt: string | null;
1010
1010
  /** Fixed price in the application currency's minor unit. */
@@ -1089,7 +1089,7 @@ type PlanChange = {
1089
1089
  } | {
1090
1090
  type: "percentage";
1091
1091
  durationCycles: number | null;
1092
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1092
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1093
1093
  startsAt: string | null;
1094
1094
  endsAt: string | null;
1095
1095
  /** Discount in basis points. 5000 means 50%. */
@@ -1097,7 +1097,7 @@ type PlanChange = {
1097
1097
  } | {
1098
1098
  type: "amount_off";
1099
1099
  durationCycles: number | null;
1100
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1100
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1101
1101
  startsAt: string | null;
1102
1102
  endsAt: string | null;
1103
1103
  /** Discount in the application currency's minor unit. */
@@ -1105,7 +1105,7 @@ type PlanChange = {
1105
1105
  } | {
1106
1106
  type: "fixed_price";
1107
1107
  durationCycles: number | null;
1108
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1108
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1109
1109
  startsAt: string | null;
1110
1110
  endsAt: string | null;
1111
1111
  /** Fixed price in the application currency's minor unit. */
@@ -1263,6 +1263,11 @@ interface PortalAccess {
1263
1263
  object: "portal_session";
1264
1264
  livemode: boolean;
1265
1265
  }
1266
+ interface PrepaidPeriodsCheckout {
1267
+ checkoutUrl: string;
1268
+ object: "checkout_session";
1269
+ livemode: boolean;
1270
+ }
1266
1271
  interface PreviewChange {
1267
1272
  currency: string;
1268
1273
  currentPlanCredit: number;
@@ -1292,7 +1297,7 @@ interface PreviewChange {
1292
1297
  } | {
1293
1298
  type: "percentage";
1294
1299
  durationCycles: number | null;
1295
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1300
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1296
1301
  startsAt: string | null;
1297
1302
  endsAt: string | null;
1298
1303
  /** Discount in basis points. 5000 means 50%. */
@@ -1300,7 +1305,7 @@ interface PreviewChange {
1300
1305
  } | {
1301
1306
  type: "amount_off";
1302
1307
  durationCycles: number | null;
1303
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1308
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1304
1309
  startsAt: string | null;
1305
1310
  endsAt: string | null;
1306
1311
  /** Discount in the application currency's minor unit. */
@@ -1308,7 +1313,7 @@ interface PreviewChange {
1308
1313
  } | {
1309
1314
  type: "fixed_price";
1310
1315
  durationCycles: number | null;
1311
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1316
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1312
1317
  startsAt: string | null;
1313
1318
  endsAt: string | null;
1314
1319
  /** Fixed price in the application currency's minor unit. */
@@ -1367,7 +1372,7 @@ interface ReactivatedSubscription {
1367
1372
  } | {
1368
1373
  type: "percentage";
1369
1374
  durationCycles: number | null;
1370
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1375
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1371
1376
  startsAt: string | null;
1372
1377
  endsAt: string | null;
1373
1378
  /** Discount in basis points. 5000 means 50%. */
@@ -1375,7 +1380,7 @@ interface ReactivatedSubscription {
1375
1380
  } | {
1376
1381
  type: "amount_off";
1377
1382
  durationCycles: number | null;
1378
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1383
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1379
1384
  startsAt: string | null;
1380
1385
  endsAt: string | null;
1381
1386
  /** Discount in the application currency's minor unit. */
@@ -1383,7 +1388,7 @@ interface ReactivatedSubscription {
1383
1388
  } | {
1384
1389
  type: "fixed_price";
1385
1390
  durationCycles: number | null;
1386
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1391
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1387
1392
  startsAt: string | null;
1388
1393
  endsAt: string | null;
1389
1394
  /** Fixed price in the application currency's minor unit. */
@@ -1653,27 +1658,27 @@ interface SubscriptionOfferApplication {
1653
1658
  type SubscriptionOfferApplicationPhase = {
1654
1659
  type: "free_trial";
1655
1660
  durationDays: number;
1656
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1661
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1657
1662
  startsAt: string | null;
1658
1663
  endsAt: string | null;
1659
1664
  } | {
1660
1665
  type: "percentage";
1661
1666
  durationCycles: number | null;
1662
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1667
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1663
1668
  percentage: number;
1664
1669
  startsAt: string | null;
1665
1670
  endsAt: string | null;
1666
1671
  } | {
1667
1672
  type: "amount_off";
1668
1673
  durationCycles: number | null;
1669
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1674
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1670
1675
  amount: number;
1671
1676
  startsAt: string | null;
1672
1677
  endsAt: string | null;
1673
1678
  } | {
1674
1679
  type: "fixed_price";
1675
1680
  durationCycles: number | null;
1676
- durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null;
1681
+ durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
1677
1682
  price: number;
1678
1683
  startsAt: string | null;
1679
1684
  endsAt: string | null;
@@ -1816,7 +1821,7 @@ interface Transaction {
1816
1821
  /** Charge context captured for new payments. Null for historical payments with no captured context. */
1817
1822
  paymentContext: {
1818
1823
  /** The original reason for the charge. Recovery never replaces this reason. */
1819
- reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
1824
+ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
1820
1825
  /** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
1821
1826
  paymentLinkId: string | null;
1822
1827
  recovery: {
@@ -1861,7 +1866,7 @@ interface TransactionListItem {
1861
1866
  /** Charge context captured for new payments. Null for historical payments with no captured context. */
1862
1867
  paymentContext: {
1863
1868
  /** The original reason for the charge. Recovery never replaces this reason. */
1864
- reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
1869
+ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
1865
1870
  /** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
1866
1871
  paymentLinkId: string | null;
1867
1872
  recovery: {
@@ -2620,14 +2625,14 @@ interface UpdateOfferParams {
2620
2625
  type: "percentage";
2621
2626
  durationCycles: number | null;
2622
2627
  /** 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. */
2623
- durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null;
2628
+ durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
2624
2629
  /** Discount in basis points. 5000 means 50%. */
2625
2630
  percentage: number;
2626
2631
  } | {
2627
2632
  type: "amount_off";
2628
2633
  durationCycles: number | null;
2629
2634
  /** 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. */
2630
- durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null;
2635
+ durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
2631
2636
  amounts: Array<{
2632
2637
  currency: string;
2633
2638
  /** Amount in the currency's minor unit (for example, cents for USD). */
@@ -2637,7 +2642,7 @@ interface UpdateOfferParams {
2637
2642
  type: "fixed_price";
2638
2643
  durationCycles: number | null;
2639
2644
  /** 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. */
2640
- durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null;
2645
+ durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
2641
2646
  prices: Array<{
2642
2647
  currency: string;
2643
2648
  /** Amount in the currency's minor unit (for example, cents for USD). */
@@ -2666,14 +2671,14 @@ interface CreateOfferParams {
2666
2671
  type: "percentage";
2667
2672
  durationCycles: number | null;
2668
2673
  /** 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. */
2669
- durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null;
2674
+ durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
2670
2675
  /** Discount in basis points. 5000 means 50%. */
2671
2676
  percentage: number;
2672
2677
  } | {
2673
2678
  type: "amount_off";
2674
2679
  durationCycles: number | null;
2675
2680
  /** 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. */
2676
- durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null;
2681
+ durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
2677
2682
  amounts: Array<{
2678
2683
  currency: string;
2679
2684
  /** Amount in the currency's minor unit (for example, cents for USD). */
@@ -2683,7 +2688,7 @@ interface CreateOfferParams {
2683
2688
  type: "fixed_price";
2684
2689
  durationCycles: number | null;
2685
2690
  /** 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. */
2686
- durationInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | null;
2691
+ durationInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null;
2687
2692
  prices: Array<{
2688
2693
  currency: string;
2689
2694
  /** Amount in the currency's minor unit (for example, cents for USD). */
@@ -2915,7 +2920,7 @@ interface DeletePlanPriceParams {
2915
2920
  }
2916
2921
  type AddPlanPriceParams = {
2917
2922
  id: string;
2918
- billingInterval: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time";
2923
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
2919
2924
  metadata?: Record<string, unknown>;
2920
2925
  price: number;
2921
2926
  trialDays?: number;
@@ -2932,7 +2937,7 @@ type AddPlanPriceParams = {
2932
2937
  }>;
2933
2938
  } | {
2934
2939
  id: string;
2935
- billingInterval: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time";
2940
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
2936
2941
  metadata?: Record<string, unknown>;
2937
2942
  inheritsFromPriceId: string;
2938
2943
  marketPrices: Array<{
@@ -3050,7 +3055,7 @@ interface GetPromoCodeParams {
3050
3055
  }
3051
3056
  interface UpdatePromoCodeParams {
3052
3057
  id: string;
3053
- billingInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null;
3058
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null;
3054
3059
  maxRedemptions?: number | null;
3055
3060
  expiresAt?: string | null;
3056
3061
  active?: boolean;
@@ -3063,7 +3068,7 @@ interface ListPromoCodesParams {
3063
3068
  interface CreatePromoCodeParams {
3064
3069
  code: string;
3065
3070
  offerId: string;
3066
- billingInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null;
3071
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null;
3067
3072
  maxRedemptions?: number;
3068
3073
  /** @format date-time */
3069
3074
  expiresAt?: string;
@@ -3222,7 +3227,7 @@ interface CancelSubscriptionParams {
3222
3227
  interface ChangePlanParams {
3223
3228
  id: string;
3224
3229
  newPlanId?: string;
3225
- newBillingInterval?: "weekly" | "monthly" | "quarterly" | "yearly";
3230
+ newBillingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
3226
3231
  successUrl?: string;
3227
3232
  offerId?: string;
3228
3233
  }
@@ -3255,10 +3260,18 @@ interface UpdatePaymentMethodParams {
3255
3260
  id: string;
3256
3261
  successUrl?: string;
3257
3262
  }
3263
+ interface CreatePrepaidPeriodsCheckoutParams {
3264
+ id: string;
3265
+ /** Active subscriptions: billing periods to add after the last paid period. Pending-payment subscriptions: total billing periods the first payment covers, including the current one. */
3266
+ periods: number;
3267
+ /** Offer applied from the first added period for its full configured duration. Active subscriptions only; assign an Offer to a pending-payment subscription with PUT /subscriptions/{id}/offer. */
3268
+ offerId?: string;
3269
+ successUrl?: string;
3270
+ }
3258
3271
  interface PreviewChangePlanParams {
3259
3272
  id: string;
3260
3273
  planId: string;
3261
- billingInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time";
3274
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
3262
3275
  offerId?: string;
3263
3276
  }
3264
3277
  interface ReactivateSubscriptionParams {
@@ -3286,7 +3299,7 @@ interface ListSubscriptionsParams {
3286
3299
  }
3287
3300
  type CreateSubscriptionParams = {
3288
3301
  customerId: string;
3289
- billingInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null;
3302
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null;
3290
3303
  /** Public price ID. When omitted, Commet selects the default price for the billing interval and still applies its market pricing. */
3291
3304
  priceId?: string;
3292
3305
  initialSeats?: Record<string, number>;
@@ -3296,6 +3309,10 @@ type CreateSubscriptionParams = {
3296
3309
  /** @format date-time */
3297
3310
  startDate?: string;
3298
3311
  successUrl?: string;
3312
+ /** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
3313
+ prepaidPeriods?: number;
3314
+ /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3315
+ cancelAtPeriodEnd?: boolean;
3299
3316
  offerId?: never;
3300
3317
  promoCode?: string;
3301
3318
  customTrialDays?: number;
@@ -3303,7 +3320,7 @@ type CreateSubscriptionParams = {
3303
3320
  planId: string;
3304
3321
  } | {
3305
3322
  customerId: string;
3306
- billingInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null;
3323
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null;
3307
3324
  /** Public price ID. When omitted, Commet selects the default price for the billing interval and still applies its market pricing. */
3308
3325
  priceId?: string;
3309
3326
  initialSeats?: Record<string, number>;
@@ -3313,6 +3330,10 @@ type CreateSubscriptionParams = {
3313
3330
  /** @format date-time */
3314
3331
  startDate?: string;
3315
3332
  successUrl?: string;
3333
+ /** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
3334
+ prepaidPeriods?: number;
3335
+ /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3336
+ cancelAtPeriodEnd?: boolean;
3316
3337
  offerId?: never;
3317
3338
  promoCode?: string;
3318
3339
  customTrialDays?: number;
@@ -3320,7 +3341,7 @@ type CreateSubscriptionParams = {
3320
3341
  planCode: string;
3321
3342
  } | {
3322
3343
  customerId: string;
3323
- billingInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null;
3344
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null;
3324
3345
  /** Public price ID. When omitted, Commet selects the default price for the billing interval and still applies its market pricing. */
3325
3346
  priceId?: string;
3326
3347
  initialSeats?: Record<string, number>;
@@ -3330,6 +3351,10 @@ type CreateSubscriptionParams = {
3330
3351
  /** @format date-time */
3331
3352
  startDate?: string;
3332
3353
  successUrl?: string;
3354
+ /** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
3355
+ prepaidPeriods?: number;
3356
+ /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3357
+ cancelAtPeriodEnd?: boolean;
3333
3358
  offerId: string;
3334
3359
  promoCode?: never;
3335
3360
  customTrialDays?: never;
@@ -3337,7 +3362,7 @@ type CreateSubscriptionParams = {
3337
3362
  planId: string;
3338
3363
  } | {
3339
3364
  customerId: string;
3340
- billingInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null;
3365
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null;
3341
3366
  /** Public price ID. When omitted, Commet selects the default price for the billing interval and still applies its market pricing. */
3342
3367
  priceId?: string;
3343
3368
  initialSeats?: Record<string, number>;
@@ -3347,6 +3372,10 @@ type CreateSubscriptionParams = {
3347
3372
  /** @format date-time */
3348
3373
  startDate?: string;
3349
3374
  successUrl?: string;
3375
+ /** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
3376
+ prepaidPeriods?: number;
3377
+ /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3378
+ cancelAtPeriodEnd?: boolean;
3350
3379
  offerId: string;
3351
3380
  promoCode?: never;
3352
3381
  customTrialDays?: never;
@@ -3354,7 +3383,7 @@ type CreateSubscriptionParams = {
3354
3383
  planCode: string;
3355
3384
  } | {
3356
3385
  customerId: string;
3357
- billingInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null;
3386
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null;
3358
3387
  /** Public price ID. When omitted, Commet selects the default price for the billing interval and still applies its market pricing. */
3359
3388
  priceId?: string;
3360
3389
  initialSeats?: Record<string, number>;
@@ -3364,6 +3393,10 @@ type CreateSubscriptionParams = {
3364
3393
  /** @format date-time */
3365
3394
  startDate?: string;
3366
3395
  successUrl?: string;
3396
+ /** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
3397
+ prepaidPeriods?: number;
3398
+ /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3399
+ cancelAtPeriodEnd?: boolean;
3367
3400
  offerId?: never;
3368
3401
  /** Public card promotion ID. The offer is shown immediately and remains conditional on card eligibility until checkout confirmation. */
3369
3402
  cardPromotionId: string;
@@ -3373,7 +3406,7 @@ type CreateSubscriptionParams = {
3373
3406
  planId: string;
3374
3407
  } | {
3375
3408
  customerId: string;
3376
- billingInterval?: "weekly" | "monthly" | "quarterly" | "yearly" | "one_time" | null;
3409
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time" | null;
3377
3410
  /** Public price ID. When omitted, Commet selects the default price for the billing interval and still applies its market pricing. */
3378
3411
  priceId?: string;
3379
3412
  initialSeats?: Record<string, number>;
@@ -3383,6 +3416,10 @@ type CreateSubscriptionParams = {
3383
3416
  /** @format date-time */
3384
3417
  startDate?: string;
3385
3418
  successUrl?: string;
3419
+ /** Billing periods of the subscription's interval paid with the first payment, including the current one. Defaults to 1. The interval does not change: each paid period renews at zero and the subscription renews normally after the last one unless `cancelAtPeriodEnd` is true. */
3420
+ prepaidPeriods?: number;
3421
+ /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3422
+ cancelAtPeriodEnd?: boolean;
3386
3423
  offerId?: never;
3387
3424
  /** Public card promotion ID. The offer is shown immediately and remains conditional on card eligibility until checkout confirmation. */
3388
3425
  cardPromotionId: string;
@@ -3418,8 +3455,10 @@ declare class SubscriptionsResource {
3418
3455
  updatePause(params: UpdateSubscriptionPauseParams, options?: RequestOptions): Promise<Subscription>;
3419
3456
  /** Revoke a pause before it becomes effective. Active pauses must be resumed instead. */
3420
3457
  revokePause(params: RevokeSubscriptionPauseParams, options?: RequestOptions): Promise<Subscription>;
3421
- /** Creates a hosted checkout session for the customer to update the subscription's default payment method. */
3458
+ /** Creates a hosted checkout to update the payment method of an active, trialing or past_due subscription. Pending-payment subscriptions must use their payment checkout. */
3422
3459
  updatePaymentMethod(params: UpdatePaymentMethodParams, options?: RequestOptions): Promise<PaymentMethodUpdateCheckout>;
3460
+ /** 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
+ createPrepaidPeriodsCheckout(params: CreatePrepaidPeriodsCheckoutParams, options?: RequestOptions): Promise<PrepaidPeriodsCheckout>;
3423
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. */
3424
3463
  previewChange(params: PreviewChangePlanParams, options?: RequestOptions): Promise<PreviewChange>;
3425
3464
  /** 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. */
@@ -3959,7 +3998,7 @@ interface PaymentReceivedData {
3959
3998
  /** Charge context captured for new payments. Null for historical payments with no captured context. */
3960
3999
  paymentContext: {
3961
4000
  /** The original reason for the charge. Recovery never replaces this reason. */
3962
- reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
4001
+ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
3963
4002
  /** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
3964
4003
  paymentLinkId: string | null;
3965
4004
  recovery: {
@@ -4006,7 +4045,7 @@ interface PaymentFailedData {
4006
4045
  /** Charge context captured for new payments. Null for historical payments with no captured context. */
4007
4046
  paymentContext: {
4008
4047
  /** The original reason for the charge. Recovery never replaces this reason. */
4009
- reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
4048
+ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
4010
4049
  /** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
4011
4050
  paymentLinkId: string | null;
4012
4051
  recovery: {
@@ -4163,7 +4202,7 @@ interface PaymentLinkCompletedData {
4163
4202
  /** Charge context captured for new payments. Null for historical payments with no captured context. */
4164
4203
  paymentContext: {
4165
4204
  /** The original reason for the charge. Recovery never replaces this reason. */
4166
- reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
4205
+ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
4167
4206
  /** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
4168
4207
  paymentLinkId: string | null;
4169
4208
  recovery: {
@@ -4204,7 +4243,7 @@ interface PaymentLinkFailedData {
4204
4243
  /** Charge context captured for new payments. Null for historical payments with no captured context. */
4205
4244
  paymentContext: {
4206
4245
  /** The original reason for the charge. Recovery never replaces this reason. */
4207
- reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment";
4246
+ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment";
4208
4247
  /** The public payment link ID, independently of the reason, or null when no payment link originated the charge. */
4209
4248
  paymentLinkId: string | null;
4210
4249
  recovery: {
@@ -5273,4 +5312,4 @@ declare function registerIntegration(name: string, version: string): void;
5273
5312
  declare const API_VERSION = "2026-08-27";
5274
5313
  declare const SDK_VERSION: string;
5275
5314
 
5276
- 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 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 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 };
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 };
package/dist/index.js CHANGED
@@ -755,7 +755,7 @@ var SubscriptionsResource = class {
755
755
  options
756
756
  );
757
757
  }
758
- /** Creates a hosted checkout session for the customer to update the subscription's default payment method. */
758
+ /** Creates a hosted checkout to update the payment method of an active, trialing or past_due subscription. Pending-payment subscriptions must use their payment checkout. */
759
759
  async updatePaymentMethod(params, options) {
760
760
  const { id, ...rest } = params;
761
761
  return this.httpClient.post(
@@ -764,6 +764,15 @@ var SubscriptionsResource = class {
764
764
  options
765
765
  );
766
766
  }
767
+ /** 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. */
768
+ async createPrepaidPeriodsCheckout(params, options) {
769
+ const { id, ...rest } = params;
770
+ return this.httpClient.post(
771
+ `/subscriptions/${id}/prepaid-periods`,
772
+ rest,
773
+ options
774
+ );
775
+ }
767
776
  /** 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. */
768
777
  async previewChange(params, options) {
769
778
  const { id, ...rest } = params;
@@ -1061,7 +1070,7 @@ var CommetValidationError = class extends CommetAPIError {
1061
1070
 
1062
1071
  // src/version.ts
1063
1072
  var API_VERSION = "2026-08-27";
1064
- var SDK_VERSION = "9.5.0";
1073
+ var SDK_VERSION = "9.7.0";
1065
1074
 
1066
1075
  // src/utils/telemetry.ts
1067
1076
  var registeredIntegrations = /* @__PURE__ */ new Set();