@metronome/sdk 3.6.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- 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/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts.map +1 -1
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/index.d.mts +2 -2
- package/internal/qs/index.d.mts.map +1 -1
- package/internal/qs/index.d.ts +2 -2
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/index.mjs.map +1 -1
- package/internal/qs/stringify.d.mts.map +1 -1
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/utils.d.mts.map +1 -1
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +4 -4
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +4 -4
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination.d.mts +1 -0
- package/pagination.d.mts.map +1 -1
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.mjs +1 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/shared.d.mts +420 -4
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +420 -4
- 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/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.mts.map +1 -1
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.mts.map +1 -1
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +674 -10
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +674 -10
- 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/named-schedules.d.mts.map +1 -1
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.mts.map +1 -1
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.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/contracts/rate-cards.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts.d.mts.map +1 -1
- package/resources/v1/contracts.d.ts.map +1 -1
- package/resources/v1/contracts.mjs.map +1 -1
- package/resources/v1/credit-grants.d.mts.map +1 -1
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.mts.map +1 -1
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.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/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.mts.map +1 -1
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.mts.map +1 -1
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.mts.map +1 -1
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.mjs.map +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/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.mts.map +1 -1
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.mts.map +1 -1
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/customers.d.mts.map +1 -1
- package/resources/v1/customers.d.ts.map +1 -1
- package/resources/v1/customers.mjs.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 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +1 -3
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +0 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.mts.map +1 -1
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/packages.d.mts +297 -13
- package/resources/v1/packages.d.mts.map +1 -1
- package/resources/v1/packages.d.ts +297 -13
- package/resources/v1/packages.d.ts.map +1 -1
- package/resources/v1/packages.js +3 -4
- package/resources/v1/packages.js.map +1 -1
- package/resources/v1/packages.mjs +3 -4
- package/resources/v1/packages.mjs.map +1 -1
- package/resources/v1/plans.d.mts.map +1 -1
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.mts.map +1 -1
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.mts.map +1 -1
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/settings/billing-providers.d.mts.map +1 -1
- package/resources/v1/settings/billing-providers.d.ts.map +1 -1
- package/resources/v1/settings/billing-providers.mjs.map +1 -1
- package/resources/v1/settings/index.d.mts.map +1 -1
- package/resources/v1/settings/index.d.ts.map +1 -1
- package/resources/v1/settings/index.mjs.map +1 -1
- package/resources/v1/settings/settings.d.mts.map +1 -1
- package/resources/v1/settings/settings.d.ts.map +1 -1
- package/resources/v1/settings/settings.mjs.map +1 -1
- package/resources/v1/settings.d.mts.map +1 -1
- package/resources/v1/settings.d.ts.map +1 -1
- package/resources/v1/settings.mjs.map +1 -1
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +2 -6
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +0 -4
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +0 -4
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1.d.mts.map +1 -1
- package/resources/v1.d.ts.map +1 -1
- package/resources/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.mts +1762 -5
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +1762 -5
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/v2/index.d.mts.map +1 -1
- package/resources/v2/index.d.ts.map +1 -1
- package/resources/v2/index.mjs.map +1 -1
- package/resources/v2/v2.d.mts.map +1 -1
- package/resources/v2/v2.d.ts.map +1 -1
- package/resources/v2/v2.mjs.map +1 -1
- package/resources/v2.d.mts.map +1 -1
- package/resources/v2.d.ts.map +1 -1
- package/resources/v2.mjs.map +1 -1
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +9 -1
- package/src/resources/shared.ts +524 -4
- package/src/resources/v1/alerts.ts +49 -0
- package/src/resources/v1/contracts/contracts.ts +850 -9
- 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 -11
- package/src/resources/v1/packages.ts +372 -13
- package/src/resources/v1/v1.ts +4 -26
- package/src/resources/v2/contracts.ts +2271 -5
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +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/resources/v1/payments.d.mts +0 -127
- package/resources/v1/payments.d.mts.map +0 -1
- package/resources/v1/payments.d.ts +0 -127
- package/resources/v1/payments.d.ts.map +0 -1
- package/resources/v1/payments.js +0 -71
- package/resources/v1/payments.js.map +0 -1
- package/resources/v1/payments.mjs +0 -67
- package/resources/v1/payments.mjs.map +0 -1
- package/src/resources/v1/payments.ts +0 -187
|
@@ -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,
|
|
@@ -730,7 +777,538 @@ export class Contracts extends APIResource {
|
|
|
730
777
|
export type ContractListBalancesResponsesBodyCursorPage = BodyCursorPage<ContractListBalancesResponse>;
|
|
731
778
|
|
|
732
779
|
export interface ContractCreateResponse {
|
|
733
|
-
data:
|
|
780
|
+
data: ContractCreateResponse.Data;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export namespace ContractCreateResponse {
|
|
784
|
+
export interface Data {
|
|
785
|
+
id: string;
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* The created contract.
|
|
789
|
+
*/
|
|
790
|
+
contract?: Data.Contract;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
export namespace Data {
|
|
794
|
+
/**
|
|
795
|
+
* The created contract.
|
|
796
|
+
*/
|
|
797
|
+
export interface Contract {
|
|
798
|
+
id: string;
|
|
799
|
+
|
|
800
|
+
commits: Array<Shared.Commit>;
|
|
801
|
+
|
|
802
|
+
created_at: string;
|
|
803
|
+
|
|
804
|
+
created_by: string;
|
|
805
|
+
|
|
806
|
+
customer_id: string;
|
|
807
|
+
|
|
808
|
+
overrides: Array<Shared.Override>;
|
|
809
|
+
|
|
810
|
+
scheduled_charges: Array<Shared.ScheduledCharge>;
|
|
811
|
+
|
|
812
|
+
starting_at: string;
|
|
813
|
+
|
|
814
|
+
transitions: Array<Contract.Transition>;
|
|
815
|
+
|
|
816
|
+
usage_filter: Array<Contract.UsageFilter>;
|
|
817
|
+
|
|
818
|
+
usage_statement_schedule: Contract.UsageStatementSchedule;
|
|
819
|
+
|
|
820
|
+
credits?: Array<Shared.Credit>;
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
824
|
+
*/
|
|
825
|
+
custom_fields?: { [key: string]: string };
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* The billing provider configuration associated with the contract.
|
|
829
|
+
*/
|
|
830
|
+
customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
|
|
831
|
+
|
|
832
|
+
ending_before?: string;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Indicates whether there are more items than the limit for this endpoint. Use the
|
|
836
|
+
* respective list endpoints to get the full lists.
|
|
837
|
+
*/
|
|
838
|
+
has_more?: Contract.HasMore;
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* Either a **parent** configuration with a list of children or a **child**
|
|
842
|
+
* configuration with a single parent.
|
|
843
|
+
*/
|
|
844
|
+
hierarchy_configuration?: Shared.HierarchyConfiguration;
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
|
|
848
|
+
* prices automatically. EXPLICIT prioritization requires specifying priorities for
|
|
849
|
+
* each multiplier; the one with the lowest priority value will be prioritized
|
|
850
|
+
* first.
|
|
851
|
+
*/
|
|
852
|
+
multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
|
|
853
|
+
|
|
854
|
+
name?: string;
|
|
855
|
+
|
|
856
|
+
net_payment_terms_days?: number;
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* ID of the package this contract was created from, if applicable.
|
|
860
|
+
*/
|
|
861
|
+
package_id?: string;
|
|
862
|
+
|
|
863
|
+
prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
|
|
864
|
+
|
|
865
|
+
rate_card_id?: string;
|
|
866
|
+
|
|
867
|
+
recurring_commits?: Array<Contract.RecurringCommit>;
|
|
868
|
+
|
|
869
|
+
recurring_credits?: Array<Contract.RecurringCredit>;
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Determines which scheduled and commit charges to consolidate onto the Contract's
|
|
873
|
+
* usage invoice. The charge's `timestamp` must match the usage invoice's
|
|
874
|
+
* `ending_before` date for consolidation to occur. This field cannot be modified
|
|
875
|
+
* after a Contract has been created. If this field is omitted, charges will appear
|
|
876
|
+
* on a separate invoice from usage charges.
|
|
877
|
+
*/
|
|
878
|
+
scheduled_charges_on_usage_invoices?: 'ALL';
|
|
879
|
+
|
|
880
|
+
spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* List of subscriptions on the contract.
|
|
884
|
+
*/
|
|
885
|
+
subscriptions?: Array<Shared.Subscription>;
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* Optional uniqueness key to prevent duplicate contract creations.
|
|
889
|
+
*/
|
|
890
|
+
uniqueness_key?: string;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
export namespace Contract {
|
|
894
|
+
export interface Transition {
|
|
895
|
+
from_contract_id: string;
|
|
896
|
+
|
|
897
|
+
to_contract_id: string;
|
|
898
|
+
|
|
899
|
+
type: 'SUPERSEDE' | 'RENEWAL';
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
export interface UsageFilter {
|
|
903
|
+
group_key: string;
|
|
904
|
+
|
|
905
|
+
group_values: Array<string>;
|
|
906
|
+
|
|
907
|
+
starting_at: string;
|
|
908
|
+
|
|
909
|
+
ending_before?: string;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
export interface UsageStatementSchedule {
|
|
913
|
+
/**
|
|
914
|
+
* Contract usage statements follow a selected cadence based on this date.
|
|
915
|
+
*/
|
|
916
|
+
billing_anchor_date: string;
|
|
917
|
+
|
|
918
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* The billing provider configuration associated with the contract.
|
|
923
|
+
*/
|
|
924
|
+
export interface CustomerBillingProviderConfiguration {
|
|
925
|
+
id?: string;
|
|
926
|
+
|
|
927
|
+
billing_provider?:
|
|
928
|
+
| 'aws_marketplace'
|
|
929
|
+
| 'stripe'
|
|
930
|
+
| 'netsuite'
|
|
931
|
+
| 'custom'
|
|
932
|
+
| 'azure_marketplace'
|
|
933
|
+
| 'quickbooks_online'
|
|
934
|
+
| 'workday'
|
|
935
|
+
| 'gcp_marketplace'
|
|
936
|
+
| 'metronome';
|
|
937
|
+
|
|
938
|
+
delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* Indicates whether there are more items than the limit for this endpoint. Use the
|
|
943
|
+
* respective list endpoints to get the full lists.
|
|
944
|
+
*/
|
|
945
|
+
export interface HasMore {
|
|
946
|
+
/**
|
|
947
|
+
* Whether there are more commits on this contract than the limit for this
|
|
948
|
+
* endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
|
|
949
|
+
* of commits.
|
|
950
|
+
*/
|
|
951
|
+
commits: boolean;
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* Whether there are more credits on this contract than the limit for this
|
|
955
|
+
* endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
|
|
956
|
+
* of credits.
|
|
957
|
+
*/
|
|
958
|
+
credits: boolean;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
export interface RecurringCommit {
|
|
962
|
+
id: string;
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* The amount of commit to grant.
|
|
966
|
+
*/
|
|
967
|
+
access_amount: RecurringCommit.AccessAmount;
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* The amount of time the created commits will be valid for
|
|
971
|
+
*/
|
|
972
|
+
commit_duration: RecurringCommit.CommitDuration;
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Will be passed down to the individual commits
|
|
976
|
+
*/
|
|
977
|
+
priority: number;
|
|
978
|
+
|
|
979
|
+
product: RecurringCommit.Product;
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Whether the created commits will use the commit rate or list rate
|
|
983
|
+
*/
|
|
984
|
+
rate_type: 'COMMIT_RATE' | 'LIST_RATE';
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Determines the start time for the first commit
|
|
988
|
+
*/
|
|
989
|
+
starting_at: string;
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Will be passed down to the individual commits
|
|
993
|
+
*/
|
|
994
|
+
applicable_product_ids?: Array<string>;
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* Will be passed down to the individual commits
|
|
998
|
+
*/
|
|
999
|
+
applicable_product_tags?: Array<string>;
|
|
1000
|
+
|
|
1001
|
+
contract?: RecurringCommit.Contract;
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* Will be passed down to the individual commits
|
|
1005
|
+
*/
|
|
1006
|
+
description?: string;
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* Determines when the contract will stop creating recurring commits. Optional
|
|
1010
|
+
*/
|
|
1011
|
+
ending_before?: string;
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
1015
|
+
*/
|
|
1016
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* The amount the customer should be billed for the commit. Not required.
|
|
1020
|
+
*/
|
|
1021
|
+
invoice_amount?: RecurringCommit.InvoiceAmount;
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* Displayed on invoices. Will be passed through to the individual commits
|
|
1025
|
+
*/
|
|
1026
|
+
name?: string;
|
|
1027
|
+
|
|
1028
|
+
/**
|
|
1029
|
+
* Will be passed down to the individual commits
|
|
1030
|
+
*/
|
|
1031
|
+
netsuite_sales_order_id?: string;
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Determines whether the first and last commit will be prorated. If not provided,
|
|
1035
|
+
* the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
|
|
1036
|
+
*/
|
|
1037
|
+
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Rounding configuration for prorated recurring commit amounts.
|
|
1041
|
+
*/
|
|
1042
|
+
proration_rounding?: RecurringCommit.ProrationRounding | null;
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* The frequency at which the recurring commits will be created. If not provided: -
|
|
1046
|
+
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
1047
|
+
* period defined in the duration will correspond to this frequency. - Commits will
|
|
1048
|
+
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
1049
|
+
* invoice dates.
|
|
1050
|
+
*/
|
|
1051
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Will be passed down to the individual commits. This controls how much of an
|
|
1055
|
+
* individual unexpired commit will roll over upon contract transition. Must be
|
|
1056
|
+
* between 0 and 1.
|
|
1057
|
+
*/
|
|
1058
|
+
rollover_fraction?: number;
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
1062
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1063
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
1064
|
+
*/
|
|
1065
|
+
specifiers?: Array<Shared.CommitSpecifier>;
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* Attach a subscription to the recurring commit/credit.
|
|
1069
|
+
*/
|
|
1070
|
+
subscription_config?: Shared.RecurringCommitSubscriptionConfig;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
export namespace RecurringCommit {
|
|
1074
|
+
/**
|
|
1075
|
+
* The amount of commit to grant.
|
|
1076
|
+
*/
|
|
1077
|
+
export interface AccessAmount {
|
|
1078
|
+
credit_type_id: string;
|
|
1079
|
+
|
|
1080
|
+
unit_price: number;
|
|
1081
|
+
|
|
1082
|
+
quantity?: number;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* The amount of time the created commits will be valid for
|
|
1087
|
+
*/
|
|
1088
|
+
export interface CommitDuration {
|
|
1089
|
+
value: number;
|
|
1090
|
+
|
|
1091
|
+
unit?: 'PERIODS';
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
export interface Product {
|
|
1095
|
+
id: string;
|
|
1096
|
+
|
|
1097
|
+
name: string;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
export interface Contract {
|
|
1101
|
+
id: string;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* The amount the customer should be billed for the commit. Not required.
|
|
1106
|
+
*/
|
|
1107
|
+
export interface InvoiceAmount {
|
|
1108
|
+
credit_type_id: string;
|
|
1109
|
+
|
|
1110
|
+
quantity: number;
|
|
1111
|
+
|
|
1112
|
+
unit_price: number;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Rounding configuration for prorated recurring commit amounts.
|
|
1117
|
+
*/
|
|
1118
|
+
export interface ProrationRounding {
|
|
1119
|
+
access?: ProrationRounding.Access;
|
|
1120
|
+
|
|
1121
|
+
invoice?: ProrationRounding.Invoice;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
export namespace ProrationRounding {
|
|
1125
|
+
export interface Access {
|
|
1126
|
+
/**
|
|
1127
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
1128
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
1129
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
1130
|
+
* dollar).
|
|
1131
|
+
*/
|
|
1132
|
+
decimal_places: number;
|
|
1133
|
+
|
|
1134
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export interface Invoice {
|
|
1138
|
+
/**
|
|
1139
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
1140
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
1141
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
1142
|
+
* dollar).
|
|
1143
|
+
*/
|
|
1144
|
+
decimal_places: number;
|
|
1145
|
+
|
|
1146
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
export interface RecurringCredit {
|
|
1152
|
+
id: string;
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* The amount of commit to grant.
|
|
1156
|
+
*/
|
|
1157
|
+
access_amount: RecurringCredit.AccessAmount;
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* The amount of time the created commits will be valid for
|
|
1161
|
+
*/
|
|
1162
|
+
commit_duration: RecurringCredit.CommitDuration;
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* Will be passed down to the individual commits
|
|
1166
|
+
*/
|
|
1167
|
+
priority: number;
|
|
1168
|
+
|
|
1169
|
+
product: RecurringCredit.Product;
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* Whether the created commits will use the commit rate or list rate
|
|
1173
|
+
*/
|
|
1174
|
+
rate_type: 'COMMIT_RATE' | 'LIST_RATE';
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Determines the start time for the first commit
|
|
1178
|
+
*/
|
|
1179
|
+
starting_at: string;
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* Will be passed down to the individual commits
|
|
1183
|
+
*/
|
|
1184
|
+
applicable_product_ids?: Array<string>;
|
|
1185
|
+
|
|
1186
|
+
/**
|
|
1187
|
+
* Will be passed down to the individual commits
|
|
1188
|
+
*/
|
|
1189
|
+
applicable_product_tags?: Array<string>;
|
|
1190
|
+
|
|
1191
|
+
contract?: RecurringCredit.Contract;
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Will be passed down to the individual commits
|
|
1195
|
+
*/
|
|
1196
|
+
description?: string;
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Determines when the contract will stop creating recurring commits. Optional
|
|
1200
|
+
*/
|
|
1201
|
+
ending_before?: string;
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
1205
|
+
*/
|
|
1206
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* Displayed on invoices. Will be passed through to the individual commits
|
|
1210
|
+
*/
|
|
1211
|
+
name?: string;
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Will be passed down to the individual commits
|
|
1215
|
+
*/
|
|
1216
|
+
netsuite_sales_order_id?: string;
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Determines whether the first and last commit will be prorated. If not provided,
|
|
1220
|
+
* the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
|
|
1221
|
+
*/
|
|
1222
|
+
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Rounding configuration for prorated recurring credit amounts.
|
|
1226
|
+
*/
|
|
1227
|
+
proration_rounding?: RecurringCredit.ProrationRounding | null;
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* The frequency at which the recurring commits will be created. If not provided: -
|
|
1231
|
+
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
1232
|
+
* period defined in the duration will correspond to this frequency. - Commits will
|
|
1233
|
+
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
1234
|
+
* invoice dates.
|
|
1235
|
+
*/
|
|
1236
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* Will be passed down to the individual commits. This controls how much of an
|
|
1240
|
+
* individual unexpired commit will roll over upon contract transition. Must be
|
|
1241
|
+
* between 0 and 1.
|
|
1242
|
+
*/
|
|
1243
|
+
rollover_fraction?: number;
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
1247
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1248
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
1249
|
+
*/
|
|
1250
|
+
specifiers?: Array<Shared.CommitSpecifier>;
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Attach a subscription to the recurring commit/credit.
|
|
1254
|
+
*/
|
|
1255
|
+
subscription_config?: Shared.RecurringCommitSubscriptionConfig;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
export namespace RecurringCredit {
|
|
1259
|
+
/**
|
|
1260
|
+
* The amount of commit to grant.
|
|
1261
|
+
*/
|
|
1262
|
+
export interface AccessAmount {
|
|
1263
|
+
credit_type_id: string;
|
|
1264
|
+
|
|
1265
|
+
unit_price: number;
|
|
1266
|
+
|
|
1267
|
+
quantity?: number;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* The amount of time the created commits will be valid for
|
|
1272
|
+
*/
|
|
1273
|
+
export interface CommitDuration {
|
|
1274
|
+
value: number;
|
|
1275
|
+
|
|
1276
|
+
unit?: 'PERIODS';
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
export interface Product {
|
|
1280
|
+
id: string;
|
|
1281
|
+
|
|
1282
|
+
name: string;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
export interface Contract {
|
|
1286
|
+
id: string;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Rounding configuration for prorated recurring credit amounts.
|
|
1291
|
+
*/
|
|
1292
|
+
export interface ProrationRounding {
|
|
1293
|
+
access?: ProrationRounding.Access;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
export namespace ProrationRounding {
|
|
1297
|
+
export interface Access {
|
|
1298
|
+
/**
|
|
1299
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
1300
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
1301
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
1302
|
+
* dollar).
|
|
1303
|
+
*/
|
|
1304
|
+
decimal_places: number;
|
|
1305
|
+
|
|
1306
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
734
1312
|
}
|
|
735
1313
|
|
|
736
1314
|
export interface ContractRetrieveResponse {
|
|
@@ -773,6 +1351,39 @@ export namespace ContractGetNetBalanceResponse {
|
|
|
773
1351
|
}
|
|
774
1352
|
}
|
|
775
1353
|
|
|
1354
|
+
export interface ContractGetSubscriptionSeatsHistoryResponse {
|
|
1355
|
+
data: Array<ContractGetSubscriptionSeatsHistoryResponse.Data>;
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* Cursor for the next page of results
|
|
1359
|
+
*/
|
|
1360
|
+
next_page: string | null;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
export namespace ContractGetSubscriptionSeatsHistoryResponse {
|
|
1364
|
+
export interface Data {
|
|
1365
|
+
/**
|
|
1366
|
+
* Array of seat IDs that are assigned in this period
|
|
1367
|
+
*/
|
|
1368
|
+
assigned_seat_ids: Array<string>;
|
|
1369
|
+
|
|
1370
|
+
/**
|
|
1371
|
+
* The end time of this seat schedule period (null if ongoing)
|
|
1372
|
+
*/
|
|
1373
|
+
ending_before: string | null;
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* The start time of this seat schedule period
|
|
1377
|
+
*/
|
|
1378
|
+
starting_at: string;
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* Total number of assigned and unassigned seats in this period
|
|
1382
|
+
*/
|
|
1383
|
+
total_quantity: number;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
|
|
776
1387
|
export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
|
|
777
1388
|
|
|
778
1389
|
export interface ContractListSeatBalancesResponse {
|
|
@@ -1145,6 +1756,12 @@ export interface ContractCreateParams {
|
|
|
1145
1756
|
|
|
1146
1757
|
spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
|
|
1147
1758
|
|
|
1759
|
+
/**
|
|
1760
|
+
* Spend trackers to attach to this contract. Aliases must be unique within a
|
|
1761
|
+
* contract.
|
|
1762
|
+
*/
|
|
1763
|
+
spend_trackers?: Array<ContractCreateParams.SpendTracker>;
|
|
1764
|
+
|
|
1148
1765
|
/**
|
|
1149
1766
|
* Optional list of
|
|
1150
1767
|
* [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
|
|
@@ -1280,6 +1897,11 @@ export namespace ContractCreateParams {
|
|
|
1280
1897
|
*/
|
|
1281
1898
|
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
1282
1899
|
|
|
1900
|
+
/**
|
|
1901
|
+
* Optional attributes for spend tracker integration. Immutable after creation.
|
|
1902
|
+
*/
|
|
1903
|
+
spend_tracker_attributes?: Commit.SpendTrackerAttributes;
|
|
1904
|
+
|
|
1283
1905
|
/**
|
|
1284
1906
|
* A temporary ID for the commit that can be used to reference the commit for
|
|
1285
1907
|
* commit specific overrides.
|
|
@@ -1420,6 +2042,17 @@ export namespace ContractCreateParams {
|
|
|
1420
2042
|
unit_price?: number;
|
|
1421
2043
|
}
|
|
1422
2044
|
}
|
|
2045
|
+
|
|
2046
|
+
/**
|
|
2047
|
+
* Optional attributes for spend tracker integration. Immutable after creation.
|
|
2048
|
+
*/
|
|
2049
|
+
export interface SpendTrackerAttributes {
|
|
2050
|
+
/**
|
|
2051
|
+
* If true, this commit will be included in spend trackers with discounted set to
|
|
2052
|
+
* DISCOUNTED_ONLY
|
|
2053
|
+
*/
|
|
2054
|
+
counts_as_discounted: boolean;
|
|
2055
|
+
}
|
|
1423
2056
|
}
|
|
1424
2057
|
|
|
1425
2058
|
export interface Credit {
|
|
@@ -1714,9 +2347,10 @@ export namespace ContractCreateParams {
|
|
|
1714
2347
|
|
|
1715
2348
|
/**
|
|
1716
2349
|
* Indicates whether the override should only apply to commits. Defaults to
|
|
1717
|
-
* `false`. If `true
|
|
1718
|
-
* passing `commit_ids
|
|
1719
|
-
*
|
|
2350
|
+
* `false`. If `true` you can specify relevant commits in `override_specifiers` by
|
|
2351
|
+
* passing `commit_ids`, `recurring_commit_ids`, or `any_commit_or_credit_ids`. If
|
|
2352
|
+
* you do not specify any of these fields, the override will apply when consuming
|
|
2353
|
+
* any prepaid commit, postpaid commit, or credit
|
|
1720
2354
|
*/
|
|
1721
2355
|
is_commit_specific?: boolean;
|
|
1722
2356
|
|
|
@@ -1770,6 +2404,15 @@ export namespace ContractCreateParams {
|
|
|
1770
2404
|
|
|
1771
2405
|
export namespace Override {
|
|
1772
2406
|
export interface OverrideSpecifier {
|
|
2407
|
+
/**
|
|
2408
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2409
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
2410
|
+
* `presentation_group_values`. Must be used instead of both `commit_ids` and
|
|
2411
|
+
* `recurring_commit_ids` If provided, the override will apply to any specified
|
|
2412
|
+
* commit, credit, recurring commit or recurring credit IDs.
|
|
2413
|
+
*/
|
|
2414
|
+
any_commit_or_credit_ids?: Array<string>;
|
|
2415
|
+
|
|
1773
2416
|
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1774
2417
|
|
|
1775
2418
|
/**
|
|
@@ -1960,6 +2603,11 @@ export namespace ContractCreateParams {
|
|
|
1960
2603
|
*/
|
|
1961
2604
|
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
1962
2605
|
|
|
2606
|
+
/**
|
|
2607
|
+
* Optional rounding configuration for prorated recurring commit amounts.
|
|
2608
|
+
*/
|
|
2609
|
+
proration_rounding?: RecurringCommit.ProrationRounding;
|
|
2610
|
+
|
|
1963
2611
|
/**
|
|
1964
2612
|
* Whether the created commits will use the commit rate or list rate
|
|
1965
2613
|
*/
|
|
@@ -1972,7 +2620,7 @@ export namespace ContractCreateParams {
|
|
|
1972
2620
|
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
1973
2621
|
* invoice dates.
|
|
1974
2622
|
*/
|
|
1975
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
2623
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
|
|
1976
2624
|
|
|
1977
2625
|
/**
|
|
1978
2626
|
* Will be passed down to the individual commits. This controls how much of an
|
|
@@ -2039,6 +2687,41 @@ export namespace ContractCreateParams {
|
|
|
2039
2687
|
unit_price: number;
|
|
2040
2688
|
}
|
|
2041
2689
|
|
|
2690
|
+
/**
|
|
2691
|
+
* Optional rounding configuration for prorated recurring commit amounts.
|
|
2692
|
+
*/
|
|
2693
|
+
export interface ProrationRounding {
|
|
2694
|
+
access?: ProrationRounding.Access;
|
|
2695
|
+
|
|
2696
|
+
invoice?: ProrationRounding.Invoice;
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
export namespace ProrationRounding {
|
|
2700
|
+
export interface Access {
|
|
2701
|
+
/**
|
|
2702
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
2703
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
2704
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
2705
|
+
* dollar).
|
|
2706
|
+
*/
|
|
2707
|
+
decimal_places: number;
|
|
2708
|
+
|
|
2709
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
export interface Invoice {
|
|
2713
|
+
/**
|
|
2714
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
2715
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
2716
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
2717
|
+
* dollar).
|
|
2718
|
+
*/
|
|
2719
|
+
decimal_places: number;
|
|
2720
|
+
|
|
2721
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2042
2725
|
/**
|
|
2043
2726
|
* Attach a subscription to the recurring commit/credit.
|
|
2044
2727
|
*/
|
|
@@ -2133,6 +2816,11 @@ export namespace ContractCreateParams {
|
|
|
2133
2816
|
*/
|
|
2134
2817
|
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
2135
2818
|
|
|
2819
|
+
/**
|
|
2820
|
+
* Optional rounding configuration for prorated recurring credit amounts.
|
|
2821
|
+
*/
|
|
2822
|
+
proration_rounding?: RecurringCredit.ProrationRounding;
|
|
2823
|
+
|
|
2136
2824
|
/**
|
|
2137
2825
|
* Whether the created commits will use the commit rate or list rate
|
|
2138
2826
|
*/
|
|
@@ -2145,7 +2833,7 @@ export namespace ContractCreateParams {
|
|
|
2145
2833
|
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
2146
2834
|
* invoice dates.
|
|
2147
2835
|
*/
|
|
2148
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
2836
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
|
|
2149
2837
|
|
|
2150
2838
|
/**
|
|
2151
2839
|
* Will be passed down to the individual commits. This controls how much of an
|
|
@@ -2201,6 +2889,27 @@ export namespace ContractCreateParams {
|
|
|
2201
2889
|
unit?: 'PERIODS';
|
|
2202
2890
|
}
|
|
2203
2891
|
|
|
2892
|
+
/**
|
|
2893
|
+
* Optional rounding configuration for prorated recurring credit amounts.
|
|
2894
|
+
*/
|
|
2895
|
+
export interface ProrationRounding {
|
|
2896
|
+
access?: ProrationRounding.Access;
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
export namespace ProrationRounding {
|
|
2900
|
+
export interface Access {
|
|
2901
|
+
/**
|
|
2902
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
2903
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
2904
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
2905
|
+
* dollar).
|
|
2906
|
+
*/
|
|
2907
|
+
decimal_places: number;
|
|
2908
|
+
|
|
2909
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2204
2913
|
/**
|
|
2205
2914
|
* Attach a subscription to the recurring commit/credit.
|
|
2206
2915
|
*/
|
|
@@ -2424,6 +3133,32 @@ export namespace ContractCreateParams {
|
|
|
2424
3133
|
}
|
|
2425
3134
|
}
|
|
2426
3135
|
|
|
3136
|
+
export interface SpendTracker {
|
|
3137
|
+
/**
|
|
3138
|
+
* Human-readable identifier, unique per contract.
|
|
3139
|
+
*/
|
|
3140
|
+
alias: string;
|
|
3141
|
+
|
|
3142
|
+
applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
|
|
3143
|
+
|
|
3144
|
+
credit_type_id: string;
|
|
3145
|
+
|
|
3146
|
+
reset_frequency: 'BILLING_PERIOD';
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
export namespace SpendTracker {
|
|
3150
|
+
export interface ApplicableSpendSpecifier {
|
|
3151
|
+
sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
|
|
3152
|
+
|
|
3153
|
+
spend_type: 'COMMIT_PURCHASE';
|
|
3154
|
+
|
|
3155
|
+
/**
|
|
3156
|
+
* Filter by whether the spend was discounted. Defaults to ANY if omitted.
|
|
3157
|
+
*/
|
|
3158
|
+
discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3161
|
+
|
|
2427
3162
|
export interface Subscription {
|
|
2428
3163
|
collection_schedule: 'ADVANCE' | 'ARREARS';
|
|
2429
3164
|
|
|
@@ -2431,6 +3166,8 @@ export namespace ContractCreateParams {
|
|
|
2431
3166
|
|
|
2432
3167
|
subscription_rate: Subscription.SubscriptionRate;
|
|
2433
3168
|
|
|
3169
|
+
billing_cycle_config?: Subscription.BillingCycleConfig;
|
|
3170
|
+
|
|
2434
3171
|
/**
|
|
2435
3172
|
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2436
3173
|
*/
|
|
@@ -2495,6 +3232,22 @@ export namespace ContractCreateParams {
|
|
|
2495
3232
|
* Indicates if the partial period will be prorated or charged a full amount.
|
|
2496
3233
|
*/
|
|
2497
3234
|
is_prorated?: boolean;
|
|
3235
|
+
|
|
3236
|
+
rounding?: Proration.Rounding;
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
export namespace Proration {
|
|
3240
|
+
export interface Rounding {
|
|
3241
|
+
/**
|
|
3242
|
+
* Number of decimal places to round to. Applied directly to the stored monetary
|
|
3243
|
+
* representation. Negative values round to powers of 10 (e.g., -2 rounds to
|
|
3244
|
+
* nearest 100 in the stored unit. For USD, this means rounding to the nearest
|
|
3245
|
+
* dollar).
|
|
3246
|
+
*/
|
|
3247
|
+
decimal_places: number;
|
|
3248
|
+
|
|
3249
|
+
rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
|
|
3250
|
+
}
|
|
2498
3251
|
}
|
|
2499
3252
|
|
|
2500
3253
|
export interface SubscriptionRate {
|
|
@@ -2510,6 +3263,20 @@ export namespace ContractCreateParams {
|
|
|
2510
3263
|
product_id: string;
|
|
2511
3264
|
}
|
|
2512
3265
|
|
|
3266
|
+
export interface BillingCycleConfig {
|
|
3267
|
+
/**
|
|
3268
|
+
* The date to anchor the billing cycle to. If omitted, defaults to the contract's
|
|
3269
|
+
* usage invoice billing cycle anchor date.
|
|
3270
|
+
*/
|
|
3271
|
+
anchor_date?: string;
|
|
3272
|
+
|
|
3273
|
+
/**
|
|
3274
|
+
* Controls whether this subscription consolidates onto usage invoices or gets its
|
|
3275
|
+
* own scheduled invoice. Defaults to ON_USAGE_INVOICE if omitted.
|
|
3276
|
+
*/
|
|
3277
|
+
invoice_placement?: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
|
|
3278
|
+
}
|
|
3279
|
+
|
|
2513
3280
|
export interface SeatConfig {
|
|
2514
3281
|
/**
|
|
2515
3282
|
* The initial assigned seats on this subscription.
|
|
@@ -2824,6 +3591,11 @@ export namespace ContractAmendParams {
|
|
|
2824
3591
|
*/
|
|
2825
3592
|
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
2826
3593
|
|
|
3594
|
+
/**
|
|
3595
|
+
* Optional attributes for spend tracker integration. Immutable after creation.
|
|
3596
|
+
*/
|
|
3597
|
+
spend_tracker_attributes?: Commit.SpendTrackerAttributes;
|
|
3598
|
+
|
|
2827
3599
|
/**
|
|
2828
3600
|
* A temporary ID for the commit that can be used to reference the commit for
|
|
2829
3601
|
* commit specific overrides.
|
|
@@ -2964,6 +3736,17 @@ export namespace ContractAmendParams {
|
|
|
2964
3736
|
unit_price?: number;
|
|
2965
3737
|
}
|
|
2966
3738
|
}
|
|
3739
|
+
|
|
3740
|
+
/**
|
|
3741
|
+
* Optional attributes for spend tracker integration. Immutable after creation.
|
|
3742
|
+
*/
|
|
3743
|
+
export interface SpendTrackerAttributes {
|
|
3744
|
+
/**
|
|
3745
|
+
* If true, this commit will be included in spend trackers with discounted set to
|
|
3746
|
+
* DISCOUNTED_ONLY
|
|
3747
|
+
*/
|
|
3748
|
+
counts_as_discounted: boolean;
|
|
3749
|
+
}
|
|
2967
3750
|
}
|
|
2968
3751
|
|
|
2969
3752
|
export interface Credit {
|
|
@@ -3210,9 +3993,10 @@ export namespace ContractAmendParams {
|
|
|
3210
3993
|
|
|
3211
3994
|
/**
|
|
3212
3995
|
* Indicates whether the override should only apply to commits. Defaults to
|
|
3213
|
-
* `false`. If `true
|
|
3214
|
-
* passing `commit_ids
|
|
3215
|
-
*
|
|
3996
|
+
* `false`. If `true` you can specify relevant commits in `override_specifiers` by
|
|
3997
|
+
* passing `commit_ids`, `recurring_commit_ids`, or `any_commit_or_credit_ids`. If
|
|
3998
|
+
* you do not specify any of these fields, the override will apply when consuming
|
|
3999
|
+
* any prepaid commit, postpaid commit, or credit
|
|
3216
4000
|
*/
|
|
3217
4001
|
is_commit_specific?: boolean;
|
|
3218
4002
|
|
|
@@ -3266,6 +4050,15 @@ export namespace ContractAmendParams {
|
|
|
3266
4050
|
|
|
3267
4051
|
export namespace Override {
|
|
3268
4052
|
export interface OverrideSpecifier {
|
|
4053
|
+
/**
|
|
4054
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
4055
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
4056
|
+
* `presentation_group_values`. Must be used instead of both `commit_ids` and
|
|
4057
|
+
* `recurring_commit_ids` If provided, the override will apply to any specified
|
|
4058
|
+
* commit, credit, recurring commit or recurring credit IDs.
|
|
4059
|
+
*/
|
|
4060
|
+
any_commit_or_credit_ids?: Array<string>;
|
|
4061
|
+
|
|
3269
4062
|
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
3270
4063
|
|
|
3271
4064
|
/**
|
|
@@ -3667,6 +4460,46 @@ export interface ContractGetNetBalanceParams {
|
|
|
3667
4460
|
invoice_inclusion_mode?: 'FINALIZED' | 'FINALIZED_AND_DRAFT';
|
|
3668
4461
|
}
|
|
3669
4462
|
|
|
4463
|
+
export interface ContractGetSubscriptionSeatsHistoryParams {
|
|
4464
|
+
contract_id: string;
|
|
4465
|
+
|
|
4466
|
+
customer_id: string;
|
|
4467
|
+
|
|
4468
|
+
subscription_id: string;
|
|
4469
|
+
|
|
4470
|
+
/**
|
|
4471
|
+
* Get the seats history segment for the covering date. Cannot be used with
|
|
4472
|
+
* `starting_at` or `ending_before`.
|
|
4473
|
+
*/
|
|
4474
|
+
covering_date?: string | null;
|
|
4475
|
+
|
|
4476
|
+
/**
|
|
4477
|
+
* Cursor for pagination. Use the value from the `next_page` field of the previous
|
|
4478
|
+
* response to retrieve the next page of results.
|
|
4479
|
+
*/
|
|
4480
|
+
cursor?: string | null;
|
|
4481
|
+
|
|
4482
|
+
/**
|
|
4483
|
+
* Include seats history segments that are active at or before this timestamp. Use
|
|
4484
|
+
* with `starting_at` to get a specific time range. If not set, there's no upper
|
|
4485
|
+
* bound.
|
|
4486
|
+
*/
|
|
4487
|
+
ending_before?: string | null;
|
|
4488
|
+
|
|
4489
|
+
/**
|
|
4490
|
+
* Maximum number of seat schedule entries to return. Defaults to 10. Required
|
|
4491
|
+
* range: 1 <= x <= 10.
|
|
4492
|
+
*/
|
|
4493
|
+
limit?: number | null;
|
|
4494
|
+
|
|
4495
|
+
/**
|
|
4496
|
+
* Include seats history segments that are active at or after this timestamp. Use
|
|
4497
|
+
* with `ending_before` to get a specific time range. If not set, there's no lower
|
|
4498
|
+
* bound.
|
|
4499
|
+
*/
|
|
4500
|
+
starting_at?: string | null;
|
|
4501
|
+
}
|
|
4502
|
+
|
|
3670
4503
|
export interface ContractListBalancesParams extends BodyCursorPageParams {
|
|
3671
4504
|
customer_id: string;
|
|
3672
4505
|
|
|
@@ -3770,6 +4603,12 @@ export interface ContractListSeatBalancesParams {
|
|
|
3770
4603
|
*/
|
|
3771
4604
|
seat_ids?: Array<string>;
|
|
3772
4605
|
|
|
4606
|
+
/**
|
|
4607
|
+
* When true, any seat_ids not found in contract subscriptions will be silently
|
|
4608
|
+
* omitted from the response instead of returning a 400 error.
|
|
4609
|
+
*/
|
|
4610
|
+
skip_missing_seat_ids?: boolean;
|
|
4611
|
+
|
|
3773
4612
|
/**
|
|
3774
4613
|
* Include only commits or credits with access effective on or after this date
|
|
3775
4614
|
* (cannot be used with covering_date).
|
|
@@ -3983,6 +4822,7 @@ export declare namespace Contracts {
|
|
|
3983
4822
|
type ContractArchiveResponse as ContractArchiveResponse,
|
|
3984
4823
|
type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
|
|
3985
4824
|
type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse,
|
|
4825
|
+
type ContractGetSubscriptionSeatsHistoryResponse as ContractGetSubscriptionSeatsHistoryResponse,
|
|
3986
4826
|
type ContractListBalancesResponse as ContractListBalancesResponse,
|
|
3987
4827
|
type ContractListSeatBalancesResponse as ContractListSeatBalancesResponse,
|
|
3988
4828
|
type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
|
|
@@ -3998,6 +4838,7 @@ export declare namespace Contracts {
|
|
|
3998
4838
|
type ContractArchiveParams as ContractArchiveParams,
|
|
3999
4839
|
type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
|
|
4000
4840
|
type ContractGetNetBalanceParams as ContractGetNetBalanceParams,
|
|
4841
|
+
type ContractGetSubscriptionSeatsHistoryParams as ContractGetSubscriptionSeatsHistoryParams,
|
|
4001
4842
|
type ContractListBalancesParams as ContractListBalancesParams,
|
|
4002
4843
|
type ContractListSeatBalancesParams as ContractListSeatBalancesParams,
|
|
4003
4844
|
type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams,
|