@commet/node 9.6.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 (86) hide show
  1. package/dist/index.d.mts +51 -12
  2. package/dist/index.d.ts +51 -12
  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/subscriptions.md +26 -1
  11. package/docs/documentation/better-auth.md +1 -8
  12. package/docs/documentation/customers/customer-portal.md +1 -7
  13. package/docs/documentation/customers/manage-customers.md +0 -6
  14. package/docs/documentation/error-handling.md +1 -1
  15. package/docs/documentation/finance/acceptable-use.md +1 -6
  16. package/docs/documentation/finance/finance-overview.md +0 -5
  17. package/docs/documentation/finance/local-currency-taxes.md +0 -6
  18. package/docs/documentation/finance/merchant-of-record.md +0 -7
  19. package/docs/documentation/finance/payouts-verification.md +0 -5
  20. package/docs/documentation/finance/payouts.md +0 -6
  21. package/docs/documentation/finance/supported-countries.md +1 -6
  22. package/docs/documentation/go/integrate-with-encore.md +1 -8
  23. package/docs/documentation/go/integrate-with-go.md +1 -8
  24. package/docs/documentation/invoicing/handle-failed-payments.md +3 -9
  25. package/docs/documentation/invoicing/invoices-and-billing-cycles.md +0 -6
  26. package/docs/documentation/java/integrate-with-java.md +1 -5
  27. package/docs/documentation/nodejs/integrate-with-astro.md +1 -8
  28. package/docs/documentation/nodejs/integrate-with-bun.md +1 -8
  29. package/docs/documentation/nodejs/integrate-with-express.md +1 -8
  30. package/docs/documentation/nodejs/integrate-with-hono.md +1 -8
  31. package/docs/documentation/nodejs/integrate-with-nextjs.md +1 -8
  32. package/docs/documentation/nodejs/integrate-with-nuxt.md +1 -8
  33. package/docs/documentation/nodejs/integrate-with-remix.md +1 -8
  34. package/docs/documentation/nodejs/integrate-with-sveltekit.md +1 -8
  35. package/docs/documentation/payments/accept-one-time-payments.md +0 -8
  36. package/docs/documentation/payments/payment-orchestration.md +0 -6
  37. package/docs/documentation/payments/payment-providers.md +0 -6
  38. package/docs/documentation/php/integrate-with-laravel.md +1 -8
  39. package/docs/documentation/php/integrate-with-php.md +1 -7
  40. package/docs/documentation/php/integrate-with-symfony.md +1 -8
  41. package/docs/documentation/plans/add-ons.md +0 -8
  42. package/docs/documentation/plans/configure-features.md +1 -8
  43. package/docs/documentation/plans/consumption-models.md +0 -7
  44. package/docs/documentation/plans/create-plans.md +0 -9
  45. package/docs/documentation/plans/credit-packs.md +0 -7
  46. package/docs/documentation/plans/one-time-payments.md +36 -7
  47. package/docs/documentation/plans/plan-groups.md +0 -6
  48. package/docs/documentation/python/integrate-with-django.md +1 -8
  49. package/docs/documentation/python/integrate-with-fastapi.md +1 -8
  50. package/docs/documentation/python/integrate-with-flask.md +1 -8
  51. package/docs/documentation/python/integrate-with-python.md +1 -8
  52. package/docs/documentation/sales/introductory-offers.md +1 -9
  53. package/docs/documentation/sales/offers.md +0 -8
  54. package/docs/documentation/sales/promo-codes.md +0 -7
  55. package/docs/documentation/sales/promotional-offers.md +0 -7
  56. package/docs/documentation/sales/regional-prices.md +0 -7
  57. package/docs/documentation/sales/trial-periods.md +0 -8
  58. package/docs/documentation/sdk-reference.md +1 -1
  59. package/docs/documentation/subscriptions/manage-subscriptions.md +2 -9
  60. package/docs/documentation/subscriptions/pay-in-advance.md +161 -0
  61. package/docs/documentation/subscriptions/plan-grants.md +0 -6
  62. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +1 -7
  63. package/docs/documentation/testing-sandbox.md +1 -1
  64. package/docs/documentation/usage/ai-token-billing.md +0 -6
  65. package/docs/documentation/usage/quota-management.md +1 -7
  66. package/docs/documentation/usage/seat-management.md +1 -7
  67. package/docs/documentation/usage/track-usage.md +1 -7
  68. package/docs/knowledge-base/how-do-discounts-work.md +0 -8
  69. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +1 -7
  70. package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +0 -6
  71. package/docs/knowledge-base/how-do-trial-periods-work.md +1 -8
  72. package/docs/knowledge-base/how-does-billing-work.md +1 -1
  73. package/docs/knowledge-base/how-does-quota-based-billing-work.md +1 -7
  74. package/docs/knowledge-base/how-does-seat-based-billing-work.md +1 -7
  75. package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +0 -6
  76. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +0 -6
  77. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +1 -7
  78. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +1 -7
  79. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -7
  80. package/docs/manifest.json +8 -1
  81. package/docs/platform-documentation.md +1 -0
  82. package/docs/schemas.md +13 -4
  83. package/docs/webhooks/introduction.md +3 -3
  84. package/docs/webhooks.md +4 -4
  85. package/docs/webhooks.openapi.json +15 -5
  86. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -126,8 +126,8 @@ type ResolvedPlanCode<TConfig> = [InferPlanCodes<TConfig>] extends [
126
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;
@@ -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: {
@@ -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;
@@ -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: {
@@ -3255,6 +3260,14 @@ 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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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.d.ts CHANGED
@@ -126,8 +126,8 @@ type ResolvedPlanCode<TConfig> = [InferPlanCodes<TConfig>] extends [
126
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;
@@ -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: {
@@ -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;
@@ -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: {
@@ -3255,6 +3260,14 @@ 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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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.6.0";
1073
+ var SDK_VERSION = "9.7.0";
1065
1074
 
1066
1075
  // src/utils/telemetry.ts
1067
1076
  var registeredIntegrations = /* @__PURE__ */ new Set();