@openmeter/client 1.0.0-beta-4bc7392a70e6
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/README.md +318 -0
- package/dist/core.d.ts +10 -0
- package/dist/core.js +38 -0
- package/dist/funcs/addons.d.ts +11 -0
- package/dist/funcs/addons.js +53 -0
- package/dist/funcs/apps.d.ts +6 -0
- package/dist/funcs/apps.js +16 -0
- package/dist/funcs/billing.d.ts +9 -0
- package/dist/funcs/billing.js +33 -0
- package/dist/funcs/currencies.d.ts +8 -0
- package/dist/funcs/currencies.js +35 -0
- package/dist/funcs/customers.d.ts +21 -0
- package/dist/funcs/customers.js +141 -0
- package/dist/funcs/defaults.d.ts +6 -0
- package/dist/funcs/defaults.js +13 -0
- package/dist/funcs/entitlements.d.ts +5 -0
- package/dist/funcs/entitlements.js +10 -0
- package/dist/funcs/events.d.ts +6 -0
- package/dist/funcs/events.js +19 -0
- package/dist/funcs/features.d.ts +10 -0
- package/dist/funcs/features.js +49 -0
- package/dist/funcs/governance.d.ts +5 -0
- package/dist/funcs/governance.js +16 -0
- package/dist/funcs/index.d.ts +17 -0
- package/dist/funcs/index.js +17 -0
- package/dist/funcs/llmCost.d.ts +9 -0
- package/dist/funcs/llmCost.js +42 -0
- package/dist/funcs/meters.d.ts +10 -0
- package/dist/funcs/meters.js +49 -0
- package/dist/funcs/planAddons.d.ts +9 -0
- package/dist/funcs/planAddons.js +48 -0
- package/dist/funcs/plans.d.ts +11 -0
- package/dist/funcs/plans.js +47 -0
- package/dist/funcs/subscriptions.d.ts +12 -0
- package/dist/funcs/subscriptions.js +64 -0
- package/dist/funcs/tax.d.ts +9 -0
- package/dist/funcs/tax.js +40 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +23 -0
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.js +7 -0
- package/dist/lib/encodings.d.ts +8 -0
- package/dist/lib/encodings.js +56 -0
- package/dist/lib/request.d.ts +3 -0
- package/dist/lib/request.js +11 -0
- package/dist/lib/to-error.d.ts +2 -0
- package/dist/lib/to-error.js +16 -0
- package/dist/lib/types.d.ts +15 -0
- package/dist/lib/types.js +13 -0
- package/dist/models/errors.d.ts +16 -0
- package/dist/models/errors.js +28 -0
- package/dist/models/operations/addons.d.ts +38 -0
- package/dist/models/operations/addons.js +2 -0
- package/dist/models/operations/apps.d.ts +17 -0
- package/dist/models/operations/apps.js +2 -0
- package/dist/models/operations/billing.d.ts +26 -0
- package/dist/models/operations/billing.js +2 -0
- package/dist/models/operations/currencies.d.ts +35 -0
- package/dist/models/operations/currencies.js +2 -0
- package/dist/models/operations/customers.d.ts +117 -0
- package/dist/models/operations/customers.js +2 -0
- package/dist/models/operations/defaults.d.ts +6 -0
- package/dist/models/operations/defaults.js +2 -0
- package/dist/models/operations/entitlements.d.ts +6 -0
- package/dist/models/operations/entitlements.js +2 -0
- package/dist/models/operations/events.d.ts +13 -0
- package/dist/models/operations/events.js +2 -0
- package/dist/models/operations/features.d.ts +35 -0
- package/dist/models/operations/features.js +2 -0
- package/dist/models/operations/governance.d.ts +9 -0
- package/dist/models/operations/governance.js +2 -0
- package/dist/models/operations/llmCost.d.ts +35 -0
- package/dist/models/operations/llmCost.js +2 -0
- package/dist/models/operations/meters.d.ts +35 -0
- package/dist/models/operations/meters.js +2 -0
- package/dist/models/operations/planAddons.d.ts +34 -0
- package/dist/models/operations/planAddons.js +2 -0
- package/dist/models/operations/plans.d.ts +38 -0
- package/dist/models/operations/plans.js +2 -0
- package/dist/models/operations/subscriptions.d.ts +52 -0
- package/dist/models/operations/subscriptions.js +2 -0
- package/dist/models/operations/tax.d.ts +28 -0
- package/dist/models/operations/tax.js +2 -0
- package/dist/models/schemas.d.ts +11372 -0
- package/dist/models/schemas.js +4023 -0
- package/dist/models/types.d.ts +3385 -0
- package/dist/models/types.js +2 -0
- package/dist/sdk/addons.d.ts +15 -0
- package/dist/sdk/addons.js +30 -0
- package/dist/sdk/apps.d.ts +10 -0
- package/dist/sdk/apps.js +15 -0
- package/dist/sdk/billing.d.ts +13 -0
- package/dist/sdk/billing.js +24 -0
- package/dist/sdk/currencies.d.ts +12 -0
- package/dist/sdk/currencies.js +21 -0
- package/dist/sdk/customers.d.ts +67 -0
- package/dist/sdk/customers.js +130 -0
- package/dist/sdk/defaults.d.ts +10 -0
- package/dist/sdk/defaults.js +15 -0
- package/dist/sdk/entitlements.d.ts +9 -0
- package/dist/sdk/entitlements.js +12 -0
- package/dist/sdk/events.d.ts +10 -0
- package/dist/sdk/events.js +15 -0
- package/dist/sdk/features.d.ts +14 -0
- package/dist/sdk/features.js +27 -0
- package/dist/sdk/governance.d.ts +9 -0
- package/dist/sdk/governance.js +12 -0
- package/dist/sdk/llmCost.d.ts +13 -0
- package/dist/sdk/llmCost.js +24 -0
- package/dist/sdk/meters.d.ts +14 -0
- package/dist/sdk/meters.js +27 -0
- package/dist/sdk/planAddons.d.ts +13 -0
- package/dist/sdk/planAddons.js +24 -0
- package/dist/sdk/plans.d.ts +15 -0
- package/dist/sdk/plans.js +30 -0
- package/dist/sdk/sdk.d.ts +52 -0
- package/dist/sdk/sdk.js +84 -0
- package/dist/sdk/subscriptions.d.ts +16 -0
- package/dist/sdk/subscriptions.js +33 -0
- package/dist/sdk/tax.d.ts +13 -0
- package/dist/sdk/tax.js +24 -0
- package/package.json +33 -0
|
@@ -0,0 +1,3385 @@
|
|
|
1
|
+
/** Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\_". */
|
|
2
|
+
export type Labels = Record<string, string>;
|
|
3
|
+
/** Determines which page of the collection to retrieve. */
|
|
4
|
+
export interface CursorPaginationQueryPage {
|
|
5
|
+
/** The number of items to include per page. */
|
|
6
|
+
size?: number;
|
|
7
|
+
/** Request the next page of data, starting with the item after this parameter. */
|
|
8
|
+
after?: string;
|
|
9
|
+
/** Request the previous page of data, starting with the item before this parameter. */
|
|
10
|
+
before?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Sort query. The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order. */
|
|
13
|
+
export interface SortQuery {
|
|
14
|
+
/** The attribute to sort by. */
|
|
15
|
+
by: string;
|
|
16
|
+
/** The sort order. `asc` for ascending, `desc` for descending. */
|
|
17
|
+
order: 'asc' | 'desc';
|
|
18
|
+
}
|
|
19
|
+
/** Event validation errors. */
|
|
20
|
+
export interface IngestedEventValidationError {
|
|
21
|
+
/** The machine readable code of the error. */
|
|
22
|
+
code: string;
|
|
23
|
+
/** The human readable description of the error. */
|
|
24
|
+
message: string;
|
|
25
|
+
/** Additional attributes. */
|
|
26
|
+
attributes?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
/** Cursor pagination metadata. */
|
|
29
|
+
export interface CursorMetaPage {
|
|
30
|
+
/** URI to the first page. */
|
|
31
|
+
first?: string;
|
|
32
|
+
/** URI to the last page. */
|
|
33
|
+
last?: string;
|
|
34
|
+
/** URI to the next page. */
|
|
35
|
+
next?: string;
|
|
36
|
+
/** URI to the previous page. */
|
|
37
|
+
previous?: string;
|
|
38
|
+
/** Requested page size. */
|
|
39
|
+
size?: number;
|
|
40
|
+
}
|
|
41
|
+
/** Standard error response. */
|
|
42
|
+
export interface BaseError {
|
|
43
|
+
/** Type contains a URI that identifies the problem type. */
|
|
44
|
+
type: string;
|
|
45
|
+
/** The HTTP status code generated by the origin server for this occurrence of the problem. */
|
|
46
|
+
status: number;
|
|
47
|
+
/** A a short, human-readable summary of the problem type. */
|
|
48
|
+
title: string;
|
|
49
|
+
/** A human-readable explanation specific to this occurrence of the problem. */
|
|
50
|
+
detail: string;
|
|
51
|
+
/** A URI reference that identifies the specific occurrence of the problem. */
|
|
52
|
+
instance: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
/** Pagination information. */
|
|
56
|
+
export interface PageMeta {
|
|
57
|
+
/** Page number. */
|
|
58
|
+
number: number;
|
|
59
|
+
/** Page size. */
|
|
60
|
+
size: number;
|
|
61
|
+
/** Total number of items in the collection. */
|
|
62
|
+
total: number;
|
|
63
|
+
}
|
|
64
|
+
/** A query filter for a string attribute. Operators are mutually exclusive, only one operator is allowed at a time. */
|
|
65
|
+
export interface QueryFilterString {
|
|
66
|
+
/** The attribute equals the provided value. */
|
|
67
|
+
eq?: string;
|
|
68
|
+
/** The attribute does not equal the provided value. */
|
|
69
|
+
neq?: string;
|
|
70
|
+
/** The attribute is one of the provided values. */
|
|
71
|
+
in?: string[];
|
|
72
|
+
/** The attribute is not one of the provided values. */
|
|
73
|
+
nin?: string[];
|
|
74
|
+
/** The attribute contains the provided value. */
|
|
75
|
+
contains?: string;
|
|
76
|
+
/** The attribute does not contain the provided value. */
|
|
77
|
+
ncontains?: string;
|
|
78
|
+
/** Combines the provided filters with a logical AND. */
|
|
79
|
+
and?: QueryFilterString[];
|
|
80
|
+
/** Combines the provided filters with a logical OR. */
|
|
81
|
+
or?: QueryFilterString[];
|
|
82
|
+
}
|
|
83
|
+
/** Custom text displayed at various stages of the checkout flow. */
|
|
84
|
+
export interface AppStripeCheckoutSessionCustomTextParams {
|
|
85
|
+
/** Text displayed after the payment confirmation button. */
|
|
86
|
+
after_submit?: {
|
|
87
|
+
message?: string;
|
|
88
|
+
};
|
|
89
|
+
/** Text displayed alongside shipping address collection. */
|
|
90
|
+
shipping_address?: {
|
|
91
|
+
message?: string;
|
|
92
|
+
};
|
|
93
|
+
/** Text displayed alongside the payment confirmation button. */
|
|
94
|
+
submit?: {
|
|
95
|
+
message?: string;
|
|
96
|
+
};
|
|
97
|
+
/** Text replacing the default terms of service agreement text. */
|
|
98
|
+
terms_of_service_acceptance?: {
|
|
99
|
+
message?: string;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/** Request to create a Stripe Customer Portal Session. */
|
|
103
|
+
export interface AppStripeCreateCustomerPortalSessionOptions {
|
|
104
|
+
/** The ID of an existing [Stripe configuration](https://docs.stripe.com/api/customer_portal/configurations) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. */
|
|
105
|
+
configuration_id?: string;
|
|
106
|
+
/** The IETF [language tag](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-locale) of the locale customer portal is displayed in. If blank or `auto`, the customer's preferred_locales or browser's locale is used. */
|
|
107
|
+
locale?: string;
|
|
108
|
+
/** The [URL to redirect](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) the customer to after they have completed their requested actions. */
|
|
109
|
+
return_url?: string;
|
|
110
|
+
}
|
|
111
|
+
/** Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\_". */
|
|
112
|
+
export type CreateLabels = Record<string, string>;
|
|
113
|
+
/** Free price. */
|
|
114
|
+
export interface PriceFree {
|
|
115
|
+
/** The type of the price. */
|
|
116
|
+
type: 'free';
|
|
117
|
+
}
|
|
118
|
+
/** The tax config for Stripe. */
|
|
119
|
+
export interface TaxConfigStripe {
|
|
120
|
+
/** Product [tax code](https://docs.stripe.com/tax/tax-codes). */
|
|
121
|
+
code: string;
|
|
122
|
+
}
|
|
123
|
+
/** External invoicing tax config. */
|
|
124
|
+
export interface TaxConfigExternalInvoicing {
|
|
125
|
+
/** The tax code should be interpreted by the external invoicing provider. */
|
|
126
|
+
code: string;
|
|
127
|
+
}
|
|
128
|
+
/** Discounts applicable to flat fee charges. This is the same as `ProductCatalog.Discounts` but without the `usage` field, which is not applicable to flat fee charges. */
|
|
129
|
+
export interface FlatFeeDiscounts {
|
|
130
|
+
/** Percentage discount applied to the price (0–100). */
|
|
131
|
+
percentage?: number;
|
|
132
|
+
}
|
|
133
|
+
/** BillingWorkflowCollectionAlignmentSubscription specifies the alignment for collecting the pending line items into an invoice. */
|
|
134
|
+
export interface WorkflowCollectionAlignmentSubscription {
|
|
135
|
+
/** The type of alignment. */
|
|
136
|
+
type: 'subscription';
|
|
137
|
+
}
|
|
138
|
+
/** Invoice settings for a billing workflow. */
|
|
139
|
+
export interface WorkflowInvoicingSettings {
|
|
140
|
+
/** Whether to automatically issue the invoice after the draftPeriod has passed. */
|
|
141
|
+
auto_advance: boolean;
|
|
142
|
+
/** The period for the invoice to be kept in draft status for manual reviews. */
|
|
143
|
+
draft_period: string;
|
|
144
|
+
/** Should progressive billing be allowed for this workflow? */
|
|
145
|
+
progressive_billing: boolean;
|
|
146
|
+
}
|
|
147
|
+
/** Payment settings for a billing workflow when the collection method is charge automatically. */
|
|
148
|
+
export interface WorkflowPaymentChargeAutomaticallySettings {
|
|
149
|
+
/** The collection method for the invoice. */
|
|
150
|
+
collection_method: 'charge_automatically';
|
|
151
|
+
}
|
|
152
|
+
/** Payment settings for a billing workflow when the collection method is send invoice. */
|
|
153
|
+
export interface WorkflowPaymentSendInvoiceSettings {
|
|
154
|
+
/** The collection method for the invoice. */
|
|
155
|
+
collection_method: 'send_invoice';
|
|
156
|
+
/** The period after which the invoice is due. With some payment solutions it's only applicable for manual collection method. */
|
|
157
|
+
due_after: string;
|
|
158
|
+
}
|
|
159
|
+
/** LLM Provider */
|
|
160
|
+
export interface LlmCostProvider {
|
|
161
|
+
/** Identifier of the provider, e.g., "openai", "anthropic". */
|
|
162
|
+
id: string;
|
|
163
|
+
/** Name of the provider, e.g., "OpenAI", "Anthropic". */
|
|
164
|
+
name: string;
|
|
165
|
+
}
|
|
166
|
+
/** LLM Model */
|
|
167
|
+
export interface LlmCostModel {
|
|
168
|
+
/** Identifier of the model, e.g., "gpt-4", "claude-3-5-sonnet". */
|
|
169
|
+
id: string;
|
|
170
|
+
/** Name of the model, e.g., "GPT-4", "Claude 3.5 Sonnet". */
|
|
171
|
+
name: string;
|
|
172
|
+
}
|
|
173
|
+
/** Validation errors providing detailed description of the issue. */
|
|
174
|
+
export interface ProductCatalogValidationError {
|
|
175
|
+
/** Machine-readable error code. */
|
|
176
|
+
code: string;
|
|
177
|
+
/** Human-readable description of the error. */
|
|
178
|
+
message: string;
|
|
179
|
+
/** Additional structured context. */
|
|
180
|
+
attributes?: Record<string, unknown>;
|
|
181
|
+
/** The path to the field. */
|
|
182
|
+
field: string;
|
|
183
|
+
}
|
|
184
|
+
/** List of customer identifiers to evaluate access for. */
|
|
185
|
+
export interface GovernanceQueryRequestCustomers {
|
|
186
|
+
/** Each entry can be a customer `key` or a usage-attribution subject `key`. Identifiers that cannot be resolved to a customer are reported in the response `errors` array. */
|
|
187
|
+
keys: string[];
|
|
188
|
+
}
|
|
189
|
+
/** Optional list of feature keys to evaluate access for. If omitted, all features available in the organization are returned. Providing this list is recommended to reduce the response size and the load on the backend services. */
|
|
190
|
+
export interface GovernanceQueryRequestFeatures {
|
|
191
|
+
/** List of feature keys to evaluate access for. */
|
|
192
|
+
keys: string[];
|
|
193
|
+
}
|
|
194
|
+
/** A query filter for an integer attribute. Operators are mutually exclusive, only one operator is allowed at a time. */
|
|
195
|
+
export interface QueryFilterInteger {
|
|
196
|
+
/** The attribute equals the provided value. */
|
|
197
|
+
eq?: number;
|
|
198
|
+
/** The attribute does not equal the provided value. */
|
|
199
|
+
neq?: number;
|
|
200
|
+
/** The attribute is one of the provided values. */
|
|
201
|
+
in?: number[];
|
|
202
|
+
/** The attribute is not one of the provided values. */
|
|
203
|
+
nin?: number[];
|
|
204
|
+
/** The attribute is greater than the provided value. */
|
|
205
|
+
gt?: number;
|
|
206
|
+
/** The attribute is greater than or equal to the provided value. */
|
|
207
|
+
gte?: number;
|
|
208
|
+
/** The attribute is less than the provided value. */
|
|
209
|
+
lt?: number;
|
|
210
|
+
/** The attribute is less than or equal to the provided value. */
|
|
211
|
+
lte?: number;
|
|
212
|
+
/** Combines the provided filters with a logical AND. */
|
|
213
|
+
and?: QueryFilterInteger[];
|
|
214
|
+
/** Combines the provided filters with a logical OR. */
|
|
215
|
+
or?: QueryFilterInteger[];
|
|
216
|
+
}
|
|
217
|
+
/** A query filter for a float attribute. Operators are mutually exclusive, only one operator is allowed at a time. */
|
|
218
|
+
export interface QueryFilterFloat {
|
|
219
|
+
/** The attribute is greater than the provided value. */
|
|
220
|
+
gt?: number;
|
|
221
|
+
/** The attribute is greater than or equal to the provided value. */
|
|
222
|
+
gte?: number;
|
|
223
|
+
/** The attribute is less than the provided value. */
|
|
224
|
+
lt?: number;
|
|
225
|
+
/** The attribute is less than or equal to the provided value. */
|
|
226
|
+
lte?: number;
|
|
227
|
+
/** Combines the provided filters with a logical AND. */
|
|
228
|
+
and?: QueryFilterFloat[];
|
|
229
|
+
/** Combines the provided filters with a logical OR. */
|
|
230
|
+
or?: QueryFilterFloat[];
|
|
231
|
+
}
|
|
232
|
+
/** A query filter for a boolean attribute. Operators are mutually exclusive, only one operator is allowed at a time. */
|
|
233
|
+
export interface QueryFilterBoolean {
|
|
234
|
+
/** The attribute equals the provided value. */
|
|
235
|
+
eq?: boolean;
|
|
236
|
+
}
|
|
237
|
+
/** Page pagination query. */
|
|
238
|
+
export interface PagePaginationQuery {
|
|
239
|
+
/** Determines which page of the collection to retrieve. */
|
|
240
|
+
page?: {
|
|
241
|
+
size?: number;
|
|
242
|
+
number?: number;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/** Public labels store information about an entity that can be used for filtering a list of objects. */
|
|
246
|
+
export type PublicLabels = Record<string, string>;
|
|
247
|
+
/** The system account access token is meant for automations and integrations that are not directly associated with a human identity. */
|
|
248
|
+
export interface SystemAccountAccessToken {
|
|
249
|
+
/** Http authentication */
|
|
250
|
+
type: 'http';
|
|
251
|
+
/** bearer auth scheme */
|
|
252
|
+
scheme: 'Bearer';
|
|
253
|
+
}
|
|
254
|
+
/** The personal access token is meant to be used as an alternative to basic-auth when accessing Konnect via APIs. */
|
|
255
|
+
export interface PersonalAccessToken {
|
|
256
|
+
/** Http authentication */
|
|
257
|
+
type: 'http';
|
|
258
|
+
/** bearer auth scheme */
|
|
259
|
+
scheme: 'Bearer';
|
|
260
|
+
}
|
|
261
|
+
/** The Konnect access token is meant to be used by the Konnect dashboard and the decK CLI authenticate with. */
|
|
262
|
+
export interface KonnectAccessToken {
|
|
263
|
+
/** Http authentication */
|
|
264
|
+
type: 'http';
|
|
265
|
+
/** bearer auth scheme */
|
|
266
|
+
scheme: 'Bearer';
|
|
267
|
+
}
|
|
268
|
+
/** Meter update request. */
|
|
269
|
+
export interface UpdateMeterRequest {
|
|
270
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
271
|
+
name?: string;
|
|
272
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
273
|
+
description?: string;
|
|
274
|
+
labels?: Labels;
|
|
275
|
+
/** Named JSONPath expressions to extract the group by values from the event data. Keys must be unique and consist only alphanumeric and underscore characters. */
|
|
276
|
+
dimensions?: Record<string, string>;
|
|
277
|
+
}
|
|
278
|
+
/** Stripe customer data. */
|
|
279
|
+
export interface AppCustomerDataStripe {
|
|
280
|
+
/** The Stripe customer ID used. */
|
|
281
|
+
customer_id?: string;
|
|
282
|
+
/** The Stripe default payment method ID. */
|
|
283
|
+
default_payment_method_id?: string;
|
|
284
|
+
/** Labels for this Stripe integration on the customer. */
|
|
285
|
+
labels?: Labels;
|
|
286
|
+
}
|
|
287
|
+
/** External invoicing customer data. */
|
|
288
|
+
export interface AppCustomerDataExternalInvoicing {
|
|
289
|
+
/** Labels for this external invoicing integration on the customer. */
|
|
290
|
+
labels?: Labels;
|
|
291
|
+
}
|
|
292
|
+
/** Filter options for listing cost bases. */
|
|
293
|
+
export interface ListCostBasesParamsFilter {
|
|
294
|
+
/** Filter cost bases by fiat currency code. */
|
|
295
|
+
fiat_code?: string;
|
|
296
|
+
}
|
|
297
|
+
/** Flat price. */
|
|
298
|
+
export interface PriceFlat {
|
|
299
|
+
/** The type of the price. */
|
|
300
|
+
type: 'flat';
|
|
301
|
+
/** The amount of the flat price. */
|
|
302
|
+
amount: string;
|
|
303
|
+
}
|
|
304
|
+
/** Unit price. Charges a fixed rate per billing unit. When UnitConfig is present on the rate card, billing units are the converted quantities (e.g. GB instead of bytes). */
|
|
305
|
+
export interface PriceUnit {
|
|
306
|
+
/** The type of the price. */
|
|
307
|
+
type: 'unit';
|
|
308
|
+
/** The amount of the unit price. */
|
|
309
|
+
amount: string;
|
|
310
|
+
}
|
|
311
|
+
/** Monetary amount in a specific currency. */
|
|
312
|
+
export interface CurrencyAmount {
|
|
313
|
+
amount: string;
|
|
314
|
+
currency: string;
|
|
315
|
+
}
|
|
316
|
+
/** Discount configuration for a rate card. */
|
|
317
|
+
export interface RateCardDiscounts {
|
|
318
|
+
/** Percentage discount applied to the price (0–100). */
|
|
319
|
+
percentage?: number;
|
|
320
|
+
/** Number of usage units granted free before billing starts. Only applies to usage-based lines (not flat fees). Usage is treated as zero until this amount is exhausted. */
|
|
321
|
+
usage?: string;
|
|
322
|
+
}
|
|
323
|
+
/** Totals contains the summaries of all calculations for a billing resource. */
|
|
324
|
+
export interface Totals {
|
|
325
|
+
/** The total value of the resource before taxes, discounts and commitments. */
|
|
326
|
+
amount: string;
|
|
327
|
+
/** The total tax amount applied to the resource. */
|
|
328
|
+
taxes_total: string;
|
|
329
|
+
/** The total tax amount already included in the resource amount. */
|
|
330
|
+
taxes_inclusive_total: string;
|
|
331
|
+
/** The total tax amount added on top of the resource amount. */
|
|
332
|
+
taxes_exclusive_total: string;
|
|
333
|
+
/** The total amount contributed by additional charges. */
|
|
334
|
+
charges_total: string;
|
|
335
|
+
/** The total amount deducted through discounts. */
|
|
336
|
+
discounts_total: string;
|
|
337
|
+
/** The total amount deducted through credits before taxes are applied. */
|
|
338
|
+
credits_total: string;
|
|
339
|
+
/** The final total value of the resource after taxes, discounts and commitments. */
|
|
340
|
+
total: string;
|
|
341
|
+
}
|
|
342
|
+
/** A fixed per-unit cost amount. */
|
|
343
|
+
export interface FeatureManualUnitCost {
|
|
344
|
+
/** The type discriminator for manual unit cost. */
|
|
345
|
+
type: 'manual';
|
|
346
|
+
/** Fixed per-unit cost amount in USD. */
|
|
347
|
+
amount: string;
|
|
348
|
+
}
|
|
349
|
+
/** Resolved per-token pricing from the LLM cost database. */
|
|
350
|
+
export interface FeatureLlmUnitCostPricing {
|
|
351
|
+
/** Cost per input token in USD. */
|
|
352
|
+
input_per_token: string;
|
|
353
|
+
/** Cost per output token in USD. */
|
|
354
|
+
output_per_token: string;
|
|
355
|
+
/** Cost per cache read token in USD. */
|
|
356
|
+
cache_read_per_token?: string;
|
|
357
|
+
/** Cost per reasoning token in USD. */
|
|
358
|
+
reasoning_per_token?: string;
|
|
359
|
+
/** Cost per cache write token in USD. */
|
|
360
|
+
cache_write_per_token?: string;
|
|
361
|
+
}
|
|
362
|
+
/** Token pricing for an LLM model, denominated per token. */
|
|
363
|
+
export interface LlmCostModelPricing {
|
|
364
|
+
/** Input price per token (USD). */
|
|
365
|
+
input_per_token: string;
|
|
366
|
+
/** Output price per token (USD). */
|
|
367
|
+
output_per_token: string;
|
|
368
|
+
/** Cache read price per token (USD). */
|
|
369
|
+
cache_read_per_token?: string;
|
|
370
|
+
/** Cache write price per token (USD). */
|
|
371
|
+
cache_write_per_token?: string;
|
|
372
|
+
/** Reasoning output price per token (USD). */
|
|
373
|
+
reasoning_per_token?: string;
|
|
374
|
+
}
|
|
375
|
+
/** Spend commitments for a rate card. The customer is committed to spend at least the minimum amount and at most the maximum amount. */
|
|
376
|
+
export interface SpendCommitments {
|
|
377
|
+
/** The customer is committed to spend at least the amount. */
|
|
378
|
+
minimum_amount?: string;
|
|
379
|
+
/** The customer is limited to spend at most the amount. */
|
|
380
|
+
maximum_amount?: string;
|
|
381
|
+
}
|
|
382
|
+
/** A query filter for a numeric attribute. Operators are mutually exclusive, only one operator is allowed at a time. */
|
|
383
|
+
export interface QueryFilterNumeric {
|
|
384
|
+
/** The attribute is greater than the provided value. */
|
|
385
|
+
gt?: string;
|
|
386
|
+
/** The attribute is greater than or equal to the provided value. */
|
|
387
|
+
gte?: string;
|
|
388
|
+
/** The attribute is less than the provided value. */
|
|
389
|
+
lt?: string;
|
|
390
|
+
/** The attribute is less than or equal to the provided value. */
|
|
391
|
+
lte?: string;
|
|
392
|
+
/** Combines the provided filters with a logical AND. */
|
|
393
|
+
and?: QueryFilterNumeric[];
|
|
394
|
+
/** Combines the provided filters with a logical OR. */
|
|
395
|
+
or?: QueryFilterNumeric[];
|
|
396
|
+
}
|
|
397
|
+
/** Cursor page query. */
|
|
398
|
+
export interface CursorPaginationQuery {
|
|
399
|
+
page?: CursorPaginationQueryPage;
|
|
400
|
+
}
|
|
401
|
+
/** Filter options for listing meters. */
|
|
402
|
+
export interface ListMetersParamsFilter {
|
|
403
|
+
/** Filter meters by key. */
|
|
404
|
+
key?: string | {
|
|
405
|
+
eq?: string;
|
|
406
|
+
neq?: string;
|
|
407
|
+
contains?: string;
|
|
408
|
+
ocontains?: string[];
|
|
409
|
+
oeq?: string[];
|
|
410
|
+
gt?: string;
|
|
411
|
+
gte?: string;
|
|
412
|
+
lt?: string;
|
|
413
|
+
lte?: string;
|
|
414
|
+
exists?: boolean;
|
|
415
|
+
};
|
|
416
|
+
/** Filter meters by name. */
|
|
417
|
+
name?: string | {
|
|
418
|
+
eq?: string;
|
|
419
|
+
neq?: string;
|
|
420
|
+
contains?: string;
|
|
421
|
+
ocontains?: string[];
|
|
422
|
+
oeq?: string[];
|
|
423
|
+
gt?: string;
|
|
424
|
+
gte?: string;
|
|
425
|
+
lt?: string;
|
|
426
|
+
lte?: string;
|
|
427
|
+
exists?: boolean;
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
/** Filter options for listing LLM cost prices. */
|
|
431
|
+
export interface ListLlmCostPricesParamsFilter {
|
|
432
|
+
/** Filter by provider. e.g. ?filter[provider][eq]=openai */
|
|
433
|
+
provider?: string | {
|
|
434
|
+
eq?: string;
|
|
435
|
+
neq?: string;
|
|
436
|
+
contains?: string;
|
|
437
|
+
ocontains?: string[];
|
|
438
|
+
oeq?: string[];
|
|
439
|
+
gt?: string;
|
|
440
|
+
gte?: string;
|
|
441
|
+
lt?: string;
|
|
442
|
+
lte?: string;
|
|
443
|
+
exists?: boolean;
|
|
444
|
+
};
|
|
445
|
+
/** Filter by model ID. e.g. ?filter[model_id][eq]=gpt-4 */
|
|
446
|
+
model_id?: string | {
|
|
447
|
+
eq?: string;
|
|
448
|
+
neq?: string;
|
|
449
|
+
contains?: string;
|
|
450
|
+
ocontains?: string[];
|
|
451
|
+
oeq?: string[];
|
|
452
|
+
gt?: string;
|
|
453
|
+
gte?: string;
|
|
454
|
+
lt?: string;
|
|
455
|
+
lte?: string;
|
|
456
|
+
exists?: boolean;
|
|
457
|
+
};
|
|
458
|
+
/** Filter by model name. e.g. ?filter[model_name][contains]=gpt */
|
|
459
|
+
model_name?: string | {
|
|
460
|
+
eq?: string;
|
|
461
|
+
neq?: string;
|
|
462
|
+
contains?: string;
|
|
463
|
+
ocontains?: string[];
|
|
464
|
+
oeq?: string[];
|
|
465
|
+
gt?: string;
|
|
466
|
+
gte?: string;
|
|
467
|
+
lt?: string;
|
|
468
|
+
lte?: string;
|
|
469
|
+
exists?: boolean;
|
|
470
|
+
};
|
|
471
|
+
/** Filter by currency code. e.g. ?filter[currency][eq]=USD */
|
|
472
|
+
currency?: string | {
|
|
473
|
+
eq?: string;
|
|
474
|
+
neq?: string;
|
|
475
|
+
contains?: string;
|
|
476
|
+
ocontains?: string[];
|
|
477
|
+
oeq?: string[];
|
|
478
|
+
gt?: string;
|
|
479
|
+
gte?: string;
|
|
480
|
+
lt?: string;
|
|
481
|
+
lte?: string;
|
|
482
|
+
exists?: boolean;
|
|
483
|
+
};
|
|
484
|
+
/** Filter by source. e.g. ?filter[source][eq]=system */
|
|
485
|
+
source?: string | {
|
|
486
|
+
eq?: string;
|
|
487
|
+
neq?: string;
|
|
488
|
+
contains?: string;
|
|
489
|
+
ocontains?: string[];
|
|
490
|
+
oeq?: string[];
|
|
491
|
+
gt?: string;
|
|
492
|
+
gte?: string;
|
|
493
|
+
lt?: string;
|
|
494
|
+
lte?: string;
|
|
495
|
+
exists?: boolean;
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
/** Filters on the resource's `labels` field. The schema is a map keyed by the label name; each value is a `StringFieldFilter`. Both deepObject forms are accepted: `filter[labels][key]=value` (nested) and `filter[labels.key]=value` (dot-notation). */
|
|
499
|
+
export type LabelsFieldFilter = Record<string, string | {
|
|
500
|
+
eq?: string;
|
|
501
|
+
neq?: string;
|
|
502
|
+
contains?: string;
|
|
503
|
+
ocontains?: string[];
|
|
504
|
+
oeq?: string[];
|
|
505
|
+
gt?: string;
|
|
506
|
+
gte?: string;
|
|
507
|
+
lt?: string;
|
|
508
|
+
lte?: string;
|
|
509
|
+
exists?: boolean;
|
|
510
|
+
}>;
|
|
511
|
+
/** Customer reference. */
|
|
512
|
+
export interface CustomerReference {
|
|
513
|
+
id: string;
|
|
514
|
+
}
|
|
515
|
+
/** Billing profile reference. */
|
|
516
|
+
export interface ProfileReference {
|
|
517
|
+
/** The ID of the billing profile. */
|
|
518
|
+
id: string;
|
|
519
|
+
}
|
|
520
|
+
/** TaxCode reference. */
|
|
521
|
+
export interface CreateResourceReference {
|
|
522
|
+
id: string;
|
|
523
|
+
}
|
|
524
|
+
/** TaxCode reference. */
|
|
525
|
+
export interface TaxCodeReference {
|
|
526
|
+
id: string;
|
|
527
|
+
}
|
|
528
|
+
/** Invoice references for the grant. */
|
|
529
|
+
export interface CreditGrantInvoiceReference {
|
|
530
|
+
/** Identifier of the invoice associated with the grant. */
|
|
531
|
+
id?: string;
|
|
532
|
+
/** Identifier of the invoice line associated with the grant. */
|
|
533
|
+
line?: {
|
|
534
|
+
id: string;
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
/** Customer reference. */
|
|
538
|
+
export interface BillingCustomerReference {
|
|
539
|
+
/** The ID of the customer. */
|
|
540
|
+
id: string;
|
|
541
|
+
}
|
|
542
|
+
/** Subscription reference represents a reference to the specific subscription item this entity represents. */
|
|
543
|
+
export interface SubscriptionReference {
|
|
544
|
+
/** The ID of the subscription. */
|
|
545
|
+
id: string;
|
|
546
|
+
/** The phase of the subscription. */
|
|
547
|
+
phase: {
|
|
548
|
+
id: string;
|
|
549
|
+
item: {
|
|
550
|
+
id: string;
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
/** Addon reference. */
|
|
555
|
+
export interface AddonReference {
|
|
556
|
+
id: string;
|
|
557
|
+
}
|
|
558
|
+
/** App reference. */
|
|
559
|
+
export interface AppReference {
|
|
560
|
+
/** The ID of the app. */
|
|
561
|
+
id: string;
|
|
562
|
+
}
|
|
563
|
+
/** Currency describes a currency supported by the billing system. */
|
|
564
|
+
export interface CurrencyFiat {
|
|
565
|
+
id: string;
|
|
566
|
+
/** The type of the currency. */
|
|
567
|
+
type: 'fiat';
|
|
568
|
+
/** The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro". */
|
|
569
|
+
name: string;
|
|
570
|
+
/** Description of the currency. */
|
|
571
|
+
description?: string;
|
|
572
|
+
/** The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro. */
|
|
573
|
+
symbol?: string;
|
|
574
|
+
code: string;
|
|
575
|
+
}
|
|
576
|
+
/** Feature reference. */
|
|
577
|
+
export interface FeatureReference {
|
|
578
|
+
id: string;
|
|
579
|
+
}
|
|
580
|
+
/** Metering event following the CloudEvents specification. */
|
|
581
|
+
export interface Event {
|
|
582
|
+
/** Identifies the event. */
|
|
583
|
+
id: string;
|
|
584
|
+
/** Identifies the context in which an event happened. */
|
|
585
|
+
source: string;
|
|
586
|
+
/** The version of the CloudEvents specification which the event uses. */
|
|
587
|
+
specversion: string;
|
|
588
|
+
/** Contains a value describing the type of event related to the originating occurrence. */
|
|
589
|
+
type: string;
|
|
590
|
+
/** Content type of the CloudEvents data value. Only the value "application/json" is allowed over HTTP. */
|
|
591
|
+
datacontenttype?: 'application/json' | null;
|
|
592
|
+
/** Identifies the schema that data adheres to. */
|
|
593
|
+
dataschema?: string | null;
|
|
594
|
+
/** Describes the subject of the event in the context of the event producer (identified by source). */
|
|
595
|
+
subject: string;
|
|
596
|
+
/** Timestamp of when the occurrence happened. Must adhere to RFC 3339. */
|
|
597
|
+
time?: string | null;
|
|
598
|
+
/** The event payload. Optional, if present it must be a JSON object. */
|
|
599
|
+
data?: Record<string, unknown> | null;
|
|
600
|
+
}
|
|
601
|
+
/** A row in the result of a meter query. */
|
|
602
|
+
export interface MeterQueryRow {
|
|
603
|
+
/** The aggregated value. */
|
|
604
|
+
value: string;
|
|
605
|
+
/** The start of the time bucket the value is aggregated over. */
|
|
606
|
+
from: string;
|
|
607
|
+
/** The end of the time bucket the value is aggregated over. */
|
|
608
|
+
to: string;
|
|
609
|
+
/** The dimensions the value is aggregated over. `subject` and `customer_id` are reserved dimensions. */
|
|
610
|
+
dimensions: Record<string, string>;
|
|
611
|
+
}
|
|
612
|
+
/** Result of creating a [Stripe Customer Portal Session](https://docs.stripe.com/api/customer_portal/sessions/object). Contains all the information needed to redirect the customer to the Stripe Customer Portal. */
|
|
613
|
+
export interface AppStripeCreateCustomerPortalSessionResult {
|
|
614
|
+
/** The ID of the customer portal session. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-id */
|
|
615
|
+
id: string;
|
|
616
|
+
/** The ID of the stripe customer. */
|
|
617
|
+
stripe_customer_id: string;
|
|
618
|
+
/** Configuration used to customize the customer portal. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-configuration */
|
|
619
|
+
configuration_id: string;
|
|
620
|
+
/** Livemode. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-livemode */
|
|
621
|
+
livemode: boolean;
|
|
622
|
+
/** Created at. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-created */
|
|
623
|
+
created_at: string;
|
|
624
|
+
/** Return URL. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-return_url */
|
|
625
|
+
return_url: string;
|
|
626
|
+
/** The IETF language tag of the locale customer portal is displayed in. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-locale */
|
|
627
|
+
locale: string;
|
|
628
|
+
/** The URL to redirect the customer to after they have completed their requested actions. */
|
|
629
|
+
url: string;
|
|
630
|
+
}
|
|
631
|
+
/** A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end. */
|
|
632
|
+
export interface ClosedPeriod {
|
|
633
|
+
/** The start of the period. The period is inclusive at the start. */
|
|
634
|
+
from: string;
|
|
635
|
+
/** The end of the period. The period is exclusive at the end. */
|
|
636
|
+
to: string;
|
|
637
|
+
}
|
|
638
|
+
/** Describes currency basis supported by billing system. */
|
|
639
|
+
export interface CostBasis {
|
|
640
|
+
id: string;
|
|
641
|
+
/** The fiat currency code for the cost basis. */
|
|
642
|
+
fiat_code: string;
|
|
643
|
+
/** The cost rate for the currency. */
|
|
644
|
+
rate: string;
|
|
645
|
+
/** An ISO-8601 timestamp representation of the date from which the cost basis is effective. If not provided, it will be effective immediately and will be set to `now` by the system. */
|
|
646
|
+
effective_from?: string;
|
|
647
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
648
|
+
created_at: string;
|
|
649
|
+
}
|
|
650
|
+
/** CostBasis create request. */
|
|
651
|
+
export interface CreateCostBasisRequest {
|
|
652
|
+
/** The fiat currency code for the cost basis. */
|
|
653
|
+
fiat_code: string;
|
|
654
|
+
/** The cost rate for the currency. */
|
|
655
|
+
rate: string;
|
|
656
|
+
/** An ISO-8601 timestamp representation of the date from which the cost basis is effective. If not provided, it will be effective immediately and will be set to `now` by the system. */
|
|
657
|
+
effective_from?: string;
|
|
658
|
+
}
|
|
659
|
+
/** A row in the result of a feature cost query. */
|
|
660
|
+
export interface FeatureCostQueryRow {
|
|
661
|
+
/** The metered usage value for the period. */
|
|
662
|
+
usage: string;
|
|
663
|
+
/** The computed cost amount (usage × unit cost). Null when pricing is not available for the given combination of dimensions. */
|
|
664
|
+
cost: string | null;
|
|
665
|
+
/** The currency code of the cost amount. */
|
|
666
|
+
currency: string;
|
|
667
|
+
/** Detail message when cost amount is null, explaining why the cost could not be resolved. */
|
|
668
|
+
detail?: string;
|
|
669
|
+
/** The start of the time bucket the value is aggregated over. */
|
|
670
|
+
from: string;
|
|
671
|
+
/** The end of the time bucket the value is aggregated over. */
|
|
672
|
+
to: string;
|
|
673
|
+
/** The dimensions the value is aggregated over. `subject` and `customer_id` are reserved dimensions. */
|
|
674
|
+
dimensions: Record<string, string>;
|
|
675
|
+
}
|
|
676
|
+
/** Represents common fields of resources. */
|
|
677
|
+
export interface Resource {
|
|
678
|
+
id: string;
|
|
679
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
680
|
+
name: string;
|
|
681
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
682
|
+
description?: string;
|
|
683
|
+
labels?: Labels;
|
|
684
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
685
|
+
created_at: string;
|
|
686
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
687
|
+
updated_at: string;
|
|
688
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
689
|
+
deleted_at?: string;
|
|
690
|
+
}
|
|
691
|
+
/** Represents common fields of immutable resources. */
|
|
692
|
+
export interface ResourceImmutable {
|
|
693
|
+
id: string;
|
|
694
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
695
|
+
name: string;
|
|
696
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
697
|
+
description?: string;
|
|
698
|
+
labels?: Labels;
|
|
699
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
700
|
+
created_at: string;
|
|
701
|
+
}
|
|
702
|
+
/** A query filter for a time attribute. Operators are mutually exclusive, only one operator is allowed at a time. */
|
|
703
|
+
export interface QueryFilterDateTime {
|
|
704
|
+
/** The attribute is greater than the provided value. */
|
|
705
|
+
gt?: string;
|
|
706
|
+
/** The attribute is greater than or equal to the provided value. */
|
|
707
|
+
gte?: string;
|
|
708
|
+
/** The attribute is less than the provided value. */
|
|
709
|
+
lt?: string;
|
|
710
|
+
/** The attribute is less than or equal to the provided value. */
|
|
711
|
+
lte?: string;
|
|
712
|
+
/** Combines the provided filters with a logical AND. */
|
|
713
|
+
and?: QueryFilterDateTime[];
|
|
714
|
+
/** Combines the provided filters with a logical OR. */
|
|
715
|
+
or?: QueryFilterDateTime[];
|
|
716
|
+
}
|
|
717
|
+
/** Cursor pagination metadata. */
|
|
718
|
+
export interface CursorMeta {
|
|
719
|
+
/** Page metadata. */
|
|
720
|
+
page: CursorMetaPage;
|
|
721
|
+
}
|
|
722
|
+
/** A parameter that failed a standard validation rule. */
|
|
723
|
+
export interface InvalidParameterStandard {
|
|
724
|
+
/** The name of the field that failed validation. */
|
|
725
|
+
field: string;
|
|
726
|
+
/** The validation rule that was violated. */
|
|
727
|
+
rule?: 'required' | 'is_array' | 'is_base64' | 'is_boolean' | 'is_date_time' | 'is_integer' | 'is_null' | 'is_number' | 'is_object' | 'is_string' | 'is_uuid' | 'is_fqdn' | 'is_arn' | 'unknown_property' | 'missing_reference' | 'is_label' | 'matches_regex' | 'invalid' | 'is_supported_network_availability_zone_list' | 'is_supported_network_cidr_block' | 'is_supported_provider_region' | 'type';
|
|
728
|
+
/** The part of the request the field came from (e.g. `body`, `query`). */
|
|
729
|
+
source?: string;
|
|
730
|
+
/** A human readable explanation of why the field failed validation. */
|
|
731
|
+
reason: string;
|
|
732
|
+
}
|
|
733
|
+
/** A parameter that failed a minimum-length (or minimum-value) validation rule. */
|
|
734
|
+
export interface InvalidParameterMinimumLength {
|
|
735
|
+
/** The name of the field that failed validation. */
|
|
736
|
+
field: string;
|
|
737
|
+
/** The minimum validation rule that was violated. */
|
|
738
|
+
rule: 'min_length' | 'min_digits' | 'min_lowercase' | 'min_uppercase' | 'min_symbols' | 'min_items' | 'min';
|
|
739
|
+
/** The minimum allowed value or length. */
|
|
740
|
+
minimum: number;
|
|
741
|
+
/** The part of the request the field came from (e.g. `body`, `query`). */
|
|
742
|
+
source?: string;
|
|
743
|
+
/** A human readable explanation of why the field failed validation. */
|
|
744
|
+
reason: string;
|
|
745
|
+
}
|
|
746
|
+
/** A parameter that failed a maximum-length (or maximum-value) validation rule. */
|
|
747
|
+
export interface InvalidParameterMaximumLength {
|
|
748
|
+
/** The name of the field that failed validation. */
|
|
749
|
+
field: string;
|
|
750
|
+
/** The maximum validation rule that was violated. */
|
|
751
|
+
rule: 'max_length' | 'max_items' | 'max';
|
|
752
|
+
/** The maximum allowed value or length. */
|
|
753
|
+
maximum: number;
|
|
754
|
+
/** The part of the request the field came from (e.g. `body`, `query`). */
|
|
755
|
+
source?: string;
|
|
756
|
+
/** A human readable explanation of why the field failed validation. */
|
|
757
|
+
reason: string;
|
|
758
|
+
}
|
|
759
|
+
/** A parameter whose value was not one of the allowed choices. */
|
|
760
|
+
export interface InvalidParameterChoiceItem {
|
|
761
|
+
/** The name of the field that failed validation. */
|
|
762
|
+
field: string;
|
|
763
|
+
/** The enum validation rule that was violated. */
|
|
764
|
+
rule: 'enum';
|
|
765
|
+
/** A human readable explanation of why the field failed validation. */
|
|
766
|
+
reason: string;
|
|
767
|
+
/** The allowed choices for the field. */
|
|
768
|
+
choices: unknown[];
|
|
769
|
+
/** The part of the request the field came from (e.g. `body`, `query`). */
|
|
770
|
+
source?: string;
|
|
771
|
+
}
|
|
772
|
+
/** A parameter that failed a dependent-fields validation rule. */
|
|
773
|
+
export interface InvalidParameterDependentItem {
|
|
774
|
+
/** The name of the field that failed validation. */
|
|
775
|
+
field: string;
|
|
776
|
+
/** The dependent-fields validation rule that was violated. */
|
|
777
|
+
rule: 'dependent_fields';
|
|
778
|
+
/** A human readable explanation of why the field failed validation. */
|
|
779
|
+
reason: string;
|
|
780
|
+
/** The fields that this field depends on. */
|
|
781
|
+
dependents: unknown[];
|
|
782
|
+
/** The part of the request the field came from (e.g. `body`, `query`). */
|
|
783
|
+
source?: string;
|
|
784
|
+
}
|
|
785
|
+
/** Unauthorized. */
|
|
786
|
+
export interface Unauthorized extends BaseError {
|
|
787
|
+
}
|
|
788
|
+
/** Forbidden. */
|
|
789
|
+
export interface Forbidden extends BaseError {
|
|
790
|
+
}
|
|
791
|
+
/** Not Found. */
|
|
792
|
+
export interface NotFound extends BaseError {
|
|
793
|
+
}
|
|
794
|
+
/** Gone. */
|
|
795
|
+
export interface Gone extends BaseError {
|
|
796
|
+
}
|
|
797
|
+
/** Conflict. */
|
|
798
|
+
export interface Conflict extends BaseError {
|
|
799
|
+
}
|
|
800
|
+
/** Payload Too Large. */
|
|
801
|
+
export interface PayloadTooLarge extends BaseError {
|
|
802
|
+
}
|
|
803
|
+
/** Unsupported Media Type. */
|
|
804
|
+
export interface UnsupportedMediaType extends BaseError {
|
|
805
|
+
}
|
|
806
|
+
/** Unprocessable Content. */
|
|
807
|
+
export interface UnprocessableContent extends BaseError {
|
|
808
|
+
}
|
|
809
|
+
/** Too Many Requests. */
|
|
810
|
+
export interface TooManyRequests extends BaseError {
|
|
811
|
+
}
|
|
812
|
+
/** Internal Server Error. */
|
|
813
|
+
export interface Internal extends BaseError {
|
|
814
|
+
}
|
|
815
|
+
/** Not Implemented. */
|
|
816
|
+
export interface NotImplemented extends BaseError {
|
|
817
|
+
}
|
|
818
|
+
/** Not Available. */
|
|
819
|
+
export interface NotAvailable extends BaseError {
|
|
820
|
+
}
|
|
821
|
+
/** Filters for the credit grant. */
|
|
822
|
+
export interface CreateCreditGrantFilters {
|
|
823
|
+
/** Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature. */
|
|
824
|
+
features?: string[];
|
|
825
|
+
}
|
|
826
|
+
/** Filters for the credit grant. */
|
|
827
|
+
export interface CreditGrantFilters {
|
|
828
|
+
/** Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature. */
|
|
829
|
+
features?: string[];
|
|
830
|
+
}
|
|
831
|
+
/** PlanAddon upsert request. */
|
|
832
|
+
export interface UpsertPlanAddonRequest {
|
|
833
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
834
|
+
name: string;
|
|
835
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
836
|
+
description?: string;
|
|
837
|
+
labels?: Labels;
|
|
838
|
+
/** The key of the plan phase from which the add-on becomes available for purchase. */
|
|
839
|
+
from_plan_phase: string;
|
|
840
|
+
/** The maximum number of times the add-on can be purchased for the plan. For single-instance add-ons this field must be omitted. For multi-instance add-ons when omitted, unlimited quantity can be purchased. */
|
|
841
|
+
max_quantity?: number;
|
|
842
|
+
}
|
|
843
|
+
/** Represents common fields of resources with a key. */
|
|
844
|
+
export interface ResourceWithKey {
|
|
845
|
+
id: string;
|
|
846
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
847
|
+
name: string;
|
|
848
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
849
|
+
description?: string;
|
|
850
|
+
labels?: Labels;
|
|
851
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
852
|
+
created_at: string;
|
|
853
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
854
|
+
updated_at: string;
|
|
855
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
856
|
+
deleted_at?: string;
|
|
857
|
+
key: string;
|
|
858
|
+
}
|
|
859
|
+
/** Meter create request. */
|
|
860
|
+
export interface CreateMeterRequest {
|
|
861
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
862
|
+
name: string;
|
|
863
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
864
|
+
description?: string;
|
|
865
|
+
labels?: Labels;
|
|
866
|
+
key: string;
|
|
867
|
+
/** The aggregation type to use for the meter. */
|
|
868
|
+
aggregation: 'sum' | 'count' | 'unique_count' | 'avg' | 'min' | 'max' | 'latest';
|
|
869
|
+
/** The event type to include in the aggregation. */
|
|
870
|
+
event_type: string;
|
|
871
|
+
/** The date since the meter should include events. Useful to skip old events. If not specified, all historical events are included. */
|
|
872
|
+
events_from?: string;
|
|
873
|
+
/** JSONPath expression to extract the value from the ingested event's data property. The ingested value for sum, avg, min, and max aggregations is a number or a string that can be parsed to a number. For unique_count aggregation, the ingested value must be a string. For count aggregation the value_property is ignored. */
|
|
874
|
+
value_property?: string;
|
|
875
|
+
/** Named JSONPath expressions to extract the group by values from the event data. Keys must be unique and consist only alphanumeric and underscore characters. */
|
|
876
|
+
dimensions?: Record<string, string>;
|
|
877
|
+
}
|
|
878
|
+
/** A meter is a configuration that defines how to match and aggregate events. */
|
|
879
|
+
export interface Meter {
|
|
880
|
+
id: string;
|
|
881
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
882
|
+
name: string;
|
|
883
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
884
|
+
description?: string;
|
|
885
|
+
labels?: Labels;
|
|
886
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
887
|
+
created_at: string;
|
|
888
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
889
|
+
updated_at: string;
|
|
890
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
891
|
+
deleted_at?: string;
|
|
892
|
+
key: string;
|
|
893
|
+
/** The aggregation type to use for the meter. */
|
|
894
|
+
aggregation: 'sum' | 'count' | 'unique_count' | 'avg' | 'min' | 'max' | 'latest';
|
|
895
|
+
/** The event type to include in the aggregation. */
|
|
896
|
+
event_type: string;
|
|
897
|
+
/** The date since the meter should include events. Useful to skip old events. If not specified, all historical events are included. */
|
|
898
|
+
events_from?: string;
|
|
899
|
+
/** JSONPath expression to extract the value from the ingested event's data property. The ingested value for sum, avg, min, and max aggregations is a number or a string that can be parsed to a number. For unique_count aggregation, the ingested value must be a string. For count aggregation the value_property is ignored. */
|
|
900
|
+
value_property?: string;
|
|
901
|
+
/** Named JSONPath expressions to extract the group by values from the event data. Keys must be unique and consist only alphanumeric and underscore characters. */
|
|
902
|
+
dimensions?: Record<string, string>;
|
|
903
|
+
}
|
|
904
|
+
/** Pagination metadata. */
|
|
905
|
+
export interface PaginatedMeta {
|
|
906
|
+
/** Page metadata. */
|
|
907
|
+
page: PageMeta;
|
|
908
|
+
}
|
|
909
|
+
/** A query filter for an item in a string map attribute. Operators are mutually exclusive, only one operator is allowed at a time. */
|
|
910
|
+
export interface QueryFilterStringMapItem {
|
|
911
|
+
/** The attribute exists. */
|
|
912
|
+
exists?: boolean;
|
|
913
|
+
/** The attribute equals the provided value. */
|
|
914
|
+
eq?: string;
|
|
915
|
+
/** The attribute does not equal the provided value. */
|
|
916
|
+
neq?: string;
|
|
917
|
+
/** The attribute is one of the provided values. */
|
|
918
|
+
in?: string[];
|
|
919
|
+
/** The attribute is not one of the provided values. */
|
|
920
|
+
nin?: string[];
|
|
921
|
+
/** The attribute contains the provided value. */
|
|
922
|
+
contains?: string;
|
|
923
|
+
/** The attribute does not contain the provided value. */
|
|
924
|
+
ncontains?: string;
|
|
925
|
+
/** Combines the provided filters with a logical AND. */
|
|
926
|
+
and?: QueryFilterString[];
|
|
927
|
+
/** Combines the provided filters with a logical OR. */
|
|
928
|
+
or?: QueryFilterString[];
|
|
929
|
+
}
|
|
930
|
+
/** Subscription create request. */
|
|
931
|
+
export interface SubscriptionCreate {
|
|
932
|
+
labels?: Labels;
|
|
933
|
+
/** The customer to create the subscription for. */
|
|
934
|
+
customer: {
|
|
935
|
+
id?: string;
|
|
936
|
+
key?: string;
|
|
937
|
+
};
|
|
938
|
+
/** The plan reference of the subscription. */
|
|
939
|
+
plan: {
|
|
940
|
+
id?: string;
|
|
941
|
+
key?: string;
|
|
942
|
+
version?: number;
|
|
943
|
+
};
|
|
944
|
+
/** A billing anchor is the fixed point in time that determines the subscription's recurring billing cycle. It affects when charges occur and how prorations are calculated. Common anchors: - Calendar month (1st of each month): `2025-01-01T00:00:00Z` - Subscription anniversary (day customer signed up) - Custom date (customer-specified day) If not provided, the subscription will be created with the subscription's creation time as the billing anchor. */
|
|
945
|
+
billing_anchor?: string;
|
|
946
|
+
}
|
|
947
|
+
/** Customer reference by external key. */
|
|
948
|
+
export interface CustomerKeyReference {
|
|
949
|
+
/** The external key of the customer. */
|
|
950
|
+
key: string;
|
|
951
|
+
}
|
|
952
|
+
/** Mapping to attribute metered usage to the customer. One customer can have zero or more subjects, but one subject can only belong to one customer. */
|
|
953
|
+
export interface CustomerUsageAttribution {
|
|
954
|
+
/** The subjects that are attributed to the customer. Can be empty when no usage event subjects are associated with the customer. */
|
|
955
|
+
subject_keys: string[];
|
|
956
|
+
}
|
|
957
|
+
/** Address */
|
|
958
|
+
export interface BillingAddress {
|
|
959
|
+
/** Country code in [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 format. */
|
|
960
|
+
country?: string;
|
|
961
|
+
/** Postal code. */
|
|
962
|
+
postal_code?: string;
|
|
963
|
+
/** State or province. */
|
|
964
|
+
state?: string;
|
|
965
|
+
/** City. */
|
|
966
|
+
city?: string;
|
|
967
|
+
/** First line of the address. */
|
|
968
|
+
line1?: string;
|
|
969
|
+
/** Second line of the address. */
|
|
970
|
+
line2?: string;
|
|
971
|
+
/** Phone number. */
|
|
972
|
+
phone_number?: string;
|
|
973
|
+
}
|
|
974
|
+
/** Address */
|
|
975
|
+
export interface Address {
|
|
976
|
+
/** Country code in [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 format. */
|
|
977
|
+
country?: string;
|
|
978
|
+
/** Postal code. */
|
|
979
|
+
postal_code?: string;
|
|
980
|
+
/** State or province. */
|
|
981
|
+
state?: string;
|
|
982
|
+
/** City. */
|
|
983
|
+
city?: string;
|
|
984
|
+
/** First line of the address. */
|
|
985
|
+
line1?: string;
|
|
986
|
+
/** Second line of the address. */
|
|
987
|
+
line2?: string;
|
|
988
|
+
/** Phone number. */
|
|
989
|
+
phone_number?: string;
|
|
990
|
+
}
|
|
991
|
+
/** Controls which customer fields can be updated by the checkout session. */
|
|
992
|
+
export interface AppStripeCreateCheckoutSessionCustomerUpdate {
|
|
993
|
+
/** Whether to save the billing address to customer.address. Defaults to "never". */
|
|
994
|
+
address: 'auto' | 'never';
|
|
995
|
+
/** Whether to save the customer name to customer.name. Defaults to "never". */
|
|
996
|
+
name: 'auto' | 'never';
|
|
997
|
+
/** Whether to save shipping information to customer.shipping. Defaults to "never". */
|
|
998
|
+
shipping: 'auto' | 'never';
|
|
999
|
+
}
|
|
1000
|
+
/** Payment method reuse agreement configuration. */
|
|
1001
|
+
export interface AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement {
|
|
1002
|
+
/** Position and visibility of the payment method reuse agreement. */
|
|
1003
|
+
position?: 'auto' | 'hidden';
|
|
1004
|
+
}
|
|
1005
|
+
/** Tax ID collection configuration for checkout sessions. */
|
|
1006
|
+
export interface AppStripeCreateCheckoutSessionTaxIdCollection {
|
|
1007
|
+
/** Enable tax ID collection during checkout. Defaults to false. */
|
|
1008
|
+
enabled: boolean;
|
|
1009
|
+
/** Whether tax ID collection is required. Defaults to "never". */
|
|
1010
|
+
required: 'if_supported' | 'never';
|
|
1011
|
+
}
|
|
1012
|
+
/** Result of creating a Stripe Checkout Session. Contains all the information needed to redirect customers to the checkout or initialize an embedded checkout flow. */
|
|
1013
|
+
export interface AppStripeCreateCheckoutSessionResult {
|
|
1014
|
+
/** The customer ID in the billing system. */
|
|
1015
|
+
customer_id: string;
|
|
1016
|
+
/** The Stripe customer ID. */
|
|
1017
|
+
stripe_customer_id: string;
|
|
1018
|
+
/** The Stripe checkout session ID. */
|
|
1019
|
+
session_id: string;
|
|
1020
|
+
/** The setup intent ID created for collecting the payment method. */
|
|
1021
|
+
setup_intent_id: string;
|
|
1022
|
+
/** Client secret for initializing Stripe.js on the client side. Required for embedded checkout sessions. See: https://docs.stripe.com/payments/checkout/custom-success-page */
|
|
1023
|
+
client_secret?: string;
|
|
1024
|
+
/** The client reference ID provided in the request. Useful for reconciling the session with your internal systems. */
|
|
1025
|
+
client_reference_id?: string;
|
|
1026
|
+
/** Customer's email address if provided to Stripe. */
|
|
1027
|
+
customer_email?: string;
|
|
1028
|
+
/** Currency code for the checkout session. */
|
|
1029
|
+
currency?: string;
|
|
1030
|
+
/** Timestamp when the checkout session was created. */
|
|
1031
|
+
created_at: string;
|
|
1032
|
+
/** Timestamp when the checkout session will expire. */
|
|
1033
|
+
expires_at?: string;
|
|
1034
|
+
/** Metadata attached to the checkout session. */
|
|
1035
|
+
metadata?: Record<string, string>;
|
|
1036
|
+
/** The status of the checkout session. See: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-status */
|
|
1037
|
+
status?: string;
|
|
1038
|
+
/** URL to redirect customers to the checkout page (for hosted mode). */
|
|
1039
|
+
url?: string;
|
|
1040
|
+
/** Mode of the checkout session. Currently only "setup" mode is supported for collecting payment methods. */
|
|
1041
|
+
mode: 'setup';
|
|
1042
|
+
/** The cancel URL where customers are redirected if they cancel. */
|
|
1043
|
+
cancel_url?: string;
|
|
1044
|
+
/** The success URL where customers are redirected after completion. */
|
|
1045
|
+
success_url?: string;
|
|
1046
|
+
/** The return URL for embedded sessions after authentication. */
|
|
1047
|
+
return_url?: string;
|
|
1048
|
+
}
|
|
1049
|
+
/** Request to create a Stripe Customer Portal Session for the customer. Useful to redirect the customer to the Stripe Customer Portal to manage their payment methods, change their billing address and access their invoice history. Only returns URL if the customer billing profile is linked to a stripe app and customer. */
|
|
1050
|
+
export interface CustomerStripeCreateCustomerPortalSessionRequest {
|
|
1051
|
+
/** Options for configuring the Stripe Customer Portal Session. */
|
|
1052
|
+
stripe_options: AppStripeCreateCustomerPortalSessionOptions;
|
|
1053
|
+
}
|
|
1054
|
+
/** Entitlement access result. */
|
|
1055
|
+
export interface EntitlementAccessResult {
|
|
1056
|
+
/** The type of the entitlement. */
|
|
1057
|
+
type: 'metered' | 'static' | 'boolean';
|
|
1058
|
+
/** The feature key of the entitlement. */
|
|
1059
|
+
feature_key: string;
|
|
1060
|
+
/** Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements. */
|
|
1061
|
+
has_access: boolean;
|
|
1062
|
+
/** Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration. */
|
|
1063
|
+
config?: string;
|
|
1064
|
+
}
|
|
1065
|
+
/** Purchase and payment terms of the grant. */
|
|
1066
|
+
export interface CreateCreditGrantPurchase {
|
|
1067
|
+
/** Currency of the purchase amount. */
|
|
1068
|
+
currency: string;
|
|
1069
|
+
/** Cost basis per credit unit used to calculate the purchase amount. If `per_unit_cost_basis` is 0.50 and credit amount is $100.00, the total charge is $50.00. The value must be greater than 0. If the cost basis is 0, use `funding_method=none` instead. Defaults to 1.0. */
|
|
1070
|
+
per_unit_cost_basis: string;
|
|
1071
|
+
/** Controls when credits become available for consumption. Defaults to `on_creation`. */
|
|
1072
|
+
availability_policy: 'on_creation';
|
|
1073
|
+
}
|
|
1074
|
+
/** Recurring period with an anchor and an interval. */
|
|
1075
|
+
export interface RecurringPeriod {
|
|
1076
|
+
/** A date-time anchor to base the recurring period on. */
|
|
1077
|
+
anchor: string;
|
|
1078
|
+
/** The interval duration in ISO 8601 format. */
|
|
1079
|
+
interval: string;
|
|
1080
|
+
}
|
|
1081
|
+
/** Purchase and payment terms of the grant. */
|
|
1082
|
+
export interface CreditGrantPurchase {
|
|
1083
|
+
/** Currency of the purchase amount. */
|
|
1084
|
+
currency: string;
|
|
1085
|
+
/** Cost basis per credit unit used to calculate the purchase amount. If `per_unit_cost_basis` is 0.50 and credit amount is $100.00, the total charge is $50.00. The value must be greater than 0. If the cost basis is 0, use `funding_method=none` instead. Defaults to 1.0. */
|
|
1086
|
+
per_unit_cost_basis: string;
|
|
1087
|
+
/** The purchase amount. Calculated from `per_unit_cost_basis` and credit `amount`. */
|
|
1088
|
+
amount: string;
|
|
1089
|
+
/** Controls when credits become available for consumption. Defaults to `on_creation`. */
|
|
1090
|
+
availability_policy: 'on_creation';
|
|
1091
|
+
/** Current payment settlement status. */
|
|
1092
|
+
settlement_status?: 'pending' | 'authorized' | 'settled';
|
|
1093
|
+
}
|
|
1094
|
+
/** Request body for updating the external payment settlement status of a credit grant. */
|
|
1095
|
+
export interface UpdateCreditGrantExternalSettlementRequest {
|
|
1096
|
+
/** The new payment settlement status. */
|
|
1097
|
+
status: 'pending' | 'authorized' | 'settled';
|
|
1098
|
+
}
|
|
1099
|
+
/** Filter options for listing credit grants. */
|
|
1100
|
+
export interface ListCreditGrantsParamsFilter {
|
|
1101
|
+
/** Filter credit grants by status. */
|
|
1102
|
+
status?: 'pending' | 'active' | 'expired' | 'voided';
|
|
1103
|
+
/** Filter credit grants by currency. */
|
|
1104
|
+
currency?: string;
|
|
1105
|
+
}
|
|
1106
|
+
/** Filter options for getting a credit balance. */
|
|
1107
|
+
export interface GetCreditBalanceParamsFilter {
|
|
1108
|
+
/** Filter credit balance by currency. */
|
|
1109
|
+
currency?: string | {
|
|
1110
|
+
eq?: string;
|
|
1111
|
+
oeq?: string[];
|
|
1112
|
+
neq?: string;
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
/** Filter options for listing charges. */
|
|
1116
|
+
export interface ListChargesParamsFilter {
|
|
1117
|
+
/** Filter charges by status. Supported statuses are: - `created` - `active` - `final` - `deleted` If omitted, all statuses are returned except for `deleted`. */
|
|
1118
|
+
status?: string | {
|
|
1119
|
+
eq?: string;
|
|
1120
|
+
oeq?: string[];
|
|
1121
|
+
neq?: string;
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
/** Filter options for listing plans. */
|
|
1125
|
+
export interface ListPlansParamsFilter {
|
|
1126
|
+
key?: string | {
|
|
1127
|
+
eq?: string;
|
|
1128
|
+
neq?: string;
|
|
1129
|
+
contains?: string;
|
|
1130
|
+
ocontains?: string[];
|
|
1131
|
+
oeq?: string[];
|
|
1132
|
+
gt?: string;
|
|
1133
|
+
gte?: string;
|
|
1134
|
+
lt?: string;
|
|
1135
|
+
lte?: string;
|
|
1136
|
+
exists?: boolean;
|
|
1137
|
+
};
|
|
1138
|
+
name?: string | {
|
|
1139
|
+
eq?: string;
|
|
1140
|
+
neq?: string;
|
|
1141
|
+
contains?: string;
|
|
1142
|
+
ocontains?: string[];
|
|
1143
|
+
oeq?: string[];
|
|
1144
|
+
gt?: string;
|
|
1145
|
+
gte?: string;
|
|
1146
|
+
lt?: string;
|
|
1147
|
+
lte?: string;
|
|
1148
|
+
exists?: boolean;
|
|
1149
|
+
};
|
|
1150
|
+
status?: string | {
|
|
1151
|
+
eq?: string;
|
|
1152
|
+
oeq?: string[];
|
|
1153
|
+
neq?: string;
|
|
1154
|
+
};
|
|
1155
|
+
currency?: string | {
|
|
1156
|
+
eq?: string;
|
|
1157
|
+
oeq?: string[];
|
|
1158
|
+
neq?: string;
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
/** The proration configuration of the rate card. */
|
|
1162
|
+
export interface RateCardProrationConfiguration {
|
|
1163
|
+
/** The proration mode of the rate card. */
|
|
1164
|
+
mode: 'no_proration' | 'prorate_prices';
|
|
1165
|
+
}
|
|
1166
|
+
/** Subscription. */
|
|
1167
|
+
export interface Subscription {
|
|
1168
|
+
id: string;
|
|
1169
|
+
labels?: Labels;
|
|
1170
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
1171
|
+
created_at: string;
|
|
1172
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
1173
|
+
updated_at: string;
|
|
1174
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
1175
|
+
deleted_at?: string;
|
|
1176
|
+
/** The customer ID of the subscription. */
|
|
1177
|
+
customer_id: string;
|
|
1178
|
+
/** The plan ID of the subscription. Set if subscription is created from a plan. */
|
|
1179
|
+
plan_id?: string;
|
|
1180
|
+
/** A billing anchor is the fixed point in time that determines the subscription's recurring billing cycle. It affects when charges occur and how prorations are calculated. Common anchors: - Calendar month (1st of each month): `2025-01-01T00:00:00Z` - Subscription anniversary (day customer signed up) - Custom date (customer-specified day) */
|
|
1181
|
+
billing_anchor: string;
|
|
1182
|
+
/** The status of the subscription. */
|
|
1183
|
+
status: 'active' | 'inactive' | 'canceled' | 'scheduled';
|
|
1184
|
+
}
|
|
1185
|
+
/** Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc. */
|
|
1186
|
+
export interface AppCatalogItem {
|
|
1187
|
+
/** Type of the app. */
|
|
1188
|
+
type: 'sandbox' | 'stripe' | 'external_invoicing';
|
|
1189
|
+
/** Name of the app. */
|
|
1190
|
+
name: string;
|
|
1191
|
+
/** Description of the app. */
|
|
1192
|
+
description: string;
|
|
1193
|
+
}
|
|
1194
|
+
/** Mapping of app types to tax codes. */
|
|
1195
|
+
export interface TaxCodeAppMapping {
|
|
1196
|
+
/** The app type that the tax code is associated with. */
|
|
1197
|
+
app_type: 'sandbox' | 'stripe' | 'external_invoicing';
|
|
1198
|
+
/** Tax code. */
|
|
1199
|
+
tax_code: string;
|
|
1200
|
+
}
|
|
1201
|
+
/** Identity stores the details required to identify an entity for tax purposes in a specific country. */
|
|
1202
|
+
export interface PartyTaxIdentity {
|
|
1203
|
+
/** Normalized tax identification code shown on the original identity document. */
|
|
1204
|
+
code?: string;
|
|
1205
|
+
}
|
|
1206
|
+
/** Filter options for listing currencies. */
|
|
1207
|
+
export interface ListCurrenciesParamsFilter {
|
|
1208
|
+
type?: 'fiat' | 'custom';
|
|
1209
|
+
code?: string | {
|
|
1210
|
+
eq?: string;
|
|
1211
|
+
neq?: string;
|
|
1212
|
+
contains?: string;
|
|
1213
|
+
ocontains?: string[];
|
|
1214
|
+
oeq?: string[];
|
|
1215
|
+
gt?: string;
|
|
1216
|
+
gte?: string;
|
|
1217
|
+
lt?: string;
|
|
1218
|
+
lte?: string;
|
|
1219
|
+
exists?: boolean;
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
/** Describes custom currency. */
|
|
1223
|
+
export interface CurrencyCustom {
|
|
1224
|
+
id: string;
|
|
1225
|
+
/** The type of the currency. */
|
|
1226
|
+
type: 'custom';
|
|
1227
|
+
/** The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro". */
|
|
1228
|
+
name: string;
|
|
1229
|
+
/** Description of the currency. */
|
|
1230
|
+
description?: string;
|
|
1231
|
+
/** The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro. */
|
|
1232
|
+
symbol?: string;
|
|
1233
|
+
code: string;
|
|
1234
|
+
/** An ISO-8601 timestamp representation of the custom currency creation date. */
|
|
1235
|
+
created_at: string;
|
|
1236
|
+
}
|
|
1237
|
+
/** CurrencyCustom create request. */
|
|
1238
|
+
export interface CreateCurrencyCustomRequest {
|
|
1239
|
+
/** The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro". */
|
|
1240
|
+
name: string;
|
|
1241
|
+
/** Description of the currency. */
|
|
1242
|
+
description?: string;
|
|
1243
|
+
/** The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro. */
|
|
1244
|
+
symbol?: string;
|
|
1245
|
+
code: string;
|
|
1246
|
+
}
|
|
1247
|
+
/** Query to evaluate feature access for a list of customers. */
|
|
1248
|
+
export interface GovernanceQueryRequest {
|
|
1249
|
+
/** Whether to include credit balance availability for each resolved customer. When true, each feature evaluation includes credit balance checks. Defaults to `false`. */
|
|
1250
|
+
include_credits: boolean;
|
|
1251
|
+
customer: GovernanceQueryRequestCustomers;
|
|
1252
|
+
feature?: GovernanceQueryRequestFeatures;
|
|
1253
|
+
}
|
|
1254
|
+
/** Reason a feature is not accessible to a customer. */
|
|
1255
|
+
export interface GovernanceFeatureAccessReason {
|
|
1256
|
+
/** Machine-readable error code. */
|
|
1257
|
+
code: 'unknown' | 'usage_limit_reached' | 'feature_unavailable' | 'feature_not_found' | 'no_credit_available';
|
|
1258
|
+
/** Human-readable description of the error. */
|
|
1259
|
+
message: string;
|
|
1260
|
+
/** Additional structured context. */
|
|
1261
|
+
attributes?: Record<string, unknown>;
|
|
1262
|
+
}
|
|
1263
|
+
/** Query error within a partially successful governance query response. */
|
|
1264
|
+
export interface GovernanceQueryError {
|
|
1265
|
+
/** Machine-readable error code. */
|
|
1266
|
+
code: 'unknown' | 'customer_not_found';
|
|
1267
|
+
/** Human-readable description of the error. */
|
|
1268
|
+
message: string;
|
|
1269
|
+
/** Additional structured context. */
|
|
1270
|
+
attributes?: Record<string, unknown>;
|
|
1271
|
+
/** The customer identifier from the request that produced this error. */
|
|
1272
|
+
customer?: string;
|
|
1273
|
+
}
|
|
1274
|
+
/** Unit conversion configuration. Transforms raw metered quantities into billing-ready units before pricing and entitlement evaluation. Applied at the rate card level so the same feature can be billed in different units across plans. Examples: - Meter bytes, bill GB: operation=divide, conversionFactor=1e9, rounding=ceiling, displayUnit="GB" - Meter seconds, bill hours: operation=divide, conversionFactor=3600, rounding=ceiling, displayUnit="hours" - Cost + 20% margin: operation=multiply, conversionFactor=1.2 - Bill per million tokens: operation=divide, conversionFactor=1e6, rounding=ceiling, displayUnit="M" v1 equivalents: - DynamicPrice(multiplier): operation=multiply, conversionFactor=multiplier + UnitPrice(amount=1) - PackagePrice(amount, quantityPerPkg): operation=divide, conversionFactor=quantityPerPkg, rounding=ceiling + UnitPrice(amount) */
|
|
1275
|
+
export interface UnitConfig {
|
|
1276
|
+
/** The arithmetic operation to apply to the raw metered quantity. */
|
|
1277
|
+
operation: 'divide' | 'multiply';
|
|
1278
|
+
/** The factor used in the conversion operation. - For `divide`: `converted = raw / conversionFactor`. - For `multiply`: `converted = raw × conversionFactor`. Must be a positive non-zero value. */
|
|
1279
|
+
conversion_factor: string;
|
|
1280
|
+
/** The rounding mode applied to the converted quantity for invoicing. Defaults to none (no rounding). Entitlement checks always use the precise (unrounded) value. */
|
|
1281
|
+
rounding: 'ceiling' | 'floor' | 'half_up' | 'none';
|
|
1282
|
+
/** The number of decimal places to retain after rounding. Only meaningful when rounding is not "none". Defaults to 0 (round to whole numbers). */
|
|
1283
|
+
precision: number;
|
|
1284
|
+
/** A human-readable label for the converted unit shown on invoices and in the customer portal (e.g., "GB", "hours", "M tokens"). Optional. When omitted, no unit label is rendered. */
|
|
1285
|
+
display_unit?: string;
|
|
1286
|
+
}
|
|
1287
|
+
/** App customer data. */
|
|
1288
|
+
export interface AppCustomerData {
|
|
1289
|
+
/** Used if the customer has a linked Stripe app. */
|
|
1290
|
+
stripe?: AppCustomerDataStripe;
|
|
1291
|
+
/** Used if the customer has a linked external invoicing app. */
|
|
1292
|
+
external_invoicing?: AppCustomerDataExternalInvoicing;
|
|
1293
|
+
}
|
|
1294
|
+
/** AppCustomerData upsert request. */
|
|
1295
|
+
export interface UpsertAppCustomerDataRequest {
|
|
1296
|
+
/** Used if the customer has a linked Stripe app. */
|
|
1297
|
+
stripe?: AppCustomerDataStripe;
|
|
1298
|
+
/** Used if the customer has a linked external invoicing app. */
|
|
1299
|
+
external_invoicing?: AppCustomerDataExternalInvoicing;
|
|
1300
|
+
}
|
|
1301
|
+
/** A credit adjustment can be used to make manual adjustments to a customer's credit balance. Supported use-cases: - Usage correction */
|
|
1302
|
+
export interface CreditAdjustment {
|
|
1303
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
1304
|
+
name: string;
|
|
1305
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
1306
|
+
description?: string;
|
|
1307
|
+
labels?: Labels;
|
|
1308
|
+
/** The currency of the granted credits. */
|
|
1309
|
+
currency: string;
|
|
1310
|
+
/** Granted credit amount. */
|
|
1311
|
+
amount: string;
|
|
1312
|
+
}
|
|
1313
|
+
/** The credit balance by currency. */
|
|
1314
|
+
export interface CreditBalance {
|
|
1315
|
+
currency: string;
|
|
1316
|
+
/** Credits that have been granted but cannot yet be consumed. Includes grants awaiting payment clearance or with a future effective date. */
|
|
1317
|
+
pending: string;
|
|
1318
|
+
/** Credits that can be consumed right now. Derived from cleared grants after applying eligibility and restriction rules. */
|
|
1319
|
+
available: string;
|
|
1320
|
+
}
|
|
1321
|
+
/** CreditAdjustment create request. */
|
|
1322
|
+
export interface CreateCreditAdjustmentRequest {
|
|
1323
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
1324
|
+
name: string;
|
|
1325
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
1326
|
+
description?: string;
|
|
1327
|
+
labels?: Labels;
|
|
1328
|
+
/** The currency of the granted credits. */
|
|
1329
|
+
currency: string;
|
|
1330
|
+
/** Granted credit amount. */
|
|
1331
|
+
amount: string;
|
|
1332
|
+
}
|
|
1333
|
+
/** Filter options for listing credit transactions. */
|
|
1334
|
+
export interface ListCreditTransactionsParamsFilter {
|
|
1335
|
+
/** Filter credit transactions by type. */
|
|
1336
|
+
type?: 'funded' | 'consumed' | 'expired';
|
|
1337
|
+
/** Filter credit transactions by currency. */
|
|
1338
|
+
currency?: string;
|
|
1339
|
+
}
|
|
1340
|
+
/** A credit transaction represents a single credit movement on the customer's balance. Credit transactions are immutable. */
|
|
1341
|
+
export interface CreditTransaction {
|
|
1342
|
+
id: string;
|
|
1343
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
1344
|
+
name: string;
|
|
1345
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
1346
|
+
description?: string;
|
|
1347
|
+
labels?: Labels;
|
|
1348
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
1349
|
+
created_at: string;
|
|
1350
|
+
/** The date and time the transaction was booked. */
|
|
1351
|
+
booked_at: string;
|
|
1352
|
+
/** The type of credit transaction. */
|
|
1353
|
+
type: 'funded' | 'consumed' | 'expired';
|
|
1354
|
+
/** Currency of the balance affected by the transaction. */
|
|
1355
|
+
currency: string;
|
|
1356
|
+
/** Signed amount of the credit movement. Positive values add balance, negative values reduce balance. */
|
|
1357
|
+
amount: string;
|
|
1358
|
+
/** The available balance before and after the transaction. */
|
|
1359
|
+
available_balance: {
|
|
1360
|
+
before: string;
|
|
1361
|
+
after: string;
|
|
1362
|
+
};
|
|
1363
|
+
}
|
|
1364
|
+
/** A price tier used in graduated and volume pricing. At least one price component (flat_price or unit_price) must be set. When UnitConfig is present on the rate card, up_to_amount is expressed in converted billing units. */
|
|
1365
|
+
export interface PriceTier {
|
|
1366
|
+
/** Up to and including this quantity will be contained in the tier. If undefined, the tier is open-ended (the last tier). */
|
|
1367
|
+
up_to_amount?: string;
|
|
1368
|
+
/** The flat price component of the tier. Charged once when the tier is entered. */
|
|
1369
|
+
flat_price?: PriceFlat;
|
|
1370
|
+
/** The unit price component of the tier. Charged per billing unit within the tier. */
|
|
1371
|
+
unit_price?: PriceUnit;
|
|
1372
|
+
}
|
|
1373
|
+
/** The totals of a change. RealTime is only expanded when the `real_time_usage` expand is used. */
|
|
1374
|
+
export interface ChargeTotals {
|
|
1375
|
+
/** The amount of the charge already booked to the internal accounting system. */
|
|
1376
|
+
booked: Totals;
|
|
1377
|
+
/** The realtime amount of the charge. Requires the `realtime_usage` expand. */
|
|
1378
|
+
realtime?: Totals;
|
|
1379
|
+
}
|
|
1380
|
+
/** LLM cost lookup configuration. Each dimension (provider, model, token type) can be specified as either a static value or a meter group-by property name (mutually exclusive). */
|
|
1381
|
+
export interface FeatureLlmUnitCost {
|
|
1382
|
+
/** The type discriminator for LLM unit cost. */
|
|
1383
|
+
type: 'llm';
|
|
1384
|
+
/** Meter group-by property that holds the LLM provider. Use this when the meter has a group-by dimension for provider. Mutually exclusive with `provider`. */
|
|
1385
|
+
provider_property?: string;
|
|
1386
|
+
/** Static LLM provider value (e.g., "openai", "anthropic"). Use this when the feature tracks a single provider. Mutually exclusive with `provider_property`. */
|
|
1387
|
+
provider?: string;
|
|
1388
|
+
/** Meter group-by property that holds the model ID. Use this when the meter has a group-by dimension for model. Mutually exclusive with `model`. */
|
|
1389
|
+
model_property?: string;
|
|
1390
|
+
/** Static model ID value (e.g., "gpt-4", "claude-3-5-sonnet"). Use this when the feature tracks a single model. Mutually exclusive with `model_property`. */
|
|
1391
|
+
model?: string;
|
|
1392
|
+
/** Meter group-by property that holds the token type. Use this when the meter has a group-by dimension for token type. Mutually exclusive with `token_type`. */
|
|
1393
|
+
token_type_property?: string;
|
|
1394
|
+
/** Static token type value. Use this when the feature tracks a single token type (e.g., only input tokens). `request` is an alias for `input`, `response` is an alias for `output`. Mutually exclusive with `token_type_property`. */
|
|
1395
|
+
token_type?: 'input' | 'output' | 'cache_read' | 'cache_write' | 'reasoning' | 'request' | 'response';
|
|
1396
|
+
/** Resolved per-token pricing from the LLM cost database. Populated in responses when the provider and model can be determined, either from static values or from meter group-by filters with exact matches. */
|
|
1397
|
+
pricing?: FeatureLlmUnitCostPricing;
|
|
1398
|
+
}
|
|
1399
|
+
/** An LLM cost price record, representing the cost per token for a specific model from a specific provider. */
|
|
1400
|
+
export interface LlmCostPrice {
|
|
1401
|
+
/** Unique identifier. */
|
|
1402
|
+
id: string;
|
|
1403
|
+
/** Provider of the model. */
|
|
1404
|
+
provider: LlmCostProvider;
|
|
1405
|
+
/** The model. */
|
|
1406
|
+
model: LlmCostModel;
|
|
1407
|
+
/** Token pricing data. */
|
|
1408
|
+
pricing: LlmCostModelPricing;
|
|
1409
|
+
/** Currency code (currently always "USD"). */
|
|
1410
|
+
currency: string;
|
|
1411
|
+
/** Where this price came from. */
|
|
1412
|
+
source: 'manual' | 'system';
|
|
1413
|
+
/** When this price becomes effective. */
|
|
1414
|
+
effective_from: string;
|
|
1415
|
+
/** When this price expires. Omitted when the price is currently effective. */
|
|
1416
|
+
effective_to?: string;
|
|
1417
|
+
/** Creation timestamp. */
|
|
1418
|
+
created_at: string;
|
|
1419
|
+
/** Last update timestamp. */
|
|
1420
|
+
updated_at: string;
|
|
1421
|
+
}
|
|
1422
|
+
/** Input for creating a per-namespace price override. Unique per provider, model and currency. If an override already exists for the given provider, model and currency, it will be updated. If an override does not exist, it will be created. */
|
|
1423
|
+
export interface LlmCostOverrideCreate {
|
|
1424
|
+
/** Provider/vendor of the model. */
|
|
1425
|
+
provider: string;
|
|
1426
|
+
/** Canonical model identifier. */
|
|
1427
|
+
model_id: string;
|
|
1428
|
+
/** Human-readable model name. */
|
|
1429
|
+
model_name?: string;
|
|
1430
|
+
/** Token pricing data. */
|
|
1431
|
+
pricing: LlmCostModelPricing;
|
|
1432
|
+
/** Currency code. */
|
|
1433
|
+
currency: string;
|
|
1434
|
+
/** When this override becomes effective. */
|
|
1435
|
+
effective_from: string;
|
|
1436
|
+
/** When this override expires. */
|
|
1437
|
+
effective_to?: string;
|
|
1438
|
+
}
|
|
1439
|
+
/** Filter options for listing customers. */
|
|
1440
|
+
export interface ListCustomersParamsFilter {
|
|
1441
|
+
key?: string | {
|
|
1442
|
+
eq?: string;
|
|
1443
|
+
neq?: string;
|
|
1444
|
+
contains?: string;
|
|
1445
|
+
ocontains?: string[];
|
|
1446
|
+
oeq?: string[];
|
|
1447
|
+
gt?: string;
|
|
1448
|
+
gte?: string;
|
|
1449
|
+
lt?: string;
|
|
1450
|
+
lte?: string;
|
|
1451
|
+
exists?: boolean;
|
|
1452
|
+
};
|
|
1453
|
+
name?: string | {
|
|
1454
|
+
eq?: string;
|
|
1455
|
+
neq?: string;
|
|
1456
|
+
contains?: string;
|
|
1457
|
+
ocontains?: string[];
|
|
1458
|
+
oeq?: string[];
|
|
1459
|
+
gt?: string;
|
|
1460
|
+
gte?: string;
|
|
1461
|
+
lt?: string;
|
|
1462
|
+
lte?: string;
|
|
1463
|
+
exists?: boolean;
|
|
1464
|
+
};
|
|
1465
|
+
primary_email?: string | {
|
|
1466
|
+
eq?: string;
|
|
1467
|
+
neq?: string;
|
|
1468
|
+
contains?: string;
|
|
1469
|
+
ocontains?: string[];
|
|
1470
|
+
oeq?: string[];
|
|
1471
|
+
gt?: string;
|
|
1472
|
+
gte?: string;
|
|
1473
|
+
lt?: string;
|
|
1474
|
+
lte?: string;
|
|
1475
|
+
exists?: boolean;
|
|
1476
|
+
};
|
|
1477
|
+
usage_attribution_subject_key?: string | {
|
|
1478
|
+
eq?: string;
|
|
1479
|
+
neq?: string;
|
|
1480
|
+
contains?: string;
|
|
1481
|
+
ocontains?: string[];
|
|
1482
|
+
oeq?: string[];
|
|
1483
|
+
gt?: string;
|
|
1484
|
+
gte?: string;
|
|
1485
|
+
lt?: string;
|
|
1486
|
+
lte?: string;
|
|
1487
|
+
exists?: boolean;
|
|
1488
|
+
};
|
|
1489
|
+
plan_key?: string | {
|
|
1490
|
+
eq?: string;
|
|
1491
|
+
neq?: string;
|
|
1492
|
+
contains?: string;
|
|
1493
|
+
ocontains?: string[];
|
|
1494
|
+
oeq?: string[];
|
|
1495
|
+
gt?: string;
|
|
1496
|
+
gte?: string;
|
|
1497
|
+
lt?: string;
|
|
1498
|
+
lte?: string;
|
|
1499
|
+
exists?: boolean;
|
|
1500
|
+
};
|
|
1501
|
+
billing_profile_id?: string | {
|
|
1502
|
+
eq?: string;
|
|
1503
|
+
oeq?: string[];
|
|
1504
|
+
neq?: string;
|
|
1505
|
+
};
|
|
1506
|
+
}
|
|
1507
|
+
/** Filter options for listing subscriptions. */
|
|
1508
|
+
export interface ListSubscriptionsParamsFilter {
|
|
1509
|
+
id?: string | {
|
|
1510
|
+
eq?: string;
|
|
1511
|
+
oeq?: string[];
|
|
1512
|
+
neq?: string;
|
|
1513
|
+
};
|
|
1514
|
+
customer_id?: string | {
|
|
1515
|
+
eq?: string;
|
|
1516
|
+
oeq?: string[];
|
|
1517
|
+
neq?: string;
|
|
1518
|
+
};
|
|
1519
|
+
status?: string | {
|
|
1520
|
+
eq?: string;
|
|
1521
|
+
oeq?: string[];
|
|
1522
|
+
neq?: string;
|
|
1523
|
+
};
|
|
1524
|
+
plan_id?: string | {
|
|
1525
|
+
eq?: string;
|
|
1526
|
+
oeq?: string[];
|
|
1527
|
+
neq?: string;
|
|
1528
|
+
};
|
|
1529
|
+
plan_key?: string | {
|
|
1530
|
+
eq?: string;
|
|
1531
|
+
oeq?: string[];
|
|
1532
|
+
neq?: string;
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
/** Filter options for listing features. */
|
|
1536
|
+
export interface ListFeatureParamsFilter {
|
|
1537
|
+
meter_id?: string | {
|
|
1538
|
+
eq?: string;
|
|
1539
|
+
oeq?: string[];
|
|
1540
|
+
neq?: string;
|
|
1541
|
+
};
|
|
1542
|
+
key?: string | {
|
|
1543
|
+
eq?: string;
|
|
1544
|
+
neq?: string;
|
|
1545
|
+
contains?: string;
|
|
1546
|
+
ocontains?: string[];
|
|
1547
|
+
oeq?: string[];
|
|
1548
|
+
gt?: string;
|
|
1549
|
+
gte?: string;
|
|
1550
|
+
lt?: string;
|
|
1551
|
+
lte?: string;
|
|
1552
|
+
exists?: boolean;
|
|
1553
|
+
};
|
|
1554
|
+
name?: string | {
|
|
1555
|
+
eq?: string;
|
|
1556
|
+
neq?: string;
|
|
1557
|
+
contains?: string;
|
|
1558
|
+
ocontains?: string[];
|
|
1559
|
+
oeq?: string[];
|
|
1560
|
+
gt?: string;
|
|
1561
|
+
gte?: string;
|
|
1562
|
+
lt?: string;
|
|
1563
|
+
lte?: string;
|
|
1564
|
+
exists?: boolean;
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
/** Filter options for listing add-ons. */
|
|
1568
|
+
export interface ListAddonsParamsFilter {
|
|
1569
|
+
id?: string | {
|
|
1570
|
+
eq?: string;
|
|
1571
|
+
oeq?: string[];
|
|
1572
|
+
neq?: string;
|
|
1573
|
+
};
|
|
1574
|
+
key?: string | {
|
|
1575
|
+
eq?: string;
|
|
1576
|
+
neq?: string;
|
|
1577
|
+
contains?: string;
|
|
1578
|
+
ocontains?: string[];
|
|
1579
|
+
oeq?: string[];
|
|
1580
|
+
gt?: string;
|
|
1581
|
+
gte?: string;
|
|
1582
|
+
lt?: string;
|
|
1583
|
+
lte?: string;
|
|
1584
|
+
exists?: boolean;
|
|
1585
|
+
};
|
|
1586
|
+
name?: string | {
|
|
1587
|
+
eq?: string;
|
|
1588
|
+
neq?: string;
|
|
1589
|
+
contains?: string;
|
|
1590
|
+
ocontains?: string[];
|
|
1591
|
+
oeq?: string[];
|
|
1592
|
+
gt?: string;
|
|
1593
|
+
gte?: string;
|
|
1594
|
+
lt?: string;
|
|
1595
|
+
lte?: string;
|
|
1596
|
+
exists?: boolean;
|
|
1597
|
+
};
|
|
1598
|
+
status?: string | {
|
|
1599
|
+
eq?: string;
|
|
1600
|
+
oeq?: string[];
|
|
1601
|
+
neq?: string;
|
|
1602
|
+
};
|
|
1603
|
+
currency?: string | {
|
|
1604
|
+
eq?: string;
|
|
1605
|
+
oeq?: string[];
|
|
1606
|
+
neq?: string;
|
|
1607
|
+
};
|
|
1608
|
+
}
|
|
1609
|
+
/** Tax configuration for a credit grant. Tax configuration should be provided to ensure correct revenue recognition, including for externally funded grants. */
|
|
1610
|
+
export interface CreateCreditGrantTaxConfig {
|
|
1611
|
+
/** Tax behavior applied to the invoice line item. */
|
|
1612
|
+
behavior?: 'inclusive' | 'exclusive';
|
|
1613
|
+
/** Tax code applied to the invoice line item. */
|
|
1614
|
+
tax_code?: CreateResourceReference;
|
|
1615
|
+
}
|
|
1616
|
+
/** Tax configuration for a credit grant. Tax configuration should be provided to ensure correct revenue recognition, including for externally funded grants. */
|
|
1617
|
+
export interface CreditGrantTaxConfig {
|
|
1618
|
+
/** Tax behavior applied to the invoice line item. */
|
|
1619
|
+
behavior?: 'inclusive' | 'exclusive';
|
|
1620
|
+
/** Tax code applied to the invoice line item. */
|
|
1621
|
+
tax_code?: TaxCodeReference;
|
|
1622
|
+
}
|
|
1623
|
+
/** Set of provider specific tax configs. */
|
|
1624
|
+
export interface TaxConfig {
|
|
1625
|
+
/** Tax behavior. If not specified the billing profile is used to determine the tax behavior. If not specified in the billing profile, the provider's default behavior is used. */
|
|
1626
|
+
behavior?: 'inclusive' | 'exclusive';
|
|
1627
|
+
/** Stripe tax config. */
|
|
1628
|
+
stripe?: TaxConfigStripe;
|
|
1629
|
+
/** External invoicing tax config. */
|
|
1630
|
+
external_invoicing?: TaxConfigExternalInvoicing;
|
|
1631
|
+
/** Tax code ID. */
|
|
1632
|
+
tax_code_id?: string;
|
|
1633
|
+
/** Tax code reference. When both `tax_code` and `tax_code_id` are provided, `tax_code` takes precedence. When `stripe.code` is also provided, `tax_code` still wins and `stripe.code` is ignored. */
|
|
1634
|
+
tax_code?: TaxCodeReference;
|
|
1635
|
+
}
|
|
1636
|
+
/** The tax config of the rate card. */
|
|
1637
|
+
export interface RateCardTaxConfig {
|
|
1638
|
+
behavior?: 'inclusive' | 'exclusive';
|
|
1639
|
+
code: TaxCodeReference;
|
|
1640
|
+
}
|
|
1641
|
+
/** Organization-level default tax code references. Stores the default tax codes applied to specific billing contexts for this organization. Provisioned automatically when the organization is created. */
|
|
1642
|
+
export interface OrganizationDefaultTaxCodes {
|
|
1643
|
+
/** Default tax code for invoicing. */
|
|
1644
|
+
invoicing_tax_code: TaxCodeReference;
|
|
1645
|
+
/** Default tax code for credit grants. */
|
|
1646
|
+
credit_grant_tax_code: TaxCodeReference;
|
|
1647
|
+
/** Timestamp of creation. */
|
|
1648
|
+
created_at: string;
|
|
1649
|
+
/** Timestamp of last update. */
|
|
1650
|
+
updated_at: string;
|
|
1651
|
+
}
|
|
1652
|
+
/** OrganizationDefaultTaxCodes update request. */
|
|
1653
|
+
export interface UpdateOrganizationDefaultTaxCodesRequest {
|
|
1654
|
+
/** Default tax code for invoicing. */
|
|
1655
|
+
invoicing_tax_code?: TaxCodeReference;
|
|
1656
|
+
/** Default tax code for credit grants. */
|
|
1657
|
+
credit_grant_tax_code?: TaxCodeReference;
|
|
1658
|
+
}
|
|
1659
|
+
/** Addon purchased with a subscription. */
|
|
1660
|
+
export interface SubscriptionAddon {
|
|
1661
|
+
id: string;
|
|
1662
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
1663
|
+
name: string;
|
|
1664
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
1665
|
+
description?: string;
|
|
1666
|
+
labels?: Labels;
|
|
1667
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
1668
|
+
created_at: string;
|
|
1669
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
1670
|
+
updated_at: string;
|
|
1671
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
1672
|
+
deleted_at?: string;
|
|
1673
|
+
/** The add-on associated with the subscription. */
|
|
1674
|
+
addon: AddonReference;
|
|
1675
|
+
/** The quantity of the add-on. Always 1 for single instance add-ons. */
|
|
1676
|
+
quantity: number;
|
|
1677
|
+
/** An ISO-8601 timestamp representation of which point in time the quantity was resolved to. */
|
|
1678
|
+
quantity_at: string;
|
|
1679
|
+
/** An ISO-8601 timestamp representation of the cadence start of the resource. */
|
|
1680
|
+
active_from: string;
|
|
1681
|
+
/** An ISO-8601 timestamp representation of the cadence end of the resource. */
|
|
1682
|
+
active_to?: string;
|
|
1683
|
+
}
|
|
1684
|
+
/** PlanAddon represents an association between a plan and an add-on, controlling which add-ons are available for purchase within a plan. */
|
|
1685
|
+
export interface PlanAddon {
|
|
1686
|
+
id: string;
|
|
1687
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
1688
|
+
name: string;
|
|
1689
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
1690
|
+
description?: string;
|
|
1691
|
+
labels?: Labels;
|
|
1692
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
1693
|
+
created_at: string;
|
|
1694
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
1695
|
+
updated_at: string;
|
|
1696
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
1697
|
+
deleted_at?: string;
|
|
1698
|
+
/** The add-on associated with the plan. */
|
|
1699
|
+
addon: AddonReference;
|
|
1700
|
+
/** The key of the plan phase from which the add-on becomes available for purchase. */
|
|
1701
|
+
from_plan_phase: string;
|
|
1702
|
+
/** The maximum number of times the add-on can be purchased for the plan. For single-instance add-ons this field must be omitted. For multi-instance add-ons when omitted, unlimited quantity can be purchased. */
|
|
1703
|
+
max_quantity?: number;
|
|
1704
|
+
/** List of validation errors. */
|
|
1705
|
+
validation_errors?: ProductCatalogValidationError[];
|
|
1706
|
+
}
|
|
1707
|
+
/** PlanAddon create request. */
|
|
1708
|
+
export interface CreatePlanAddonRequest {
|
|
1709
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
1710
|
+
name: string;
|
|
1711
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
1712
|
+
description?: string;
|
|
1713
|
+
labels?: Labels;
|
|
1714
|
+
/** The add-on associated with the plan. */
|
|
1715
|
+
addon: AddonReference;
|
|
1716
|
+
/** The key of the plan phase from which the add-on becomes available for purchase. */
|
|
1717
|
+
from_plan_phase: string;
|
|
1718
|
+
/** The maximum number of times the add-on can be purchased for the plan. For single-instance add-ons this field must be omitted. For multi-instance add-ons when omitted, unlimited quantity can be purchased. */
|
|
1719
|
+
max_quantity?: number;
|
|
1720
|
+
}
|
|
1721
|
+
/** References to the applications used by a billing profile. */
|
|
1722
|
+
export interface ProfileAppReferences {
|
|
1723
|
+
/** The tax app used for this workflow. */
|
|
1724
|
+
tax: AppReference;
|
|
1725
|
+
/** The invoicing app used for this workflow. */
|
|
1726
|
+
invoicing: AppReference;
|
|
1727
|
+
/** The payment app used for this workflow. */
|
|
1728
|
+
payment: AppReference;
|
|
1729
|
+
}
|
|
1730
|
+
/** Filter options for listing ingested events. */
|
|
1731
|
+
export interface ListEventsParamsFilter {
|
|
1732
|
+
/** Filter events by ID. */
|
|
1733
|
+
id?: string | {
|
|
1734
|
+
eq?: string;
|
|
1735
|
+
neq?: string;
|
|
1736
|
+
contains?: string;
|
|
1737
|
+
ocontains?: string[];
|
|
1738
|
+
oeq?: string[];
|
|
1739
|
+
gt?: string;
|
|
1740
|
+
gte?: string;
|
|
1741
|
+
lt?: string;
|
|
1742
|
+
lte?: string;
|
|
1743
|
+
exists?: boolean;
|
|
1744
|
+
};
|
|
1745
|
+
/** Filter events by source. */
|
|
1746
|
+
source?: string | {
|
|
1747
|
+
eq?: string;
|
|
1748
|
+
neq?: string;
|
|
1749
|
+
contains?: string;
|
|
1750
|
+
ocontains?: string[];
|
|
1751
|
+
oeq?: string[];
|
|
1752
|
+
gt?: string;
|
|
1753
|
+
gte?: string;
|
|
1754
|
+
lt?: string;
|
|
1755
|
+
lte?: string;
|
|
1756
|
+
exists?: boolean;
|
|
1757
|
+
};
|
|
1758
|
+
/** Filter events by subject. */
|
|
1759
|
+
subject?: string | {
|
|
1760
|
+
eq?: string;
|
|
1761
|
+
neq?: string;
|
|
1762
|
+
contains?: string;
|
|
1763
|
+
ocontains?: string[];
|
|
1764
|
+
oeq?: string[];
|
|
1765
|
+
gt?: string;
|
|
1766
|
+
gte?: string;
|
|
1767
|
+
lt?: string;
|
|
1768
|
+
lte?: string;
|
|
1769
|
+
exists?: boolean;
|
|
1770
|
+
};
|
|
1771
|
+
/** Filter events by type. */
|
|
1772
|
+
type?: string | {
|
|
1773
|
+
eq?: string;
|
|
1774
|
+
neq?: string;
|
|
1775
|
+
contains?: string;
|
|
1776
|
+
ocontains?: string[];
|
|
1777
|
+
oeq?: string[];
|
|
1778
|
+
gt?: string;
|
|
1779
|
+
gte?: string;
|
|
1780
|
+
lt?: string;
|
|
1781
|
+
lte?: string;
|
|
1782
|
+
exists?: boolean;
|
|
1783
|
+
};
|
|
1784
|
+
/** Filter events by the associated customer ID. */
|
|
1785
|
+
customer_id?: string | {
|
|
1786
|
+
eq?: string;
|
|
1787
|
+
oeq?: string[];
|
|
1788
|
+
neq?: string;
|
|
1789
|
+
};
|
|
1790
|
+
/** Filter events by event time. */
|
|
1791
|
+
time?: string | {
|
|
1792
|
+
eq?: string;
|
|
1793
|
+
lt?: string;
|
|
1794
|
+
lte?: string;
|
|
1795
|
+
gt?: string;
|
|
1796
|
+
gte?: string;
|
|
1797
|
+
};
|
|
1798
|
+
/** Filter events by the time the event was ingested. */
|
|
1799
|
+
ingested_at?: string | {
|
|
1800
|
+
eq?: string;
|
|
1801
|
+
lt?: string;
|
|
1802
|
+
lte?: string;
|
|
1803
|
+
gt?: string;
|
|
1804
|
+
gte?: string;
|
|
1805
|
+
};
|
|
1806
|
+
/** Filter events by the time the event was stored. */
|
|
1807
|
+
stored_at?: string | {
|
|
1808
|
+
eq?: string;
|
|
1809
|
+
lt?: string;
|
|
1810
|
+
lte?: string;
|
|
1811
|
+
gt?: string;
|
|
1812
|
+
gte?: string;
|
|
1813
|
+
};
|
|
1814
|
+
}
|
|
1815
|
+
/** Resource filters. */
|
|
1816
|
+
export interface ResourceFilters {
|
|
1817
|
+
name?: string | {
|
|
1818
|
+
eq?: string;
|
|
1819
|
+
neq?: string;
|
|
1820
|
+
contains?: string;
|
|
1821
|
+
ocontains?: string[];
|
|
1822
|
+
oeq?: string[];
|
|
1823
|
+
gt?: string;
|
|
1824
|
+
gte?: string;
|
|
1825
|
+
lt?: string;
|
|
1826
|
+
lte?: string;
|
|
1827
|
+
exists?: boolean;
|
|
1828
|
+
};
|
|
1829
|
+
labels?: LabelsFieldFilter;
|
|
1830
|
+
public_labels?: LabelsFieldFilter;
|
|
1831
|
+
created_at?: string | {
|
|
1832
|
+
eq?: string;
|
|
1833
|
+
lt?: string;
|
|
1834
|
+
lte?: string;
|
|
1835
|
+
gt?: string;
|
|
1836
|
+
gte?: string;
|
|
1837
|
+
};
|
|
1838
|
+
updated_at?: string | {
|
|
1839
|
+
eq?: string;
|
|
1840
|
+
lt?: string;
|
|
1841
|
+
lte?: string;
|
|
1842
|
+
gt?: string;
|
|
1843
|
+
gte?: string;
|
|
1844
|
+
};
|
|
1845
|
+
deleted_at?: string | {
|
|
1846
|
+
eq?: string;
|
|
1847
|
+
lt?: string;
|
|
1848
|
+
lte?: string;
|
|
1849
|
+
gt?: string;
|
|
1850
|
+
gte?: string;
|
|
1851
|
+
};
|
|
1852
|
+
}
|
|
1853
|
+
/** Field filters with all supported types. */
|
|
1854
|
+
export interface FieldFilters {
|
|
1855
|
+
boolean?: boolean | {
|
|
1856
|
+
eq: boolean;
|
|
1857
|
+
};
|
|
1858
|
+
numeric?: number | {
|
|
1859
|
+
eq?: number;
|
|
1860
|
+
neq?: number;
|
|
1861
|
+
oeq?: number[];
|
|
1862
|
+
lt?: number;
|
|
1863
|
+
lte?: number;
|
|
1864
|
+
gt?: number;
|
|
1865
|
+
gte?: number;
|
|
1866
|
+
};
|
|
1867
|
+
string?: string | {
|
|
1868
|
+
eq?: string;
|
|
1869
|
+
neq?: string;
|
|
1870
|
+
contains?: string;
|
|
1871
|
+
ocontains?: string[];
|
|
1872
|
+
oeq?: string[];
|
|
1873
|
+
gt?: string;
|
|
1874
|
+
gte?: string;
|
|
1875
|
+
lt?: string;
|
|
1876
|
+
lte?: string;
|
|
1877
|
+
exists?: boolean;
|
|
1878
|
+
};
|
|
1879
|
+
string_exact?: string | {
|
|
1880
|
+
eq?: string;
|
|
1881
|
+
oeq?: string[];
|
|
1882
|
+
neq?: string;
|
|
1883
|
+
};
|
|
1884
|
+
ulid?: string | {
|
|
1885
|
+
eq?: string;
|
|
1886
|
+
oeq?: string[];
|
|
1887
|
+
neq?: string;
|
|
1888
|
+
};
|
|
1889
|
+
datetime?: string | {
|
|
1890
|
+
eq?: string;
|
|
1891
|
+
lt?: string;
|
|
1892
|
+
lte?: string;
|
|
1893
|
+
gt?: string;
|
|
1894
|
+
gte?: string;
|
|
1895
|
+
};
|
|
1896
|
+
labels?: LabelsFieldFilter;
|
|
1897
|
+
}
|
|
1898
|
+
/** An ingested metering event with ingestion metadata. */
|
|
1899
|
+
export interface IngestedEvent {
|
|
1900
|
+
/** The original event ingested. */
|
|
1901
|
+
event: Event;
|
|
1902
|
+
/** The customer if the event is associated with a customer. */
|
|
1903
|
+
customer?: CustomerReference;
|
|
1904
|
+
/** The date and time the event was ingested and its processing started. */
|
|
1905
|
+
ingested_at: string;
|
|
1906
|
+
/** The date and time the event was stored in the database. */
|
|
1907
|
+
stored_at: string;
|
|
1908
|
+
/** The validation errors of the ingested event. */
|
|
1909
|
+
validation_errors?: IngestedEventValidationError[];
|
|
1910
|
+
}
|
|
1911
|
+
/** Meter query result. */
|
|
1912
|
+
export interface MeterQueryResult {
|
|
1913
|
+
/** The start of the period the usage is queried from. */
|
|
1914
|
+
from?: string;
|
|
1915
|
+
/** The end of the period the usage is queried to. */
|
|
1916
|
+
to?: string;
|
|
1917
|
+
/** The usage data. If no data is available, an empty array is returned. */
|
|
1918
|
+
data: MeterQueryRow[];
|
|
1919
|
+
}
|
|
1920
|
+
/** Result of a feature cost query. */
|
|
1921
|
+
export interface FeatureCostQueryResult {
|
|
1922
|
+
/** Start of the queried period. */
|
|
1923
|
+
from?: string;
|
|
1924
|
+
/** End of the queried period. */
|
|
1925
|
+
to?: string;
|
|
1926
|
+
/** The cost data rows. */
|
|
1927
|
+
data: FeatureCostQueryRow[];
|
|
1928
|
+
}
|
|
1929
|
+
/** Page paginated response. */
|
|
1930
|
+
export interface MeterPagePaginatedResponse {
|
|
1931
|
+
data: Meter[];
|
|
1932
|
+
meta: PaginatedMeta;
|
|
1933
|
+
}
|
|
1934
|
+
/** Page paginated response. */
|
|
1935
|
+
export interface CostBasisPagePaginatedResponse {
|
|
1936
|
+
data: CostBasis[];
|
|
1937
|
+
meta: PaginatedMeta;
|
|
1938
|
+
}
|
|
1939
|
+
/** Filters to apply to a meter query. */
|
|
1940
|
+
export interface MeterQueryFilters {
|
|
1941
|
+
/** Filters to apply to the dimensions of the query. For `subject` and `customer_id` only equals ("eq", "in") comparisons are supported. */
|
|
1942
|
+
dimensions?: Record<string, QueryFilterStringMapItem>;
|
|
1943
|
+
}
|
|
1944
|
+
/** Reference to a meter associated with a feature. */
|
|
1945
|
+
export interface FeatureMeterReference {
|
|
1946
|
+
/** The ID of the meter to associate with this feature. */
|
|
1947
|
+
id: string;
|
|
1948
|
+
/** Filters to apply to the dimensions of the meter. */
|
|
1949
|
+
filters?: Record<string, QueryFilterStringMapItem>;
|
|
1950
|
+
}
|
|
1951
|
+
/** Customer create request. */
|
|
1952
|
+
export interface CreateCustomerRequest {
|
|
1953
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
1954
|
+
name: string;
|
|
1955
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
1956
|
+
description?: string;
|
|
1957
|
+
labels?: Labels;
|
|
1958
|
+
key: string;
|
|
1959
|
+
/** Mapping to attribute metered usage to the customer by the event subject. */
|
|
1960
|
+
usage_attribution?: CustomerUsageAttribution;
|
|
1961
|
+
/** The primary email address of the customer. */
|
|
1962
|
+
primary_email?: string;
|
|
1963
|
+
/** Currency of the customer. Used for billing, tax and invoicing. */
|
|
1964
|
+
currency?: string;
|
|
1965
|
+
/** The billing address of the customer. Used for tax and invoicing. */
|
|
1966
|
+
billing_address?: BillingAddress;
|
|
1967
|
+
}
|
|
1968
|
+
/** Customers can be individuals or organizations that can subscribe to plans and have access to features. */
|
|
1969
|
+
export interface Customer {
|
|
1970
|
+
id: string;
|
|
1971
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
1972
|
+
name: string;
|
|
1973
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
1974
|
+
description?: string;
|
|
1975
|
+
labels?: Labels;
|
|
1976
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
1977
|
+
created_at: string;
|
|
1978
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
1979
|
+
updated_at: string;
|
|
1980
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
1981
|
+
deleted_at?: string;
|
|
1982
|
+
key: string;
|
|
1983
|
+
/** Mapping to attribute metered usage to the customer by the event subject. */
|
|
1984
|
+
usage_attribution?: CustomerUsageAttribution;
|
|
1985
|
+
/** The primary email address of the customer. */
|
|
1986
|
+
primary_email?: string;
|
|
1987
|
+
/** Currency of the customer. Used for billing, tax and invoicing. */
|
|
1988
|
+
currency?: string;
|
|
1989
|
+
/** The billing address of the customer. Used for tax and invoicing. */
|
|
1990
|
+
billing_address?: BillingAddress;
|
|
1991
|
+
}
|
|
1992
|
+
/** Customer upsert request. */
|
|
1993
|
+
export interface UpsertCustomerRequest {
|
|
1994
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
1995
|
+
name: string;
|
|
1996
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
1997
|
+
description?: string;
|
|
1998
|
+
labels?: Labels;
|
|
1999
|
+
/** Mapping to attribute metered usage to the customer by the event subject. */
|
|
2000
|
+
usage_attribution?: CustomerUsageAttribution;
|
|
2001
|
+
/** The primary email address of the customer. */
|
|
2002
|
+
primary_email?: string;
|
|
2003
|
+
/** Currency of the customer. Used for billing, tax and invoicing. */
|
|
2004
|
+
currency?: string;
|
|
2005
|
+
/** The billing address of the customer. Used for tax and invoicing. */
|
|
2006
|
+
billing_address?: BillingAddress;
|
|
2007
|
+
}
|
|
2008
|
+
/** A collection of addresses for the party. */
|
|
2009
|
+
export interface PartyAddresses {
|
|
2010
|
+
/** Billing address. */
|
|
2011
|
+
billing_address: Address;
|
|
2012
|
+
}
|
|
2013
|
+
/** Checkout Session consent collection configuration. */
|
|
2014
|
+
export interface AppStripeCreateCheckoutSessionConsentCollection {
|
|
2015
|
+
/** Controls the visibility of payment method reuse agreement. */
|
|
2016
|
+
payment_method_reuse_agreement?: AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement;
|
|
2017
|
+
/** Enables collection of promotional communication consent. Only available to US merchants. When set to "auto", Checkout determines whether to show the option based on the customer's locale. */
|
|
2018
|
+
promotions?: 'auto' | 'none';
|
|
2019
|
+
/** Requires customers to accept terms of service before payment. Requires a valid terms of service URL in your Stripe Dashboard settings. */
|
|
2020
|
+
terms_of_service?: 'none' | 'required';
|
|
2021
|
+
}
|
|
2022
|
+
/** List customer entitlement access response data. */
|
|
2023
|
+
export interface ListCustomerEntitlementAccessResponseData {
|
|
2024
|
+
/** The list of entitlement access results. */
|
|
2025
|
+
data: EntitlementAccessResult[];
|
|
2026
|
+
}
|
|
2027
|
+
/** BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice. */
|
|
2028
|
+
export interface WorkflowCollectionAlignmentAnchored {
|
|
2029
|
+
/** The type of alignment. */
|
|
2030
|
+
type: 'anchored';
|
|
2031
|
+
/** The recurring period for the alignment. */
|
|
2032
|
+
recurring_period: RecurringPeriod;
|
|
2033
|
+
}
|
|
2034
|
+
/** Page paginated response. */
|
|
2035
|
+
export interface SubscriptionPagePaginatedResponse {
|
|
2036
|
+
data: Subscription[];
|
|
2037
|
+
meta: PaginatedMeta;
|
|
2038
|
+
}
|
|
2039
|
+
/** Response for changing a subscription. */
|
|
2040
|
+
export interface SubscriptionChangeResponse {
|
|
2041
|
+
/** The current subscription before the change. */
|
|
2042
|
+
current: Subscription;
|
|
2043
|
+
/** The new state of the subscription after the change. */
|
|
2044
|
+
next: Subscription;
|
|
2045
|
+
}
|
|
2046
|
+
/** Request for canceling a subscription. */
|
|
2047
|
+
export interface SubscriptionCancel {
|
|
2048
|
+
/** If not provided the subscription is canceled immediately. */
|
|
2049
|
+
timing: 'immediate' | 'next_billing_cycle' | string;
|
|
2050
|
+
}
|
|
2051
|
+
/** Request for changing a subscription. */
|
|
2052
|
+
export interface SubscriptionChange {
|
|
2053
|
+
labels?: Labels;
|
|
2054
|
+
/** The customer to create the subscription for. */
|
|
2055
|
+
customer: {
|
|
2056
|
+
id?: string;
|
|
2057
|
+
key?: string;
|
|
2058
|
+
};
|
|
2059
|
+
/** The plan reference of the subscription. */
|
|
2060
|
+
plan: {
|
|
2061
|
+
id?: string;
|
|
2062
|
+
key?: string;
|
|
2063
|
+
version?: number;
|
|
2064
|
+
};
|
|
2065
|
+
/** A billing anchor is the fixed point in time that determines the subscription's recurring billing cycle. It affects when charges occur and how prorations are calculated. Common anchors: - Calendar month (1st of each month): `2025-01-01T00:00:00Z` - Subscription anniversary (day customer signed up) - Custom date (customer-specified day) If not provided, the subscription will be created with the subscription's creation time as the billing anchor. */
|
|
2066
|
+
billing_anchor?: string;
|
|
2067
|
+
/** Timing configuration for the change, when the change should take effect. For changing a subscription, the accepted values depend on the subscription configuration. */
|
|
2068
|
+
timing: 'immediate' | 'next_billing_cycle' | string;
|
|
2069
|
+
}
|
|
2070
|
+
/** Stripe app. */
|
|
2071
|
+
export interface AppStripe {
|
|
2072
|
+
id: string;
|
|
2073
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2074
|
+
name: string;
|
|
2075
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2076
|
+
description?: string;
|
|
2077
|
+
labels?: Labels;
|
|
2078
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2079
|
+
created_at: string;
|
|
2080
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2081
|
+
updated_at: string;
|
|
2082
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2083
|
+
deleted_at?: string;
|
|
2084
|
+
/** The app type. */
|
|
2085
|
+
type: 'stripe';
|
|
2086
|
+
/** The app catalog definition that this installed app is based on. */
|
|
2087
|
+
definition: AppCatalogItem;
|
|
2088
|
+
/** Status of the app connection. */
|
|
2089
|
+
status: 'ready' | 'unauthorized';
|
|
2090
|
+
/** The Stripe account ID associated with the connected Stripe account. */
|
|
2091
|
+
account_id: string;
|
|
2092
|
+
/** Indicates whether the app is connected to a live Stripe account. */
|
|
2093
|
+
livemode: boolean;
|
|
2094
|
+
/** The masked Stripe API key that only exposes the first and last few characters. */
|
|
2095
|
+
masked_api_key: string;
|
|
2096
|
+
/** The Stripe secret API key used to authenticate API requests. */
|
|
2097
|
+
secret_api_key?: string;
|
|
2098
|
+
}
|
|
2099
|
+
/** Sandbox app can be used for testing billing features. */
|
|
2100
|
+
export interface AppSandbox {
|
|
2101
|
+
id: string;
|
|
2102
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2103
|
+
name: string;
|
|
2104
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2105
|
+
description?: string;
|
|
2106
|
+
labels?: Labels;
|
|
2107
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2108
|
+
created_at: string;
|
|
2109
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2110
|
+
updated_at: string;
|
|
2111
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2112
|
+
deleted_at?: string;
|
|
2113
|
+
/** The app type. */
|
|
2114
|
+
type: 'sandbox';
|
|
2115
|
+
/** The app catalog definition that this installed app is based on. */
|
|
2116
|
+
definition: AppCatalogItem;
|
|
2117
|
+
/** Status of the app connection. */
|
|
2118
|
+
status: 'ready' | 'unauthorized';
|
|
2119
|
+
}
|
|
2120
|
+
/** External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks. */
|
|
2121
|
+
export interface AppExternalInvoicing {
|
|
2122
|
+
id: string;
|
|
2123
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2124
|
+
name: string;
|
|
2125
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2126
|
+
description?: string;
|
|
2127
|
+
labels?: Labels;
|
|
2128
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2129
|
+
created_at: string;
|
|
2130
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2131
|
+
updated_at: string;
|
|
2132
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2133
|
+
deleted_at?: string;
|
|
2134
|
+
/** The app type. */
|
|
2135
|
+
type: 'external_invoicing';
|
|
2136
|
+
/** The app catalog definition that this installed app is based on. */
|
|
2137
|
+
definition: AppCatalogItem;
|
|
2138
|
+
/** Status of the app connection. */
|
|
2139
|
+
status: 'ready' | 'unauthorized';
|
|
2140
|
+
/** Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing. */
|
|
2141
|
+
enable_draft_sync_hook: boolean;
|
|
2142
|
+
/** Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued. */
|
|
2143
|
+
enable_issuing_sync_hook: boolean;
|
|
2144
|
+
}
|
|
2145
|
+
/** TaxCode create request. */
|
|
2146
|
+
export interface CreateTaxCodeRequest {
|
|
2147
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2148
|
+
name: string;
|
|
2149
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2150
|
+
description?: string;
|
|
2151
|
+
labels?: Labels;
|
|
2152
|
+
key: string;
|
|
2153
|
+
/** Mapping of app types to tax codes. */
|
|
2154
|
+
app_mappings: TaxCodeAppMapping[];
|
|
2155
|
+
}
|
|
2156
|
+
/** Tax codes by provider. */
|
|
2157
|
+
export interface TaxCode {
|
|
2158
|
+
id: string;
|
|
2159
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2160
|
+
name: string;
|
|
2161
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2162
|
+
description?: string;
|
|
2163
|
+
labels?: Labels;
|
|
2164
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2165
|
+
created_at: string;
|
|
2166
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2167
|
+
updated_at: string;
|
|
2168
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2169
|
+
deleted_at?: string;
|
|
2170
|
+
key: string;
|
|
2171
|
+
/** Mapping of app types to tax codes. */
|
|
2172
|
+
app_mappings: TaxCodeAppMapping[];
|
|
2173
|
+
}
|
|
2174
|
+
/** TaxCode upsert request. */
|
|
2175
|
+
export interface UpsertTaxCodeRequest {
|
|
2176
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2177
|
+
name: string;
|
|
2178
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2179
|
+
description?: string;
|
|
2180
|
+
labels?: Labels;
|
|
2181
|
+
/** Mapping of app types to tax codes. */
|
|
2182
|
+
app_mappings: TaxCodeAppMapping[];
|
|
2183
|
+
}
|
|
2184
|
+
/** Access status for a single feature. */
|
|
2185
|
+
export interface GovernanceFeatureAccess {
|
|
2186
|
+
/** Whether the customer currently has access to the feature. `true` for boolean and static entitlements that are available, and for metered entitlements with remaining balance. `false` when the feature is unavailable, the usage limit has been reached, or (when applicable) credits have been exhausted. */
|
|
2187
|
+
has_access: boolean;
|
|
2188
|
+
/** Optional reason when the customer does not have access to the feature. Populated when `has_access` is `false`. */
|
|
2189
|
+
reason?: GovernanceFeatureAccessReason;
|
|
2190
|
+
}
|
|
2191
|
+
/** Usage quantity details on an invoice line item when UnitConfig is in effect. Provides the full audit trail from raw meter output to the invoiced amount. */
|
|
2192
|
+
export interface InvoiceUsageQuantityDetail {
|
|
2193
|
+
/** The raw quantity as reported by the meter (native units). */
|
|
2194
|
+
raw_quantity: string;
|
|
2195
|
+
/** The precise decimal value after applying the conversion operation and factor, before rounding. */
|
|
2196
|
+
converted_quantity: string;
|
|
2197
|
+
/** The quantity after rounding, used for pricing. */
|
|
2198
|
+
invoiced_quantity: string;
|
|
2199
|
+
/** The display unit label (e.g., "GB", "hours", "M tokens"). */
|
|
2200
|
+
display_unit?: string;
|
|
2201
|
+
/** Snapshot of the UnitConfig that was in effect at billing time. Ensures historical invoices reflect the config that was actually applied. */
|
|
2202
|
+
applied_unit_config: UnitConfig;
|
|
2203
|
+
}
|
|
2204
|
+
/** Billing customer data. */
|
|
2205
|
+
export interface CustomerData {
|
|
2206
|
+
/** The billing profile for the customer. If not provided, the default billing profile will be used. */
|
|
2207
|
+
billing_profile?: ProfileReference;
|
|
2208
|
+
/** App customer data. */
|
|
2209
|
+
app_data?: AppCustomerData;
|
|
2210
|
+
}
|
|
2211
|
+
/** CustomerBillingData upsert request. */
|
|
2212
|
+
export interface UpsertCustomerBillingDataRequest {
|
|
2213
|
+
/** The billing profile for the customer. If not provided, the default billing profile will be used. */
|
|
2214
|
+
billing_profile?: ProfileReference;
|
|
2215
|
+
/** App customer data. */
|
|
2216
|
+
app_data?: AppCustomerData;
|
|
2217
|
+
}
|
|
2218
|
+
/** The balances of the credits of a customer. */
|
|
2219
|
+
export interface CreditBalances {
|
|
2220
|
+
/** The timestamp of the balance retrieval. */
|
|
2221
|
+
retrieved_at: string;
|
|
2222
|
+
/** The balances by currencies. */
|
|
2223
|
+
balances: CreditBalance[];
|
|
2224
|
+
}
|
|
2225
|
+
/** Cursor paginated response. */
|
|
2226
|
+
export interface CreditTransactionPaginatedResponse {
|
|
2227
|
+
data: CreditTransaction[];
|
|
2228
|
+
meta: CursorMeta;
|
|
2229
|
+
}
|
|
2230
|
+
/** Graduated tiered price. Each tier's rate applies only to the usage within that tier. Pricing can change as cumulative usage crosses tier boundaries. When UnitConfig is present on the rate card, tier boundaries (up_to_amount) are expressed in converted billing units. */
|
|
2231
|
+
export interface PriceGraduated {
|
|
2232
|
+
/** The type of the price. */
|
|
2233
|
+
type: 'graduated';
|
|
2234
|
+
/** The tiers of the graduated price. At least one tier is required. */
|
|
2235
|
+
tiers: PriceTier[];
|
|
2236
|
+
}
|
|
2237
|
+
/** Volume tiered price. The maximum quantity within a period determines the per-unit price for all units in that period. When UnitConfig is present on the rate card, tier boundaries (up_to_amount) are expressed in converted billing units. */
|
|
2238
|
+
export interface PriceVolume {
|
|
2239
|
+
/** The type of the price. */
|
|
2240
|
+
type: 'volume';
|
|
2241
|
+
/** The tiers of the volume price. At least one tier is required. */
|
|
2242
|
+
tiers: PriceTier[];
|
|
2243
|
+
}
|
|
2244
|
+
/** Page paginated response. */
|
|
2245
|
+
export interface PricePagePaginatedResponse {
|
|
2246
|
+
data: LlmCostPrice[];
|
|
2247
|
+
meta: PaginatedMeta;
|
|
2248
|
+
}
|
|
2249
|
+
/** CreditGrant create request. */
|
|
2250
|
+
export interface CreateCreditGrantRequest {
|
|
2251
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2252
|
+
name: string;
|
|
2253
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2254
|
+
description?: string;
|
|
2255
|
+
labels?: CreateLabels;
|
|
2256
|
+
/** Funding method of the grant. */
|
|
2257
|
+
funding_method: 'none' | 'invoice' | 'external';
|
|
2258
|
+
/** The currency of the granted credits. */
|
|
2259
|
+
currency: string;
|
|
2260
|
+
/** Granted credit amount. */
|
|
2261
|
+
amount: string;
|
|
2262
|
+
/** Present when a funding workflow applies (funding_method is not `none`). */
|
|
2263
|
+
purchase?: CreateCreditGrantPurchase;
|
|
2264
|
+
/** Tax configuration for the grant. For `invoice` and `external` funding methods, tax configuration should be provided to ensure correct revenue recognition. When not provided, the default credit grant tax code is applied, if that's not set the global default taxcode is used. */
|
|
2265
|
+
tax_config?: CreateCreditGrantTaxConfig;
|
|
2266
|
+
filters?: CreateCreditGrantFilters;
|
|
2267
|
+
/** Draw-down priority of the grant. Lower values have higher priority. */
|
|
2268
|
+
priority: number;
|
|
2269
|
+
/** The duration after which the credit grant expires. Defaults to never expiring. */
|
|
2270
|
+
expires_after?: string;
|
|
2271
|
+
}
|
|
2272
|
+
/** A credit grant allocates credits to a customer. Credits are drawn down against charges according to the settlement mode configured on the rate card. */
|
|
2273
|
+
export interface CreditGrant {
|
|
2274
|
+
id: string;
|
|
2275
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2276
|
+
name: string;
|
|
2277
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2278
|
+
description?: string;
|
|
2279
|
+
labels?: Labels;
|
|
2280
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2281
|
+
created_at: string;
|
|
2282
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2283
|
+
updated_at: string;
|
|
2284
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2285
|
+
deleted_at?: string;
|
|
2286
|
+
/** Funding method of the grant. */
|
|
2287
|
+
funding_method: 'none' | 'invoice' | 'external';
|
|
2288
|
+
/** The currency of the granted credits. */
|
|
2289
|
+
currency: string;
|
|
2290
|
+
/** Granted credit amount. */
|
|
2291
|
+
amount: string;
|
|
2292
|
+
/** Present when a funding workflow applies (funding_method is not `none`). */
|
|
2293
|
+
purchase?: CreditGrantPurchase;
|
|
2294
|
+
/** Tax configuration for the grant. For `invoice` and `external` funding methods, tax configuration should be provided to ensure correct revenue recognition. When not provided, the default credit grant tax code is applied, if that's not set the global default taxcode is used. */
|
|
2295
|
+
tax_config?: CreditGrantTaxConfig;
|
|
2296
|
+
/** Available when `funding_method` is `invoice`. */
|
|
2297
|
+
invoice?: CreditGrantInvoiceReference;
|
|
2298
|
+
filters?: CreditGrantFilters;
|
|
2299
|
+
/** Draw-down priority of the grant. Lower values have higher priority. */
|
|
2300
|
+
priority: number;
|
|
2301
|
+
/** The duration after which the credit grant expires. Defaults to never expiring. */
|
|
2302
|
+
expires_after?: string;
|
|
2303
|
+
/** The timestamp when the credit grant expires. Calculated from the grant effective time and `expires_after` if provided. */
|
|
2304
|
+
expires_at?: string;
|
|
2305
|
+
/** Timestamp when the grant was voided. */
|
|
2306
|
+
voided_at?: string;
|
|
2307
|
+
/** Current lifecycle status of the grant. */
|
|
2308
|
+
status: 'pending' | 'active' | 'expired' | 'voided';
|
|
2309
|
+
}
|
|
2310
|
+
/** Tax settings for a billing workflow. */
|
|
2311
|
+
export interface WorkflowTaxSettings {
|
|
2312
|
+
/** Enable automatic tax calculation when tax is supported by the app. For example, with Stripe Invoicing when enabled, tax is calculated via Stripe Tax. */
|
|
2313
|
+
enabled: boolean;
|
|
2314
|
+
/** Enforce tax calculation when tax is supported by the app. When enabled, the billing system will not allow to create an invoice without tax calculation. Enforcement is different per apps, for example, Stripe app requires customer to have a tax location when starting a paid subscription. */
|
|
2315
|
+
enforced: boolean;
|
|
2316
|
+
/** Default tax configuration to apply to the invoices for line items. */
|
|
2317
|
+
default_tax_config?: TaxConfig;
|
|
2318
|
+
}
|
|
2319
|
+
/** Page paginated response. */
|
|
2320
|
+
export interface SubscriptionAddonPagePaginatedResponse {
|
|
2321
|
+
data: SubscriptionAddon[];
|
|
2322
|
+
meta: PaginatedMeta;
|
|
2323
|
+
}
|
|
2324
|
+
/** Page paginated response. */
|
|
2325
|
+
export interface PlanAddonPagePaginatedResponse {
|
|
2326
|
+
data: PlanAddon[];
|
|
2327
|
+
meta: PaginatedMeta;
|
|
2328
|
+
}
|
|
2329
|
+
/** Cursor paginated response. */
|
|
2330
|
+
export interface IngestedEventPaginatedResponse {
|
|
2331
|
+
data: IngestedEvent[];
|
|
2332
|
+
meta: CursorMeta;
|
|
2333
|
+
}
|
|
2334
|
+
/** The list of parameters that failed validation. */
|
|
2335
|
+
export type InvalidParameters = (InvalidParameterStandard | InvalidParameterMinimumLength | InvalidParameterMaximumLength | InvalidParameterChoiceItem | InvalidParameterDependentItem)[];
|
|
2336
|
+
/** A meter query request. */
|
|
2337
|
+
export interface MeterQueryRequest {
|
|
2338
|
+
/** The start of the period the usage is queried from. */
|
|
2339
|
+
from?: string;
|
|
2340
|
+
/** The end of the period the usage is queried to. */
|
|
2341
|
+
to?: string;
|
|
2342
|
+
/** The size of the time buckets to group the usage into. If not specified, the usage is aggregated over the entire period. */
|
|
2343
|
+
granularity?: 'PT1M' | 'PT1H' | 'P1D' | 'P1M';
|
|
2344
|
+
/** The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). The time zone is used to determine the start and end of the time buckets. If not specified, the UTC timezone will be used. */
|
|
2345
|
+
time_zone: string;
|
|
2346
|
+
/** The dimensions to group the results by. */
|
|
2347
|
+
group_by_dimensions?: string[];
|
|
2348
|
+
/** Filters to apply to the query. */
|
|
2349
|
+
filters?: MeterQueryFilters;
|
|
2350
|
+
}
|
|
2351
|
+
/** Page paginated response. */
|
|
2352
|
+
export interface CustomerPagePaginatedResponse {
|
|
2353
|
+
data: Customer[];
|
|
2354
|
+
meta: PaginatedMeta;
|
|
2355
|
+
}
|
|
2356
|
+
/** Party represents a person or business entity. */
|
|
2357
|
+
export interface Party {
|
|
2358
|
+
/** Unique identifier for the party. */
|
|
2359
|
+
id?: string;
|
|
2360
|
+
/** An optional unique key of the party. */
|
|
2361
|
+
key?: string;
|
|
2362
|
+
/** Legal name or representation of the party. */
|
|
2363
|
+
name?: string;
|
|
2364
|
+
/** The entity's legal identification used for tax purposes. They may have other numbers, but we're only interested in those valid for tax purposes. */
|
|
2365
|
+
tax_id?: PartyTaxIdentity;
|
|
2366
|
+
/** Address for where information should be sent if needed. */
|
|
2367
|
+
addresses?: PartyAddresses;
|
|
2368
|
+
}
|
|
2369
|
+
/** Configuration options for creating a Stripe Checkout Session. Based on Stripe's [Checkout Session API parameters](https://docs.stripe.com/api/checkout/sessions/create). */
|
|
2370
|
+
export interface AppStripeCreateCheckoutSessionRequestOptions {
|
|
2371
|
+
/** Whether to collect the customer's billing address. Defaults to auto, which only collects the address when necessary for tax calculation. */
|
|
2372
|
+
billing_address_collection: 'auto' | 'required';
|
|
2373
|
+
/** URL to redirect customers who cancel the checkout session. Not allowed when ui_mode is "embedded". */
|
|
2374
|
+
cancel_url?: string;
|
|
2375
|
+
/** Unique reference string for reconciling sessions with internal systems. Can be a customer ID, cart ID, or any other identifier. */
|
|
2376
|
+
client_reference_id?: string;
|
|
2377
|
+
/** Controls which customer fields can be updated by the checkout session. */
|
|
2378
|
+
customer_update?: AppStripeCreateCheckoutSessionCustomerUpdate;
|
|
2379
|
+
/** Configuration for collecting customer consent during checkout. */
|
|
2380
|
+
consent_collection?: AppStripeCreateCheckoutSessionConsentCollection;
|
|
2381
|
+
/** Three-letter ISO 4217 currency code in uppercase. Required for payment mode sessions. Optional for setup mode sessions. */
|
|
2382
|
+
currency?: string;
|
|
2383
|
+
/** Custom text to display during checkout at various stages. */
|
|
2384
|
+
custom_text?: AppStripeCheckoutSessionCustomTextParams;
|
|
2385
|
+
/** Unix timestamp when the checkout session expires. Can be 30 minutes to 24 hours from creation. Defaults to 24 hours. */
|
|
2386
|
+
expires_at?: bigint;
|
|
2387
|
+
/** IETF language tag for the checkout UI locale. If blank or "auto", uses the browser's locale. Example: "en", "fr", "de". */
|
|
2388
|
+
locale?: string;
|
|
2389
|
+
/** Set of key-value pairs to attach to the checkout session. Useful for storing additional structured information. */
|
|
2390
|
+
metadata?: Record<string, string>;
|
|
2391
|
+
/** Return URL for embedded checkout sessions after payment authentication. Required if ui_mode is "embedded" and redirect-based payment methods are enabled. */
|
|
2392
|
+
return_url?: string;
|
|
2393
|
+
/** Success URL to redirect customers after completing payment or setup. Not allowed when ui_mode is "embedded". See: https://docs.stripe.com/payments/checkout/custom-success-page */
|
|
2394
|
+
success_url?: string;
|
|
2395
|
+
/** The UI mode for the checkout session. "hosted" displays a Stripe-hosted page. "embedded" integrates directly into your app. Defaults to "hosted". */
|
|
2396
|
+
ui_mode: 'embedded' | 'hosted';
|
|
2397
|
+
/** List of payment method types to enable (e.g., "card", "us_bank_account"). If not specified, Stripe enables all relevant payment methods. */
|
|
2398
|
+
payment_method_types?: string[];
|
|
2399
|
+
/** Redirect behavior for embedded checkout sessions. Controls when to redirect users after completion. See: https://docs.stripe.com/payments/checkout/custom-success-page?payment-ui=embedded-form */
|
|
2400
|
+
redirect_on_completion?: 'always' | 'if_required' | 'never';
|
|
2401
|
+
/** Configuration for collecting tax IDs during checkout. */
|
|
2402
|
+
tax_id_collection?: AppStripeCreateCheckoutSessionTaxIdCollection;
|
|
2403
|
+
}
|
|
2404
|
+
/** Page paginated response. */
|
|
2405
|
+
export interface TaxCodePagePaginatedResponse {
|
|
2406
|
+
data: TaxCode[];
|
|
2407
|
+
meta: PaginatedMeta;
|
|
2408
|
+
}
|
|
2409
|
+
/** Page paginated response. */
|
|
2410
|
+
export interface CurrencyPagePaginatedResponse {
|
|
2411
|
+
data: (CurrencyFiat | CurrencyCustom)[];
|
|
2412
|
+
meta: PaginatedMeta;
|
|
2413
|
+
}
|
|
2414
|
+
/** Access evaluation result for a single resolved customer. */
|
|
2415
|
+
export interface GovernanceQueryResult {
|
|
2416
|
+
/** The list of identifiers from the request that resolved to this customer. Each entry is either the customer `key` or one of its usage-attribution subject `key`s. Duplicate or aliased identifiers that resolve to the same customer collapse to a single result entry, with every requested identifier listed here. */
|
|
2417
|
+
matched: string[];
|
|
2418
|
+
/** The customer the matched identifiers resolved to. */
|
|
2419
|
+
customer: Customer;
|
|
2420
|
+
/** Map of features with their access status. Map keys are the feature keys requested in `feature.keys`, or every feature `key` available in the organization when the feature filter was omitted. */
|
|
2421
|
+
features: Record<string, GovernanceFeatureAccess>;
|
|
2422
|
+
/** Timestamp of the most recent change to the customer's access state reflected in this result. */
|
|
2423
|
+
updated_at: string;
|
|
2424
|
+
}
|
|
2425
|
+
/** A capability or billable dimension offered by a provider. */
|
|
2426
|
+
export interface Feature {
|
|
2427
|
+
id: string;
|
|
2428
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2429
|
+
name: string;
|
|
2430
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2431
|
+
description?: string;
|
|
2432
|
+
labels?: Labels;
|
|
2433
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2434
|
+
created_at: string;
|
|
2435
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2436
|
+
updated_at: string;
|
|
2437
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2438
|
+
deleted_at?: string;
|
|
2439
|
+
key: string;
|
|
2440
|
+
/** The meter that the feature is associated with and based on which usage is calculated. If not specified, the feature is static. */
|
|
2441
|
+
meter?: FeatureMeterReference;
|
|
2442
|
+
/** Optional per-unit cost configuration. Use "manual" for a fixed per-unit cost, or "llm" to look up cost from the LLM cost database based on meter group-by properties. */
|
|
2443
|
+
unit_cost?: FeatureManualUnitCost | FeatureLlmUnitCost;
|
|
2444
|
+
}
|
|
2445
|
+
/** Feature create request. */
|
|
2446
|
+
export interface CreateFeatureRequest {
|
|
2447
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2448
|
+
name: string;
|
|
2449
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2450
|
+
description?: string;
|
|
2451
|
+
labels?: Labels;
|
|
2452
|
+
key: string;
|
|
2453
|
+
/** The meter that the feature is associated with and based on which usage is calculated. If not specified, the feature is static. */
|
|
2454
|
+
meter?: FeatureMeterReference;
|
|
2455
|
+
/** Optional per-unit cost configuration. Use "manual" for a fixed per-unit cost, or "llm" to look up cost from the LLM cost database based on meter group-by properties. */
|
|
2456
|
+
unit_cost?: FeatureManualUnitCost | FeatureLlmUnitCost;
|
|
2457
|
+
}
|
|
2458
|
+
/** Request body for updating a feature. Currently only the unit_cost field can be updated. */
|
|
2459
|
+
export interface UpdateFeatureRequest {
|
|
2460
|
+
/** Optional per-unit cost configuration. Use "manual" for a fixed per-unit cost, or "llm" to look up cost from the LLM cost database based on meter group-by properties. Set to `null` to clear the existing unit cost; omit to leave it unchanged. */
|
|
2461
|
+
unit_cost?: FeatureManualUnitCost | FeatureLlmUnitCost | null;
|
|
2462
|
+
}
|
|
2463
|
+
/** Page paginated response. */
|
|
2464
|
+
export interface CreditGrantPagePaginatedResponse {
|
|
2465
|
+
data: CreditGrant[];
|
|
2466
|
+
meta: PaginatedMeta;
|
|
2467
|
+
}
|
|
2468
|
+
/** Bad Request. */
|
|
2469
|
+
export interface BadRequest extends BaseError {
|
|
2470
|
+
/** The list of parameters that failed validation. */
|
|
2471
|
+
invalid_parameters: (InvalidParameterStandard | InvalidParameterMinimumLength | InvalidParameterMaximumLength | InvalidParameterChoiceItem | InvalidParameterDependentItem)[];
|
|
2472
|
+
}
|
|
2473
|
+
/** Request to create a Stripe Checkout Session for the customer. Checkout Sessions are used to collect payment method information from customers in a secure, Stripe-hosted interface. This integration uses setup mode to collect payment methods that can be charged later for subscription billing. */
|
|
2474
|
+
export interface CustomerStripeCreateCheckoutSessionRequest {
|
|
2475
|
+
/** Options for configuring the Stripe Checkout Session. These options are passed directly to Stripe's [checkout session creation API](https://docs.stripe.com/api/checkout/sessions/create). */
|
|
2476
|
+
stripe_options: AppStripeCreateCheckoutSessionRequestOptions;
|
|
2477
|
+
}
|
|
2478
|
+
/** Workflow collection specifies how to collect the pending line items for an invoice. */
|
|
2479
|
+
export interface WorkflowCollectionSettings {
|
|
2480
|
+
/** The alignment for collecting the pending line items into an invoice. */
|
|
2481
|
+
alignment: WorkflowCollectionAlignmentSubscription | WorkflowCollectionAlignmentAnchored;
|
|
2482
|
+
/** This grace period can be used to delay the collection of the pending line items specified in alignment. This is useful, in case of multiple subscriptions having slightly different billing periods. */
|
|
2483
|
+
interval: string;
|
|
2484
|
+
}
|
|
2485
|
+
/** Page paginated response. */
|
|
2486
|
+
export interface AppPagePaginatedResponse {
|
|
2487
|
+
data: (AppStripe | AppSandbox | AppExternalInvoicing)[];
|
|
2488
|
+
meta: PaginatedMeta;
|
|
2489
|
+
}
|
|
2490
|
+
/** Applications used by a billing profile. */
|
|
2491
|
+
export interface ProfileApps {
|
|
2492
|
+
/** The tax app used for this workflow. */
|
|
2493
|
+
tax: AppStripe | AppSandbox | AppExternalInvoicing;
|
|
2494
|
+
/** The invoicing app used for this workflow. */
|
|
2495
|
+
invoicing: AppStripe | AppSandbox | AppExternalInvoicing;
|
|
2496
|
+
/** The payment app used for this workflow. */
|
|
2497
|
+
payment: AppStripe | AppSandbox | AppExternalInvoicing;
|
|
2498
|
+
}
|
|
2499
|
+
/** Response of the governance query. */
|
|
2500
|
+
export interface GovernanceQueryResponse {
|
|
2501
|
+
/** Access evaluation results, one entry per resolved customer. */
|
|
2502
|
+
data: GovernanceQueryResult[];
|
|
2503
|
+
/** Partial errors encountered while processing the request. */
|
|
2504
|
+
errors: GovernanceQueryError[];
|
|
2505
|
+
/** Pagination metadata. The endpoint may return a partial response if the full response would exceed server-side limits. */
|
|
2506
|
+
meta: CursorMeta;
|
|
2507
|
+
}
|
|
2508
|
+
/** A flat fee charge for a customer. */
|
|
2509
|
+
export interface FlatFeeCharge {
|
|
2510
|
+
id: string;
|
|
2511
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2512
|
+
name: string;
|
|
2513
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2514
|
+
description?: string;
|
|
2515
|
+
labels?: Labels;
|
|
2516
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2517
|
+
created_at: string;
|
|
2518
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2519
|
+
updated_at: string;
|
|
2520
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2521
|
+
deleted_at?: string;
|
|
2522
|
+
/** The type of the charge. */
|
|
2523
|
+
type: 'flat_fee';
|
|
2524
|
+
/** The customer owning the charge. */
|
|
2525
|
+
customer: BillingCustomerReference;
|
|
2526
|
+
/** The charge is managed by the following entity. */
|
|
2527
|
+
managed_by: 'manual' | 'system' | 'subscription';
|
|
2528
|
+
/** The subscription that originated the charge, when the charge was created from a subscription item. */
|
|
2529
|
+
subscription?: SubscriptionReference;
|
|
2530
|
+
/** The currency of the charge. */
|
|
2531
|
+
currency: string;
|
|
2532
|
+
/** The lifecycle status of the charge. */
|
|
2533
|
+
status: 'created' | 'active' | 'final' | 'deleted';
|
|
2534
|
+
/** The timestamp when the charge is intended to be invoiced. */
|
|
2535
|
+
invoice_at: string;
|
|
2536
|
+
/** The effective service period covered by the charge. */
|
|
2537
|
+
service_period: ClosedPeriod;
|
|
2538
|
+
/** The full, unprorated service period of the charge. */
|
|
2539
|
+
full_service_period: ClosedPeriod;
|
|
2540
|
+
/** The billing period the charge belongs to. */
|
|
2541
|
+
billing_period: ClosedPeriod;
|
|
2542
|
+
/** The earliest time when the charge should be advanced again by background processing. */
|
|
2543
|
+
advance_after?: string;
|
|
2544
|
+
/** The price of the charge. */
|
|
2545
|
+
price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
2546
|
+
/** Unique reference ID of the charge. */
|
|
2547
|
+
unique_reference_id?: string;
|
|
2548
|
+
/** Settlement mode of the charge. */
|
|
2549
|
+
settlement_mode: 'credit_then_invoice' | 'credit_only';
|
|
2550
|
+
/** Tax configuration of the charge. */
|
|
2551
|
+
tax_config?: TaxConfig;
|
|
2552
|
+
/** Payment term of the flat fee charge. */
|
|
2553
|
+
payment_term: 'in_advance' | 'in_arrears';
|
|
2554
|
+
/** The discounts applied to the charge. */
|
|
2555
|
+
discounts?: FlatFeeDiscounts;
|
|
2556
|
+
/** The feature associated with the charge, when applicable. */
|
|
2557
|
+
feature_key?: string;
|
|
2558
|
+
/** The proration configuration of the charge. */
|
|
2559
|
+
proration_configuration: RateCardProrationConfiguration;
|
|
2560
|
+
/** The amount after proration of the charge. */
|
|
2561
|
+
amount_after_proration: CurrencyAmount;
|
|
2562
|
+
}
|
|
2563
|
+
/** A usage-based charge for a customer. */
|
|
2564
|
+
export interface UsageBasedCharge {
|
|
2565
|
+
id: string;
|
|
2566
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2567
|
+
name: string;
|
|
2568
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2569
|
+
description?: string;
|
|
2570
|
+
labels?: Labels;
|
|
2571
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2572
|
+
created_at: string;
|
|
2573
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2574
|
+
updated_at: string;
|
|
2575
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2576
|
+
deleted_at?: string;
|
|
2577
|
+
/** The type of the charge. */
|
|
2578
|
+
type: 'usage_based';
|
|
2579
|
+
/** The customer owning the charge. */
|
|
2580
|
+
customer: BillingCustomerReference;
|
|
2581
|
+
/** The charge is managed by the following entity. */
|
|
2582
|
+
managed_by: 'manual' | 'system' | 'subscription';
|
|
2583
|
+
/** The subscription that originated the charge, when the charge was created from a subscription item. */
|
|
2584
|
+
subscription?: SubscriptionReference;
|
|
2585
|
+
/** The currency of the charge. */
|
|
2586
|
+
currency: string;
|
|
2587
|
+
/** The lifecycle status of the charge. */
|
|
2588
|
+
status: 'created' | 'active' | 'final' | 'deleted';
|
|
2589
|
+
/** The timestamp when the charge is intended to be invoiced. */
|
|
2590
|
+
invoice_at: string;
|
|
2591
|
+
/** The effective service period covered by the charge. */
|
|
2592
|
+
service_period: ClosedPeriod;
|
|
2593
|
+
/** The full, unprorated service period of the charge. */
|
|
2594
|
+
full_service_period: ClosedPeriod;
|
|
2595
|
+
/** The billing period the charge belongs to. */
|
|
2596
|
+
billing_period: ClosedPeriod;
|
|
2597
|
+
/** The earliest time when the charge should be advanced again by background processing. */
|
|
2598
|
+
advance_after?: string;
|
|
2599
|
+
/** The price of the charge. */
|
|
2600
|
+
price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
2601
|
+
/** Unique reference ID of the charge. */
|
|
2602
|
+
unique_reference_id?: string;
|
|
2603
|
+
/** Settlement mode of the charge. */
|
|
2604
|
+
settlement_mode: 'credit_then_invoice' | 'credit_only';
|
|
2605
|
+
/** Tax configuration of the charge. */
|
|
2606
|
+
tax_config?: TaxConfig;
|
|
2607
|
+
/** Discounts applied to the usage-based charge. */
|
|
2608
|
+
discounts?: RateCardDiscounts;
|
|
2609
|
+
/** The feature associated with the charge. */
|
|
2610
|
+
feature_key: string;
|
|
2611
|
+
/** Aggregated booked and realtime totals for the charge. */
|
|
2612
|
+
totals: ChargeTotals;
|
|
2613
|
+
}
|
|
2614
|
+
/** A rate card defines the pricing and entitlement of a feature or service. */
|
|
2615
|
+
export interface RateCard {
|
|
2616
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2617
|
+
name: string;
|
|
2618
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2619
|
+
description?: string;
|
|
2620
|
+
labels?: Labels;
|
|
2621
|
+
key: string;
|
|
2622
|
+
/** The feature associated with the rate card. */
|
|
2623
|
+
feature?: FeatureReference;
|
|
2624
|
+
/** The billing cadence of the rate card. When null, the charge is one-time (non-recurring). Only valid for flat prices. */
|
|
2625
|
+
billing_cadence?: string;
|
|
2626
|
+
/** The price of the rate card. */
|
|
2627
|
+
price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
2628
|
+
/** The payment term of the rate card. In advance payment term can only be used for flat prices. */
|
|
2629
|
+
payment_term: 'in_advance' | 'in_arrears';
|
|
2630
|
+
/** Spend commitments for this rate card. Only applicable to usage-based prices (unit, graduated, volume). */
|
|
2631
|
+
commitments?: SpendCommitments;
|
|
2632
|
+
/** The discounts of the rate card. */
|
|
2633
|
+
discounts?: RateCardDiscounts;
|
|
2634
|
+
/** The tax config of the rate card. */
|
|
2635
|
+
tax_config?: RateCardTaxConfig;
|
|
2636
|
+
}
|
|
2637
|
+
/** Page paginated response. */
|
|
2638
|
+
export interface FeaturePagePaginatedResponse {
|
|
2639
|
+
data: Feature[];
|
|
2640
|
+
meta: PaginatedMeta;
|
|
2641
|
+
}
|
|
2642
|
+
/** Billing workflow settings. */
|
|
2643
|
+
export interface Workflow {
|
|
2644
|
+
/** The collection settings for this workflow */
|
|
2645
|
+
collection?: WorkflowCollectionSettings;
|
|
2646
|
+
/** The invoicing settings for this workflow */
|
|
2647
|
+
invoicing?: WorkflowInvoicingSettings;
|
|
2648
|
+
/** The payment settings for this workflow */
|
|
2649
|
+
payment?: WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettings;
|
|
2650
|
+
/** The tax settings for this workflow */
|
|
2651
|
+
tax?: WorkflowTaxSettings;
|
|
2652
|
+
}
|
|
2653
|
+
/** The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. */
|
|
2654
|
+
export interface PlanPhase {
|
|
2655
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2656
|
+
name: string;
|
|
2657
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2658
|
+
description?: string;
|
|
2659
|
+
labels?: Labels;
|
|
2660
|
+
key: string;
|
|
2661
|
+
/** The duration of the phase. When not specified, the phase runs indefinitely. Only the last phase may omit the duration. */
|
|
2662
|
+
duration?: string;
|
|
2663
|
+
/** The rate cards of the plan. */
|
|
2664
|
+
rate_cards: RateCard[];
|
|
2665
|
+
}
|
|
2666
|
+
/** Add-on allows extending subscriptions with compatible plans with additional ratecards. */
|
|
2667
|
+
export interface Addon {
|
|
2668
|
+
id: string;
|
|
2669
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2670
|
+
name: string;
|
|
2671
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2672
|
+
description?: string;
|
|
2673
|
+
labels?: Labels;
|
|
2674
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2675
|
+
created_at: string;
|
|
2676
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2677
|
+
updated_at: string;
|
|
2678
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2679
|
+
deleted_at?: string;
|
|
2680
|
+
/** A key is a semi-unique string that is used to identify the add-on. It is used to reference the latest `active` version of the add-on and is unique with the version number. */
|
|
2681
|
+
key: string;
|
|
2682
|
+
/** Version of the add-on. Incremented when the add-on is updated. */
|
|
2683
|
+
version: number;
|
|
2684
|
+
/** The InstanceType of the add-ons. Can be "single" or "multiple". */
|
|
2685
|
+
instance_type: 'single' | 'multiple';
|
|
2686
|
+
/** The currency code of the add-on. */
|
|
2687
|
+
currency: string;
|
|
2688
|
+
/** The date and time when the add-on becomes effective. When not specified, the add-on is a draft. */
|
|
2689
|
+
effective_from?: string;
|
|
2690
|
+
/** The date and time when the add-on is no longer effective. When not specified, the add-on is effective indefinitely. */
|
|
2691
|
+
effective_to?: string;
|
|
2692
|
+
/** The status of the add-on. Computed based on the effective start and end dates: - `draft`: `effective_from` is not set. - `active`: `effective_from <= now` and (`effective_to` is not set or `now < effective_to`). - `archived`: `effective_to <= now`. */
|
|
2693
|
+
status: 'draft' | 'active' | 'archived';
|
|
2694
|
+
/** The rate cards of the add-on. */
|
|
2695
|
+
rate_cards: RateCard[];
|
|
2696
|
+
/** List of validation errors. */
|
|
2697
|
+
validation_errors?: ProductCatalogValidationError[];
|
|
2698
|
+
}
|
|
2699
|
+
/** Addon create request. */
|
|
2700
|
+
export interface CreateAddonRequest {
|
|
2701
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2702
|
+
name: string;
|
|
2703
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2704
|
+
description?: string;
|
|
2705
|
+
labels?: Labels;
|
|
2706
|
+
/** A key is a semi-unique string that is used to identify the add-on. It is used to reference the latest `active` version of the add-on and is unique with the version number. */
|
|
2707
|
+
key: string;
|
|
2708
|
+
/** The InstanceType of the add-ons. Can be "single" or "multiple". */
|
|
2709
|
+
instance_type: 'single' | 'multiple';
|
|
2710
|
+
/** The currency code of the add-on. */
|
|
2711
|
+
currency: string;
|
|
2712
|
+
/** The rate cards of the add-on. */
|
|
2713
|
+
rate_cards: RateCard[];
|
|
2714
|
+
}
|
|
2715
|
+
/** Addon upsert request. */
|
|
2716
|
+
export interface UpsertAddonRequest {
|
|
2717
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2718
|
+
name: string;
|
|
2719
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2720
|
+
description?: string;
|
|
2721
|
+
labels?: Labels;
|
|
2722
|
+
/** The InstanceType of the add-ons. Can be "single" or "multiple". */
|
|
2723
|
+
instance_type: 'single' | 'multiple';
|
|
2724
|
+
/** The rate cards of the add-on. */
|
|
2725
|
+
rate_cards: RateCard[];
|
|
2726
|
+
}
|
|
2727
|
+
/** Billing profiles contain the settings for billing and controls invoice generation. */
|
|
2728
|
+
export interface Profile {
|
|
2729
|
+
id: string;
|
|
2730
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2731
|
+
name: string;
|
|
2732
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2733
|
+
description?: string;
|
|
2734
|
+
labels?: Labels;
|
|
2735
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2736
|
+
created_at: string;
|
|
2737
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2738
|
+
updated_at: string;
|
|
2739
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2740
|
+
deleted_at?: string;
|
|
2741
|
+
/** The name and contact information for the supplier this billing profile represents */
|
|
2742
|
+
supplier: Party;
|
|
2743
|
+
/** The billing workflow settings for this profile */
|
|
2744
|
+
workflow: Workflow;
|
|
2745
|
+
/** The applications used by this billing profile. */
|
|
2746
|
+
apps: ProfileAppReferences;
|
|
2747
|
+
/** Whether this is the default profile. */
|
|
2748
|
+
default: boolean;
|
|
2749
|
+
}
|
|
2750
|
+
/** BillingProfile create request. */
|
|
2751
|
+
export interface CreateBillingProfileRequest {
|
|
2752
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2753
|
+
name: string;
|
|
2754
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2755
|
+
description?: string;
|
|
2756
|
+
labels?: Labels;
|
|
2757
|
+
/** The name and contact information for the supplier this billing profile represents */
|
|
2758
|
+
supplier: Party;
|
|
2759
|
+
/** The billing workflow settings for this profile */
|
|
2760
|
+
workflow: Workflow;
|
|
2761
|
+
/** The applications used by this billing profile. */
|
|
2762
|
+
apps: ProfileAppReferences;
|
|
2763
|
+
/** Whether this is the default profile. */
|
|
2764
|
+
default: boolean;
|
|
2765
|
+
}
|
|
2766
|
+
/** BillingProfile upsert request. */
|
|
2767
|
+
export interface UpsertBillingProfileRequest {
|
|
2768
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2769
|
+
name: string;
|
|
2770
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2771
|
+
description?: string;
|
|
2772
|
+
labels?: Labels;
|
|
2773
|
+
/** The name and contact information for the supplier this billing profile represents */
|
|
2774
|
+
supplier: Party;
|
|
2775
|
+
/** The billing workflow settings for this profile */
|
|
2776
|
+
workflow: Workflow;
|
|
2777
|
+
/** Whether this is the default profile. */
|
|
2778
|
+
default: boolean;
|
|
2779
|
+
}
|
|
2780
|
+
/** Page paginated response. */
|
|
2781
|
+
export interface ChargePagePaginatedResponse {
|
|
2782
|
+
data: (FlatFeeCharge | UsageBasedCharge)[];
|
|
2783
|
+
meta: PaginatedMeta;
|
|
2784
|
+
}
|
|
2785
|
+
/** Plans provide a template for subscriptions. */
|
|
2786
|
+
export interface Plan {
|
|
2787
|
+
id: string;
|
|
2788
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2789
|
+
name: string;
|
|
2790
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2791
|
+
description?: string;
|
|
2792
|
+
labels?: Labels;
|
|
2793
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2794
|
+
created_at: string;
|
|
2795
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2796
|
+
updated_at: string;
|
|
2797
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2798
|
+
deleted_at?: string;
|
|
2799
|
+
/** A key is a semi-unique string that is used to identify the plan. It is used to reference the latest `active` version of the plan and is unique with the version number. */
|
|
2800
|
+
key: string;
|
|
2801
|
+
/** Plans are versioned to allow you to make changes without affecting running subscriptions. */
|
|
2802
|
+
version: number;
|
|
2803
|
+
/** The currency code of the plan. */
|
|
2804
|
+
currency: string;
|
|
2805
|
+
/** The billing cadence for subscriptions using this plan. */
|
|
2806
|
+
billing_cadence: string;
|
|
2807
|
+
/** Whether pro-rating is enabled for this plan. */
|
|
2808
|
+
pro_rating_enabled: boolean;
|
|
2809
|
+
/** The date and time when the plan becomes `active`. When not specified, the plan is in `draft` status. */
|
|
2810
|
+
effective_from?: string;
|
|
2811
|
+
/** A scheduled date and time when the plan becomes `archived`. When not specified, the plan is in `active` status indefinitely. */
|
|
2812
|
+
effective_to?: string;
|
|
2813
|
+
/** The status of the plan. Computed based on the effective start and end dates: - `draft`: `effective_from` is not set. - `scheduled`: `now < effective_from`. - `active`: `effective_from <= now` and (`effective_to` is not set or `now < effective_to`). - `archived`: `effective_to <= now`. */
|
|
2814
|
+
status: 'draft' | 'active' | 'archived' | 'scheduled';
|
|
2815
|
+
/** The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required. */
|
|
2816
|
+
phases: PlanPhase[];
|
|
2817
|
+
/** List of validation errors in `draft` state that prevent the plan from being published. */
|
|
2818
|
+
validation_errors?: ProductCatalogValidationError[];
|
|
2819
|
+
}
|
|
2820
|
+
/** Plan create request. */
|
|
2821
|
+
export interface CreatePlanRequest {
|
|
2822
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2823
|
+
name: string;
|
|
2824
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2825
|
+
description?: string;
|
|
2826
|
+
labels?: Labels;
|
|
2827
|
+
/** A key is a semi-unique string that is used to identify the plan. It is used to reference the latest `active` version of the plan and is unique with the version number. */
|
|
2828
|
+
key: string;
|
|
2829
|
+
/** The currency code of the plan. */
|
|
2830
|
+
currency: string;
|
|
2831
|
+
/** The billing cadence for subscriptions using this plan. */
|
|
2832
|
+
billing_cadence: string;
|
|
2833
|
+
/** Whether pro-rating is enabled for this plan. */
|
|
2834
|
+
pro_rating_enabled: boolean;
|
|
2835
|
+
/** The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required. */
|
|
2836
|
+
phases: PlanPhase[];
|
|
2837
|
+
}
|
|
2838
|
+
/** Plan upsert request. */
|
|
2839
|
+
export interface UpsertPlanRequest {
|
|
2840
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2841
|
+
name: string;
|
|
2842
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2843
|
+
description?: string;
|
|
2844
|
+
labels?: Labels;
|
|
2845
|
+
/** Whether pro-rating is enabled for this plan. */
|
|
2846
|
+
pro_rating_enabled: boolean;
|
|
2847
|
+
/** The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required. */
|
|
2848
|
+
phases: PlanPhase[];
|
|
2849
|
+
}
|
|
2850
|
+
/** Page paginated response. */
|
|
2851
|
+
export interface AddonPagePaginatedResponse {
|
|
2852
|
+
data: Addon[];
|
|
2853
|
+
meta: PaginatedMeta;
|
|
2854
|
+
}
|
|
2855
|
+
/** Page paginated response. */
|
|
2856
|
+
export interface ProfilePagePaginatedResponse {
|
|
2857
|
+
data: Profile[];
|
|
2858
|
+
meta: PaginatedMeta;
|
|
2859
|
+
}
|
|
2860
|
+
/** Page paginated response. */
|
|
2861
|
+
export interface PlanPagePaginatedResponse {
|
|
2862
|
+
data: Plan[];
|
|
2863
|
+
meta: PaginatedMeta;
|
|
2864
|
+
}
|
|
2865
|
+
export interface SortQueryInput {
|
|
2866
|
+
/** The attribute to sort by. */
|
|
2867
|
+
by: string;
|
|
2868
|
+
/** The sort order. `asc` for ascending, `desc` for descending. */
|
|
2869
|
+
order?: 'asc' | 'desc';
|
|
2870
|
+
}
|
|
2871
|
+
export interface BaseErrorInput {
|
|
2872
|
+
/** Type contains a URI that identifies the problem type. */
|
|
2873
|
+
type?: string;
|
|
2874
|
+
/** The HTTP status code generated by the origin server for this occurrence of the problem. */
|
|
2875
|
+
status: number;
|
|
2876
|
+
/** A a short, human-readable summary of the problem type. */
|
|
2877
|
+
title: string;
|
|
2878
|
+
/** A human-readable explanation specific to this occurrence of the problem. */
|
|
2879
|
+
detail: string;
|
|
2880
|
+
/** A URI reference that identifies the specific occurrence of the problem. */
|
|
2881
|
+
instance: string;
|
|
2882
|
+
[key: string]: unknown;
|
|
2883
|
+
}
|
|
2884
|
+
export interface WorkflowInvoicingSettingsInput {
|
|
2885
|
+
/** Whether to automatically issue the invoice after the draftPeriod has passed. */
|
|
2886
|
+
auto_advance?: boolean;
|
|
2887
|
+
/** The period for the invoice to be kept in draft status for manual reviews. */
|
|
2888
|
+
draft_period?: string;
|
|
2889
|
+
/** Should progressive billing be allowed for this workflow? */
|
|
2890
|
+
progressive_billing?: boolean;
|
|
2891
|
+
}
|
|
2892
|
+
export interface WorkflowPaymentSendInvoiceSettingsInput {
|
|
2893
|
+
/** The collection method for the invoice. */
|
|
2894
|
+
collection_method: 'send_invoice';
|
|
2895
|
+
/** The period after which the invoice is due. With some payment solutions it's only applicable for manual collection method. */
|
|
2896
|
+
due_after?: string;
|
|
2897
|
+
}
|
|
2898
|
+
export interface EventInput {
|
|
2899
|
+
/** Identifies the event. */
|
|
2900
|
+
id: string;
|
|
2901
|
+
/** Identifies the context in which an event happened. */
|
|
2902
|
+
source: string;
|
|
2903
|
+
/** The version of the CloudEvents specification which the event uses. */
|
|
2904
|
+
specversion?: string;
|
|
2905
|
+
/** Contains a value describing the type of event related to the originating occurrence. */
|
|
2906
|
+
type: string;
|
|
2907
|
+
/** Content type of the CloudEvents data value. Only the value "application/json" is allowed over HTTP. */
|
|
2908
|
+
datacontenttype?: 'application/json' | null;
|
|
2909
|
+
/** Identifies the schema that data adheres to. */
|
|
2910
|
+
dataschema?: string | null;
|
|
2911
|
+
/** Describes the subject of the event in the context of the event producer (identified by source). */
|
|
2912
|
+
subject: string;
|
|
2913
|
+
/** Timestamp of when the occurrence happened. Must adhere to RFC 3339. */
|
|
2914
|
+
time?: string | null;
|
|
2915
|
+
/** The event payload. Optional, if present it must be a JSON object. */
|
|
2916
|
+
data?: Record<string, unknown> | null;
|
|
2917
|
+
}
|
|
2918
|
+
export interface UnauthorizedInput extends BaseErrorInput {
|
|
2919
|
+
}
|
|
2920
|
+
export interface ForbiddenInput extends BaseErrorInput {
|
|
2921
|
+
}
|
|
2922
|
+
export interface NotFoundInput extends BaseErrorInput {
|
|
2923
|
+
}
|
|
2924
|
+
export interface GoneInput extends BaseErrorInput {
|
|
2925
|
+
}
|
|
2926
|
+
export interface ConflictInput extends BaseErrorInput {
|
|
2927
|
+
}
|
|
2928
|
+
export interface PayloadTooLargeInput extends BaseErrorInput {
|
|
2929
|
+
}
|
|
2930
|
+
export interface UnsupportedMediaTypeInput extends BaseErrorInput {
|
|
2931
|
+
}
|
|
2932
|
+
export interface UnprocessableContentInput extends BaseErrorInput {
|
|
2933
|
+
}
|
|
2934
|
+
export interface TooManyRequestsInput extends BaseErrorInput {
|
|
2935
|
+
}
|
|
2936
|
+
export interface InternalInput extends BaseErrorInput {
|
|
2937
|
+
}
|
|
2938
|
+
export interface NotImplementedInput extends BaseErrorInput {
|
|
2939
|
+
}
|
|
2940
|
+
export interface NotAvailableInput extends BaseErrorInput {
|
|
2941
|
+
}
|
|
2942
|
+
export interface AppStripeCreateCheckoutSessionCustomerUpdateInput {
|
|
2943
|
+
/** Whether to save the billing address to customer.address. Defaults to "never". */
|
|
2944
|
+
address?: 'auto' | 'never';
|
|
2945
|
+
/** Whether to save the customer name to customer.name. Defaults to "never". */
|
|
2946
|
+
name?: 'auto' | 'never';
|
|
2947
|
+
/** Whether to save shipping information to customer.shipping. Defaults to "never". */
|
|
2948
|
+
shipping?: 'auto' | 'never';
|
|
2949
|
+
}
|
|
2950
|
+
export interface AppStripeCreateCheckoutSessionTaxIdCollectionInput {
|
|
2951
|
+
/** Enable tax ID collection during checkout. Defaults to false. */
|
|
2952
|
+
enabled?: boolean;
|
|
2953
|
+
/** Whether tax ID collection is required. Defaults to "never". */
|
|
2954
|
+
required?: 'if_supported' | 'never';
|
|
2955
|
+
}
|
|
2956
|
+
export interface CreateCreditGrantPurchaseInput {
|
|
2957
|
+
/** Currency of the purchase amount. */
|
|
2958
|
+
currency: string;
|
|
2959
|
+
/** Cost basis per credit unit used to calculate the purchase amount. If `per_unit_cost_basis` is 0.50 and credit amount is $100.00, the total charge is $50.00. The value must be greater than 0. If the cost basis is 0, use `funding_method=none` instead. Defaults to 1.0. */
|
|
2960
|
+
per_unit_cost_basis?: string;
|
|
2961
|
+
/** Controls when credits become available for consumption. Defaults to `on_creation`. */
|
|
2962
|
+
availability_policy?: 'on_creation';
|
|
2963
|
+
}
|
|
2964
|
+
export interface CreditGrantPurchaseInput {
|
|
2965
|
+
/** Currency of the purchase amount. */
|
|
2966
|
+
currency: string;
|
|
2967
|
+
/** Cost basis per credit unit used to calculate the purchase amount. If `per_unit_cost_basis` is 0.50 and credit amount is $100.00, the total charge is $50.00. The value must be greater than 0. If the cost basis is 0, use `funding_method=none` instead. Defaults to 1.0. */
|
|
2968
|
+
per_unit_cost_basis?: string;
|
|
2969
|
+
/** The purchase amount. Calculated from `per_unit_cost_basis` and credit `amount`. */
|
|
2970
|
+
amount: string;
|
|
2971
|
+
/** Controls when credits become available for consumption. Defaults to `on_creation`. */
|
|
2972
|
+
availability_policy?: 'on_creation';
|
|
2973
|
+
/** Current payment settlement status. */
|
|
2974
|
+
settlement_status?: 'pending' | 'authorized' | 'settled';
|
|
2975
|
+
}
|
|
2976
|
+
export interface GovernanceQueryRequestInput {
|
|
2977
|
+
/** Whether to include credit balance availability for each resolved customer. When true, each feature evaluation includes credit balance checks. Defaults to `false`. */
|
|
2978
|
+
include_credits?: boolean;
|
|
2979
|
+
customer: GovernanceQueryRequestCustomers;
|
|
2980
|
+
feature?: GovernanceQueryRequestFeatures;
|
|
2981
|
+
}
|
|
2982
|
+
export interface UnitConfigInput {
|
|
2983
|
+
/** The arithmetic operation to apply to the raw metered quantity. */
|
|
2984
|
+
operation: 'divide' | 'multiply';
|
|
2985
|
+
/** The factor used in the conversion operation. - For `divide`: `converted = raw / conversionFactor`. - For `multiply`: `converted = raw × conversionFactor`. Must be a positive non-zero value. */
|
|
2986
|
+
conversion_factor: string;
|
|
2987
|
+
/** The rounding mode applied to the converted quantity for invoicing. Defaults to none (no rounding). Entitlement checks always use the precise (unrounded) value. */
|
|
2988
|
+
rounding?: 'ceiling' | 'floor' | 'half_up' | 'none';
|
|
2989
|
+
/** The number of decimal places to retain after rounding. Only meaningful when rounding is not "none". Defaults to 0 (round to whole numbers). */
|
|
2990
|
+
precision?: number;
|
|
2991
|
+
/** A human-readable label for the converted unit shown on invoices and in the customer portal (e.g., "GB", "hours", "M tokens"). Optional. When omitted, no unit label is rendered. */
|
|
2992
|
+
display_unit?: string;
|
|
2993
|
+
}
|
|
2994
|
+
export interface IngestedEventInput {
|
|
2995
|
+
/** The original event ingested. */
|
|
2996
|
+
event: EventInput;
|
|
2997
|
+
/** The customer if the event is associated with a customer. */
|
|
2998
|
+
customer?: CustomerReference;
|
|
2999
|
+
/** The date and time the event was ingested and its processing started. */
|
|
3000
|
+
ingested_at: string;
|
|
3001
|
+
/** The date and time the event was stored in the database. */
|
|
3002
|
+
stored_at: string;
|
|
3003
|
+
/** The validation errors of the ingested event. */
|
|
3004
|
+
validation_errors?: IngestedEventValidationError[];
|
|
3005
|
+
}
|
|
3006
|
+
export interface SubscriptionCancelInput {
|
|
3007
|
+
/** If not provided the subscription is canceled immediately. */
|
|
3008
|
+
timing?: 'immediate' | 'next_billing_cycle' | string;
|
|
3009
|
+
}
|
|
3010
|
+
export interface InvoiceUsageQuantityDetailInput {
|
|
3011
|
+
/** The raw quantity as reported by the meter (native units). */
|
|
3012
|
+
raw_quantity: string;
|
|
3013
|
+
/** The precise decimal value after applying the conversion operation and factor, before rounding. */
|
|
3014
|
+
converted_quantity: string;
|
|
3015
|
+
/** The quantity after rounding, used for pricing. */
|
|
3016
|
+
invoiced_quantity: string;
|
|
3017
|
+
/** The display unit label (e.g., "GB", "hours", "M tokens"). */
|
|
3018
|
+
display_unit?: string;
|
|
3019
|
+
/** Snapshot of the UnitConfig that was in effect at billing time. Ensures historical invoices reflect the config that was actually applied. */
|
|
3020
|
+
applied_unit_config: UnitConfigInput;
|
|
3021
|
+
}
|
|
3022
|
+
export interface CreateCreditGrantRequestInput {
|
|
3023
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3024
|
+
name: string;
|
|
3025
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3026
|
+
description?: string;
|
|
3027
|
+
labels?: CreateLabels;
|
|
3028
|
+
/** Funding method of the grant. */
|
|
3029
|
+
funding_method: 'none' | 'invoice' | 'external';
|
|
3030
|
+
/** The currency of the granted credits. */
|
|
3031
|
+
currency: string;
|
|
3032
|
+
/** Granted credit amount. */
|
|
3033
|
+
amount: string;
|
|
3034
|
+
/** Present when a funding workflow applies (funding_method is not `none`). */
|
|
3035
|
+
purchase?: CreateCreditGrantPurchaseInput;
|
|
3036
|
+
/** Tax configuration for the grant. For `invoice` and `external` funding methods, tax configuration should be provided to ensure correct revenue recognition. When not provided, the default credit grant tax code is applied, if that's not set the global default taxcode is used. */
|
|
3037
|
+
tax_config?: CreateCreditGrantTaxConfig;
|
|
3038
|
+
filters?: CreateCreditGrantFilters;
|
|
3039
|
+
/** Draw-down priority of the grant. Lower values have higher priority. */
|
|
3040
|
+
priority?: number;
|
|
3041
|
+
/** The duration after which the credit grant expires. Defaults to never expiring. */
|
|
3042
|
+
expires_after?: string;
|
|
3043
|
+
}
|
|
3044
|
+
export interface CreditGrantInput {
|
|
3045
|
+
id: string;
|
|
3046
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3047
|
+
name: string;
|
|
3048
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3049
|
+
description?: string;
|
|
3050
|
+
labels?: Labels;
|
|
3051
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3052
|
+
created_at: string;
|
|
3053
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3054
|
+
updated_at: string;
|
|
3055
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3056
|
+
deleted_at?: string;
|
|
3057
|
+
/** Funding method of the grant. */
|
|
3058
|
+
funding_method: 'none' | 'invoice' | 'external';
|
|
3059
|
+
/** The currency of the granted credits. */
|
|
3060
|
+
currency: string;
|
|
3061
|
+
/** Granted credit amount. */
|
|
3062
|
+
amount: string;
|
|
3063
|
+
/** Present when a funding workflow applies (funding_method is not `none`). */
|
|
3064
|
+
purchase?: CreditGrantPurchaseInput;
|
|
3065
|
+
/** Tax configuration for the grant. For `invoice` and `external` funding methods, tax configuration should be provided to ensure correct revenue recognition. When not provided, the default credit grant tax code is applied, if that's not set the global default taxcode is used. */
|
|
3066
|
+
tax_config?: CreditGrantTaxConfig;
|
|
3067
|
+
/** Available when `funding_method` is `invoice`. */
|
|
3068
|
+
invoice?: CreditGrantInvoiceReference;
|
|
3069
|
+
filters?: CreditGrantFilters;
|
|
3070
|
+
/** Draw-down priority of the grant. Lower values have higher priority. */
|
|
3071
|
+
priority?: number;
|
|
3072
|
+
/** The duration after which the credit grant expires. Defaults to never expiring. */
|
|
3073
|
+
expires_after?: string;
|
|
3074
|
+
/** The timestamp when the credit grant expires. Calculated from the grant effective time and `expires_after` if provided. */
|
|
3075
|
+
expires_at?: string;
|
|
3076
|
+
/** Timestamp when the grant was voided. */
|
|
3077
|
+
voided_at?: string;
|
|
3078
|
+
/** Current lifecycle status of the grant. */
|
|
3079
|
+
status: 'pending' | 'active' | 'expired' | 'voided';
|
|
3080
|
+
}
|
|
3081
|
+
export interface WorkflowTaxSettingsInput {
|
|
3082
|
+
/** Enable automatic tax calculation when tax is supported by the app. For example, with Stripe Invoicing when enabled, tax is calculated via Stripe Tax. */
|
|
3083
|
+
enabled?: boolean;
|
|
3084
|
+
/** Enforce tax calculation when tax is supported by the app. When enabled, the billing system will not allow to create an invoice without tax calculation. Enforcement is different per apps, for example, Stripe app requires customer to have a tax location when starting a paid subscription. */
|
|
3085
|
+
enforced?: boolean;
|
|
3086
|
+
/** Default tax configuration to apply to the invoices for line items. */
|
|
3087
|
+
default_tax_config?: TaxConfig;
|
|
3088
|
+
}
|
|
3089
|
+
export interface IngestedEventPaginatedResponseInput {
|
|
3090
|
+
data: IngestedEventInput[];
|
|
3091
|
+
meta: CursorMeta;
|
|
3092
|
+
}
|
|
3093
|
+
export interface MeterQueryRequestInput {
|
|
3094
|
+
/** The start of the period the usage is queried from. */
|
|
3095
|
+
from?: string;
|
|
3096
|
+
/** The end of the period the usage is queried to. */
|
|
3097
|
+
to?: string;
|
|
3098
|
+
/** The size of the time buckets to group the usage into. If not specified, the usage is aggregated over the entire period. */
|
|
3099
|
+
granularity?: 'PT1M' | 'PT1H' | 'P1D' | 'P1M';
|
|
3100
|
+
/** The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). The time zone is used to determine the start and end of the time buckets. If not specified, the UTC timezone will be used. */
|
|
3101
|
+
time_zone?: string;
|
|
3102
|
+
/** The dimensions to group the results by. */
|
|
3103
|
+
group_by_dimensions?: string[];
|
|
3104
|
+
/** Filters to apply to the query. */
|
|
3105
|
+
filters?: MeterQueryFilters;
|
|
3106
|
+
}
|
|
3107
|
+
export interface AppStripeCreateCheckoutSessionRequestOptionsInput {
|
|
3108
|
+
/** Whether to collect the customer's billing address. Defaults to auto, which only collects the address when necessary for tax calculation. */
|
|
3109
|
+
billing_address_collection?: 'auto' | 'required';
|
|
3110
|
+
/** URL to redirect customers who cancel the checkout session. Not allowed when ui_mode is "embedded". */
|
|
3111
|
+
cancel_url?: string;
|
|
3112
|
+
/** Unique reference string for reconciling sessions with internal systems. Can be a customer ID, cart ID, or any other identifier. */
|
|
3113
|
+
client_reference_id?: string;
|
|
3114
|
+
/** Controls which customer fields can be updated by the checkout session. */
|
|
3115
|
+
customer_update?: AppStripeCreateCheckoutSessionCustomerUpdateInput;
|
|
3116
|
+
/** Configuration for collecting customer consent during checkout. */
|
|
3117
|
+
consent_collection?: AppStripeCreateCheckoutSessionConsentCollection;
|
|
3118
|
+
/** Three-letter ISO 4217 currency code in uppercase. Required for payment mode sessions. Optional for setup mode sessions. */
|
|
3119
|
+
currency?: string;
|
|
3120
|
+
/** Custom text to display during checkout at various stages. */
|
|
3121
|
+
custom_text?: AppStripeCheckoutSessionCustomTextParams;
|
|
3122
|
+
/** Unix timestamp when the checkout session expires. Can be 30 minutes to 24 hours from creation. Defaults to 24 hours. */
|
|
3123
|
+
expires_at?: bigint;
|
|
3124
|
+
/** IETF language tag for the checkout UI locale. If blank or "auto", uses the browser's locale. Example: "en", "fr", "de". */
|
|
3125
|
+
locale?: string;
|
|
3126
|
+
/** Set of key-value pairs to attach to the checkout session. Useful for storing additional structured information. */
|
|
3127
|
+
metadata?: Record<string, string>;
|
|
3128
|
+
/** Return URL for embedded checkout sessions after payment authentication. Required if ui_mode is "embedded" and redirect-based payment methods are enabled. */
|
|
3129
|
+
return_url?: string;
|
|
3130
|
+
/** Success URL to redirect customers after completing payment or setup. Not allowed when ui_mode is "embedded". See: https://docs.stripe.com/payments/checkout/custom-success-page */
|
|
3131
|
+
success_url?: string;
|
|
3132
|
+
/** The UI mode for the checkout session. "hosted" displays a Stripe-hosted page. "embedded" integrates directly into your app. Defaults to "hosted". */
|
|
3133
|
+
ui_mode?: 'embedded' | 'hosted';
|
|
3134
|
+
/** List of payment method types to enable (e.g., "card", "us_bank_account"). If not specified, Stripe enables all relevant payment methods. */
|
|
3135
|
+
payment_method_types?: string[];
|
|
3136
|
+
/** Redirect behavior for embedded checkout sessions. Controls when to redirect users after completion. See: https://docs.stripe.com/payments/checkout/custom-success-page?payment-ui=embedded-form */
|
|
3137
|
+
redirect_on_completion?: 'always' | 'if_required' | 'never';
|
|
3138
|
+
/** Configuration for collecting tax IDs during checkout. */
|
|
3139
|
+
tax_id_collection?: AppStripeCreateCheckoutSessionTaxIdCollectionInput;
|
|
3140
|
+
}
|
|
3141
|
+
export interface CreditGrantPagePaginatedResponseInput {
|
|
3142
|
+
data: CreditGrantInput[];
|
|
3143
|
+
meta: PaginatedMeta;
|
|
3144
|
+
}
|
|
3145
|
+
export interface BadRequestInput extends BaseErrorInput {
|
|
3146
|
+
/** The list of parameters that failed validation. */
|
|
3147
|
+
invalid_parameters: (InvalidParameterStandard | InvalidParameterMinimumLength | InvalidParameterMaximumLength | InvalidParameterChoiceItem | InvalidParameterDependentItem)[];
|
|
3148
|
+
}
|
|
3149
|
+
export interface CustomerStripeCreateCheckoutSessionRequestInput {
|
|
3150
|
+
/** Options for configuring the Stripe Checkout Session. These options are passed directly to Stripe's [checkout session creation API](https://docs.stripe.com/api/checkout/sessions/create). */
|
|
3151
|
+
stripe_options: AppStripeCreateCheckoutSessionRequestOptionsInput;
|
|
3152
|
+
}
|
|
3153
|
+
export interface WorkflowCollectionSettingsInput {
|
|
3154
|
+
/** The alignment for collecting the pending line items into an invoice. */
|
|
3155
|
+
alignment?: WorkflowCollectionAlignmentSubscription | WorkflowCollectionAlignmentAnchored;
|
|
3156
|
+
/** This grace period can be used to delay the collection of the pending line items specified in alignment. This is useful, in case of multiple subscriptions having slightly different billing periods. */
|
|
3157
|
+
interval?: string;
|
|
3158
|
+
}
|
|
3159
|
+
export interface RateCardInput {
|
|
3160
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3161
|
+
name: string;
|
|
3162
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3163
|
+
description?: string;
|
|
3164
|
+
labels?: Labels;
|
|
3165
|
+
key: string;
|
|
3166
|
+
/** The feature associated with the rate card. */
|
|
3167
|
+
feature?: FeatureReference;
|
|
3168
|
+
/** The billing cadence of the rate card. When null, the charge is one-time (non-recurring). Only valid for flat prices. */
|
|
3169
|
+
billing_cadence?: string;
|
|
3170
|
+
/** The price of the rate card. */
|
|
3171
|
+
price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
3172
|
+
/** The payment term of the rate card. In advance payment term can only be used for flat prices. */
|
|
3173
|
+
payment_term?: 'in_advance' | 'in_arrears';
|
|
3174
|
+
/** Spend commitments for this rate card. Only applicable to usage-based prices (unit, graduated, volume). */
|
|
3175
|
+
commitments?: SpendCommitments;
|
|
3176
|
+
/** The discounts of the rate card. */
|
|
3177
|
+
discounts?: RateCardDiscounts;
|
|
3178
|
+
/** The tax config of the rate card. */
|
|
3179
|
+
tax_config?: RateCardTaxConfig;
|
|
3180
|
+
}
|
|
3181
|
+
export interface WorkflowInput {
|
|
3182
|
+
/** The collection settings for this workflow */
|
|
3183
|
+
collection?: WorkflowCollectionSettingsInput;
|
|
3184
|
+
/** The invoicing settings for this workflow */
|
|
3185
|
+
invoicing?: WorkflowInvoicingSettingsInput;
|
|
3186
|
+
/** The payment settings for this workflow */
|
|
3187
|
+
payment?: WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettingsInput;
|
|
3188
|
+
/** The tax settings for this workflow */
|
|
3189
|
+
tax?: WorkflowTaxSettingsInput;
|
|
3190
|
+
}
|
|
3191
|
+
export interface PlanPhaseInput {
|
|
3192
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3193
|
+
name: string;
|
|
3194
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3195
|
+
description?: string;
|
|
3196
|
+
labels?: Labels;
|
|
3197
|
+
key: string;
|
|
3198
|
+
/** The duration of the phase. When not specified, the phase runs indefinitely. Only the last phase may omit the duration. */
|
|
3199
|
+
duration?: string;
|
|
3200
|
+
/** The rate cards of the plan. */
|
|
3201
|
+
rate_cards: RateCardInput[];
|
|
3202
|
+
}
|
|
3203
|
+
export interface AddonInput {
|
|
3204
|
+
id: string;
|
|
3205
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3206
|
+
name: string;
|
|
3207
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3208
|
+
description?: string;
|
|
3209
|
+
labels?: Labels;
|
|
3210
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3211
|
+
created_at: string;
|
|
3212
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3213
|
+
updated_at: string;
|
|
3214
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3215
|
+
deleted_at?: string;
|
|
3216
|
+
/** A key is a semi-unique string that is used to identify the add-on. It is used to reference the latest `active` version of the add-on and is unique with the version number. */
|
|
3217
|
+
key: string;
|
|
3218
|
+
/** Version of the add-on. Incremented when the add-on is updated. */
|
|
3219
|
+
version?: number;
|
|
3220
|
+
/** The InstanceType of the add-ons. Can be "single" or "multiple". */
|
|
3221
|
+
instance_type: 'single' | 'multiple';
|
|
3222
|
+
/** The currency code of the add-on. */
|
|
3223
|
+
currency: string;
|
|
3224
|
+
/** The date and time when the add-on becomes effective. When not specified, the add-on is a draft. */
|
|
3225
|
+
effective_from?: string;
|
|
3226
|
+
/** The date and time when the add-on is no longer effective. When not specified, the add-on is effective indefinitely. */
|
|
3227
|
+
effective_to?: string;
|
|
3228
|
+
/** The status of the add-on. Computed based on the effective start and end dates: - `draft`: `effective_from` is not set. - `active`: `effective_from <= now` and (`effective_to` is not set or `now < effective_to`). - `archived`: `effective_to <= now`. */
|
|
3229
|
+
status: 'draft' | 'active' | 'archived';
|
|
3230
|
+
/** The rate cards of the add-on. */
|
|
3231
|
+
rate_cards: RateCardInput[];
|
|
3232
|
+
/** List of validation errors. */
|
|
3233
|
+
validation_errors?: ProductCatalogValidationError[];
|
|
3234
|
+
}
|
|
3235
|
+
export interface CreateAddonRequestInput {
|
|
3236
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3237
|
+
name: string;
|
|
3238
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3239
|
+
description?: string;
|
|
3240
|
+
labels?: Labels;
|
|
3241
|
+
/** A key is a semi-unique string that is used to identify the add-on. It is used to reference the latest `active` version of the add-on and is unique with the version number. */
|
|
3242
|
+
key: string;
|
|
3243
|
+
/** The InstanceType of the add-ons. Can be "single" or "multiple". */
|
|
3244
|
+
instance_type: 'single' | 'multiple';
|
|
3245
|
+
/** The currency code of the add-on. */
|
|
3246
|
+
currency: string;
|
|
3247
|
+
/** The rate cards of the add-on. */
|
|
3248
|
+
rate_cards: RateCardInput[];
|
|
3249
|
+
}
|
|
3250
|
+
export interface UpsertAddonRequestInput {
|
|
3251
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3252
|
+
name: string;
|
|
3253
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3254
|
+
description?: string;
|
|
3255
|
+
labels?: Labels;
|
|
3256
|
+
/** The InstanceType of the add-ons. Can be "single" or "multiple". */
|
|
3257
|
+
instance_type: 'single' | 'multiple';
|
|
3258
|
+
/** The rate cards of the add-on. */
|
|
3259
|
+
rate_cards: RateCardInput[];
|
|
3260
|
+
}
|
|
3261
|
+
export interface ProfileInput {
|
|
3262
|
+
id: string;
|
|
3263
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3264
|
+
name: string;
|
|
3265
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3266
|
+
description?: string;
|
|
3267
|
+
labels?: Labels;
|
|
3268
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3269
|
+
created_at: string;
|
|
3270
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3271
|
+
updated_at: string;
|
|
3272
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3273
|
+
deleted_at?: string;
|
|
3274
|
+
/** The name and contact information for the supplier this billing profile represents */
|
|
3275
|
+
supplier: Party;
|
|
3276
|
+
/** The billing workflow settings for this profile */
|
|
3277
|
+
workflow: WorkflowInput;
|
|
3278
|
+
/** The applications used by this billing profile. */
|
|
3279
|
+
apps: ProfileAppReferences;
|
|
3280
|
+
/** Whether this is the default profile. */
|
|
3281
|
+
default: boolean;
|
|
3282
|
+
}
|
|
3283
|
+
export interface CreateBillingProfileRequestInput {
|
|
3284
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3285
|
+
name: string;
|
|
3286
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3287
|
+
description?: string;
|
|
3288
|
+
labels?: Labels;
|
|
3289
|
+
/** The name and contact information for the supplier this billing profile represents */
|
|
3290
|
+
supplier: Party;
|
|
3291
|
+
/** The billing workflow settings for this profile */
|
|
3292
|
+
workflow: WorkflowInput;
|
|
3293
|
+
/** The applications used by this billing profile. */
|
|
3294
|
+
apps: ProfileAppReferences;
|
|
3295
|
+
/** Whether this is the default profile. */
|
|
3296
|
+
default: boolean;
|
|
3297
|
+
}
|
|
3298
|
+
export interface UpsertBillingProfileRequestInput {
|
|
3299
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3300
|
+
name: string;
|
|
3301
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3302
|
+
description?: string;
|
|
3303
|
+
labels?: Labels;
|
|
3304
|
+
/** The name and contact information for the supplier this billing profile represents */
|
|
3305
|
+
supplier: Party;
|
|
3306
|
+
/** The billing workflow settings for this profile */
|
|
3307
|
+
workflow: WorkflowInput;
|
|
3308
|
+
/** Whether this is the default profile. */
|
|
3309
|
+
default: boolean;
|
|
3310
|
+
}
|
|
3311
|
+
export interface PlanInput {
|
|
3312
|
+
id: string;
|
|
3313
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3314
|
+
name: string;
|
|
3315
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3316
|
+
description?: string;
|
|
3317
|
+
labels?: Labels;
|
|
3318
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3319
|
+
created_at: string;
|
|
3320
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3321
|
+
updated_at: string;
|
|
3322
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3323
|
+
deleted_at?: string;
|
|
3324
|
+
/** A key is a semi-unique string that is used to identify the plan. It is used to reference the latest `active` version of the plan and is unique with the version number. */
|
|
3325
|
+
key: string;
|
|
3326
|
+
/** Plans are versioned to allow you to make changes without affecting running subscriptions. */
|
|
3327
|
+
version?: number;
|
|
3328
|
+
/** The currency code of the plan. */
|
|
3329
|
+
currency: string;
|
|
3330
|
+
/** The billing cadence for subscriptions using this plan. */
|
|
3331
|
+
billing_cadence: string;
|
|
3332
|
+
/** Whether pro-rating is enabled for this plan. */
|
|
3333
|
+
pro_rating_enabled?: boolean;
|
|
3334
|
+
/** The date and time when the plan becomes `active`. When not specified, the plan is in `draft` status. */
|
|
3335
|
+
effective_from?: string;
|
|
3336
|
+
/** A scheduled date and time when the plan becomes `archived`. When not specified, the plan is in `active` status indefinitely. */
|
|
3337
|
+
effective_to?: string;
|
|
3338
|
+
/** The status of the plan. Computed based on the effective start and end dates: - `draft`: `effective_from` is not set. - `scheduled`: `now < effective_from`. - `active`: `effective_from <= now` and (`effective_to` is not set or `now < effective_to`). - `archived`: `effective_to <= now`. */
|
|
3339
|
+
status: 'draft' | 'active' | 'archived' | 'scheduled';
|
|
3340
|
+
/** The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required. */
|
|
3341
|
+
phases: PlanPhaseInput[];
|
|
3342
|
+
/** List of validation errors in `draft` state that prevent the plan from being published. */
|
|
3343
|
+
validation_errors?: ProductCatalogValidationError[];
|
|
3344
|
+
}
|
|
3345
|
+
export interface CreatePlanRequestInput {
|
|
3346
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3347
|
+
name: string;
|
|
3348
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3349
|
+
description?: string;
|
|
3350
|
+
labels?: Labels;
|
|
3351
|
+
/** A key is a semi-unique string that is used to identify the plan. It is used to reference the latest `active` version of the plan and is unique with the version number. */
|
|
3352
|
+
key: string;
|
|
3353
|
+
/** The currency code of the plan. */
|
|
3354
|
+
currency: string;
|
|
3355
|
+
/** The billing cadence for subscriptions using this plan. */
|
|
3356
|
+
billing_cadence: string;
|
|
3357
|
+
/** Whether pro-rating is enabled for this plan. */
|
|
3358
|
+
pro_rating_enabled?: boolean;
|
|
3359
|
+
/** The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required. */
|
|
3360
|
+
phases: PlanPhaseInput[];
|
|
3361
|
+
}
|
|
3362
|
+
export interface UpsertPlanRequestInput {
|
|
3363
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
3364
|
+
name: string;
|
|
3365
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
3366
|
+
description?: string;
|
|
3367
|
+
labels?: Labels;
|
|
3368
|
+
/** Whether pro-rating is enabled for this plan. */
|
|
3369
|
+
pro_rating_enabled?: boolean;
|
|
3370
|
+
/** The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required. */
|
|
3371
|
+
phases: PlanPhaseInput[];
|
|
3372
|
+
}
|
|
3373
|
+
export interface AddonPagePaginatedResponseInput {
|
|
3374
|
+
data: AddonInput[];
|
|
3375
|
+
meta: PaginatedMeta;
|
|
3376
|
+
}
|
|
3377
|
+
export interface ProfilePagePaginatedResponseInput {
|
|
3378
|
+
data: ProfileInput[];
|
|
3379
|
+
meta: PaginatedMeta;
|
|
3380
|
+
}
|
|
3381
|
+
export interface PlanPagePaginatedResponseInput {
|
|
3382
|
+
data: PlanInput[];
|
|
3383
|
+
meta: PaginatedMeta;
|
|
3384
|
+
}
|
|
3385
|
+
//# sourceMappingURL=types.d.ts.map
|