@metronome/sdk 2.0.0 → 2.2.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 +99 -0
- package/client.d.mts +1 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +1 -1
- package/client.d.ts.map +1 -1
- package/package.json +1 -1
- package/resources/shared.d.mts +73 -20
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +73 -20
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +20 -1
- package/resources/v1/alerts.d.mts.map +1 -1
- package/resources/v1/alerts.d.ts +20 -1
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +89 -12
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +89 -12
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +1 -1
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +1 -1
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/credit-grants.d.mts +10 -5
- package/resources/v1/credit-grants.d.mts.map +1 -1
- package/resources/v1/credit-grants.d.ts +10 -5
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +10 -5
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +10 -5
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.mts +39 -1
- package/resources/v1/customers/alerts.d.mts.map +1 -1
- package/resources/v1/customers/alerts.d.ts +39 -1
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.d.mts +25 -7
- package/resources/v1/customers/billing-config.d.mts.map +1 -1
- package/resources/v1/customers/billing-config.d.ts +25 -7
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +6 -3
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +6 -3
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.mts +3 -2
- package/resources/v1/customers/commits.d.mts.map +1 -1
- package/resources/v1/customers/commits.d.ts +3 -2
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +2 -1
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +2 -1
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +89 -14
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +89 -14
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +13 -8
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +13 -8
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +1 -1
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.mts +62 -5
- package/resources/v1/customers/invoices.d.mts.map +1 -1
- package/resources/v1/customers/invoices.d.ts +62 -5
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +2 -1
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +2 -1
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/plans.d.mts +9 -4
- package/resources/v1/customers/plans.d.mts.map +1 -1
- package/resources/v1/customers/plans.d.ts +9 -4
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +8 -4
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +8 -4
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/index.d.mts +2 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/payments.d.mts +1 -0
- package/resources/v1/payments.d.mts.map +1 -1
- package/resources/v1/payments.d.ts +1 -0
- package/resources/v1/payments.d.ts.map +1 -1
- package/resources/v1/plans.d.mts +8 -4
- package/resources/v1/plans.d.mts.map +1 -1
- package/resources/v1/plans.d.ts +8 -4
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +8 -4
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +8 -4
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/settings/billing-providers.d.mts +103 -0
- package/resources/v1/settings/billing-providers.d.mts.map +1 -0
- package/resources/v1/settings/billing-providers.d.ts +103 -0
- package/resources/v1/settings/billing-providers.d.ts.map +1 -0
- package/resources/v1/settings/billing-providers.js +48 -0
- package/resources/v1/settings/billing-providers.js.map +1 -0
- package/resources/v1/settings/billing-providers.mjs +44 -0
- package/resources/v1/settings/billing-providers.mjs.map +1 -0
- package/resources/v1/settings/index.d.mts +3 -0
- package/resources/v1/settings/index.d.mts.map +1 -0
- package/resources/v1/settings/index.d.ts +3 -0
- package/resources/v1/settings/index.d.ts.map +1 -0
- package/resources/v1/settings/index.js +9 -0
- package/resources/v1/settings/index.js.map +1 -0
- package/resources/v1/settings/index.mjs +4 -0
- package/resources/v1/settings/index.mjs.map +1 -0
- package/resources/v1/settings/settings.d.mts +60 -0
- package/resources/v1/settings/settings.d.mts.map +1 -0
- package/resources/v1/settings/settings.d.ts +60 -0
- package/resources/v1/settings/settings.d.ts.map +1 -0
- package/resources/v1/settings/settings.js +40 -0
- package/resources/v1/settings/settings.js.map +1 -0
- package/resources/v1/settings/settings.mjs +35 -0
- package/resources/v1/settings/settings.mjs.map +1 -0
- package/resources/v1/settings.d.mts +2 -0
- package/resources/v1/settings.d.mts.map +1 -0
- package/resources/v1/settings.d.ts +2 -0
- package/resources/v1/settings.d.ts.map +1 -0
- package/resources/v1/settings.js +6 -0
- package/resources/v1/settings.js.map +1 -0
- package/resources/v1/settings.mjs +3 -0
- package/resources/v1/settings.mjs.map +1 -0
- package/resources/v1/usage.d.mts +3 -2
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +3 -2
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/v1.d.mts +6 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +6 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.mts +204 -3
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +204 -3
- package/resources/v2/contracts.d.ts.map +1 -1
- package/src/client.ts +1 -1
- package/src/resources/shared.ts +80 -20
- package/src/resources/v1/alerts.ts +24 -1
- package/src/resources/v1/contracts/contracts.ts +97 -12
- package/src/resources/v1/credit-grants.ts +10 -5
- package/src/resources/v1/customers/alerts.ts +45 -0
- package/src/resources/v1/customers/billing-config.ts +32 -7
- package/src/resources/v1/customers/commits.ts +3 -2
- package/src/resources/v1/customers/customers.ts +112 -18
- package/src/resources/v1/customers/index.ts +1 -0
- package/src/resources/v1/customers/invoices.ts +80 -3
- package/src/resources/v1/customers/plans.ts +10 -4
- package/src/resources/v1/index.ts +6 -0
- package/src/resources/v1/payments.ts +2 -0
- package/src/resources/v1/plans.ts +8 -4
- package/src/resources/v1/settings/billing-providers.ts +139 -0
- package/src/resources/v1/settings/index.ts +14 -0
- package/src/resources/v1/settings/settings.ts +94 -0
- package/src/resources/v1/settings.ts +3 -0
- package/src/resources/v1/usage.ts +3 -2
- package/src/resources/v1/v1.ts +16 -0
- package/src/resources/v2/contracts.ts +249 -3
- 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
package/src/resources/shared.ts
CHANGED
|
@@ -563,7 +563,8 @@ export namespace Contract {
|
|
|
563
563
|
| 'azure_marketplace'
|
|
564
564
|
| 'quickbooks_online'
|
|
565
565
|
| 'workday'
|
|
566
|
-
| 'gcp_marketplace'
|
|
566
|
+
| 'gcp_marketplace'
|
|
567
|
+
| 'metronome';
|
|
567
568
|
|
|
568
569
|
delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
569
570
|
|
|
@@ -822,6 +823,11 @@ export namespace ContractV2 {
|
|
|
822
823
|
* specifiers to contribute to a commit's or credit's drawdown.
|
|
823
824
|
*/
|
|
824
825
|
specifiers?: Array<Shared.CommitSpecifier>;
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* Attach a subscription to the recurring commit/credit.
|
|
829
|
+
*/
|
|
830
|
+
subscription_config?: Shared.RecurringCommitSubscriptionConfig;
|
|
825
831
|
}
|
|
826
832
|
|
|
827
833
|
export namespace Commit {
|
|
@@ -1164,6 +1170,14 @@ export namespace ContractV2 {
|
|
|
1164
1170
|
|
|
1165
1171
|
contract?: Credit.Contract;
|
|
1166
1172
|
|
|
1173
|
+
/**
|
|
1174
|
+
* Timestamp of when the credit was created.
|
|
1175
|
+
*
|
|
1176
|
+
* - Recurring credits: latter of credit service period date and parent credit
|
|
1177
|
+
* start date
|
|
1178
|
+
*/
|
|
1179
|
+
created_at?: string;
|
|
1180
|
+
|
|
1167
1181
|
/**
|
|
1168
1182
|
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1169
1183
|
*/
|
|
@@ -1214,6 +1228,11 @@ export namespace ContractV2 {
|
|
|
1214
1228
|
* specifiers to contribute to a commit's or credit's drawdown.
|
|
1215
1229
|
*/
|
|
1216
1230
|
specifiers?: Array<Shared.CommitSpecifier>;
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Attach a subscription to the recurring commit/credit.
|
|
1234
|
+
*/
|
|
1235
|
+
subscription_config?: Shared.RecurringCommitSubscriptionConfig;
|
|
1217
1236
|
}
|
|
1218
1237
|
|
|
1219
1238
|
export namespace Credit {
|
|
@@ -1327,7 +1346,8 @@ export namespace ContractV2 {
|
|
|
1327
1346
|
| 'azure_marketplace'
|
|
1328
1347
|
| 'quickbooks_online'
|
|
1329
1348
|
| 'workday'
|
|
1330
|
-
| 'gcp_marketplace'
|
|
1349
|
+
| 'gcp_marketplace'
|
|
1350
|
+
| 'metronome';
|
|
1331
1351
|
|
|
1332
1352
|
delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
1333
1353
|
}
|
|
@@ -1370,10 +1390,13 @@ export namespace ContractV2 {
|
|
|
1370
1390
|
|
|
1371
1391
|
export interface ParentBehavior {
|
|
1372
1392
|
/**
|
|
1373
|
-
* Indicates the desired behavior of consolidated invoices
|
|
1374
|
-
* in a customer hierarchy
|
|
1375
|
-
*
|
|
1376
|
-
*
|
|
1393
|
+
* Account hierarchy M3 - Indicates the desired behavior of consolidated invoices
|
|
1394
|
+
* generated by the parent in a customer hierarchy
|
|
1395
|
+
*
|
|
1396
|
+
* **CONCATENATE**: Statements on the invoices of child customers will be appended
|
|
1397
|
+
* to the consolidated invoice
|
|
1398
|
+
*
|
|
1399
|
+
* **NONE**: Do not generate consolidated invoices
|
|
1377
1400
|
*/
|
|
1378
1401
|
invoice_consolidation_type?: 'CONCATENATE' | 'NONE';
|
|
1379
1402
|
}
|
|
@@ -1386,15 +1409,21 @@ export namespace ContractV2 {
|
|
|
1386
1409
|
parent: ChildHierarchyConfigurationV2.Parent;
|
|
1387
1410
|
|
|
1388
1411
|
/**
|
|
1389
|
-
*
|
|
1412
|
+
* Account hierarchy M3 - Indicates which customer should pay for the child's
|
|
1413
|
+
* invoice charges **SELF**: The child pays for its own invoice charges **PARENT**:
|
|
1414
|
+
* The parent pays for the child's invoice charges
|
|
1390
1415
|
*/
|
|
1391
1416
|
payer?: 'SELF' | 'PARENT';
|
|
1392
1417
|
|
|
1393
1418
|
/**
|
|
1394
|
-
* Indicates the behavior of the child's invoice statements
|
|
1395
|
-
*
|
|
1396
|
-
*
|
|
1397
|
-
*
|
|
1419
|
+
* Account hierarchy M3 - Indicates the behavior of the child's invoice statements
|
|
1420
|
+
* on the parent's invoices.
|
|
1421
|
+
*
|
|
1422
|
+
* **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
1423
|
+
* consolidated invoices
|
|
1424
|
+
*
|
|
1425
|
+
* **SEPARATE**: Child's invoice statements will appear not appear on parent's
|
|
1426
|
+
* consolidated invoices
|
|
1398
1427
|
*/
|
|
1399
1428
|
usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE';
|
|
1400
1429
|
}
|
|
@@ -2431,10 +2460,13 @@ export namespace HierarchyConfiguration {
|
|
|
2431
2460
|
|
|
2432
2461
|
export interface ParentBehavior {
|
|
2433
2462
|
/**
|
|
2434
|
-
* Indicates the desired behavior of consolidated invoices
|
|
2435
|
-
* in a customer hierarchy
|
|
2436
|
-
*
|
|
2437
|
-
*
|
|
2463
|
+
* Account hierarchy M3 - Indicates the desired behavior of consolidated invoices
|
|
2464
|
+
* generated by the parent in a customer hierarchy
|
|
2465
|
+
*
|
|
2466
|
+
* **CONCATENATE**: Statements on the invoices of child customers will be appended
|
|
2467
|
+
* to the consolidated invoice
|
|
2468
|
+
*
|
|
2469
|
+
* **NONE**: Do not generate consolidated invoices
|
|
2438
2470
|
*/
|
|
2439
2471
|
invoice_consolidation_type?: 'CONCATENATE' | 'NONE';
|
|
2440
2472
|
}
|
|
@@ -2447,15 +2479,24 @@ export namespace HierarchyConfiguration {
|
|
|
2447
2479
|
parent: ChildHierarchyConfiguration.Parent;
|
|
2448
2480
|
|
|
2449
2481
|
/**
|
|
2450
|
-
* Indicates
|
|
2482
|
+
* Account hierarchy M3 - Indicates which customer should pay for the child's
|
|
2483
|
+
* invoice charges
|
|
2484
|
+
*
|
|
2485
|
+
* **SELF**: The child pays for its own invoice charges
|
|
2486
|
+
*
|
|
2487
|
+
* **PARENT**: The parent pays for the child's invoice charges
|
|
2451
2488
|
*/
|
|
2452
2489
|
payer?: 'SELF' | 'PARENT';
|
|
2453
2490
|
|
|
2454
2491
|
/**
|
|
2455
|
-
* Indicates the behavior of the child's invoice statements
|
|
2456
|
-
*
|
|
2457
|
-
*
|
|
2458
|
-
*
|
|
2492
|
+
* Account hierarchy M3 - Indicates the behavior of the child's invoice statements
|
|
2493
|
+
* on the parent's invoices.
|
|
2494
|
+
*
|
|
2495
|
+
* **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
2496
|
+
* consolidated invoices
|
|
2497
|
+
*
|
|
2498
|
+
* **SEPARATE**: Child's invoice statements will appear not appear on parent's
|
|
2499
|
+
* consolidated invoices
|
|
2459
2500
|
*/
|
|
2460
2501
|
usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE';
|
|
2461
2502
|
}
|
|
@@ -3104,6 +3145,11 @@ export interface Subscription {
|
|
|
3104
3145
|
* QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
3105
3146
|
* directly on the subscription. `initial_quantity` must be provided with this
|
|
3106
3147
|
* option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
3148
|
+
* **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
|
|
3149
|
+
* user_123) to increment and decrement a subscription quantity, rather than
|
|
3150
|
+
* directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
3151
|
+
* use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
3152
|
+
* provided with this option.
|
|
3107
3153
|
*/
|
|
3108
3154
|
quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
|
|
3109
3155
|
|
|
@@ -3131,6 +3177,8 @@ export interface Subscription {
|
|
|
3131
3177
|
fiat_credit_type_id?: string;
|
|
3132
3178
|
|
|
3133
3179
|
name?: string;
|
|
3180
|
+
|
|
3181
|
+
seat_config?: Subscription.SeatConfig;
|
|
3134
3182
|
}
|
|
3135
3183
|
|
|
3136
3184
|
export namespace Subscription {
|
|
@@ -3192,6 +3240,18 @@ export namespace Subscription {
|
|
|
3192
3240
|
name: string;
|
|
3193
3241
|
}
|
|
3194
3242
|
}
|
|
3243
|
+
|
|
3244
|
+
export interface SeatConfig {
|
|
3245
|
+
/**
|
|
3246
|
+
* The property name, sent on usage events, that identifies the seat ID associated
|
|
3247
|
+
* with the usage event. For example, the property name might be seat_id or
|
|
3248
|
+
* user_id. The property must be set as a group key on billable metrics and a
|
|
3249
|
+
* presentation/pricing group key on contract products. This allows linked
|
|
3250
|
+
* recurring credits with an allocation per seat to be consumed by only one seat's
|
|
3251
|
+
* usage.
|
|
3252
|
+
*/
|
|
3253
|
+
seat_group_key: string;
|
|
3254
|
+
}
|
|
3195
3255
|
}
|
|
3196
3256
|
|
|
3197
3257
|
export interface Tier {
|
|
@@ -137,7 +137,8 @@ export interface AlertCreateParams {
|
|
|
137
137
|
| 'low_remaining_contract_credit_balance_reached'
|
|
138
138
|
| 'low_remaining_contract_credit_percentage_reached'
|
|
139
139
|
| 'low_remaining_contract_credit_and_commit_balance_reached'
|
|
140
|
-
| 'invoice_total_reached'
|
|
140
|
+
| 'invoice_total_reached'
|
|
141
|
+
| 'low_remaining_seat_balance_reached';
|
|
141
142
|
|
|
142
143
|
/**
|
|
143
144
|
* Name of the threshold notification
|
|
@@ -209,6 +210,12 @@ export interface AlertCreateParams {
|
|
|
209
210
|
*/
|
|
210
211
|
plan_id?: string;
|
|
211
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Required for `low_remaining_seat_balance_reached` notifications. The alert is
|
|
215
|
+
* scoped to this seat group key-value pair.
|
|
216
|
+
*/
|
|
217
|
+
seat_filter?: AlertCreateParams.SeatFilter;
|
|
218
|
+
|
|
212
219
|
/**
|
|
213
220
|
* Prevents the creation of duplicates. If a request to create a record is made
|
|
214
221
|
* with a previously used uniqueness key, a new record will not be created and the
|
|
@@ -231,6 +238,22 @@ export namespace AlertCreateParams {
|
|
|
231
238
|
|
|
232
239
|
value?: string;
|
|
233
240
|
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Required for `low_remaining_seat_balance_reached` notifications. The alert is
|
|
244
|
+
* scoped to this seat group key-value pair.
|
|
245
|
+
*/
|
|
246
|
+
export interface SeatFilter {
|
|
247
|
+
/**
|
|
248
|
+
* The seat group key (e.g., "seat_id", "user_id")
|
|
249
|
+
*/
|
|
250
|
+
seat_group_key: string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Optional seat identifier the alert is scoped to.
|
|
254
|
+
*/
|
|
255
|
+
seat_group_value?: string;
|
|
256
|
+
}
|
|
234
257
|
}
|
|
235
258
|
|
|
236
259
|
export interface AlertArchiveParams {
|
|
@@ -279,7 +279,7 @@ export class Contracts extends APIResource {
|
|
|
279
279
|
/**
|
|
280
280
|
* Amendments will be replaced by Contract editing. New clients should implement
|
|
281
281
|
* using the `editContract` endpoint. Read more about the migration to contract
|
|
282
|
-
* editing [here](
|
|
282
|
+
* editing [here](/guides/implement-metronome/migrate-amendments-to-edits/) and
|
|
283
283
|
* reach out to your Metronome representative for more details. Once contract
|
|
284
284
|
* editing is enabled, access to this endpoint will be removed.
|
|
285
285
|
*
|
|
@@ -792,6 +792,12 @@ export interface ContractCreateParams {
|
|
|
792
792
|
*/
|
|
793
793
|
reseller_royalties?: Array<ContractCreateParams.ResellerRoyalty>;
|
|
794
794
|
|
|
795
|
+
/**
|
|
796
|
+
* The revenue system configuration associated with a contract. Provide either an
|
|
797
|
+
* ID or the provider and delivery method.
|
|
798
|
+
*/
|
|
799
|
+
revenue_system_configuration?: ContractCreateParams.RevenueSystemConfiguration;
|
|
800
|
+
|
|
795
801
|
/**
|
|
796
802
|
* This field's availability is dependent on your client's configuration.
|
|
797
803
|
*/
|
|
@@ -1393,15 +1399,24 @@ export namespace ContractCreateParams {
|
|
|
1393
1399
|
parent_behavior?: HierarchyConfiguration.ParentBehavior;
|
|
1394
1400
|
|
|
1395
1401
|
/**
|
|
1396
|
-
* Indicates
|
|
1402
|
+
* Account hierarchy M3 - Indicates which customer should pay for the child's
|
|
1403
|
+
* invoice charges
|
|
1404
|
+
*
|
|
1405
|
+
* **SELF**: The child pays for its own invoice charges
|
|
1406
|
+
*
|
|
1407
|
+
* **PARENT**: The parent pays for the child's invoice charges
|
|
1397
1408
|
*/
|
|
1398
1409
|
payer?: 'SELF' | 'PARENT';
|
|
1399
1410
|
|
|
1400
1411
|
/**
|
|
1401
|
-
* Indicates the behavior of the child's invoice statements
|
|
1402
|
-
*
|
|
1403
|
-
*
|
|
1404
|
-
*
|
|
1412
|
+
* Account hierarchy M3 - Indicates the behavior of the child's invoice statements
|
|
1413
|
+
* on the parent's invoices.
|
|
1414
|
+
*
|
|
1415
|
+
* **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
1416
|
+
* consolidated invoices
|
|
1417
|
+
*
|
|
1418
|
+
* **SEPARATE**: Child's invoice statements will appear not appear on parent's
|
|
1419
|
+
* consolidated invoices
|
|
1405
1420
|
*/
|
|
1406
1421
|
usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE';
|
|
1407
1422
|
}
|
|
@@ -1415,10 +1430,13 @@ export namespace ContractCreateParams {
|
|
|
1415
1430
|
|
|
1416
1431
|
export interface ParentBehavior {
|
|
1417
1432
|
/**
|
|
1418
|
-
* Indicates the desired behavior of consolidated invoices
|
|
1419
|
-
* in a customer hierarchy
|
|
1420
|
-
*
|
|
1421
|
-
*
|
|
1433
|
+
* Account hierarchy M3 - Indicates the desired behavior of consolidated invoices
|
|
1434
|
+
* generated by the parent in a customer hierarchy
|
|
1435
|
+
*
|
|
1436
|
+
* **CONCATENATE**: Statements on the invoices of child customers will be appended
|
|
1437
|
+
* to the consolidated invoice
|
|
1438
|
+
*
|
|
1439
|
+
* **NONE**: Do not generate consolidated invoices
|
|
1422
1440
|
*/
|
|
1423
1441
|
invoice_consolidation_type?: 'CONCATENATE' | 'NONE';
|
|
1424
1442
|
}
|
|
@@ -1790,7 +1808,8 @@ export namespace ContractCreateParams {
|
|
|
1790
1808
|
subscription_id: string;
|
|
1791
1809
|
|
|
1792
1810
|
/**
|
|
1793
|
-
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
1811
|
+
* If set to POOLED, allocation added per seat is pooled across the account. If set
|
|
1812
|
+
* to INDIVIDUAL, each seat in the subscription will have its own allocation.
|
|
1794
1813
|
*/
|
|
1795
1814
|
allocation?: 'INDIVIDUAL' | 'POOLED';
|
|
1796
1815
|
}
|
|
@@ -1951,7 +1970,8 @@ export namespace ContractCreateParams {
|
|
|
1951
1970
|
subscription_id: string;
|
|
1952
1971
|
|
|
1953
1972
|
/**
|
|
1954
|
-
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
1973
|
+
* If set to POOLED, allocation added per seat is pooled across the account. If set
|
|
1974
|
+
* to INDIVIDUAL, each seat in the subscription will have its own allocation.
|
|
1955
1975
|
*/
|
|
1956
1976
|
allocation?: 'INDIVIDUAL' | 'POOLED';
|
|
1957
1977
|
}
|
|
@@ -2010,6 +2030,31 @@ export namespace ContractCreateParams {
|
|
|
2010
2030
|
}
|
|
2011
2031
|
}
|
|
2012
2032
|
|
|
2033
|
+
/**
|
|
2034
|
+
* The revenue system configuration associated with a contract. Provide either an
|
|
2035
|
+
* ID or the provider and delivery method.
|
|
2036
|
+
*/
|
|
2037
|
+
export interface RevenueSystemConfiguration {
|
|
2038
|
+
/**
|
|
2039
|
+
* How revenue recognition records should be delivered to the revenue system. Do
|
|
2040
|
+
* not specify if using revenue_system_configuration_id.
|
|
2041
|
+
*/
|
|
2042
|
+
delivery_method?: 'direct_to_billing_provider';
|
|
2043
|
+
|
|
2044
|
+
/**
|
|
2045
|
+
* The system that is providing services for revenue recognition. Do not specify if
|
|
2046
|
+
* using revenue_system_configuration_id.
|
|
2047
|
+
*/
|
|
2048
|
+
provider?: 'netsuite';
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* The Metronome ID of the revenue system configuration. Use when a customer has
|
|
2052
|
+
* multiple configurations with the same provider and delivery method. Otherwise,
|
|
2053
|
+
* specify the provider and delivery_method.
|
|
2054
|
+
*/
|
|
2055
|
+
revenue_system_configuration_id?: string;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2013
2058
|
export interface ScheduledCharge {
|
|
2014
2059
|
product_id: string;
|
|
2015
2060
|
|
|
@@ -2169,9 +2214,16 @@ export namespace ContractCreateParams {
|
|
|
2169
2214
|
* QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
2170
2215
|
* directly on the subscription. `initial_quantity` must be provided with this
|
|
2171
2216
|
* option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
2217
|
+
* **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
|
|
2218
|
+
* user_123) to increment and decrement a subscription quantity, rather than
|
|
2219
|
+
* directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
2220
|
+
* use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
2221
|
+
* provided with this option.
|
|
2172
2222
|
*/
|
|
2173
2223
|
quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
|
|
2174
2224
|
|
|
2225
|
+
seat_config?: Subscription.SeatConfig;
|
|
2226
|
+
|
|
2175
2227
|
/**
|
|
2176
2228
|
* Inclusive start time for the subscription. If not provided, defaults to contract
|
|
2177
2229
|
* start date
|
|
@@ -2214,6 +2266,28 @@ export namespace ContractCreateParams {
|
|
|
2214
2266
|
*/
|
|
2215
2267
|
product_id: string;
|
|
2216
2268
|
}
|
|
2269
|
+
|
|
2270
|
+
export interface SeatConfig {
|
|
2271
|
+
/**
|
|
2272
|
+
* The initial assigned seats on this subscription.
|
|
2273
|
+
*/
|
|
2274
|
+
initial_seat_ids: Array<string>;
|
|
2275
|
+
|
|
2276
|
+
/**
|
|
2277
|
+
* The property name, sent on usage events, that identifies the seat ID associated
|
|
2278
|
+
* with the usage event. For example, the property name might be seat_id or
|
|
2279
|
+
* user_id. The property must be set as a group key on billable metrics and a
|
|
2280
|
+
* presentation/pricing group key on contract products. This allows linked
|
|
2281
|
+
* recurring credits with an allocation per seat to be consumed by only one seat's
|
|
2282
|
+
* usage.
|
|
2283
|
+
*/
|
|
2284
|
+
seat_group_key: string;
|
|
2285
|
+
|
|
2286
|
+
/**
|
|
2287
|
+
* The initial amount of unassigned seats on this subscription.
|
|
2288
|
+
*/
|
|
2289
|
+
initial_unassigned_seats?: number;
|
|
2290
|
+
}
|
|
2217
2291
|
}
|
|
2218
2292
|
|
|
2219
2293
|
export interface Transition {
|
|
@@ -2348,6 +2422,12 @@ export interface ContractAddManualBalanceEntryParams {
|
|
|
2348
2422
|
*/
|
|
2349
2423
|
contract_id?: string;
|
|
2350
2424
|
|
|
2425
|
+
/**
|
|
2426
|
+
* If using individually configured commits/credits attached to seat managed
|
|
2427
|
+
* subscriptions, the amount to add for each seat. Must sum to total amount.
|
|
2428
|
+
*/
|
|
2429
|
+
per_group_amounts?: { [key: string]: number };
|
|
2430
|
+
|
|
2351
2431
|
/**
|
|
2352
2432
|
* RFC 3339 timestamp indicating when the manual adjustment takes place. If not
|
|
2353
2433
|
* provided, it will default to the start of the segment.
|
|
@@ -3418,6 +3498,11 @@ export interface ContractListBalancesParams extends BodyCursorPageParams {
|
|
|
3418
3498
|
*/
|
|
3419
3499
|
effective_before?: string;
|
|
3420
3500
|
|
|
3501
|
+
/**
|
|
3502
|
+
* Exclude balances with zero amounts from the response.
|
|
3503
|
+
*/
|
|
3504
|
+
exclude_zero_balances?: boolean;
|
|
3505
|
+
|
|
3421
3506
|
/**
|
|
3422
3507
|
* Include archived credits and credits from archived contracts.
|
|
3423
3508
|
*/
|
|
@@ -15,7 +15,8 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
15
15
|
|
|
16
16
|
export class CreditGrants extends APIResource {
|
|
17
17
|
/**
|
|
18
|
-
* Create a new credit grant
|
|
18
|
+
* Create a new credit grant. This is a Plans (deprecated) endpoint. New clients
|
|
19
|
+
* should implement using Contracts.
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* ```ts
|
|
@@ -43,7 +44,8 @@ export class CreditGrants extends APIResource {
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
|
-
* List credit grants. This list does not included voided grants.
|
|
47
|
+
* List credit grants. This list does not included voided grants. This is a Plans
|
|
48
|
+
* (deprecated) endpoint. New clients should implement using Contracts.
|
|
47
49
|
*
|
|
48
50
|
* @example
|
|
49
51
|
* ```ts
|
|
@@ -79,7 +81,8 @@ export class CreditGrants extends APIResource {
|
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
/**
|
|
82
|
-
* Edit an existing credit grant
|
|
84
|
+
* Edit an existing credit grant. This is a Plans (deprecated) endpoint. New
|
|
85
|
+
* clients should implement using Contracts.
|
|
83
86
|
*
|
|
84
87
|
* @example
|
|
85
88
|
* ```ts
|
|
@@ -97,7 +100,8 @@ export class CreditGrants extends APIResource {
|
|
|
97
100
|
/**
|
|
98
101
|
* Fetches a list of credit ledger entries. Returns lists of ledgers per customer.
|
|
99
102
|
* Ledger entries are returned in chronological order. Ledger entries associated
|
|
100
|
-
* with voided credit grants are not included.
|
|
103
|
+
* with voided credit grants are not included. This is a Plans (deprecated)
|
|
104
|
+
* endpoint. New clients should implement using Contracts.
|
|
101
105
|
*
|
|
102
106
|
* @example
|
|
103
107
|
* ```ts
|
|
@@ -129,7 +133,8 @@ export class CreditGrants extends APIResource {
|
|
|
129
133
|
}
|
|
130
134
|
|
|
131
135
|
/**
|
|
132
|
-
* Void a credit grant
|
|
136
|
+
* Void a credit grant. This is a Plans (deprecated) endpoint. New clients should
|
|
137
|
+
* implement using Contracts.
|
|
133
138
|
*
|
|
134
139
|
* @example
|
|
135
140
|
* ```ts
|
|
@@ -241,6 +241,7 @@ export namespace CustomerAlert {
|
|
|
241
241
|
| 'low_remaining_contract_credit_balance_reached'
|
|
242
242
|
| 'low_remaining_contract_credit_percentage_reached'
|
|
243
243
|
| 'low_remaining_contract_credit_and_commit_balance_reached'
|
|
244
|
+
| 'low_remaining_seat_balance_reached'
|
|
244
245
|
| 'invoice_total_reached';
|
|
245
246
|
|
|
246
247
|
/**
|
|
@@ -282,6 +283,12 @@ export namespace CustomerAlert {
|
|
|
282
283
|
*/
|
|
283
284
|
invoice_types_filter?: Array<string>;
|
|
284
285
|
|
|
286
|
+
/**
|
|
287
|
+
* Only present for low_remaining_seat_balance_reached notifications. The seat
|
|
288
|
+
* group key or seat group key-value pair the alert is scoped to.
|
|
289
|
+
*/
|
|
290
|
+
seat_filter?: Alert.SeatFilter;
|
|
291
|
+
|
|
285
292
|
/**
|
|
286
293
|
* Prevents the creation of duplicates. If a request to create a record is made
|
|
287
294
|
* with a previously used uniqueness key, a new record will not be created and the
|
|
@@ -314,6 +321,22 @@ export namespace CustomerAlert {
|
|
|
314
321
|
|
|
315
322
|
value?: string;
|
|
316
323
|
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Only present for low_remaining_seat_balance_reached notifications. The seat
|
|
327
|
+
* group key or seat group key-value pair the alert is scoped to.
|
|
328
|
+
*/
|
|
329
|
+
export interface SeatFilter {
|
|
330
|
+
/**
|
|
331
|
+
* The seat group key (e.g., "seat_id", "user_id") that the alert is scoped to.
|
|
332
|
+
*/
|
|
333
|
+
seat_group_key: string;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* The seat group value that the alert is scoped to.
|
|
337
|
+
*/
|
|
338
|
+
seat_group_value?: string;
|
|
339
|
+
}
|
|
317
340
|
}
|
|
318
341
|
}
|
|
319
342
|
|
|
@@ -343,6 +366,12 @@ export interface AlertRetrieveParams {
|
|
|
343
366
|
* denotes whether to fetch notifications for plans or contracts.
|
|
344
367
|
*/
|
|
345
368
|
plans_or_contracts?: 'PLANS' | 'CONTRACTS';
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Only allowed for `low_remaining_seat_balance_reached` notifications. This
|
|
372
|
+
* filters alerts by the seat group key-value pair.
|
|
373
|
+
*/
|
|
374
|
+
seat_filter?: AlertRetrieveParams.SeatFilter;
|
|
346
375
|
}
|
|
347
376
|
|
|
348
377
|
export namespace AlertRetrieveParams {
|
|
@@ -355,6 +384,22 @@ export namespace AlertRetrieveParams {
|
|
|
355
384
|
|
|
356
385
|
value: string;
|
|
357
386
|
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Only allowed for `low_remaining_seat_balance_reached` notifications. This
|
|
390
|
+
* filters alerts by the seat group key-value pair.
|
|
391
|
+
*/
|
|
392
|
+
export interface SeatFilter {
|
|
393
|
+
/**
|
|
394
|
+
* The seat group key (e.g., "seat_id", "user_id")
|
|
395
|
+
*/
|
|
396
|
+
seat_group_key: string;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* The specific seat identifier to filter by
|
|
400
|
+
*/
|
|
401
|
+
seat_group_value: string;
|
|
402
|
+
}
|
|
358
403
|
}
|
|
359
404
|
|
|
360
405
|
export interface AlertListParams extends CursorPageWithoutLimitParams {
|
|
@@ -8,7 +8,8 @@ import { path } from '../../../internal/utils/path';
|
|
|
8
8
|
|
|
9
9
|
export class BillingConfig extends APIResource {
|
|
10
10
|
/**
|
|
11
|
-
* Set the billing configuration for a given customer.
|
|
11
|
+
* Set the billing configuration for a given customer. This is a Plans (deprecated)
|
|
12
|
+
* endpoint. New clients should implement using Contracts.
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```ts
|
|
@@ -30,7 +31,8 @@ export class BillingConfig extends APIResource {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
|
-
* Fetch the billing configuration for the given customer.
|
|
34
|
+
* Fetch the billing configuration for the given customer. This is a Plans
|
|
35
|
+
* (deprecated) endpoint. New clients should implement using Contracts.
|
|
34
36
|
*
|
|
35
37
|
* @example
|
|
36
38
|
* ```ts
|
|
@@ -54,7 +56,8 @@ export class BillingConfig extends APIResource {
|
|
|
54
56
|
|
|
55
57
|
/**
|
|
56
58
|
* Delete the billing configuration for a given customer. Note: this is unsupported
|
|
57
|
-
* for Azure and AWS Marketplace customers.
|
|
59
|
+
* for Azure and AWS Marketplace customers. This is a Plans (deprecated) endpoint.
|
|
60
|
+
* New clients should implement using Contracts.
|
|
58
61
|
*
|
|
59
62
|
* @example
|
|
60
63
|
* ```ts
|
|
@@ -79,6 +82,10 @@ export interface BillingConfigRetrieveResponse {
|
|
|
79
82
|
|
|
80
83
|
export namespace BillingConfigRetrieveResponse {
|
|
81
84
|
export interface Data {
|
|
85
|
+
aws_customer_account_id?: string;
|
|
86
|
+
|
|
87
|
+
aws_customer_id?: string;
|
|
88
|
+
|
|
82
89
|
/**
|
|
83
90
|
* Contract expiration date for the customer. The expected format is RFC 3339 and
|
|
84
91
|
* can be retrieved from
|
|
@@ -140,6 +147,10 @@ export namespace BillingConfigRetrieveResponse {
|
|
|
140
147
|
|
|
141
148
|
billing_provider_customer_id?: string;
|
|
142
149
|
|
|
150
|
+
/**
|
|
151
|
+
* The collection method for the customer's invoices. NOTE:
|
|
152
|
+
* `auto_charge_payment_intent` and `manually_charge_payment_intent` are in beta.
|
|
153
|
+
*/
|
|
143
154
|
stripe_collection_method?:
|
|
144
155
|
| 'charge_automatically'
|
|
145
156
|
| 'send_invoice'
|
|
@@ -165,7 +176,8 @@ export interface BillingConfigCreateParams {
|
|
|
165
176
|
| 'azure_marketplace'
|
|
166
177
|
| 'quickbooks_online'
|
|
167
178
|
| 'workday'
|
|
168
|
-
| 'gcp_marketplace'
|
|
179
|
+
| 'gcp_marketplace'
|
|
180
|
+
| 'metronome';
|
|
169
181
|
|
|
170
182
|
/**
|
|
171
183
|
* Body param: The customer ID in the billing provider's system. For Azure, this is
|
|
@@ -173,6 +185,16 @@ export interface BillingConfigCreateParams {
|
|
|
173
185
|
*/
|
|
174
186
|
billing_provider_customer_id: string;
|
|
175
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Body param:
|
|
190
|
+
*/
|
|
191
|
+
aws_customer_account_id?: string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Body param:
|
|
195
|
+
*/
|
|
196
|
+
aws_customer_id?: string;
|
|
197
|
+
|
|
176
198
|
/**
|
|
177
199
|
* Body param:
|
|
178
200
|
*/
|
|
@@ -209,7 +231,8 @@ export interface BillingConfigCreateParams {
|
|
|
209
231
|
| 'us-west-2';
|
|
210
232
|
|
|
211
233
|
/**
|
|
212
|
-
* Body param:
|
|
234
|
+
* Body param: The collection method for the customer's invoices. NOTE:
|
|
235
|
+
* `auto_charge_payment_intent` and `manually_charge_payment_intent` are in beta.
|
|
213
236
|
*/
|
|
214
237
|
stripe_collection_method?:
|
|
215
238
|
| 'charge_automatically'
|
|
@@ -232,7 +255,8 @@ export interface BillingConfigRetrieveParams {
|
|
|
232
255
|
| 'azure_marketplace'
|
|
233
256
|
| 'quickbooks_online'
|
|
234
257
|
| 'workday'
|
|
235
|
-
| 'gcp_marketplace'
|
|
258
|
+
| 'gcp_marketplace'
|
|
259
|
+
| 'metronome';
|
|
236
260
|
}
|
|
237
261
|
|
|
238
262
|
export interface BillingConfigDeleteParams {
|
|
@@ -249,7 +273,8 @@ export interface BillingConfigDeleteParams {
|
|
|
249
273
|
| 'azure_marketplace'
|
|
250
274
|
| 'quickbooks_online'
|
|
251
275
|
| 'workday'
|
|
252
|
-
| 'gcp_marketplace'
|
|
276
|
+
| 'gcp_marketplace'
|
|
277
|
+
| 'metronome';
|
|
253
278
|
}
|
|
254
279
|
|
|
255
280
|
export declare namespace BillingConfig {
|
|
@@ -38,7 +38,8 @@ export class Commits extends APIResource {
|
|
|
38
38
|
* #### Billing configuration:
|
|
39
39
|
*
|
|
40
40
|
* - invoice_contract_id is required for postpaid commits and for prepaid commits
|
|
41
|
-
* with billing (only optional for free prepaid commits)
|
|
41
|
+
* with billing (only optional for free prepaid commits) unless do_not_invoice is
|
|
42
|
+
* set to true
|
|
42
43
|
* - For postpaid commits: access_schedule and invoice_schedule must have matching
|
|
43
44
|
* amounts
|
|
44
45
|
* - For postpaid commits: only one schedule item is allowed in both schedules.
|
|
@@ -271,7 +272,7 @@ export interface CommitCreateParams {
|
|
|
271
272
|
/**
|
|
272
273
|
* The contract that this commit will be billed on. This is required for "POSTPAID"
|
|
273
274
|
* commits and for "PREPAID" commits unless there is no invoice schedule above
|
|
274
|
-
* (i.e., the commit is 'free').
|
|
275
|
+
* (i.e., the commit is 'free'), or if do_not_invoice is set to true.
|
|
275
276
|
*/
|
|
276
277
|
invoice_contract_id?: string;
|
|
277
278
|
|