@metronome/sdk 1.0.0 → 2.1.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 +101 -0
- package/bin/cli +5 -12
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/package.json +1 -1
- package/resources/shared.d.mts +157 -7
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +157 -7
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +68 -64
- package/resources/v1/alerts.d.mts.map +1 -1
- package/resources/v1/alerts.d.ts +68 -64
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +40 -39
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +40 -39
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +56 -9
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +56 -9
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +5 -4
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +5 -4
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/credit-grants.d.mts +10 -5
- package/resources/v1/credit-grants.d.mts.map +1 -1
- package/resources/v1/credit-grants.d.ts +10 -5
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +10 -5
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +10 -5
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.mts +99 -78
- package/resources/v1/customers/alerts.d.mts.map +1 -1
- package/resources/v1/customers/alerts.d.ts +99 -78
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +65 -46
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +65 -46
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.mts +15 -7
- package/resources/v1/customers/billing-config.d.mts.map +1 -1
- package/resources/v1/customers/billing-config.d.ts +15 -7
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +6 -3
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +6 -3
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.mts +3 -2
- package/resources/v1/customers/commits.d.mts.map +1 -1
- package/resources/v1/customers/commits.d.ts +3 -2
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +2 -1
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +2 -1
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +35 -26
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +35 -26
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +11 -5
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +11 -5
- 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 +169 -5
- package/resources/v1/customers/invoices.d.mts.map +1 -1
- package/resources/v1/customers/invoices.d.ts +169 -5
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +51 -1
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +51 -1
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/plans.d.mts +8 -4
- package/resources/v1/customers/plans.d.mts.map +1 -1
- package/resources/v1/customers/plans.d.ts +8 -4
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +8 -4
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +8 -4
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/index.d.mts +2 -0
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -0
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +5 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +2 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/payments.d.mts +117 -0
- package/resources/v1/payments.d.mts.map +1 -0
- package/resources/v1/payments.d.ts +117 -0
- package/resources/v1/payments.d.ts.map +1 -0
- package/resources/v1/payments.js +71 -0
- package/resources/v1/payments.js.map +1 -0
- package/resources/v1/payments.mjs +67 -0
- package/resources/v1/payments.mjs.map +1 -0
- package/resources/v1/plans.d.mts +8 -4
- package/resources/v1/plans.d.mts.map +1 -1
- package/resources/v1/plans.d.ts +8 -4
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +8 -4
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +8 -4
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/settings/billing-providers.d.mts +103 -0
- package/resources/v1/settings/billing-providers.d.mts.map +1 -0
- package/resources/v1/settings/billing-providers.d.ts +103 -0
- package/resources/v1/settings/billing-providers.d.ts.map +1 -0
- package/resources/v1/settings/billing-providers.js +48 -0
- package/resources/v1/settings/billing-providers.js.map +1 -0
- package/resources/v1/settings/billing-providers.mjs +44 -0
- package/resources/v1/settings/billing-providers.mjs.map +1 -0
- package/resources/v1/settings/index.d.mts +3 -0
- package/resources/v1/settings/index.d.mts.map +1 -0
- package/resources/v1/settings/index.d.ts +3 -0
- package/resources/v1/settings/index.d.ts.map +1 -0
- package/resources/v1/settings/index.js +9 -0
- package/resources/v1/settings/index.js.map +1 -0
- package/resources/v1/settings/index.mjs +4 -0
- package/resources/v1/settings/index.mjs.map +1 -0
- package/resources/v1/settings/settings.d.mts +54 -0
- package/resources/v1/settings/settings.d.mts.map +1 -0
- package/resources/v1/settings/settings.d.ts +54 -0
- package/resources/v1/settings/settings.d.ts.map +1 -0
- package/resources/v1/settings/settings.js +39 -0
- package/resources/v1/settings/settings.js.map +1 -0
- package/resources/v1/settings/settings.mjs +34 -0
- package/resources/v1/settings/settings.mjs.map +1 -0
- package/resources/v1/settings.d.mts +2 -0
- package/resources/v1/settings.d.mts.map +1 -0
- package/resources/v1/settings.d.ts +2 -0
- package/resources/v1/settings.d.ts.map +1 -0
- package/resources/v1/settings.js +6 -0
- package/resources/v1/settings.js.map +1 -0
- package/resources/v1/settings.mjs +3 -0
- package/resources/v1/settings.mjs.map +1 -0
- package/resources/v1/usage.d.mts +4 -2
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +4 -2
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +4 -2
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +4 -2
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +8 -0
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +8 -0
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +8 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +8 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.mts +120 -5
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +120 -5
- package/resources/v2/contracts.d.ts.map +1 -1
- package/src/internal/to-file.ts +1 -1
- package/src/resources/shared.ts +190 -7
- package/src/resources/v1/alerts.ts +68 -64
- package/src/resources/v1/contracts/contracts.ts +61 -9
- package/src/resources/v1/credit-grants.ts +10 -5
- package/src/resources/v1/customers/alerts.ts +99 -77
- package/src/resources/v1/customers/billing-config.ts +18 -7
- package/src/resources/v1/customers/commits.ts +3 -2
- package/src/resources/v1/customers/customers.ts +39 -25
- package/src/resources/v1/customers/index.ts +1 -0
- package/src/resources/v1/customers/invoices.ts +210 -4
- package/src/resources/v1/customers/plans.ts +8 -4
- package/src/resources/v1/index.ts +16 -0
- package/src/resources/v1/payments.ts +172 -0
- package/src/resources/v1/plans.ts +8 -4
- package/src/resources/v1/settings/billing-providers.ts +139 -0
- package/src/resources/v1/settings/index.ts +14 -0
- package/src/resources/v1/settings/settings.ts +87 -0
- package/src/resources/v1/settings.ts +3 -0
- package/src/resources/v1/usage.ts +4 -2
- package/src/resources/v1/v1.ts +40 -0
- package/src/resources/v2/contracts.ts +156 -5
- 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
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class BillingProviders extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Set up account-level configuration for a billing provider. Once configured,
|
|
10
|
+
* individual contracts across customers can be mapped to this configuration using
|
|
11
|
+
* the returned delivery_method_id.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const billingProvider =
|
|
16
|
+
* await client.v1.settings.billingProviders.create({
|
|
17
|
+
* billing_provider: 'aws_marketplace',
|
|
18
|
+
* configuration: {
|
|
19
|
+
* aws_external_id:
|
|
20
|
+
* '47b4f6b7-e297-42e8-b175-331d933b402c',
|
|
21
|
+
* aws_iam_role_arn: 'arn:aws:iam::test',
|
|
22
|
+
* },
|
|
23
|
+
* delivery_method: 'direct_to_billing_provider',
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
create(
|
|
28
|
+
body: BillingProviderCreateParams,
|
|
29
|
+
options?: RequestOptions,
|
|
30
|
+
): APIPromise<BillingProviderCreateResponse> {
|
|
31
|
+
return this._client.post('/v1/setUpBillingProvider', { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Lists all configured billing providers and their delivery method configurations
|
|
36
|
+
* for your account. Returns provider details, delivery method IDs, and
|
|
37
|
+
* configuration settings needed for mapping individual customer contracts to
|
|
38
|
+
* billing integrations.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const billingProviders =
|
|
43
|
+
* await client.v1.settings.billingProviders.list({
|
|
44
|
+
* next_page: 'af26878a-de62-4a0d-9b77-3936f7c2b6d6',
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
list(
|
|
49
|
+
body: BillingProviderListParams | null | undefined = {},
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<BillingProviderListResponse> {
|
|
52
|
+
return this._client.post('/v1/listConfiguredBillingProviders', { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface BillingProviderCreateResponse {
|
|
57
|
+
data: BillingProviderCreateResponse.Data;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export namespace BillingProviderCreateResponse {
|
|
61
|
+
export interface Data {
|
|
62
|
+
delivery_method_id: string;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface BillingProviderListResponse {
|
|
67
|
+
data: Array<BillingProviderListResponse.Data>;
|
|
68
|
+
|
|
69
|
+
next_page?: string | null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export namespace BillingProviderListResponse {
|
|
73
|
+
export interface Data {
|
|
74
|
+
/**
|
|
75
|
+
* The billing provider set for this configuration.
|
|
76
|
+
*/
|
|
77
|
+
billing_provider:
|
|
78
|
+
| 'aws_marketplace'
|
|
79
|
+
| 'stripe'
|
|
80
|
+
| 'netsuite'
|
|
81
|
+
| 'custom'
|
|
82
|
+
| 'azure_marketplace'
|
|
83
|
+
| 'quickbooks_online'
|
|
84
|
+
| 'workday'
|
|
85
|
+
| 'gcp_marketplace'
|
|
86
|
+
| 'metronome';
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The method to use for delivering invoices to this customer.
|
|
90
|
+
*/
|
|
91
|
+
delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Configuration for the delivery method. The structure of this object is specific
|
|
95
|
+
* to the delivery method. Some configuration may be omitted for security reasons.
|
|
96
|
+
*/
|
|
97
|
+
delivery_method_configuration: { [key: string]: unknown };
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* ID of the delivery method to use for this customer.
|
|
101
|
+
*/
|
|
102
|
+
delivery_method_id: string;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface BillingProviderCreateParams {
|
|
107
|
+
/**
|
|
108
|
+
* The billing provider set for this configuration.
|
|
109
|
+
*/
|
|
110
|
+
billing_provider: 'aws_marketplace' | 'azure_marketplace';
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Account-level configuration for the billing provider. The structure of this
|
|
114
|
+
* object is specific to the billing provider and delivery provider combination.
|
|
115
|
+
* See examples below.
|
|
116
|
+
*/
|
|
117
|
+
configuration: { [key: string]: unknown };
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The method to use for delivering invoices for this configuration.
|
|
121
|
+
*/
|
|
122
|
+
delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'aws_sns';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface BillingProviderListParams {
|
|
126
|
+
/**
|
|
127
|
+
* The cursor to the next page of results
|
|
128
|
+
*/
|
|
129
|
+
next_page?: string | null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare namespace BillingProviders {
|
|
133
|
+
export {
|
|
134
|
+
type BillingProviderCreateResponse as BillingProviderCreateResponse,
|
|
135
|
+
type BillingProviderListResponse as BillingProviderListResponse,
|
|
136
|
+
type BillingProviderCreateParams as BillingProviderCreateParams,
|
|
137
|
+
type BillingProviderListParams as BillingProviderListParams,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
BillingProviders,
|
|
5
|
+
type BillingProviderCreateResponse,
|
|
6
|
+
type BillingProviderListResponse,
|
|
7
|
+
type BillingProviderCreateParams,
|
|
8
|
+
type BillingProviderListParams,
|
|
9
|
+
} from './billing-providers';
|
|
10
|
+
export {
|
|
11
|
+
Settings,
|
|
12
|
+
type SettingUpsertAvalaraCredentialsResponse,
|
|
13
|
+
type SettingUpsertAvalaraCredentialsParams,
|
|
14
|
+
} from './settings';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as BillingProvidersAPI from './billing-providers';
|
|
5
|
+
import {
|
|
6
|
+
BillingProviderCreateParams,
|
|
7
|
+
BillingProviderCreateResponse,
|
|
8
|
+
BillingProviderListParams,
|
|
9
|
+
BillingProviderListResponse,
|
|
10
|
+
BillingProviders,
|
|
11
|
+
} from './billing-providers';
|
|
12
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
13
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
14
|
+
|
|
15
|
+
export class Settings extends APIResource {
|
|
16
|
+
billingProviders: BillingProvidersAPI.BillingProviders = new BillingProvidersAPI.BillingProviders(
|
|
17
|
+
this._client,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Set the Avalara credentials for some specified `delivery_method_ids`, which can
|
|
22
|
+
* be found in the `/listConfiguredBillingProviders` response. This maps the
|
|
23
|
+
* Avalara credentials to the appropriate billing entity. These credentials are
|
|
24
|
+
* only used for PLG Invoicing today.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const response =
|
|
29
|
+
* await client.v1.settings.upsertAvalaraCredentials({
|
|
30
|
+
* avalara_environment: 'PRODUCTION',
|
|
31
|
+
* avalara_password: 'my_password_123',
|
|
32
|
+
* avalara_username: 'test@metronome.com',
|
|
33
|
+
* delivery_method_ids: [
|
|
34
|
+
* '9a906ebb-fbc7-42e8-8e29-53bfd2db3aca',
|
|
35
|
+
* ],
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
upsertAvalaraCredentials(
|
|
40
|
+
body: SettingUpsertAvalaraCredentialsParams,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): APIPromise<SettingUpsertAvalaraCredentialsResponse> {
|
|
43
|
+
return this._client.post('/v1/upsertAvalaraCredentials', { body, ...options });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface SettingUpsertAvalaraCredentialsResponse {}
|
|
48
|
+
|
|
49
|
+
export interface SettingUpsertAvalaraCredentialsParams {
|
|
50
|
+
/**
|
|
51
|
+
* The Avalara environment to use (SANDBOX or PRODUCTION).
|
|
52
|
+
*/
|
|
53
|
+
avalara_environment: 'PRODUCTION' | 'SANDBOX';
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The password for the Avalara account.
|
|
57
|
+
*/
|
|
58
|
+
avalara_password: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The username for the Avalara account.
|
|
62
|
+
*/
|
|
63
|
+
avalara_username: string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The delivery method IDs of the billing provider configurations to update, can be
|
|
67
|
+
* found in the response of the `/listConfiguredBillingProviders` endpoint.
|
|
68
|
+
*/
|
|
69
|
+
delivery_method_ids: Array<string>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
Settings.BillingProviders = BillingProviders;
|
|
73
|
+
|
|
74
|
+
export declare namespace Settings {
|
|
75
|
+
export {
|
|
76
|
+
type SettingUpsertAvalaraCredentialsResponse as SettingUpsertAvalaraCredentialsResponse,
|
|
77
|
+
type SettingUpsertAvalaraCredentialsParams as SettingUpsertAvalaraCredentialsParams,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
BillingProviders as BillingProviders,
|
|
82
|
+
type BillingProviderCreateResponse as BillingProviderCreateResponse,
|
|
83
|
+
type BillingProviderListResponse as BillingProviderListResponse,
|
|
84
|
+
type BillingProviderCreateParams as BillingProviderCreateParams,
|
|
85
|
+
type BillingProviderListParams as BillingProviderListParams,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -81,8 +81,7 @@ export class Usage extends APIResource {
|
|
|
81
81
|
* ingestion, supports backdating 34 days, and is built to handle mission-critical
|
|
82
82
|
* usage data with enterprise-grade reliability. Metronome supports 100,000 events
|
|
83
83
|
* per second without requiring pre-aggregation or rollups and can scale up from
|
|
84
|
-
* there. See
|
|
85
|
-
* [Getting usage into Metronome](https://docs.metronome.com/connect-metronome/) to
|
|
84
|
+
* there. See the [Send usage events](/guides/events/send-usage-events) guide to
|
|
86
85
|
* learn more about usage events.
|
|
87
86
|
*
|
|
88
87
|
* ### Use this endpoint to:
|
|
@@ -125,6 +124,9 @@ export class Usage extends APIResource {
|
|
|
125
124
|
* }
|
|
126
125
|
* ```
|
|
127
126
|
*
|
|
127
|
+
* Learn more about
|
|
128
|
+
* [usage event structure definitions](/guides/events/design-usage-events).
|
|
129
|
+
*
|
|
128
130
|
* #### Transaction ID
|
|
129
131
|
*
|
|
130
132
|
* The transaction_id serves as your idempotency key, ensuring events are processed
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -69,6 +69,18 @@ import {
|
|
|
69
69
|
InvoiceVoidResponse,
|
|
70
70
|
Invoices,
|
|
71
71
|
} from './invoices';
|
|
72
|
+
import * as PaymentsAPI from './payments';
|
|
73
|
+
import {
|
|
74
|
+
Payment,
|
|
75
|
+
PaymentAttemptParams,
|
|
76
|
+
PaymentAttemptResponse,
|
|
77
|
+
PaymentCancelParams,
|
|
78
|
+
PaymentCancelResponse,
|
|
79
|
+
PaymentListParams,
|
|
80
|
+
PaymentStatus,
|
|
81
|
+
Payments,
|
|
82
|
+
PaymentsBodyCursorPage,
|
|
83
|
+
} from './payments';
|
|
72
84
|
import * as PlansAPI from './plans';
|
|
73
85
|
import {
|
|
74
86
|
PlanDetail,
|
|
@@ -165,6 +177,12 @@ import {
|
|
|
165
177
|
CustomerUpdateConfigParams,
|
|
166
178
|
Customers,
|
|
167
179
|
} from './customers/customers';
|
|
180
|
+
import * as SettingsAPI from './settings/settings';
|
|
181
|
+
import {
|
|
182
|
+
SettingUpsertAvalaraCredentialsParams,
|
|
183
|
+
SettingUpsertAvalaraCredentialsResponse,
|
|
184
|
+
Settings,
|
|
185
|
+
} from './settings/settings';
|
|
168
186
|
|
|
169
187
|
export class V1 extends APIResource {
|
|
170
188
|
alerts: AlertsAPI.Alerts = new AlertsAPI.Alerts(this._client);
|
|
@@ -180,6 +198,8 @@ export class V1 extends APIResource {
|
|
|
180
198
|
services: ServicesAPI.Services = new ServicesAPI.Services(this._client);
|
|
181
199
|
invoices: InvoicesAPI.Invoices = new InvoicesAPI.Invoices(this._client);
|
|
182
200
|
contracts: ContractsAPI.Contracts = new ContractsAPI.Contracts(this._client);
|
|
201
|
+
payments: PaymentsAPI.Payments = new PaymentsAPI.Payments(this._client);
|
|
202
|
+
settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client);
|
|
183
203
|
}
|
|
184
204
|
|
|
185
205
|
V1.Alerts = Alerts;
|
|
@@ -195,6 +215,8 @@ V1.BillableMetrics = BillableMetrics;
|
|
|
195
215
|
V1.Services = Services;
|
|
196
216
|
V1.Invoices = Invoices;
|
|
197
217
|
V1.Contracts = Contracts;
|
|
218
|
+
V1.Payments = Payments;
|
|
219
|
+
V1.Settings = Settings;
|
|
198
220
|
|
|
199
221
|
export declare namespace V1 {
|
|
200
222
|
export {
|
|
@@ -364,4 +386,22 @@ export declare namespace V1 {
|
|
|
364
386
|
type ContractSetUsageFilterParams as ContractSetUsageFilterParams,
|
|
365
387
|
type ContractUpdateEndDateParams as ContractUpdateEndDateParams,
|
|
366
388
|
};
|
|
389
|
+
|
|
390
|
+
export {
|
|
391
|
+
Payments as Payments,
|
|
392
|
+
type Payment as Payment,
|
|
393
|
+
type PaymentStatus as PaymentStatus,
|
|
394
|
+
type PaymentAttemptResponse as PaymentAttemptResponse,
|
|
395
|
+
type PaymentCancelResponse as PaymentCancelResponse,
|
|
396
|
+
type PaymentsBodyCursorPage as PaymentsBodyCursorPage,
|
|
397
|
+
type PaymentListParams as PaymentListParams,
|
|
398
|
+
type PaymentAttemptParams as PaymentAttemptParams,
|
|
399
|
+
type PaymentCancelParams as PaymentCancelParams,
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
export {
|
|
403
|
+
Settings as Settings,
|
|
404
|
+
type SettingUpsertAvalaraCredentialsResponse as SettingUpsertAvalaraCredentialsResponse,
|
|
405
|
+
type SettingUpsertAvalaraCredentialsParams as SettingUpsertAvalaraCredentialsParams,
|
|
406
|
+
};
|
|
367
407
|
}
|
|
@@ -373,7 +373,7 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
373
373
|
/**
|
|
374
374
|
* The schedule that the customer will be invoiced for this commit.
|
|
375
375
|
*/
|
|
376
|
-
invoice_schedule?:
|
|
376
|
+
invoice_schedule?: AddCommit.InvoiceSchedule;
|
|
377
377
|
|
|
378
378
|
name?: string;
|
|
379
379
|
|
|
@@ -414,6 +414,36 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
414
414
|
|
|
415
415
|
name: string;
|
|
416
416
|
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* The schedule that the customer will be invoiced for this commit.
|
|
420
|
+
*/
|
|
421
|
+
export interface InvoiceSchedule {
|
|
422
|
+
credit_type?: Shared.CreditTypeData;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* If true, this schedule will not generate an invoice.
|
|
426
|
+
*/
|
|
427
|
+
do_not_invoice?: boolean;
|
|
428
|
+
|
|
429
|
+
schedule_items?: Array<InvoiceSchedule.ScheduleItem>;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export namespace InvoiceSchedule {
|
|
433
|
+
export interface ScheduleItem {
|
|
434
|
+
id: string;
|
|
435
|
+
|
|
436
|
+
timestamp: string;
|
|
437
|
+
|
|
438
|
+
amount?: number;
|
|
439
|
+
|
|
440
|
+
invoice_id?: string | null;
|
|
441
|
+
|
|
442
|
+
quantity?: number;
|
|
443
|
+
|
|
444
|
+
unit_price?: number;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
417
447
|
}
|
|
418
448
|
|
|
419
449
|
export interface AddCredit {
|
|
@@ -495,7 +525,7 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
495
525
|
|
|
496
526
|
override_tiers?: Array<Shared.OverrideTier>;
|
|
497
527
|
|
|
498
|
-
overwrite_rate?:
|
|
528
|
+
overwrite_rate?: AddOverride.OverwriteRate;
|
|
499
529
|
|
|
500
530
|
priority?: number;
|
|
501
531
|
|
|
@@ -525,6 +555,40 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
525
555
|
recurring_credit_ids?: Array<string>;
|
|
526
556
|
}
|
|
527
557
|
|
|
558
|
+
export interface OverwriteRate {
|
|
559
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
560
|
+
|
|
561
|
+
credit_type?: Shared.CreditTypeData;
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
565
|
+
* processors.
|
|
566
|
+
*/
|
|
567
|
+
custom_rate?: { [key: string]: unknown };
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
|
|
571
|
+
* set to true.
|
|
572
|
+
*/
|
|
573
|
+
is_prorated?: boolean;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
|
|
577
|
+
* this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
|
|
578
|
+
*/
|
|
579
|
+
price?: number;
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
583
|
+
*/
|
|
584
|
+
quantity?: number;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Only set for TIERED rate_type.
|
|
588
|
+
*/
|
|
589
|
+
tiers?: Array<Shared.Tier>;
|
|
590
|
+
}
|
|
591
|
+
|
|
528
592
|
export interface Product {
|
|
529
593
|
id: string;
|
|
530
594
|
|
|
@@ -1301,6 +1365,8 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1301
1365
|
ending_before?: string;
|
|
1302
1366
|
|
|
1303
1367
|
invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
|
|
1368
|
+
|
|
1369
|
+
rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
|
|
1304
1370
|
}
|
|
1305
1371
|
|
|
1306
1372
|
export namespace UpdateRecurringCommit {
|
|
@@ -1323,6 +1389,8 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1323
1389
|
access_amount?: UpdateRecurringCredit.AccessAmount;
|
|
1324
1390
|
|
|
1325
1391
|
ending_before?: string;
|
|
1392
|
+
|
|
1393
|
+
rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
|
|
1326
1394
|
}
|
|
1327
1395
|
|
|
1328
1396
|
export namespace UpdateRecurringCredit {
|
|
@@ -1494,6 +1562,13 @@ export interface ContractEditParams {
|
|
|
1494
1562
|
*/
|
|
1495
1563
|
customer_id: string;
|
|
1496
1564
|
|
|
1565
|
+
/**
|
|
1566
|
+
* Update the billing provider configuration on the contract. Currently only
|
|
1567
|
+
* supports adding a billing provider configuration to a contract that does not
|
|
1568
|
+
* already have one.
|
|
1569
|
+
*/
|
|
1570
|
+
add_billing_provider_configuration_update?: ContractEditParams.AddBillingProviderConfigurationUpdate;
|
|
1571
|
+
|
|
1497
1572
|
add_commits?: Array<ContractEditParams.AddCommit>;
|
|
1498
1573
|
|
|
1499
1574
|
add_credits?: Array<ContractEditParams.AddCredit>;
|
|
@@ -1601,6 +1676,51 @@ export interface ContractEditParams {
|
|
|
1601
1676
|
}
|
|
1602
1677
|
|
|
1603
1678
|
export namespace ContractEditParams {
|
|
1679
|
+
/**
|
|
1680
|
+
* Update the billing provider configuration on the contract. Currently only
|
|
1681
|
+
* supports adding a billing provider configuration to a contract that does not
|
|
1682
|
+
* already have one.
|
|
1683
|
+
*/
|
|
1684
|
+
export interface AddBillingProviderConfigurationUpdate {
|
|
1685
|
+
billing_provider_configuration: AddBillingProviderConfigurationUpdate.BillingProviderConfiguration;
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* Indicates when the billing provider will be active on the contract. Any charges
|
|
1689
|
+
* accrued during the schedule will be billed to the indicated billing provider.
|
|
1690
|
+
*/
|
|
1691
|
+
schedule: AddBillingProviderConfigurationUpdate.Schedule;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
export namespace AddBillingProviderConfigurationUpdate {
|
|
1695
|
+
export interface BillingProviderConfiguration {
|
|
1696
|
+
billing_provider?:
|
|
1697
|
+
| 'aws_marketplace'
|
|
1698
|
+
| 'stripe'
|
|
1699
|
+
| 'netsuite'
|
|
1700
|
+
| 'custom'
|
|
1701
|
+
| 'azure_marketplace'
|
|
1702
|
+
| 'quickbooks_online'
|
|
1703
|
+
| 'workday'
|
|
1704
|
+
| 'gcp_marketplace'
|
|
1705
|
+
| 'metronome';
|
|
1706
|
+
|
|
1707
|
+
billing_provider_configuration_id?: string;
|
|
1708
|
+
|
|
1709
|
+
delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* Indicates when the billing provider will be active on the contract. Any charges
|
|
1714
|
+
* accrued during the schedule will be billed to the indicated billing provider.
|
|
1715
|
+
*/
|
|
1716
|
+
export interface Schedule {
|
|
1717
|
+
/**
|
|
1718
|
+
* When the billing provider update will take effect.
|
|
1719
|
+
*/
|
|
1720
|
+
effective_at: 'START_OF_CURRENT_PERIOD';
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1604
1724
|
export interface AddCommit {
|
|
1605
1725
|
product_id: string;
|
|
1606
1726
|
|
|
@@ -1858,7 +1978,7 @@ export namespace ContractEditParams {
|
|
|
1858
1978
|
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
1859
1979
|
* will default to NONE.
|
|
1860
1980
|
*/
|
|
1861
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
1981
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
|
|
1862
1982
|
}
|
|
1863
1983
|
|
|
1864
1984
|
export namespace PaymentGateConfig {
|
|
@@ -2491,7 +2611,9 @@ export namespace ContractEditParams {
|
|
|
2491
2611
|
subscription_id: string;
|
|
2492
2612
|
|
|
2493
2613
|
/**
|
|
2494
|
-
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
2614
|
+
* If set to POOLED, allocation added per seat is pooled across the account. (BETA)
|
|
2615
|
+
* If set to INDIVIDUAL, each seat in the subscription will have its own
|
|
2616
|
+
* allocation.
|
|
2495
2617
|
*/
|
|
2496
2618
|
allocation?: 'POOLED' | 'INDIVIDUAL';
|
|
2497
2619
|
}
|
|
@@ -2654,7 +2776,9 @@ export namespace ContractEditParams {
|
|
|
2654
2776
|
subscription_id: string;
|
|
2655
2777
|
|
|
2656
2778
|
/**
|
|
2657
|
-
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
2779
|
+
* If set to POOLED, allocation added per seat is pooled across the account. (BETA)
|
|
2780
|
+
* If set to INDIVIDUAL, each seat in the subscription will have its own
|
|
2781
|
+
* allocation.
|
|
2658
2782
|
*/
|
|
2659
2783
|
allocation?: 'POOLED' | 'INDIVIDUAL';
|
|
2660
2784
|
}
|
|
@@ -2875,6 +2999,11 @@ export namespace ContractEditParams {
|
|
|
2875
2999
|
* QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
2876
3000
|
* directly on the subscription. `initial_quantity` must be provided with this
|
|
2877
3001
|
* option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
3002
|
+
* **SEAT_BASED**: (BETA) Use when you want to pass specific seat identifiers (e.g.
|
|
3003
|
+
* add user_123) to increment and decrement a subscription quantity, rather than
|
|
3004
|
+
* directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
3005
|
+
* use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
3006
|
+
* provided with this option.
|
|
2878
3007
|
*/
|
|
2879
3008
|
quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
|
|
2880
3009
|
|
|
@@ -3187,6 +3316,12 @@ export namespace ContractEditParams {
|
|
|
3187
3316
|
ending_before?: string | null;
|
|
3188
3317
|
|
|
3189
3318
|
invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
|
|
3319
|
+
|
|
3320
|
+
/**
|
|
3321
|
+
* If provided, updates the recurring commit to use the specified rate type when
|
|
3322
|
+
* generating future commits.
|
|
3323
|
+
*/
|
|
3324
|
+
rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
|
|
3190
3325
|
}
|
|
3191
3326
|
|
|
3192
3327
|
export namespace UpdateRecurringCommit {
|
|
@@ -3209,6 +3344,12 @@ export namespace ContractEditParams {
|
|
|
3209
3344
|
access_amount?: UpdateRecurringCredit.AccessAmount;
|
|
3210
3345
|
|
|
3211
3346
|
ending_before?: string | null;
|
|
3347
|
+
|
|
3348
|
+
/**
|
|
3349
|
+
* If provided, updates the recurring credit to use the specified rate type when
|
|
3350
|
+
* generating future credits.
|
|
3351
|
+
*/
|
|
3352
|
+
rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
|
|
3212
3353
|
}
|
|
3213
3354
|
|
|
3214
3355
|
export namespace UpdateRecurringCredit {
|
|
@@ -3344,6 +3485,11 @@ export interface ContractEditCommitParams {
|
|
|
3344
3485
|
*/
|
|
3345
3486
|
applicable_product_tags?: Array<string> | null;
|
|
3346
3487
|
|
|
3488
|
+
/**
|
|
3489
|
+
* Optional configuration for commit hierarchy access control
|
|
3490
|
+
*/
|
|
3491
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
3492
|
+
|
|
3347
3493
|
/**
|
|
3348
3494
|
* ID of contract to use for invoicing
|
|
3349
3495
|
*/
|
|
@@ -3472,6 +3618,11 @@ export interface ContractEditCreditParams {
|
|
|
3472
3618
|
*/
|
|
3473
3619
|
applicable_product_tags?: Array<string> | null;
|
|
3474
3620
|
|
|
3621
|
+
/**
|
|
3622
|
+
* Optional configuration for credit hierarchy access control
|
|
3623
|
+
*/
|
|
3624
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
3625
|
+
|
|
3475
3626
|
/**
|
|
3476
3627
|
* If multiple commits are applicable, the one with the lower priority will apply
|
|
3477
3628
|
* first.
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.0
|
|
1
|
+
export const VERSION = '2.1.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0
|
|
1
|
+
export declare const VERSION = "2.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0
|
|
1
|
+
export declare const VERSION = "2.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.0
|
|
1
|
+
export const VERSION = '2.1.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|