@commet/node 9.9.0 → 9.11.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 (61) hide show
  1. package/dist/index.d.mts +932 -59
  2. package/dist/index.d.ts +932 -59
  3. package/dist/index.js +209 -13
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +209 -13
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/ai-onboarding/mcp-server.md +2 -0
  8. package/docs/api-reference/addons.md +3 -1
  9. package/docs/api-reference/credit-packs.md +3 -1
  10. package/docs/api-reference/customers.md +3 -3
  11. package/docs/api-reference/generated-webhooks.md +2 -2
  12. package/docs/api-reference/index.md +3 -3
  13. package/docs/api-reference/invoices.md +4 -3
  14. package/docs/api-reference/plans.md +487 -6
  15. package/docs/api-reference/subscriptions.md +45 -4
  16. package/docs/api-reference/transactions.md +2 -1
  17. package/docs/documentation/api-versioning.md +8 -2
  18. package/docs/documentation/cli.md +4 -0
  19. package/docs/documentation/customers/customer-portal.md +2 -2
  20. package/docs/documentation/invoicing/manage-invoices.md +1 -1
  21. package/docs/documentation/plans/add-ons.md +16 -5
  22. package/docs/documentation/plans/balance-and-top-ups.md +1 -1
  23. package/docs/documentation/plans/consumption-models.md +23 -3
  24. package/docs/documentation/plans/create-plans.md +5 -1
  25. package/docs/documentation/plans/credit-packs.md +22 -10
  26. package/docs/documentation/plans/plan-groups.md +1 -1
  27. package/docs/documentation/plans/plan-versions.md +267 -0
  28. package/docs/documentation/sales/regional-prices.md +23 -9
  29. package/docs/documentation/sales/trial-periods.md +3 -3
  30. package/docs/documentation/subscriptions/manage-subscriptions.md +50 -13
  31. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +2 -0
  32. package/docs/errors/addon_has_activations.md +2 -2
  33. package/docs/errors/addon_unavailable.md +22 -0
  34. package/docs/errors/credit_pack_unavailable.md +22 -0
  35. package/docs/errors/currency_held_by_balance_plan.md +22 -0
  36. package/docs/errors/currency_held_by_customer_credit.md +22 -0
  37. package/docs/errors/currency_held_by_fixed_amount_discount.md +22 -0
  38. package/docs/errors/currency_held_by_payment_method.md +22 -0
  39. package/docs/errors/currency_held_by_prepaid_period.md +22 -0
  40. package/docs/errors/currency_held_by_scheduled_pause.md +22 -0
  41. package/docs/errors/index.md +14 -2
  42. package/docs/errors/missing_regional_price.md +3 -3
  43. package/docs/errors/plan_experiment_not_found.md +22 -0
  44. package/docs/errors/plan_version_not_found.md +22 -0
  45. package/docs/errors/subscribers_do_not_fit.md +22 -0
  46. package/docs/errors/version_not_newer.md +22 -0
  47. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +4 -3
  48. package/docs/knowledge-base/how-do-trial-periods-work.md +3 -3
  49. package/docs/knowledge-base/how-does-billing-work.md +26 -28
  50. package/docs/knowledge-base/how-does-quota-based-billing-work.md +12 -22
  51. package/docs/knowledge-base/how-does-seat-based-billing-work.md +12 -22
  52. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +11 -8
  53. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +34 -29
  54. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -1
  55. package/docs/manifest.json +227 -2
  56. package/docs/platform-documentation.md +1 -0
  57. package/docs/schemas.md +128 -13
  58. package/docs/webhooks/introduction.md +3 -1
  59. package/docs/webhooks.md +27 -2
  60. package/docs/webhooks.openapi.json +231 -1
  61. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -168,6 +168,8 @@ interface Addon {
168
168
  includedUnits: number | null;
169
169
  overageRate: number | null;
170
170
  creditCost: number | null;
171
+ /** Plans that sell the add-on. */
172
+ planIds: Array<string>;
171
173
  object: "addon";
172
174
  livemode: boolean;
173
175
  }
@@ -191,6 +193,8 @@ interface BalanceAdjustment {
191
193
  }
192
194
  interface BalanceTopup {
193
195
  amount: number;
196
+ /** `succeeded` when the payment was confirmed and the balance was added. `processing` when the payment method confirms later: the balance is added once the payment is confirmed, and nothing is added if it is declined. */
197
+ status: "succeeded" | "processing";
194
198
  object: "balance_topup";
195
199
  livemode: boolean;
196
200
  }
@@ -265,6 +269,13 @@ interface CreatedSubscription {
265
269
  createdAt: string;
266
270
  /** @format date-time */
267
271
  updatedAt: string;
272
+ /** The plan version whose terms the subscription has now. It keeps paying and receiving everything from this version until it is moved. */
273
+ planVersion: {
274
+ /** Public plan version ID. */
275
+ id: string;
276
+ /** Main versions are 1, 2, 3; an experiment's versions carry its own code, like price-test 2. */
277
+ label: string;
278
+ } | null;
268
279
  offerApplications: Array<SubscriptionOfferApplication>;
269
280
  pause: {
270
281
  status: "scheduled";
@@ -304,6 +315,8 @@ interface CreatedWebhook {
304
315
  }
305
316
  interface CreditGrant {
306
317
  credits: number;
318
+ /** `succeeded` when the payment was confirmed and the credits were added. `processing` when the payment method confirms later: the credits are added once the payment is confirmed, and nothing is added if it is declined. */
319
+ status: "succeeded" | "processing";
307
320
  object: "credit_grant";
308
321
  livemode: boolean;
309
322
  }
@@ -313,6 +326,8 @@ interface CreditPack {
313
326
  description: string | null;
314
327
  credits: number;
315
328
  price: number;
329
+ /** Plans that sell the credit pack. */
330
+ planIds: Array<string>;
316
331
  isActive: boolean;
317
332
  /** @format date-time */
318
333
  createdAt: string;
@@ -327,6 +342,8 @@ interface CreditPackListItem {
327
342
  description: string | null;
328
343
  credits: number;
329
344
  price: number;
345
+ /** Plans that sell the credit pack. */
346
+ planIds: Array<string>;
330
347
  currency: string;
331
348
  object: "credit_pack";
332
349
  livemode: boolean;
@@ -363,6 +380,7 @@ interface CustomerBatch {
363
380
  email: string;
364
381
  fullName?: string | null;
365
382
  taxDocument?: string | null;
383
+ businessTaxId?: string;
366
384
  timezone?: string;
367
385
  metadata?: Record<string, unknown> | null;
368
386
  address?: {
@@ -529,8 +547,10 @@ type FeatureAccess = {
529
547
  creditsPerUnit: number;
530
548
  /** Actual credits deducted by this feature during the period. */
531
549
  creditsConsumed: number;
532
- /** Additional product units available from the current shared credit pool at this feature's conversion rate. */
533
- availableUnits: number;
550
+ /** Whether the plan credits are unlimited: usage never spends them and only the plan credit limit caps it. */
551
+ unlimited: boolean;
552
+ /** Additional product units available from the current shared credit pool at this feature's conversion rate. Absent when unlimited is true. */
553
+ availableUnits?: number;
534
554
  } | {
535
555
  /** Product usage deducts money from a shared balance. */
536
556
  model: "balance";
@@ -556,7 +576,9 @@ type FeatureAccess = {
556
576
  /** Lowercase ISO 4217 currency code. */
557
577
  currency: string;
558
578
  };
559
- /** Estimated additional units available from the current shared balance at this feature's fixed price. Absent for dynamic pricing. */
579
+ /** Whether the plan balance is unlimited: usage never spends it and only the plan balance limit caps it. */
580
+ unlimited: boolean;
581
+ /** Estimated additional units available from the current shared balance at this feature's fixed price. Absent for dynamic pricing and when unlimited is true. */
560
582
  availableUnits?: number;
561
583
  /** Price for one additional product unit. */
562
584
  unitPrice?: {
@@ -769,6 +791,12 @@ interface InvoiceListItem {
769
791
  object: "invoice";
770
792
  livemode: boolean;
771
793
  }
794
+ interface KeptOnVersion {
795
+ subscriptionId: string;
796
+ keptOnVersion: true;
797
+ object: "kept_on_version";
798
+ livemode: boolean;
799
+ }
772
800
  type ManagedBy = "dub" | null;
773
801
  interface Market {
774
802
  id: string;
@@ -917,6 +945,8 @@ interface Plan {
917
945
  /** The most plan credits a subscription holds after a reset, including the credits that reset grants; credits above it expire. At least the included credits of every price. null means no limit other than the largest storable balance, 2,147,483,647 plan credits. */
918
946
  maxPlanCredits: number | null;
919
947
  } | null;
948
+ /** Credits plans only; null for other consumption models. true when the plan credits are unlimited: usage never spends them and only planCreditLimit caps it. */
949
+ unlimitedPlanCredits: boolean | null;
920
950
  /** Credits plans only. The most plan credits a subscription spends per day or per week; null means no limit. */
921
951
  planCreditLimit: {
922
952
  /** The most plan credits a subscription spends in one window. */
@@ -932,6 +962,8 @@ interface Plan {
932
962
  /** The most plan balance a subscription holds after a reset, in USD cents, including the balance that reset grants; balance above it expires. At least the included balance of every price. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. null means no limit other than the largest storable amount, 2,147,483,647 cents. */
933
963
  maxPlanBalance: number | null;
934
964
  } | null;
965
+ /** Balance plans only; null for other consumption models. true when the plan balance is unlimited: usage never spends it and only planBalanceLimit caps it. */
966
+ unlimitedPlanBalance: boolean | null;
935
967
  /** Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; null means no limit. */
936
968
  planBalanceLimit: {
937
969
  /** The most plan balance a subscription spends in one window, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. */
@@ -1003,6 +1035,36 @@ interface Plan {
1003
1035
  currency: string;
1004
1036
  exchangeRate: number;
1005
1037
  }>;
1038
+ /** Countries with their own currency or prices in the current version. Buyers from any other country pay the USD prices. */
1039
+ countries: Array<{
1040
+ /** ISO country code. */
1041
+ country: string;
1042
+ /** The currency buyers from the country pay, USD included. */
1043
+ currency: string;
1044
+ prices: Array<{
1045
+ billingInterval: BillingInterval;
1046
+ /** The country's price in the currency's minor unit. */
1047
+ price: number;
1048
+ /** True when set by hand; false when it follows the USD base at the exchange rate. */
1049
+ manual: boolean;
1050
+ }>;
1051
+ /** Every add-on the version sells, priced for the country. */
1052
+ addons: Array<{
1053
+ addonId: string;
1054
+ /** What buyers from the country pay for the add-on, in the currency's minor unit. */
1055
+ price: number;
1056
+ /** True when set by hand; false when it follows the add-on's USD price at the exchange rate. */
1057
+ manual: boolean;
1058
+ }>;
1059
+ /** Every credit pack the version sells, priced for the country. */
1060
+ creditPacks: Array<{
1061
+ creditPackId: string;
1062
+ /** What buyers from the country pay for the pack, in the currency's minor unit. */
1063
+ price: number;
1064
+ /** True when set by hand; false when it follows the pack's USD price at the exchange rate. */
1065
+ manual: boolean;
1066
+ }>;
1067
+ }>;
1006
1068
  object: "plan";
1007
1069
  livemode: boolean;
1008
1070
  }
@@ -1166,6 +1228,136 @@ type PlanChange = {
1166
1228
  object: "plan_change";
1167
1229
  livemode: boolean;
1168
1230
  };
1231
+ interface PlanDraft {
1232
+ /** Public plan draft ID. */
1233
+ id: string;
1234
+ /** The version the draft started from. */
1235
+ fromVersionId: string;
1236
+ /** What the draft changes against the version it started from. */
1237
+ changes: Array<{
1238
+ /** Identifies the change; send it to undo just this change. */
1239
+ key: string;
1240
+ /** Where the change is: Price, Trial, a rules section, Add-ons, or a country. */
1241
+ section: string;
1242
+ /** ISO country code when the change belongs to one country. */
1243
+ country: string | null;
1244
+ /** What changed, such as Monthly price. */
1245
+ label: string;
1246
+ /** The value before, formatted. */
1247
+ before: string | null;
1248
+ /** The value now, formatted. */
1249
+ after: string | null;
1250
+ }>;
1251
+ /** @format date-time */
1252
+ createdAt: string;
1253
+ /** @format date-time */
1254
+ updatedAt: string;
1255
+ object: "plan_draft";
1256
+ livemode: boolean;
1257
+ }
1258
+ interface PlanDraftPublication {
1259
+ preview: boolean;
1260
+ /** The published version. Null for a preview. */
1261
+ version: {
1262
+ /** Public plan version ID. */
1263
+ id: string;
1264
+ /** The plan's versions are numbered 1, 2, 3; an experiment's own versions read with its code, such as price-test 2. */
1265
+ label: string;
1266
+ /** The plan's version number. Null for a version that only belongs to an experiment; an experiment version made current takes the next number. */
1267
+ number: number | null;
1268
+ /** The experiment this version belongs to, if any. */
1269
+ experiment: {
1270
+ /** The experiment's code, as sold with planCode. */
1271
+ code: string;
1272
+ /** Its number within the experiment. */
1273
+ version: number;
1274
+ } | null;
1275
+ /** Whether new buyers get this version. */
1276
+ isCurrent: boolean;
1277
+ /** The version this one was created from. */
1278
+ parentVersionId: string | null;
1279
+ /** Active, trialing, past due and paused subscriptions on it. */
1280
+ subscriptionCount: number;
1281
+ maxPlanCredits: number | null;
1282
+ maxPlanBalance: number | null;
1283
+ prices: Array<{
1284
+ /** Public plan price ID. */
1285
+ id: string;
1286
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
1287
+ price: number;
1288
+ includedCredits: number | null;
1289
+ includedBalance: number | null;
1290
+ regionalPrices: Array<{
1291
+ currency: string;
1292
+ price: number;
1293
+ includedBalance: number | null;
1294
+ }>;
1295
+ }>;
1296
+ /** @format date-time */
1297
+ createdAt: string;
1298
+ } | null;
1299
+ /** The move of subscribers, if any. */
1300
+ moveId: string | null;
1301
+ subscribers: {
1302
+ moving: number;
1303
+ keptOnVersion: number;
1304
+ /** Left on their version because no change makes them fit; they show among the subscribers that need a change. */
1305
+ needsAChange: number;
1306
+ leftOut: Array<{
1307
+ subscriptionId: string;
1308
+ code: string;
1309
+ message: string;
1310
+ }>;
1311
+ } | null;
1312
+ object: "plan_draft_publication";
1313
+ livemode: boolean;
1314
+ }
1315
+ interface PlanExperiment {
1316
+ /** Public plan experiment ID. */
1317
+ id: string;
1318
+ /** The code to sell it with as planCode, such as pro:price-test. It always sells the experiment's latest version while running, and the plan's current version once closed. */
1319
+ code: string;
1320
+ /** running sells its latest version; won became the plan's current version; archived stopped selling. */
1321
+ status: "running" | "won" | "archived";
1322
+ /** The plan's version that was current when it started. */
1323
+ startedFromVersionId: string;
1324
+ /** Its latest version. */
1325
+ latestVersionId: string;
1326
+ /** The version its code sells to new buyers today. */
1327
+ sellsVersionId: string;
1328
+ /** Active, trialing, past due and paused subscriptions on its versions. */
1329
+ subscriptionCount: number;
1330
+ /** @format date-time */
1331
+ createdAt: string;
1332
+ closedAt: string | null;
1333
+ object: "plan_experiment";
1334
+ livemode: boolean;
1335
+ }
1336
+ interface PlanExperimentArchive {
1337
+ experiment: {
1338
+ /** Public plan experiment ID. */
1339
+ id: string;
1340
+ /** The code to sell it with as planCode, such as pro:price-test. It always sells the experiment's latest version while running, and the plan's current version once closed. */
1341
+ code: string;
1342
+ /** running sells its latest version; won became the plan's current version; archived stopped selling. */
1343
+ status: "running" | "won" | "archived";
1344
+ /** The plan's version that was current when it started. */
1345
+ startedFromVersionId: string;
1346
+ /** Its latest version. */
1347
+ latestVersionId: string;
1348
+ /** The version its code sells to new buyers today. */
1349
+ sellsVersionId: string;
1350
+ /** Active, trialing, past due and paused subscriptions on its versions. */
1351
+ subscriptionCount: number;
1352
+ /** @format date-time */
1353
+ createdAt: string;
1354
+ closedAt: string | null;
1355
+ };
1356
+ /** The move of its subscribers, or null when they stay. */
1357
+ moveId: string | null;
1358
+ object: "plan_experiment_archive";
1359
+ livemode: boolean;
1360
+ }
1169
1361
  interface PlanFeature {
1170
1362
  planId: string;
1171
1363
  featureId: string;
@@ -1247,6 +1439,37 @@ interface PlanGroupDetail {
1247
1439
  object: "plan_group";
1248
1440
  livemode: boolean;
1249
1441
  }
1442
+ interface PlanMove {
1443
+ /** Public move ID. Null for a preview, which records nothing. */
1444
+ id: string | null;
1445
+ toVersionId: string;
1446
+ /** The versions its subscribers are moving from. */
1447
+ fromVersionIds: Array<string>;
1448
+ effective: "now" | "period_end";
1449
+ preview: boolean;
1450
+ /** checked is a preview where everyone fits; moving while subscribers wait for their move; completed once every move ran; canceled after it was canceled. */
1451
+ status: "checking" | "blocked" | "checked" | "moving" | "completed" | "canceled";
1452
+ counts: {
1453
+ moving: number;
1454
+ moved: number;
1455
+ needsAChange: number;
1456
+ leftOut: number;
1457
+ canceled: number;
1458
+ keptOnVersion: number;
1459
+ };
1460
+ subscriptions: Array<{
1461
+ subscriptionId: string;
1462
+ /** moving waits for its renewal or is being moved; moved is on the destination; needs_a_change could not move and keeps its version until it is resolved or kept; left_out was not moved because it was not active, trialing or past due, such as a paused subscription (invalid_subscription_status), or because a listed subscription was already on the destination (no_change_requested); canceled was canceled before it moved; kept_on_version was left on its version by the merchant. */
1463
+ status: "moving" | "moved" | "needs_a_change" | "left_out" | "canceled" | "kept_on_version";
1464
+ code: string | null;
1465
+ message: string | null;
1466
+ }>;
1467
+ createdAt: string | null;
1468
+ completedAt: string | null;
1469
+ canceledAt: string | null;
1470
+ object: "plan_move";
1471
+ livemode: boolean;
1472
+ }
1250
1473
  interface PlanPrice {
1251
1474
  /** Public plan price ID. */
1252
1475
  id: string;
@@ -1301,6 +1524,69 @@ interface PlanRegionalPricingResult {
1301
1524
  object: "plan_regional_pricing";
1302
1525
  livemode: boolean;
1303
1526
  }
1527
+ interface PlanVersion {
1528
+ /** Public plan version ID. */
1529
+ id: string;
1530
+ /** The plan's versions are numbered 1, 2, 3; an experiment's own versions read with its code, such as price-test 2. */
1531
+ label: string;
1532
+ /** The plan's version number. Null for a version that only belongs to an experiment; an experiment version made current takes the next number. */
1533
+ number: number | null;
1534
+ /** The experiment this version belongs to, if any. */
1535
+ experiment: {
1536
+ /** The experiment's code, as sold with planCode. */
1537
+ code: string;
1538
+ /** Its number within the experiment. */
1539
+ version: number;
1540
+ } | null;
1541
+ /** Whether new buyers get this version. */
1542
+ isCurrent: boolean;
1543
+ /** The version this one was created from. */
1544
+ parentVersionId: string | null;
1545
+ /** Active, trialing, past due and paused subscriptions on it. */
1546
+ subscriptionCount: number;
1547
+ maxPlanCredits: number | null;
1548
+ maxPlanBalance: number | null;
1549
+ prices: Array<{
1550
+ /** Public plan price ID. */
1551
+ id: string;
1552
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
1553
+ price: number;
1554
+ includedCredits: number | null;
1555
+ includedBalance: number | null;
1556
+ regionalPrices: Array<{
1557
+ currency: string;
1558
+ price: number;
1559
+ includedBalance: number | null;
1560
+ }>;
1561
+ }>;
1562
+ /** @format date-time */
1563
+ createdAt: string;
1564
+ object: "plan_version";
1565
+ livemode: boolean;
1566
+ }
1567
+ interface PlanVersionComparison {
1568
+ /** The version the changes start from. */
1569
+ versionId: string;
1570
+ /** The version they end at. */
1571
+ againstVersionId: string;
1572
+ /** Every term that differs, the plan's first and then each country. */
1573
+ changes: Array<{
1574
+ /** Identifies the change; send it to undo just this change. */
1575
+ key: string;
1576
+ /** Where the change is: Price, Trial, a rules section, Add-ons, or a country. */
1577
+ section: string;
1578
+ /** ISO country code when the change belongs to one country. */
1579
+ country: string | null;
1580
+ /** What changed, such as Monthly price. */
1581
+ label: string;
1582
+ /** The value before, formatted. */
1583
+ before: string | null;
1584
+ /** The value now, formatted. */
1585
+ after: string | null;
1586
+ }>;
1587
+ object: "plan_version_comparison";
1588
+ livemode: boolean;
1589
+ }
1304
1590
  interface PortalAccess {
1305
1591
  portalUrl: string;
1306
1592
  object: "portal_session";
@@ -1321,6 +1607,11 @@ interface PreviewChange {
1321
1607
  daysRemaining: number;
1322
1608
  totalDays: number;
1323
1609
  isUpgrade: boolean;
1610
+ /** Active add-ons that the version the change moves the subscription to does not sell. The change deactivates them when it applies. */
1611
+ deactivatedAddons: Array<{
1612
+ addonId: string;
1613
+ name: string;
1614
+ }>;
1324
1615
  offerApplication?: {
1325
1616
  id: string;
1326
1617
  offerId: string;
@@ -1525,6 +1816,20 @@ interface SentInvoice {
1525
1816
  object: "invoice_delivery";
1526
1817
  livemode: boolean;
1527
1818
  }
1819
+ interface SubscriberNeedingAChange {
1820
+ subscriptionId: string;
1821
+ /** The move it could not complete. */
1822
+ moveId: string;
1823
+ /** The version it stays on. */
1824
+ fromVersionId: string;
1825
+ /** The version it could not move to. */
1826
+ toVersionId: string;
1827
+ /** Why it could not move. */
1828
+ code: string;
1829
+ message: string;
1830
+ object: "subscriber_needing_a_change";
1831
+ livemode: boolean;
1832
+ }
1528
1833
  interface Subscription {
1529
1834
  id: string;
1530
1835
  customerId: string;
@@ -1573,6 +1878,13 @@ interface Subscription {
1573
1878
  createdAt: string;
1574
1879
  /** @format date-time */
1575
1880
  updatedAt: string;
1881
+ /** The plan version whose terms the subscription has now. It keeps paying and receiving everything from this version until it is moved. */
1882
+ planVersion: {
1883
+ /** Public plan version ID. */
1884
+ id: string;
1885
+ /** Main versions are 1, 2, 3; an experiment's versions carry its own code, like price-test 2. */
1886
+ label: string;
1887
+ } | null;
1576
1888
  offerApplications: Array<SubscriptionOfferApplication>;
1577
1889
  pause: {
1578
1890
  status: "scheduled";
@@ -1591,6 +1903,15 @@ interface Subscription {
1591
1903
  effectiveAt: string;
1592
1904
  resumeAt: string | null;
1593
1905
  } | null;
1906
+ /** A move to another version of the plan pending for the next renewal. */
1907
+ scheduledVersionChange: {
1908
+ planVersionId: string;
1909
+ label: string;
1910
+ /** @format date-time */
1911
+ effectiveAt: string;
1912
+ /** The currency the subscription pays from the move on: its own, or usd when the move charges it in USD. */
1913
+ currency: string;
1914
+ } | null;
1594
1915
  planGrant?: {
1595
1916
  /** The active Plan Grant ID. */
1596
1917
  id: string;
@@ -1658,27 +1979,31 @@ interface Subscription {
1658
1979
  } | null;
1659
1980
  }>;
1660
1981
  credits: {
1661
- /** Plan credits left. Kept for compatibility; equal to `plan`. */
1662
- remaining: number;
1982
+ /** true when the plan credits are unlimited: usage never spends them and only the plan credit limit caps it. */
1983
+ unlimited: boolean;
1984
+ /** Plan credits left. Kept for compatibility; equal to `plan`. Omitted when `unlimited` is true. */
1985
+ remaining?: number;
1663
1986
  included: number;
1664
1987
  /** Purchased credits: purchases and manual adjustments. Spent after plan credits and kept until the subscription ends. */
1665
1988
  purchased: number;
1666
- /** Plan credits left this period. Spent first and replaced or rolled over at each reset; negative while overage is owed. */
1667
- plan: number;
1668
- /** Credits available: `plan` plus `purchased`. */
1669
- total: number;
1989
+ /** Plan credits left this period. Spent first and replaced or rolled over at each reset; negative while overage is owed. Omitted when `unlimited` is true. */
1990
+ plan?: number;
1991
+ /** Credits available: `plan` plus `purchased`. Omitted when `unlimited` is true. */
1992
+ total?: number;
1670
1993
  } | null;
1671
1994
  balance: {
1672
- /** Balance available in minor units of the subscription currency. Kept for compatibility; equal to `total`. */
1673
- remaining: number;
1995
+ /** true when the plan balance is unlimited: usage never spends it and only the plan balance limit caps it. */
1996
+ unlimited: boolean;
1997
+ /** Balance available in minor units of the subscription currency. Kept for compatibility; equal to `total`. Omitted when `unlimited` is true. */
1998
+ remaining?: number;
1674
1999
  included: number;
1675
2000
  currency: string;
1676
- /** Plan balance left this period, in minor units. Spent first and replaced or rolled over at each reset; negative while overage is owed. */
1677
- plan: number;
2001
+ /** Plan balance left this period, in minor units. Spent first and replaced or rolled over at each reset; negative while overage is owed. Omitted when `unlimited` is true. */
2002
+ plan?: number;
1678
2003
  /** Purchased balance in minor units: top-ups and manual adjustments. Spent after the plan balance and kept until the subscription ends. */
1679
2004
  purchased: number;
1680
- /** Balance available in minor units: `plan` plus `purchased`. */
1681
- total: number;
2005
+ /** Balance available in minor units: `plan` plus `purchased`. Omitted when `unlimited` is true. */
2006
+ total?: number;
1682
2007
  } | null;
1683
2008
  priceId: string | null;
1684
2009
  object: "subscription";
@@ -1686,7 +2011,8 @@ interface Subscription {
1686
2011
  }
1687
2012
  interface SubscriptionAddon {
1688
2013
  addonId: string;
1689
- status: "active";
2014
+ /** `active` when the add-on is active. `processing` when the payment method confirms later: the add-on is activated once the payment is confirmed, and stays inactive if it is declined. */
2015
+ status: "active" | "processing";
1690
2016
  proratedCharge: number;
1691
2017
  object: "subscription_addon";
1692
2018
  livemode: boolean;
@@ -1825,6 +2151,13 @@ interface SubscriptionSummary {
1825
2151
  createdAt: string;
1826
2152
  /** @format date-time */
1827
2153
  updatedAt: string;
2154
+ /** The plan version whose terms the subscription has now. It keeps paying and receiving everything from this version until it is moved. */
2155
+ planVersion: {
2156
+ /** Public plan version ID. */
2157
+ id: string;
2158
+ /** Main versions are 1, 2, 3; an experiment's versions carry its own code, like price-test 2. */
2159
+ label: string;
2160
+ } | null;
1828
2161
  offerApplications: Array<SubscriptionOfferApplication>;
1829
2162
  pause: {
1830
2163
  status: "scheduled";
@@ -1933,6 +2266,8 @@ interface Transaction {
1933
2266
  taxAmount: number | null;
1934
2267
  /** Amount in the charge currency's smallest unit, as presented to the customer. Set for non-USD charges; null when the charge was made in USD. */
1935
2268
  presentmentAmount: number | null;
2269
+ /** Cumulative confirmed refunds in the payment currency’s smallest unit. */
2270
+ amountRefunded: number;
1936
2271
  currency: string;
1937
2272
  /** The payment provider the charge was routed to: stripe, commet, or dlocal. */
1938
2273
  provider: PaymentProvider;
@@ -1978,6 +2313,8 @@ interface TransactionListItem {
1978
2313
  taxAmount: number | null;
1979
2314
  /** Amount in the charge currency's smallest unit, as presented to the customer. Set for non-USD charges; null when the charge was made in USD. */
1980
2315
  presentmentAmount: number | null;
2316
+ /** Cumulative confirmed refunds in the payment currency’s smallest unit. */
2317
+ amountRefunded: number;
1981
2318
  currency: string;
1982
2319
  /** The payment provider the charge was routed to: stripe, commet, or dlocal. */
1983
2320
  provider: PaymentProvider;
@@ -2044,9 +2381,13 @@ type UsageCheck = {
2044
2381
  consumptionModel: "credits";
2045
2382
  creditsPerUnit: number;
2046
2383
  estimatedCredits: number;
2047
- planCredits: number;
2384
+ /** true when the plan credits are unlimited: usage never spends them and only planCreditLimit caps it. */
2385
+ unlimited: boolean;
2386
+ /** Plan credits left. Omitted when unlimited is true. */
2387
+ planCredits?: number;
2048
2388
  purchasedCredits: number;
2049
- totalCredits: number;
2389
+ /** planCredits plus purchasedCredits. Omitted when unlimited is true. */
2390
+ totalCredits?: number;
2050
2391
  planCreditLimit: {
2051
2392
  /** The most plan credits the subscription spends per window. */
2052
2393
  credits: number;
@@ -2076,14 +2417,16 @@ type UsageCheck = {
2076
2417
  consumptionModel: "balance";
2077
2418
  unitPrice: number;
2078
2419
  estimatedAmount: number;
2079
- /** The available balance, plan plus purchased, in rate scale (10000 = 1.00 of the subscription currency). Equal to totalBalance. */
2080
- currentBalance: number;
2081
- /** The plan part of the balance in rate scale. Consumed first, replaced or rolled over at each reset, and negative while overage is owed. */
2082
- planBalance: number;
2420
+ /** true when the plan balance is unlimited: usage never spends it and only planBalanceLimit caps it. */
2421
+ unlimited: boolean;
2422
+ /** The available balance, plan plus purchased, in rate scale (10000 = 1.00 of the subscription currency). Equal to totalBalance. Omitted when unlimited is true. */
2423
+ currentBalance?: number;
2424
+ /** The plan part of the balance in rate scale. Consumed first, replaced or rolled over at each reset, and negative while overage is owed. Omitted when unlimited is true. */
2425
+ planBalance?: number;
2083
2426
  /** The purchased part of the balance in rate scale: top-ups and adjustments. Consumed after the plan part and kept until the subscription ends. */
2084
2427
  purchasedBalance: number;
2085
- /** planBalance plus purchasedBalance, in rate scale. */
2086
- totalBalance: number;
2428
+ /** planBalance plus purchasedBalance, in rate scale. Omitted when unlimited is true. */
2429
+ totalBalance?: number;
2087
2430
  planBalanceLimit: {
2088
2431
  /** The most plan balance the subscription spends per window, in rate scale (10000 = 1.00 of the subscription currency). */
2089
2432
  amount: number;
@@ -2121,7 +2464,10 @@ interface UsageEvent {
2121
2464
  consumption?: {
2122
2465
  model: "credits" | "balance";
2123
2466
  deducted: number;
2124
- remaining: number;
2467
+ /** true when the plan credits or plan balance are unlimited: usage never spends them and only the plan limit caps it. */
2468
+ unlimited: boolean;
2469
+ /** Plan plus purchased amount left after this event. Omitted when unlimited is true. */
2470
+ remaining?: number;
2125
2471
  blocked: boolean;
2126
2472
  /** Credits consumption only, omitted for balance. The plan credit limit after this event; null when the plan has no limit. */
2127
2473
  planCreditLimit?: {
@@ -2201,14 +2547,16 @@ interface WebhookAddonRef {
2201
2547
  name: string;
2202
2548
  }
2203
2549
  interface WebhookBalance {
2204
- /** The available balance, plan plus purchased, in rate scale. Equal to totalBalance. */
2205
- currentBalance: number;
2206
- /** The plan part in rate scale: spent first, replaced or rolled over at each reset, negative while overage is owed. */
2207
- planBalance: number;
2550
+ /** true when the plan balance is unlimited: usage never spends it and only the plan balance limit caps it. */
2551
+ unlimited: boolean;
2552
+ /** The available balance, plan plus purchased, in rate scale. Equal to totalBalance. Omitted when unlimited is true. */
2553
+ currentBalance?: number;
2554
+ /** The plan part in rate scale: spent first, replaced or rolled over at each reset, negative while overage is owed. Omitted when unlimited is true. */
2555
+ planBalance?: number;
2208
2556
  /** The purchased part in rate scale: top-ups and manual adjustments, spent after the plan part and kept until the subscription ends. */
2209
2557
  purchasedBalance: number;
2210
- /** planBalance plus purchasedBalance, in rate scale. */
2211
- totalBalance: number;
2558
+ /** planBalance plus purchasedBalance, in rate scale. Omitted when unlimited is true. */
2559
+ totalBalance?: number;
2212
2560
  }
2213
2561
  interface WebhookBankRef {
2214
2562
  bankName: string | null;
@@ -2221,9 +2569,13 @@ interface WebhookCardInfo {
2221
2569
  expYear: number;
2222
2570
  }
2223
2571
  interface WebhookCreditsBalance {
2224
- planCredits: number;
2572
+ /** true when the plan credits are unlimited: usage never spends them and only the plan credit limit caps it. */
2573
+ unlimited: boolean;
2574
+ /** Plan credits left. Omitted when unlimited is true. */
2575
+ planCredits?: number;
2225
2576
  purchasedCredits: number;
2226
- totalCredits: number;
2577
+ /** planCredits plus purchasedCredits. Omitted when unlimited is true. */
2578
+ totalCredits?: number;
2227
2579
  }
2228
2580
  interface WebhookPlanGrantTimelineEvent {
2229
2581
  /** The public ID of this plan grant event. */
@@ -2314,6 +2666,8 @@ interface UpdateAddonParams {
2314
2666
  basePrice?: number;
2315
2667
  includedUnits?: number;
2316
2668
  overageRate?: number;
2669
+ /** Plans that sell the add-on, replacing the current ones. Empty means every plan; omitted keeps them. Removing a plan is rejected with addon_has_activations while a subscription of that plan has the add-on active. */
2670
+ planIds?: Array<string>;
2317
2671
  }
2318
2672
  interface DeleteAddonParams {
2319
2673
  id: string;
@@ -2327,12 +2681,16 @@ type CreateAddonParams = {
2327
2681
  description?: string;
2328
2682
  basePrice: number;
2329
2683
  featureId: string;
2684
+ /** Plans that sell the add-on. Omitted or empty, every plan sells it. Plans created later sell it too. */
2685
+ planIds?: Array<string>;
2330
2686
  consumptionModel: "boolean";
2331
2687
  } | {
2332
2688
  name: string;
2333
2689
  description?: string;
2334
2690
  basePrice: number;
2335
2691
  featureId: string;
2692
+ /** Plans that sell the add-on. Omitted or empty, every plan sells it. Plans created later sell it too. */
2693
+ planIds?: Array<string>;
2336
2694
  consumptionModel: "metered";
2337
2695
  includedUnits: number;
2338
2696
  overageRate: number;
@@ -2341,6 +2699,8 @@ type CreateAddonParams = {
2341
2699
  description?: string;
2342
2700
  basePrice: number;
2343
2701
  featureId: string;
2702
+ /** Plans that sell the add-on. Omitted or empty, every plan sells it. Plans created later sell it too. */
2703
+ planIds?: Array<string>;
2344
2704
  consumptionModel: "credits";
2345
2705
  creditCost: number;
2346
2706
  } | {
@@ -2348,6 +2708,8 @@ type CreateAddonParams = {
2348
2708
  description?: string;
2349
2709
  basePrice: number;
2350
2710
  featureId: string;
2711
+ /** Plans that sell the add-on. Omitted or empty, every plan sells it. Plans created later sell it too. */
2712
+ planIds?: Array<string>;
2351
2713
  consumptionModel: "balance";
2352
2714
  overageRate: number;
2353
2715
  };
@@ -2363,7 +2725,7 @@ declare class AddonsResource {
2363
2725
  }>;
2364
2726
  /** Retrieve an add-on by its public ID or slug. */
2365
2727
  get(params: GetAddonParams, options?: RequestOptions): Promise<Addon>;
2366
- /** Update an add-on's name, description, or pricing. */
2728
+ /** Update an add-on's name, description, pricing, or the plans that sell it. */
2367
2729
  update(params: UpdateAddonParams, options?: RequestOptions): Promise<Addon>;
2368
2730
  /** Soft-delete an add-on. Fails if the add-on has active subscriptions. */
2369
2731
  delete(params: DeleteAddonParams, options?: RequestOptions): Promise<DeletedObject>;
@@ -2433,6 +2795,8 @@ interface UpdateCreditPackParams {
2433
2795
  credits?: number;
2434
2796
  price?: number;
2435
2797
  isActive?: boolean;
2798
+ /** Plans that sell the credit pack, replacing the current ones. Empty means every plan; omitted keeps them. */
2799
+ planIds?: Array<string>;
2436
2800
  }
2437
2801
  interface DeleteCreditPackParams {
2438
2802
  id: string;
@@ -2443,11 +2807,13 @@ interface CreateCreditPackParams {
2443
2807
  credits: number;
2444
2808
  price: number;
2445
2809
  isActive?: boolean;
2810
+ /** Plans that sell the credit pack. Omitted or empty, every plan sells it. Plans created later sell it too. */
2811
+ planIds?: Array<string>;
2446
2812
  }
2447
2813
  declare class CreditPacksResource {
2448
2814
  private httpClient;
2449
2815
  constructor(httpClient: CommetHTTPClient);
2450
- /** Update a credit pack's name, description, credits, price, or active status. */
2816
+ /** Update a credit pack's name, description, credits, price, active status, or the plans that sell it. */
2451
2817
  update(params: UpdateCreditPackParams, options?: RequestOptions): Promise<CreditPack>;
2452
2818
  /** Soft-delete a credit pack. */
2453
2819
  delete(params: DeleteCreditPackParams, options?: RequestOptions): Promise<DeletedObject>;
@@ -2534,7 +2900,7 @@ interface UpdateCustomerParams {
2534
2900
  email?: string;
2535
2901
  fullName?: string;
2536
2902
  taxDocument?: string;
2537
- /** Business tax ID, such as an EU VAT number or a Peruvian RUC, for the country of the customer's address. Accepted only where Commet collects tax; a valid ID replaces consumer tax with the business treatment. Send null to remove it. */
2903
+ /** Business tax ID, such as an EU VAT number, a Peruvian RUC or an Argentine CUIT, for the country of the customer's address; its type comes from that country. Where Commet collects tax and that ID exempts business buyers, a valid ID replaces consumer tax with the business treatment; elsewhere it is stored as sent and does not change any charge. Send null to remove it. */
2538
2904
  businessTaxId?: string | null;
2539
2905
  externalId?: string;
2540
2906
  timezone?: Timezone;
@@ -2556,6 +2922,8 @@ interface BatchCreateCustomersParams {
2556
2922
  externalId?: string;
2557
2923
  fullName?: string;
2558
2924
  taxDocument?: string;
2925
+ /** Business tax ID, such as an EU VAT number, a Peruvian RUC or an Argentine CUIT, for the country of the customer's address; its type comes from that country. Where Commet collects tax and that ID exempts business buyers, a valid ID replaces consumer tax with the business treatment; elsewhere it is stored as sent and does not change any charge. */
2926
+ businessTaxId?: string;
2559
2927
  timezone?: Timezone;
2560
2928
  metadata?: Record<string, unknown>;
2561
2929
  address?: {
@@ -2581,7 +2949,7 @@ interface CreateCustomerParams {
2581
2949
  externalId?: string;
2582
2950
  fullName?: string;
2583
2951
  taxDocument?: string;
2584
- /** Business tax ID, such as an EU VAT number or a Peruvian RUC, for the country of the customer's address. Accepted only where Commet collects tax; a valid ID replaces consumer tax with the business treatment. */
2952
+ /** Business tax ID, such as an EU VAT number, a Peruvian RUC or an Argentine CUIT, for the country of the customer's address; its type comes from that country. Where Commet collects tax and that ID exempts business buyers, a valid ID replaces consumer tax with the business treatment; elsewhere it is stored as sent and does not change any charge. */
2585
2953
  businessTaxId?: string;
2586
2954
  address?: {
2587
2955
  line1: string;
@@ -2714,7 +3082,6 @@ interface SendInvoiceParams {
2714
3082
  }
2715
3083
  interface UpdateInvoiceStatusParams {
2716
3084
  id: string;
2717
- status: "paid" | "void";
2718
3085
  }
2719
3086
  interface ListInvoicesParams {
2720
3087
  cursor?: string;
@@ -2738,8 +3105,11 @@ declare class InvoicesResource {
2738
3105
  get(params: GetInvoiceParams, options?: RequestOptions): Promise<Invoice>;
2739
3106
  /** Send the invoice to the customer via email. */
2740
3107
  send(params: SendInvoiceParams, options?: RequestOptions): Promise<SentInvoice>;
2741
- /** Mark an outstanding invoice as "paid" or "void" and return the updated invoice. Cannot change the status of already paid or voided invoices. */
2742
- updateStatus(params: UpdateInvoiceStatusParams, options?: RequestOptions): Promise<Invoice>;
3108
+ /**
3109
+ * Deprecated. No longer changes the invoice. An invoice is paid when its charge settles: to collect a past-due subscription, reactivate it or send the customer a recovery link.
3110
+ * @deprecated
3111
+ */
3112
+ updateStatus(params: UpdateInvoiceStatusParams, options?: RequestOptions): Promise<void>;
2743
3113
  /** List invoices with cursor-based pagination. Filter by customer, status, or subscription. */
2744
3114
  list(params?: ListInvoicesParams, options?: RequestOptions): Promise<{
2745
3115
  object: "list";
@@ -3021,6 +3391,252 @@ declare class PlanGroupsResource {
3021
3391
  create(params: CreatePlanGroupParams, options?: RequestOptions): Promise<PlanGroup>;
3022
3392
  }
3023
3393
 
3394
+ type PublishPlanDraftParams = {
3395
+ id: string;
3396
+ draftId: string;
3397
+ /** current sells the draft to every new buyer. */
3398
+ publishAs: "current";
3399
+ /** What happens to subscribers of earlier versions: keep them, move them at their next renewal, or move them now (features and balance change today, the price at renewal). Nobody moves unless every one of them fits or has a change below. */
3400
+ move?: "keep" | "period_end" | "now";
3401
+ /** Per-subscriber changes that make each one fit, applied at its renewal. */
3402
+ changes?: Array<{
3403
+ subscriptionId: string;
3404
+ /** Leave this subscriber on its version. */
3405
+ keepOnVersion?: true;
3406
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
3407
+ /** Lower its seats to the version's limit at renewal. */
3408
+ seatLimit?: true;
3409
+ /** Add-ons it stops paying at renewal. */
3410
+ removeAddonIds?: Array<string>;
3411
+ /** usd to charge it in USD from its renewal when the version does not sell the currency it pays, or the USD price of its country. */
3412
+ currency?: string;
3413
+ }>;
3414
+ /** Check everything without publishing. */
3415
+ preview?: boolean;
3416
+ } | {
3417
+ id: string;
3418
+ draftId: string;
3419
+ /** experiment starts an experiment with experimentCode, sold with planCode plan:code. Starting an experiment moves nobody, so it takes no move or changes. */
3420
+ publishAs: "experiment";
3421
+ /** The experiment's own code, after the plan's code. */
3422
+ experimentCode: string;
3423
+ /** Check everything without publishing. */
3424
+ preview?: boolean;
3425
+ } | {
3426
+ id: string;
3427
+ draftId: string;
3428
+ /** experiment_version publishes the next version of the experiment the draft started from. */
3429
+ publishAs: "experiment_version";
3430
+ /** What happens to subscribers of earlier versions: keep them, move them at their next renewal, or move them now (features and balance change today, the price at renewal). Nobody moves unless every one of them fits or has a change below. */
3431
+ move?: "keep" | "period_end" | "now";
3432
+ /** Per-subscriber changes that make each one fit, applied at its renewal. */
3433
+ changes?: Array<{
3434
+ subscriptionId: string;
3435
+ /** Leave this subscriber on its version. */
3436
+ keepOnVersion?: true;
3437
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
3438
+ /** Lower its seats to the version's limit at renewal. */
3439
+ seatLimit?: true;
3440
+ /** Add-ons it stops paying at renewal. */
3441
+ removeAddonIds?: Array<string>;
3442
+ /** usd to charge it in USD from its renewal when the version does not sell the currency it pays, or the USD price of its country. */
3443
+ currency?: string;
3444
+ }>;
3445
+ /** Check everything without publishing. */
3446
+ preview?: boolean;
3447
+ };
3448
+ interface GetPlanDraftParams {
3449
+ id: string;
3450
+ draftId: string;
3451
+ }
3452
+ interface UpdatePlanDraftParams {
3453
+ id: string;
3454
+ draftId: string;
3455
+ /** Every interval the draft sells. An interval the draft sold and this list leaves out is removed from the draft. */
3456
+ prices?: Array<{
3457
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
3458
+ /** USD price in cents. */
3459
+ price: number;
3460
+ includedCredits?: number | null;
3461
+ includedBalance?: number | null;
3462
+ /** Days of trial on this price. Null removes the trial. */
3463
+ trialDays?: number | null;
3464
+ trialRequiresPaymentMethod?: boolean;
3465
+ /** Show this interval first at checkout and in pricing tables. */
3466
+ isDefault?: boolean;
3467
+ }>;
3468
+ /** Every country with its own currency or prices. A country the draft sold and this list leaves out is removed. A country missing a price blocks publishing. */
3469
+ countries?: Array<{
3470
+ /** ISO country code. */
3471
+ country: string;
3472
+ /** The currency the country pays in, USD included. */
3473
+ currency: string;
3474
+ /** Local units per USD for prices that follow the USD base. USD defaults to 1. */
3475
+ exchangeRate?: number | null;
3476
+ prices: Array<{
3477
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
3478
+ /** The price set by hand, in the currency's minor unit. */
3479
+ price: number;
3480
+ /** The balance included each period in this country, in the currency's minor unit. Required when the plan's price includes a balance. */
3481
+ includedBalance?: number;
3482
+ } | {
3483
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
3484
+ /** Follow the USD base at the exchange rate. */
3485
+ followBase: true;
3486
+ }>;
3487
+ /** Smallest balance top-up in this country, in the currency's minor unit. Null follows the USD minimum at the exchange rate; left out keeps it. */
3488
+ topUpMinimum?: number | null;
3489
+ /** Most unused plan balance that rolls over in this country. Null follows the USD cap at the exchange rate; left out keeps it. */
3490
+ maxPlanBalance?: number | null;
3491
+ /** Most plan balance spent per limit interval in this country. Null follows the USD limit at the exchange rate; left out keeps it. */
3492
+ planBalanceLimit?: number | null;
3493
+ /** What the country pays for each add-on the draft sells. Left out keeps the country's add-on prices; sent, it replaces them, and add-ons not listed follow the USD price. */
3494
+ addonPrices?: Array<{
3495
+ addonId: string;
3496
+ /** The add-on's price set by hand, in the currency's minor unit. */
3497
+ price: number;
3498
+ } | {
3499
+ addonId: string;
3500
+ /** Follow the add-on's USD price at the exchange rate. */
3501
+ followBase: true;
3502
+ }>;
3503
+ /** What the country pays for each credit pack the draft sells. Left out keeps the country's pack prices; sent, it replaces them, and packs not listed follow the USD price. */
3504
+ creditPackPrices?: Array<{
3505
+ creditPackId: string;
3506
+ /** The pack's price set by hand, in the currency's minor unit. */
3507
+ price: number;
3508
+ } | {
3509
+ creditPackId: string;
3510
+ /** Follow the pack's USD price at the exchange rate. */
3511
+ followBase: true;
3512
+ }>;
3513
+ }>;
3514
+ /** Credit or balance rules; fields left out stay as they are. */
3515
+ rules?: {
3516
+ /** Credits a free plan includes each month. */
3517
+ freeIncludedCredits?: number | null;
3518
+ /** Balance a free plan includes each month, in cents. */
3519
+ freeIncludedBalance?: number | null;
3520
+ unusedPlanCredits?: "expire" | "roll_over";
3521
+ maxPlanCredits?: number | null;
3522
+ /** Credits plans only. true makes the plan credits unlimited: usage never spends them, only planCreditLimit caps it, and every price and the free plan include 0 credits. */
3523
+ unlimitedPlanCredits?: boolean;
3524
+ planCreditLimit?: number | null;
3525
+ planCreditLimitInterval?: "day" | "week" | null;
3526
+ unusedPlanBalance?: "expire" | "roll_over";
3527
+ maxPlanBalance?: number | null;
3528
+ /** Balance plans only. true makes the plan balance unlimited: usage never spends it, only planBalanceLimit caps it, and every price, country and the free plan include no balance. */
3529
+ unlimitedPlanBalance?: boolean;
3530
+ planBalanceLimit?: number | null;
3531
+ planBalanceLimitInterval?: "day" | "week" | null;
3532
+ blockOnExhaustion?: boolean;
3533
+ purchasesEnabled?: boolean;
3534
+ creditPurchaseUnitPrice?: number | null;
3535
+ creditPurchaseMinimum?: number | null;
3536
+ topUpMinimum?: number | null;
3537
+ };
3538
+ /** Change keys to put back as the version the draft started from had them. */
3539
+ undo?: Array<string>;
3540
+ }
3541
+ interface DeletePlanDraftParams {
3542
+ id: string;
3543
+ draftId: string;
3544
+ }
3545
+ interface ListPlanDraftsParams {
3546
+ id: string;
3547
+ }
3548
+ interface CreatePlanDraftParams {
3549
+ id: string;
3550
+ /** The version to start from: the current version, an experiment's version or an older version. Defaults to the current version. */
3551
+ fromVersionId?: string;
3552
+ }
3553
+ interface ArchivePlanExperimentParams {
3554
+ id: string;
3555
+ code: string;
3556
+ /** What happens to the experiment's subscribers: keep them on its versions, move them to the plan's current version at their next renewal, or move them now. Nobody moves, and the experiment keeps running, unless every one of them fits or has a change. */
3557
+ subscribers?: "keep" | "period_end" | "now";
3558
+ /** Per-subscriber changes that make each one fit, applied at its renewal. */
3559
+ changes?: Array<{
3560
+ subscriptionId: string;
3561
+ /** Leave this subscriber on its version. */
3562
+ keepOnVersion?: true;
3563
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
3564
+ /** Lower its seats to the version's limit at renewal. */
3565
+ seatLimit?: true;
3566
+ /** Add-ons it stops paying at renewal. */
3567
+ removeAddonIds?: Array<string>;
3568
+ /** usd to charge it in USD from its renewal when the version does not sell the currency it pays, or the USD price of its country. */
3569
+ currency?: string;
3570
+ }>;
3571
+ /** Check the archive and the move without changing anything. */
3572
+ preview?: boolean;
3573
+ }
3574
+ interface MakePlanExperimentCurrentParams {
3575
+ id: string;
3576
+ code: string;
3577
+ }
3578
+ interface GetPlanExperimentParams {
3579
+ id: string;
3580
+ code: string;
3581
+ }
3582
+ interface CreatePlanExperimentVersionParams {
3583
+ id: string;
3584
+ code: string;
3585
+ prices?: Array<{
3586
+ /** An interval the plan already sells. Prices not listed are copied unchanged from the current version. */
3587
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
3588
+ /** USD price in the currency's minor unit (cents). */
3589
+ price: number;
3590
+ includedCredits?: number | null;
3591
+ includedBalance?: number | null;
3592
+ /** Per-currency amounts. A currency the current version does not sell also needs its exchangeRate in currencies; its amounts not listed here are derived from the USD price. */
3593
+ regionalPrices?: Array<{
3594
+ currency: string;
3595
+ price: number;
3596
+ includedBalance?: number | null;
3597
+ }>;
3598
+ }>;
3599
+ /** Currencies the current version does not sell, with the exchange rate (local units per USD) used for the amounts not listed, credit purchases, add-ons and overage. */
3600
+ currencies?: Array<{
3601
+ currency: string;
3602
+ exchangeRate: number;
3603
+ }>;
3604
+ /** Credits plans that roll over unused credits: the most plan credits a subscription can hold. Null removes the cap. */
3605
+ maxPlanCredits?: number | null;
3606
+ /** Balance plans that roll over unused balance: the most plan balance a subscription can hold, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. Null removes the cap. */
3607
+ maxPlanBalance?: number | null;
3608
+ }
3609
+ interface ListPlanExperimentsParams {
3610
+ id: string;
3611
+ }
3612
+ interface CreatePlanExperimentParams {
3613
+ id: string;
3614
+ prices?: Array<{
3615
+ /** An interval the plan already sells. Prices not listed are copied unchanged from the current version. */
3616
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
3617
+ /** USD price in the currency's minor unit (cents). */
3618
+ price: number;
3619
+ includedCredits?: number | null;
3620
+ includedBalance?: number | null;
3621
+ /** Per-currency amounts. A currency the current version does not sell also needs its exchangeRate in currencies; its amounts not listed here are derived from the USD price. */
3622
+ regionalPrices?: Array<{
3623
+ currency: string;
3624
+ price: number;
3625
+ includedBalance?: number | null;
3626
+ }>;
3627
+ }>;
3628
+ /** Currencies the current version does not sell, with the exchange rate (local units per USD) used for the amounts not listed, credit purchases, add-ons and overage. */
3629
+ currencies?: Array<{
3630
+ currency: string;
3631
+ exchangeRate: number;
3632
+ }>;
3633
+ /** Credits plans that roll over unused credits: the most plan credits a subscription can hold. Null removes the cap. */
3634
+ maxPlanCredits?: number | null;
3635
+ /** Balance plans that roll over unused balance: the most plan balance a subscription can hold, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. Null removes the cap. */
3636
+ maxPlanBalance?: number | null;
3637
+ /** The experiment's own code: lowercase letters, numbers, hyphens and underscores. It is sold as planCode `<plan code>:<code>` and is never reused in the plan. */
3638
+ code: string;
3639
+ }
3024
3640
  interface UpdatePlanFeatureParams {
3025
3641
  id: string;
3026
3642
  featureId: string;
@@ -3051,6 +3667,76 @@ interface AddPlanFeatureParams {
3051
3667
  pricingMode?: "fixed" | "ai_model";
3052
3668
  margin?: number | null;
3053
3669
  }
3670
+ interface CancelPlanMoveParams {
3671
+ id: string;
3672
+ moveId: string;
3673
+ }
3674
+ interface GetPlanMoveParams {
3675
+ id: string;
3676
+ moveId: string;
3677
+ }
3678
+ interface CancelPlanMoveSubscriptionParams {
3679
+ id: string;
3680
+ moveId: string;
3681
+ subscriptionId: string;
3682
+ }
3683
+ interface ListPlanMovesParams {
3684
+ id: string;
3685
+ }
3686
+ type CreatePlanMoveParams = {
3687
+ id: string;
3688
+ /** Public IDs of the subscriptions to move. */
3689
+ subscriptionIds: Array<string>;
3690
+ /** The version subscribers move to. */
3691
+ toVersionId: string;
3692
+ /** now changes features and the included amount today and the price at renewal; period_end moves each subscriber at its next renewal. */
3693
+ effective: "now" | "period_end";
3694
+ /** Per-subscriber changes that make each one fit, applied at its renewal. */
3695
+ changes?: Array<{
3696
+ subscriptionId: string;
3697
+ /** Leave this subscriber on its version. */
3698
+ keepOnVersion?: true;
3699
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
3700
+ /** Lower its seats to the version's limit at renewal. */
3701
+ seatLimit?: true;
3702
+ /** Add-ons it stops paying at renewal. */
3703
+ removeAddonIds?: Array<string>;
3704
+ /** usd to charge it in USD from its renewal when the version does not sell the currency it pays, or the USD price of its country. */
3705
+ currency?: string;
3706
+ }>;
3707
+ /** Check every subscriber without moving anyone. */
3708
+ preview?: boolean;
3709
+ } | {
3710
+ id: string;
3711
+ /** Move every active, trialing and past due subscription on this version of the plan. */
3712
+ fromVersionId: string;
3713
+ /** The version subscribers move to. */
3714
+ toVersionId: string;
3715
+ /** now changes features and the included amount today and the price at renewal; period_end moves each subscriber at its next renewal. */
3716
+ effective: "now" | "period_end";
3717
+ /** Per-subscriber changes that make each one fit, applied at its renewal. */
3718
+ changes?: Array<{
3719
+ subscriptionId: string;
3720
+ /** Leave this subscriber on its version. */
3721
+ keepOnVersion?: true;
3722
+ billingInterval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
3723
+ /** Lower its seats to the version's limit at renewal. */
3724
+ seatLimit?: true;
3725
+ /** Add-ons it stops paying at renewal. */
3726
+ removeAddonIds?: Array<string>;
3727
+ /** usd to charge it in USD from its renewal when the version does not sell the currency it pays, or the USD price of its country. */
3728
+ currency?: string;
3729
+ }>;
3730
+ /** Check every subscriber without moving anyone. */
3731
+ preview?: boolean;
3732
+ };
3733
+ interface KeepPlanSubscriberOnVersionParams {
3734
+ id: string;
3735
+ subscriptionId: string;
3736
+ }
3737
+ interface ListPlanSubscribersNeedingAChangeParams {
3738
+ id: string;
3739
+ }
3054
3740
  interface SetDefaultPlanPriceParams {
3055
3741
  id: string;
3056
3742
  priceId: string;
@@ -3146,7 +3832,7 @@ interface UpdatePlanParams {
3146
3832
  description?: string | null;
3147
3833
  metadata?: Record<string, unknown>;
3148
3834
  isPublic?: boolean;
3149
- /** Credits plans only. What happens to unused plan credits at each reset. Existing subscriptions apply it from their next reset. */
3835
+ /** Credits plans only. What happens to unused plan credits at each reset. Changing it publishes a new version of the plan; each subscription stays on its version until moved. */
3150
3836
  unusedPlanCredits?: {
3151
3837
  type: "expire";
3152
3838
  } | {
@@ -3154,14 +3840,16 @@ interface UpdatePlanParams {
3154
3840
  /** The most plan credits a subscription holds after a reset, including the credits that reset grants; credits above it expire. At least the included credits of every price. null means no limit other than the largest storable balance, 2,147,483,647 plan credits. */
3155
3841
  maxPlanCredits: number | null;
3156
3842
  };
3157
- /** Credits plans only. The most plan credits a subscription spends per day or per week; null removes the limit. Raising or removing it applies to existing subscriptions at once; lowering it, adding it or changing its interval applies from their next period. */
3843
+ /** Credits plans only. true makes the plan credits unlimited: usage never spends them, only planCreditLimit caps it, and every price includes 0 credits. Changing it publishes a new version of the plan; each subscription stays on its version until moved. */
3844
+ unlimitedPlanCredits?: boolean;
3845
+ /** Credits plans only. The most plan credits a subscription spends per day or per week; null removes the limit. Changing it publishes a new version of the plan; each subscription stays on its version until moved. */
3158
3846
  planCreditLimit?: {
3159
3847
  /** The most plan credits a subscription spends in one window. */
3160
3848
  credits: number;
3161
3849
  /** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
3162
3850
  interval: "day" | "week";
3163
3851
  } | null;
3164
- /** Balance plans only. What happens to unused plan balance at each reset. Existing subscriptions apply it from their next reset. */
3852
+ /** Balance plans only. What happens to unused plan balance at each reset. Changing it publishes a new version of the plan; each subscription stays on its version until moved. */
3165
3853
  unusedPlanBalance?: {
3166
3854
  type: "expire";
3167
3855
  } | {
@@ -3169,14 +3857,16 @@ interface UpdatePlanParams {
3169
3857
  /** The most plan balance a subscription holds after a reset, in USD cents, including the balance that reset grants; balance above it expires. At least the included balance of every price. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. null means no limit other than the largest storable amount, 2,147,483,647 cents. */
3170
3858
  maxPlanBalance: number | null;
3171
3859
  };
3172
- /** Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; null removes the limit. Raising or removing it applies to existing subscriptions at once; lowering it, adding it or changing its interval applies from their next period. */
3860
+ /** Balance plans only. true makes the plan balance unlimited: usage never spends it, only planBalanceLimit caps it, and every price and country includes no balance. Changing it publishes a new version of the plan; each subscription stays on its version until moved. */
3861
+ unlimitedPlanBalance?: boolean;
3862
+ /** Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; null removes the limit. Changing it publishes a new version of the plan; each subscription stays on its version until moved. */
3173
3863
  planBalanceLimit?: {
3174
3864
  /** The most plan balance a subscription spends in one window, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. */
3175
3865
  amount: number;
3176
3866
  /** The window length: `day` is 24 hours and `week` is 7 days, starting at the time of day of the subscription's billing anchor. */
3177
3867
  interval: "day" | "week";
3178
3868
  } | null;
3179
- /** Credits and balance plans only. false lets usage continue past the plan and purchased amounts and bills the missing amount as overage at the next renewal; a credits plan bills it at the price per credit and needs one. Trials and free plans always stop, so free plans accept only true. Existing subscriptions apply it from their next reset. */
3869
+ /** Credits and balance plans only. false lets usage continue past the plan and purchased amounts and bills the missing amount as overage at the next renewal; a credits plan bills it at the price per credit and needs one. Trials and free plans always stop, so free plans accept only true. Changing it publishes a new version of the plan; each subscription stays on its version until moved. */
3180
3870
  blockOnExhaustion?: boolean;
3181
3871
  /** Make this plan the default plan of its plan group: customers created with that planGroupId start on it, and a paid plan of the group that ends from the customer portal, a revoked payment authorization or exhausted dunning moves to it instead of canceling. Requires a free plan in a plan group; replaces the group's previous default plan. false unmarks it. */
3182
3872
  isDefault?: boolean;
@@ -3184,6 +3874,46 @@ interface UpdatePlanParams {
3184
3874
  interface DeletePlanParams {
3185
3875
  id: string;
3186
3876
  }
3877
+ interface ComparePlanVersionsParams {
3878
+ id: string;
3879
+ versionId: string;
3880
+ against: string;
3881
+ }
3882
+ interface GetPlanVersionParams {
3883
+ id: string;
3884
+ versionId: string;
3885
+ }
3886
+ interface ListPlanVersionsParams {
3887
+ id: string;
3888
+ cursor?: string;
3889
+ limit?: number;
3890
+ }
3891
+ interface CreatePlanVersionParams {
3892
+ id: string;
3893
+ prices?: Array<{
3894
+ /** An interval the plan already sells. Prices not listed are copied unchanged from the current version. */
3895
+ billingInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | "one_time";
3896
+ /** USD price in the currency's minor unit (cents). */
3897
+ price: number;
3898
+ includedCredits?: number | null;
3899
+ includedBalance?: number | null;
3900
+ /** Per-currency amounts. A currency the current version does not sell also needs its exchangeRate in currencies; its amounts not listed here are derived from the USD price. */
3901
+ regionalPrices?: Array<{
3902
+ currency: string;
3903
+ price: number;
3904
+ includedBalance?: number | null;
3905
+ }>;
3906
+ }>;
3907
+ /** Currencies the current version does not sell, with the exchange rate (local units per USD) used for the amounts not listed, credit purchases, add-ons and overage. */
3908
+ currencies?: Array<{
3909
+ currency: string;
3910
+ exchangeRate: number;
3911
+ }>;
3912
+ /** Credits plans that roll over unused credits: the most plan credits a subscription can hold. Null removes the cap. */
3913
+ maxPlanCredits?: number | null;
3914
+ /** Balance plans that roll over unused balance: the most plan balance a subscription can hold, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. Null removes the cap. */
3915
+ maxPlanBalance?: number | null;
3916
+ }
3187
3917
  interface SetPlanVisibilityParams {
3188
3918
  id: string;
3189
3919
  isPublic: boolean;
@@ -3208,6 +3938,8 @@ interface CreatePlanParams {
3208
3938
  /** The most plan credits a subscription holds after a reset, including the credits that reset grants; credits above it expire. At least the included credits of every price. null means no limit other than the largest storable balance, 2,147,483,647 plan credits. */
3209
3939
  maxPlanCredits: number | null;
3210
3940
  };
3941
+ /** Credits plans only. true makes the plan credits unlimited: usage never spends them, only planCreditLimit caps it, and every price includes 0 credits. Omitted means false. */
3942
+ unlimitedPlanCredits?: boolean;
3211
3943
  /** Credits plans only. The most plan credits a subscription spends per day or per week; omitted or null means no limit. */
3212
3944
  planCreditLimit?: {
3213
3945
  /** The most plan credits a subscription spends in one window. */
@@ -3223,6 +3955,8 @@ interface CreatePlanParams {
3223
3955
  /** The most plan balance a subscription holds after a reset, in USD cents, including the balance that reset grants; balance above it expires. At least the included balance of every price. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. null means no limit other than the largest storable amount, 2,147,483,647 cents. */
3224
3956
  maxPlanBalance: number | null;
3225
3957
  };
3958
+ /** Balance plans only. true makes the plan balance unlimited: usage never spends it, only planBalanceLimit caps it, and every price and country includes no balance. Omitted means false. */
3959
+ unlimitedPlanBalance?: boolean;
3226
3960
  /** Balance plans only. The most plan balance a subscription spends per day or per week, in USD cents; omitted or null means no limit. */
3227
3961
  planBalanceLimit?: {
3228
3962
  /** The most plan balance a subscription spends in one window, in USD cents. Other currencies convert it with the plan's exchange rate unless the dashboard sets a custom amount for that currency. */
@@ -3238,12 +3972,70 @@ interface CreatePlanParams {
3238
3972
  declare class PlansResource {
3239
3973
  private httpClient;
3240
3974
  constructor(httpClient: CommetHTTPClient);
3975
+ /** Publish a draft as the plan's current version, as a new experiment with its own code, or as the next version of the experiment it started from. A country missing a price, or removing the signup trial of the plan's group from the current version, stops the publication. With move, subscribers of earlier versions move at their renewal or now; if any of them does not fit the new version, nothing is published and the response lists each one with what would make it fit, to send back in changes. Paused subscribers stay where they are. Send preview to check without publishing. */
3976
+ publishDraft(params: PublishPlanDraftParams, options?: RequestOptions): Promise<PlanDraftPublication>;
3977
+ /** Retrieve a draft with the version it started from and what it changes. */
3978
+ getDraft(params: GetPlanDraftParams, options?: RequestOptions): Promise<PlanDraft>;
3979
+ /** Change a draft's prices per interval, trials, the interval shown first, countries with their currency and prices, and credit or balance rules, or undo single changes. Each block sent replaces that block; blocks left out stay as they are. Buyers and subscribers see nothing until the draft is published. */
3980
+ updateDraft(params: UpdatePlanDraftParams, options?: RequestOptions): Promise<PlanDraft>;
3981
+ /** Discard a draft. Nothing it changed was ever sold. */
3982
+ deleteDraft(params: DeletePlanDraftParams, options?: RequestOptions): Promise<DeletedObject>;
3983
+ /** List the plan's open drafts, oldest first, each with the version it started from and what it changes. Drafts sell nothing until published. */
3984
+ listDrafts(params: ListPlanDraftsParams, options?: RequestOptions): Promise<{
3985
+ object: "list";
3986
+ data: Array<PlanDraft>;
3987
+ hasMore: boolean;
3988
+ nextCursor?: string;
3989
+ }>;
3990
+ /** Start a draft from a version of the plan: the current one, an experiment's version or an older one. A plan can have any number of drafts. Edit it, then publish it as the current version, as an experiment or as an experiment's next version; nothing changes for buyers or subscribers until then. */
3991
+ createDraft(params: CreatePlanDraftParams, options?: RequestOptions): Promise<PlanDraft>;
3992
+ /** Stop selling the experiment. Its code sells the plan's current version from then on, so links already shared keep working. Choose what happens to its subscribers: keep them on its versions, or move them to the current version at their renewal or now. If any of them does not fit, nothing changes and the response lists each one with what would make it fit, to send back in changes. */
3993
+ archiveExperiment(params: ArchivePlanExperimentParams, options?: RequestOptions): Promise<PlanExperimentArchive>;
3994
+ /** Make the experiment's latest version the plan's current version, with exactly its content and the next version number. New buyers get it; its subscribers are already on it. The experiment closes, and its code sells the plan's current version from then on. Nobody else moves. */
3995
+ makeExperimentCurrent(params: MakePlanExperimentCurrentParams, options?: RequestOptions): Promise<PlanVersion>;
3996
+ /** Get one experiment of a plan by its own code, with the version it sells and how many subscriptions are on it. */
3997
+ getExperiment(params: GetPlanExperimentParams, options?: RequestOptions): Promise<PlanExperiment>;
3998
+ /** Publish the experiment's next version from its latest version with the changes given. Its code sells the new version from now on; subscribers on its earlier versions stay where they are until moved. */
3999
+ createExperimentVersion(params: CreatePlanExperimentVersionParams, options?: RequestOptions): Promise<PlanVersion>;
4000
+ /** List a plan's experiments, newest first, with the version each one sells and how many subscriptions are on them. */
4001
+ listExperiments(params: ListPlanExperimentsParams, options?: RequestOptions): Promise<{
4002
+ object: "list";
4003
+ data: Array<PlanExperiment>;
4004
+ hasMore: boolean;
4005
+ nextCursor?: string;
4006
+ }>;
4007
+ /** Start an experiment from the plan's current version with the changes given. It is sold only through its code (planCode `<plan code>:<code>`); new buyers of the plan keep getting the current version. */
4008
+ createExperiment(params: CreatePlanExperimentParams, options?: RequestOptions): Promise<PlanExperiment>;
3241
4009
  /** Update limits, overage, or enabled status of a feature on a plan. */
3242
4010
  updateFeature(params: UpdatePlanFeatureParams, options?: RequestOptions): Promise<PlanFeature>;
3243
4011
  /** Detach a feature from a plan. */
3244
4012
  removeFeature(params: RemovePlanFeatureParams, options?: RequestOptions): Promise<RemovedPlanFeature>;
3245
4013
  /** Attach a feature to a plan with limits, overage, and credits configuration. */
3246
4014
  addFeature(params: AddPlanFeatureParams, options?: RequestOptions): Promise<PlanFeature>;
4015
+ /** Cancel a move for every subscriber who has not moved yet. They stay on their version; those already moved stay moved. */
4016
+ cancelMove(params: CancelPlanMoveParams, options?: RequestOptions): Promise<PlanMove>;
4017
+ /** Read a move of subscribers between plan versions with each subscriber's status: moving, moved, needs a change, left out, canceled or kept on its version. */
4018
+ getMove(params: GetPlanMoveParams, options?: RequestOptions): Promise<PlanMove>;
4019
+ /** Cancel a move for one subscriber who has not moved yet. It stays on its version; the rest of the move continues. */
4020
+ cancelMoveSubscription(params: CancelPlanMoveSubscriptionParams, options?: RequestOptions): Promise<PlanMove>;
4021
+ /** List a plan's latest moves of subscribers between versions, newest first, including the change of a single subscription, with how many are moving, moved, need a change, were left out, canceled or kept on their version. */
4022
+ listMoves(params: ListPlanMovesParams, options?: RequestOptions): Promise<{
4023
+ object: "list";
4024
+ data: Array<PlanMove>;
4025
+ hasMore: boolean;
4026
+ nextCursor?: string;
4027
+ }>;
4028
+ /** Move a list of subscriptions, or every subscription of another version, to a newer version of the plan, at their next renewal or now. Nobody moves unless every one of them fits or has a change in changes; otherwise the response lists each one with what would make it fit. Only active, trialing and past due subscriptions move. Paused ones, and listed subscriptions in another status or already on the destination, are left out. Send preview to check without moving anyone. */
4029
+ createMove(params: CreatePlanMoveParams, options?: RequestOptions): Promise<PlanMove>;
4030
+ /** Leave a subscriber that needs a change on its version. It stops appearing among the subscribers that need a change; move it later like any other subscriber. */
4031
+ keepSubscriberOnVersion(params: KeepPlanSubscriberOnVersionParams, options?: RequestOptions): Promise<KeptOnVersion>;
4032
+ /** List the plan's subscribers whose move could not complete, with the version they stay on, the one they could not move to and why. Move them again with a change, or keep them on their version so they leave this list. */
4033
+ listSubscribersNeedingAChange(params: ListPlanSubscribersNeedingAChangeParams, options?: RequestOptions): Promise<{
4034
+ object: "list";
4035
+ data: Array<SubscriberNeedingAChange>;
4036
+ hasMore: boolean;
4037
+ nextCursor?: string;
4038
+ }>;
3247
4039
  /** Set a specific price as the default and return the updated plan price. */
3248
4040
  setDefaultPrice(params: SetDefaultPlanPriceParams, options?: RequestOptions): Promise<PlanPrice>;
3249
4041
  /** Create or update regional currency price overrides for a plan price. */
@@ -3252,7 +4044,7 @@ declare class PlansResource {
3252
4044
  deleteRegionalPrices(params: DeleteRegionalPricesParams, options?: RequestOptions): Promise<DeletedPlanRegionalPricing>;
3253
4045
  /** Update a base price or market price variant. Removing a base market override is rejected while a variant depends on it. Offer terms are managed through Offers. */
3254
4046
  updatePrice(params: UpdatePlanPriceParams, options?: RequestOptions): Promise<PlanPrice>;
3255
- /** Archive a price for new subscriptions. Existing subscriptions that selected it continue using its current catalog value. */
4047
+ /** Archive a price for new subscriptions. This publishes a new version of the plan; existing subscriptions that selected the price keep paying it on their version until moved. */
3256
4048
  deletePrice(params: DeletePlanPriceParams, options?: RequestOptions): Promise<DeletedObject>;
3257
4049
  /** Add a base price or a selectable market price variant. Variants inherit their base price outside the markets they override. Configure introductory and promotional benefits through Offers. */
3258
4050
  addPrice(params: AddPlanPriceParams, options?: RequestOptions): Promise<PlanPrice>;
@@ -3264,6 +4056,19 @@ declare class PlansResource {
3264
4056
  update(params: UpdatePlanParams, options?: RequestOptions): Promise<Plan>;
3265
4057
  /** Soft-delete a plan. */
3266
4058
  delete(params: DeletePlanParams, options?: RequestOptions): Promise<DeletedObject>;
4059
+ /** List what changes from one version of a plan to another: prices, trials, features, rules, add-ons, credit packs and countries. */
4060
+ compareVersions(params: ComparePlanVersionsParams, options?: RequestOptions): Promise<PlanVersionComparison>;
4061
+ /** Get one published version of a plan with its prices and how many subscriptions are on it. */
4062
+ getVersion(params: GetPlanVersionParams, options?: RequestOptions): Promise<PlanVersion>;
4063
+ /** List a plan's published versions, newest first, with their prices and how many subscriptions are on each. Versions published before Commet recorded every term are not listed. */
4064
+ listVersions(params: ListPlanVersionsParams, options?: RequestOptions): Promise<{
4065
+ object: "list";
4066
+ data: Array<PlanVersion>;
4067
+ hasMore: boolean;
4068
+ nextCursor?: string;
4069
+ }>;
4070
+ /** Publish a new current version of the plan from its current version, changing prices per interval, included credits or balance, per-currency amounts and the rollover cap. New buyers get it; every subscriber stays on its version until moved. To try changes without selling them to everyone, create an experiment instead. */
4071
+ createVersion(params: CreatePlanVersionParams, options?: RequestOptions): Promise<PlanVersion>;
3267
4072
  /** Set a plan's public visibility and return the updated plan. */
3268
4073
  setVisibility(params: SetPlanVisibilityParams, options?: RequestOptions): Promise<Plan>;
3269
4074
  /** List plans with public price IDs and their automatic introductory offer IDs. */
@@ -3499,6 +4304,15 @@ type ChangePlanParams = {
3499
4304
  /** Promo code whose Offer prices the change, validated with the checkout's rules: a code the checkout would refuse returns 400 validation_error with the checkout's reason in details.reason. Cannot be combined with offerId. */
3500
4305
  promoCode: string;
3501
4306
  };
4307
+ interface ChangeSubscriptionVersionParams {
4308
+ id: string;
4309
+ /** A published version of the subscription's plan. */
4310
+ planVersionId: string;
4311
+ /** now changes features, limits and the included credits or balance at once (the included difference is added to or subtracted from the plan credits or plan balance: an increase first pays any plan-part debt, a decrease never creates new debt, and purchased credits and purchased balance are untouched) and charges the new price from the next renewal. period_end changes everything at the next renewal. There is never a proration charge or refund. */
4312
+ effective: "now" | "period_end";
4313
+ /** usd to charge the subscription in USD from its next renewal when the version does not sell the currency it pays, or the USD price of its country: it pays the version's USD price for its country, or the USD base price. The whole move then happens at that renewal, even with effective now. Rejected with missing_regional_price when the version still sells what the subscription pays or for another currency, and with a currency_held_by code naming what keeps it in its currency: currency_held_by_payment_method (it pays through dLocal), currency_held_by_customer_credit, currency_held_by_balance_plan, currency_held_by_fixed_amount_discount, currency_held_by_prepaid_period or currency_held_by_scheduled_pause. */
4314
+ currency?: string;
4315
+ }
3502
4316
  type PurchaseCreditsParams = {
3503
4317
  id: string;
3504
4318
  creditPackId: string;
@@ -3570,6 +4384,9 @@ interface GetSubscriptionParams {
3570
4384
  interface RevokeScheduledPlanChangeParams {
3571
4385
  id: string;
3572
4386
  }
4387
+ interface RevokeScheduledVersionChangeParams {
4388
+ id: string;
4389
+ }
3573
4390
  interface UncancelSubscriptionParams {
3574
4391
  id: string;
3575
4392
  }
@@ -3579,6 +4396,7 @@ interface GetActiveSubscriptionParams {
3579
4396
  interface ListSubscriptionsParams {
3580
4397
  customerId?: string;
3581
4398
  status?: SubscriptionStatus;
4399
+ planVersionId?: string;
3582
4400
  }
3583
4401
  type CreateSubscriptionParams = {
3584
4402
  customerId: string;
@@ -3598,6 +4416,8 @@ type CreateSubscriptionParams = {
3598
4416
  prepaidPeriods?: number;
3599
4417
  /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3600
4418
  cancelAtPeriodEnd?: boolean;
4419
+ /** Public ID of a published version of the plan, current or not, including an experiment's versions. The subscription is created on that version and stays on it: checkout charges its price and activation grants its credits, add-ons and credit packs. When omitted, the subscription gets the current version, or the version an experiment code (planCode `<plan code>:<experiment code>`) sells. */
4420
+ planVersionId?: string;
3601
4421
  offerId?: never;
3602
4422
  promoCode?: string;
3603
4423
  /** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
@@ -3622,11 +4442,14 @@ type CreateSubscriptionParams = {
3622
4442
  prepaidPeriods?: number;
3623
4443
  /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3624
4444
  cancelAtPeriodEnd?: boolean;
4445
+ /** Public ID of a published version of the plan, current or not, including an experiment's versions. The subscription is created on that version and stays on it: checkout charges its price and activation grants its credits, add-ons and credit packs. When omitted, the subscription gets the current version, or the version an experiment code (planCode `<plan code>:<experiment code>`) sells. */
4446
+ planVersionId?: string;
3625
4447
  offerId?: never;
3626
4448
  promoCode?: string;
3627
4449
  /** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
3628
4450
  customTrialDays?: number;
3629
4451
  skipTrial?: boolean;
4452
+ /** The plan code, or an experiment code as `<plan code>:<experiment code>` to sell the version the experiment sells. */
3630
4453
  planCode: string;
3631
4454
  } | {
3632
4455
  customerId: string;
@@ -3646,6 +4469,8 @@ type CreateSubscriptionParams = {
3646
4469
  prepaidPeriods?: number;
3647
4470
  /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3648
4471
  cancelAtPeriodEnd?: boolean;
4472
+ /** Public ID of a published version of the plan, current or not, including an experiment's versions. The subscription is created on that version and stays on it: checkout charges its price and activation grants its credits, add-ons and credit packs. When omitted, the subscription gets the current version, or the version an experiment code (planCode `<plan code>:<experiment code>`) sells. */
4473
+ planVersionId?: string;
3649
4474
  offerId: string;
3650
4475
  promoCode?: never;
3651
4476
  /** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
@@ -3670,11 +4495,14 @@ type CreateSubscriptionParams = {
3670
4495
  prepaidPeriods?: number;
3671
4496
  /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3672
4497
  cancelAtPeriodEnd?: boolean;
4498
+ /** Public ID of a published version of the plan, current or not, including an experiment's versions. The subscription is created on that version and stays on it: checkout charges its price and activation grants its credits, add-ons and credit packs. When omitted, the subscription gets the current version, or the version an experiment code (planCode `<plan code>:<experiment code>`) sells. */
4499
+ planVersionId?: string;
3673
4500
  offerId: string;
3674
4501
  promoCode?: never;
3675
4502
  /** Trial length in days, replacing the price's trial. A customer who already had this plan, in a trial or paying, gets no trial and goes through the regular checkout. */
3676
4503
  customTrialDays?: number;
3677
4504
  skipTrial?: boolean;
4505
+ /** The plan code, or an experiment code as `<plan code>:<experiment code>` to sell the version the experiment sells. */
3678
4506
  planCode: string;
3679
4507
  } | {
3680
4508
  customerId: string;
@@ -3694,6 +4522,8 @@ type CreateSubscriptionParams = {
3694
4522
  prepaidPeriods?: number;
3695
4523
  /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3696
4524
  cancelAtPeriodEnd?: boolean;
4525
+ /** Public ID of a published version of the plan, current or not, including an experiment's versions. The subscription is created on that version and stays on it: checkout charges its price and activation grants its credits, add-ons and credit packs. When omitted, the subscription gets the current version, or the version an experiment code (planCode `<plan code>:<experiment code>`) sells. */
4526
+ planVersionId?: string;
3697
4527
  offerId?: never;
3698
4528
  /** Public card promotion ID. The offer is shown immediately and remains conditional on card eligibility until checkout confirmation. */
3699
4529
  cardPromotionId: string;
@@ -3719,12 +4549,15 @@ type CreateSubscriptionParams = {
3719
4549
  prepaidPeriods?: number;
3720
4550
  /** Schedules the cancellation from creation so the subscription ends after its last paid period and never renews with any payment method. */
3721
4551
  cancelAtPeriodEnd?: boolean;
4552
+ /** Public ID of a published version of the plan, current or not, including an experiment's versions. The subscription is created on that version and stays on it: checkout charges its price and activation grants its credits, add-ons and credit packs. When omitted, the subscription gets the current version, or the version an experiment code (planCode `<plan code>:<experiment code>`) sells. */
4553
+ planVersionId?: string;
3722
4554
  offerId?: never;
3723
4555
  /** Public card promotion ID. The offer is shown immediately and remains conditional on card eligibility until checkout confirmation. */
3724
4556
  cardPromotionId: string;
3725
4557
  promoCode?: never;
3726
4558
  customTrialDays?: never;
3727
4559
  skipTrial?: false;
4560
+ /** The plan code, or an experiment code as `<plan code>:<experiment code>` to sell the version the experiment sells. */
3728
4561
  planCode: string;
3729
4562
  };
3730
4563
  declare class SubscriptionsResource {
@@ -3732,7 +4565,7 @@ declare class SubscriptionsResource {
3732
4565
  constructor(httpClient: CommetHTTPClient);
3733
4566
  /** Deactivate an add-on from a subscription. */
3734
4567
  deactivateAddon(params: DeactivateAddonParams, options?: RequestOptions): Promise<DeletedSubscriptionAddon>;
3735
- /** Activate an add-on on a subscription. Charges a prorated amount for the current billing period. */
4568
+ /** Activate an add-on on a subscription. Creates the activation invoice and charges a prorated amount for the current billing period; the add-on is active once the payment is confirmed. Rejected with 409 while the add-on is active or an activation of it is still processing. An add-on that the subscription's plan version does not sell is rejected with addon_unavailable. */
3736
4569
  activateAddon(params: ActivateAddonParams, options?: RequestOptions): Promise<SubscriptionAddon>;
3737
4570
  /** Read whether the subscription tops up automatically with its saved payment method when its available credits or balance reach a threshold, with the top-ups used this period and the last failure. */
3738
4571
  getAutoTopUp(params: GetSubscriptionAutoTopUpParams, options?: RequestOptions): Promise<SubscriptionAutoTopUp>;
@@ -3740,13 +4573,15 @@ declare class SubscriptionsResource {
3740
4573
  updateAutoTopUp(params: UpdateSubscriptionAutoTopUpParams, options?: RequestOptions): Promise<SubscriptionAutoTopUp>;
3741
4574
  /** Adjust a subscription's balance or credits by a signed amount. Positive adds, negative subtracts. */
3742
4575
  adjustBalance(params: AdjustBalanceParams, options?: RequestOptions): Promise<BalanceAdjustment>;
3743
- /** Top up a balance subscription. Charges the customer's payment method for the amount plus tax, adds it to the subscription's purchased balance (after paying back any overage owed on the plan balance), creates its invoice and emits `balance.topped_up`. Purchased balance is spent after the plan balance and is kept until the subscription ends. Rejected with 400 when the subscription is not on a balance plan, its plan has top-ups turned off, or the amount is below the effective minimum: the plan's minimum top-up in the subscription currency, raised to the currency's minimum charge. */
4576
+ /** Top up a balance subscription. Creates the top-up invoice and charges the customer's payment method for the amount plus tax. Once the payment is confirmed, adds the amount to the subscription's purchased balance (after paying back any overage owed on the plan balance), marks the invoice paid and emits `balance.topped_up`. Purchased balance is spent after the plan balance and is kept until the subscription ends. Rejected with 400 when the subscription is not on a balance plan, its plan has top-ups turned off, or the amount is below the effective minimum: the plan's minimum top-up in the subscription currency, raised to the currency's minimum charge. */
3744
4577
  topupBalance(params: TopupBalanceParams, options?: RequestOptions): Promise<BalanceTopup>;
3745
4578
  /** Cancel immediately or at period end and return the updated subscription. */
3746
4579
  cancel(params: CancelSubscriptionParams, options?: RequestOptions): Promise<Subscription>;
3747
4580
  /** Upgrade or change billing interval immediately, optionally applying an Offer by offerId or the Offer of a promoCode. Scheduled changes accept neither offerId nor promoCode. From a free plan, a promoCode opens the checkout with the code applied and counts its use when the checkout is paid; without offerId or promoCode, a destination price whose free trial requires no payment method starts that trial right away without checkout. During a trial without a payment method, an immediate change returns 409 no_payment_method; scheduled changes still apply. */
3748
4581
  changePlan(params: ChangePlanParams, options?: RequestOptions): Promise<PlanChange>;
3749
- /** Purchase a fixed credit pack or choose a whole credit quantity at the subscription plan price and minimum. Charges the saved payment method and adds purchased credits. */
4582
+ /** Move a subscription to a newer published version of its plan, now or at the end of the period, without proration; an older version is rejected with version_not_newer, and a subscription on a running experiment moves only to a later version of that experiment. The subscription keeps its currency and its price: a destination that does not sell its currency is rejected with missing_regional_price unless currency asks to charge it in USD from its renewal, and one that does not sell the price it pays with price_not_found. A free version moves only to a free version and a paid one only to a paid one (validation_error). A subscription whose usage does not fit the destination, or with an active add-on the destination does not sell, is not moved either, and the error says why. Each change is recorded as a move of this one subscription in the plan's moves. Repeating the same request changes nothing; a new one replaces the pending move. */
4583
+ changeVersion(params: ChangeSubscriptionVersionParams, options?: RequestOptions): Promise<Subscription>;
4584
+ /** Purchase a fixed credit pack or choose a whole credit quantity at the subscription plan price and minimum. Creates the purchase invoice, charges the saved payment method and adds the purchased credits once the payment is confirmed. A credit pack that the subscription's plan version does not sell is rejected with credit_pack_unavailable. */
3750
4585
  purchaseCredits(params: PurchaseCreditsParams, options?: RequestOptions): Promise<CreditGrant>;
3751
4586
  /** Apply a direct Offer to a subscription. On a pending checkout it quotes or replaces the checkout discount, which starts after the plan price trial when there is one, and the existing checkout URL remains unchanged. On an active subscription it applies the Offer immediately with its discount phases starting at the next billing cycle; the call is rejected while another applied Offer still has active or upcoming discount phases. */
3752
4587
  applyOffer(params: ApplySubscriptionOfferParams, options?: RequestOptions): Promise<Subscription>;
@@ -3774,6 +4609,8 @@ declare class SubscriptionsResource {
3774
4609
  get(params: GetSubscriptionParams, options?: RequestOptions): Promise<Subscription>;
3775
4610
  /** Revoke the plan or interval change scheduled for the end of the period, so the subscription stays on its current plan. Returns the updated subscription. */
3776
4611
  revokeScheduledPlanChange(params: RevokeScheduledPlanChangeParams, options?: RequestOptions): Promise<Subscription>;
4612
+ /** Cancel the move to another plan version pending for the next renewal, so the subscription stays on its version, and send subscription.version_change_canceled with reason canceled_by_merchant. A move made now has nothing pending to revoke. With nothing pending it changes nothing. Returns the subscription. */
4613
+ revokeScheduledVersionChange(params: RevokeScheduledVersionChangeParams, options?: RequestOptions): Promise<Subscription>;
3777
4614
  /** Revert a scheduled cancellation and return the updated subscription. Only works before cancellation takes effect. */
3778
4615
  uncancel(params: UncancelSubscriptionParams, options?: RequestOptions): Promise<Subscription>;
3779
4616
  /** Get the active subscription for a customer. Returns null if none. */
@@ -3811,6 +4648,8 @@ declare class TestClockResource {
3811
4648
 
3812
4649
  interface RefundTransactionParams {
3813
4650
  id: string;
4651
+ /** Amount returned to the customer, including tax, in the payment currency’s smallest unit. Omit to refund the remainder. */
4652
+ amount?: number;
3814
4653
  }
3815
4654
  interface RetryTransactionParams {
3816
4655
  id: string;
@@ -3827,7 +4666,7 @@ interface ListTransactionsParams {
3827
4666
  declare class TransactionsResource {
3828
4667
  private httpClient;
3829
4668
  constructor(httpClient: CommetHTTPClient);
3830
- /** Issue a full refund and return the provider-neutral refund resource with its actual status. */
4669
+ /** Refund a positive amount in the payment currency’s smallest unit, or omit amount to refund the remaining amount. Returns the refund resource with its actual status. */
3831
4670
  refund(params: RefundTransactionParams, options?: RequestOptions): Promise<Refund>;
3832
4671
  /** Retry a failed subscription renewal and return an honest retry result. The original failed transaction remains immutable. */
3833
4672
  retry(params: RetryTransactionParams, options?: RequestOptions): Promise<TransactionRetry>;
@@ -3923,7 +4762,7 @@ declare class GeneratedResources {
3923
4762
  protected initResources(http: CommetHTTPClient): void;
3924
4763
  }
3925
4764
 
3926
- type WebhookEvent = "subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed";
4765
+ type WebhookEvent = "subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.version_changed" | "subscription.version_change_canceled" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed";
3927
4766
  /** Fired when a subscription record is created, usually with status pending_payment: the first charge has not been confirmed yet — do NOT grant access here; wait for subscription.activated. A trial whose price requires no payment method is created already trialing, together with trial.started. */
3928
4767
  interface SubscriptionCreatedData {
3929
4768
  /** The subscription ID. */
@@ -4197,6 +5036,32 @@ interface SubscriptionPlanChangeRevokedData {
4197
5036
  /** The previously scheduled billing interval, if the revoked change included one. */
4198
5037
  revokedBillingInterval: string | null;
4199
5038
  }
5039
+ /** Fired when a subscription moves to another version of its plan: a move applied now or a scheduled move that took effect at renewal. Making an experiment current moves nobody, so it sends none. The plan stays the same; the version's prices and features apply from now on. */
5040
+ interface SubscriptionVersionChangedData {
5041
+ /** The subscription ID. */
5042
+ subscriptionId: string;
5043
+ /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
5044
+ customerId: string;
5045
+ /** The version the subscription left. */
5046
+ fromVersionId: string;
5047
+ /** The version the subscription is on now. */
5048
+ toVersionId: string;
5049
+ /** The currency the subscription pays in. */
5050
+ currency: string;
5051
+ /** The billing interval the subscription pays. */
5052
+ billingInterval: string;
5053
+ }
5054
+ /** Fired when a scheduled move to another plan version will no longer take effect because the subscription no longer fit the version at its renewal, or because the merchant revoked the scheduled version change or canceled the plan move. A new move that replaces it, a move made now, a plan change or an immediate cancellation sends none. The subscription stays on its version; reason says why. */
5055
+ interface SubscriptionVersionChangeCanceledData {
5056
+ /** The subscription ID. */
5057
+ subscriptionId: string;
5058
+ /** The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId. */
5059
+ customerId: string;
5060
+ /** The version the subscription was going to move to. */
5061
+ toVersionId: string;
5062
+ /** Why the move was canceled: canceled_by_merchant, version_change_failed when the move could not be applied at renewal, the code of what the subscription no longer fits (addon_unavailable, seat_limit_exceeded, price_not_found, missing_regional_price), or, for a move that charges it in USD, what keeps it in its currency (currency_held_by_payment_method, currency_held_by_customer_credit, currency_held_by_balance_plan, currency_held_by_fixed_amount_discount, currency_held_by_prepaid_period, currency_held_by_scheduled_pause). */
5063
+ reason: string;
5064
+ }
4200
5065
  /** Fired when a recurring payment fails on a previously paid subscription and its status becomes past_due. past_due is a grace window, not a cutoff: usage and seats keep working while new purchases are blocked, and dunning retries the charge — use this to notify the customer and recover the payment. */
4201
5066
  interface SubscriptionPastDueData {
4202
5067
  /** The subscription ID. */
@@ -4434,6 +5299,8 @@ interface PaymentRefundedData {
4434
5299
  customerId: string | null;
4435
5300
  /** The subscription ID, if the invoice is linked to a subscription. */
4436
5301
  subscriptionId: string | null;
5302
+ /** Cumulative confirmed refunds in the payment currency’s smallest unit. */
5303
+ amountRefunded: number;
4437
5304
  /** The refunded amount in cents (100 = $1.00). */
4438
5305
  refundAmount: number;
4439
5306
  /** The refund currency code. */
@@ -4624,7 +5491,7 @@ interface InvoiceCreatedData {
4624
5491
  /** The subscription ID, if the invoice is linked to a subscription. */
4625
5492
  subscriptionId: string | null;
4626
5493
  }
4627
- /** 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. */
5494
+ /** Fired when an invoice is voided — nullified before collection, for example when its subscription is canceled. Voiding is terminal: a void invoice is never retried or collected. */
4628
5495
  interface InvoiceVoidedData {
4629
5496
  /** The invoice ID. */
4630
5497
  invoiceId: string;
@@ -4890,8 +5757,10 @@ interface CustomerStateChangedData {
4890
5757
  creditsPerUnit: number;
4891
5758
  /** Actual credits deducted by this feature during the period. */
4892
5759
  creditsConsumed: number;
4893
- /** Additional product units available from the current shared credit pool at this feature's conversion rate. */
4894
- availableUnits: number;
5760
+ /** Whether the plan credits are unlimited: usage never spends them and only the plan credit limit caps it. */
5761
+ unlimited: boolean;
5762
+ /** Additional product units available from the current shared credit pool at this feature's conversion rate. Absent when unlimited is true. */
5763
+ availableUnits?: number;
4895
5764
  } | {
4896
5765
  /** Product usage deducts money from a shared balance. */
4897
5766
  model: "balance";
@@ -4917,7 +5786,9 @@ interface CustomerStateChangedData {
4917
5786
  /** Lowercase ISO 4217 currency code. */
4918
5787
  currency: string;
4919
5788
  };
4920
- /** Estimated additional units available from the current shared balance at this feature's fixed price. Absent for dynamic pricing. */
5789
+ /** Whether the plan balance is unlimited: usage never spends it and only the plan balance limit caps it. */
5790
+ unlimited: boolean;
5791
+ /** Estimated additional units available from the current shared balance at this feature's fixed price. Absent for dynamic pricing and when unlimited is true. */
4921
5792
  availableUnits?: number;
4922
5793
  /** Price for one additional product unit. */
4923
5794
  unitPrice?: {
@@ -5515,7 +6386,7 @@ interface WebhookEventEnvelope<E extends WebhookEvent, D> {
5515
6386
  apiVersion: string;
5516
6387
  data: D;
5517
6388
  }
5518
- type WebhookEventPayload = WebhookEventEnvelope<"subscription.created", SubscriptionCreatedData> | WebhookEventEnvelope<"subscription.activated", SubscriptionActivatedData> | WebhookEventEnvelope<"subscription.reactivated", SubscriptionReactivatedData> | WebhookEventEnvelope<"subscription.pause_scheduled", SubscriptionPauseScheduledData> | WebhookEventEnvelope<"subscription.pause_updated", SubscriptionPauseUpdatedData> | WebhookEventEnvelope<"subscription.pause_revoked", SubscriptionPauseRevokedData> | WebhookEventEnvelope<"subscription.paused", SubscriptionPausedData> | WebhookEventEnvelope<"subscription.resumed", SubscriptionResumedData> | WebhookEventEnvelope<"subscription.resume_failed", SubscriptionResumeFailedData> | WebhookEventEnvelope<"subscription.canceled", SubscriptionCanceledData> | WebhookEventEnvelope<"subscription.updated", SubscriptionUpdatedData> | WebhookEventEnvelope<"subscription.plan_changed", SubscriptionPlanChangedData> | WebhookEventEnvelope<"subscription.cancellation_scheduled", SubscriptionCancellationScheduledData> | WebhookEventEnvelope<"subscription.cancellation_revoked", SubscriptionCancellationRevokedData> | WebhookEventEnvelope<"subscription.plan_change_scheduled", SubscriptionPlanChangeScheduledData> | WebhookEventEnvelope<"subscription.plan_change_revoked", SubscriptionPlanChangeRevokedData> | WebhookEventEnvelope<"subscription.past_due", SubscriptionPastDueData> | WebhookEventEnvelope<"trial.started", TrialStartedData> | WebhookEventEnvelope<"trial.converted", TrialConvertedData> | WebhookEventEnvelope<"trial.expired", TrialExpiredData> | WebhookEventEnvelope<"trial.will_end", TrialWillEndData> | WebhookEventEnvelope<"trial.checkout_ready", TrialCheckoutReadyData> | WebhookEventEnvelope<"checkout.ready", CheckoutReadyData> | WebhookEventEnvelope<"payment.received", PaymentReceivedData> | WebhookEventEnvelope<"payment.failed", PaymentFailedData> | WebhookEventEnvelope<"payment.recovered", PaymentRecoveredData> | WebhookEventEnvelope<"payment.retry_failed", PaymentRetryFailedData> | WebhookEventEnvelope<"payment.refunded", PaymentRefundedData> | WebhookEventEnvelope<"payment.disputed", PaymentDisputedData> | WebhookEventEnvelope<"payment.dispute_resolved", PaymentDisputeResolvedData> | WebhookEventEnvelope<"payment_link.created", PaymentLinkCreatedData> | WebhookEventEnvelope<"payment_link.completed", PaymentLinkCompletedData> | WebhookEventEnvelope<"payment_link.failed", PaymentLinkFailedData> | WebhookEventEnvelope<"payment_link.canceled", PaymentLinkCanceledData> | WebhookEventEnvelope<"invoice.created", InvoiceCreatedData> | WebhookEventEnvelope<"invoice.voided", InvoiceVoidedData> | WebhookEventEnvelope<"invoice.overdue", InvoiceOverdueData> | WebhookEventEnvelope<"invoice.upcoming", InvoiceUpcomingData> | WebhookEventEnvelope<"payment_method.attached", PaymentMethodAttachedData> | WebhookEventEnvelope<"payment_method.updated", PaymentMethodUpdatedData> | WebhookEventEnvelope<"payment_method.detached", PaymentMethodDetachedData> | WebhookEventEnvelope<"customer.created", CustomerCreatedData> | WebhookEventEnvelope<"customer.updated", CustomerUpdatedData> | WebhookEventEnvelope<"customer.state_changed", CustomerStateChangedData> | WebhookEventEnvelope<"plan_grant.created", PlanGrantCreatedData> | WebhookEventEnvelope<"plan_grant.updated", PlanGrantUpdatedData> | WebhookEventEnvelope<"plan_grant.expired", PlanGrantExpiredData> | WebhookEventEnvelope<"plan_grant.revoked", PlanGrantRevokedData> | WebhookEventEnvelope<"credits.granted", CreditsGrantedData> | WebhookEventEnvelope<"credits.purchased", CreditsPurchasedData> | WebhookEventEnvelope<"credits.low", CreditsLowData> | WebhookEventEnvelope<"credits.depleted", CreditsDepletedData> | WebhookEventEnvelope<"credits.expired", CreditsExpiredData> | WebhookEventEnvelope<"balance.granted", BalanceGrantedData> | WebhookEventEnvelope<"balance.topped_up", BalanceToppedUpData> | WebhookEventEnvelope<"balance.low", BalanceLowData> | WebhookEventEnvelope<"balance.depleted", BalanceDepletedData> | WebhookEventEnvelope<"balance.expired", BalanceExpiredData> | WebhookEventEnvelope<"quota.threshold_reached", QuotaThresholdReachedData> | WebhookEventEnvelope<"quota.exceeded", QuotaExceededData> | WebhookEventEnvelope<"seats.updated", SeatsUpdatedData> | WebhookEventEnvelope<"seats.limit_reached", SeatsLimitReachedData> | WebhookEventEnvelope<"addon.activated", AddonActivatedData> | WebhookEventEnvelope<"addon.deactivated", AddonDeactivatedData> | WebhookEventEnvelope<"usage.recorded", UsageRecordedData> | WebhookEventEnvelope<"payout.available", PayoutAvailableData> | WebhookEventEnvelope<"payout.created", PayoutCreatedData> | WebhookEventEnvelope<"payout.paid", PayoutPaidData> | WebhookEventEnvelope<"payout.failed", PayoutFailedData>;
6389
+ type WebhookEventPayload = WebhookEventEnvelope<"subscription.created", SubscriptionCreatedData> | WebhookEventEnvelope<"subscription.activated", SubscriptionActivatedData> | WebhookEventEnvelope<"subscription.reactivated", SubscriptionReactivatedData> | WebhookEventEnvelope<"subscription.pause_scheduled", SubscriptionPauseScheduledData> | WebhookEventEnvelope<"subscription.pause_updated", SubscriptionPauseUpdatedData> | WebhookEventEnvelope<"subscription.pause_revoked", SubscriptionPauseRevokedData> | WebhookEventEnvelope<"subscription.paused", SubscriptionPausedData> | WebhookEventEnvelope<"subscription.resumed", SubscriptionResumedData> | WebhookEventEnvelope<"subscription.resume_failed", SubscriptionResumeFailedData> | WebhookEventEnvelope<"subscription.canceled", SubscriptionCanceledData> | WebhookEventEnvelope<"subscription.updated", SubscriptionUpdatedData> | WebhookEventEnvelope<"subscription.plan_changed", SubscriptionPlanChangedData> | WebhookEventEnvelope<"subscription.cancellation_scheduled", SubscriptionCancellationScheduledData> | WebhookEventEnvelope<"subscription.cancellation_revoked", SubscriptionCancellationRevokedData> | WebhookEventEnvelope<"subscription.plan_change_scheduled", SubscriptionPlanChangeScheduledData> | WebhookEventEnvelope<"subscription.plan_change_revoked", SubscriptionPlanChangeRevokedData> | WebhookEventEnvelope<"subscription.version_changed", SubscriptionVersionChangedData> | WebhookEventEnvelope<"subscription.version_change_canceled", SubscriptionVersionChangeCanceledData> | WebhookEventEnvelope<"subscription.past_due", SubscriptionPastDueData> | WebhookEventEnvelope<"trial.started", TrialStartedData> | WebhookEventEnvelope<"trial.converted", TrialConvertedData> | WebhookEventEnvelope<"trial.expired", TrialExpiredData> | WebhookEventEnvelope<"trial.will_end", TrialWillEndData> | WebhookEventEnvelope<"trial.checkout_ready", TrialCheckoutReadyData> | WebhookEventEnvelope<"checkout.ready", CheckoutReadyData> | WebhookEventEnvelope<"payment.received", PaymentReceivedData> | WebhookEventEnvelope<"payment.failed", PaymentFailedData> | WebhookEventEnvelope<"payment.recovered", PaymentRecoveredData> | WebhookEventEnvelope<"payment.retry_failed", PaymentRetryFailedData> | WebhookEventEnvelope<"payment.refunded", PaymentRefundedData> | WebhookEventEnvelope<"payment.disputed", PaymentDisputedData> | WebhookEventEnvelope<"payment.dispute_resolved", PaymentDisputeResolvedData> | WebhookEventEnvelope<"payment_link.created", PaymentLinkCreatedData> | WebhookEventEnvelope<"payment_link.completed", PaymentLinkCompletedData> | WebhookEventEnvelope<"payment_link.failed", PaymentLinkFailedData> | WebhookEventEnvelope<"payment_link.canceled", PaymentLinkCanceledData> | WebhookEventEnvelope<"invoice.created", InvoiceCreatedData> | WebhookEventEnvelope<"invoice.voided", InvoiceVoidedData> | WebhookEventEnvelope<"invoice.overdue", InvoiceOverdueData> | WebhookEventEnvelope<"invoice.upcoming", InvoiceUpcomingData> | WebhookEventEnvelope<"payment_method.attached", PaymentMethodAttachedData> | WebhookEventEnvelope<"payment_method.updated", PaymentMethodUpdatedData> | WebhookEventEnvelope<"payment_method.detached", PaymentMethodDetachedData> | WebhookEventEnvelope<"customer.created", CustomerCreatedData> | WebhookEventEnvelope<"customer.updated", CustomerUpdatedData> | WebhookEventEnvelope<"customer.state_changed", CustomerStateChangedData> | WebhookEventEnvelope<"plan_grant.created", PlanGrantCreatedData> | WebhookEventEnvelope<"plan_grant.updated", PlanGrantUpdatedData> | WebhookEventEnvelope<"plan_grant.expired", PlanGrantExpiredData> | WebhookEventEnvelope<"plan_grant.revoked", PlanGrantRevokedData> | WebhookEventEnvelope<"credits.granted", CreditsGrantedData> | WebhookEventEnvelope<"credits.purchased", CreditsPurchasedData> | WebhookEventEnvelope<"credits.low", CreditsLowData> | WebhookEventEnvelope<"credits.depleted", CreditsDepletedData> | WebhookEventEnvelope<"credits.expired", CreditsExpiredData> | WebhookEventEnvelope<"balance.granted", BalanceGrantedData> | WebhookEventEnvelope<"balance.topped_up", BalanceToppedUpData> | WebhookEventEnvelope<"balance.low", BalanceLowData> | WebhookEventEnvelope<"balance.depleted", BalanceDepletedData> | WebhookEventEnvelope<"balance.expired", BalanceExpiredData> | WebhookEventEnvelope<"quota.threshold_reached", QuotaThresholdReachedData> | WebhookEventEnvelope<"quota.exceeded", QuotaExceededData> | WebhookEventEnvelope<"seats.updated", SeatsUpdatedData> | WebhookEventEnvelope<"seats.limit_reached", SeatsLimitReachedData> | WebhookEventEnvelope<"addon.activated", AddonActivatedData> | WebhookEventEnvelope<"addon.deactivated", AddonDeactivatedData> | WebhookEventEnvelope<"usage.recorded", UsageRecordedData> | WebhookEventEnvelope<"payout.available", PayoutAvailableData> | WebhookEventEnvelope<"payout.created", PayoutCreatedData> | WebhookEventEnvelope<"payout.paid", PayoutPaidData> | WebhookEventEnvelope<"payout.failed", PayoutFailedData>;
5519
6390
  interface WebhookEventDataMap {
5520
6391
  "subscription.created": SubscriptionCreatedData;
5521
6392
  "subscription.activated": SubscriptionActivatedData;
@@ -5533,6 +6404,8 @@ interface WebhookEventDataMap {
5533
6404
  "subscription.cancellation_revoked": SubscriptionCancellationRevokedData;
5534
6405
  "subscription.plan_change_scheduled": SubscriptionPlanChangeScheduledData;
5535
6406
  "subscription.plan_change_revoked": SubscriptionPlanChangeRevokedData;
6407
+ "subscription.version_changed": SubscriptionVersionChangedData;
6408
+ "subscription.version_change_canceled": SubscriptionVersionChangeCanceledData;
5536
6409
  "subscription.past_due": SubscriptionPastDueData;
5537
6410
  "trial.started": TrialStartedData;
5538
6411
  "trial.converted": TrialConvertedData;
@@ -5618,7 +6491,7 @@ interface GetWebhookEndpointParams {
5618
6491
  interface UpdateWebhookEndpointParams {
5619
6492
  id: string;
5620
6493
  url?: string;
5621
- events?: Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">;
6494
+ events?: Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.version_changed" | "subscription.version_change_canceled" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">;
5622
6495
  description?: string | null;
5623
6496
  isActive?: boolean;
5624
6497
  apiVersion?: string;
@@ -5635,7 +6508,7 @@ interface ListWebhookEndpointsParams {
5635
6508
  }
5636
6509
  interface CreateWebhookEndpointParams {
5637
6510
  url: string;
5638
- events: Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">;
6511
+ events: Array<"subscription.created" | "subscription.activated" | "subscription.reactivated" | "subscription.pause_scheduled" | "subscription.pause_updated" | "subscription.pause_revoked" | "subscription.paused" | "subscription.resumed" | "subscription.resume_failed" | "subscription.canceled" | "subscription.updated" | "subscription.plan_changed" | "subscription.cancellation_scheduled" | "subscription.cancellation_revoked" | "subscription.plan_change_scheduled" | "subscription.plan_change_revoked" | "subscription.version_changed" | "subscription.version_change_canceled" | "subscription.past_due" | "trial.started" | "trial.converted" | "trial.expired" | "trial.will_end" | "trial.checkout_ready" | "checkout.ready" | "payment.received" | "payment.failed" | "payment.recovered" | "payment.retry_failed" | "payment.refunded" | "payment.disputed" | "payment.dispute_resolved" | "payment_link.created" | "payment_link.completed" | "payment_link.failed" | "payment_link.canceled" | "invoice.created" | "invoice.voided" | "invoice.overdue" | "invoice.upcoming" | "payment_method.attached" | "payment_method.updated" | "payment_method.detached" | "customer.created" | "customer.updated" | "customer.state_changed" | "plan_grant.created" | "plan_grant.updated" | "plan_grant.expired" | "plan_grant.revoked" | "credits.granted" | "credits.purchased" | "credits.low" | "credits.depleted" | "credits.expired" | "balance.granted" | "balance.topped_up" | "balance.low" | "balance.depleted" | "balance.expired" | "quota.threshold_reached" | "quota.exceeded" | "seats.updated" | "seats.limit_reached" | "addon.activated" | "addon.deactivated" | "usage.recorded" | "payout.available" | "payout.created" | "payout.paid" | "payout.failed">;
5639
6512
  description?: string;
5640
6513
  apiVersion?: string;
5641
6514
  }
@@ -5673,4 +6546,4 @@ declare function registerIntegration(name: string, version: string): void;
5673
6546
  declare const API_VERSION = "2026-08-27";
5674
6547
  declare const SDK_VERSION: string;
5675
6548
 
5676
- export { API_VERSION, type ActivateAddonParams, type ActiveAddon, type AddPayoutBankAccountParams, type AddPlanFeatureParams, type AddPlanPriceParams, type AddPlanToGroupParams, type AddQuotaParams, type AddSeatsParams, type AddedPlanToGroup, type Addon, type AddonActivatedData, type AddonDeactivatedData, type AdjustBalanceParams, type AdvanceTestClockParams, type ApiErrorDetail, type ApiKey, type ApplySubscriptionOfferParams, type BalanceAdjustment, type BalanceDepletedData, type BalanceExpiredData, type BalanceGrantedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSetSeatsParams, type BusinessTaxId, type CancelPaymentParams, type CancelSubscriptionParams, type ChangePlanParams, type ChargePaymentParams, type CheckUsageAvailabilityParams, type CheckoutReadyData, type ClaimLink, Commet, CommetAPIError, type CommetClientOptions, CommetError, type CommetErrorContext, CommetValidationError, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerCreditParams, type CreateCustomerParams, type CreateFeatureParams, type CreateMarketParams, type CreateOfferParams, type CreatePaymentParams, type CreatePlanGrantParams, type CreatePlanGroupParams, type CreatePlanParams, type CreatePrepaidPeriodsCheckoutParams, type CreatePromoCodeParams, type CreateSubscriptionParams, type CreateSubscriptionRecoveryLinkParams, type CreateWebhookEndpointParams, type CreatedApiKey, type CreatedSubscription, type CreatedWebhook, type CreditGrant, type CreditPack, type CreditPackListItem, type CreditsDepletedData, type CreditsExpiredData, type CreditsGrantedData, type CreditsLowData, type CreditsPurchasedData, type Customer, type CustomerBatch, type CustomerCreatedData, type CustomerCredit, type CustomerCreditRevocation, type CustomerStateChangedData, type CustomerUpdatedData, type DeactivateAddonParams, type DeleteAddonParams, type DeleteApiKeyParams, type DeleteCreditPackParams, type DeleteFeatureParams, type DeleteMarketParams, type DeleteOfferParams, type DeletePlanGroupParams, type DeletePlanParams, type DeletePlanPriceParams, type DeleteRegionalPricesParams, type DeleteWebhookEndpointParams, type DeletedObject, type DeletedOffer, type DeletedPlanRegionalPricing, type DeletedSubscriptionAddon, type DownloadInvoiceParams, type Feature, type FeatureAccess, type FeatureDef, type FeatureType, type GetActiveSubscriptionParams, type GetAddonParams, type GetAllQuotaAllowancesParams, type GetAllSeatBalancesParams, type GetCustomerParams, type GetFeatureAccessParams, type GetFeatureParams, type GetInvoiceParams, type GetMarketParams, type GetOfferParams, type GetPaymentParams, type GetPlanGroupParams, type GetPlanParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionAutoTopUpParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookEndpointParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceListItem, type InvoiceOverdueData, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomerCreditsParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListOffersParams, type ListPaymentsParams, type ListPlanGrantsParams, type ListPlanGroupsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhookEndpointsParams, type ManagedBy, type Market, type Offer, type PauseSubscriptionParams, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethod, type PaymentMethodAttachedData, type PaymentMethodDetachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type Plan, type PlanChange, type PlanDef, type PlanFeature, type PlanFeatureValue, type PlanGrant, type PlanGrantCreatedData, type PlanGrantExpiredData, type PlanGrantRevokedData, type PlanGrantUpdatedData, type PlanGroup, type PlanGroupDetail, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PortalAccess, type PrepaidPeriodsCheckout, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type Refund, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemoveSubscriptionOfferParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type ResumeSubscriptionParams, type RetryTransactionParams, type RevokeCustomerCreditParams, type RevokePlanGrantParams, type RevokeScheduledPlanChangeParams, type RevokeSubscriptionPauseParams, SDK_VERSION, type SeatBalance, type SeatBalanceCollection, type SeatEvent, type SeatsLimitReachedData, type SeatsUpdatedData, type SendInvoiceParams, type SentInvoice, type SetDefaultPlanPriceParams, type SetPlanRegionalPricingParams, type SetPlanVisibilityParams, type SetQuotaParams, type SetSeatsParams, type SetUsageParams, type SubPaymentMethod, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionAutoTopUp, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionOfferApplication, type SubscriptionOfferApplicationPhase, type SubscriptionPastDueData, type SubscriptionPauseRevokedData, type SubscriptionPauseScheduledData, type SubscriptionPauseUpdatedData, type SubscriptionPausedData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionResume, type SubscriptionResumeFailedData, type SubscriptionResumedData, type SubscriptionStatus, type SubscriptionSummary, type SubscriptionUpdatedData, type TestClock, type TestClockRun, type TestWebhookEndpointParams, type Timezone, type TopupBalanceParams, type TrackUsageParams, type Transaction, type TransactionListItem, type TransactionRetry, type TransactionStatus, type TrialCheckoutReadyData, type TrialConvertedData, type TrialExpiredData, type TrialStartedData, type TrialWillEndData, type UncancelSubscriptionParams, type UpdateAddonParams, type UpdateCreditPackParams, type UpdateCustomerParams, type UpdateFeatureParams, type UpdateInvoiceStatusParams, type UpdateMarketParams, type UpdateOfferParams, type UpdatePaymentMethodParams, type UpdatePlanFeatureParams, type UpdatePlanGrantParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateSubscriptionAutoTopUpParams, type UpdateSubscriptionPauseParams, type UpdateWebhookEndpointParams, type UpsertRegionalPricesParams, type UsageAdjustment, type UsageCheck, type UsageEvent, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type Webhook, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookPayload, type WebhookPlanGrantTimelineEvent, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTest, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };
6549
+ 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 ArchivePlanExperimentParams, type BalanceAdjustment, type BalanceDepletedData, type BalanceExpiredData, type BalanceGrantedData, type BalanceLowData, type BalanceToppedUpData, type BalanceTopup, type BatchCreateCustomersParams, type BillingConfig, type BillingInterval, type BulkSetSeatsParams, type BusinessTaxId, type CancelPaymentParams, type CancelPlanMoveParams, type CancelPlanMoveSubscriptionParams, type CancelSubscriptionParams, type ChangePlanParams, type ChangeSubscriptionVersionParams, type ChargePaymentParams, type CheckUsageAvailabilityParams, type CheckoutReadyData, type ClaimLink, Commet, CommetAPIError, type CommetClientOptions, CommetError, type CommetErrorContext, CommetValidationError, type ComparePlanVersionsParams, type ConsumptionModel, type CreateAddonParams, type CreateAdjustmentInvoiceParams, type CreateApiKeyParams, type CreateCreditPackParams, type CreateCustomerCreditParams, type CreateCustomerParams, type CreateFeatureParams, type CreateMarketParams, type CreateOfferParams, type CreatePaymentParams, type CreatePlanDraftParams, type CreatePlanExperimentParams, type CreatePlanExperimentVersionParams, type CreatePlanGrantParams, type CreatePlanGroupParams, type CreatePlanMoveParams, type CreatePlanParams, type CreatePlanVersionParams, 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 DeletePlanDraftParams, 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 GetPlanDraftParams, type GetPlanExperimentParams, type GetPlanGroupParams, type GetPlanMoveParams, type GetPlanParams, type GetPlanVersionParams, type GetPromoCodeParams, type GetQuotaAllowanceParams, type GetSeatBalanceParams, type GetSubscriptionAutoTopUpParams, type GetSubscriptionParams, type GetTransactionParams, type GetWebhookEndpointParams, type InferFeatureCodes, type InferPlanCodes, type InferSeatCodes, type InferUsageCodes, type Invoice, type InvoiceCreatedData, type InvoiceDownload, type InvoiceListItem, type InvoiceOverdueData, type InvoiceType, type InvoiceUpcomingData, type InvoiceVoidedData, type KeepPlanSubscriberOnVersionParams, type KeptOnVersion, type ListActiveAddonsParams, type ListAddonsParams, type ListApiKeysParams, type ListCustomerCreditsParams, type ListCustomersParams, type ListFeatureAccessParams, type ListInvoicesParams, type ListOffersParams, type ListPaymentsParams, type ListPlanDraftsParams, type ListPlanExperimentsParams, type ListPlanGrantsParams, type ListPlanGroupsParams, type ListPlanMovesParams, type ListPlanSubscribersNeedingAChangeParams, type ListPlanVersionsParams, type ListPlansParams, type ListPromoCodesParams, type ListSubscriptionsParams, type ListTransactionsParams, type ListWebhookEndpointsParams, type MakePlanExperimentCurrentParams, type ManagedBy, type Market, type Offer, type PauseSubscriptionParams, type Payment, type PaymentDisputeResolvedData, type PaymentDisputedData, type PaymentFailedData, type PaymentLinkCanceledData, type PaymentLinkCompletedData, type PaymentLinkCreatedData, type PaymentLinkFailedData, type PaymentMethod, type PaymentMethodAttachedData, type PaymentMethodDetachedData, type PaymentMethodUpdateCheckout, type PaymentMethodUpdatedData, type PaymentProvider, type PaymentReceivedData, type PaymentRecoveredData, type PaymentRefundedData, type PaymentRetryFailedData, type Payout, type PayoutAvailableData, type PayoutBankAccount, type PayoutCreatedData, type PayoutFailedData, type PayoutPaidData, type Plan, type PlanChange, type PlanDef, type PlanDraft, type PlanDraftPublication, type PlanExperiment, type PlanExperimentArchive, type PlanFeature, type PlanFeatureValue, type PlanGrant, type PlanGrantCreatedData, type PlanGrantExpiredData, type PlanGrantRevokedData, type PlanGrantUpdatedData, type PlanGroup, type PlanGroupDetail, type PlanMove, type PlanPrice, type PlanRegionalPricing, type PlanRegionalPricingResult, type PlanVersion, type PlanVersionComparison, type PortalAccess, type PrepaidPeriodsCheckout, type PreviewChange, type PreviewChangePlanParams, type PriceDef, type PromoCode, type PublishPlanDraftParams, type PurchaseCreditsParams, type QuotaExceededData, type QuotaThresholdReachedData, type ReactivateSubscriptionParams, type ReactivatedSubscription, type RecoveryLink, type Refund, type RefundTransactionParams, type RemovePlanFeatureParams, type RemovePlanFromGroupParams, type RemoveQuotaParams, type RemoveSeatsParams, type RemoveSubscriptionOfferParams, type RemovedPlanFeature, type RemovedPlanFromGroup, type ReorderPlansInGroupParams, type ReorderedPlans, type RequestOptions, type RequestPayoutParams, type RequestPortalAccessParams, type ResolvedFeatureCode, type ResolvedPlanCode, type ResolvedSeatCode, type ResolvedUsageCode, type ResumeSubscriptionParams, type RetryTransactionParams, type RevokeCustomerCreditParams, type RevokePlanGrantParams, type RevokeScheduledPlanChangeParams, type RevokeScheduledVersionChangeParams, 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 SubscriberNeedingAChange, type Subscription, type SubscriptionActivatedData, type SubscriptionAddon, type SubscriptionAutoTopUp, type SubscriptionCanceledData, type SubscriptionCancellationRevokedData, type SubscriptionCancellationScheduledData, type SubscriptionCreatedData, type SubscriptionOfferApplication, type SubscriptionOfferApplicationPhase, type SubscriptionPastDueData, type SubscriptionPauseRevokedData, type SubscriptionPauseScheduledData, type SubscriptionPauseUpdatedData, type SubscriptionPausedData, type SubscriptionPlanChangeRevokedData, type SubscriptionPlanChangeScheduledData, type SubscriptionPlanChangedData, type SubscriptionReactivatedData, type SubscriptionResume, type SubscriptionResumeFailedData, type SubscriptionResumedData, type SubscriptionStatus, type SubscriptionSummary, type SubscriptionUpdatedData, type SubscriptionVersionChangeCanceledData, type SubscriptionVersionChangedData, 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 UpdatePlanDraftParams, type UpdatePlanFeatureParams, type UpdatePlanGrantParams, type UpdatePlanGroupParams, type UpdatePlanParams, type UpdatePlanPriceParams, type UpdatePromoCodeParams, type UpdateSubscriptionAutoTopUpParams, type UpdateSubscriptionPauseParams, type UpdateWebhookEndpointParams, type UpsertRegionalPricesParams, type UsageAdjustment, type UsageCheck, type UsageEvent, type UsageQuota, type UsageQuotaEvent, type UsageRecordedData, type Webhook, type WebhookAddonRef, type WebhookBalance, type WebhookBankRef, type WebhookCardInfo, type WebhookCreditsBalance, type WebhookData, type WebhookEvent, type WebhookEventDataMap, type WebhookEventEnvelope, type WebhookEventHandler, type WebhookEventPayload, type WebhookPayload, type WebhookPlanGrantTimelineEvent, type WebhookPlanRef, type WebhookSeatSummary, type WebhookTest, Webhooks, createCommet, Commet as default, defineConfig, registerIntegration };