@metronome/sdk 0.1.0-beta.9 → 0.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 +194 -0
- package/README.md +30 -46
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +19 -5
- package/core.d.ts.map +1 -1
- package/core.js +23 -14
- package/core.js.map +1 -1
- package/core.mjs +24 -15
- package/core.mjs.map +1 -1
- package/index.d.mts +3 -2
- package/index.d.ts +3 -2
- package/index.d.ts.map +1 -1
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/index.mjs +6 -3
- package/index.mjs.map +1 -1
- package/package.json +1 -5
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -0
- package/pagination.js.map +1 -1
- package/pagination.mjs +3 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/shared.d.ts +521 -37
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.ts +30 -10
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +19 -0
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +19 -0
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.ts +8 -0
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.ts +58 -3
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +41 -0
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +41 -0
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +1556 -122
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +180 -3
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +180 -3
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.ts +2 -2
- 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.ts +21 -0
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +21 -0
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +21 -0
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.ts +51 -3
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +33 -0
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +33 -0
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.js.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +107 -10
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.ts +102 -14
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +68 -0
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +68 -0
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/credit-grants.d.ts +77 -2
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +39 -2
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +39 -2
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.ts +51 -7
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +35 -0
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +35 -0
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.ts +37 -0
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +23 -0
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +23 -0
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.ts +31 -0
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +27 -0
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +27 -0
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.ts +94 -7
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +56 -1
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +56 -1
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.ts +73 -3
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +41 -1
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +41 -1
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.ts +186 -9
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +106 -1
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +106 -1
- package/resources/v1/customers/customers.mjs.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.ts +144 -52
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +49 -0
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +49 -0
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.ts +21 -0
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +21 -0
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +21 -0
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.ts +46 -1
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +43 -0
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +43 -0
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/dashboards.d.ts +31 -3
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +26 -0
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +26 -0
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.ts +3 -3
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.ts +14 -0
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +14 -0
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +14 -0
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/plans.d.ts +47 -4
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +27 -0
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +27 -0
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.ts +8 -0
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.ts +5 -0
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +5 -0
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +5 -0
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/usage.d.ts +161 -3
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +46 -0
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +46 -0
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.ts +6 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.ts +3241 -205
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +90 -2
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +90 -2
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/webhooks.js +5 -5
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +5 -5
- package/resources/webhooks.mjs.map +1 -1
- package/src/_shims/auto/runtime-bun.ts +1 -1
- package/src/_shims/auto/runtime-node.ts +1 -1
- package/src/_shims/auto/runtime.ts +1 -1
- package/src/_shims/auto/types-node.ts +1 -1
- package/src/_shims/bun-runtime.ts +2 -2
- package/src/_shims/index.d.ts +5 -3
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +6 -2
- package/src/_shims/node-runtime.ts +3 -3
- package/src/_shims/registry.ts +1 -1
- package/src/_shims/web-runtime.ts +3 -3
- package/src/core.ts +46 -18
- package/src/error.ts +1 -1
- package/src/index.ts +22 -16
- package/src/internal/qs/formats.ts +1 -1
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +3 -3
- package/src/internal/qs/utils.ts +2 -2
- package/src/pagination.ts +5 -1
- package/src/resource.ts +2 -2
- package/src/resources/index.ts +4 -4
- package/src/resources/shared.ts +605 -40
- package/src/resources/v1/alerts.ts +33 -13
- package/src/resources/v1/audit-logs.ts +12 -4
- package/src/resources/v1/billable-metrics.ts +57 -8
- package/src/resources/v1/contracts/contracts.ts +1723 -135
- package/src/resources/v1/contracts/index.ts +8 -4
- package/src/resources/v1/contracts/named-schedules.ts +23 -2
- package/src/resources/v1/contracts/products.ts +53 -9
- package/src/resources/v1/contracts/rate-cards/index.ts +6 -4
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +27 -2
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +33 -3
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +113 -20
- package/src/resources/v1/contracts/rate-cards/rates.ts +86 -18
- package/src/resources/v1/contracts/rate-cards.ts +1 -1
- package/src/resources/v1/contracts.ts +1 -1
- package/src/resources/v1/credit-grants.ts +82 -10
- package/src/resources/v1/custom-fields.ts +57 -9
- package/src/resources/v1/customers/alerts.ts +44 -3
- package/src/resources/v1/customers/billing-config.ts +34 -2
- package/src/resources/v1/customers/commits.ts +97 -10
- package/src/resources/v1/customers/credits.ts +76 -6
- package/src/resources/v1/customers/customers.ts +208 -27
- package/src/resources/v1/customers/index.ts +10 -8
- package/src/resources/v1/customers/invoices.ts +123 -57
- package/src/resources/v1/customers/named-schedules.ts +23 -2
- package/src/resources/v1/customers/plans.ts +48 -5
- package/src/resources/v1/customers.ts +1 -1
- package/src/resources/v1/dashboards.ts +33 -5
- package/src/resources/v1/index.ts +20 -14
- package/src/resources/v1/invoices.ts +16 -2
- package/src/resources/v1/plans.ts +45 -10
- package/src/resources/v1/pricing-units.ts +12 -4
- package/src/resources/v1/services.ts +7 -2
- package/src/resources/v1/usage.ts +187 -6
- package/src/resources/v1/v1.ts +39 -27
- package/src/resources/v1.ts +1 -1
- package/src/resources/v2/contracts.ts +3838 -261
- package/src/resources/v2/index.ts +2 -2
- package/src/resources/v2/v2.ts +3 -3
- package/src/resources/v2.ts +1 -1
- package/src/resources/webhooks.ts +7 -7
- package/src/resources.ts +1 -1
- package/src/shims/node.ts +3 -3
- package/src/shims/web.ts +3 -3
- package/src/uploads.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/resources/shared.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import * as Shared from
|
|
3
|
+
import * as Shared from "./shared.js";
|
|
4
4
|
|
|
5
5
|
export interface BaseUsageFilter {
|
|
6
6
|
group_key: string;
|
|
@@ -34,6 +34,12 @@ export interface Commit {
|
|
|
34
34
|
|
|
35
35
|
applicable_product_tags?: Array<string>;
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* RFC 3339 timestamp indicating when the commit was archived. If not provided, the
|
|
39
|
+
* commit is not archived.
|
|
40
|
+
*/
|
|
41
|
+
archived_at?: string;
|
|
42
|
+
|
|
37
43
|
/**
|
|
38
44
|
* The current balance of the credit or commit. This balance reflects the amount of
|
|
39
45
|
* credit or commit that the customer has access to use at this moment - thus,
|
|
@@ -48,10 +54,15 @@ export interface Commit {
|
|
|
48
54
|
|
|
49
55
|
contract?: Commit.Contract;
|
|
50
56
|
|
|
51
|
-
custom_fields?:
|
|
57
|
+
custom_fields?: { [key: string]: string };
|
|
52
58
|
|
|
53
59
|
description?: string;
|
|
54
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Optional configuration for commit hierarchy access control
|
|
63
|
+
*/
|
|
64
|
+
hierarchy_configuration?: Commit.HierarchyConfiguration;
|
|
65
|
+
|
|
55
66
|
/**
|
|
56
67
|
* The contract that this commit will be billed on.
|
|
57
68
|
*/
|
|
@@ -73,6 +84,7 @@ export interface Commit {
|
|
|
73
84
|
| Commit.PrepaidCommitExpirationLedgerEntry
|
|
74
85
|
| Commit.PrepaidCommitCanceledLedgerEntry
|
|
75
86
|
| Commit.PrepaidCommitCreditedLedgerEntry
|
|
87
|
+
| Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry
|
|
76
88
|
| Commit.PostpaidCommitInitialBalanceLedgerEntry
|
|
77
89
|
| Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry
|
|
78
90
|
| Commit.PostpaidCommitRolloverLedgerEntry
|
|
@@ -106,6 +118,13 @@ export interface Commit {
|
|
|
106
118
|
*/
|
|
107
119
|
salesforce_opportunity_id?: string;
|
|
108
120
|
|
|
121
|
+
/**
|
|
122
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
123
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
124
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
125
|
+
*/
|
|
126
|
+
specifiers?: Array<Commit.Specifier>;
|
|
127
|
+
|
|
109
128
|
/**
|
|
110
129
|
* Prevents the creation of duplicates. If a request to create a commit or credit
|
|
111
130
|
* is made with a uniqueness key that was previously used to create a commit or
|
|
@@ -126,6 +145,32 @@ export namespace Commit {
|
|
|
126
145
|
id: string;
|
|
127
146
|
}
|
|
128
147
|
|
|
148
|
+
/**
|
|
149
|
+
* Optional configuration for commit hierarchy access control
|
|
150
|
+
*/
|
|
151
|
+
export interface HierarchyConfiguration {
|
|
152
|
+
child_access:
|
|
153
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
154
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
155
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export namespace HierarchyConfiguration {
|
|
159
|
+
export interface CommitHierarchyChildAccessAll {
|
|
160
|
+
type: 'ALL';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface CommitHierarchyChildAccessNone {
|
|
164
|
+
type: 'NONE';
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface CommitHierarchyChildAccessContractIDs {
|
|
168
|
+
contract_ids: Array<string>;
|
|
169
|
+
|
|
170
|
+
type: 'CONTRACT_IDS';
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
129
174
|
/**
|
|
130
175
|
* The contract that this commit will be billed on.
|
|
131
176
|
*/
|
|
@@ -153,6 +198,8 @@ export namespace Commit {
|
|
|
153
198
|
timestamp: string;
|
|
154
199
|
|
|
155
200
|
type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
|
|
201
|
+
|
|
202
|
+
contract_id?: string;
|
|
156
203
|
}
|
|
157
204
|
|
|
158
205
|
export interface PrepaidCommitRolloverLedgerEntry {
|
|
@@ -187,6 +234,8 @@ export namespace Commit {
|
|
|
187
234
|
timestamp: string;
|
|
188
235
|
|
|
189
236
|
type: 'PREPAID_COMMIT_CANCELED';
|
|
237
|
+
|
|
238
|
+
contract_id?: string;
|
|
190
239
|
}
|
|
191
240
|
|
|
192
241
|
export interface PrepaidCommitCreditedLedgerEntry {
|
|
@@ -199,6 +248,18 @@ export namespace Commit {
|
|
|
199
248
|
timestamp: string;
|
|
200
249
|
|
|
201
250
|
type: 'PREPAID_COMMIT_CREDITED';
|
|
251
|
+
|
|
252
|
+
contract_id?: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
|
|
256
|
+
amount: number;
|
|
257
|
+
|
|
258
|
+
segment_id: string;
|
|
259
|
+
|
|
260
|
+
timestamp: string;
|
|
261
|
+
|
|
262
|
+
type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
|
|
202
263
|
}
|
|
203
264
|
|
|
204
265
|
export interface PostpaidCommitInitialBalanceLedgerEntry {
|
|
@@ -219,6 +280,8 @@ export namespace Commit {
|
|
|
219
280
|
timestamp: string;
|
|
220
281
|
|
|
221
282
|
type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
|
|
283
|
+
|
|
284
|
+
contract_id?: string;
|
|
222
285
|
}
|
|
223
286
|
|
|
224
287
|
export interface PostpaidCommitRolloverLedgerEntry {
|
|
@@ -241,6 +304,8 @@ export namespace Commit {
|
|
|
241
304
|
timestamp: string;
|
|
242
305
|
|
|
243
306
|
type: 'POSTPAID_COMMIT_TRUEUP';
|
|
307
|
+
|
|
308
|
+
contract_id?: string;
|
|
244
309
|
}
|
|
245
310
|
|
|
246
311
|
export interface PrepaidCommitManualLedgerEntry {
|
|
@@ -276,6 +341,23 @@ export namespace Commit {
|
|
|
276
341
|
|
|
277
342
|
contract_id: string;
|
|
278
343
|
}
|
|
344
|
+
|
|
345
|
+
export interface Specifier {
|
|
346
|
+
presentation_group_values?: { [key: string]: string };
|
|
347
|
+
|
|
348
|
+
pricing_group_values?: { [key: string]: string };
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
352
|
+
*/
|
|
353
|
+
product_id?: string;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
357
|
+
* tags.
|
|
358
|
+
*/
|
|
359
|
+
product_tags?: Array<string>;
|
|
360
|
+
}
|
|
279
361
|
}
|
|
280
362
|
|
|
281
363
|
export interface ContractWithoutAmendments {
|
|
@@ -304,6 +386,14 @@ export interface ContractWithoutAmendments {
|
|
|
304
386
|
|
|
305
387
|
ending_before?: string;
|
|
306
388
|
|
|
389
|
+
/**
|
|
390
|
+
* Either a **parent** configuration with a list of children or a **child**
|
|
391
|
+
* configuration with a single parent.
|
|
392
|
+
*/
|
|
393
|
+
hierarchy_configuration?:
|
|
394
|
+
| ContractWithoutAmendments.ParentHierarchyConfiguration
|
|
395
|
+
| ContractWithoutAmendments.ChildHierarchyConfiguration;
|
|
396
|
+
|
|
307
397
|
name?: string;
|
|
308
398
|
|
|
309
399
|
net_payment_terms_days?: number;
|
|
@@ -313,6 +403,8 @@ export interface ContractWithoutAmendments {
|
|
|
313
403
|
*/
|
|
314
404
|
netsuite_sales_order_id?: string;
|
|
315
405
|
|
|
406
|
+
prepaid_balance_threshold_configuration?: ContractWithoutAmendments.PrepaidBalanceThresholdConfiguration;
|
|
407
|
+
|
|
316
408
|
/**
|
|
317
409
|
* This field's availability is dependent on your client's configuration.
|
|
318
410
|
*/
|
|
@@ -343,7 +435,7 @@ export interface ContractWithoutAmendments {
|
|
|
343
435
|
*/
|
|
344
436
|
scheduled_charges_on_usage_invoices?: 'ALL';
|
|
345
437
|
|
|
346
|
-
|
|
438
|
+
spend_threshold_configuration?: ContractWithoutAmendments.SpendThresholdConfiguration;
|
|
347
439
|
|
|
348
440
|
/**
|
|
349
441
|
* This field's availability is dependent on your client's configuration.
|
|
@@ -368,7 +460,191 @@ export namespace ContractWithoutAmendments {
|
|
|
368
460
|
*/
|
|
369
461
|
billing_anchor_date: string;
|
|
370
462
|
|
|
371
|
-
frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
463
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export interface ParentHierarchyConfiguration {
|
|
467
|
+
/**
|
|
468
|
+
* List of contracts that belong to this parent.
|
|
469
|
+
*/
|
|
470
|
+
children: Array<ParentHierarchyConfiguration.Child>;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export namespace ParentHierarchyConfiguration {
|
|
474
|
+
export interface Child {
|
|
475
|
+
contract_id: string;
|
|
476
|
+
|
|
477
|
+
customer_id: string;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export interface ChildHierarchyConfiguration {
|
|
482
|
+
/**
|
|
483
|
+
* The single parent contract/customer for this child.
|
|
484
|
+
*/
|
|
485
|
+
parent: ChildHierarchyConfiguration.Parent;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export namespace ChildHierarchyConfiguration {
|
|
489
|
+
/**
|
|
490
|
+
* The single parent contract/customer for this child.
|
|
491
|
+
*/
|
|
492
|
+
export interface Parent {
|
|
493
|
+
contract_id: string;
|
|
494
|
+
|
|
495
|
+
customer_id: string;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export interface PrepaidBalanceThresholdConfiguration {
|
|
500
|
+
commit: PrepaidBalanceThresholdConfiguration.Commit;
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* When set to false, the contract will not be evaluated against the
|
|
504
|
+
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
505
|
+
* regardless of prior state.
|
|
506
|
+
*/
|
|
507
|
+
is_enabled: boolean;
|
|
508
|
+
|
|
509
|
+
payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Specify the amount the balance should be recharged to.
|
|
513
|
+
*/
|
|
514
|
+
recharge_to_amount: number;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Specify the threshold amount for the contract. Each time the contract's prepaid
|
|
518
|
+
* balance lowers to this amount, a threshold charge will be initiated.
|
|
519
|
+
*/
|
|
520
|
+
threshold_amount: number;
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* If provided, the threshold, recharge-to amount, and the resulting threshold
|
|
524
|
+
* commit amount will be in terms of this credit type instead of the fiat currency.
|
|
525
|
+
*/
|
|
526
|
+
custom_credit_type_id?: string;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export namespace PrepaidBalanceThresholdConfiguration {
|
|
530
|
+
export interface Commit {
|
|
531
|
+
/**
|
|
532
|
+
* The commit product that will be used to generate the line item for commit
|
|
533
|
+
* payment.
|
|
534
|
+
*/
|
|
535
|
+
product_id: string;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Which products the threshold commit applies to. If applicable_product_ids,
|
|
539
|
+
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
540
|
+
* all products.
|
|
541
|
+
*/
|
|
542
|
+
applicable_product_ids?: Array<string>;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Which tags the threshold commit applies to. If applicable_product_ids,
|
|
546
|
+
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
547
|
+
* all products.
|
|
548
|
+
*/
|
|
549
|
+
applicable_product_tags?: Array<string>;
|
|
550
|
+
|
|
551
|
+
description?: string;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
555
|
+
* will default to the commit product name.
|
|
556
|
+
*/
|
|
557
|
+
name?: string;
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
561
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
562
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
563
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
564
|
+
*/
|
|
565
|
+
specifiers?: Array<Commit.Specifier>;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export namespace Commit {
|
|
569
|
+
export interface Specifier {
|
|
570
|
+
presentation_group_values?: { [key: string]: string };
|
|
571
|
+
|
|
572
|
+
pricing_group_values?: { [key: string]: string };
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
576
|
+
*/
|
|
577
|
+
product_id?: string;
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
581
|
+
* tags.
|
|
582
|
+
*/
|
|
583
|
+
product_tags?: Array<string>;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export interface PaymentGateConfig {
|
|
588
|
+
/**
|
|
589
|
+
* Gate access to the commit balance based on successful collection of payment.
|
|
590
|
+
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
591
|
+
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
592
|
+
* wish to payment gate the commit balance.
|
|
593
|
+
*/
|
|
594
|
+
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
598
|
+
*/
|
|
599
|
+
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
603
|
+
*/
|
|
604
|
+
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
608
|
+
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
609
|
+
* will default to NONE.
|
|
610
|
+
*/
|
|
611
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
export namespace PaymentGateConfig {
|
|
615
|
+
/**
|
|
616
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
617
|
+
*/
|
|
618
|
+
export interface PrecalculatedTaxConfig {
|
|
619
|
+
/**
|
|
620
|
+
* Amount of tax to be applied. This should be in the same currency and
|
|
621
|
+
* denomination as the commit's invoice schedule
|
|
622
|
+
*/
|
|
623
|
+
tax_amount: number;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Name of the tax to be applied. This may be used in an invoice line item
|
|
627
|
+
* description.
|
|
628
|
+
*/
|
|
629
|
+
tax_name?: string;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
634
|
+
*/
|
|
635
|
+
export interface StripeConfig {
|
|
636
|
+
/**
|
|
637
|
+
* If left blank, will default to INVOICE
|
|
638
|
+
*/
|
|
639
|
+
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
643
|
+
* your payment type.
|
|
644
|
+
*/
|
|
645
|
+
invoice_metadata?: { [key: string]: string };
|
|
646
|
+
}
|
|
647
|
+
}
|
|
372
648
|
}
|
|
373
649
|
|
|
374
650
|
export interface RecurringCommit {
|
|
@@ -423,6 +699,11 @@ export namespace ContractWithoutAmendments {
|
|
|
423
699
|
*/
|
|
424
700
|
ending_before?: string;
|
|
425
701
|
|
|
702
|
+
/**
|
|
703
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
704
|
+
*/
|
|
705
|
+
hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
|
|
706
|
+
|
|
426
707
|
/**
|
|
427
708
|
* The amount the customer should be billed for the commit. Not required.
|
|
428
709
|
*/
|
|
@@ -448,10 +729,10 @@ export namespace ContractWithoutAmendments {
|
|
|
448
729
|
* The frequency at which the recurring commits will be created. If not provided: -
|
|
449
730
|
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
450
731
|
* period defined in the duration will correspond to this frequency. - Commits will
|
|
451
|
-
* be created aligned with the recurring commit's
|
|
732
|
+
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
452
733
|
* invoice dates.
|
|
453
734
|
*/
|
|
454
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
735
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
455
736
|
|
|
456
737
|
/**
|
|
457
738
|
* Will be passed down to the individual commits. This controls how much of an
|
|
@@ -459,6 +740,18 @@ export namespace ContractWithoutAmendments {
|
|
|
459
740
|
* between 0 and 1.
|
|
460
741
|
*/
|
|
461
742
|
rollover_fraction?: number;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
746
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
747
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
748
|
+
*/
|
|
749
|
+
specifiers?: Array<RecurringCommit.Specifier>;
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Attach a subscription to the recurring commit/credit.
|
|
753
|
+
*/
|
|
754
|
+
subscription_config?: RecurringCommit.SubscriptionConfig;
|
|
462
755
|
}
|
|
463
756
|
|
|
464
757
|
export namespace RecurringCommit {
|
|
@@ -468,9 +761,9 @@ export namespace ContractWithoutAmendments {
|
|
|
468
761
|
export interface AccessAmount {
|
|
469
762
|
credit_type_id: string;
|
|
470
763
|
|
|
471
|
-
quantity: number;
|
|
472
|
-
|
|
473
764
|
unit_price: number;
|
|
765
|
+
|
|
766
|
+
quantity?: number;
|
|
474
767
|
}
|
|
475
768
|
|
|
476
769
|
/**
|
|
@@ -492,6 +785,32 @@ export namespace ContractWithoutAmendments {
|
|
|
492
785
|
id: string;
|
|
493
786
|
}
|
|
494
787
|
|
|
788
|
+
/**
|
|
789
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
790
|
+
*/
|
|
791
|
+
export interface HierarchyConfiguration {
|
|
792
|
+
child_access:
|
|
793
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
794
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
795
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
export namespace HierarchyConfiguration {
|
|
799
|
+
export interface CommitHierarchyChildAccessAll {
|
|
800
|
+
type: 'ALL';
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
export interface CommitHierarchyChildAccessNone {
|
|
804
|
+
type: 'NONE';
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
export interface CommitHierarchyChildAccessContractIDs {
|
|
808
|
+
contract_ids: Array<string>;
|
|
809
|
+
|
|
810
|
+
type: 'CONTRACT_IDS';
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
495
814
|
/**
|
|
496
815
|
* The amount the customer should be billed for the commit. Not required.
|
|
497
816
|
*/
|
|
@@ -502,6 +821,43 @@ export namespace ContractWithoutAmendments {
|
|
|
502
821
|
|
|
503
822
|
unit_price: number;
|
|
504
823
|
}
|
|
824
|
+
|
|
825
|
+
export interface Specifier {
|
|
826
|
+
presentation_group_values?: { [key: string]: string };
|
|
827
|
+
|
|
828
|
+
pricing_group_values?: { [key: string]: string };
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
832
|
+
*/
|
|
833
|
+
product_id?: string;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
837
|
+
* tags.
|
|
838
|
+
*/
|
|
839
|
+
product_tags?: Array<string>;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Attach a subscription to the recurring commit/credit.
|
|
844
|
+
*/
|
|
845
|
+
export interface SubscriptionConfig {
|
|
846
|
+
allocation: 'INDIVIDUAL' | 'POOLED';
|
|
847
|
+
|
|
848
|
+
apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
849
|
+
|
|
850
|
+
subscription_id: string;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
export namespace SubscriptionConfig {
|
|
854
|
+
export interface ApplySeatIncreaseConfig {
|
|
855
|
+
/**
|
|
856
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
857
|
+
*/
|
|
858
|
+
is_prorated: boolean;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
505
861
|
}
|
|
506
862
|
|
|
507
863
|
export interface RecurringCredit {
|
|
@@ -556,6 +912,11 @@ export namespace ContractWithoutAmendments {
|
|
|
556
912
|
*/
|
|
557
913
|
ending_before?: string;
|
|
558
914
|
|
|
915
|
+
/**
|
|
916
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
917
|
+
*/
|
|
918
|
+
hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
|
|
919
|
+
|
|
559
920
|
/**
|
|
560
921
|
* Displayed on invoices. Will be passed through to the individual commits
|
|
561
922
|
*/
|
|
@@ -576,10 +937,10 @@ export namespace ContractWithoutAmendments {
|
|
|
576
937
|
* The frequency at which the recurring commits will be created. If not provided: -
|
|
577
938
|
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
578
939
|
* period defined in the duration will correspond to this frequency. - Commits will
|
|
579
|
-
* be created aligned with the recurring commit's
|
|
940
|
+
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
580
941
|
* invoice dates.
|
|
581
942
|
*/
|
|
582
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
943
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
583
944
|
|
|
584
945
|
/**
|
|
585
946
|
* Will be passed down to the individual commits. This controls how much of an
|
|
@@ -587,6 +948,18 @@ export namespace ContractWithoutAmendments {
|
|
|
587
948
|
* between 0 and 1.
|
|
588
949
|
*/
|
|
589
950
|
rollover_fraction?: number;
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
954
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
955
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
956
|
+
*/
|
|
957
|
+
specifiers?: Array<RecurringCredit.Specifier>;
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* Attach a subscription to the recurring commit/credit.
|
|
961
|
+
*/
|
|
962
|
+
subscription_config?: RecurringCredit.SubscriptionConfig;
|
|
590
963
|
}
|
|
591
964
|
|
|
592
965
|
export namespace RecurringCredit {
|
|
@@ -596,9 +969,9 @@ export namespace ContractWithoutAmendments {
|
|
|
596
969
|
export interface AccessAmount {
|
|
597
970
|
credit_type_id: string;
|
|
598
971
|
|
|
599
|
-
quantity: number;
|
|
600
|
-
|
|
601
972
|
unit_price: number;
|
|
973
|
+
|
|
974
|
+
quantity?: number;
|
|
602
975
|
}
|
|
603
976
|
|
|
604
977
|
/**
|
|
@@ -619,6 +992,69 @@ export namespace ContractWithoutAmendments {
|
|
|
619
992
|
export interface Contract {
|
|
620
993
|
id: string;
|
|
621
994
|
}
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
998
|
+
*/
|
|
999
|
+
export interface HierarchyConfiguration {
|
|
1000
|
+
child_access:
|
|
1001
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
1002
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
1003
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
export namespace HierarchyConfiguration {
|
|
1007
|
+
export interface CommitHierarchyChildAccessAll {
|
|
1008
|
+
type: 'ALL';
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
export interface CommitHierarchyChildAccessNone {
|
|
1012
|
+
type: 'NONE';
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
export interface CommitHierarchyChildAccessContractIDs {
|
|
1016
|
+
contract_ids: Array<string>;
|
|
1017
|
+
|
|
1018
|
+
type: 'CONTRACT_IDS';
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
export interface Specifier {
|
|
1023
|
+
presentation_group_values?: { [key: string]: string };
|
|
1024
|
+
|
|
1025
|
+
pricing_group_values?: { [key: string]: string };
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
1029
|
+
*/
|
|
1030
|
+
product_id?: string;
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
1034
|
+
* tags.
|
|
1035
|
+
*/
|
|
1036
|
+
product_tags?: Array<string>;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Attach a subscription to the recurring commit/credit.
|
|
1041
|
+
*/
|
|
1042
|
+
export interface SubscriptionConfig {
|
|
1043
|
+
allocation: 'INDIVIDUAL' | 'POOLED';
|
|
1044
|
+
|
|
1045
|
+
apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
1046
|
+
|
|
1047
|
+
subscription_id: string;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
export namespace SubscriptionConfig {
|
|
1051
|
+
export interface ApplySeatIncreaseConfig {
|
|
1052
|
+
/**
|
|
1053
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
1054
|
+
*/
|
|
1055
|
+
is_prorated: boolean;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
622
1058
|
}
|
|
623
1059
|
|
|
624
1060
|
export interface ResellerRoyalty {
|
|
@@ -649,16 +1085,18 @@ export namespace ContractWithoutAmendments {
|
|
|
649
1085
|
reseller_contract_value?: number;
|
|
650
1086
|
}
|
|
651
1087
|
|
|
652
|
-
export interface
|
|
653
|
-
commit:
|
|
1088
|
+
export interface SpendThresholdConfiguration {
|
|
1089
|
+
commit: SpendThresholdConfiguration.Commit;
|
|
654
1090
|
|
|
655
1091
|
/**
|
|
656
1092
|
* When set to false, the contract will not be evaluated against the
|
|
657
1093
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
658
|
-
* regardless of prior state
|
|
1094
|
+
* regardless of prior state.
|
|
659
1095
|
*/
|
|
660
1096
|
is_enabled: boolean;
|
|
661
1097
|
|
|
1098
|
+
payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
|
|
1099
|
+
|
|
662
1100
|
/**
|
|
663
1101
|
* Specify the threshold amount for the contract. Each time the contract's usage
|
|
664
1102
|
* hits this amount, a threshold charge will be initiated.
|
|
@@ -666,30 +1104,83 @@ export namespace ContractWithoutAmendments {
|
|
|
666
1104
|
threshold_amount: number;
|
|
667
1105
|
}
|
|
668
1106
|
|
|
669
|
-
export namespace
|
|
1107
|
+
export namespace SpendThresholdConfiguration {
|
|
670
1108
|
export interface Commit {
|
|
1109
|
+
/**
|
|
1110
|
+
* The commit product that will be used to generate the line item for commit
|
|
1111
|
+
* payment.
|
|
1112
|
+
*/
|
|
671
1113
|
product_id: string;
|
|
672
1114
|
|
|
1115
|
+
description?: string;
|
|
1116
|
+
|
|
673
1117
|
/**
|
|
674
|
-
*
|
|
675
|
-
*
|
|
676
|
-
* products.
|
|
1118
|
+
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
1119
|
+
* will default to the commit product name.
|
|
677
1120
|
*/
|
|
678
|
-
|
|
1121
|
+
name?: string;
|
|
1122
|
+
}
|
|
679
1123
|
|
|
1124
|
+
export interface PaymentGateConfig {
|
|
680
1125
|
/**
|
|
681
|
-
*
|
|
682
|
-
*
|
|
1126
|
+
* Gate access to the commit balance based on successful collection of payment.
|
|
1127
|
+
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
1128
|
+
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
1129
|
+
* wish to payment gate the commit balance.
|
|
683
1130
|
*/
|
|
684
|
-
|
|
1131
|
+
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
685
1132
|
|
|
686
|
-
|
|
1133
|
+
/**
|
|
1134
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
1135
|
+
*/
|
|
1136
|
+
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
687
1137
|
|
|
688
1138
|
/**
|
|
689
|
-
*
|
|
690
|
-
* will default to the commit product name.
|
|
1139
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
691
1140
|
*/
|
|
692
|
-
|
|
1141
|
+
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
1145
|
+
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
1146
|
+
* will default to NONE.
|
|
1147
|
+
*/
|
|
1148
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
export namespace PaymentGateConfig {
|
|
1152
|
+
/**
|
|
1153
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
1154
|
+
*/
|
|
1155
|
+
export interface PrecalculatedTaxConfig {
|
|
1156
|
+
/**
|
|
1157
|
+
* Amount of tax to be applied. This should be in the same currency and
|
|
1158
|
+
* denomination as the commit's invoice schedule
|
|
1159
|
+
*/
|
|
1160
|
+
tax_amount: number;
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Name of the tax to be applied. This may be used in an invoice line item
|
|
1164
|
+
* description.
|
|
1165
|
+
*/
|
|
1166
|
+
tax_name?: string;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
1171
|
+
*/
|
|
1172
|
+
export interface StripeConfig {
|
|
1173
|
+
/**
|
|
1174
|
+
* If left blank, will default to INVOICE
|
|
1175
|
+
*/
|
|
1176
|
+
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
1180
|
+
* your payment type.
|
|
1181
|
+
*/
|
|
1182
|
+
invoice_metadata?: { [key: string]: string };
|
|
1183
|
+
}
|
|
693
1184
|
}
|
|
694
1185
|
}
|
|
695
1186
|
|
|
@@ -744,10 +1235,15 @@ export interface Credit {
|
|
|
744
1235
|
|
|
745
1236
|
contract?: Credit.Contract;
|
|
746
1237
|
|
|
747
|
-
custom_fields?:
|
|
1238
|
+
custom_fields?: { [key: string]: string };
|
|
748
1239
|
|
|
749
1240
|
description?: string;
|
|
750
1241
|
|
|
1242
|
+
/**
|
|
1243
|
+
* Optional configuration for credit hierarchy access control
|
|
1244
|
+
*/
|
|
1245
|
+
hierarchy_configuration?: Credit.HierarchyConfiguration;
|
|
1246
|
+
|
|
751
1247
|
/**
|
|
752
1248
|
* A list of ordered events that impact the balance of a credit. For example, an
|
|
753
1249
|
* invoice deduction or an expiration.
|
|
@@ -759,6 +1255,7 @@ export interface Credit {
|
|
|
759
1255
|
| Credit.CreditCanceledLedgerEntry
|
|
760
1256
|
| Credit.CreditCreditedLedgerEntry
|
|
761
1257
|
| Credit.CreditManualLedgerEntry
|
|
1258
|
+
| Credit.CreditSeatBasedAdjustmentLedgerEntry
|
|
762
1259
|
>;
|
|
763
1260
|
|
|
764
1261
|
name?: string;
|
|
@@ -781,6 +1278,13 @@ export interface Credit {
|
|
|
781
1278
|
*/
|
|
782
1279
|
salesforce_opportunity_id?: string;
|
|
783
1280
|
|
|
1281
|
+
/**
|
|
1282
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
1283
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1284
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
1285
|
+
*/
|
|
1286
|
+
specifiers?: Array<Credit.Specifier>;
|
|
1287
|
+
|
|
784
1288
|
/**
|
|
785
1289
|
* Prevents the creation of duplicates. If a request to create a commit or credit
|
|
786
1290
|
* is made with a uniqueness key that was previously used to create a commit or
|
|
@@ -801,6 +1305,32 @@ export namespace Credit {
|
|
|
801
1305
|
id: string;
|
|
802
1306
|
}
|
|
803
1307
|
|
|
1308
|
+
/**
|
|
1309
|
+
* Optional configuration for credit hierarchy access control
|
|
1310
|
+
*/
|
|
1311
|
+
export interface HierarchyConfiguration {
|
|
1312
|
+
child_access:
|
|
1313
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
1314
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
1315
|
+
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
export namespace HierarchyConfiguration {
|
|
1319
|
+
export interface CommitHierarchyChildAccessAll {
|
|
1320
|
+
type: 'ALL';
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
export interface CommitHierarchyChildAccessNone {
|
|
1324
|
+
type: 'NONE';
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
export interface CommitHierarchyChildAccessContractIDs {
|
|
1328
|
+
contract_ids: Array<string>;
|
|
1329
|
+
|
|
1330
|
+
type: 'CONTRACT_IDS';
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
|
|
804
1334
|
export interface CreditSegmentStartLedgerEntry {
|
|
805
1335
|
amount: number;
|
|
806
1336
|
|
|
@@ -821,6 +1351,8 @@ export namespace Credit {
|
|
|
821
1351
|
timestamp: string;
|
|
822
1352
|
|
|
823
1353
|
type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION';
|
|
1354
|
+
|
|
1355
|
+
contract_id?: string;
|
|
824
1356
|
}
|
|
825
1357
|
|
|
826
1358
|
export interface CreditExpirationLedgerEntry {
|
|
@@ -843,6 +1375,8 @@ export namespace Credit {
|
|
|
843
1375
|
timestamp: string;
|
|
844
1376
|
|
|
845
1377
|
type: 'CREDIT_CANCELED';
|
|
1378
|
+
|
|
1379
|
+
contract_id?: string;
|
|
846
1380
|
}
|
|
847
1381
|
|
|
848
1382
|
export interface CreditCreditedLedgerEntry {
|
|
@@ -855,6 +1389,8 @@ export namespace Credit {
|
|
|
855
1389
|
timestamp: string;
|
|
856
1390
|
|
|
857
1391
|
type: 'CREDIT_CREDITED';
|
|
1392
|
+
|
|
1393
|
+
contract_id?: string;
|
|
858
1394
|
}
|
|
859
1395
|
|
|
860
1396
|
export interface CreditManualLedgerEntry {
|
|
@@ -866,6 +1402,33 @@ export namespace Credit {
|
|
|
866
1402
|
|
|
867
1403
|
type: 'CREDIT_MANUAL';
|
|
868
1404
|
}
|
|
1405
|
+
|
|
1406
|
+
export interface CreditSeatBasedAdjustmentLedgerEntry {
|
|
1407
|
+
amount: number;
|
|
1408
|
+
|
|
1409
|
+
segment_id: string;
|
|
1410
|
+
|
|
1411
|
+
timestamp: string;
|
|
1412
|
+
|
|
1413
|
+
type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
export interface Specifier {
|
|
1417
|
+
presentation_group_values?: { [key: string]: string };
|
|
1418
|
+
|
|
1419
|
+
pricing_group_values?: { [key: string]: string };
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
1423
|
+
*/
|
|
1424
|
+
product_id?: string;
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
1428
|
+
* tags.
|
|
1429
|
+
*/
|
|
1430
|
+
product_tags?: Array<string>;
|
|
1431
|
+
}
|
|
869
1432
|
}
|
|
870
1433
|
|
|
871
1434
|
export interface CreditTypeData {
|
|
@@ -881,7 +1444,7 @@ export interface Discount {
|
|
|
881
1444
|
|
|
882
1445
|
schedule: SchedulePointInTime;
|
|
883
1446
|
|
|
884
|
-
custom_fields?:
|
|
1447
|
+
custom_fields?: { [key: string]: string };
|
|
885
1448
|
|
|
886
1449
|
name?: string;
|
|
887
1450
|
|
|
@@ -981,18 +1544,18 @@ export interface Override {
|
|
|
981
1544
|
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
982
1545
|
* processors.
|
|
983
1546
|
*/
|
|
984
|
-
value?:
|
|
1547
|
+
value?: { [key: string]: unknown };
|
|
985
1548
|
}
|
|
986
1549
|
|
|
987
1550
|
export namespace Override {
|
|
988
1551
|
export interface OverrideSpecifier {
|
|
989
|
-
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
1552
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
990
1553
|
|
|
991
1554
|
commit_ids?: Array<string>;
|
|
992
1555
|
|
|
993
|
-
presentation_group_values?:
|
|
1556
|
+
presentation_group_values?: { [key: string]: string | null };
|
|
994
1557
|
|
|
995
|
-
pricing_group_values?:
|
|
1558
|
+
pricing_group_values?: { [key: string]: string };
|
|
996
1559
|
|
|
997
1560
|
product_id?: string;
|
|
998
1561
|
|
|
@@ -1018,7 +1581,7 @@ export namespace Override {
|
|
|
1018
1581
|
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
1019
1582
|
* processors.
|
|
1020
1583
|
*/
|
|
1021
|
-
custom_rate?:
|
|
1584
|
+
custom_rate?: { [key: string]: unknown };
|
|
1022
1585
|
|
|
1023
1586
|
/**
|
|
1024
1587
|
* Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
|
|
@@ -1103,7 +1666,7 @@ export interface ProService {
|
|
|
1103
1666
|
*/
|
|
1104
1667
|
unit_price: number;
|
|
1105
1668
|
|
|
1106
|
-
custom_fields?:
|
|
1669
|
+
custom_fields?: { [key: string]: string };
|
|
1107
1670
|
|
|
1108
1671
|
description?: string;
|
|
1109
1672
|
|
|
@@ -1122,7 +1685,7 @@ export interface Rate {
|
|
|
1122
1685
|
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
1123
1686
|
* processors.
|
|
1124
1687
|
*/
|
|
1125
|
-
custom_rate?:
|
|
1688
|
+
custom_rate?: { [key: string]: unknown };
|
|
1126
1689
|
|
|
1127
1690
|
/**
|
|
1128
1691
|
* Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
|
|
@@ -1140,7 +1703,7 @@ export interface Rate {
|
|
|
1140
1703
|
* if pricing groups are used, this will contain the values used to calculate the
|
|
1141
1704
|
* price
|
|
1142
1705
|
*/
|
|
1143
|
-
pricing_group_values?:
|
|
1706
|
+
pricing_group_values?: { [key: string]: string };
|
|
1144
1707
|
|
|
1145
1708
|
/**
|
|
1146
1709
|
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
@@ -1167,7 +1730,9 @@ export interface ScheduledCharge {
|
|
|
1167
1730
|
|
|
1168
1731
|
schedule: SchedulePointInTime;
|
|
1169
1732
|
|
|
1170
|
-
|
|
1733
|
+
archived_at?: string;
|
|
1734
|
+
|
|
1735
|
+
custom_fields?: { [key: string]: string };
|
|
1171
1736
|
|
|
1172
1737
|
/**
|
|
1173
1738
|
* displayed on invoices
|
|
@@ -1218,13 +1783,13 @@ export namespace SchedulePointInTime {
|
|
|
1218
1783
|
|
|
1219
1784
|
amount: number;
|
|
1220
1785
|
|
|
1221
|
-
invoice_id: string;
|
|
1222
|
-
|
|
1223
1786
|
quantity: number;
|
|
1224
1787
|
|
|
1225
1788
|
timestamp: string;
|
|
1226
1789
|
|
|
1227
1790
|
unit_price: number;
|
|
1791
|
+
|
|
1792
|
+
invoice_id?: string | null;
|
|
1228
1793
|
}
|
|
1229
1794
|
}
|
|
1230
1795
|
|