@metronome/sdk 0.1.0-alpha.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 +24 -0
- package/LICENSE +201 -0
- package/README.md +313 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +90 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +237 -0
- package/core.d.ts.map +1 -0
- package/core.js +868 -0
- package/core.js.map +1 -0
- package/core.mjs +837 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +53 -0
- package/error.d.ts.map +1 -0
- package/error.js +143 -0
- package/error.js.map +1 -0
- package/error.mjs +127 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +210 -0
- package/index.d.ts +210 -0
- package/index.d.ts.map +1 -0
- package/index.js +133 -0
- package/index.js.map +1 -0
- package/index.mjs +105 -0
- package/index.mjs.map +1 -0
- package/package.json +106 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/alerts.d.ts +103 -0
- package/resources/alerts.d.ts.map +1 -0
- package/resources/alerts.js +23 -0
- package/resources/alerts.js.map +1 -0
- package/resources/alerts.mjs +19 -0
- package/resources/alerts.mjs.map +1 -0
- package/resources/audit-logs.d.ts +83 -0
- package/resources/audit-logs.d.ts.map +1 -0
- package/resources/audit-logs.js +18 -0
- package/resources/audit-logs.js.map +1 -0
- package/resources/audit-logs.mjs +14 -0
- package/resources/audit-logs.mjs.map +1 -0
- package/resources/billable-metrics.d.ts +236 -0
- package/resources/billable-metrics.d.ts.map +1 -0
- package/resources/billable-metrics.js +36 -0
- package/resources/billable-metrics.js.map +1 -0
- package/resources/billable-metrics.mjs +32 -0
- package/resources/billable-metrics.mjs.map +1 -0
- package/resources/credit-grants.d.ts +469 -0
- package/resources/credit-grants.d.ts.map +1 -0
- package/resources/credit-grants.js +50 -0
- package/resources/credit-grants.js.map +1 -0
- package/resources/credit-grants.mjs +46 -0
- package/resources/credit-grants.mjs.map +1 -0
- package/resources/custom-fields.d.ts +82 -0
- package/resources/custom-fields.d.ts.map +1 -0
- package/resources/custom-fields.js +66 -0
- package/resources/custom-fields.js.map +1 -0
- package/resources/custom-fields.mjs +62 -0
- package/resources/custom-fields.mjs.map +1 -0
- package/resources/customers/alerts.d.ts +146 -0
- package/resources/customers/alerts.d.ts.map +1 -0
- package/resources/customers/alerts.js +35 -0
- package/resources/customers/alerts.js.map +1 -0
- package/resources/customers/alerts.mjs +31 -0
- package/resources/customers/alerts.mjs.map +1 -0
- package/resources/customers/billing-config.d.ts +64 -0
- package/resources/customers/billing-config.d.ts.map +1 -0
- package/resources/customers/billing-config.js +37 -0
- package/resources/customers/billing-config.js.map +1 -0
- package/resources/customers/billing-config.mjs +33 -0
- package/resources/customers/billing-config.mjs.map +1 -0
- package/resources/customers/customers.d.ts +313 -0
- package/resources/customers/customers.d.ts.map +1 -0
- package/resources/customers/customers.js +116 -0
- package/resources/customers/customers.js.map +1 -0
- package/resources/customers/customers.mjs +89 -0
- package/resources/customers/customers.mjs.map +1 -0
- package/resources/customers/index.d.ts +6 -0
- package/resources/customers/index.d.ts.map +1 -0
- package/resources/customers/index.js +15 -0
- package/resources/customers/index.js.map +1 -0
- package/resources/customers/index.mjs +7 -0
- package/resources/customers/index.mjs.map +1 -0
- package/resources/customers/invoices.d.ts +331 -0
- package/resources/customers/invoices.d.ts.map +1 -0
- package/resources/customers/invoices.js +30 -0
- package/resources/customers/invoices.js.map +1 -0
- package/resources/customers/invoices.mjs +26 -0
- package/resources/customers/invoices.mjs.map +1 -0
- package/resources/customers/plans.d.ts +239 -0
- package/resources/customers/plans.d.ts.map +1 -0
- package/resources/customers/plans.js +41 -0
- package/resources/customers/plans.js.map +1 -0
- package/resources/customers/plans.mjs +37 -0
- package/resources/customers/plans.mjs.map +1 -0
- package/resources/dashboards.d.ts +61 -0
- package/resources/dashboards.d.ts.map +1 -0
- package/resources/dashboards.js +19 -0
- package/resources/dashboards.js.map +1 -0
- package/resources/dashboards.mjs +15 -0
- package/resources/dashboards.mjs.map +1 -0
- package/resources/index.d.ts +13 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +42 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +14 -0
- package/resources/index.mjs.map +1 -0
- package/resources/plans.d.ts +217 -0
- package/resources/plans.d.ts.map +1 -0
- package/resources/plans.js +36 -0
- package/resources/plans.js.map +1 -0
- package/resources/plans.mjs +32 -0
- package/resources/plans.mjs.map +1 -0
- package/resources/services.d.ts +26 -0
- package/resources/services.d.ts.map +1 -0
- package/resources/services.js +20 -0
- package/resources/services.js.map +1 -0
- package/resources/services.mjs +16 -0
- package/resources/services.mjs.map +1 -0
- package/resources/shared.d.ts +540 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/usage.d.ts +182 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +41 -0
- package/resources/usage.js.map +1 -0
- package/resources/usage.mjs +37 -0
- package/resources/usage.mjs.map +1 -0
- package/resources/webhooks.d.ts +22 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +91 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +87 -0
- package/resources/webhooks.mjs.map +1 -0
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +83 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1146 -0
- package/src/error.ts +146 -0
- package/src/index.ts +303 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/alerts.ts +144 -0
- package/src/resources/audit-logs.ts +116 -0
- package/src/resources/billable-metrics.ts +341 -0
- package/src/resources/credit-grants.ts +627 -0
- package/src/resources/custom-fields.ts +242 -0
- package/src/resources/customers/alerts.ts +214 -0
- package/src/resources/customers/billing-config.ts +183 -0
- package/src/resources/customers/customers.ts +500 -0
- package/src/resources/customers/index.ts +53 -0
- package/src/resources/customers/invoices.ts +533 -0
- package/src/resources/customers/plans.ts +363 -0
- package/src/resources/dashboards.ts +98 -0
- package/src/resources/index.ts +90 -0
- package/src/resources/plans.ts +333 -0
- package/src/resources/services.ts +35 -0
- package/src/resources/shared.ts +849 -0
- package/src/resources/usage.ts +245 -0
- package/src/resources/webhooks.ts +120 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +248 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +165 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +152 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as Core from "../../core";
|
|
4
|
+
import { APIResource } from "../../resource";
|
|
5
|
+
import { isRequestOptions } from "../../core";
|
|
6
|
+
import * as InvoicesAPI from "./invoices";
|
|
7
|
+
import * as Shared from "../shared";
|
|
8
|
+
|
|
9
|
+
export class Invoices extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Fetch a specific invoice for a given customer.
|
|
12
|
+
*/
|
|
13
|
+
retrieve(
|
|
14
|
+
customerId: string,
|
|
15
|
+
invoiceId: string,
|
|
16
|
+
query?: InvoiceRetrieveParams,
|
|
17
|
+
options?: Core.RequestOptions,
|
|
18
|
+
): Core.APIPromise<InvoiceRetrieveResponse>;
|
|
19
|
+
retrieve(
|
|
20
|
+
customerId: string,
|
|
21
|
+
invoiceId: string,
|
|
22
|
+
options?: Core.RequestOptions,
|
|
23
|
+
): Core.APIPromise<InvoiceRetrieveResponse>;
|
|
24
|
+
retrieve(
|
|
25
|
+
customerId: string,
|
|
26
|
+
invoiceId: string,
|
|
27
|
+
query: InvoiceRetrieveParams | Core.RequestOptions = {},
|
|
28
|
+
options?: Core.RequestOptions,
|
|
29
|
+
): Core.APIPromise<InvoiceRetrieveResponse> {
|
|
30
|
+
if (isRequestOptions(query)) {
|
|
31
|
+
return this.retrieve(customerId, invoiceId, {}, query);
|
|
32
|
+
}
|
|
33
|
+
return this._client.get(`/customers/${customerId}/invoices/${invoiceId}`, { query, ...options });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List all invoices for a given customer, optionally filtered by status, date
|
|
38
|
+
* range, and/or credit type.
|
|
39
|
+
*/
|
|
40
|
+
list(
|
|
41
|
+
customerId: string,
|
|
42
|
+
query?: InvoiceListParams,
|
|
43
|
+
options?: Core.RequestOptions,
|
|
44
|
+
): Core.APIPromise<InvoiceListResponse>;
|
|
45
|
+
list(customerId: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceListResponse>;
|
|
46
|
+
list(
|
|
47
|
+
customerId: string,
|
|
48
|
+
query: InvoiceListParams | Core.RequestOptions = {},
|
|
49
|
+
options?: Core.RequestOptions,
|
|
50
|
+
): Core.APIPromise<InvoiceListResponse> {
|
|
51
|
+
if (isRequestOptions(query)) {
|
|
52
|
+
return this.list(customerId, {}, query);
|
|
53
|
+
}
|
|
54
|
+
return this._client.get(`/customers/${customerId}/invoices`, { query, ...options });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Add a one time charge to the specified invoice
|
|
59
|
+
*/
|
|
60
|
+
addCharge(
|
|
61
|
+
customerId: string,
|
|
62
|
+
body: InvoiceAddChargeParams,
|
|
63
|
+
options?: Core.RequestOptions,
|
|
64
|
+
): Core.APIPromise<InvoiceAddChargeResponse> {
|
|
65
|
+
return this._client.post(`/customers/${customerId}/addCharge`, { body, ...options });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface Invoice {
|
|
70
|
+
id: string;
|
|
71
|
+
|
|
72
|
+
billable_status: 'billable' | 'unbillable';
|
|
73
|
+
|
|
74
|
+
credit_type: Shared.CreditType;
|
|
75
|
+
|
|
76
|
+
customer_id: string;
|
|
77
|
+
|
|
78
|
+
line_items: Array<Invoice.LineItem>;
|
|
79
|
+
|
|
80
|
+
status: string;
|
|
81
|
+
|
|
82
|
+
total: number;
|
|
83
|
+
|
|
84
|
+
type: string;
|
|
85
|
+
|
|
86
|
+
amendment_id?: string;
|
|
87
|
+
|
|
88
|
+
contract_custom_fields?: Record<string, string>;
|
|
89
|
+
|
|
90
|
+
contract_id?: string;
|
|
91
|
+
|
|
92
|
+
correction_record?: Invoice.CorrectionRecord;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* When the invoice was created (UTC). This field is present for correction
|
|
96
|
+
* invoices only.
|
|
97
|
+
*/
|
|
98
|
+
created_at?: string;
|
|
99
|
+
|
|
100
|
+
custom_fields?: Record<string, unknown>;
|
|
101
|
+
|
|
102
|
+
customer_custom_fields?: Record<string, string>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* End of the usage period this invoice covers (UTC)
|
|
106
|
+
*/
|
|
107
|
+
end_timestamp?: string;
|
|
108
|
+
|
|
109
|
+
external_invoice?: Invoice.ExternalInvoice | null;
|
|
110
|
+
|
|
111
|
+
invoice_adjustments?: Array<Invoice.InvoiceAdjustment>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* When the invoice was issued (UTC)
|
|
115
|
+
*/
|
|
116
|
+
issued_at?: string;
|
|
117
|
+
|
|
118
|
+
net_payment_terms_days?: number;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* This field's availability is dependent on your client's configuration.
|
|
122
|
+
*/
|
|
123
|
+
netsuite_sales_order_id?: string;
|
|
124
|
+
|
|
125
|
+
plan_custom_fields?: Record<string, string>;
|
|
126
|
+
|
|
127
|
+
plan_id?: string;
|
|
128
|
+
|
|
129
|
+
plan_name?: string;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* only present for beta contract invoices with reseller royalties
|
|
133
|
+
*/
|
|
134
|
+
reseller_royalty?: Invoice.ResellerRoyalty;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* This field's availability is dependent on your client's configuration.
|
|
138
|
+
*/
|
|
139
|
+
salesforce_opportunity_id?: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Beginning of the usage period this invoice covers (UTC)
|
|
143
|
+
*/
|
|
144
|
+
start_timestamp?: string;
|
|
145
|
+
|
|
146
|
+
subtotal?: number;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export namespace Invoice {
|
|
150
|
+
export interface LineItem {
|
|
151
|
+
credit_type: Shared.CreditType;
|
|
152
|
+
|
|
153
|
+
name: string;
|
|
154
|
+
|
|
155
|
+
total: number;
|
|
156
|
+
|
|
157
|
+
commit_custom_fields?: Record<string, string>;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* only present for beta contract invoices
|
|
161
|
+
*/
|
|
162
|
+
commit_id?: string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* only present for beta contract invoices. This field's availability is dependent
|
|
166
|
+
* on your client's configuration.
|
|
167
|
+
*/
|
|
168
|
+
commit_netsuite_item_id?: string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* only present for beta contract invoices. This field's availability is dependent
|
|
172
|
+
* on your client's configuration.
|
|
173
|
+
*/
|
|
174
|
+
commit_netsuite_sales_order_id?: string;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* only present for beta contract invoices
|
|
178
|
+
*/
|
|
179
|
+
commit_segment_id?: string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* only present for beta contract invoices
|
|
183
|
+
*/
|
|
184
|
+
commit_type?: string;
|
|
185
|
+
|
|
186
|
+
custom_fields?: Record<string, string>;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* only present for beta contract invoices
|
|
190
|
+
*/
|
|
191
|
+
ending_before?: string;
|
|
192
|
+
|
|
193
|
+
group_key?: string;
|
|
194
|
+
|
|
195
|
+
group_value?: string | null;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* only present for beta contract invoices
|
|
199
|
+
*/
|
|
200
|
+
is_prorated?: boolean;
|
|
201
|
+
|
|
202
|
+
metadata?: string;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The end date for the billing period on the invoice.
|
|
206
|
+
*/
|
|
207
|
+
netsuite_invoice_billing_end?: string;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The start date for the billing period on the invoice.
|
|
211
|
+
*/
|
|
212
|
+
netsuite_invoice_billing_start?: string;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* only present for beta contract invoices. This field's availability is dependent
|
|
216
|
+
* on your client's configuration.
|
|
217
|
+
*/
|
|
218
|
+
netsuite_item_id?: string;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* only present for beta contract invoices
|
|
222
|
+
*/
|
|
223
|
+
postpaid_commit?: LineItem.PostpaidCommit;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* if presentation groups are used, this will contain the values used to break down
|
|
227
|
+
* the line item
|
|
228
|
+
*/
|
|
229
|
+
presentation_group_values?: Record<string, string | null>;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* if pricing groups are used, this will contain the values used to calculate the
|
|
233
|
+
* price
|
|
234
|
+
*/
|
|
235
|
+
pricing_group_values?: Record<string, string>;
|
|
236
|
+
|
|
237
|
+
product_custom_fields?: Record<string, string>;
|
|
238
|
+
|
|
239
|
+
product_id?: string;
|
|
240
|
+
|
|
241
|
+
product_type?: string;
|
|
242
|
+
|
|
243
|
+
professional_service_custom_fields?: Record<string, string>;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* only present for beta contract invoices
|
|
247
|
+
*/
|
|
248
|
+
professional_service_id?: string;
|
|
249
|
+
|
|
250
|
+
quantity?: number;
|
|
251
|
+
|
|
252
|
+
reseller_type?: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
253
|
+
|
|
254
|
+
scheduled_charge_custom_fields?: Record<string, string>;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* only present for beta contract invoices
|
|
258
|
+
*/
|
|
259
|
+
scheduled_charge_id?: string;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* only present for beta contract invoices
|
|
263
|
+
*/
|
|
264
|
+
starting_at?: string;
|
|
265
|
+
|
|
266
|
+
sub_line_items?: Array<LineItem.SubLineItem>;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* only present for beta contract invoices
|
|
270
|
+
*/
|
|
271
|
+
unit_price?: number;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export namespace LineItem {
|
|
275
|
+
/**
|
|
276
|
+
* only present for beta contract invoices
|
|
277
|
+
*/
|
|
278
|
+
export interface PostpaidCommit {
|
|
279
|
+
id: string;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface SubLineItem {
|
|
283
|
+
custom_fields: Record<string, string>;
|
|
284
|
+
|
|
285
|
+
name: string;
|
|
286
|
+
|
|
287
|
+
quantity: number;
|
|
288
|
+
|
|
289
|
+
subtotal: number;
|
|
290
|
+
|
|
291
|
+
charge_id?: string;
|
|
292
|
+
|
|
293
|
+
credit_grant_id?: string;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* the unit price for this charge, present only if the charge is not tiered and the
|
|
297
|
+
* quantity is nonzero
|
|
298
|
+
*/
|
|
299
|
+
price?: number;
|
|
300
|
+
|
|
301
|
+
tiers?: Array<SubLineItem.Tier>;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export namespace SubLineItem {
|
|
305
|
+
export interface Tier {
|
|
306
|
+
price: number;
|
|
307
|
+
|
|
308
|
+
quantity: number;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* at what metric amount this tier begins
|
|
312
|
+
*/
|
|
313
|
+
starting_at: number;
|
|
314
|
+
|
|
315
|
+
subtotal: number;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface CorrectionRecord {
|
|
321
|
+
corrected_invoice_id: string;
|
|
322
|
+
|
|
323
|
+
memo: string;
|
|
324
|
+
|
|
325
|
+
reason: string;
|
|
326
|
+
|
|
327
|
+
corrected_external_invoice?: CorrectionRecord.CorrectedExternalInvoice;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export namespace CorrectionRecord {
|
|
331
|
+
export interface CorrectedExternalInvoice {
|
|
332
|
+
billing_provider_type:
|
|
333
|
+
| 'aws_marketplace'
|
|
334
|
+
| 'stripe'
|
|
335
|
+
| 'netsuite'
|
|
336
|
+
| 'custom'
|
|
337
|
+
| 'azure_marketplace'
|
|
338
|
+
| 'quickbooks_online'
|
|
339
|
+
| 'workday'
|
|
340
|
+
| 'gcp_marketplace';
|
|
341
|
+
|
|
342
|
+
external_status?:
|
|
343
|
+
| 'DRAFT'
|
|
344
|
+
| 'FINALIZED'
|
|
345
|
+
| 'PAID'
|
|
346
|
+
| 'UNCOLLECTIBLE'
|
|
347
|
+
| 'VOID'
|
|
348
|
+
| 'DELETED'
|
|
349
|
+
| 'PAYMENT_FAILED'
|
|
350
|
+
| 'INVALID_REQUEST_ERROR'
|
|
351
|
+
| 'SKIPPED'
|
|
352
|
+
| 'SENT'
|
|
353
|
+
| 'QUEUED';
|
|
354
|
+
|
|
355
|
+
invoice_id?: string;
|
|
356
|
+
|
|
357
|
+
issued_at_timestamp?: string;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export interface ExternalInvoice {
|
|
362
|
+
billing_provider_type:
|
|
363
|
+
| 'aws_marketplace'
|
|
364
|
+
| 'stripe'
|
|
365
|
+
| 'netsuite'
|
|
366
|
+
| 'custom'
|
|
367
|
+
| 'azure_marketplace'
|
|
368
|
+
| 'quickbooks_online'
|
|
369
|
+
| 'workday'
|
|
370
|
+
| 'gcp_marketplace';
|
|
371
|
+
|
|
372
|
+
external_status?:
|
|
373
|
+
| 'DRAFT'
|
|
374
|
+
| 'FINALIZED'
|
|
375
|
+
| 'PAID'
|
|
376
|
+
| 'UNCOLLECTIBLE'
|
|
377
|
+
| 'VOID'
|
|
378
|
+
| 'DELETED'
|
|
379
|
+
| 'PAYMENT_FAILED'
|
|
380
|
+
| 'INVALID_REQUEST_ERROR'
|
|
381
|
+
| 'SKIPPED'
|
|
382
|
+
| 'SENT'
|
|
383
|
+
| 'QUEUED';
|
|
384
|
+
|
|
385
|
+
invoice_id?: string;
|
|
386
|
+
|
|
387
|
+
issued_at_timestamp?: string;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export interface InvoiceAdjustment {
|
|
391
|
+
credit_type: Shared.CreditType;
|
|
392
|
+
|
|
393
|
+
name: string;
|
|
394
|
+
|
|
395
|
+
total: number;
|
|
396
|
+
|
|
397
|
+
credit_grant_id?: string;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* only present for beta contract invoices with reseller royalties
|
|
402
|
+
*/
|
|
403
|
+
export interface ResellerRoyalty {
|
|
404
|
+
fraction: string;
|
|
405
|
+
|
|
406
|
+
netsuite_reseller_id: string;
|
|
407
|
+
|
|
408
|
+
reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
409
|
+
|
|
410
|
+
aws_options?: ResellerRoyalty.AwsOptions;
|
|
411
|
+
|
|
412
|
+
gcp_options?: ResellerRoyalty.GcpOptions;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export namespace ResellerRoyalty {
|
|
416
|
+
export interface AwsOptions {
|
|
417
|
+
aws_account_number?: string;
|
|
418
|
+
|
|
419
|
+
aws_offer_id?: string;
|
|
420
|
+
|
|
421
|
+
aws_payer_reference_id?: string;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export interface GcpOptions {
|
|
425
|
+
gcp_account_id?: string;
|
|
426
|
+
|
|
427
|
+
gcp_offer_id?: string;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export interface InvoiceRetrieveResponse {
|
|
433
|
+
data: Invoice;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export interface InvoiceListResponse {
|
|
437
|
+
data: Array<Invoice>;
|
|
438
|
+
|
|
439
|
+
next_page: string | null;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface InvoiceAddChargeResponse {}
|
|
443
|
+
|
|
444
|
+
export interface InvoiceRetrieveParams {
|
|
445
|
+
/**
|
|
446
|
+
* If set, all zero quantity line items will be filtered out of the response
|
|
447
|
+
*/
|
|
448
|
+
skip_zero_qty_line_items?: boolean;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export interface InvoiceListParams {
|
|
452
|
+
/**
|
|
453
|
+
* Only return invoices for the specified credit type
|
|
454
|
+
*/
|
|
455
|
+
credit_type_id?: string;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* RFC 3339 timestamp (exclusive). Invoices will only be returned for billing
|
|
459
|
+
* periods that end before this time.
|
|
460
|
+
*/
|
|
461
|
+
ending_before?: string;
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Max number of results that should be returned
|
|
465
|
+
*/
|
|
466
|
+
limit?: number;
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Cursor that indicates where the next page of results should start.
|
|
470
|
+
*/
|
|
471
|
+
next_page?: string;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* If set, all zero quantity line items will be filtered out of the response
|
|
475
|
+
*/
|
|
476
|
+
skip_zero_qty_line_items?: boolean;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Invoice sort order by issued_at, e.g. date_asc or date_desc. Defaults to
|
|
480
|
+
* date_asc.
|
|
481
|
+
*/
|
|
482
|
+
sort?: 'date_asc' | 'date_desc';
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* RFC 3339 timestamp (inclusive). Invoices will only be returned for billing
|
|
486
|
+
* periods that start at or after this time.
|
|
487
|
+
*/
|
|
488
|
+
starting_on?: string;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Invoice status, e.g. DRAFT, FINALIZED, or VOID
|
|
492
|
+
*/
|
|
493
|
+
status?: string;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export interface InvoiceAddChargeParams {
|
|
497
|
+
/**
|
|
498
|
+
* The Metronome ID of the charge to add to the invoice. Note that the charge must
|
|
499
|
+
* be on a product that is not on the current plan, and the product must have only
|
|
500
|
+
* fixed charges.
|
|
501
|
+
*/
|
|
502
|
+
charge_id: string;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* The Metronome ID of the customer plan to add the charge to.
|
|
506
|
+
*/
|
|
507
|
+
customer_plan_id: string;
|
|
508
|
+
|
|
509
|
+
description: string;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* The start_timestamp of the invoice to add the charge to.
|
|
513
|
+
*/
|
|
514
|
+
invoice_start_timestamp: string;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* The price of the charge. This price will match the currency on the invoice, e.g.
|
|
518
|
+
* USD cents.
|
|
519
|
+
*/
|
|
520
|
+
price: number;
|
|
521
|
+
|
|
522
|
+
quantity: number;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export namespace Invoices {
|
|
526
|
+
export import Invoice = InvoicesAPI.Invoice;
|
|
527
|
+
export import InvoiceRetrieveResponse = InvoicesAPI.InvoiceRetrieveResponse;
|
|
528
|
+
export import InvoiceListResponse = InvoicesAPI.InvoiceListResponse;
|
|
529
|
+
export import InvoiceAddChargeResponse = InvoicesAPI.InvoiceAddChargeResponse;
|
|
530
|
+
export import InvoiceRetrieveParams = InvoicesAPI.InvoiceRetrieveParams;
|
|
531
|
+
export import InvoiceListParams = InvoicesAPI.InvoiceListParams;
|
|
532
|
+
export import InvoiceAddChargeParams = InvoicesAPI.InvoiceAddChargeParams;
|
|
533
|
+
}
|