@metronome/sdk 3.7.0 → 3.8.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 (94) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts.map +1 -1
  4. package/client.js +9 -1
  5. package/client.js.map +1 -1
  6. package/client.mjs +9 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/shared.d.mts +194 -4
  10. package/resources/shared.d.mts.map +1 -1
  11. package/resources/shared.d.ts +194 -4
  12. package/resources/shared.d.ts.map +1 -1
  13. package/resources/v1/alerts.d.mts +39 -0
  14. package/resources/v1/alerts.d.mts.map +1 -1
  15. package/resources/v1/alerts.d.ts +39 -0
  16. package/resources/v1/alerts.d.ts.map +1 -1
  17. package/resources/v1/contracts/contracts.d.mts +270 -11
  18. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  19. package/resources/v1/contracts/contracts.d.ts +270 -11
  20. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  21. package/resources/v1/contracts/contracts.js +43 -0
  22. package/resources/v1/contracts/contracts.js.map +1 -1
  23. package/resources/v1/contracts/contracts.mjs +43 -0
  24. package/resources/v1/contracts/contracts.mjs.map +1 -1
  25. package/resources/v1/contracts/index.d.mts +1 -1
  26. package/resources/v1/contracts/index.d.mts.map +1 -1
  27. package/resources/v1/contracts/index.d.ts +1 -1
  28. package/resources/v1/contracts/index.d.ts.map +1 -1
  29. package/resources/v1/contracts/index.js.map +1 -1
  30. package/resources/v1/contracts/index.mjs.map +1 -1
  31. package/resources/v1/contracts/rate-cards/rates.d.mts +4 -0
  32. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  33. package/resources/v1/contracts/rate-cards/rates.d.ts +4 -0
  34. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  35. package/resources/v1/contracts/rate-cards/rates.js +4 -0
  36. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  37. package/resources/v1/contracts/rate-cards/rates.mjs +4 -0
  38. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  39. package/resources/v1/customers/alerts.d.mts +79 -2
  40. package/resources/v1/customers/alerts.d.mts.map +1 -1
  41. package/resources/v1/customers/alerts.d.ts +79 -2
  42. package/resources/v1/customers/alerts.d.ts.map +1 -1
  43. package/resources/v1/customers/alerts.js +1 -1
  44. package/resources/v1/customers/alerts.mjs +1 -1
  45. package/resources/v1/customers/invoices.d.mts +5 -0
  46. package/resources/v1/customers/invoices.d.mts.map +1 -1
  47. package/resources/v1/customers/invoices.d.ts +5 -0
  48. package/resources/v1/customers/invoices.d.ts.map +1 -1
  49. package/resources/v1/dashboards.d.mts +8 -3
  50. package/resources/v1/dashboards.d.mts.map +1 -1
  51. package/resources/v1/dashboards.d.ts +8 -3
  52. package/resources/v1/dashboards.d.ts.map +1 -1
  53. package/resources/v1/dashboards.js +7 -2
  54. package/resources/v1/dashboards.js.map +1 -1
  55. package/resources/v1/dashboards.mjs +7 -2
  56. package/resources/v1/dashboards.mjs.map +1 -1
  57. package/resources/v1/index.d.mts +1 -1
  58. package/resources/v1/index.d.mts.map +1 -1
  59. package/resources/v1/index.d.ts +1 -1
  60. package/resources/v1/index.d.ts.map +1 -1
  61. package/resources/v1/index.js.map +1 -1
  62. package/resources/v1/index.mjs.map +1 -1
  63. package/resources/v1/packages.d.mts +240 -9
  64. package/resources/v1/packages.d.mts.map +1 -1
  65. package/resources/v1/packages.d.ts +240 -9
  66. package/resources/v1/packages.d.ts.map +1 -1
  67. package/resources/v1/v1.d.mts +2 -2
  68. package/resources/v1/v1.d.mts.map +1 -1
  69. package/resources/v1/v1.d.ts +2 -2
  70. package/resources/v1/v1.d.ts.map +1 -1
  71. package/resources/v1/v1.js.map +1 -1
  72. package/resources/v1/v1.mjs.map +1 -1
  73. package/resources/v2/contracts.d.mts +427 -6
  74. package/resources/v2/contracts.d.mts.map +1 -1
  75. package/resources/v2/contracts.d.ts +427 -6
  76. package/resources/v2/contracts.d.ts.map +1 -1
  77. package/src/client.ts +9 -1
  78. package/src/resources/shared.ts +234 -4
  79. package/src/resources/v1/alerts.ts +49 -0
  80. package/src/resources/v1/contracts/contracts.ts +322 -10
  81. package/src/resources/v1/contracts/index.ts +2 -0
  82. package/src/resources/v1/contracts/rate-cards/rates.ts +4 -0
  83. package/src/resources/v1/customers/alerts.ts +99 -2
  84. package/src/resources/v1/customers/invoices.ts +6 -0
  85. package/src/resources/v1/dashboards.ts +10 -3
  86. package/src/resources/v1/index.ts +2 -0
  87. package/src/resources/v1/packages.ts +291 -9
  88. package/src/resources/v1/v1.ts +4 -0
  89. package/src/resources/v2/contracts.ts +517 -6
  90. package/src/version.ts +1 -1
  91. package/version.d.mts +1 -1
  92. package/version.d.ts +1 -1
  93. package/version.js +1 -1
  94. package/version.mjs +1 -1
@@ -451,6 +451,53 @@ export class Contracts extends APIResource {
451
451
  return this._client.post('/v1/contracts/customerBalances/getNetBalance', { body, ...options });
452
452
  }
453
453
 
454
+ /**
455
+ * Get the history of subscription seats schedule over time for a given
456
+ * `subscription_id`. This endpoint provides information about seat assignments and
457
+ * total quantities for different time periods, allowing you to track how seat
458
+ * assignments have changed over time.
459
+ *
460
+ * ### Use this endpoint to:
461
+ *
462
+ * - Track changes to seat assignments over time
463
+ * - Get seat schedule for a specific date using the `covering_date` parameter
464
+ * - Get seat schedule history with optional date range filtering using
465
+ * `starting_at` and `ending_before`
466
+ *
467
+ * ### Key response fields:
468
+ *
469
+ * - data: array of seat schedule entries with time periods, quantity, and
470
+ * assignments
471
+ * - next_page: cursor for pagination to retrieve additional results
472
+ *
473
+ * ### Usage guidelines:
474
+ *
475
+ * - Use `covering_date` to get the active seats for a specific point in time.
476
+ * `covering_date` cannot be used with `starting_at` or `ending_before`.
477
+ * - Use `starting_at` and `ending_before` to filter results by time range.
478
+ * `starting_at` and `ending_before` cannot be used with `covering_date`.
479
+ * - Maximum limit is 10 seat schedule entries per request
480
+ * - Results are ordered by `starting_at` timestamp
481
+ *
482
+ * @example
483
+ * ```ts
484
+ * const response =
485
+ * await client.v1.contracts.getSubscriptionSeatsHistory({
486
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
487
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
488
+ * subscription_id: '1a824d53-bde6-4d82-96d7-6347ff227d5c',
489
+ * covering_date: '2024-01-15T00:00:00.000Z',
490
+ * limit: 10,
491
+ * });
492
+ * ```
493
+ */
494
+ getSubscriptionSeatsHistory(
495
+ body: ContractGetSubscriptionSeatsHistoryParams,
496
+ options?: RequestOptions,
497
+ ): APIPromise<ContractGetSubscriptionSeatsHistoryResponse> {
498
+ return this._client.post('/v1/contracts/getSubscriptionSeatsHistory', { body, ...options });
499
+ }
500
+
454
501
  /**
455
502
  * Retrieve a comprehensive view of all available balances (commits and credits)
456
503
  * for a customer. This endpoint provides real-time visibility into prepaid funds,
@@ -989,6 +1036,11 @@ export namespace ContractCreateResponse {
989
1036
  */
990
1037
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
991
1038
 
1039
+ /**
1040
+ * Rounding configuration for prorated recurring commit amounts.
1041
+ */
1042
+ proration_rounding?: RecurringCommit.ProrationRounding | null;
1043
+
992
1044
  /**
993
1045
  * The frequency at which the recurring commits will be created. If not provided: -
994
1046
  * The commits will be created on the usage invoice frequency. If provided: - The
@@ -996,7 +1048,7 @@ export namespace ContractCreateResponse {
996
1048
  * be created aligned with the recurring commit's starting_at rather than the usage
997
1049
  * invoice dates.
998
1050
  */
999
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1051
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
1000
1052
 
1001
1053
  /**
1002
1054
  * Will be passed down to the individual commits. This controls how much of an
@@ -1059,6 +1111,41 @@ export namespace ContractCreateResponse {
1059
1111
 
1060
1112
  unit_price: number;
1061
1113
  }
1114
+
1115
+ /**
1116
+ * Rounding configuration for prorated recurring commit amounts.
1117
+ */
1118
+ export interface ProrationRounding {
1119
+ access?: ProrationRounding.Access;
1120
+
1121
+ invoice?: ProrationRounding.Invoice;
1122
+ }
1123
+
1124
+ export namespace ProrationRounding {
1125
+ export interface Access {
1126
+ /**
1127
+ * Number of decimal places to round to. Applied directly to the stored monetary
1128
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1129
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
1130
+ * dollar).
1131
+ */
1132
+ decimal_places: number;
1133
+
1134
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1135
+ }
1136
+
1137
+ export interface Invoice {
1138
+ /**
1139
+ * Number of decimal places to round to. Applied directly to the stored monetary
1140
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1141
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
1142
+ * dollar).
1143
+ */
1144
+ decimal_places: number;
1145
+
1146
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1147
+ }
1148
+ }
1062
1149
  }
1063
1150
 
1064
1151
  export interface RecurringCredit {
@@ -1134,6 +1221,11 @@ export namespace ContractCreateResponse {
1134
1221
  */
1135
1222
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1136
1223
 
1224
+ /**
1225
+ * Rounding configuration for prorated recurring credit amounts.
1226
+ */
1227
+ proration_rounding?: RecurringCredit.ProrationRounding | null;
1228
+
1137
1229
  /**
1138
1230
  * The frequency at which the recurring commits will be created. If not provided: -
1139
1231
  * The commits will be created on the usage invoice frequency. If provided: - The
@@ -1141,7 +1233,7 @@ export namespace ContractCreateResponse {
1141
1233
  * be created aligned with the recurring commit's starting_at rather than the usage
1142
1234
  * invoice dates.
1143
1235
  */
1144
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1236
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
1145
1237
 
1146
1238
  /**
1147
1239
  * Will be passed down to the individual commits. This controls how much of an
@@ -1193,6 +1285,27 @@ export namespace ContractCreateResponse {
1193
1285
  export interface Contract {
1194
1286
  id: string;
1195
1287
  }
1288
+
1289
+ /**
1290
+ * Rounding configuration for prorated recurring credit amounts.
1291
+ */
1292
+ export interface ProrationRounding {
1293
+ access?: ProrationRounding.Access;
1294
+ }
1295
+
1296
+ export namespace ProrationRounding {
1297
+ export interface Access {
1298
+ /**
1299
+ * Number of decimal places to round to. Applied directly to the stored monetary
1300
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1301
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
1302
+ * dollar).
1303
+ */
1304
+ decimal_places: number;
1305
+
1306
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1307
+ }
1308
+ }
1196
1309
  }
1197
1310
  }
1198
1311
  }
@@ -1238,6 +1351,39 @@ export namespace ContractGetNetBalanceResponse {
1238
1351
  }
1239
1352
  }
1240
1353
 
1354
+ export interface ContractGetSubscriptionSeatsHistoryResponse {
1355
+ data: Array<ContractGetSubscriptionSeatsHistoryResponse.Data>;
1356
+
1357
+ /**
1358
+ * Cursor for the next page of results
1359
+ */
1360
+ next_page: string | null;
1361
+ }
1362
+
1363
+ export namespace ContractGetSubscriptionSeatsHistoryResponse {
1364
+ export interface Data {
1365
+ /**
1366
+ * Array of seat IDs that are assigned in this period
1367
+ */
1368
+ assigned_seat_ids: Array<string>;
1369
+
1370
+ /**
1371
+ * The end time of this seat schedule period (null if ongoing)
1372
+ */
1373
+ ending_before: string | null;
1374
+
1375
+ /**
1376
+ * The start time of this seat schedule period
1377
+ */
1378
+ starting_at: string;
1379
+
1380
+ /**
1381
+ * Total number of assigned and unassigned seats in this period
1382
+ */
1383
+ total_quantity: number;
1384
+ }
1385
+ }
1386
+
1241
1387
  export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
1242
1388
 
1243
1389
  export interface ContractListSeatBalancesResponse {
@@ -2201,9 +2347,10 @@ export namespace ContractCreateParams {
2201
2347
 
2202
2348
  /**
2203
2349
  * Indicates whether the override should only apply to commits. Defaults to
2204
- * `false`. If `true`, you can specify relevant commits in `override_specifiers` by
2205
- * passing `commit_ids`. if you do not specify `commit_ids`, then the override will
2206
- * apply when consuming any prepaid or postpaid commit.
2350
+ * `false`. If `true` you can specify relevant commits in `override_specifiers` by
2351
+ * passing `commit_ids`, `recurring_commit_ids`, or `any_commit_or_credit_ids`. If
2352
+ * you do not specify any of these fields, the override will apply when consuming
2353
+ * any prepaid commit, postpaid commit, or credit
2207
2354
  */
2208
2355
  is_commit_specific?: boolean;
2209
2356
 
@@ -2257,6 +2404,15 @@ export namespace ContractCreateParams {
2257
2404
 
2258
2405
  export namespace Override {
2259
2406
  export interface OverrideSpecifier {
2407
+ /**
2408
+ * Can only be used for commit specific overrides. Must be used in conjunction with
2409
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
2410
+ * `presentation_group_values`. Must be used instead of both `commit_ids` and
2411
+ * `recurring_commit_ids` If provided, the override will apply to any specified
2412
+ * commit, credit, recurring commit or recurring credit IDs.
2413
+ */
2414
+ any_commit_or_credit_ids?: Array<string>;
2415
+
2260
2416
  billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2261
2417
 
2262
2418
  /**
@@ -2447,6 +2603,11 @@ export namespace ContractCreateParams {
2447
2603
  */
2448
2604
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2449
2605
 
2606
+ /**
2607
+ * Optional rounding configuration for prorated recurring commit amounts.
2608
+ */
2609
+ proration_rounding?: RecurringCommit.ProrationRounding;
2610
+
2450
2611
  /**
2451
2612
  * Whether the created commits will use the commit rate or list rate
2452
2613
  */
@@ -2459,7 +2620,7 @@ export namespace ContractCreateParams {
2459
2620
  * be created aligned with the recurring commit's starting_at rather than the usage
2460
2621
  * invoice dates.
2461
2622
  */
2462
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2623
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
2463
2624
 
2464
2625
  /**
2465
2626
  * Will be passed down to the individual commits. This controls how much of an
@@ -2526,6 +2687,41 @@ export namespace ContractCreateParams {
2526
2687
  unit_price: number;
2527
2688
  }
2528
2689
 
2690
+ /**
2691
+ * Optional rounding configuration for prorated recurring commit amounts.
2692
+ */
2693
+ export interface ProrationRounding {
2694
+ access?: ProrationRounding.Access;
2695
+
2696
+ invoice?: ProrationRounding.Invoice;
2697
+ }
2698
+
2699
+ export namespace ProrationRounding {
2700
+ export interface Access {
2701
+ /**
2702
+ * Number of decimal places to round to. Applied directly to the stored monetary
2703
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2704
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2705
+ * dollar).
2706
+ */
2707
+ decimal_places: number;
2708
+
2709
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2710
+ }
2711
+
2712
+ export interface Invoice {
2713
+ /**
2714
+ * Number of decimal places to round to. Applied directly to the stored monetary
2715
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2716
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2717
+ * dollar).
2718
+ */
2719
+ decimal_places: number;
2720
+
2721
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2722
+ }
2723
+ }
2724
+
2529
2725
  /**
2530
2726
  * Attach a subscription to the recurring commit/credit.
2531
2727
  */
@@ -2620,6 +2816,11 @@ export namespace ContractCreateParams {
2620
2816
  */
2621
2817
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2622
2818
 
2819
+ /**
2820
+ * Optional rounding configuration for prorated recurring credit amounts.
2821
+ */
2822
+ proration_rounding?: RecurringCredit.ProrationRounding;
2823
+
2623
2824
  /**
2624
2825
  * Whether the created commits will use the commit rate or list rate
2625
2826
  */
@@ -2632,7 +2833,7 @@ export namespace ContractCreateParams {
2632
2833
  * be created aligned with the recurring commit's starting_at rather than the usage
2633
2834
  * invoice dates.
2634
2835
  */
2635
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2836
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
2636
2837
 
2637
2838
  /**
2638
2839
  * Will be passed down to the individual commits. This controls how much of an
@@ -2688,6 +2889,27 @@ export namespace ContractCreateParams {
2688
2889
  unit?: 'PERIODS';
2689
2890
  }
2690
2891
 
2892
+ /**
2893
+ * Optional rounding configuration for prorated recurring credit amounts.
2894
+ */
2895
+ export interface ProrationRounding {
2896
+ access?: ProrationRounding.Access;
2897
+ }
2898
+
2899
+ export namespace ProrationRounding {
2900
+ export interface Access {
2901
+ /**
2902
+ * Number of decimal places to round to. Applied directly to the stored monetary
2903
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2904
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2905
+ * dollar).
2906
+ */
2907
+ decimal_places: number;
2908
+
2909
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2910
+ }
2911
+ }
2912
+
2691
2913
  /**
2692
2914
  * Attach a subscription to the recurring commit/credit.
2693
2915
  */
@@ -2944,6 +3166,8 @@ export namespace ContractCreateParams {
2944
3166
 
2945
3167
  subscription_rate: Subscription.SubscriptionRate;
2946
3168
 
3169
+ billing_cycle_config?: Subscription.BillingCycleConfig;
3170
+
2947
3171
  /**
2948
3172
  * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2949
3173
  */
@@ -3008,6 +3232,22 @@ export namespace ContractCreateParams {
3008
3232
  * Indicates if the partial period will be prorated or charged a full amount.
3009
3233
  */
3010
3234
  is_prorated?: boolean;
3235
+
3236
+ rounding?: Proration.Rounding;
3237
+ }
3238
+
3239
+ export namespace Proration {
3240
+ export interface Rounding {
3241
+ /**
3242
+ * Number of decimal places to round to. Applied directly to the stored monetary
3243
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
3244
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
3245
+ * dollar).
3246
+ */
3247
+ decimal_places: number;
3248
+
3249
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
3250
+ }
3011
3251
  }
3012
3252
 
3013
3253
  export interface SubscriptionRate {
@@ -3023,6 +3263,20 @@ export namespace ContractCreateParams {
3023
3263
  product_id: string;
3024
3264
  }
3025
3265
 
3266
+ export interface BillingCycleConfig {
3267
+ /**
3268
+ * The date to anchor the billing cycle to. If omitted, defaults to the contract's
3269
+ * usage invoice billing cycle anchor date.
3270
+ */
3271
+ anchor_date?: string;
3272
+
3273
+ /**
3274
+ * Controls whether this subscription consolidates onto usage invoices or gets its
3275
+ * own scheduled invoice. Defaults to ON_USAGE_INVOICE if omitted.
3276
+ */
3277
+ invoice_placement?: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
3278
+ }
3279
+
3026
3280
  export interface SeatConfig {
3027
3281
  /**
3028
3282
  * The initial assigned seats on this subscription.
@@ -3739,9 +3993,10 @@ export namespace ContractAmendParams {
3739
3993
 
3740
3994
  /**
3741
3995
  * Indicates whether the override should only apply to commits. Defaults to
3742
- * `false`. If `true`, you can specify relevant commits in `override_specifiers` by
3743
- * passing `commit_ids`. if you do not specify `commit_ids`, then the override will
3744
- * apply when consuming any prepaid or postpaid commit.
3996
+ * `false`. If `true` you can specify relevant commits in `override_specifiers` by
3997
+ * passing `commit_ids`, `recurring_commit_ids`, or `any_commit_or_credit_ids`. If
3998
+ * you do not specify any of these fields, the override will apply when consuming
3999
+ * any prepaid commit, postpaid commit, or credit
3745
4000
  */
3746
4001
  is_commit_specific?: boolean;
3747
4002
 
@@ -3795,6 +4050,15 @@ export namespace ContractAmendParams {
3795
4050
 
3796
4051
  export namespace Override {
3797
4052
  export interface OverrideSpecifier {
4053
+ /**
4054
+ * Can only be used for commit specific overrides. Must be used in conjunction with
4055
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
4056
+ * `presentation_group_values`. Must be used instead of both `commit_ids` and
4057
+ * `recurring_commit_ids` If provided, the override will apply to any specified
4058
+ * commit, credit, recurring commit or recurring credit IDs.
4059
+ */
4060
+ any_commit_or_credit_ids?: Array<string>;
4061
+
3798
4062
  billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
3799
4063
 
3800
4064
  /**
@@ -4196,6 +4460,46 @@ export interface ContractGetNetBalanceParams {
4196
4460
  invoice_inclusion_mode?: 'FINALIZED' | 'FINALIZED_AND_DRAFT';
4197
4461
  }
4198
4462
 
4463
+ export interface ContractGetSubscriptionSeatsHistoryParams {
4464
+ contract_id: string;
4465
+
4466
+ customer_id: string;
4467
+
4468
+ subscription_id: string;
4469
+
4470
+ /**
4471
+ * Get the seats history segment for the covering date. Cannot be used with
4472
+ * `starting_at` or `ending_before`.
4473
+ */
4474
+ covering_date?: string | null;
4475
+
4476
+ /**
4477
+ * Cursor for pagination. Use the value from the `next_page` field of the previous
4478
+ * response to retrieve the next page of results.
4479
+ */
4480
+ cursor?: string | null;
4481
+
4482
+ /**
4483
+ * Include seats history segments that are active at or before this timestamp. Use
4484
+ * with `starting_at` to get a specific time range. If not set, there's no upper
4485
+ * bound.
4486
+ */
4487
+ ending_before?: string | null;
4488
+
4489
+ /**
4490
+ * Maximum number of seat schedule entries to return. Defaults to 10. Required
4491
+ * range: 1 <= x <= 10.
4492
+ */
4493
+ limit?: number | null;
4494
+
4495
+ /**
4496
+ * Include seats history segments that are active at or after this timestamp. Use
4497
+ * with `ending_before` to get a specific time range. If not set, there's no lower
4498
+ * bound.
4499
+ */
4500
+ starting_at?: string | null;
4501
+ }
4502
+
4199
4503
  export interface ContractListBalancesParams extends BodyCursorPageParams {
4200
4504
  customer_id: string;
4201
4505
 
@@ -4299,6 +4603,12 @@ export interface ContractListSeatBalancesParams {
4299
4603
  */
4300
4604
  seat_ids?: Array<string>;
4301
4605
 
4606
+ /**
4607
+ * When true, any seat_ids not found in contract subscriptions will be silently
4608
+ * omitted from the response instead of returning a 400 error.
4609
+ */
4610
+ skip_missing_seat_ids?: boolean;
4611
+
4302
4612
  /**
4303
4613
  * Include only commits or credits with access effective on or after this date
4304
4614
  * (cannot be used with covering_date).
@@ -4512,6 +4822,7 @@ export declare namespace Contracts {
4512
4822
  type ContractArchiveResponse as ContractArchiveResponse,
4513
4823
  type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
4514
4824
  type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse,
4825
+ type ContractGetSubscriptionSeatsHistoryResponse as ContractGetSubscriptionSeatsHistoryResponse,
4515
4826
  type ContractListBalancesResponse as ContractListBalancesResponse,
4516
4827
  type ContractListSeatBalancesResponse as ContractListSeatBalancesResponse,
4517
4828
  type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
@@ -4527,6 +4838,7 @@ export declare namespace Contracts {
4527
4838
  type ContractArchiveParams as ContractArchiveParams,
4528
4839
  type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
4529
4840
  type ContractGetNetBalanceParams as ContractGetNetBalanceParams,
4841
+ type ContractGetSubscriptionSeatsHistoryParams as ContractGetSubscriptionSeatsHistoryParams,
4530
4842
  type ContractListBalancesParams as ContractListBalancesParams,
4531
4843
  type ContractListSeatBalancesParams as ContractListSeatBalancesParams,
4532
4844
  type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams,
@@ -9,6 +9,7 @@ export {
9
9
  type ContractArchiveResponse,
10
10
  type ContractCreateHistoricalInvoicesResponse,
11
11
  type ContractGetNetBalanceResponse,
12
+ type ContractGetSubscriptionSeatsHistoryResponse,
12
13
  type ContractListBalancesResponse,
13
14
  type ContractListSeatBalancesResponse,
14
15
  type ContractRetrieveRateScheduleResponse,
@@ -23,6 +24,7 @@ export {
23
24
  type ContractArchiveParams,
24
25
  type ContractCreateHistoricalInvoicesParams,
25
26
  type ContractGetNetBalanceParams,
27
+ type ContractGetSubscriptionSeatsHistoryParams,
26
28
  type ContractListBalancesParams,
27
29
  type ContractListSeatBalancesParams,
28
30
  type ContractRetrieveRateScheduleParams,
@@ -59,6 +59,10 @@ export class Rates extends APIResource {
59
59
  /**
60
60
  * Add a new rate
61
61
  *
62
+ * This endpoint is heavily rate limited. For adding multiple rates, using the
63
+ * [addRates](https://docs.metronome.com/api-reference/rate-cards/add-rates)
64
+ * endpoint is strongly encouraged.
65
+ *
62
66
  * @example
63
67
  * ```ts
64
68
  * const response =
@@ -50,11 +50,11 @@ export class Alerts extends APIResource {
50
50
  * - `null` - Notification has been archived
51
51
  * - `triggered_by`: Additional context about what caused the notification to
52
52
  * trigger (when applicable)
53
+ * - `updated_at`: Timestamp of when the `customer_status` was last updated
53
54
  * - alert: Complete threshold notification configuration including:
54
55
  * - Notification ID, name, and type
55
56
  * - Current threshold values and credit type information
56
57
  * - Notification status (enabled, disabled, or archived)
57
- * - Last update timestamp
58
58
  * - Any applied filters (credit grant types, custom fields, group values)
59
59
  *
60
60
  * ### Usage guidelines:
@@ -248,10 +248,17 @@ export namespace CustomerAlert {
248
248
  | 'invoice_total_reached';
249
249
 
250
250
  /**
251
- * Timestamp for when the threshold notification was last updated
251
+ * Timestamp for when the threshold notification's customer status was last updated
252
252
  */
253
253
  updated_at: string;
254
254
 
255
+ /**
256
+ * Present for `low_remaining_contract_credit_and_commit_balance_reached`
257
+ * notifications. The filters that define the balances that are considered when
258
+ * evaluating the alert.
259
+ */
260
+ alert_specifiers?: Array<Alert.AlertSpecifier>;
261
+
255
262
  /**
256
263
  * An array of strings, representing a way to filter the credit grant this
257
264
  * threshold notification applies to, by looking at the credit_grant_type field on
@@ -301,6 +308,48 @@ export namespace CustomerAlert {
301
308
  }
302
309
 
303
310
  export namespace Alert {
311
+ export interface AlertSpecifier {
312
+ /**
313
+ * A list of custom field filters for notification types that support advanced
314
+ * filtering
315
+ */
316
+ custom_field_filters?: Array<AlertSpecifier.CustomFieldFilter>;
317
+
318
+ /**
319
+ * If provided, the specifier will not apply to balances that matches the inclusion
320
+ * criteria and any of the excluding values.
321
+ */
322
+ exclude?: Array<AlertSpecifier.Exclude>;
323
+ }
324
+
325
+ export namespace AlertSpecifier {
326
+ export interface CustomFieldFilter {
327
+ entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
328
+
329
+ key: string;
330
+
331
+ value?: string;
332
+ }
333
+
334
+ export interface Exclude {
335
+ /**
336
+ * A list of custom field filters for notification types that support advanced
337
+ * filtering
338
+ */
339
+ custom_field_filters?: Array<Exclude.CustomFieldFilter>;
340
+ }
341
+
342
+ export namespace Exclude {
343
+ export interface CustomFieldFilter {
344
+ entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
345
+
346
+ key: string;
347
+
348
+ value: string;
349
+ }
350
+ }
351
+ }
352
+
304
353
  export interface CustomFieldFilter {
305
354
  entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
306
355
 
@@ -358,6 +407,12 @@ export interface AlertRetrieveParams {
358
407
  */
359
408
  customer_id: string;
360
409
 
410
+ /**
411
+ * Can be used with only `low_remaining_contract_credit_and_commit_balance_reached`
412
+ * notifications. Used to filter the alert by the custom field key-value pair.
413
+ */
414
+ alert_specifiers?: Array<AlertRetrieveParams.AlertSpecifier>;
415
+
361
416
  /**
362
417
  * Only present for `spend_threshold_reached` notifications. Retrieve the
363
418
  * notification for a specific group key-value pair.
@@ -378,6 +433,48 @@ export interface AlertRetrieveParams {
378
433
  }
379
434
 
380
435
  export namespace AlertRetrieveParams {
436
+ export interface AlertSpecifier {
437
+ /**
438
+ * A list of custom field filters for notification types that support advanced
439
+ * filtering
440
+ */
441
+ custom_field_filters: Array<AlertSpecifier.CustomFieldFilter>;
442
+
443
+ /**
444
+ * If provided, the specifier will not apply to balances that matches the inclusion
445
+ * criteria and any of the excluding values.
446
+ */
447
+ exclude?: Array<AlertSpecifier.Exclude>;
448
+ }
449
+
450
+ export namespace AlertSpecifier {
451
+ export interface CustomFieldFilter {
452
+ entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
453
+
454
+ key: string;
455
+
456
+ value: string;
457
+ }
458
+
459
+ export interface Exclude {
460
+ /**
461
+ * A list of custom field filters for notification types that support advanced
462
+ * filtering
463
+ */
464
+ custom_field_filters?: Array<Exclude.CustomFieldFilter>;
465
+ }
466
+
467
+ export namespace Exclude {
468
+ export interface CustomFieldFilter {
469
+ entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
470
+
471
+ key: string;
472
+
473
+ value: string;
474
+ }
475
+ }
476
+ }
477
+
381
478
  /**
382
479
  * Scopes threshold notification evaluation to a specific presentation group key on
383
480
  * individual line items. Only present for spend notifications.
@@ -1052,6 +1052,12 @@ export interface InvoiceListParams extends CursorPageParams {
1052
1052
  * Query param: Filter invoices by type. Defaults to returning all invoice types.
1053
1053
  */
1054
1054
  type?: 'USAGE' | 'USAGE_CONSOLIDATED' | 'SCHEDULED';
1055
+
1056
+ /**
1057
+ * Query param: Indicates that this API request was triggered by a webhook
1058
+ * notification with the provided ID.
1059
+ */
1060
+ webhook_notification_id?: string;
1055
1061
  }
1056
1062
 
1057
1063
  export interface InvoiceAddChargeParams {