@metronome/sdk 3.4.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +2 -2
  3. package/internal/utils/env.js +2 -2
  4. package/internal/utils/env.js.map +1 -1
  5. package/internal/utils/env.mjs +2 -2
  6. package/internal/utils/env.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/resources/shared.d.mts +81 -6
  9. package/resources/shared.d.mts.map +1 -1
  10. package/resources/shared.d.ts +81 -6
  11. package/resources/shared.d.ts.map +1 -1
  12. package/resources/v1/contracts/contracts.d.mts +7 -14
  13. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  14. package/resources/v1/contracts/contracts.d.ts +7 -14
  15. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  16. package/resources/v1/contracts/contracts.js +7 -0
  17. package/resources/v1/contracts/contracts.js.map +1 -1
  18. package/resources/v1/contracts/contracts.mjs +7 -0
  19. package/resources/v1/contracts/contracts.mjs.map +1 -1
  20. package/resources/v1/packages.d.mts +10 -9
  21. package/resources/v1/packages.d.mts.map +1 -1
  22. package/resources/v1/packages.d.ts +10 -9
  23. package/resources/v1/packages.d.ts.map +1 -1
  24. package/resources/v2/contracts.d.mts +69 -12
  25. package/resources/v2/contracts.d.mts.map +1 -1
  26. package/resources/v2/contracts.d.ts +69 -12
  27. package/resources/v2/contracts.d.ts.map +1 -1
  28. package/resources/webhooks.js +1 -1
  29. package/resources/webhooks.js.map +1 -1
  30. package/resources/webhooks.mjs +1 -1
  31. package/resources/webhooks.mjs.map +1 -1
  32. package/src/internal/utils/env.ts +2 -2
  33. package/src/resources/shared.ts +109 -6
  34. package/src/resources/v1/contracts/contracts.ts +7 -16
  35. package/src/resources/v1/packages.ts +14 -12
  36. package/src/resources/v2/contracts.ts +84 -14
  37. package/src/resources/webhooks.ts +1 -1
  38. package/src/version.ts +1 -1
  39. package/version.d.mts +1 -1
  40. package/version.d.ts +1 -1
  41. package/version.js +1 -1
  42. package/version.mjs +1 -1
@@ -34,6 +34,12 @@ export interface BaseThresholdCommit {
34
34
  * will default to the commit product name.
35
35
  */
36
36
  name?: string;
37
+
38
+ /**
39
+ * The priority of the commit, used to determine drawdown order. Lower priority
40
+ * commits are consumed first. Defaults to 100 if not specified.
41
+ */
42
+ priority?: number;
37
43
  }
38
44
 
39
45
  export interface BaseUsageFilter {
@@ -1081,6 +1087,8 @@ export namespace ContractV2 {
1081
1087
  export interface Override {
1082
1088
  id: string;
1083
1089
 
1090
+ created_at: string;
1091
+
1084
1092
  starting_at: string;
1085
1093
 
1086
1094
  applicable_product_tags?: Array<string>;
@@ -1123,8 +1131,6 @@ export namespace ContractV2 {
1123
1131
  product_tags?: Array<string>;
1124
1132
 
1125
1133
  recurring_commit_ids?: Array<string>;
1126
-
1127
- recurring_credit_ids?: Array<string>;
1128
1134
  }
1129
1135
 
1130
1136
  export interface OverwriteRate {
@@ -1267,6 +1273,7 @@ export namespace ContractV2 {
1267
1273
  | Credit.CreditCreditedLedgerEntry
1268
1274
  | Credit.CreditManualLedgerEntry
1269
1275
  | Credit.CreditSeatBasedAdjustmentLedgerEntry
1276
+ | Credit.CreditRolloverLedgerEntry
1270
1277
  >;
1271
1278
 
1272
1279
  name?: string;
@@ -1287,6 +1294,8 @@ export namespace ContractV2 {
1287
1294
  */
1288
1295
  recurring_credit_id?: string;
1289
1296
 
1297
+ rolled_over_from?: Credit.RolledOverFrom;
1298
+
1290
1299
  /**
1291
1300
  * This field's availability is dependent on your client's configuration.
1292
1301
  */
@@ -1397,6 +1406,24 @@ export namespace ContractV2 {
1397
1406
 
1398
1407
  type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1399
1408
  }
1409
+
1410
+ export interface CreditRolloverLedgerEntry {
1411
+ amount: number;
1412
+
1413
+ new_contract_id: string;
1414
+
1415
+ segment_id: string;
1416
+
1417
+ timestamp: string;
1418
+
1419
+ type: 'CREDIT_ROLLOVER';
1420
+ }
1421
+
1422
+ export interface RolledOverFrom {
1423
+ contract_id: string;
1424
+
1425
+ credit_id: string;
1426
+ }
1400
1427
  }
1401
1428
 
1402
1429
  /**
@@ -2318,6 +2345,7 @@ export interface Credit {
2318
2345
  | Credit.CreditCreditedLedgerEntry
2319
2346
  | Credit.CreditManualLedgerEntry
2320
2347
  | Credit.CreditSeatBasedAdjustmentLedgerEntry
2348
+ | Credit.CreditRolloverLedgerEntry
2321
2349
  >;
2322
2350
 
2323
2351
  name?: string;
@@ -2341,6 +2369,8 @@ export interface Credit {
2341
2369
  */
2342
2370
  recurring_credit_id?: string;
2343
2371
 
2372
+ rolled_over_from?: Credit.RolledOverFrom;
2373
+
2344
2374
  /**
2345
2375
  * This field's availability is dependent on your client's configuration.
2346
2376
  */
@@ -2461,6 +2491,24 @@ export namespace Credit {
2461
2491
  type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
2462
2492
  }
2463
2493
 
2494
+ export interface CreditRolloverLedgerEntry {
2495
+ amount: number;
2496
+
2497
+ new_contract_id: string;
2498
+
2499
+ segment_id: string;
2500
+
2501
+ timestamp: string;
2502
+
2503
+ type: 'CREDIT_ROLLOVER';
2504
+ }
2505
+
2506
+ export interface RolledOverFrom {
2507
+ contract_id: string;
2508
+
2509
+ credit_id: string;
2510
+ }
2511
+
2464
2512
  /**
2465
2513
  * The subscription configuration for this credit, if it was generated from a
2466
2514
  * recurring credit with a subscription attached.
@@ -2622,6 +2670,8 @@ export interface ID {
2622
2670
  export interface Override {
2623
2671
  id: string;
2624
2672
 
2673
+ created_at: string;
2674
+
2625
2675
  starting_at: string;
2626
2676
 
2627
2677
  applicable_product_tags?: Array<string>;
@@ -2696,8 +2746,6 @@ export namespace Override {
2696
2746
  product_tags?: Array<string>;
2697
2747
 
2698
2748
  recurring_commit_ids?: Array<string>;
2699
-
2700
- recurring_credit_ids?: Array<string>;
2701
2749
  }
2702
2750
 
2703
2751
  export interface Product {
@@ -2899,6 +2947,8 @@ export interface PrepaidBalanceThresholdConfiguration {
2899
2947
  * commit amount will be in terms of this credit type instead of the fiat currency.
2900
2948
  */
2901
2949
  custom_credit_type_id?: string;
2950
+
2951
+ discount_configuration?: PrepaidBalanceThresholdConfiguration.DiscountConfiguration;
2902
2952
  }
2903
2953
 
2904
2954
  export namespace PrepaidBalanceThresholdConfiguration {
@@ -2925,6 +2975,15 @@ export namespace PrepaidBalanceThresholdConfiguration {
2925
2975
  */
2926
2976
  specifiers?: Array<Shared.CommitSpecifierInput>;
2927
2977
  }
2978
+
2979
+ export interface DiscountConfiguration {
2980
+ /**
2981
+ * The fraction of the original amount that the customer pays after applying the
2982
+ * discount. For example, 0.85 means the customer pays 85% of the original amount
2983
+ * (a 15% discount).
2984
+ */
2985
+ payment_fraction: number;
2986
+ }
2928
2987
  }
2929
2988
 
2930
2989
  export interface PrepaidBalanceThresholdConfigurationV2 {
@@ -2955,10 +3014,12 @@ export interface PrepaidBalanceThresholdConfigurationV2 {
2955
3014
  * commit amount will be in terms of this credit type instead of the fiat currency.
2956
3015
  */
2957
3016
  custom_credit_type_id?: string;
3017
+
3018
+ discount_configuration?: PrepaidBalanceThresholdConfigurationV2.DiscountConfiguration;
2958
3019
  }
2959
3020
 
2960
3021
  export namespace PrepaidBalanceThresholdConfigurationV2 {
2961
- export interface Commit extends Shared.UpdateBaseThresholdCommit {
3022
+ export interface Commit extends Shared.BaseThresholdCommit {
2962
3023
  /**
2963
3024
  * Which products the threshold commit applies to. If applicable_product_ids,
2964
3025
  * applicable_product_tags or specifiers are not provided, the commit applies to
@@ -2983,6 +3044,15 @@ export namespace PrepaidBalanceThresholdConfigurationV2 {
2983
3044
  */
2984
3045
  specifiers?: Array<Shared.CommitSpecifierInput>;
2985
3046
  }
3047
+
3048
+ export interface DiscountConfiguration {
3049
+ /**
3050
+ * The fraction of the original amount that the customer pays after applying the
3051
+ * discount. For example, 0.85 means the customer pays 85% of the original amount
3052
+ * (a 15% discount).
3053
+ */
3054
+ payment_fraction: number;
3055
+ }
2986
3056
  }
2987
3057
 
2988
3058
  export interface PropertyFilter {
@@ -3204,10 +3274,23 @@ export interface SpendThresholdConfiguration {
3204
3274
  * hits this amount, a threshold charge will be initiated.
3205
3275
  */
3206
3276
  threshold_amount: number;
3277
+
3278
+ discount_configuration?: SpendThresholdConfiguration.DiscountConfiguration;
3279
+ }
3280
+
3281
+ export namespace SpendThresholdConfiguration {
3282
+ export interface DiscountConfiguration {
3283
+ /**
3284
+ * The fraction of the original amount that the customer pays after applying the
3285
+ * discount. For example, 0.85 means the customer pays 85% of the original amount
3286
+ * (a 15% discount).
3287
+ */
3288
+ payment_fraction: number;
3289
+ }
3207
3290
  }
3208
3291
 
3209
3292
  export interface SpendThresholdConfigurationV2 {
3210
- commit: UpdateBaseThresholdCommit;
3293
+ commit: BaseThresholdCommit;
3211
3294
 
3212
3295
  /**
3213
3296
  * When set to false, the contract will not be evaluated against the
@@ -3223,6 +3306,19 @@ export interface SpendThresholdConfigurationV2 {
3223
3306
  * hits this amount, a threshold charge will be initiated.
3224
3307
  */
3225
3308
  threshold_amount: number;
3309
+
3310
+ discount_configuration?: SpendThresholdConfigurationV2.DiscountConfiguration;
3311
+ }
3312
+
3313
+ export namespace SpendThresholdConfigurationV2 {
3314
+ export interface DiscountConfiguration {
3315
+ /**
3316
+ * The fraction of the original amount that the customer pays after applying the
3317
+ * discount. For example, 0.85 means the customer pays 85% of the original amount
3318
+ * (a 15% discount).
3319
+ */
3320
+ payment_fraction: number;
3321
+ }
3226
3322
  }
3227
3323
 
3228
3324
  export interface Subscription {
@@ -3364,6 +3460,13 @@ export interface UpdateBaseThresholdCommit {
3364
3460
  */
3365
3461
  name?: string;
3366
3462
 
3463
+ /**
3464
+ * The priority of the commit, used to determine drawdown order. Lower priority
3465
+ * commits are consumed first. Defaults to 100 if not specified. On updates, set to
3466
+ * null to clear a previously configured priority.
3467
+ */
3468
+ priority?: number | null;
3469
+
3367
3470
  /**
3368
3471
  * The commit product that will be used to generate the line item for commit
3369
3472
  * payment.
@@ -411,6 +411,10 @@ export class Contracts extends APIResource {
411
411
  *
412
412
  * ### Usage guidelines:
413
413
  *
414
+ * - **Balance ledger details**: Use the
415
+ * [listBalances](https://docs.metronome.com/api-reference/credits-and-commits/list-balances)
416
+ * endpoint instead to understand detailed ledger drawdowns for each individual
417
+ * balance
414
418
  * - **Draft invoice handling**: Use `invoice_inclusion_mode` to control whether
415
419
  * pending draft invoice deductions are included (`FINALIZED_AND_DRAFT`, the
416
420
  * default) or excluded (`FINALIZED`) from the balance calculation
@@ -473,6 +477,9 @@ export class Contracts extends APIResource {
473
477
  *
474
478
  * ### Usage guidelines:
475
479
  *
480
+ * - Use the
481
+ * [getNetBalance](https://docs.metronome.com/api-reference/credits-and-commits/get-the-net-balance-of-a-customer)
482
+ * endpoint to retrieve a single combined current balance
476
483
  * - Date filtering: Use `effective_before` to include only balances with access
477
484
  * before a specific date (exclusive)
478
485
  * - Set `include_balance=true` for calculated balance amounts on each commit or
@@ -1664,14 +1671,6 @@ export namespace ContractCreateParams {
1664
1671
  * commits created by the specified recurring commit ids.
1665
1672
  */
1666
1673
  recurring_commit_ids?: Array<string>;
1667
-
1668
- /**
1669
- * Can only be used for commit specific overrides. Must be used in conjunction with
1670
- * one of `product_id`, `product_tags`, `pricing_group_values`, or
1671
- * `presentation_group_values`. If provided, the override will only apply to
1672
- * credits created by the specified recurring credit ids.
1673
- */
1674
- recurring_credit_ids?: Array<string>;
1675
1674
  }
1676
1675
 
1677
1676
  /**
@@ -3250,14 +3249,6 @@ export namespace ContractAmendParams {
3250
3249
  * commits created by the specified recurring commit ids.
3251
3250
  */
3252
3251
  recurring_commit_ids?: Array<string>;
3253
-
3254
- /**
3255
- * Can only be used for commit specific overrides. Must be used in conjunction with
3256
- * one of `product_id`, `product_tags`, `pricing_group_values`, or
3257
- * `presentation_group_values`. If provided, the override will only apply to
3258
- * credits created by the specified recurring credit ids.
3259
- */
3260
- recurring_credit_ids?: Array<string>;
3261
3252
  }
3262
3253
 
3263
3254
  /**
@@ -217,6 +217,11 @@ export namespace PackageRetrieveResponse {
217
217
  | 'gcp_marketplace'
218
218
  | 'metronome';
219
219
 
220
+ /**
221
+ * The name to use for contracts created from this package.
222
+ */
223
+ contract_name?: string;
224
+
220
225
  credits?: Array<Data.Credit>;
221
226
 
222
227
  delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
@@ -437,8 +442,6 @@ export namespace PackageRetrieveResponse {
437
442
  product_tags?: Array<string>;
438
443
 
439
444
  recurring_commit_template_ids?: Array<string>;
440
-
441
- recurring_credit_template_ids?: Array<string>;
442
445
  }
443
446
 
444
447
  export interface StartingAtOffset {
@@ -513,6 +516,8 @@ export namespace PackageRetrieveResponse {
513
516
 
514
517
  export interface UsageStatementSchedule {
515
518
  frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
519
+
520
+ day?: 'FIRST_OF_MONTH' | 'CONTRACT_START';
516
521
  }
517
522
 
518
523
  export interface Alias {
@@ -1039,6 +1044,11 @@ export interface PackageListResponse {
1039
1044
  | 'gcp_marketplace'
1040
1045
  | 'metronome';
1041
1046
 
1047
+ /**
1048
+ * The name to use for contracts created from this package.
1049
+ */
1050
+ contract_name?: string;
1051
+
1042
1052
  credits?: Array<PackageListResponse.Credit>;
1043
1053
 
1044
1054
  delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
@@ -1259,8 +1269,6 @@ export namespace PackageListResponse {
1259
1269
  product_tags?: Array<string>;
1260
1270
 
1261
1271
  recurring_commit_template_ids?: Array<string>;
1262
-
1263
- recurring_credit_template_ids?: Array<string>;
1264
1272
  }
1265
1273
 
1266
1274
  export interface StartingAtOffset {
@@ -1335,6 +1343,8 @@ export namespace PackageListResponse {
1335
1343
 
1336
1344
  export interface UsageStatementSchedule {
1337
1345
  frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1346
+
1347
+ day?: 'FIRST_OF_MONTH' | 'CONTRACT_START';
1338
1348
  }
1339
1349
 
1340
1350
  export interface Alias {
@@ -2332,14 +2342,6 @@ export namespace PackageCreateParams {
2332
2342
  * commits created by the specified recurring commit ids.
2333
2343
  */
2334
2344
  recurring_commit_ids?: Array<string>;
2335
-
2336
- /**
2337
- * Can only be used for commit specific overrides. Must be used in conjunction with
2338
- * one of `product_id`, `product_tags`, `pricing_group_values`, or
2339
- * `presentation_group_values`. If provided, the override will only apply to
2340
- * credits created by the specified recurring credit ids.
2341
- */
2342
- recurring_credit_ids?: Array<string>;
2343
2345
  }
2344
2346
 
2345
2347
  /**
@@ -479,6 +479,10 @@ export namespace ContractGetEditHistoryResponse {
479
479
  */
480
480
  priority?: number;
481
481
 
482
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
483
+
484
+ rollover_fraction?: number;
485
+
482
486
  /**
483
487
  * This field's availability is dependent on your client's configuration.
484
488
  */
@@ -506,6 +510,8 @@ export namespace ContractGetEditHistoryResponse {
506
510
  export interface AddOverride {
507
511
  id: string;
508
512
 
513
+ created_at: string;
514
+
509
515
  starting_at: string;
510
516
 
511
517
  applicable_product_tags?: Array<string>;
@@ -548,8 +554,6 @@ export namespace ContractGetEditHistoryResponse {
548
554
  product_tags?: Array<string>;
549
555
 
550
556
  recurring_commit_ids?: Array<string>;
551
-
552
- recurring_credit_ids?: Array<string>;
553
557
  }
554
558
 
555
559
  export interface OverwriteRate {
@@ -1110,6 +1114,20 @@ export namespace ContractGetEditHistoryResponse {
1110
1114
 
1111
1115
  access_schedule?: UpdateCredit.AccessSchedule;
1112
1116
 
1117
+ /**
1118
+ * Which products the credit applies to. If applicable_product_ids,
1119
+ * applicable_product_tags or specifiers are not provided, the credit applies to
1120
+ * all products.
1121
+ */
1122
+ applicable_product_ids?: Array<string> | null;
1123
+
1124
+ /**
1125
+ * Which tags the credit applies to. If applicable_product_ids,
1126
+ * applicable_product_tags or specifiers are not provided, the credit applies to
1127
+ * all products.
1128
+ */
1129
+ applicable_product_tags?: Array<string> | null;
1130
+
1113
1131
  description?: string;
1114
1132
 
1115
1133
  /**
@@ -1127,12 +1145,24 @@ export namespace ContractGetEditHistoryResponse {
1127
1145
  */
1128
1146
  priority?: number | null;
1129
1147
 
1148
+ product_id?: string;
1149
+
1130
1150
  /**
1131
1151
  * If set, the credit's rate type was updated to the specified value.
1132
1152
  */
1133
1153
  rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1134
1154
 
1135
1155
  rollover_fraction?: number | null;
1156
+
1157
+ /**
1158
+ * List of filters that determine what kind of customer usage draws down a commit
1159
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1160
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1161
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1162
+ * Instead, to target usage by product or product tag, pass those values in the
1163
+ * body of `specifiers`.
1164
+ */
1165
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
1136
1166
  }
1137
1167
 
1138
1168
  export namespace UpdateCredit {
@@ -1310,6 +1340,8 @@ export namespace ContractGetEditHistoryResponse {
1310
1340
  */
1311
1341
  custom_credit_type_id?: string | null;
1312
1342
 
1343
+ discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
1344
+
1313
1345
  /**
1314
1346
  * When set to false, the contract will not be evaluated against the
1315
1347
  * threshold_amount. Toggling to true will result an immediate evaluation,
@@ -1356,6 +1388,15 @@ export namespace ContractGetEditHistoryResponse {
1356
1388
  */
1357
1389
  specifiers?: Array<Shared.CommitSpecifierInput> | null;
1358
1390
  }
1391
+
1392
+ export interface DiscountConfiguration {
1393
+ /**
1394
+ * The fraction of the original amount that the customer pays after applying the
1395
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
1396
+ * the customer pays 85% of the original amount (a 15% discount).
1397
+ */
1398
+ payment_fraction?: number | null;
1399
+ }
1359
1400
  }
1360
1401
 
1361
1402
  export interface UpdateRecurringCommit {
@@ -1459,6 +1500,8 @@ export namespace ContractGetEditHistoryResponse {
1459
1500
  export interface UpdateSpendThresholdConfiguration {
1460
1501
  commit?: Shared.UpdateBaseThresholdCommit;
1461
1502
 
1503
+ discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
1504
+
1462
1505
  /**
1463
1506
  * When set to false, the contract will not be evaluated against the
1464
1507
  * threshold_amount. Toggling to true will result an immediate evaluation,
@@ -1475,6 +1518,17 @@ export namespace ContractGetEditHistoryResponse {
1475
1518
  threshold_amount?: number;
1476
1519
  }
1477
1520
 
1521
+ export namespace UpdateSpendThresholdConfiguration {
1522
+ export interface DiscountConfiguration {
1523
+ /**
1524
+ * The fraction of the original amount that the customer pays after applying the
1525
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
1526
+ * the customer pays 85% of the original amount (a 15% discount).
1527
+ */
1528
+ payment_fraction?: number | null;
1529
+ }
1530
+ }
1531
+
1478
1532
  export interface UpdateSubscription {
1479
1533
  id: string;
1480
1534
 
@@ -2462,14 +2516,6 @@ export namespace ContractEditParams {
2462
2516
  * created by the specified recurring commit ids.
2463
2517
  */
2464
2518
  recurring_commit_ids?: Array<string>;
2465
-
2466
- /**
2467
- * Can only be used for commit specific overrides. Must be used in conjunction with
2468
- * one of product_id, product_tags, pricing_group_values, or
2469
- * presentation_group_values. If provided, the override will only apply to commits
2470
- * created by the specified recurring credit ids.
2471
- */
2472
- recurring_credit_ids?: Array<string>;
2473
2519
  }
2474
2520
 
2475
2521
  /**
@@ -3344,15 +3390,15 @@ export namespace ContractEditParams {
3344
3390
  access_schedule?: UpdateCredit.AccessSchedule;
3345
3391
 
3346
3392
  /**
3347
- * Which products the commit applies to. If applicable_product_ids,
3348
- * applicable_product_tags or specifiers are not provided, the commit applies to
3393
+ * Which products the credit applies to. If applicable_product_ids,
3394
+ * applicable_product_tags or specifiers are not provided, the credit applies to
3349
3395
  * all products.
3350
3396
  */
3351
3397
  applicable_product_ids?: Array<string> | null;
3352
3398
 
3353
3399
  /**
3354
- * Which tags the commit applies to. If applicable_product_ids,
3355
- * applicable_product_tags or specifiers are not provided, the commit applies to
3400
+ * Which tags the credit applies to. If applicable_product_ids,
3401
+ * applicable_product_tags or specifiers are not provided, the credit applies to
3356
3402
  * all products.
3357
3403
  */
3358
3404
  applicable_product_tags?: Array<string> | null;
@@ -3425,6 +3471,8 @@ export namespace ContractEditParams {
3425
3471
  */
3426
3472
  custom_credit_type_id?: string | null;
3427
3473
 
3474
+ discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
3475
+
3428
3476
  /**
3429
3477
  * When set to false, the contract will not be evaluated against the
3430
3478
  * threshold_amount. Toggling to true will result an immediate evaluation,
@@ -3471,6 +3519,15 @@ export namespace ContractEditParams {
3471
3519
  */
3472
3520
  specifiers?: Array<Shared.CommitSpecifierInput> | null;
3473
3521
  }
3522
+
3523
+ export interface DiscountConfiguration {
3524
+ /**
3525
+ * The fraction of the original amount that the customer pays after applying the
3526
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
3527
+ * the customer pays 85% of the original amount (a 15% discount).
3528
+ */
3529
+ payment_fraction?: number | null;
3530
+ }
3474
3531
  }
3475
3532
 
3476
3533
  export interface UpdateRecurringCommit {
@@ -3574,6 +3631,8 @@ export namespace ContractEditParams {
3574
3631
  export interface UpdateSpendThresholdConfiguration {
3575
3632
  commit?: Shared.UpdateBaseThresholdCommit;
3576
3633
 
3634
+ discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
3635
+
3577
3636
  /**
3578
3637
  * When set to false, the contract will not be evaluated against the
3579
3638
  * threshold_amount. Toggling to true will result an immediate evaluation,
@@ -3590,6 +3649,17 @@ export namespace ContractEditParams {
3590
3649
  threshold_amount?: number;
3591
3650
  }
3592
3651
 
3652
+ export namespace UpdateSpendThresholdConfiguration {
3653
+ export interface DiscountConfiguration {
3654
+ /**
3655
+ * The fraction of the original amount that the customer pays after applying the
3656
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
3657
+ * the customer pays 85% of the original amount (a 15% discount).
3658
+ */
3659
+ payment_fraction?: number | null;
3660
+ }
3661
+ }
3662
+
3593
3663
  export interface UpdateSubscription {
3594
3664
  subscription_id: string;
3595
3665
 
@@ -82,7 +82,7 @@ export class Webhooks extends APIResource {
82
82
  ): void {
83
83
  this.validateSecret(secret);
84
84
 
85
- const msgDate = getRequiredHeader(headers, 'Date');
85
+ const msgDate = getRequiredHeader(headers, 'X-Metronome-Date');
86
86
  const msgSignature = getRequiredHeader(headers, 'Metronome-Webhook-Signature');
87
87
 
88
88
  const now = Date.now();
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '3.4.1'; // x-release-please-version
1
+ export const VERSION = '3.5.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.4.1";
1
+ export declare const VERSION = "3.5.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.4.1";
1
+ export declare const VERSION = "3.5.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '3.4.1'; // x-release-please-version
4
+ exports.VERSION = '3.5.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.4.1'; // x-release-please-version
1
+ export const VERSION = '3.5.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map