@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/resources/shared.d.ts
CHANGED
|
@@ -20,6 +20,11 @@ export interface Commit {
|
|
|
20
20
|
applicable_contract_ids?: Array<string>;
|
|
21
21
|
applicable_product_ids?: Array<string>;
|
|
22
22
|
applicable_product_tags?: Array<string>;
|
|
23
|
+
/**
|
|
24
|
+
* RFC 3339 timestamp indicating when the commit was archived. If not provided, the
|
|
25
|
+
* commit is not archived.
|
|
26
|
+
*/
|
|
27
|
+
archived_at?: string;
|
|
23
28
|
/**
|
|
24
29
|
* The current balance of the credit or commit. This balance reflects the amount of
|
|
25
30
|
* credit or commit that the customer has access to use at this moment - thus,
|
|
@@ -32,8 +37,14 @@ export interface Commit {
|
|
|
32
37
|
*/
|
|
33
38
|
balance?: number;
|
|
34
39
|
contract?: Commit.Contract;
|
|
35
|
-
custom_fields?:
|
|
40
|
+
custom_fields?: {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
};
|
|
36
43
|
description?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Optional configuration for commit hierarchy access control
|
|
46
|
+
*/
|
|
47
|
+
hierarchy_configuration?: Commit.HierarchyConfiguration;
|
|
37
48
|
/**
|
|
38
49
|
* The contract that this commit will be billed on.
|
|
39
50
|
*/
|
|
@@ -46,7 +57,7 @@ export interface Commit {
|
|
|
46
57
|
* A list of ordered events that impact the balance of a commit. For example, an
|
|
47
58
|
* invoice deduction or a rollover.
|
|
48
59
|
*/
|
|
49
|
-
ledger?: Array<Commit.PrepaidCommitSegmentStartLedgerEntry | Commit.PrepaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PrepaidCommitRolloverLedgerEntry | Commit.PrepaidCommitExpirationLedgerEntry | Commit.PrepaidCommitCanceledLedgerEntry | Commit.PrepaidCommitCreditedLedgerEntry | Commit.PostpaidCommitInitialBalanceLedgerEntry | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PostpaidCommitRolloverLedgerEntry | Commit.PostpaidCommitTrueupLedgerEntry | Commit.PrepaidCommitManualLedgerEntry | Commit.PostpaidCommitManualLedgerEntry | Commit.PostpaidCommitExpirationLedgerEntry>;
|
|
60
|
+
ledger?: Array<Commit.PrepaidCommitSegmentStartLedgerEntry | Commit.PrepaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PrepaidCommitRolloverLedgerEntry | Commit.PrepaidCommitExpirationLedgerEntry | Commit.PrepaidCommitCanceledLedgerEntry | Commit.PrepaidCommitCreditedLedgerEntry | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry | Commit.PostpaidCommitInitialBalanceLedgerEntry | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PostpaidCommitRolloverLedgerEntry | Commit.PostpaidCommitTrueupLedgerEntry | Commit.PrepaidCommitManualLedgerEntry | Commit.PostpaidCommitManualLedgerEntry | Commit.PostpaidCommitExpirationLedgerEntry>;
|
|
50
61
|
name?: string;
|
|
51
62
|
/**
|
|
52
63
|
* This field's availability is dependent on your client's configuration.
|
|
@@ -64,6 +75,12 @@ export interface Commit {
|
|
|
64
75
|
* This field's availability is dependent on your client's configuration.
|
|
65
76
|
*/
|
|
66
77
|
salesforce_opportunity_id?: string;
|
|
78
|
+
/**
|
|
79
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
80
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
81
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
82
|
+
*/
|
|
83
|
+
specifiers?: Array<Commit.Specifier>;
|
|
67
84
|
/**
|
|
68
85
|
* Prevents the creation of duplicates. If a request to create a commit or credit
|
|
69
86
|
* is made with a uniqueness key that was previously used to create a commit or
|
|
@@ -80,6 +97,24 @@ export declare namespace Commit {
|
|
|
80
97
|
interface Contract {
|
|
81
98
|
id: string;
|
|
82
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Optional configuration for commit hierarchy access control
|
|
102
|
+
*/
|
|
103
|
+
interface HierarchyConfiguration {
|
|
104
|
+
child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
105
|
+
}
|
|
106
|
+
namespace HierarchyConfiguration {
|
|
107
|
+
interface CommitHierarchyChildAccessAll {
|
|
108
|
+
type: 'ALL';
|
|
109
|
+
}
|
|
110
|
+
interface CommitHierarchyChildAccessNone {
|
|
111
|
+
type: 'NONE';
|
|
112
|
+
}
|
|
113
|
+
interface CommitHierarchyChildAccessContractIDs {
|
|
114
|
+
contract_ids: Array<string>;
|
|
115
|
+
type: 'CONTRACT_IDS';
|
|
116
|
+
}
|
|
117
|
+
}
|
|
83
118
|
/**
|
|
84
119
|
* The contract that this commit will be billed on.
|
|
85
120
|
*/
|
|
@@ -98,6 +133,7 @@ export declare namespace Commit {
|
|
|
98
133
|
segment_id: string;
|
|
99
134
|
timestamp: string;
|
|
100
135
|
type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
|
|
136
|
+
contract_id?: string;
|
|
101
137
|
}
|
|
102
138
|
interface PrepaidCommitRolloverLedgerEntry {
|
|
103
139
|
amount: number;
|
|
@@ -118,6 +154,7 @@ export declare namespace Commit {
|
|
|
118
154
|
segment_id: string;
|
|
119
155
|
timestamp: string;
|
|
120
156
|
type: 'PREPAID_COMMIT_CANCELED';
|
|
157
|
+
contract_id?: string;
|
|
121
158
|
}
|
|
122
159
|
interface PrepaidCommitCreditedLedgerEntry {
|
|
123
160
|
amount: number;
|
|
@@ -125,6 +162,13 @@ export declare namespace Commit {
|
|
|
125
162
|
segment_id: string;
|
|
126
163
|
timestamp: string;
|
|
127
164
|
type: 'PREPAID_COMMIT_CREDITED';
|
|
165
|
+
contract_id?: string;
|
|
166
|
+
}
|
|
167
|
+
interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
|
|
168
|
+
amount: number;
|
|
169
|
+
segment_id: string;
|
|
170
|
+
timestamp: string;
|
|
171
|
+
type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
|
|
128
172
|
}
|
|
129
173
|
interface PostpaidCommitInitialBalanceLedgerEntry {
|
|
130
174
|
amount: number;
|
|
@@ -137,6 +181,7 @@ export declare namespace Commit {
|
|
|
137
181
|
segment_id: string;
|
|
138
182
|
timestamp: string;
|
|
139
183
|
type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
|
|
184
|
+
contract_id?: string;
|
|
140
185
|
}
|
|
141
186
|
interface PostpaidCommitRolloverLedgerEntry {
|
|
142
187
|
amount: number;
|
|
@@ -150,6 +195,7 @@ export declare namespace Commit {
|
|
|
150
195
|
invoice_id: string;
|
|
151
196
|
timestamp: string;
|
|
152
197
|
type: 'POSTPAID_COMMIT_TRUEUP';
|
|
198
|
+
contract_id?: string;
|
|
153
199
|
}
|
|
154
200
|
interface PrepaidCommitManualLedgerEntry {
|
|
155
201
|
amount: number;
|
|
@@ -172,6 +218,23 @@ export declare namespace Commit {
|
|
|
172
218
|
commit_id: string;
|
|
173
219
|
contract_id: string;
|
|
174
220
|
}
|
|
221
|
+
interface Specifier {
|
|
222
|
+
presentation_group_values?: {
|
|
223
|
+
[key: string]: string;
|
|
224
|
+
};
|
|
225
|
+
pricing_group_values?: {
|
|
226
|
+
[key: string]: string;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
230
|
+
*/
|
|
231
|
+
product_id?: string;
|
|
232
|
+
/**
|
|
233
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
234
|
+
* tags.
|
|
235
|
+
*/
|
|
236
|
+
product_tags?: Array<string>;
|
|
237
|
+
}
|
|
175
238
|
}
|
|
176
239
|
export interface ContractWithoutAmendments {
|
|
177
240
|
commits: Array<Commit>;
|
|
@@ -188,12 +251,18 @@ export interface ContractWithoutAmendments {
|
|
|
188
251
|
*/
|
|
189
252
|
discounts?: Array<Discount>;
|
|
190
253
|
ending_before?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Either a **parent** configuration with a list of children or a **child**
|
|
256
|
+
* configuration with a single parent.
|
|
257
|
+
*/
|
|
258
|
+
hierarchy_configuration?: ContractWithoutAmendments.ParentHierarchyConfiguration | ContractWithoutAmendments.ChildHierarchyConfiguration;
|
|
191
259
|
name?: string;
|
|
192
260
|
net_payment_terms_days?: number;
|
|
193
261
|
/**
|
|
194
262
|
* This field's availability is dependent on your client's configuration.
|
|
195
263
|
*/
|
|
196
264
|
netsuite_sales_order_id?: string;
|
|
265
|
+
prepaid_balance_threshold_configuration?: ContractWithoutAmendments.PrepaidBalanceThresholdConfiguration;
|
|
197
266
|
/**
|
|
198
267
|
* This field's availability is dependent on your client's configuration.
|
|
199
268
|
*/
|
|
@@ -217,7 +286,7 @@ export interface ContractWithoutAmendments {
|
|
|
217
286
|
* on a separate invoice from usage charges.
|
|
218
287
|
*/
|
|
219
288
|
scheduled_charges_on_usage_invoices?: 'ALL';
|
|
220
|
-
|
|
289
|
+
spend_threshold_configuration?: ContractWithoutAmendments.SpendThresholdConfiguration;
|
|
221
290
|
/**
|
|
222
291
|
* This field's availability is dependent on your client's configuration.
|
|
223
292
|
*/
|
|
@@ -235,7 +304,167 @@ export declare namespace ContractWithoutAmendments {
|
|
|
235
304
|
* Contract usage statements follow a selected cadence based on this date.
|
|
236
305
|
*/
|
|
237
306
|
billing_anchor_date: string;
|
|
238
|
-
frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
307
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
308
|
+
}
|
|
309
|
+
interface ParentHierarchyConfiguration {
|
|
310
|
+
/**
|
|
311
|
+
* List of contracts that belong to this parent.
|
|
312
|
+
*/
|
|
313
|
+
children: Array<ParentHierarchyConfiguration.Child>;
|
|
314
|
+
}
|
|
315
|
+
namespace ParentHierarchyConfiguration {
|
|
316
|
+
interface Child {
|
|
317
|
+
contract_id: string;
|
|
318
|
+
customer_id: string;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
interface ChildHierarchyConfiguration {
|
|
322
|
+
/**
|
|
323
|
+
* The single parent contract/customer for this child.
|
|
324
|
+
*/
|
|
325
|
+
parent: ChildHierarchyConfiguration.Parent;
|
|
326
|
+
}
|
|
327
|
+
namespace ChildHierarchyConfiguration {
|
|
328
|
+
/**
|
|
329
|
+
* The single parent contract/customer for this child.
|
|
330
|
+
*/
|
|
331
|
+
interface Parent {
|
|
332
|
+
contract_id: string;
|
|
333
|
+
customer_id: string;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
interface PrepaidBalanceThresholdConfiguration {
|
|
337
|
+
commit: PrepaidBalanceThresholdConfiguration.Commit;
|
|
338
|
+
/**
|
|
339
|
+
* When set to false, the contract will not be evaluated against the
|
|
340
|
+
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
341
|
+
* regardless of prior state.
|
|
342
|
+
*/
|
|
343
|
+
is_enabled: boolean;
|
|
344
|
+
payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
|
|
345
|
+
/**
|
|
346
|
+
* Specify the amount the balance should be recharged to.
|
|
347
|
+
*/
|
|
348
|
+
recharge_to_amount: number;
|
|
349
|
+
/**
|
|
350
|
+
* Specify the threshold amount for the contract. Each time the contract's prepaid
|
|
351
|
+
* balance lowers to this amount, a threshold charge will be initiated.
|
|
352
|
+
*/
|
|
353
|
+
threshold_amount: number;
|
|
354
|
+
/**
|
|
355
|
+
* If provided, the threshold, recharge-to amount, and the resulting threshold
|
|
356
|
+
* commit amount will be in terms of this credit type instead of the fiat currency.
|
|
357
|
+
*/
|
|
358
|
+
custom_credit_type_id?: string;
|
|
359
|
+
}
|
|
360
|
+
namespace PrepaidBalanceThresholdConfiguration {
|
|
361
|
+
interface Commit {
|
|
362
|
+
/**
|
|
363
|
+
* The commit product that will be used to generate the line item for commit
|
|
364
|
+
* payment.
|
|
365
|
+
*/
|
|
366
|
+
product_id: string;
|
|
367
|
+
/**
|
|
368
|
+
* Which products the threshold commit applies to. If applicable_product_ids,
|
|
369
|
+
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
370
|
+
* all products.
|
|
371
|
+
*/
|
|
372
|
+
applicable_product_ids?: Array<string>;
|
|
373
|
+
/**
|
|
374
|
+
* Which tags the threshold commit applies to. If applicable_product_ids,
|
|
375
|
+
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
376
|
+
* all products.
|
|
377
|
+
*/
|
|
378
|
+
applicable_product_tags?: Array<string>;
|
|
379
|
+
description?: string;
|
|
380
|
+
/**
|
|
381
|
+
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
382
|
+
* will default to the commit product name.
|
|
383
|
+
*/
|
|
384
|
+
name?: string;
|
|
385
|
+
/**
|
|
386
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
387
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
388
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
389
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
390
|
+
*/
|
|
391
|
+
specifiers?: Array<Commit.Specifier>;
|
|
392
|
+
}
|
|
393
|
+
namespace Commit {
|
|
394
|
+
interface Specifier {
|
|
395
|
+
presentation_group_values?: {
|
|
396
|
+
[key: string]: string;
|
|
397
|
+
};
|
|
398
|
+
pricing_group_values?: {
|
|
399
|
+
[key: string]: string;
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
403
|
+
*/
|
|
404
|
+
product_id?: string;
|
|
405
|
+
/**
|
|
406
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
407
|
+
* tags.
|
|
408
|
+
*/
|
|
409
|
+
product_tags?: Array<string>;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
interface PaymentGateConfig {
|
|
413
|
+
/**
|
|
414
|
+
* Gate access to the commit balance based on successful collection of payment.
|
|
415
|
+
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
416
|
+
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
417
|
+
* wish to payment gate the commit balance.
|
|
418
|
+
*/
|
|
419
|
+
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
420
|
+
/**
|
|
421
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
422
|
+
*/
|
|
423
|
+
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
424
|
+
/**
|
|
425
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
426
|
+
*/
|
|
427
|
+
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
428
|
+
/**
|
|
429
|
+
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
430
|
+
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
431
|
+
* will default to NONE.
|
|
432
|
+
*/
|
|
433
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
434
|
+
}
|
|
435
|
+
namespace PaymentGateConfig {
|
|
436
|
+
/**
|
|
437
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
438
|
+
*/
|
|
439
|
+
interface PrecalculatedTaxConfig {
|
|
440
|
+
/**
|
|
441
|
+
* Amount of tax to be applied. This should be in the same currency and
|
|
442
|
+
* denomination as the commit's invoice schedule
|
|
443
|
+
*/
|
|
444
|
+
tax_amount: number;
|
|
445
|
+
/**
|
|
446
|
+
* Name of the tax to be applied. This may be used in an invoice line item
|
|
447
|
+
* description.
|
|
448
|
+
*/
|
|
449
|
+
tax_name?: string;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
453
|
+
*/
|
|
454
|
+
interface StripeConfig {
|
|
455
|
+
/**
|
|
456
|
+
* If left blank, will default to INVOICE
|
|
457
|
+
*/
|
|
458
|
+
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
459
|
+
/**
|
|
460
|
+
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
461
|
+
* your payment type.
|
|
462
|
+
*/
|
|
463
|
+
invoice_metadata?: {
|
|
464
|
+
[key: string]: string;
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
}
|
|
239
468
|
}
|
|
240
469
|
interface RecurringCommit {
|
|
241
470
|
id: string;
|
|
@@ -277,6 +506,10 @@ export declare namespace ContractWithoutAmendments {
|
|
|
277
506
|
* Determines when the contract will stop creating recurring commits. Optional
|
|
278
507
|
*/
|
|
279
508
|
ending_before?: string;
|
|
509
|
+
/**
|
|
510
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
511
|
+
*/
|
|
512
|
+
hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
|
|
280
513
|
/**
|
|
281
514
|
* The amount the customer should be billed for the commit. Not required.
|
|
282
515
|
*/
|
|
@@ -298,16 +531,26 @@ export declare namespace ContractWithoutAmendments {
|
|
|
298
531
|
* The frequency at which the recurring commits will be created. If not provided: -
|
|
299
532
|
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
300
533
|
* period defined in the duration will correspond to this frequency. - Commits will
|
|
301
|
-
* be created aligned with the recurring commit's
|
|
534
|
+
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
302
535
|
* invoice dates.
|
|
303
536
|
*/
|
|
304
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
537
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
305
538
|
/**
|
|
306
539
|
* Will be passed down to the individual commits. This controls how much of an
|
|
307
540
|
* individual unexpired commit will roll over upon contract transition. Must be
|
|
308
541
|
* between 0 and 1.
|
|
309
542
|
*/
|
|
310
543
|
rollover_fraction?: number;
|
|
544
|
+
/**
|
|
545
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
546
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
547
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
548
|
+
*/
|
|
549
|
+
specifiers?: Array<RecurringCommit.Specifier>;
|
|
550
|
+
/**
|
|
551
|
+
* Attach a subscription to the recurring commit/credit.
|
|
552
|
+
*/
|
|
553
|
+
subscription_config?: RecurringCommit.SubscriptionConfig;
|
|
311
554
|
}
|
|
312
555
|
namespace RecurringCommit {
|
|
313
556
|
/**
|
|
@@ -315,8 +558,8 @@ export declare namespace ContractWithoutAmendments {
|
|
|
315
558
|
*/
|
|
316
559
|
interface AccessAmount {
|
|
317
560
|
credit_type_id: string;
|
|
318
|
-
quantity: number;
|
|
319
561
|
unit_price: number;
|
|
562
|
+
quantity?: number;
|
|
320
563
|
}
|
|
321
564
|
/**
|
|
322
565
|
* The amount of time the created commits will be valid for
|
|
@@ -332,6 +575,24 @@ export declare namespace ContractWithoutAmendments {
|
|
|
332
575
|
interface Contract {
|
|
333
576
|
id: string;
|
|
334
577
|
}
|
|
578
|
+
/**
|
|
579
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
580
|
+
*/
|
|
581
|
+
interface HierarchyConfiguration {
|
|
582
|
+
child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
583
|
+
}
|
|
584
|
+
namespace HierarchyConfiguration {
|
|
585
|
+
interface CommitHierarchyChildAccessAll {
|
|
586
|
+
type: 'ALL';
|
|
587
|
+
}
|
|
588
|
+
interface CommitHierarchyChildAccessNone {
|
|
589
|
+
type: 'NONE';
|
|
590
|
+
}
|
|
591
|
+
interface CommitHierarchyChildAccessContractIDs {
|
|
592
|
+
contract_ids: Array<string>;
|
|
593
|
+
type: 'CONTRACT_IDS';
|
|
594
|
+
}
|
|
595
|
+
}
|
|
335
596
|
/**
|
|
336
597
|
* The amount the customer should be billed for the commit. Not required.
|
|
337
598
|
*/
|
|
@@ -340,6 +601,39 @@ export declare namespace ContractWithoutAmendments {
|
|
|
340
601
|
quantity: number;
|
|
341
602
|
unit_price: number;
|
|
342
603
|
}
|
|
604
|
+
interface Specifier {
|
|
605
|
+
presentation_group_values?: {
|
|
606
|
+
[key: string]: string;
|
|
607
|
+
};
|
|
608
|
+
pricing_group_values?: {
|
|
609
|
+
[key: string]: string;
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
613
|
+
*/
|
|
614
|
+
product_id?: string;
|
|
615
|
+
/**
|
|
616
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
617
|
+
* tags.
|
|
618
|
+
*/
|
|
619
|
+
product_tags?: Array<string>;
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Attach a subscription to the recurring commit/credit.
|
|
623
|
+
*/
|
|
624
|
+
interface SubscriptionConfig {
|
|
625
|
+
allocation: 'INDIVIDUAL' | 'POOLED';
|
|
626
|
+
apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
627
|
+
subscription_id: string;
|
|
628
|
+
}
|
|
629
|
+
namespace SubscriptionConfig {
|
|
630
|
+
interface ApplySeatIncreaseConfig {
|
|
631
|
+
/**
|
|
632
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
633
|
+
*/
|
|
634
|
+
is_prorated: boolean;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
343
637
|
}
|
|
344
638
|
interface RecurringCredit {
|
|
345
639
|
id: string;
|
|
@@ -381,6 +675,10 @@ export declare namespace ContractWithoutAmendments {
|
|
|
381
675
|
* Determines when the contract will stop creating recurring commits. Optional
|
|
382
676
|
*/
|
|
383
677
|
ending_before?: string;
|
|
678
|
+
/**
|
|
679
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
680
|
+
*/
|
|
681
|
+
hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
|
|
384
682
|
/**
|
|
385
683
|
* Displayed on invoices. Will be passed through to the individual commits
|
|
386
684
|
*/
|
|
@@ -398,16 +696,26 @@ export declare namespace ContractWithoutAmendments {
|
|
|
398
696
|
* The frequency at which the recurring commits will be created. If not provided: -
|
|
399
697
|
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
400
698
|
* period defined in the duration will correspond to this frequency. - Commits will
|
|
401
|
-
* be created aligned with the recurring commit's
|
|
699
|
+
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
402
700
|
* invoice dates.
|
|
403
701
|
*/
|
|
404
|
-
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
702
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
405
703
|
/**
|
|
406
704
|
* Will be passed down to the individual commits. This controls how much of an
|
|
407
705
|
* individual unexpired commit will roll over upon contract transition. Must be
|
|
408
706
|
* between 0 and 1.
|
|
409
707
|
*/
|
|
410
708
|
rollover_fraction?: number;
|
|
709
|
+
/**
|
|
710
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
711
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
712
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
713
|
+
*/
|
|
714
|
+
specifiers?: Array<RecurringCredit.Specifier>;
|
|
715
|
+
/**
|
|
716
|
+
* Attach a subscription to the recurring commit/credit.
|
|
717
|
+
*/
|
|
718
|
+
subscription_config?: RecurringCredit.SubscriptionConfig;
|
|
411
719
|
}
|
|
412
720
|
namespace RecurringCredit {
|
|
413
721
|
/**
|
|
@@ -415,8 +723,8 @@ export declare namespace ContractWithoutAmendments {
|
|
|
415
723
|
*/
|
|
416
724
|
interface AccessAmount {
|
|
417
725
|
credit_type_id: string;
|
|
418
|
-
quantity: number;
|
|
419
726
|
unit_price: number;
|
|
727
|
+
quantity?: number;
|
|
420
728
|
}
|
|
421
729
|
/**
|
|
422
730
|
* The amount of time the created commits will be valid for
|
|
@@ -432,6 +740,57 @@ export declare namespace ContractWithoutAmendments {
|
|
|
432
740
|
interface Contract {
|
|
433
741
|
id: string;
|
|
434
742
|
}
|
|
743
|
+
/**
|
|
744
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
745
|
+
*/
|
|
746
|
+
interface HierarchyConfiguration {
|
|
747
|
+
child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
748
|
+
}
|
|
749
|
+
namespace HierarchyConfiguration {
|
|
750
|
+
interface CommitHierarchyChildAccessAll {
|
|
751
|
+
type: 'ALL';
|
|
752
|
+
}
|
|
753
|
+
interface CommitHierarchyChildAccessNone {
|
|
754
|
+
type: 'NONE';
|
|
755
|
+
}
|
|
756
|
+
interface CommitHierarchyChildAccessContractIDs {
|
|
757
|
+
contract_ids: Array<string>;
|
|
758
|
+
type: 'CONTRACT_IDS';
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
interface Specifier {
|
|
762
|
+
presentation_group_values?: {
|
|
763
|
+
[key: string]: string;
|
|
764
|
+
};
|
|
765
|
+
pricing_group_values?: {
|
|
766
|
+
[key: string]: string;
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
770
|
+
*/
|
|
771
|
+
product_id?: string;
|
|
772
|
+
/**
|
|
773
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
774
|
+
* tags.
|
|
775
|
+
*/
|
|
776
|
+
product_tags?: Array<string>;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Attach a subscription to the recurring commit/credit.
|
|
780
|
+
*/
|
|
781
|
+
interface SubscriptionConfig {
|
|
782
|
+
allocation: 'INDIVIDUAL' | 'POOLED';
|
|
783
|
+
apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
784
|
+
subscription_id: string;
|
|
785
|
+
}
|
|
786
|
+
namespace SubscriptionConfig {
|
|
787
|
+
interface ApplySeatIncreaseConfig {
|
|
788
|
+
/**
|
|
789
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
790
|
+
*/
|
|
791
|
+
is_prorated: boolean;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
435
794
|
}
|
|
436
795
|
interface ResellerRoyalty {
|
|
437
796
|
fraction: number;
|
|
@@ -448,34 +807,28 @@ export declare namespace ContractWithoutAmendments {
|
|
|
448
807
|
gcp_offer_id?: string;
|
|
449
808
|
reseller_contract_value?: number;
|
|
450
809
|
}
|
|
451
|
-
interface
|
|
452
|
-
commit:
|
|
810
|
+
interface SpendThresholdConfiguration {
|
|
811
|
+
commit: SpendThresholdConfiguration.Commit;
|
|
453
812
|
/**
|
|
454
813
|
* When set to false, the contract will not be evaluated against the
|
|
455
814
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
456
|
-
* regardless of prior state
|
|
815
|
+
* regardless of prior state.
|
|
457
816
|
*/
|
|
458
817
|
is_enabled: boolean;
|
|
818
|
+
payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
|
|
459
819
|
/**
|
|
460
820
|
* Specify the threshold amount for the contract. Each time the contract's usage
|
|
461
821
|
* hits this amount, a threshold charge will be initiated.
|
|
462
822
|
*/
|
|
463
823
|
threshold_amount: number;
|
|
464
824
|
}
|
|
465
|
-
namespace
|
|
825
|
+
namespace SpendThresholdConfiguration {
|
|
466
826
|
interface Commit {
|
|
467
|
-
product_id: string;
|
|
468
827
|
/**
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
* products.
|
|
828
|
+
* The commit product that will be used to generate the line item for commit
|
|
829
|
+
* payment.
|
|
472
830
|
*/
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* Which tags the threshold commit applies to. If both applicable_product_ids and
|
|
476
|
-
* applicable_product_tags are not provided, the commit applies to all products.
|
|
477
|
-
*/
|
|
478
|
-
applicable_product_tags?: Array<string>;
|
|
831
|
+
product_id: string;
|
|
479
832
|
description?: string;
|
|
480
833
|
/**
|
|
481
834
|
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
@@ -483,6 +836,62 @@ export declare namespace ContractWithoutAmendments {
|
|
|
483
836
|
*/
|
|
484
837
|
name?: string;
|
|
485
838
|
}
|
|
839
|
+
interface PaymentGateConfig {
|
|
840
|
+
/**
|
|
841
|
+
* Gate access to the commit balance based on successful collection of payment.
|
|
842
|
+
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
843
|
+
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
844
|
+
* wish to payment gate the commit balance.
|
|
845
|
+
*/
|
|
846
|
+
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
847
|
+
/**
|
|
848
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
849
|
+
*/
|
|
850
|
+
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
851
|
+
/**
|
|
852
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
853
|
+
*/
|
|
854
|
+
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
855
|
+
/**
|
|
856
|
+
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
857
|
+
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
858
|
+
* will default to NONE.
|
|
859
|
+
*/
|
|
860
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
861
|
+
}
|
|
862
|
+
namespace PaymentGateConfig {
|
|
863
|
+
/**
|
|
864
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
865
|
+
*/
|
|
866
|
+
interface PrecalculatedTaxConfig {
|
|
867
|
+
/**
|
|
868
|
+
* Amount of tax to be applied. This should be in the same currency and
|
|
869
|
+
* denomination as the commit's invoice schedule
|
|
870
|
+
*/
|
|
871
|
+
tax_amount: number;
|
|
872
|
+
/**
|
|
873
|
+
* Name of the tax to be applied. This may be used in an invoice line item
|
|
874
|
+
* description.
|
|
875
|
+
*/
|
|
876
|
+
tax_name?: string;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
880
|
+
*/
|
|
881
|
+
interface StripeConfig {
|
|
882
|
+
/**
|
|
883
|
+
* If left blank, will default to INVOICE
|
|
884
|
+
*/
|
|
885
|
+
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
886
|
+
/**
|
|
887
|
+
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
888
|
+
* your payment type.
|
|
889
|
+
*/
|
|
890
|
+
invoice_metadata?: {
|
|
891
|
+
[key: string]: string;
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
}
|
|
486
895
|
}
|
|
487
896
|
interface UsageFilter {
|
|
488
897
|
current: Shared.BaseUsageFilter | null;
|
|
@@ -520,13 +929,19 @@ export interface Credit {
|
|
|
520
929
|
*/
|
|
521
930
|
balance?: number;
|
|
522
931
|
contract?: Credit.Contract;
|
|
523
|
-
custom_fields?:
|
|
932
|
+
custom_fields?: {
|
|
933
|
+
[key: string]: string;
|
|
934
|
+
};
|
|
524
935
|
description?: string;
|
|
936
|
+
/**
|
|
937
|
+
* Optional configuration for credit hierarchy access control
|
|
938
|
+
*/
|
|
939
|
+
hierarchy_configuration?: Credit.HierarchyConfiguration;
|
|
525
940
|
/**
|
|
526
941
|
* A list of ordered events that impact the balance of a credit. For example, an
|
|
527
942
|
* invoice deduction or an expiration.
|
|
528
943
|
*/
|
|
529
|
-
ledger?: Array<Credit.CreditSegmentStartLedgerEntry | Credit.CreditAutomatedInvoiceDeductionLedgerEntry | Credit.CreditExpirationLedgerEntry | Credit.CreditCanceledLedgerEntry | Credit.CreditCreditedLedgerEntry | Credit.CreditManualLedgerEntry>;
|
|
944
|
+
ledger?: Array<Credit.CreditSegmentStartLedgerEntry | Credit.CreditAutomatedInvoiceDeductionLedgerEntry | Credit.CreditExpirationLedgerEntry | Credit.CreditCanceledLedgerEntry | Credit.CreditCreditedLedgerEntry | Credit.CreditManualLedgerEntry | Credit.CreditSeatBasedAdjustmentLedgerEntry>;
|
|
530
945
|
name?: string;
|
|
531
946
|
/**
|
|
532
947
|
* This field's availability is dependent on your client's configuration.
|
|
@@ -542,6 +957,12 @@ export interface Credit {
|
|
|
542
957
|
* This field's availability is dependent on your client's configuration.
|
|
543
958
|
*/
|
|
544
959
|
salesforce_opportunity_id?: string;
|
|
960
|
+
/**
|
|
961
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
962
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
963
|
+
* specifiers to contribute to a commit's or credit's drawdown.
|
|
964
|
+
*/
|
|
965
|
+
specifiers?: Array<Credit.Specifier>;
|
|
545
966
|
/**
|
|
546
967
|
* Prevents the creation of duplicates. If a request to create a commit or credit
|
|
547
968
|
* is made with a uniqueness key that was previously used to create a commit or
|
|
@@ -558,6 +979,24 @@ export declare namespace Credit {
|
|
|
558
979
|
interface Contract {
|
|
559
980
|
id: string;
|
|
560
981
|
}
|
|
982
|
+
/**
|
|
983
|
+
* Optional configuration for credit hierarchy access control
|
|
984
|
+
*/
|
|
985
|
+
interface HierarchyConfiguration {
|
|
986
|
+
child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
987
|
+
}
|
|
988
|
+
namespace HierarchyConfiguration {
|
|
989
|
+
interface CommitHierarchyChildAccessAll {
|
|
990
|
+
type: 'ALL';
|
|
991
|
+
}
|
|
992
|
+
interface CommitHierarchyChildAccessNone {
|
|
993
|
+
type: 'NONE';
|
|
994
|
+
}
|
|
995
|
+
interface CommitHierarchyChildAccessContractIDs {
|
|
996
|
+
contract_ids: Array<string>;
|
|
997
|
+
type: 'CONTRACT_IDS';
|
|
998
|
+
}
|
|
999
|
+
}
|
|
561
1000
|
interface CreditSegmentStartLedgerEntry {
|
|
562
1001
|
amount: number;
|
|
563
1002
|
segment_id: string;
|
|
@@ -570,6 +1009,7 @@ export declare namespace Credit {
|
|
|
570
1009
|
segment_id: string;
|
|
571
1010
|
timestamp: string;
|
|
572
1011
|
type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION';
|
|
1012
|
+
contract_id?: string;
|
|
573
1013
|
}
|
|
574
1014
|
interface CreditExpirationLedgerEntry {
|
|
575
1015
|
amount: number;
|
|
@@ -583,6 +1023,7 @@ export declare namespace Credit {
|
|
|
583
1023
|
segment_id: string;
|
|
584
1024
|
timestamp: string;
|
|
585
1025
|
type: 'CREDIT_CANCELED';
|
|
1026
|
+
contract_id?: string;
|
|
586
1027
|
}
|
|
587
1028
|
interface CreditCreditedLedgerEntry {
|
|
588
1029
|
amount: number;
|
|
@@ -590,6 +1031,7 @@ export declare namespace Credit {
|
|
|
590
1031
|
segment_id: string;
|
|
591
1032
|
timestamp: string;
|
|
592
1033
|
type: 'CREDIT_CREDITED';
|
|
1034
|
+
contract_id?: string;
|
|
593
1035
|
}
|
|
594
1036
|
interface CreditManualLedgerEntry {
|
|
595
1037
|
amount: number;
|
|
@@ -597,6 +1039,29 @@ export declare namespace Credit {
|
|
|
597
1039
|
timestamp: string;
|
|
598
1040
|
type: 'CREDIT_MANUAL';
|
|
599
1041
|
}
|
|
1042
|
+
interface CreditSeatBasedAdjustmentLedgerEntry {
|
|
1043
|
+
amount: number;
|
|
1044
|
+
segment_id: string;
|
|
1045
|
+
timestamp: string;
|
|
1046
|
+
type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
|
|
1047
|
+
}
|
|
1048
|
+
interface Specifier {
|
|
1049
|
+
presentation_group_values?: {
|
|
1050
|
+
[key: string]: string;
|
|
1051
|
+
};
|
|
1052
|
+
pricing_group_values?: {
|
|
1053
|
+
[key: string]: string;
|
|
1054
|
+
};
|
|
1055
|
+
/**
|
|
1056
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
1057
|
+
*/
|
|
1058
|
+
product_id?: string;
|
|
1059
|
+
/**
|
|
1060
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
1061
|
+
* tags.
|
|
1062
|
+
*/
|
|
1063
|
+
product_tags?: Array<string>;
|
|
1064
|
+
}
|
|
600
1065
|
}
|
|
601
1066
|
export interface CreditTypeData {
|
|
602
1067
|
id: string;
|
|
@@ -606,7 +1071,9 @@ export interface Discount {
|
|
|
606
1071
|
id: string;
|
|
607
1072
|
product: Discount.Product;
|
|
608
1073
|
schedule: SchedulePointInTime;
|
|
609
|
-
custom_fields?:
|
|
1074
|
+
custom_fields?: {
|
|
1075
|
+
[key: string]: string;
|
|
1076
|
+
};
|
|
610
1077
|
name?: string;
|
|
611
1078
|
/**
|
|
612
1079
|
* This field's availability is dependent on your client's configuration.
|
|
@@ -678,14 +1145,20 @@ export interface Override {
|
|
|
678
1145
|
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
679
1146
|
* processors.
|
|
680
1147
|
*/
|
|
681
|
-
value?:
|
|
1148
|
+
value?: {
|
|
1149
|
+
[key: string]: unknown;
|
|
1150
|
+
};
|
|
682
1151
|
}
|
|
683
1152
|
export declare namespace Override {
|
|
684
1153
|
interface OverrideSpecifier {
|
|
685
|
-
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
|
|
1154
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
686
1155
|
commit_ids?: Array<string>;
|
|
687
|
-
presentation_group_values?:
|
|
688
|
-
|
|
1156
|
+
presentation_group_values?: {
|
|
1157
|
+
[key: string]: string | null;
|
|
1158
|
+
};
|
|
1159
|
+
pricing_group_values?: {
|
|
1160
|
+
[key: string]: string;
|
|
1161
|
+
};
|
|
689
1162
|
product_id?: string;
|
|
690
1163
|
product_tags?: Array<string>;
|
|
691
1164
|
recurring_commit_ids?: Array<string>;
|
|
@@ -702,7 +1175,9 @@ export declare namespace Override {
|
|
|
702
1175
|
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
703
1176
|
* processors.
|
|
704
1177
|
*/
|
|
705
|
-
custom_rate?:
|
|
1178
|
+
custom_rate?: {
|
|
1179
|
+
[key: string]: unknown;
|
|
1180
|
+
};
|
|
706
1181
|
/**
|
|
707
1182
|
* Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
|
|
708
1183
|
* set to true.
|
|
@@ -771,7 +1246,9 @@ export interface ProService {
|
|
|
771
1246
|
* amount and must be specified.
|
|
772
1247
|
*/
|
|
773
1248
|
unit_price: number;
|
|
774
|
-
custom_fields?:
|
|
1249
|
+
custom_fields?: {
|
|
1250
|
+
[key: string]: string;
|
|
1251
|
+
};
|
|
775
1252
|
description?: string;
|
|
776
1253
|
/**
|
|
777
1254
|
* This field's availability is dependent on your client's configuration.
|
|
@@ -785,7 +1262,9 @@ export interface Rate {
|
|
|
785
1262
|
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
786
1263
|
* processors.
|
|
787
1264
|
*/
|
|
788
|
-
custom_rate?:
|
|
1265
|
+
custom_rate?: {
|
|
1266
|
+
[key: string]: unknown;
|
|
1267
|
+
};
|
|
789
1268
|
/**
|
|
790
1269
|
* Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
|
|
791
1270
|
* set to true.
|
|
@@ -800,7 +1279,9 @@ export interface Rate {
|
|
|
800
1279
|
* if pricing groups are used, this will contain the values used to calculate the
|
|
801
1280
|
* price
|
|
802
1281
|
*/
|
|
803
|
-
pricing_group_values?:
|
|
1282
|
+
pricing_group_values?: {
|
|
1283
|
+
[key: string]: string;
|
|
1284
|
+
};
|
|
804
1285
|
/**
|
|
805
1286
|
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
806
1287
|
*/
|
|
@@ -820,7 +1301,10 @@ export interface ScheduledCharge {
|
|
|
820
1301
|
id: string;
|
|
821
1302
|
product: ScheduledCharge.Product;
|
|
822
1303
|
schedule: SchedulePointInTime;
|
|
823
|
-
|
|
1304
|
+
archived_at?: string;
|
|
1305
|
+
custom_fields?: {
|
|
1306
|
+
[key: string]: string;
|
|
1307
|
+
};
|
|
824
1308
|
/**
|
|
825
1309
|
* displayed on invoices
|
|
826
1310
|
*/
|
|
@@ -856,10 +1340,10 @@ export declare namespace SchedulePointInTime {
|
|
|
856
1340
|
interface ScheduleItem {
|
|
857
1341
|
id: string;
|
|
858
1342
|
amount: number;
|
|
859
|
-
invoice_id: string;
|
|
860
1343
|
quantity: number;
|
|
861
1344
|
timestamp: string;
|
|
862
1345
|
unit_price: number;
|
|
1346
|
+
invoice_id?: string | null;
|
|
863
1347
|
}
|
|
864
1348
|
}
|
|
865
1349
|
export interface Tier {
|