@metronome/sdk 2.2.0 → 3.4.1
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 +188 -0
- package/LICENSE +1 -1
- package/README.md +26 -4
- package/client.d.mts +5 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -3
- package/client.d.ts.map +1 -1
- package/client.js +26 -10
- package/client.js.map +1 -1
- package/client.mjs +26 -10
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +12 -1
- package/resources/shared.d.mts +111 -30
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +111 -30
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +3 -0
- package/resources/v1/alerts.d.mts.map +1 -1
- package/resources/v1/alerts.d.ts +3 -0
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +3 -0
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +3 -0
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.mts +3 -0
- package/resources/v1/audit-logs.d.mts.map +1 -1
- package/resources/v1/audit-logs.d.ts +3 -0
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js +3 -0
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs +3 -0
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.mts +3 -0
- package/resources/v1/billable-metrics.d.mts.map +1 -1
- package/resources/v1/billable-metrics.d.ts +3 -0
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +3 -0
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +3 -0
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +134 -14
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +134 -14
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +69 -0
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +69 -0
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.mts +1 -1
- package/resources/v1/contracts/index.d.mts.map +1 -1
- package/resources/v1/contracts/index.d.ts +1 -1
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/named-schedules.d.mts +3 -0
- package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
- package/resources/v1/contracts/named-schedules.d.ts +3 -0
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +3 -0
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +3 -0
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.mts +3 -0
- package/resources/v1/contracts/products.d.mts.map +1 -1
- package/resources/v1/contracts/products.d.ts +3 -0
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +3 -0
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +3 -0
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts +3 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +3 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +3 -0
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -0
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.mts +3 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +3 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +3 -0
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +3 -0
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts +4 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +4 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +3 -0
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +3 -0
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.mts +6 -21
- package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.ts +6 -21
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +3 -0
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +3 -0
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/credit-grants.d.mts +3 -0
- package/resources/v1/credit-grants.d.mts.map +1 -1
- package/resources/v1/credit-grants.d.ts +3 -0
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +3 -0
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +3 -0
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.mts +9 -6
- package/resources/v1/custom-fields.d.mts.map +1 -1
- package/resources/v1/custom-fields.d.ts +9 -6
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +3 -0
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +3 -0
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.mts +3 -0
- package/resources/v1/customers/alerts.d.mts.map +1 -1
- package/resources/v1/customers/alerts.d.ts +3 -0
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +3 -0
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +3 -0
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.mts +8 -5
- package/resources/v1/customers/billing-config.d.mts.map +1 -1
- package/resources/v1/customers/billing-config.d.ts +8 -5
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +3 -0
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +3 -0
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.mts +3 -0
- package/resources/v1/customers/commits.d.mts.map +1 -1
- package/resources/v1/customers/commits.d.ts +3 -0
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +3 -0
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +3 -0
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.mts +3 -0
- package/resources/v1/customers/credits.d.mts.map +1 -1
- package/resources/v1/customers/credits.d.ts +3 -0
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +3 -0
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +3 -0
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +84 -8
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +84 -8
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +53 -0
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +53 -0
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +1 -1
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.mts +38 -19
- package/resources/v1/customers/invoices.d.mts.map +1 -1
- package/resources/v1/customers/invoices.d.ts +38 -19
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +3 -0
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +3 -0
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.mts +3 -0
- package/resources/v1/customers/named-schedules.d.mts.map +1 -1
- package/resources/v1/customers/named-schedules.d.ts +3 -0
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +3 -0
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +3 -0
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.mts +8 -5
- package/resources/v1/customers/plans.d.mts.map +1 -1
- package/resources/v1/customers/plans.d.ts +8 -5
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +3 -0
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +3 -0
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/dashboards.d.mts +3 -0
- package/resources/v1/dashboards.d.mts.map +1 -1
- package/resources/v1/dashboards.d.ts +3 -0
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +3 -0
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +3 -0
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.mts +3 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +3 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.mts +3 -0
- package/resources/v1/invoices.d.mts.map +1 -1
- package/resources/v1/invoices.d.ts +3 -0
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +3 -0
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +3 -0
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/packages.d.mts +2352 -0
- package/resources/v1/packages.d.mts.map +1 -0
- package/resources/v1/packages.d.ts +2352 -0
- package/resources/v1/packages.d.ts.map +1 -0
- package/resources/v1/packages.js +160 -0
- package/resources/v1/packages.js.map +1 -0
- package/resources/v1/packages.mjs +156 -0
- package/resources/v1/packages.mjs.map +1 -0
- package/resources/v1/payments.d.mts +10 -0
- package/resources/v1/payments.d.mts.map +1 -1
- package/resources/v1/payments.d.ts +10 -0
- package/resources/v1/payments.d.ts.map +1 -1
- package/resources/v1/plans.d.mts +5 -2
- package/resources/v1/plans.d.mts.map +1 -1
- package/resources/v1/plans.d.ts +5 -2
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +3 -0
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +3 -0
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.mts +3 -0
- package/resources/v1/pricing-units.d.mts.map +1 -1
- package/resources/v1/pricing-units.d.ts +3 -0
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js +3 -0
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs +3 -0
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.mts +3 -0
- package/resources/v1/services.d.mts.map +1 -1
- package/resources/v1/services.d.ts +3 -0
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +3 -0
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +3 -0
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/settings/billing-providers.d.mts +3 -0
- package/resources/v1/settings/billing-providers.d.mts.map +1 -1
- package/resources/v1/settings/billing-providers.d.ts +3 -0
- package/resources/v1/settings/billing-providers.d.ts.map +1 -1
- package/resources/v1/settings/billing-providers.js +3 -0
- package/resources/v1/settings/billing-providers.js.map +1 -1
- package/resources/v1/settings/billing-providers.mjs +3 -0
- package/resources/v1/settings/billing-providers.mjs.map +1 -1
- package/resources/v1/settings/settings.d.mts +3 -0
- package/resources/v1/settings/settings.d.mts.map +1 -1
- package/resources/v1/settings/settings.d.ts +3 -0
- package/resources/v1/settings/settings.d.ts.map +1 -1
- package/resources/v1/settings/settings.js +3 -0
- package/resources/v1/settings/settings.js.map +1 -1
- package/resources/v1/settings/settings.mjs +3 -0
- package/resources/v1/settings/settings.mjs.map +1 -1
- package/resources/v1/usage.d.mts +87 -18
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +87 -18
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +37 -11
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +37 -11
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +8 -4
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +8 -4
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.mts +45 -7
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +45 -7
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +1 -4
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +1 -4
- package/resources/v2/contracts.mjs.map +1 -1
- package/src/client.ts +37 -15
- package/src/internal/parse.ts +6 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/shared.ts +127 -32
- package/src/resources/v1/alerts.ts +3 -0
- package/src/resources/v1/audit-logs.ts +3 -0
- package/src/resources/v1/billable-metrics.ts +3 -0
- package/src/resources/v1/contracts/contracts.ts +151 -13
- package/src/resources/v1/contracts/index.ts +2 -0
- package/src/resources/v1/contracts/named-schedules.ts +3 -0
- package/src/resources/v1/contracts/products.ts +3 -0
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +3 -0
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +3 -0
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +4 -1
- package/src/resources/v1/contracts/rate-cards/rates.ts +6 -24
- package/src/resources/v1/credit-grants.ts +3 -0
- package/src/resources/v1/custom-fields.ts +32 -5
- package/src/resources/v1/customers/alerts.ts +3 -0
- package/src/resources/v1/customers/billing-config.ts +8 -5
- package/src/resources/v1/customers/commits.ts +3 -0
- package/src/resources/v1/customers/credits.ts +3 -0
- package/src/resources/v1/customers/customers.ts +96 -7
- package/src/resources/v1/customers/index.ts +2 -0
- package/src/resources/v1/customers/invoices.ts +45 -19
- package/src/resources/v1/customers/named-schedules.ts +3 -0
- package/src/resources/v1/customers/plans.ts +8 -5
- package/src/resources/v1/dashboards.ts +3 -0
- package/src/resources/v1/index.ts +19 -0
- package/src/resources/v1/invoices.ts +3 -0
- package/src/resources/v1/packages.ts +3057 -0
- package/src/resources/v1/payments.ts +15 -0
- package/src/resources/v1/plans.ts +5 -2
- package/src/resources/v1/pricing-units.ts +3 -0
- package/src/resources/v1/services.ts +3 -0
- package/src/resources/v1/settings/billing-providers.ts +3 -0
- package/src/resources/v1/settings/settings.ts +3 -0
- package/src/resources/v1/usage.ts +86 -18
- package/src/resources/v1/v1.ts +42 -0
- package/src/resources/v2/contracts.ts +55 -7
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/shared.ts
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
import * as Shared from './shared';
|
|
4
4
|
import { BodyCursorPage } from '../core/pagination';
|
|
5
5
|
|
|
6
|
+
export interface BalanceFilter {
|
|
7
|
+
/**
|
|
8
|
+
* The balance type to filter by.
|
|
9
|
+
*/
|
|
10
|
+
balance_types?: Array<'PREPAID_COMMIT' | 'POSTPAID_COMMIT' | 'CREDIT'>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Custom fields to compute balance across. Must match all custom fields
|
|
14
|
+
*/
|
|
15
|
+
custom_fields?: { [key: string]: string };
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Specific IDs to compute balance across.
|
|
19
|
+
*/
|
|
20
|
+
ids?: Array<string>;
|
|
21
|
+
}
|
|
22
|
+
|
|
6
23
|
export interface BaseThresholdCommit {
|
|
7
24
|
/**
|
|
8
25
|
* The commit product that will be used to generate the line item for commit
|
|
@@ -138,6 +155,12 @@ export interface Commit {
|
|
|
138
155
|
|
|
139
156
|
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
140
157
|
|
|
158
|
+
/**
|
|
159
|
+
* The ID of the recurring commit that this commit was generated from, if
|
|
160
|
+
* applicable.
|
|
161
|
+
*/
|
|
162
|
+
recurring_commit_id?: string;
|
|
163
|
+
|
|
141
164
|
rolled_over_from?: Commit.RolledOverFrom;
|
|
142
165
|
|
|
143
166
|
rollover_fraction?: number;
|
|
@@ -154,6 +177,12 @@ export interface Commit {
|
|
|
154
177
|
*/
|
|
155
178
|
specifiers?: Array<CommitSpecifier>;
|
|
156
179
|
|
|
180
|
+
/**
|
|
181
|
+
* The subscription configuration for this commit, if it was generated from a
|
|
182
|
+
* recurring commit with a subscription attached.
|
|
183
|
+
*/
|
|
184
|
+
subscription_config?: Commit.SubscriptionConfig;
|
|
185
|
+
|
|
157
186
|
/**
|
|
158
187
|
* Prevents the creation of duplicates. If a request to create a commit or credit
|
|
159
188
|
* is made with a uniqueness key that was previously used to create a commit or
|
|
@@ -344,6 +373,27 @@ export namespace Commit {
|
|
|
344
373
|
|
|
345
374
|
contract_id: string;
|
|
346
375
|
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* The subscription configuration for this commit, if it was generated from a
|
|
379
|
+
* recurring commit with a subscription attached.
|
|
380
|
+
*/
|
|
381
|
+
export interface SubscriptionConfig {
|
|
382
|
+
allocation?: 'INDIVIDUAL' | 'POOLED';
|
|
383
|
+
|
|
384
|
+
apply_seat_increase_config?: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
385
|
+
|
|
386
|
+
subscription_id?: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export namespace SubscriptionConfig {
|
|
390
|
+
export interface ApplySeatIncreaseConfig {
|
|
391
|
+
/**
|
|
392
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
393
|
+
*/
|
|
394
|
+
is_prorated: boolean;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
347
397
|
}
|
|
348
398
|
|
|
349
399
|
export interface CommitHierarchyConfiguration {
|
|
@@ -374,10 +424,12 @@ export namespace CommitHierarchyConfiguration {
|
|
|
374
424
|
* list rate when consuming a credit or commit.
|
|
375
425
|
*/
|
|
376
426
|
export interface CommitRate {
|
|
377
|
-
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
427
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
|
|
378
428
|
|
|
379
429
|
/**
|
|
380
|
-
* Commit rate price. For FLAT rate_type, this must be >=0.
|
|
430
|
+
* Commit rate price. For FLAT rate_type, this must be >=0. For PERCENTAGE
|
|
431
|
+
* rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0
|
|
432
|
+
* and <=1.
|
|
381
433
|
*/
|
|
382
434
|
price?: number;
|
|
383
435
|
|
|
@@ -405,8 +457,16 @@ export interface CommitSpecifier {
|
|
|
405
457
|
}
|
|
406
458
|
|
|
407
459
|
export interface CommitSpecifierInput {
|
|
460
|
+
/**
|
|
461
|
+
* If provided, the specifier will apply to product usage with these set of
|
|
462
|
+
* presentation group values.
|
|
463
|
+
*/
|
|
408
464
|
presentation_group_values?: { [key: string]: string };
|
|
409
465
|
|
|
466
|
+
/**
|
|
467
|
+
* If provided, the specifier will apply to product usage with these set of pricing
|
|
468
|
+
* group values.
|
|
469
|
+
*/
|
|
410
470
|
pricing_group_values?: { [key: string]: string };
|
|
411
471
|
|
|
412
472
|
/**
|
|
@@ -448,12 +508,12 @@ export interface Contract {
|
|
|
448
508
|
*/
|
|
449
509
|
customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
|
|
450
510
|
|
|
451
|
-
prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
|
|
452
|
-
|
|
453
511
|
/**
|
|
454
|
-
*
|
|
512
|
+
* ID of the package this contract was created from, if applicable.
|
|
455
513
|
*/
|
|
456
|
-
|
|
514
|
+
package_id?: string;
|
|
515
|
+
|
|
516
|
+
prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
|
|
457
517
|
|
|
458
518
|
/**
|
|
459
519
|
* Determines which scheduled and commit charges to consolidate onto the Contract's
|
|
@@ -808,6 +868,11 @@ export namespace ContractV2 {
|
|
|
808
868
|
|
|
809
869
|
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
810
870
|
|
|
871
|
+
/**
|
|
872
|
+
* The ID of the recurring commit that created this commit
|
|
873
|
+
*/
|
|
874
|
+
recurring_commit_id?: string;
|
|
875
|
+
|
|
811
876
|
rolled_over_from?: Commit.RolledOverFrom;
|
|
812
877
|
|
|
813
878
|
rollover_fraction?: number;
|
|
@@ -1063,7 +1128,7 @@ export namespace ContractV2 {
|
|
|
1063
1128
|
}
|
|
1064
1129
|
|
|
1065
1130
|
export interface OverwriteRate {
|
|
1066
|
-
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
1131
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
|
|
1067
1132
|
|
|
1068
1133
|
credit_type?: Shared.CreditTypeData;
|
|
1069
1134
|
|
|
@@ -1217,6 +1282,11 @@ export namespace ContractV2 {
|
|
|
1217
1282
|
*/
|
|
1218
1283
|
priority?: number;
|
|
1219
1284
|
|
|
1285
|
+
/**
|
|
1286
|
+
* The ID of the recurring credit that created this credit
|
|
1287
|
+
*/
|
|
1288
|
+
recurring_credit_id?: string;
|
|
1289
|
+
|
|
1220
1290
|
/**
|
|
1221
1291
|
* This field's availability is dependent on your client's configuration.
|
|
1222
1292
|
*/
|
|
@@ -1390,8 +1460,8 @@ export namespace ContractV2 {
|
|
|
1390
1460
|
|
|
1391
1461
|
export interface ParentBehavior {
|
|
1392
1462
|
/**
|
|
1393
|
-
*
|
|
1394
|
-
*
|
|
1463
|
+
* Indicates the desired behavior of consolidated invoices generated by the parent
|
|
1464
|
+
* in a customer hierarchy
|
|
1395
1465
|
*
|
|
1396
1466
|
* **CONCATENATE**: Statements on the invoices of child customers will be appended
|
|
1397
1467
|
* to the consolidated invoice
|
|
@@ -1409,15 +1479,15 @@ export namespace ContractV2 {
|
|
|
1409
1479
|
parent: ChildHierarchyConfigurationV2.Parent;
|
|
1410
1480
|
|
|
1411
1481
|
/**
|
|
1412
|
-
*
|
|
1413
|
-
*
|
|
1414
|
-
*
|
|
1482
|
+
* Indicates which customer should pay for the child's invoice charges **SELF**:
|
|
1483
|
+
* The child pays for its own invoice charges **PARENT**: The parent pays for the
|
|
1484
|
+
* child's invoice charges
|
|
1415
1485
|
*/
|
|
1416
1486
|
payer?: 'SELF' | 'PARENT';
|
|
1417
1487
|
|
|
1418
1488
|
/**
|
|
1419
|
-
*
|
|
1420
|
-
*
|
|
1489
|
+
* Indicates the behavior of the child's invoice statements on the parent's
|
|
1490
|
+
* invoices.
|
|
1421
1491
|
*
|
|
1422
1492
|
* **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
1423
1493
|
* consolidated invoices
|
|
@@ -2265,6 +2335,12 @@ export interface Credit {
|
|
|
2265
2335
|
|
|
2266
2336
|
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
2267
2337
|
|
|
2338
|
+
/**
|
|
2339
|
+
* The ID of the recurring credit that this credit was generated from, if
|
|
2340
|
+
* applicable.
|
|
2341
|
+
*/
|
|
2342
|
+
recurring_credit_id?: string;
|
|
2343
|
+
|
|
2268
2344
|
/**
|
|
2269
2345
|
* This field's availability is dependent on your client's configuration.
|
|
2270
2346
|
*/
|
|
@@ -2277,6 +2353,12 @@ export interface Credit {
|
|
|
2277
2353
|
*/
|
|
2278
2354
|
specifiers?: Array<CommitSpecifier>;
|
|
2279
2355
|
|
|
2356
|
+
/**
|
|
2357
|
+
* The subscription configuration for this credit, if it was generated from a
|
|
2358
|
+
* recurring credit with a subscription attached.
|
|
2359
|
+
*/
|
|
2360
|
+
subscription_config?: Credit.SubscriptionConfig;
|
|
2361
|
+
|
|
2280
2362
|
/**
|
|
2281
2363
|
* Prevents the creation of duplicates. If a request to create a commit or credit
|
|
2282
2364
|
* is made with a uniqueness key that was previously used to create a commit or
|
|
@@ -2378,6 +2460,27 @@ export namespace Credit {
|
|
|
2378
2460
|
|
|
2379
2461
|
type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
|
|
2380
2462
|
}
|
|
2463
|
+
|
|
2464
|
+
/**
|
|
2465
|
+
* The subscription configuration for this credit, if it was generated from a
|
|
2466
|
+
* recurring credit with a subscription attached.
|
|
2467
|
+
*/
|
|
2468
|
+
export interface SubscriptionConfig {
|
|
2469
|
+
allocation?: 'INDIVIDUAL' | 'POOLED';
|
|
2470
|
+
|
|
2471
|
+
apply_seat_increase_config?: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
2472
|
+
|
|
2473
|
+
subscription_id?: string;
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
export namespace SubscriptionConfig {
|
|
2477
|
+
export interface ApplySeatIncreaseConfig {
|
|
2478
|
+
/**
|
|
2479
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
2480
|
+
*/
|
|
2481
|
+
is_prorated: boolean;
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2381
2484
|
}
|
|
2382
2485
|
|
|
2383
2486
|
export interface CreditTypeData {
|
|
@@ -2460,8 +2563,8 @@ export namespace HierarchyConfiguration {
|
|
|
2460
2563
|
|
|
2461
2564
|
export interface ParentBehavior {
|
|
2462
2565
|
/**
|
|
2463
|
-
*
|
|
2464
|
-
*
|
|
2566
|
+
* Indicates the desired behavior of consolidated invoices generated by the parent
|
|
2567
|
+
* in a customer hierarchy
|
|
2465
2568
|
*
|
|
2466
2569
|
* **CONCATENATE**: Statements on the invoices of child customers will be appended
|
|
2467
2570
|
* to the consolidated invoice
|
|
@@ -2479,8 +2582,7 @@ export namespace HierarchyConfiguration {
|
|
|
2479
2582
|
parent: ChildHierarchyConfiguration.Parent;
|
|
2480
2583
|
|
|
2481
2584
|
/**
|
|
2482
|
-
*
|
|
2483
|
-
* invoice charges
|
|
2585
|
+
* Indicates which customer should pay for the child's invoice charges
|
|
2484
2586
|
*
|
|
2485
2587
|
* **SELF**: The child pays for its own invoice charges
|
|
2486
2588
|
*
|
|
@@ -2489,8 +2591,8 @@ export namespace HierarchyConfiguration {
|
|
|
2489
2591
|
payer?: 'SELF' | 'PARENT';
|
|
2490
2592
|
|
|
2491
2593
|
/**
|
|
2492
|
-
*
|
|
2493
|
-
*
|
|
2594
|
+
* Indicates the behavior of the child's invoice statements on the parent's
|
|
2595
|
+
* invoices.
|
|
2494
2596
|
*
|
|
2495
2597
|
* **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
2496
2598
|
* consolidated invoices
|
|
@@ -2561,7 +2663,7 @@ export interface Override {
|
|
|
2561
2663
|
*/
|
|
2562
2664
|
quantity?: number;
|
|
2563
2665
|
|
|
2564
|
-
rate_type?: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
2666
|
+
rate_type?: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
|
|
2565
2667
|
|
|
2566
2668
|
target?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
2567
2669
|
|
|
@@ -2612,7 +2714,7 @@ export interface OverrideTier {
|
|
|
2612
2714
|
}
|
|
2613
2715
|
|
|
2614
2716
|
export interface OverwriteRate {
|
|
2615
|
-
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
2717
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
|
|
2616
2718
|
|
|
2617
2719
|
credit_type?: CreditTypeData;
|
|
2618
2720
|
|
|
@@ -2669,7 +2771,7 @@ export interface PaymentGateConfig {
|
|
|
2669
2771
|
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
2670
2772
|
* will default to NONE.
|
|
2671
2773
|
*/
|
|
2672
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | '
|
|
2774
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
2673
2775
|
}
|
|
2674
2776
|
|
|
2675
2777
|
export namespace PaymentGateConfig {
|
|
@@ -2731,7 +2833,7 @@ export interface PaymentGateConfigV2 {
|
|
|
2731
2833
|
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
2732
2834
|
* will default to NONE.
|
|
2733
2835
|
*/
|
|
2734
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | '
|
|
2836
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
2735
2837
|
}
|
|
2736
2838
|
|
|
2737
2839
|
export namespace PaymentGateConfigV2 {
|
|
@@ -2950,7 +3052,7 @@ export interface ProService {
|
|
|
2950
3052
|
}
|
|
2951
3053
|
|
|
2952
3054
|
export interface Rate {
|
|
2953
|
-
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'CUSTOM' | 'TIERED';
|
|
3055
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'CUSTOM' | 'TIERED' | 'TIERED_PERCENTAGE';
|
|
2954
3056
|
|
|
2955
3057
|
credit_type?: CreditTypeData;
|
|
2956
3058
|
|
|
@@ -2987,13 +3089,6 @@ export interface Rate {
|
|
|
2987
3089
|
* Only set for TIERED rate_type.
|
|
2988
3090
|
*/
|
|
2989
3091
|
tiers?: Array<Tier>;
|
|
2990
|
-
|
|
2991
|
-
/**
|
|
2992
|
-
* Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed
|
|
2993
|
-
* using list prices rather than the standard rates for this product on the
|
|
2994
|
-
* contract.
|
|
2995
|
-
*/
|
|
2996
|
-
use_list_prices?: boolean;
|
|
2997
3092
|
}
|
|
2998
3093
|
|
|
2999
3094
|
export interface RecurringCommitSubscriptionConfig {
|
|
@@ -5,6 +5,9 @@ import * as Shared from '../shared';
|
|
|
5
5
|
import { APIPromise } from '../../core/api-promise';
|
|
6
6
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* [Alerts](https://docs.metronome.com/connecting-metronome/alerts/) monitor customer spending, balances, and other billing factors. Use these endpoints to create, retrieve, and archive customer alerts. To view sample alert payloads by alert type, navigate [here.](https://docs.metronome.com/manage-product-access/create-manage-alerts/#webhook-notifications)
|
|
10
|
+
*/
|
|
8
11
|
export class Alerts extends APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* Create a new threshold notification to monitor customer spending, balances, and
|
|
@@ -4,6 +4,9 @@ import { APIResource } from '../../core/resource';
|
|
|
4
4
|
import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagination';
|
|
5
5
|
import { RequestOptions } from '../../internal/request-options';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* [Security](https://docs.metronome.com/developer-resources/security/) endpoints allow you to retrieve security-related data.
|
|
9
|
+
*/
|
|
7
10
|
export class AuditLogs extends APIResource {
|
|
8
11
|
/**
|
|
9
12
|
* Get a comprehensive audit trail of all operations performed in your Metronome
|
|
@@ -7,6 +7,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagin
|
|
|
7
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
8
|
import { path } from '../../internal/utils/path';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* [Billable metrics](https://docs.metronome.com/understanding-metronome/how-metronome-works#billable-metrics) in Metronome represent the various consumption components that Metronome meters and aggregates.
|
|
12
|
+
*/
|
|
10
13
|
export class BillableMetrics extends APIResource {
|
|
11
14
|
/**
|
|
12
15
|
* Create billable metrics programmatically with this endpoint—an essential step in
|
|
@@ -374,6 +374,79 @@ export class Contracts extends APIResource {
|
|
|
374
374
|
return this._client.post('/v1/contracts/createHistoricalInvoices', { body, ...options });
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
+
/**
|
|
378
|
+
* Retrieve the combined current balance across any grouping of credits and commits
|
|
379
|
+
* for a customer in a single API call.
|
|
380
|
+
*
|
|
381
|
+
* - Display real-time available balance to customers in billing dashboards
|
|
382
|
+
* - Build finance dashboards showing credit utilization across customer segments
|
|
383
|
+
* - Validate expected vs. actual balance during billing reconciliation
|
|
384
|
+
*
|
|
385
|
+
* ### Key response fields:
|
|
386
|
+
*
|
|
387
|
+
* - `balance`: The combined net balance available to use at this moment across all
|
|
388
|
+
* matching commits and credits
|
|
389
|
+
* - `credit_type_id`: The credit type (fiat or custom pricing unit) the balance is
|
|
390
|
+
* denominated in
|
|
391
|
+
*
|
|
392
|
+
* ### Filtering options:
|
|
393
|
+
*
|
|
394
|
+
* Balance filters allow you to scope the calculation to specific subsets of
|
|
395
|
+
* commits and credits. When using multiple filter objects, they are OR'd together
|
|
396
|
+
* — if a commit or credit matches any filter, it's included in the net balance.
|
|
397
|
+
* Within a single filter object, all specified conditions are AND'd together.
|
|
398
|
+
*
|
|
399
|
+
* - **Balance types**: Include any combination of `PREPAID_COMMIT`,
|
|
400
|
+
* `POSTPAID_COMMIT`, and `CREDIT` (e.g., `["PREPAID_COMMIT", "CREDIT"]` to
|
|
401
|
+
* exclude postpaid commits). If not specified, all balance types are included.
|
|
402
|
+
* - **Specific IDs**: Target exact commit or credit IDs for precise balance
|
|
403
|
+
* queries
|
|
404
|
+
* - **Custom fields**: Filter by custom field key-value pairs; when multiple pairs
|
|
405
|
+
* are provided, commits must match all of them
|
|
406
|
+
*
|
|
407
|
+
* **Example**: To get the balance of all free-trial credits OR all
|
|
408
|
+
* signup-promotion commits, you'd pass two filter objects — one filtering for
|
|
409
|
+
* CREDIT with custom field campaign: free-trial, and another filtering for
|
|
410
|
+
* PREPAID_COMMIT with custom field campaign: signup-promotion.
|
|
411
|
+
*
|
|
412
|
+
* ### Usage guidelines:
|
|
413
|
+
*
|
|
414
|
+
* - **Draft invoice handling**: Use `invoice_inclusion_mode` to control whether
|
|
415
|
+
* pending draft invoice deductions are included (`FINALIZED_AND_DRAFT`, the
|
|
416
|
+
* default) or excluded (`FINALIZED`) from the balance calculation
|
|
417
|
+
* - **Account hierarchies**: When querying a child customer, shared commits from
|
|
418
|
+
* parent contracts are not included — query the parent customer directly to see
|
|
419
|
+
* shared commit balances
|
|
420
|
+
* - **Negative balances**: Manual ledger entries can cause negative segment
|
|
421
|
+
* balances; these are treated as zero when calculating the net balance
|
|
422
|
+
* - **Credit types**: If `credit_type_id` is not specified, the balance defaults
|
|
423
|
+
* to USD (cents)
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* ```ts
|
|
427
|
+
* const response = await client.v1.contracts.getNetBalance({
|
|
428
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
429
|
+
* credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
430
|
+
* filters: [
|
|
431
|
+
* {
|
|
432
|
+
* balance_types: ['CREDIT'],
|
|
433
|
+
* custom_fields: { campaign: 'free-trial' },
|
|
434
|
+
* },
|
|
435
|
+
* {
|
|
436
|
+
* balance_types: ['PREPAID_COMMIT', 'POSTPAID_COMMIT'],
|
|
437
|
+
* custom_fields: { campaign: 'signup-promotion' },
|
|
438
|
+
* },
|
|
439
|
+
* ],
|
|
440
|
+
* });
|
|
441
|
+
* ```
|
|
442
|
+
*/
|
|
443
|
+
getNetBalance(
|
|
444
|
+
body: ContractGetNetBalanceParams,
|
|
445
|
+
options?: RequestOptions,
|
|
446
|
+
): APIPromise<ContractGetNetBalanceResponse> {
|
|
447
|
+
return this._client.post('/v1/contracts/customerBalances/getNetBalance', { body, ...options });
|
|
448
|
+
}
|
|
449
|
+
|
|
377
450
|
/**
|
|
378
451
|
* Retrieve a comprehensive view of all available balances (commits and credits)
|
|
379
452
|
* for a customer. This endpoint provides real-time visibility into prepaid funds,
|
|
@@ -624,6 +697,26 @@ export interface ContractCreateHistoricalInvoicesResponse {
|
|
|
624
697
|
data: Array<InvoicesAPI.Invoice>;
|
|
625
698
|
}
|
|
626
699
|
|
|
700
|
+
export interface ContractGetNetBalanceResponse {
|
|
701
|
+
data: ContractGetNetBalanceResponse.Data;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
export namespace ContractGetNetBalanceResponse {
|
|
705
|
+
export interface Data {
|
|
706
|
+
/**
|
|
707
|
+
* The combined net balance that the customer has access to use at this moment
|
|
708
|
+
* across all pertinent commits and credits.
|
|
709
|
+
*/
|
|
710
|
+
balance: number;
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* The ID of the credit type (can be fiat or a custom pricing unit) that the
|
|
714
|
+
* balance is for.
|
|
715
|
+
*/
|
|
716
|
+
credit_type_id: string;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
627
720
|
export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
|
|
628
721
|
|
|
629
722
|
export interface ContractRetrieveRateScheduleResponse {
|
|
@@ -763,12 +856,20 @@ export interface ContractCreateParams {
|
|
|
763
856
|
|
|
764
857
|
overrides?: Array<ContractCreateParams.Override>;
|
|
765
858
|
|
|
766
|
-
|
|
859
|
+
/**
|
|
860
|
+
* Selects the package linked to the specified alias as of the contract's start
|
|
861
|
+
* date. Mutually exclusive with package_id.
|
|
862
|
+
*/
|
|
863
|
+
package_alias?: string;
|
|
767
864
|
|
|
768
865
|
/**
|
|
769
|
-
*
|
|
866
|
+
* If provided, provisions a customer on a package instead of creating a
|
|
867
|
+
* traditional contract. When specified, only customer_id, starting_at, package_id,
|
|
868
|
+
* and uniqueness_key are allowed.
|
|
770
869
|
*/
|
|
771
|
-
|
|
870
|
+
package_id?: string;
|
|
871
|
+
|
|
872
|
+
prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
|
|
772
873
|
|
|
773
874
|
/**
|
|
774
875
|
* This field's availability is dependent on your client's configuration.
|
|
@@ -1124,7 +1225,7 @@ export namespace ContractCreateParams {
|
|
|
1124
1225
|
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
1125
1226
|
* will default to NONE.
|
|
1126
1227
|
*/
|
|
1127
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | '
|
|
1228
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
1128
1229
|
}
|
|
1129
1230
|
|
|
1130
1231
|
export namespace PaymentGateConfig {
|
|
@@ -1228,6 +1329,11 @@ export namespace ContractCreateParams {
|
|
|
1228
1329
|
|
|
1229
1330
|
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
1230
1331
|
|
|
1332
|
+
/**
|
|
1333
|
+
* Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
1334
|
+
*/
|
|
1335
|
+
rollover_fraction?: number;
|
|
1336
|
+
|
|
1231
1337
|
/**
|
|
1232
1338
|
* List of filters that determine what kind of customer usage draws down a commit
|
|
1233
1339
|
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
@@ -1399,8 +1505,7 @@ export namespace ContractCreateParams {
|
|
|
1399
1505
|
parent_behavior?: HierarchyConfiguration.ParentBehavior;
|
|
1400
1506
|
|
|
1401
1507
|
/**
|
|
1402
|
-
*
|
|
1403
|
-
* invoice charges
|
|
1508
|
+
* Indicates which customer should pay for the child's invoice charges
|
|
1404
1509
|
*
|
|
1405
1510
|
* **SELF**: The child pays for its own invoice charges
|
|
1406
1511
|
*
|
|
@@ -1409,8 +1514,8 @@ export namespace ContractCreateParams {
|
|
|
1409
1514
|
payer?: 'SELF' | 'PARENT';
|
|
1410
1515
|
|
|
1411
1516
|
/**
|
|
1412
|
-
*
|
|
1413
|
-
*
|
|
1517
|
+
* Indicates the behavior of the child's invoice statements on the parent's
|
|
1518
|
+
* invoices.
|
|
1414
1519
|
*
|
|
1415
1520
|
* **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
1416
1521
|
* consolidated invoices
|
|
@@ -1430,8 +1535,8 @@ export namespace ContractCreateParams {
|
|
|
1430
1535
|
|
|
1431
1536
|
export interface ParentBehavior {
|
|
1432
1537
|
/**
|
|
1433
|
-
*
|
|
1434
|
-
*
|
|
1538
|
+
* Indicates the desired behavior of consolidated invoices generated by the parent
|
|
1539
|
+
* in a customer hierarchy
|
|
1435
1540
|
*
|
|
1436
1541
|
* **CONCATENATE**: Statements on the invoices of child customers will be appended
|
|
1437
1542
|
* to the consolidated invoice
|
|
@@ -1573,7 +1678,7 @@ export namespace ContractCreateParams {
|
|
|
1573
1678
|
* Required for OVERWRITE type.
|
|
1574
1679
|
*/
|
|
1575
1680
|
export interface OverwriteRate {
|
|
1576
|
-
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
1681
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
|
|
1577
1682
|
|
|
1578
1683
|
credit_type_id?: string;
|
|
1579
1684
|
|
|
@@ -2754,7 +2859,7 @@ export namespace ContractAmendParams {
|
|
|
2754
2859
|
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
2755
2860
|
* will default to NONE.
|
|
2756
2861
|
*/
|
|
2757
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | '
|
|
2862
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
2758
2863
|
}
|
|
2759
2864
|
|
|
2760
2865
|
export namespace PaymentGateConfig {
|
|
@@ -2858,6 +2963,11 @@ export namespace ContractAmendParams {
|
|
|
2858
2963
|
|
|
2859
2964
|
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
2860
2965
|
|
|
2966
|
+
/**
|
|
2967
|
+
* Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
2968
|
+
*/
|
|
2969
|
+
rollover_fraction?: number;
|
|
2970
|
+
|
|
2861
2971
|
/**
|
|
2862
2972
|
* List of filters that determine what kind of customer usage draws down a commit
|
|
2863
2973
|
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
@@ -3154,7 +3264,7 @@ export namespace ContractAmendParams {
|
|
|
3154
3264
|
* Required for OVERWRITE type.
|
|
3155
3265
|
*/
|
|
3156
3266
|
export interface OverwriteRate {
|
|
3157
|
-
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
3267
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
|
|
3158
3268
|
|
|
3159
3269
|
credit_type_id?: string;
|
|
3160
3270
|
|
|
@@ -3483,6 +3593,32 @@ export namespace ContractCreateHistoricalInvoicesParams {
|
|
|
3483
3593
|
}
|
|
3484
3594
|
}
|
|
3485
3595
|
|
|
3596
|
+
export interface ContractGetNetBalanceParams {
|
|
3597
|
+
/**
|
|
3598
|
+
* The ID of the customer.
|
|
3599
|
+
*/
|
|
3600
|
+
customer_id: string;
|
|
3601
|
+
|
|
3602
|
+
/**
|
|
3603
|
+
* The ID of the credit type (can be fiat or a custom pricing unit) to get the
|
|
3604
|
+
* balance for. Defaults to USD (cents) if not specified.
|
|
3605
|
+
*/
|
|
3606
|
+
credit_type_id?: string;
|
|
3607
|
+
|
|
3608
|
+
/**
|
|
3609
|
+
* Balance filters are OR'd together, so if a given commit or credit matches any of
|
|
3610
|
+
* the filters, it will be included in the net balance.
|
|
3611
|
+
*/
|
|
3612
|
+
filters?: Array<Shared.BalanceFilter>;
|
|
3613
|
+
|
|
3614
|
+
/**
|
|
3615
|
+
* Controls which invoices are considered when calculating the remaining balance.
|
|
3616
|
+
* `FINALIZED` considers only deductions from finalized invoices.
|
|
3617
|
+
* `FINALIZED_AND_DRAFT` also includes deductions from pending draft invoices.
|
|
3618
|
+
*/
|
|
3619
|
+
invoice_inclusion_mode?: 'FINALIZED' | 'FINALIZED_AND_DRAFT';
|
|
3620
|
+
}
|
|
3621
|
+
|
|
3486
3622
|
export interface ContractListBalancesParams extends BodyCursorPageParams {
|
|
3487
3623
|
customer_id: string;
|
|
3488
3624
|
|
|
@@ -3729,6 +3865,7 @@ export declare namespace Contracts {
|
|
|
3729
3865
|
type ContractAmendResponse as ContractAmendResponse,
|
|
3730
3866
|
type ContractArchiveResponse as ContractArchiveResponse,
|
|
3731
3867
|
type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
|
|
3868
|
+
type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse,
|
|
3732
3869
|
type ContractListBalancesResponse as ContractListBalancesResponse,
|
|
3733
3870
|
type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
|
|
3734
3871
|
type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse,
|
|
@@ -3742,6 +3879,7 @@ export declare namespace Contracts {
|
|
|
3742
3879
|
type ContractAmendParams as ContractAmendParams,
|
|
3743
3880
|
type ContractArchiveParams as ContractArchiveParams,
|
|
3744
3881
|
type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
|
|
3882
|
+
type ContractGetNetBalanceParams as ContractGetNetBalanceParams,
|
|
3745
3883
|
type ContractListBalancesParams as ContractListBalancesParams,
|
|
3746
3884
|
type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams,
|
|
3747
3885
|
type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams,
|
|
@@ -8,6 +8,7 @@ export {
|
|
|
8
8
|
type ContractAmendResponse,
|
|
9
9
|
type ContractArchiveResponse,
|
|
10
10
|
type ContractCreateHistoricalInvoicesResponse,
|
|
11
|
+
type ContractGetNetBalanceResponse,
|
|
11
12
|
type ContractListBalancesResponse,
|
|
12
13
|
type ContractRetrieveRateScheduleResponse,
|
|
13
14
|
type ContractRetrieveSubscriptionQuantityHistoryResponse,
|
|
@@ -20,6 +21,7 @@ export {
|
|
|
20
21
|
type ContractAmendParams,
|
|
21
22
|
type ContractArchiveParams,
|
|
22
23
|
type ContractCreateHistoricalInvoicesParams,
|
|
24
|
+
type ContractGetNetBalanceParams,
|
|
23
25
|
type ContractListBalancesParams,
|
|
24
26
|
type ContractRetrieveRateScheduleParams,
|
|
25
27
|
type ContractRetrieveSubscriptionQuantityHistoryParams,
|
|
@@ -5,6 +5,9 @@ import { APIPromise } from '../../../core/api-promise';
|
|
|
5
5
|
import { buildHeaders } from '../../../internal/headers';
|
|
6
6
|
import { RequestOptions } from '../../../internal/request-options';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Named schedules are used for storing custom data that can change over time. Named schedules are often used in custom pricing logic.
|
|
10
|
+
*/
|
|
8
11
|
export class NamedSchedules extends APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* Get a named schedule for the given rate card. This endpoint's availability is
|
|
@@ -7,6 +7,9 @@ import { APIPromise } from '../../../core/api-promise';
|
|
|
7
7
|
import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination';
|
|
8
8
|
import { RequestOptions } from '../../../internal/request-options';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Products are the items that customers purchase.
|
|
12
|
+
*/
|
|
10
13
|
export class Products extends APIResource {
|
|
11
14
|
/**
|
|
12
15
|
* Create a new product object. Products in Metronome represent your company's
|
|
@@ -5,6 +5,9 @@ import { APIPromise } from '../../../../core/api-promise';
|
|
|
5
5
|
import { buildHeaders } from '../../../../internal/headers';
|
|
6
6
|
import { RequestOptions } from '../../../../internal/request-options';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Named schedules are used for storing custom data that can change over time. Named schedules are often used in custom pricing logic.
|
|
10
|
+
*/
|
|
8
11
|
export class NamedSchedules extends APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* Get a named schedule for the given contract. This endpoint's availability is
|