@metronome/sdk 3.7.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +9 -1
- package/client.js.map +1 -1
- package/client.mjs +9 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/shared.d.mts +354 -20
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +354 -20
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +39 -0
- package/resources/v1/alerts.d.mts.map +1 -1
- package/resources/v1/alerts.d.ts +39 -0
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +303 -20
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +303 -20
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +43 -0
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +43 -0
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.mts +1 -1
- package/resources/v1/contracts/index.d.mts.map +1 -1
- package/resources/v1/contracts/index.d.ts +1 -1
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.mts +4 -0
- package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.ts +4 -0
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +4 -0
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +4 -0
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.mts +79 -2
- package/resources/v1/customers/alerts.d.mts.map +1 -1
- package/resources/v1/customers/alerts.d.ts +79 -2
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +1 -1
- package/resources/v1/customers/alerts.mjs +1 -1
- package/resources/v1/customers/invoices.d.mts +5 -0
- package/resources/v1/customers/invoices.d.mts.map +1 -1
- package/resources/v1/customers/invoices.d.ts +5 -0
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/dashboards.d.mts +8 -3
- package/resources/v1/dashboards.d.mts.map +1 -1
- package/resources/v1/dashboards.d.ts +8 -3
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +7 -2
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +7 -2
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.mts +1 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/packages.d.mts +240 -9
- package/resources/v1/packages.d.mts.map +1 -1
- package/resources/v1/packages.d.ts +240 -9
- package/resources/v1/packages.d.ts.map +1 -1
- package/resources/v1/v1.d.mts +2 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.mts +429 -8
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +429 -8
- package/resources/v2/contracts.d.ts.map +1 -1
- package/src/client.ts +9 -1
- package/src/resources/shared.ts +422 -21
- package/src/resources/v1/alerts.ts +49 -0
- package/src/resources/v1/contracts/contracts.ts +356 -19
- package/src/resources/v1/contracts/index.ts +2 -0
- package/src/resources/v1/contracts/rate-cards/rates.ts +4 -0
- package/src/resources/v1/customers/alerts.ts +99 -2
- package/src/resources/v1/customers/invoices.ts +6 -0
- package/src/resources/v1/dashboards.ts +10 -3
- package/src/resources/v1/index.ts +2 -0
- package/src/resources/v1/packages.ts +291 -9
- package/src/resources/v1/v1.ts +4 -0
- package/src/resources/v2/contracts.ts +519 -8
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -155,6 +155,13 @@ export interface AlertCreateParams {
|
|
|
155
155
|
*/
|
|
156
156
|
threshold: number;
|
|
157
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Can be used with only `low_remaining_contract_credit_and_commit_balance_reached`
|
|
160
|
+
* notifications. Defines the balances that are considered when evaluating the
|
|
161
|
+
* alert.
|
|
162
|
+
*/
|
|
163
|
+
alert_specifiers?: Array<AlertCreateParams.AlertSpecifier>;
|
|
164
|
+
|
|
158
165
|
/**
|
|
159
166
|
* For threshold notifications of type `usage_threshold_reached`, specifies which
|
|
160
167
|
* billable metric to track the usage for.
|
|
@@ -228,6 +235,48 @@ export interface AlertCreateParams {
|
|
|
228
235
|
}
|
|
229
236
|
|
|
230
237
|
export namespace AlertCreateParams {
|
|
238
|
+
export interface AlertSpecifier {
|
|
239
|
+
/**
|
|
240
|
+
* A list of custom field filters for notification types that support advanced
|
|
241
|
+
* filtering
|
|
242
|
+
*/
|
|
243
|
+
custom_field_filters?: Array<AlertSpecifier.CustomFieldFilter>;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* If provided, the specifier will not apply to balances that matches the inclusion
|
|
247
|
+
* criteria and any of the excluding values.
|
|
248
|
+
*/
|
|
249
|
+
exclude?: Array<AlertSpecifier.Exclude>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export namespace AlertSpecifier {
|
|
253
|
+
export interface CustomFieldFilter {
|
|
254
|
+
entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
|
|
255
|
+
|
|
256
|
+
key: string;
|
|
257
|
+
|
|
258
|
+
value?: string;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface Exclude {
|
|
262
|
+
/**
|
|
263
|
+
* A list of custom field filters for notification types that support advanced
|
|
264
|
+
* filtering
|
|
265
|
+
*/
|
|
266
|
+
custom_field_filters?: Array<Exclude.CustomFieldFilter>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export namespace Exclude {
|
|
270
|
+
export interface CustomFieldFilter {
|
|
271
|
+
entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
|
|
272
|
+
|
|
273
|
+
key: string;
|
|
274
|
+
|
|
275
|
+
value: string;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
231
280
|
export interface CustomFieldFilter {
|
|
232
281
|
entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
|
|
233
282
|
|
|
@@ -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,
|
|
@@ -777,9 +824,6 @@ export namespace ContractCreateResponse {
|
|
|
777
824
|
*/
|
|
778
825
|
custom_fields?: { [key: string]: string };
|
|
779
826
|
|
|
780
|
-
/**
|
|
781
|
-
* The billing provider configuration associated with the contract.
|
|
782
|
-
*/
|
|
783
827
|
customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
|
|
784
828
|
|
|
785
829
|
ending_before?: string;
|
|
@@ -871,13 +915,19 @@ export namespace ContractCreateResponse {
|
|
|
871
915
|
frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
872
916
|
}
|
|
873
917
|
|
|
874
|
-
/**
|
|
875
|
-
* The billing provider configuration associated with the contract.
|
|
876
|
-
*/
|
|
877
918
|
export interface CustomerBillingProviderConfiguration {
|
|
878
|
-
|
|
919
|
+
/**
|
|
920
|
+
* ID of this configuration; can be provided as the
|
|
921
|
+
* billing_provider_configuration_id when creating a contract.
|
|
922
|
+
*/
|
|
923
|
+
id: string;
|
|
924
|
+
|
|
925
|
+
archived_at: string | null;
|
|
879
926
|
|
|
880
|
-
|
|
927
|
+
/**
|
|
928
|
+
* The billing provider set for this configuration.
|
|
929
|
+
*/
|
|
930
|
+
billing_provider:
|
|
881
931
|
| 'aws_marketplace'
|
|
882
932
|
| 'stripe'
|
|
883
933
|
| 'netsuite'
|
|
@@ -888,7 +938,29 @@ export namespace ContractCreateResponse {
|
|
|
888
938
|
| 'gcp_marketplace'
|
|
889
939
|
| 'metronome';
|
|
890
940
|
|
|
891
|
-
|
|
941
|
+
/**
|
|
942
|
+
* Configuration for the billing provider. The structure of this object is specific
|
|
943
|
+
* to the billing provider.
|
|
944
|
+
*/
|
|
945
|
+
configuration: { [key: string]: unknown };
|
|
946
|
+
|
|
947
|
+
customer_id: string;
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* The method to use for delivering invoices to this customer.
|
|
951
|
+
*/
|
|
952
|
+
delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* Configuration for the delivery method. The structure of this object is specific
|
|
956
|
+
* to the delivery method.
|
|
957
|
+
*/
|
|
958
|
+
delivery_method_configuration: { [key: string]: unknown };
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* ID of the delivery method to use for this customer.
|
|
962
|
+
*/
|
|
963
|
+
delivery_method_id: string;
|
|
892
964
|
}
|
|
893
965
|
|
|
894
966
|
/**
|
|
@@ -989,6 +1061,11 @@ export namespace ContractCreateResponse {
|
|
|
989
1061
|
*/
|
|
990
1062
|
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
991
1063
|
|
|
1064
|
+
/**
|
|
1065
|
+
* Rounding configuration for prorated recurring commit amounts.
|
|
1066
|
+
*/
|
|
1067
|
+
proration_rounding?: RecurringCommit.ProrationRounding | null;
|
|
1068
|
+
|
|
992
1069
|
/**
|
|
993
1070
|
* The frequency at which the recurring commits will be created. If not provided: -
|
|
994
1071
|
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
@@ -996,7 +1073,7 @@ export namespace ContractCreateResponse {
|
|
|
996
1073
|
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
997
1074
|
* invoice dates.
|
|
998
1075
|
*/
|
|
999
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1076
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
|
|
1000
1077
|
|
|
1001
1078
|
/**
|
|
1002
1079
|
* Will be passed down to the individual commits. This controls how much of an
|
|
@@ -1059,6 +1136,41 @@ export namespace ContractCreateResponse {
|
|
|
1059
1136
|
|
|
1060
1137
|
unit_price: number;
|
|
1061
1138
|
}
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* Rounding configuration for prorated recurring commit amounts.
|
|
1142
|
+
*/
|
|
1143
|
+
export interface ProrationRounding {
|
|
1144
|
+
access?: ProrationRounding.Access;
|
|
1145
|
+
|
|
1146
|
+
invoice?: ProrationRounding.Invoice;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
export namespace ProrationRounding {
|
|
1150
|
+
export interface Access {
|
|
1151
|
+
/**
|
|
1152
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
1153
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
1154
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
1155
|
+
* dollar).
|
|
1156
|
+
*/
|
|
1157
|
+
decimal_places: number;
|
|
1158
|
+
|
|
1159
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
export interface Invoice {
|
|
1163
|
+
/**
|
|
1164
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
1165
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
1166
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
1167
|
+
* dollar).
|
|
1168
|
+
*/
|
|
1169
|
+
decimal_places: number;
|
|
1170
|
+
|
|
1171
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1062
1174
|
}
|
|
1063
1175
|
|
|
1064
1176
|
export interface RecurringCredit {
|
|
@@ -1134,6 +1246,11 @@ export namespace ContractCreateResponse {
|
|
|
1134
1246
|
*/
|
|
1135
1247
|
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
1136
1248
|
|
|
1249
|
+
/**
|
|
1250
|
+
* Rounding configuration for prorated recurring credit amounts.
|
|
1251
|
+
*/
|
|
1252
|
+
proration_rounding?: RecurringCredit.ProrationRounding | null;
|
|
1253
|
+
|
|
1137
1254
|
/**
|
|
1138
1255
|
* The frequency at which the recurring commits will be created. If not provided: -
|
|
1139
1256
|
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
@@ -1141,7 +1258,7 @@ export namespace ContractCreateResponse {
|
|
|
1141
1258
|
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
1142
1259
|
* invoice dates.
|
|
1143
1260
|
*/
|
|
1144
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1261
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
|
|
1145
1262
|
|
|
1146
1263
|
/**
|
|
1147
1264
|
* Will be passed down to the individual commits. This controls how much of an
|
|
@@ -1193,6 +1310,27 @@ export namespace ContractCreateResponse {
|
|
|
1193
1310
|
export interface Contract {
|
|
1194
1311
|
id: string;
|
|
1195
1312
|
}
|
|
1313
|
+
|
|
1314
|
+
/**
|
|
1315
|
+
* Rounding configuration for prorated recurring credit amounts.
|
|
1316
|
+
*/
|
|
1317
|
+
export interface ProrationRounding {
|
|
1318
|
+
access?: ProrationRounding.Access;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
export namespace ProrationRounding {
|
|
1322
|
+
export interface Access {
|
|
1323
|
+
/**
|
|
1324
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
1325
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
1326
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
1327
|
+
* dollar).
|
|
1328
|
+
*/
|
|
1329
|
+
decimal_places: number;
|
|
1330
|
+
|
|
1331
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1196
1334
|
}
|
|
1197
1335
|
}
|
|
1198
1336
|
}
|
|
@@ -1238,6 +1376,39 @@ export namespace ContractGetNetBalanceResponse {
|
|
|
1238
1376
|
}
|
|
1239
1377
|
}
|
|
1240
1378
|
|
|
1379
|
+
export interface ContractGetSubscriptionSeatsHistoryResponse {
|
|
1380
|
+
data: Array<ContractGetSubscriptionSeatsHistoryResponse.Data>;
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* Cursor for the next page of results
|
|
1384
|
+
*/
|
|
1385
|
+
next_page: string | null;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
export namespace ContractGetSubscriptionSeatsHistoryResponse {
|
|
1389
|
+
export interface Data {
|
|
1390
|
+
/**
|
|
1391
|
+
* Array of seat IDs that are assigned in this period
|
|
1392
|
+
*/
|
|
1393
|
+
assigned_seat_ids: Array<string>;
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* The end time of this seat schedule period (null if ongoing)
|
|
1397
|
+
*/
|
|
1398
|
+
ending_before: string | null;
|
|
1399
|
+
|
|
1400
|
+
/**
|
|
1401
|
+
* The start time of this seat schedule period
|
|
1402
|
+
*/
|
|
1403
|
+
starting_at: string;
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* Total number of assigned and unassigned seats in this period
|
|
1407
|
+
*/
|
|
1408
|
+
total_quantity: number;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1241
1412
|
export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
|
|
1242
1413
|
|
|
1243
1414
|
export interface ContractListSeatBalancesResponse {
|
|
@@ -2201,9 +2372,10 @@ export namespace ContractCreateParams {
|
|
|
2201
2372
|
|
|
2202
2373
|
/**
|
|
2203
2374
|
* Indicates whether the override should only apply to commits. Defaults to
|
|
2204
|
-
* `false`. If `true
|
|
2205
|
-
* passing `commit_ids
|
|
2206
|
-
*
|
|
2375
|
+
* `false`. If `true` you can specify relevant commits in `override_specifiers` by
|
|
2376
|
+
* passing `commit_ids`, `recurring_commit_ids`, or `any_commit_or_credit_ids`. If
|
|
2377
|
+
* you do not specify any of these fields, the override will apply when consuming
|
|
2378
|
+
* any prepaid commit, postpaid commit, or credit
|
|
2207
2379
|
*/
|
|
2208
2380
|
is_commit_specific?: boolean;
|
|
2209
2381
|
|
|
@@ -2257,6 +2429,15 @@ export namespace ContractCreateParams {
|
|
|
2257
2429
|
|
|
2258
2430
|
export namespace Override {
|
|
2259
2431
|
export interface OverrideSpecifier {
|
|
2432
|
+
/**
|
|
2433
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2434
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
2435
|
+
* `presentation_group_values`. Must be used instead of both `commit_ids` and
|
|
2436
|
+
* `recurring_commit_ids` If provided, the override will apply to any specified
|
|
2437
|
+
* commit, credit, recurring commit or recurring credit IDs.
|
|
2438
|
+
*/
|
|
2439
|
+
any_commit_or_credit_ids?: Array<string>;
|
|
2440
|
+
|
|
2260
2441
|
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
2261
2442
|
|
|
2262
2443
|
/**
|
|
@@ -2447,6 +2628,11 @@ export namespace ContractCreateParams {
|
|
|
2447
2628
|
*/
|
|
2448
2629
|
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
2449
2630
|
|
|
2631
|
+
/**
|
|
2632
|
+
* Optional rounding configuration for prorated recurring commit amounts.
|
|
2633
|
+
*/
|
|
2634
|
+
proration_rounding?: RecurringCommit.ProrationRounding;
|
|
2635
|
+
|
|
2450
2636
|
/**
|
|
2451
2637
|
* Whether the created commits will use the commit rate or list rate
|
|
2452
2638
|
*/
|
|
@@ -2459,7 +2645,7 @@ export namespace ContractCreateParams {
|
|
|
2459
2645
|
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
2460
2646
|
* invoice dates.
|
|
2461
2647
|
*/
|
|
2462
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
2648
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
|
|
2463
2649
|
|
|
2464
2650
|
/**
|
|
2465
2651
|
* Will be passed down to the individual commits. This controls how much of an
|
|
@@ -2526,6 +2712,41 @@ export namespace ContractCreateParams {
|
|
|
2526
2712
|
unit_price: number;
|
|
2527
2713
|
}
|
|
2528
2714
|
|
|
2715
|
+
/**
|
|
2716
|
+
* Optional rounding configuration for prorated recurring commit amounts.
|
|
2717
|
+
*/
|
|
2718
|
+
export interface ProrationRounding {
|
|
2719
|
+
access?: ProrationRounding.Access;
|
|
2720
|
+
|
|
2721
|
+
invoice?: ProrationRounding.Invoice;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
export namespace ProrationRounding {
|
|
2725
|
+
export interface Access {
|
|
2726
|
+
/**
|
|
2727
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
2728
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
2729
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
2730
|
+
* dollar).
|
|
2731
|
+
*/
|
|
2732
|
+
decimal_places: number;
|
|
2733
|
+
|
|
2734
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
export interface Invoice {
|
|
2738
|
+
/**
|
|
2739
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
2740
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
2741
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
2742
|
+
* dollar).
|
|
2743
|
+
*/
|
|
2744
|
+
decimal_places: number;
|
|
2745
|
+
|
|
2746
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2529
2750
|
/**
|
|
2530
2751
|
* Attach a subscription to the recurring commit/credit.
|
|
2531
2752
|
*/
|
|
@@ -2620,6 +2841,11 @@ export namespace ContractCreateParams {
|
|
|
2620
2841
|
*/
|
|
2621
2842
|
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
2622
2843
|
|
|
2844
|
+
/**
|
|
2845
|
+
* Optional rounding configuration for prorated recurring credit amounts.
|
|
2846
|
+
*/
|
|
2847
|
+
proration_rounding?: RecurringCredit.ProrationRounding;
|
|
2848
|
+
|
|
2623
2849
|
/**
|
|
2624
2850
|
* Whether the created commits will use the commit rate or list rate
|
|
2625
2851
|
*/
|
|
@@ -2632,7 +2858,7 @@ export namespace ContractCreateParams {
|
|
|
2632
2858
|
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
2633
2859
|
* invoice dates.
|
|
2634
2860
|
*/
|
|
2635
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
2861
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
|
|
2636
2862
|
|
|
2637
2863
|
/**
|
|
2638
2864
|
* Will be passed down to the individual commits. This controls how much of an
|
|
@@ -2688,6 +2914,27 @@ export namespace ContractCreateParams {
|
|
|
2688
2914
|
unit?: 'PERIODS';
|
|
2689
2915
|
}
|
|
2690
2916
|
|
|
2917
|
+
/**
|
|
2918
|
+
* Optional rounding configuration for prorated recurring credit amounts.
|
|
2919
|
+
*/
|
|
2920
|
+
export interface ProrationRounding {
|
|
2921
|
+
access?: ProrationRounding.Access;
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
export namespace ProrationRounding {
|
|
2925
|
+
export interface Access {
|
|
2926
|
+
/**
|
|
2927
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
2928
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
2929
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
2930
|
+
* dollar).
|
|
2931
|
+
*/
|
|
2932
|
+
decimal_places: number;
|
|
2933
|
+
|
|
2934
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2691
2938
|
/**
|
|
2692
2939
|
* Attach a subscription to the recurring commit/credit.
|
|
2693
2940
|
*/
|
|
@@ -2944,6 +3191,8 @@ export namespace ContractCreateParams {
|
|
|
2944
3191
|
|
|
2945
3192
|
subscription_rate: Subscription.SubscriptionRate;
|
|
2946
3193
|
|
|
3194
|
+
billing_cycle_config?: Subscription.BillingCycleConfig;
|
|
3195
|
+
|
|
2947
3196
|
/**
|
|
2948
3197
|
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2949
3198
|
*/
|
|
@@ -3008,6 +3257,22 @@ export namespace ContractCreateParams {
|
|
|
3008
3257
|
* Indicates if the partial period will be prorated or charged a full amount.
|
|
3009
3258
|
*/
|
|
3010
3259
|
is_prorated?: boolean;
|
|
3260
|
+
|
|
3261
|
+
rounding?: Proration.Rounding;
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
export namespace Proration {
|
|
3265
|
+
export interface Rounding {
|
|
3266
|
+
/**
|
|
3267
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
3268
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
3269
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
3270
|
+
* dollar).
|
|
3271
|
+
*/
|
|
3272
|
+
decimal_places: number;
|
|
3273
|
+
|
|
3274
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
3275
|
+
}
|
|
3011
3276
|
}
|
|
3012
3277
|
|
|
3013
3278
|
export interface SubscriptionRate {
|
|
@@ -3023,6 +3288,20 @@ export namespace ContractCreateParams {
|
|
|
3023
3288
|
product_id: string;
|
|
3024
3289
|
}
|
|
3025
3290
|
|
|
3291
|
+
export interface BillingCycleConfig {
|
|
3292
|
+
/**
|
|
3293
|
+
* The date to anchor the billing cycle to. If omitted, defaults to the contract's
|
|
3294
|
+
* usage invoice billing cycle anchor date.
|
|
3295
|
+
*/
|
|
3296
|
+
anchor_date?: string;
|
|
3297
|
+
|
|
3298
|
+
/**
|
|
3299
|
+
* Controls whether this subscription consolidates onto usage invoices or gets its
|
|
3300
|
+
* own scheduled invoice. Defaults to ON_USAGE_INVOICE if omitted.
|
|
3301
|
+
*/
|
|
3302
|
+
invoice_placement?: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3026
3305
|
export interface SeatConfig {
|
|
3027
3306
|
/**
|
|
3028
3307
|
* The initial assigned seats on this subscription.
|
|
@@ -3739,9 +4018,10 @@ export namespace ContractAmendParams {
|
|
|
3739
4018
|
|
|
3740
4019
|
/**
|
|
3741
4020
|
* Indicates whether the override should only apply to commits. Defaults to
|
|
3742
|
-
* `false`. If `true
|
|
3743
|
-
* passing `commit_ids
|
|
3744
|
-
*
|
|
4021
|
+
* `false`. If `true` you can specify relevant commits in `override_specifiers` by
|
|
4022
|
+
* passing `commit_ids`, `recurring_commit_ids`, or `any_commit_or_credit_ids`. If
|
|
4023
|
+
* you do not specify any of these fields, the override will apply when consuming
|
|
4024
|
+
* any prepaid commit, postpaid commit, or credit
|
|
3745
4025
|
*/
|
|
3746
4026
|
is_commit_specific?: boolean;
|
|
3747
4027
|
|
|
@@ -3795,6 +4075,15 @@ export namespace ContractAmendParams {
|
|
|
3795
4075
|
|
|
3796
4076
|
export namespace Override {
|
|
3797
4077
|
export interface OverrideSpecifier {
|
|
4078
|
+
/**
|
|
4079
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
4080
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
4081
|
+
* `presentation_group_values`. Must be used instead of both `commit_ids` and
|
|
4082
|
+
* `recurring_commit_ids` If provided, the override will apply to any specified
|
|
4083
|
+
* commit, credit, recurring commit or recurring credit IDs.
|
|
4084
|
+
*/
|
|
4085
|
+
any_commit_or_credit_ids?: Array<string>;
|
|
4086
|
+
|
|
3798
4087
|
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
3799
4088
|
|
|
3800
4089
|
/**
|
|
@@ -4196,6 +4485,46 @@ export interface ContractGetNetBalanceParams {
|
|
|
4196
4485
|
invoice_inclusion_mode?: 'FINALIZED' | 'FINALIZED_AND_DRAFT';
|
|
4197
4486
|
}
|
|
4198
4487
|
|
|
4488
|
+
export interface ContractGetSubscriptionSeatsHistoryParams {
|
|
4489
|
+
contract_id: string;
|
|
4490
|
+
|
|
4491
|
+
customer_id: string;
|
|
4492
|
+
|
|
4493
|
+
subscription_id: string;
|
|
4494
|
+
|
|
4495
|
+
/**
|
|
4496
|
+
* Get the seats history segment for the covering date. Cannot be used with
|
|
4497
|
+
* `starting_at` or `ending_before`.
|
|
4498
|
+
*/
|
|
4499
|
+
covering_date?: string | null;
|
|
4500
|
+
|
|
4501
|
+
/**
|
|
4502
|
+
* Cursor for pagination. Use the value from the `next_page` field of the previous
|
|
4503
|
+
* response to retrieve the next page of results.
|
|
4504
|
+
*/
|
|
4505
|
+
cursor?: string | null;
|
|
4506
|
+
|
|
4507
|
+
/**
|
|
4508
|
+
* Include seats history segments that are active at or before this timestamp. Use
|
|
4509
|
+
* with `starting_at` to get a specific time range. If not set, there's no upper
|
|
4510
|
+
* bound.
|
|
4511
|
+
*/
|
|
4512
|
+
ending_before?: string | null;
|
|
4513
|
+
|
|
4514
|
+
/**
|
|
4515
|
+
* Maximum number of seat schedule entries to return. Defaults to 10. Required
|
|
4516
|
+
* range: 1 <= x <= 10.
|
|
4517
|
+
*/
|
|
4518
|
+
limit?: number | null;
|
|
4519
|
+
|
|
4520
|
+
/**
|
|
4521
|
+
* Include seats history segments that are active at or after this timestamp. Use
|
|
4522
|
+
* with `ending_before` to get a specific time range. If not set, there's no lower
|
|
4523
|
+
* bound.
|
|
4524
|
+
*/
|
|
4525
|
+
starting_at?: string | null;
|
|
4526
|
+
}
|
|
4527
|
+
|
|
4199
4528
|
export interface ContractListBalancesParams extends BodyCursorPageParams {
|
|
4200
4529
|
customer_id: string;
|
|
4201
4530
|
|
|
@@ -4299,6 +4628,12 @@ export interface ContractListSeatBalancesParams {
|
|
|
4299
4628
|
*/
|
|
4300
4629
|
seat_ids?: Array<string>;
|
|
4301
4630
|
|
|
4631
|
+
/**
|
|
4632
|
+
* When true, any seat_ids not found in contract subscriptions will be silently
|
|
4633
|
+
* omitted from the response instead of returning a 400 error.
|
|
4634
|
+
*/
|
|
4635
|
+
skip_missing_seat_ids?: boolean;
|
|
4636
|
+
|
|
4302
4637
|
/**
|
|
4303
4638
|
* Include only commits or credits with access effective on or after this date
|
|
4304
4639
|
* (cannot be used with covering_date).
|
|
@@ -4512,6 +4847,7 @@ export declare namespace Contracts {
|
|
|
4512
4847
|
type ContractArchiveResponse as ContractArchiveResponse,
|
|
4513
4848
|
type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
|
|
4514
4849
|
type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse,
|
|
4850
|
+
type ContractGetSubscriptionSeatsHistoryResponse as ContractGetSubscriptionSeatsHistoryResponse,
|
|
4515
4851
|
type ContractListBalancesResponse as ContractListBalancesResponse,
|
|
4516
4852
|
type ContractListSeatBalancesResponse as ContractListSeatBalancesResponse,
|
|
4517
4853
|
type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
|
|
@@ -4527,6 +4863,7 @@ export declare namespace Contracts {
|
|
|
4527
4863
|
type ContractArchiveParams as ContractArchiveParams,
|
|
4528
4864
|
type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
|
|
4529
4865
|
type ContractGetNetBalanceParams as ContractGetNetBalanceParams,
|
|
4866
|
+
type ContractGetSubscriptionSeatsHistoryParams as ContractGetSubscriptionSeatsHistoryParams,
|
|
4530
4867
|
type ContractListBalancesParams as ContractListBalancesParams,
|
|
4531
4868
|
type ContractListSeatBalancesParams as ContractListSeatBalancesParams,
|
|
4532
4869
|
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 =
|