@commet/node 7.3.0 → 7.5.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.
package/dist/index.d.ts CHANGED
@@ -140,8 +140,9 @@ type ResolvedPlanCode<TConfig> = [InferPlanCodes<TConfig>] extends [
140
140
  type SubscriptionStatus = "draft" | "pending_payment" | "trialing" | "active" | "past_due" | "canceled";
141
141
  type BillingInterval = "weekly" | "monthly" | "quarterly" | "yearly" | "one_time";
142
142
  type ConsumptionModel = "metered" | "credits" | "balance";
143
- type InvoiceType = "recurring" | "overage" | "plan_change" | "adjustment" | "credit_purchase" | "balance_topup" | "addon_activation" | "one_time_payment";
143
+ type InvoiceType = "recurring" | "overage" | "plan_change" | "adjustment" | "credit_purchase" | "balance_topup" | "addon_activation" | "one_time_payment" | "reactivation";
144
144
  type TransactionStatus = "pending" | "succeeded" | "failed" | "refunded" | "disputed";
145
+ type PaymentProvider = "stripe" | "commet" | "dlocal";
145
146
  type FeatureType = "boolean" | "usage" | "seats" | "quota";
146
147
  type DiscountType = "percentage" | "amount";
147
148
  type Timezone = "UTC" | "America/New_York" | "America/Chicago" | "America/Denver" | "America/Los_Angeles" | "America/Sao_Paulo" | "America/Mexico_City" | "America/Buenos_Aires" | "America/Santiago" | "America/Bogota" | "America/Lima" | "America/Asuncion" | "Europe/London" | "Europe/Paris" | "Europe/Berlin" | "Europe/Madrid" | "Asia/Tokyo" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Dubai" | "Australia/Sydney";
@@ -292,6 +293,8 @@ interface Customer {
292
293
  externalId: string | null;
293
294
  fullName: string | null;
294
295
  email: string;
296
+ taxDocument: string | null;
297
+ documentType: string | null;
295
298
  timezone: string | null;
296
299
  metadata: Record<string, unknown> | null;
297
300
  /** @format date-time */
@@ -315,6 +318,7 @@ interface CustomerBatch {
315
318
  externalId?: string;
316
319
  email: string;
317
320
  fullName?: string | null;
321
+ taxDocument?: string | null;
318
322
  timezone?: string;
319
323
  metadata?: Record<string, unknown> | null;
320
324
  address?: {
@@ -473,7 +477,7 @@ interface Payment {
473
477
  customerId: string | null;
474
478
  kind: "link" | "charge";
475
479
  status: "pending" | "processing" | "succeeded" | "requires_action" | "failed" | "canceled";
476
- provider: "stripe" | "commet";
480
+ provider: PaymentProvider;
477
481
  amountSubtotal: number;
478
482
  taxAmount: number;
479
483
  amountTotal: number;
@@ -921,8 +925,10 @@ interface Transaction {
921
925
  invoiceId: string | null;
922
926
  grossAmount: number;
923
927
  subtotal: number;
924
- taxAmount: number;
928
+ taxAmount: number | null;
925
929
  currency: string;
930
+ /** The payment provider the charge was routed to: stripe, commet, or dlocal. */
931
+ provider: PaymentProvider;
926
932
  status: TransactionStatus;
927
933
  customerEmail: string | null;
928
934
  customerName: string | null;
@@ -981,6 +987,54 @@ interface UsageQuotaEvent {
981
987
  object: "usage_quota";
982
988
  livemode: boolean;
983
989
  }
990
+ interface WebhookAddonRef {
991
+ id: string;
992
+ name: string;
993
+ }
994
+ interface WebhookBalance {
995
+ currentBalance: number;
996
+ }
997
+ interface WebhookBankRef {
998
+ bankName: string | null;
999
+ last4: string;
1000
+ }
1001
+ interface WebhookCardInfo {
1002
+ brand: string;
1003
+ last4: string;
1004
+ expMonth: number;
1005
+ expYear: number;
1006
+ }
1007
+ interface WebhookCreditsBalance {
1008
+ planCredits: number;
1009
+ purchasedCredits: number;
1010
+ totalCredits: number;
1011
+ }
1012
+ interface WebhookFeatureAccess {
1013
+ code: string;
1014
+ name: string;
1015
+ type: string;
1016
+ allowed: boolean;
1017
+ enabled: boolean | null;
1018
+ current: number | null;
1019
+ included: number | null;
1020
+ remaining: number | null;
1021
+ overageQuantity: number | null;
1022
+ overageUnitPrice: number | null;
1023
+ unlimited: boolean | null;
1024
+ overageEnabled: boolean | null;
1025
+ billedQuantity: number | null;
1026
+ }
1027
+ interface WebhookPlanRef {
1028
+ id: string;
1029
+ name: string;
1030
+ }
1031
+ interface WebhookSeatSummary {
1032
+ code: string;
1033
+ current: number | null;
1034
+ included: number | null;
1035
+ remaining: number | null;
1036
+ unlimited: boolean | null;
1037
+ }
984
1038
 
985
1039
  declare class CommetHTTPClient {
986
1040
  private config;
@@ -1123,6 +1177,7 @@ interface CreateCustomerParams {
1123
1177
  id?: string;
1124
1178
  externalId?: string;
1125
1179
  fullName?: string;
1180
+ taxDocument?: string;
1126
1181
  address?: {
1127
1182
  line1: string;
1128
1183
  line2?: string;
@@ -1144,6 +1199,7 @@ interface UpdateCustomerParams {
1144
1199
  id: string;
1145
1200
  email?: string;
1146
1201
  fullName?: string;
1202
+ taxDocument?: string;
1147
1203
  externalId?: string;
1148
1204
  timezone?: Timezone;
1149
1205
  metadata?: Record<string, unknown>;
@@ -1163,6 +1219,7 @@ interface BatchCreateCustomersParams {
1163
1219
  id?: string;
1164
1220
  externalId?: string;
1165
1221
  fullName?: string;
1222
+ taxDocument?: string;
1166
1223
  timezone?: Timezone;
1167
1224
  metadata?: Record<string, unknown>;
1168
1225
  address?: {
@@ -1629,6 +1686,7 @@ declare class PlansResource {
1629
1686
  interface RequestPortalAccessParams {
1630
1687
  email?: string;
1631
1688
  customerId?: string;
1689
+ returnUrl?: string;
1632
1690
  }
1633
1691
  declare class PortalResource {
1634
1692
  private httpClient;
@@ -1668,7 +1726,11 @@ declare class PromoCodesResource {
1668
1726
  list(params?: ListPromoCodesParams, options?: RequestOptions): Promise<ApiResponse<Array<PromoCode>>>;
1669
1727
  /** Retrieve a promo code by its public ID. */
1670
1728
  get(params: GetPromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCode>>;
1671
- /** Create a new promo code. Optionally restrict to specific plans. */
1729
+ /**
1730
+ * Create a new promo code. Optionally restrict to specific plans.
1731
+ *
1732
+ * **100% discounts are not supported.** Percentage codes must be strictly less than 100% (`discountValue` < 10000 basis points). For full waivers, use an introductory offer on the plan instead. At checkout, any code — percentage or fixed amount — that would reduce the total below the currency's minimum charge ($0.50 USD equivalent) is silently dropped.
1733
+ */
1672
1734
  create(params: CreatePromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCode>>;
1673
1735
  /** Update a promo code's redemption limits, expiration, active status, or plan restrictions. */
1674
1736
  update(params: UpdatePromoCodeParams, options?: RequestOptions): Promise<ApiResponse<PromoCode>>;
@@ -1853,7 +1915,7 @@ declare class SubscriptionsResource {
1853
1915
  cancel(params: CancelSubscriptionParams, options?: RequestOptions): Promise<ApiResponse<CanceledSubscription>>;
1854
1916
  /** Revert a scheduled cancellation. Only works when canceledAt is set but status is not yet 'canceled'. */
1855
1917
  uncancel(params: UncancelSubscriptionParams, options?: RequestOptions): Promise<ApiResponse<UncanceledSubscription>>;
1856
- /** Retries the outstanding renewal charge for a past_due subscription. On a successful charge the subscription recovers to active and a payment.recovered webhook is delivered; a declined charge returns an error and the subscription stays past_due. */
1918
+ /** 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. */
1857
1919
  reactivate(params: ReactivateSubscriptionParams, options?: RequestOptions): Promise<ApiResponse<ReactivatedSubscription>>;
1858
1920
  /** Generates a hosted, signed recovery link that lets the customer pay the outstanding renewal charge for a past_due subscription. Unlike reactivate, which charges server-to-server, this returns a link the merchant can deliver through their own email, SMS, or dashboard. The link carries a self-contained signed token and stays valid until the charge is paid or the subscription is no longer past due. */
1859
1921
  createRecoveryLink(params: CreateSubscriptionRecoveryLinkParams, options?: RequestOptions): Promise<ApiResponse<RecoveryLink>>;
@@ -2019,56 +2081,7 @@ declare class UsageResource {
2019
2081
  check(params: CheckUsageParams, options?: RequestOptions): Promise<ApiResponse<UsageCheckResult>>;
2020
2082
  }
2021
2083
 
2022
- interface WebhookPlanRef {
2023
- id: string;
2024
- name: string;
2025
- }
2026
- interface WebhookAddonRef {
2027
- id: string;
2028
- name: string;
2029
- }
2030
- interface WebhookCardInfo {
2031
- brand: string;
2032
- last4: string;
2033
- expMonth: number;
2034
- expYear: number;
2035
- }
2036
- interface WebhookBankRef {
2037
- bankName: string;
2038
- last4: string;
2039
- }
2040
- interface WebhookFeatureAccess {
2041
- code: string;
2042
- name: string;
2043
- type: string;
2044
- allowed: boolean;
2045
- enabled: boolean | null;
2046
- current: number | null;
2047
- included: number | null;
2048
- remaining: number | null;
2049
- overageQuantity: number | null;
2050
- overageUnitPrice: number | null;
2051
- unlimited: boolean | null;
2052
- overageEnabled: boolean | null;
2053
- billedQuantity: number | null;
2054
- }
2055
- interface WebhookSeatSummary {
2056
- code: string;
2057
- current: number | null;
2058
- included: number | null;
2059
- remaining: number | null;
2060
- unlimited: boolean | null;
2061
- }
2062
- interface WebhookCreditsBalance {
2063
- planCredits: number;
2064
- purchasedCredits: number;
2065
- totalCredits: number;
2066
- }
2067
- interface WebhookBalance {
2068
- currentBalance: number;
2069
- }
2070
-
2071
- type WebhookEvent = "subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.upcoming" | "invoice.overdue" | "invoice.voided" | "payment_method.attached" | "payment_method.updated" | "customer.created" | "customer.updated" | "customer.state_changed" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.topped_up" | "balance.low" | "balance.depleted" | "quota.threshold_reached" | "quota.exceeded" | "usage.recorded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed";
2084
+ type WebhookEvent = "subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "customer.created" | "customer.updated" | "customer.state_changed" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.topped_up" | "balance.low" | "balance.depleted" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed";
2072
2085
  /** Fired when a subscription record is created with status pending_payment. The first charge has not been confirmed yet — do NOT grant access here. Wait for subscription.activated. */
2073
2086
  interface SubscriptionCreatedData {
2074
2087
  /** The subscription ID. */
@@ -2079,25 +2092,25 @@ interface SubscriptionCreatedData {
2079
2092
  planId: string;
2080
2093
  /** The plan name. */
2081
2094
  planName: string;
2082
- /** Current status. One of: draft, pending_payment, trialing, active, past_due, canceled, expired. Grant access only when trialing or active. */
2095
+ /** Current status. One of: draft, pending_payment, trialing, active, past_due, canceled. Access is granted while trialing, active, or past_due — past_due is a permissive grace window during dunning, where you decide whether to keep serving the customer or block them. */
2083
2096
  status: string;
2084
2097
  /** ISO 8601 datetime when the subscription starts. */
2085
- startDate: string | null;
2098
+ startDate: string;
2086
2099
  /** Optional custom name for the subscription. */
2087
2100
  name: string | null;
2088
2101
  }
2089
- /** Fired when the first charge succeeds and status becomes active (or trialing if a trial is configured). This is where you grant access. */
2102
+ /** Fired once, when the subscription's first charge succeeds and it becomes active this is where you grant access. Never re-fired on renewals; use payment.received for per-charge notifications. */
2090
2103
  interface SubscriptionActivatedData {
2091
2104
  /** The subscription ID. */
2092
2105
  subscriptionId: string;
2093
2106
  /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
2094
2107
  customerId: string;
2095
- /** Current status. One of: draft, pending_payment, trialing, active, past_due, canceled, expired. Grant access only when trialing or active. */
2108
+ /** Current status. One of: draft, pending_payment, trialing, active, past_due, canceled. Access is granted while trialing, active, or past_due — past_due is a permissive grace window during dunning, where you decide whether to keep serving the customer or block them. */
2096
2109
  status: string;
2097
2110
  /** ISO 8601 start of the current billing period. */
2098
- currentPeriodStart: string | null;
2111
+ currentPeriodStart?: string;
2099
2112
  /** ISO 8601 end of the current billing period. */
2100
- currentPeriodEnd: string | null;
2113
+ currentPeriodEnd?: string;
2101
2114
  /** Optional custom name for the subscription. */
2102
2115
  name: string | null;
2103
2116
  /** The invoice ID for this payment. */
@@ -2109,18 +2122,18 @@ interface SubscriptionActivatedData {
2109
2122
  /** The invoice currency code. */
2110
2123
  invoiceCurrency: string;
2111
2124
  }
2112
- /** Fired when a canceled subscription is reactivated and its reactivation charge succeeds. The subscription returns to active with a fresh invoice and a billing period anchored to the reactivation date. */
2125
+ /** Fired when a canceled subscription is reactivated and its reactivation charge succeeds. The subscription returns to active with a fresh invoice and a billing period anchored to the reactivation date. Distinct from subscription.activated (first activation) and payment.recovered (past_due recovery, which keeps the original anchor). */
2113
2126
  interface SubscriptionReactivatedData {
2114
2127
  /** The subscription ID. */
2115
2128
  subscriptionId: string;
2116
2129
  /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
2117
2130
  customerId: string;
2118
- /** Current status. Always "active" for this event. */
2131
+ /** Always "active" for this event. Restore access here. */
2119
2132
  status: string;
2120
2133
  /** ISO 8601 start of the new billing period, anchored to the reactivation date. */
2121
- currentPeriodStart: string | null;
2134
+ currentPeriodStart?: string;
2122
2135
  /** ISO 8601 end of the new billing period. */
2123
- currentPeriodEnd: string | null;
2136
+ currentPeriodEnd?: string;
2124
2137
  /** Optional custom name for the subscription. */
2125
2138
  name: string | null;
2126
2139
  /** The fresh reactivation invoice ID. */
@@ -2141,11 +2154,11 @@ interface SubscriptionCanceledData {
2141
2154
  /** Always "canceled" for this event. Revoke access when you receive this. */
2142
2155
  status: string;
2143
2156
  /** ISO 8601 datetime when the customer originally requested cancellation. */
2144
- canceledAt: string;
2157
+ canceledAt?: string;
2145
2158
  /** The reason for cancellation, if provided. */
2146
2159
  cancelReason: string | null;
2147
2160
  /** ISO 8601 datetime when the subscription ended (matches the billing period end). */
2148
- endDate: string;
2161
+ endDate?: string;
2149
2162
  }
2150
2163
  /** Fired when subscription details change. The most common trigger is scheduling a cancellation — when a customer cancels, the status stays "active" until the billing period ends, but canceledAt and endDate are set immediately. Use this event to show "your subscription will end on {endDate}" in your UI. Access should NOT be revoked here — wait for subscription.canceled. */
2151
2164
  interface SubscriptionUpdatedData {
@@ -2156,11 +2169,11 @@ interface SubscriptionUpdatedData {
2156
2169
  /** Current status. When cancellation is scheduled, this is still "active" — the subscription remains usable until endDate. */
2157
2170
  status: string;
2158
2171
  /** ISO 8601 datetime when cancellation was requested. Present when cancellation is scheduled, null otherwise. */
2159
- canceledAt: string | null;
2172
+ canceledAt?: string;
2160
2173
  /** The reason for cancellation, if provided. */
2161
2174
  cancelReason: string | null;
2162
2175
  /** ISO 8601 datetime when the subscription will end. Present when cancellation is scheduled — this is the date access should be revoked (via subscription.canceled). */
2163
- endDate: string | null;
2176
+ endDate?: string;
2164
2177
  }
2165
2178
  /** Fired when a subscription changes from one plan to another, including upgrades, downgrades, and billing interval changes. Access does not change on this event — the subscription stays active. */
2166
2179
  interface SubscriptionPlanChangedData {
@@ -2175,11 +2188,11 @@ interface SubscriptionPlanChangedData {
2175
2188
  /** The billing interval (monthly, yearly). */
2176
2189
  billingInterval: string | null;
2177
2190
  /** Prorated credit in cents from the previous plan. */
2178
- credit: number | null;
2191
+ credit: number;
2179
2192
  /** Prorated charge in cents for the new plan. */
2180
- charge: number | null;
2193
+ charge: number;
2181
2194
  /** Total amount charged in cents. */
2182
- totalCharged: number | null;
2195
+ totalCharged: number;
2183
2196
  }
2184
2197
  /** Fired when a cancellation is scheduled for the end of the billing period. The subscription stays active until effectiveAt — do NOT revoke access here. subscription.updated also fires for backward compatibility. */
2185
2198
  interface SubscriptionCancellationScheduledData {
@@ -2190,7 +2203,7 @@ interface SubscriptionCancellationScheduledData {
2190
2203
  /** Still "active" — the subscription remains usable until effectiveAt. */
2191
2204
  status: string;
2192
2205
  /** ISO 8601 datetime when the cancellation was requested. */
2193
- canceledAt: string;
2206
+ canceledAt?: string;
2194
2207
  /** The reason for cancellation, if provided. */
2195
2208
  cancelReason: string | null;
2196
2209
  /** ISO 8601 datetime when the cancellation will execute (the billing period end). subscription.canceled fires at this moment. */
@@ -2205,7 +2218,7 @@ interface SubscriptionCancellationRevokedData {
2205
2218
  /** Current status — typically "active". The scheduled cancellation no longer applies. */
2206
2219
  status: string;
2207
2220
  /** ISO 8601 end of the current billing period, which continues normally. */
2208
- currentPeriodEnd: string | null;
2221
+ currentPeriodEnd?: string;
2209
2222
  }
2210
2223
  /** Fired when a plan change (downgrade or shorter interval) is scheduled for the end of the billing period. The subscription stays on the current plan until effectiveAt, when subscription.plan_changed fires. */
2211
2224
  interface SubscriptionPlanChangeScheduledData {
@@ -2344,7 +2357,7 @@ interface CheckoutReadyData {
2344
2357
  /** The hosted checkout URL to share with the customer. */
2345
2358
  checkoutUrl: string;
2346
2359
  }
2347
- /** Fired when a recurring payment is successfully processed. This event is for recurring charges only the first checkout payment triggers subscription.activated instead. */
2360
+ /** Fired every time a payment settles successfully the first payment and every renewal alike. subscription.activated fires alongside it only on the first one. */
2348
2361
  interface PaymentReceivedData {
2349
2362
  /** The invoice ID. */
2350
2363
  invoiceId: string;
@@ -2355,34 +2368,38 @@ interface PaymentReceivedData {
2355
2368
  /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
2356
2369
  customerId: string;
2357
2370
  /** The subscription ID. */
2358
- subscriptionId: string;
2371
+ subscriptionId: string | null;
2359
2372
  /** The payment transaction ID. */
2360
- paymentTransactionId: string;
2373
+ paymentTransactionId: string | null;
2374
+ /** The payment provider the charge was routed to: stripe, commet, or dlocal. Null for billing-only charges with no Commet ledger row. */
2375
+ provider: PaymentProvider | null;
2361
2376
  /** Gross amount in cents before fees. */
2362
- grossAmount: number;
2377
+ grossAmount: number | null;
2363
2378
  /** The payment currency code. */
2364
- currency: string;
2379
+ currency: string | null;
2365
2380
  /** Net amount after fees in cents. */
2366
- orgNetAmount: number;
2381
+ orgNetAmount: number | null;
2367
2382
  /** The customer email used for this payment. */
2368
2383
  customerEmail: string | null;
2369
2384
  /** ISO 8601 datetime when the payment was received. */
2370
- paidAt: string | null;
2385
+ paidAt?: string;
2371
2386
  }
2372
2387
  /** Fired when a recurring charge fails. This event is for recurring charge failures only — card declines during initial checkout do not trigger this event. */
2373
2388
  interface PaymentFailedData {
2374
2389
  /** The invoice ID, if available. */
2375
- invoiceId: string | null;
2390
+ invoiceId: string;
2376
2391
  /** The human-readable invoice number, if available. */
2377
- invoiceNumber: string | null;
2392
+ invoiceNumber: string;
2378
2393
  /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
2379
2394
  customerId: string;
2380
2395
  /** The subscription ID, if the invoice is linked to a subscription. */
2381
2396
  subscriptionId: string | null;
2382
2397
  /** The failure code from the payment processor. */
2383
- failureCode: string | null;
2398
+ failureCode: string;
2384
2399
  /** A human-readable failure message. */
2385
- failureMessage: string | null;
2400
+ failureMessage: string;
2401
+ /** A ready-to-use link the customer can follow to retry this payment, or null when no recovery path applies. For a first failed charge (pending_payment) it is the checkout URL; for a failed renewal (past_due) it is a signed recovery link — no separate createRecoveryLink call needed. */
2402
+ recoveryUrl: string | null;
2386
2403
  }
2387
2404
  /** Fired when an outstanding invoice that previously failed is successfully paid — automatically on retry or by the customer through the portal. The subscription returns to active at the same time; use this event to close the dunning flow you opened on payment.failed. */
2388
2405
  interface PaymentRecoveredData {
@@ -2397,7 +2414,7 @@ interface PaymentRecoveredData {
2397
2414
  /** The subscription ID, if the invoice is linked to a subscription. */
2398
2415
  subscriptionId: string | null;
2399
2416
  }
2400
- /** Fired after all dunning retries are exhausted and the subscription is canceled. Use it to close the recovery loop opened by payment.failed. */
2417
+ /** Fired when all dunning retries are exhausted and the subscription is canceled. This is the terminal event of the dunning flow payment.recovered will not follow. Revoke access when you receive this. */
2401
2418
  interface PaymentRetryFailedData {
2402
2419
  /** The invoice whose retries were exhausted. */
2403
2420
  invoiceId: string;
@@ -2414,6 +2431,10 @@ interface PaymentRetryFailedData {
2414
2431
  interface PaymentRefundedData {
2415
2432
  /** The refunded payment transaction ID. */
2416
2433
  paymentTransactionId: string;
2434
+ /** The payment provider the charge was routed to: stripe, commet, or dlocal. */
2435
+ provider: PaymentProvider;
2436
+ /** The payment link the payment originated from, or null when the payment did not come from a payment link. */
2437
+ paymentLinkId: string | null;
2417
2438
  /** The invoice the payment collected, or null for payments without an invoice. */
2418
2439
  invoiceId: string | null;
2419
2440
  /** The human-readable invoice number, if available. */
@@ -2431,6 +2452,10 @@ interface PaymentRefundedData {
2431
2452
  interface PaymentDisputedData {
2432
2453
  /** The disputed payment transaction ID. */
2433
2454
  paymentTransactionId: string;
2455
+ /** The payment provider the charge was routed to: stripe, commet, or dlocal. */
2456
+ provider: PaymentProvider;
2457
+ /** The payment link the payment originated from, or null when the payment did not come from a payment link. */
2458
+ paymentLinkId: string | null;
2434
2459
  /** The invoice the payment collected, or null for payments without an invoice. */
2435
2460
  invoiceId: string | null;
2436
2461
  /** The human-readable invoice number, if available. */
@@ -2450,6 +2475,10 @@ interface PaymentDisputedData {
2450
2475
  interface PaymentDisputeResolvedData {
2451
2476
  /** The disputed payment transaction ID. */
2452
2477
  paymentTransactionId: string;
2478
+ /** The payment provider the charge was routed to: stripe, commet, or dlocal. */
2479
+ provider: PaymentProvider;
2480
+ /** The payment link the payment originated from, or null when the payment did not come from a payment link. */
2481
+ paymentLinkId: string | null;
2453
2482
  /** The invoice the payment collected, or null for payments without an invoice. */
2454
2483
  invoiceId: string | null;
2455
2484
  /** The human-readable invoice number, if available. */
@@ -2501,7 +2530,7 @@ interface PaymentLinkCompletedData {
2501
2530
  /** The human-readable invoice number. */
2502
2531
  invoiceNumber: string;
2503
2532
  /** The payment transaction ID for the settled charge. */
2504
- paymentTransactionId: string;
2533
+ paymentTransactionId: string | null;
2505
2534
  }
2506
2535
  /** Fired when a payment link charge attempt is declined. The link stays open and can be paid again — a failed link is retryable. */
2507
2536
  interface PaymentLinkFailedData {
@@ -2518,9 +2547,9 @@ interface PaymentLinkFailedData {
2518
2547
  /** The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
2519
2548
  customerId: string | null;
2520
2549
  /** The failure code from the payment processor. */
2521
- failureCode: string | null;
2550
+ failureCode: string;
2522
2551
  /** A human-readable failure message. */
2523
- failureMessage: string | null;
2552
+ failureMessage: string;
2524
2553
  }
2525
2554
  /** Fired when a pending payment link is canceled before being paid. A canceled link can no longer be paid. */
2526
2555
  interface PaymentLinkCanceledData {
@@ -2546,13 +2575,13 @@ interface InvoiceCreatedData {
2546
2575
  /** The invoice status (e.g. pending, paid). */
2547
2576
  invoiceStatus: string;
2548
2577
  /** ISO 8601 start of the billing period. */
2549
- periodStart: string | null;
2578
+ periodStart: string;
2550
2579
  /** ISO 8601 end of the billing period. */
2551
- periodEnd: string | null;
2580
+ periodEnd: string;
2552
2581
  /** ISO 8601 date the invoice was issued. */
2553
- issueDate: string | null;
2582
+ issueDate: string;
2554
2583
  /** ISO 8601 date the invoice is due. */
2555
- dueDate: string | null;
2584
+ dueDate: string;
2556
2585
  /** The invoice currency code. */
2557
2586
  currency: string;
2558
2587
  /** Subtotal in cents (100 = $1.00). */
@@ -2564,38 +2593,21 @@ interface InvoiceCreatedData {
2564
2593
  /** The subscription ID, if the invoice is linked to a subscription. */
2565
2594
  subscriptionId: string | null;
2566
2595
  }
2567
- /** Predictive event fired once, 3 days before an active subscription renews. Use it to notify the customer before they are charged. Carries no amount usage-based charges are only final at renewal, when invoice.created delivers the actual invoice. */
2568
- interface InvoiceUpcomingData {
2569
- /** The subscription ID. */
2570
- subscriptionId: string;
2571
- /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
2572
- customerId: string;
2573
- /** Always "active" for this event. */
2574
- status: string;
2575
- /** The plan ID. */
2576
- planId: string;
2577
- /** The plan name. */
2578
- planName: string;
2579
- /** The billing interval (monthly, yearly). */
2580
- billingInterval: string | null;
2581
- /** ISO 8601 datetime when the current period ends and the renewal invoice is issued. */
2582
- currentPeriodEnd: string;
2583
- }
2584
- /** Fired once when an outstanding invoice passes its due date without payment. The invoice keeps its outstanding status — overdue is a fact about the due date, not a new status. Use it to start your own dunning flow. */
2585
- interface InvoiceOverdueData {
2596
+ /** Fired when an invoice is voided nullified before collection, either manually or automatically when its subscription is canceled. Voiding is terminal: a void invoice is never retried or collected. */
2597
+ interface InvoiceVoidedData {
2586
2598
  /** The invoice ID. */
2587
2599
  invoiceId: string;
2588
2600
  /** The human-readable invoice number. */
2589
2601
  invoiceNumber: string;
2590
- /** Always "outstanding" for this event. */
2602
+ /** Always "void" for this event. */
2591
2603
  invoiceStatus: string;
2592
2604
  /** ISO 8601 start of the billing period. */
2593
- periodStart: string | null;
2605
+ periodStart: string;
2594
2606
  /** ISO 8601 end of the billing period. */
2595
- periodEnd: string | null;
2607
+ periodEnd: string;
2596
2608
  /** ISO 8601 date the invoice was issued. */
2597
- issueDate: string | null;
2598
- /** ISO 8601 date the invoice was due — now in the past. */
2609
+ issueDate: string;
2610
+ /** ISO 8601 date the invoice was due. */
2599
2611
  dueDate: string;
2600
2612
  /** The invoice currency code. */
2601
2613
  currency: string;
@@ -2608,22 +2620,22 @@ interface InvoiceOverdueData {
2608
2620
  /** The subscription ID, if the invoice is linked to a subscription. */
2609
2621
  subscriptionId: string | null;
2610
2622
  }
2611
- /** Fired when an invoice is voided nullified before collection, either manually or automatically when its subscription is canceled. Voiding is terminal: a void invoice is never retried or collected. */
2612
- interface InvoiceVoidedData {
2623
+ /** Fired once when an outstanding invoice passes its due date without payment. The invoice keeps its outstanding status overdue is a fact about the due date, not a new status. Use it to start your own dunning flow. */
2624
+ interface InvoiceOverdueData {
2613
2625
  /** The invoice ID. */
2614
2626
  invoiceId: string;
2615
2627
  /** The human-readable invoice number. */
2616
2628
  invoiceNumber: string;
2617
- /** Always "void" for this event. */
2629
+ /** Always "outstanding" for this event. */
2618
2630
  invoiceStatus: string;
2619
2631
  /** ISO 8601 start of the billing period. */
2620
- periodStart: string | null;
2632
+ periodStart: string;
2621
2633
  /** ISO 8601 end of the billing period. */
2622
- periodEnd: string | null;
2634
+ periodEnd: string;
2623
2635
  /** ISO 8601 date the invoice was issued. */
2624
- issueDate: string | null;
2625
- /** ISO 8601 date the invoice was due. */
2626
- dueDate: string | null;
2636
+ issueDate: string;
2637
+ /** ISO 8601 date the invoice was due — now in the past. */
2638
+ dueDate: string;
2627
2639
  /** The invoice currency code. */
2628
2640
  currency: string;
2629
2641
  /** Subtotal in cents (100 = $1.00). */
@@ -2635,6 +2647,23 @@ interface InvoiceVoidedData {
2635
2647
  /** The subscription ID, if the invoice is linked to a subscription. */
2636
2648
  subscriptionId: string | null;
2637
2649
  }
2650
+ /** Predictive event fired once, 3 days before an active subscription renews. Use it to notify the customer before they are charged. Carries no amount — usage-based charges are only final at renewal, when invoice.created delivers the actual invoice. */
2651
+ interface InvoiceUpcomingData {
2652
+ /** The subscription ID. */
2653
+ subscriptionId: string;
2654
+ /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
2655
+ customerId: string;
2656
+ /** Always "active" for this event. */
2657
+ status: string;
2658
+ /** The plan ID. */
2659
+ planId: string;
2660
+ /** The plan name. */
2661
+ planName: string;
2662
+ /** The billing interval (monthly, yearly). */
2663
+ billingInterval: string | null;
2664
+ /** ISO 8601 datetime when the current period ends and the renewal invoice is issued. */
2665
+ currentPeriodEnd: string;
2666
+ }
2638
2667
  /** Fired when Commet records a payment method for a subscription: after a paid checkout, when a trial starts with a card on file, or when a zero-total checkout completes. The card object carries display metadata only — full numbers never leave the payment provider. */
2639
2668
  interface PaymentMethodAttachedData {
2640
2669
  /** The subscription the payment method was saved for. */
@@ -2661,6 +2690,10 @@ interface CustomerCreatedData {
2661
2690
  fullName: string | null;
2662
2691
  /** The customer's email. */
2663
2692
  email: string;
2693
+ /** The customer's tax identification number, if provided. */
2694
+ taxDocument: string | null;
2695
+ /** The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided. */
2696
+ documentType: string | null;
2664
2697
  /** The customer's timezone. */
2665
2698
  timezone: string | null;
2666
2699
  /** Custom key-value metadata you attached to the customer. */
@@ -2680,6 +2713,10 @@ interface CustomerUpdatedData {
2680
2713
  fullName: string | null;
2681
2714
  /** The customer's email. */
2682
2715
  email: string;
2716
+ /** The customer's tax identification number, if provided. */
2717
+ taxDocument: string | null;
2718
+ /** The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided. */
2719
+ documentType: string | null;
2683
2720
  /** The customer's timezone. */
2684
2721
  timezone: string | null;
2685
2722
  /** Custom key-value metadata you attached to the customer. */
@@ -2695,7 +2732,7 @@ interface CustomerStateChangedData {
2695
2732
  customerId: string;
2696
2733
  /** What caused the transition. One of: subscription_created, subscription_activated, subscription_canceled, plan_change, past_due, trial_started, trial_converted, trial_expired, cancellation_scheduled, cancellation_revoked, seats_updated, addon_activated, addon_deactivated, credits_depleted, balance_depleted, quota_exceeded. */
2697
2734
  trigger: string;
2698
- /** The customer's current subscription status, or "none" when no live subscription exists. Grant access only when trialing or active. */
2735
+ /** The customer's current subscription status, or "none" when no live subscription exists. Access is granted while trialing, active, or past_due — past_due is a permissive grace window during dunning. */
2699
2736
  status: string;
2700
2737
  /** The live subscription ID, or null when status is none. */
2701
2738
  subscriptionId: string | null;
@@ -2842,21 +2879,6 @@ interface QuotaExceededData {
2842
2879
  /** ISO 8601 start of the usage period. */
2843
2880
  periodStart: string;
2844
2881
  }
2845
- /** Fired for every processed usage event. HIGH VOLUME: this fires once per tracked event, so it is excluded from family select-all in the dashboard — subscribe to it explicitly and make sure your endpoint can absorb your own ingest rate. */
2846
- interface UsageRecordedData {
2847
- /** The usage event ID. */
2848
- usageEventId: string;
2849
- /** The subscription ID. */
2850
- subscriptionId: string;
2851
- /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
2852
- customerId: string;
2853
- /** The feature code the usage was tracked against. */
2854
- featureCode: string;
2855
- /** The recorded quantity. For AI model events this is the total token count. */
2856
- value: number;
2857
- /** ISO 8601 timestamp of the usage event. */
2858
- ts: string;
2859
- }
2860
2882
  /** Fired when a customer's seat count changes for a seats-type feature — via the SDK seats endpoints or the dashboard. Also fires customer.state_changed with trigger seats_updated. */
2861
2883
  interface SeatsUpdatedData {
2862
2884
  /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
@@ -2909,6 +2931,21 @@ interface AddonDeactivatedData {
2909
2931
  /** The feature the add-on unlocked or extended. */
2910
2932
  featureCode: string;
2911
2933
  }
2934
+ /** Fired for every processed usage event. HIGH VOLUME: this fires once per tracked event, so it is excluded from family select-all in the dashboard — subscribe to it explicitly and make sure your endpoint can absorb your own ingest rate. */
2935
+ interface UsageRecordedData {
2936
+ /** The subscription ID. */
2937
+ subscriptionId: string;
2938
+ /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
2939
+ customerId: string;
2940
+ /** The usage event ID. */
2941
+ usageEventId: string;
2942
+ /** The feature code the usage was tracked against. */
2943
+ featureCode: string;
2944
+ /** The recorded quantity. For AI model events this is the total token count. */
2945
+ value: number;
2946
+ /** ISO 8601 timestamp of the usage event. */
2947
+ ts: string;
2948
+ }
2912
2949
  /** Organization-level event about YOUR money as the merchant. Fired when payment funds the provider was holding become available to pay out to your bank. */
2913
2950
  interface PayoutAvailableData {
2914
2951
  /** Your full available payout balance in cents (100 = $1.00) at the time of the event — not just the newly released funds. */
@@ -2986,7 +3023,7 @@ interface WebhookEventEnvelope<E extends WebhookEvent, D> {
2986
3023
  apiVersion: string;
2987
3024
  data: D;
2988
3025
  }
2989
- type WebhookEventPayload = WebhookEventEnvelope<"subscription.created", SubscriptionCreatedData> | WebhookEventEnvelope<"subscription.activated", SubscriptionActivatedData> | WebhookEventEnvelope<"subscription.reactivated", SubscriptionReactivatedData> | WebhookEventEnvelope<"subscription.canceled", SubscriptionCanceledData> | WebhookEventEnvelope<"subscription.updated", SubscriptionUpdatedData> | WebhookEventEnvelope<"subscription.plan_changed", SubscriptionPlanChangedData> | WebhookEventEnvelope<"subscription.cancellation_scheduled", SubscriptionCancellationScheduledData> | WebhookEventEnvelope<"subscription.cancellation_revoked", SubscriptionCancellationRevokedData> | WebhookEventEnvelope<"subscription.plan_change_scheduled", SubscriptionPlanChangeScheduledData> | WebhookEventEnvelope<"subscription.plan_change_revoked", SubscriptionPlanChangeRevokedData> | WebhookEventEnvelope<"subscription.past_due", SubscriptionPastDueData> | WebhookEventEnvelope<"trial.started", TrialStartedData> | WebhookEventEnvelope<"trial.converted", TrialConvertedData> | WebhookEventEnvelope<"trial.expired", TrialExpiredData> | WebhookEventEnvelope<"trial.will_end", TrialWillEndData> | WebhookEventEnvelope<"trial.checkout_ready", TrialCheckoutReadyData> | WebhookEventEnvelope<"checkout.ready", CheckoutReadyData> | WebhookEventEnvelope<"payment.received", PaymentReceivedData> | WebhookEventEnvelope<"payment.failed", PaymentFailedData> | WebhookEventEnvelope<"payment.recovered", PaymentRecoveredData> | WebhookEventEnvelope<"payment.retry_failed", PaymentRetryFailedData> | WebhookEventEnvelope<"payment.refunded", PaymentRefundedData> | WebhookEventEnvelope<"payment.disputed", PaymentDisputedData> | WebhookEventEnvelope<"payment.dispute_resolved", PaymentDisputeResolvedData> | WebhookEventEnvelope<"payment_link.created", PaymentLinkCreatedData> | WebhookEventEnvelope<"payment_link.completed", PaymentLinkCompletedData> | WebhookEventEnvelope<"payment_link.failed", PaymentLinkFailedData> | WebhookEventEnvelope<"payment_link.canceled", PaymentLinkCanceledData> | WebhookEventEnvelope<"invoice.created", InvoiceCreatedData> | WebhookEventEnvelope<"invoice.upcoming", InvoiceUpcomingData> | WebhookEventEnvelope<"invoice.overdue", InvoiceOverdueData> | WebhookEventEnvelope<"invoice.voided", InvoiceVoidedData> | WebhookEventEnvelope<"payment_method.attached", PaymentMethodAttachedData> | WebhookEventEnvelope<"payment_method.updated", PaymentMethodUpdatedData> | WebhookEventEnvelope<"customer.created", CustomerCreatedData> | WebhookEventEnvelope<"customer.updated", CustomerUpdatedData> | WebhookEventEnvelope<"customer.state_changed", CustomerStateChangedData> | WebhookEventEnvelope<"credits.granted", CreditsGrantedData> | WebhookEventEnvelope<"credits.purchased", CreditsPurchasedData> | WebhookEventEnvelope<"credits.low", CreditsLowData> | WebhookEventEnvelope<"credits.depleted", CreditsDepletedData> | WebhookEventEnvelope<"credits.expired", CreditsExpiredData> | WebhookEventEnvelope<"balance.topped_up", BalanceToppedUpData> | WebhookEventEnvelope<"balance.low", BalanceLowData> | WebhookEventEnvelope<"balance.depleted", BalanceDepletedData> | WebhookEventEnvelope<"quota.threshold_reached", QuotaThresholdReachedData> | WebhookEventEnvelope<"quota.exceeded", QuotaExceededData> | WebhookEventEnvelope<"usage.recorded", UsageRecordedData> | WebhookEventEnvelope<"seats.updated", SeatsUpdatedData> | WebhookEventEnvelope<"seats.limit_reached", SeatsLimitReachedData> | WebhookEventEnvelope<"addon.activated", AddonActivatedData> | WebhookEventEnvelope<"addon.deactivated", AddonDeactivatedData> | WebhookEventEnvelope<"payout.available", PayoutAvailableData> | WebhookEventEnvelope<"payout.created", PayoutCreatedData> | WebhookEventEnvelope<"payout.paid", PayoutPaidData> | WebhookEventEnvelope<"payout.failed", PayoutFailedData>;
3026
+ type WebhookEventPayload = WebhookEventEnvelope<"subscription.created", SubscriptionCreatedData> | WebhookEventEnvelope<"subscription.activated", SubscriptionActivatedData> | WebhookEventEnvelope<"subscription.reactivated", SubscriptionReactivatedData> | WebhookEventEnvelope<"subscription.canceled", SubscriptionCanceledData> | WebhookEventEnvelope<"subscription.updated", SubscriptionUpdatedData> | WebhookEventEnvelope<"subscription.plan_changed", SubscriptionPlanChangedData> | WebhookEventEnvelope<"subscription.cancellation_scheduled", SubscriptionCancellationScheduledData> | WebhookEventEnvelope<"subscription.cancellation_revoked", SubscriptionCancellationRevokedData> | WebhookEventEnvelope<"subscription.plan_change_scheduled", SubscriptionPlanChangeScheduledData> | WebhookEventEnvelope<"subscription.plan_change_revoked", SubscriptionPlanChangeRevokedData> | WebhookEventEnvelope<"subscription.past_due", SubscriptionPastDueData> | WebhookEventEnvelope<"trial.started", TrialStartedData> | WebhookEventEnvelope<"trial.converted", TrialConvertedData> | WebhookEventEnvelope<"trial.expired", TrialExpiredData> | WebhookEventEnvelope<"trial.will_end", TrialWillEndData> | WebhookEventEnvelope<"trial.checkout_ready", TrialCheckoutReadyData> | WebhookEventEnvelope<"checkout.ready", CheckoutReadyData> | WebhookEventEnvelope<"payment.received", PaymentReceivedData> | WebhookEventEnvelope<"payment.failed", PaymentFailedData> | WebhookEventEnvelope<"payment.recovered", PaymentRecoveredData> | WebhookEventEnvelope<"payment.retry_failed", PaymentRetryFailedData> | WebhookEventEnvelope<"payment.refunded", PaymentRefundedData> | WebhookEventEnvelope<"payment.disputed", PaymentDisputedData> | WebhookEventEnvelope<"payment.dispute_resolved", PaymentDisputeResolvedData> | WebhookEventEnvelope<"payment_link.created", PaymentLinkCreatedData> | WebhookEventEnvelope<"payment_link.completed", PaymentLinkCompletedData> | WebhookEventEnvelope<"payment_link.failed", PaymentLinkFailedData> | WebhookEventEnvelope<"payment_link.canceled", PaymentLinkCanceledData> | WebhookEventEnvelope<"invoice.created", InvoiceCreatedData> | WebhookEventEnvelope<"invoice.voided", InvoiceVoidedData> | WebhookEventEnvelope<"invoice.overdue", InvoiceOverdueData> | WebhookEventEnvelope<"invoice.upcoming", InvoiceUpcomingData> | WebhookEventEnvelope<"payment_method.attached", PaymentMethodAttachedData> | WebhookEventEnvelope<"payment_method.updated", PaymentMethodUpdatedData> | WebhookEventEnvelope<"customer.created", CustomerCreatedData> | WebhookEventEnvelope<"customer.updated", CustomerUpdatedData> | WebhookEventEnvelope<"customer.state_changed", CustomerStateChangedData> | WebhookEventEnvelope<"credits.granted", CreditsGrantedData> | WebhookEventEnvelope<"credits.purchased", CreditsPurchasedData> | WebhookEventEnvelope<"credits.low", CreditsLowData> | WebhookEventEnvelope<"credits.depleted", CreditsDepletedData> | WebhookEventEnvelope<"credits.expired", CreditsExpiredData> | WebhookEventEnvelope<"balance.topped_up", BalanceToppedUpData> | WebhookEventEnvelope<"balance.low", BalanceLowData> | WebhookEventEnvelope<"balance.depleted", BalanceDepletedData> | WebhookEventEnvelope<"quota.threshold_reached", QuotaThresholdReachedData> | WebhookEventEnvelope<"quota.exceeded", QuotaExceededData> | WebhookEventEnvelope<"seats.updated", SeatsUpdatedData> | WebhookEventEnvelope<"seats.limit_reached", SeatsLimitReachedData> | WebhookEventEnvelope<"addon.activated", AddonActivatedData> | WebhookEventEnvelope<"addon.deactivated", AddonDeactivatedData> | WebhookEventEnvelope<"usage.recorded", UsageRecordedData> | WebhookEventEnvelope<"payout.available", PayoutAvailableData> | WebhookEventEnvelope<"payout.created", PayoutCreatedData> | WebhookEventEnvelope<"payout.paid", PayoutPaidData> | WebhookEventEnvelope<"payout.failed", PayoutFailedData>;
2990
3027
  interface WebhookEventDataMap {
2991
3028
  "subscription.created": SubscriptionCreatedData;
2992
3029
  "subscription.activated": SubscriptionActivatedData;
@@ -3017,9 +3054,9 @@ interface WebhookEventDataMap {
3017
3054
  "payment_link.failed": PaymentLinkFailedData;
3018
3055
  "payment_link.canceled": PaymentLinkCanceledData;
3019
3056
  "invoice.created": InvoiceCreatedData;
3020
- "invoice.upcoming": InvoiceUpcomingData;
3021
- "invoice.overdue": InvoiceOverdueData;
3022
3057
  "invoice.voided": InvoiceVoidedData;
3058
+ "invoice.overdue": InvoiceOverdueData;
3059
+ "invoice.upcoming": InvoiceUpcomingData;
3023
3060
  "payment_method.attached": PaymentMethodAttachedData;
3024
3061
  "payment_method.updated": PaymentMethodUpdatedData;
3025
3062
  "customer.created": CustomerCreatedData;
@@ -3035,11 +3072,11 @@ interface WebhookEventDataMap {
3035
3072
  "balance.depleted": BalanceDepletedData;
3036
3073
  "quota.threshold_reached": QuotaThresholdReachedData;
3037
3074
  "quota.exceeded": QuotaExceededData;
3038
- "usage.recorded": UsageRecordedData;
3039
3075
  "seats.updated": SeatsUpdatedData;
3040
3076
  "seats.limit_reached": SeatsLimitReachedData;
3041
3077
  "addon.activated": AddonActivatedData;
3042
3078
  "addon.deactivated": AddonDeactivatedData;
3079
+ "usage.recorded": UsageRecordedData;
3043
3080
  "payout.available": PayoutAvailableData;
3044
3081
  "payout.created": PayoutCreatedData;
3045
3082
  "payout.paid": PayoutPaidData;
@@ -3167,7 +3204,7 @@ declare function createCommet<const TConfig extends BillingConfig>(_billingConfi
3167
3204
 
3168
3205
  declare function registerIntegration(name: string, version: string): void;
3169
3206
 
3170
- declare const API_VERSION = "2026-06-10";
3207
+ declare const API_VERSION = "2026-06-23";
3171
3208
  declare const SDK_VERSION: string;
3172
3209
 
3173
- 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 ApiResponse, type BalanceAdjustment, type BalanceDepletedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelPaymentParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type ChargePaymentParams, type CheckUsageParams, type CheckoutReadyData, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePaymentParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Currency, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerID, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DefaultPlanPrice, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookParams, type DeletedObject, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DiscountType, type DownloadInvoiceParams, type EventID, type Feature, type FeatureAccess, type FeatureDef, type FeatureLookup, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceOverdueData, type InvoiceStatus, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListPaymentsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type PaginatedList, type PaginatedResponse, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethodAttachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type PayoutVerification, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGroup, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PlanVisibility, type PortalAccess, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type RetryTransactionParams, SDK_VERSION, type SeatBalance, type SeatBalanceListItem, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionPastDueData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionStatus, type SubscriptionUpdatedData, type TestClock, type TestClockBilling, type TestWebhookParams, type Timezone, type TopupBalanceParams, type TrackModelTokensParams, type TrackParams, type TrackUsageParams, type Transaction, type TransactionRefund, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UncanceledSubscription, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateWebhookParams, type UpsertRegionalPricesParams, type UsageCheckDenialReason, type UsageCheckResult, type UsageEvent, type UsageEventProperty, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookFeatureAccess, type WebhookPayload, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
3210
+ 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 ApiResponse, type BalanceAdjustment, type BalanceDepletedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSeatUpdate, type BulkSetSeatsParams, type CanUseFeatureParams, type CancelPaymentParams, type CancelSubscriptionParams, type CanceledSubscription, type ChangePlanParams, type ChargePaymentParams, type CheckUsageParams, type CheckoutReadyData, Commet, CommetAPIError, type CommetClientOptions, CommetError, CommetValidationError, type CompletePayoutVerificationParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerParams, type CreateFeatureParams, type CreatePaymentParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookParams, type CreatedApiKey, type CreatedInvoice, type CreditGrant, type CreditPack, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Currency, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerID, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DefaultPlanPrice, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookParams, type DeletedObject, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DiscountType, type DownloadInvoiceParams, type EventID, type Feature, type FeatureAccess, type FeatureDef, type FeatureLookup, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceOverdueData, type InvoiceStatus, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListPaymentsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhooksParams, type PaginatedList, type PaginatedResponse, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, 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 PayoutVerification, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGroup, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PlanVisibility, type PortalAccess, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type RetryTransactionParams, SDK_VERSION, type SeatBalance, type SeatBalanceListItem, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionPastDueData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionStatus, type SubscriptionUpdatedData, type TestClock, type TestClockBilling, type TestWebhookParams, type Timezone, type TopupBalanceParams, type TrackModelTokensParams, type TrackParams, type TrackUsageParams, type Transaction, type TransactionRefund, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UncanceledSubscription, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateWebhookParams, type UpsertRegionalPricesParams, type UsageCheckDenialReason, type UsageCheckResult, type UsageEvent, type UsageEventProperty, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEndpoint, type WebhookEndpointCreated, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookFeatureAccess, type WebhookPayload, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTestResult, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };