lago-javascript-client 0.45.0-beta → 0.48.0-beta
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/{types → esm}/openapi/client.d.ts +156 -710
- package/esm/openapi/client.js +1 -555
- package/package.json +6 -13
- package/script/mod.d.ts +5 -0
- package/script/openapi/client.d.ts +4465 -0
- package/script/openapi/client.js +2 -556
- /package/{types → esm}/mod.d.ts +0 -0
|
@@ -0,0 +1,4465 @@
|
|
|
1
|
+
export interface AddOnBaseInput {
|
|
2
|
+
/**
|
|
3
|
+
* The name of the add-on.
|
|
4
|
+
* @example "Setup Fee"
|
|
5
|
+
*/
|
|
6
|
+
name?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Unique code used to identify the add-on.
|
|
9
|
+
* @example "setup_fee"
|
|
10
|
+
*/
|
|
11
|
+
code?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The cost of the add-on in cents, excluding any applicable taxes, that is billed to a customer. By creating a one-off invoice, you will be able to override this value.
|
|
14
|
+
* @example 50000
|
|
15
|
+
*/
|
|
16
|
+
amount_cents?: number;
|
|
17
|
+
/** The currency of the add-on. */
|
|
18
|
+
amount_currency?: Currency;
|
|
19
|
+
/**
|
|
20
|
+
* The description of the add-on.
|
|
21
|
+
* @example "Implementation fee for new customers."
|
|
22
|
+
*/
|
|
23
|
+
description?: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* List of unique code used to identify the taxes.
|
|
26
|
+
* @example ["french_standard_vat"]
|
|
27
|
+
*/
|
|
28
|
+
tax_codes?: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface AddOnCreateInput {
|
|
31
|
+
add_on: AddOnBaseInput;
|
|
32
|
+
}
|
|
33
|
+
export interface AddOnObject {
|
|
34
|
+
/**
|
|
35
|
+
* Unique identifier of the add-on, created by Lago.
|
|
36
|
+
* @format uuid
|
|
37
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
38
|
+
*/
|
|
39
|
+
lago_id: string;
|
|
40
|
+
/**
|
|
41
|
+
* The name of the add-on.
|
|
42
|
+
* @example "Setup Fee"
|
|
43
|
+
*/
|
|
44
|
+
name: string;
|
|
45
|
+
/**
|
|
46
|
+
* Unique code used to identify the add-on.
|
|
47
|
+
* @example "setup_fee"
|
|
48
|
+
*/
|
|
49
|
+
code: string;
|
|
50
|
+
/**
|
|
51
|
+
* The cost of the add-on in cents, excluding any applicable taxes, that is billed to a customer. By creating a one-off invoice, you will be able to override this value.
|
|
52
|
+
* @example 50000
|
|
53
|
+
*/
|
|
54
|
+
amount_cents: number;
|
|
55
|
+
/** The currency of the add-on. */
|
|
56
|
+
amount_currency: Currency;
|
|
57
|
+
/**
|
|
58
|
+
* The description of the add-on.
|
|
59
|
+
* @example "Implementation fee for new customers."
|
|
60
|
+
*/
|
|
61
|
+
description?: string | null;
|
|
62
|
+
/**
|
|
63
|
+
* The date and time when the add-on was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the add-on was initially created.
|
|
64
|
+
* @format date-time
|
|
65
|
+
* @example "2022-04-29T08:59:51Z"
|
|
66
|
+
*/
|
|
67
|
+
created_at: string;
|
|
68
|
+
/** All taxes applied to the add-on. */
|
|
69
|
+
taxes?: TaxObject[];
|
|
70
|
+
}
|
|
71
|
+
export interface AddOn {
|
|
72
|
+
add_on: AddOnObject;
|
|
73
|
+
}
|
|
74
|
+
export interface AddOnsPaginated {
|
|
75
|
+
add_ons: AddOnObject[];
|
|
76
|
+
meta: PaginationMeta;
|
|
77
|
+
}
|
|
78
|
+
export interface AddOnUpdateInput {
|
|
79
|
+
add_on: AddOnBaseInput;
|
|
80
|
+
}
|
|
81
|
+
export interface ApiErrorBadRequest {
|
|
82
|
+
/**
|
|
83
|
+
* @format int32
|
|
84
|
+
* @example 400
|
|
85
|
+
*/
|
|
86
|
+
status: number;
|
|
87
|
+
/** @example "Bad request" */
|
|
88
|
+
error: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ApiErrorForbidden {
|
|
91
|
+
/**
|
|
92
|
+
* @format int32
|
|
93
|
+
* @example 403
|
|
94
|
+
*/
|
|
95
|
+
status: number;
|
|
96
|
+
/** @example "Forbidden" */
|
|
97
|
+
error: string;
|
|
98
|
+
/** @example "feature_unavailable" */
|
|
99
|
+
code: string;
|
|
100
|
+
}
|
|
101
|
+
export interface ApiErrorUnauthorized {
|
|
102
|
+
/**
|
|
103
|
+
* @format int32
|
|
104
|
+
* @example 401
|
|
105
|
+
*/
|
|
106
|
+
status: number;
|
|
107
|
+
/** @example "Unauthorized" */
|
|
108
|
+
error: string;
|
|
109
|
+
}
|
|
110
|
+
export interface ApiErrorUnprocessableEntity {
|
|
111
|
+
/**
|
|
112
|
+
* @format int32
|
|
113
|
+
* @example 422
|
|
114
|
+
*/
|
|
115
|
+
status: number;
|
|
116
|
+
/** @example "Unprocessable entity" */
|
|
117
|
+
error: string;
|
|
118
|
+
/** @example "validation_errors" */
|
|
119
|
+
code: string;
|
|
120
|
+
error_details: object;
|
|
121
|
+
}
|
|
122
|
+
export interface ApiErrorNotAllowed {
|
|
123
|
+
/**
|
|
124
|
+
* @format int32
|
|
125
|
+
* @example 405
|
|
126
|
+
*/
|
|
127
|
+
status: number;
|
|
128
|
+
/** @example "Method Not Allowed" */
|
|
129
|
+
error: string;
|
|
130
|
+
/** @example "not_allowed" */
|
|
131
|
+
code: string;
|
|
132
|
+
}
|
|
133
|
+
export interface ApiErrorNotFound {
|
|
134
|
+
/**
|
|
135
|
+
* @format int32
|
|
136
|
+
* @example 404
|
|
137
|
+
*/
|
|
138
|
+
status: number;
|
|
139
|
+
/** @example "Not Found" */
|
|
140
|
+
error: string;
|
|
141
|
+
/** @example "object_not_found" */
|
|
142
|
+
code: string;
|
|
143
|
+
}
|
|
144
|
+
export interface AppliedCoupon {
|
|
145
|
+
applied_coupon: AppliedCouponObject;
|
|
146
|
+
}
|
|
147
|
+
export interface AppliedCouponInput {
|
|
148
|
+
applied_coupon: {
|
|
149
|
+
/**
|
|
150
|
+
* The customer external unique identifier (provided by your own application)
|
|
151
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
152
|
+
*/
|
|
153
|
+
external_customer_id: string;
|
|
154
|
+
/**
|
|
155
|
+
* Unique code used to identify the coupon.
|
|
156
|
+
* @example "startup_deal"
|
|
157
|
+
*/
|
|
158
|
+
coupon_code: string;
|
|
159
|
+
/**
|
|
160
|
+
* The type of frequency for the coupon. It can have three possible values: `once`, `recurring` or `forever`.
|
|
161
|
+
*
|
|
162
|
+
* - If set to `once`, the coupon is applicable only for a single use.
|
|
163
|
+
* - If set to `recurring`, the coupon can be used multiple times for recurring billing periods.
|
|
164
|
+
* - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
|
|
165
|
+
* @example "recurring"
|
|
166
|
+
*/
|
|
167
|
+
frequency?: "once" | "recurring" | null;
|
|
168
|
+
/**
|
|
169
|
+
* Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
|
|
170
|
+
* @example 3
|
|
171
|
+
*/
|
|
172
|
+
frequency_duration?: number | null;
|
|
173
|
+
/**
|
|
174
|
+
* The amount of the coupon in cents. This field is required only for coupon with `fixed_amount` type.
|
|
175
|
+
* @example 2000
|
|
176
|
+
*/
|
|
177
|
+
amount_cents?: number | null;
|
|
178
|
+
/** The currency of the coupon. This field is required only for coupon with `fixed_amount` type. */
|
|
179
|
+
amount_currency?: Currency;
|
|
180
|
+
/**
|
|
181
|
+
* The percentage rate of the coupon. This field is required only for coupons with a `percentage` coupon type.
|
|
182
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
183
|
+
* @example null
|
|
184
|
+
*/
|
|
185
|
+
percentage_rate?: string | null;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export interface AppliedCouponObject {
|
|
189
|
+
/**
|
|
190
|
+
* Unique identifier of the applied coupon, created by Lago.
|
|
191
|
+
* @format uuid
|
|
192
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
193
|
+
*/
|
|
194
|
+
lago_id: string;
|
|
195
|
+
/**
|
|
196
|
+
* Unique identifier of the coupon, created by Lago.
|
|
197
|
+
* @format uuid
|
|
198
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
199
|
+
*/
|
|
200
|
+
lago_coupon_id: string;
|
|
201
|
+
/**
|
|
202
|
+
* Unique code used to identify the coupon.
|
|
203
|
+
* @example "startup_deal"
|
|
204
|
+
*/
|
|
205
|
+
coupon_code: string;
|
|
206
|
+
/**
|
|
207
|
+
* The name of the coupon.
|
|
208
|
+
* @example "Startup Deal"
|
|
209
|
+
*/
|
|
210
|
+
coupon_name: string;
|
|
211
|
+
/**
|
|
212
|
+
* Unique identifier of the customer, created by Lago.
|
|
213
|
+
* @format uuid
|
|
214
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
215
|
+
*/
|
|
216
|
+
lago_customer_id: string;
|
|
217
|
+
/**
|
|
218
|
+
* The customer external unique identifier (provided by your own application)
|
|
219
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
220
|
+
*/
|
|
221
|
+
external_customer_id: string;
|
|
222
|
+
/**
|
|
223
|
+
* The status of the coupon. Can be either `active` or `terminated`.
|
|
224
|
+
* @example "active"
|
|
225
|
+
*/
|
|
226
|
+
status: "active" | "terminated";
|
|
227
|
+
/**
|
|
228
|
+
* The amount of the coupon in cents. This field is required only for coupon with `fixed_amount` type.
|
|
229
|
+
* @example 2000
|
|
230
|
+
*/
|
|
231
|
+
amount_cents?: number | null;
|
|
232
|
+
/**
|
|
233
|
+
* The remaining amount in cents for a `fixed_amount` coupon with a frequency set to `once`. This field indicates the remaining balance or value that can still be utilized from the coupon.
|
|
234
|
+
* @example 50
|
|
235
|
+
*/
|
|
236
|
+
amount_cents_remaining?: number | null;
|
|
237
|
+
/** The currency of the coupon. This field is required only for coupon with `fixed_amount` type. */
|
|
238
|
+
amount_currency?: Currency;
|
|
239
|
+
/**
|
|
240
|
+
* The percentage rate of the coupon. This field is required only for coupons with a `percentage` coupon type.
|
|
241
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
242
|
+
* @example null
|
|
243
|
+
*/
|
|
244
|
+
percentage_rate?: string | null;
|
|
245
|
+
/**
|
|
246
|
+
* The type of frequency for the coupon. It can have three possible values: `once`, `recurring` or `forever`.
|
|
247
|
+
*
|
|
248
|
+
* - If set to `once`, the coupon is applicable only for a single use.
|
|
249
|
+
* - If set to `recurring`, the coupon can be used multiple times for recurring billing periods.
|
|
250
|
+
* - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
|
|
251
|
+
* @example "recurring"
|
|
252
|
+
*/
|
|
253
|
+
frequency: "once" | "recurring";
|
|
254
|
+
/**
|
|
255
|
+
* Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
|
|
256
|
+
* @example 3
|
|
257
|
+
*/
|
|
258
|
+
frequency_duration?: number | null;
|
|
259
|
+
/**
|
|
260
|
+
* The remaining number of billing periods to which the coupon is applicable. This field determines the remaining usage or availability of the coupon based on the remaining billing periods.
|
|
261
|
+
* @example 1
|
|
262
|
+
*/
|
|
263
|
+
frequency_duration_remaining?: number | null;
|
|
264
|
+
/**
|
|
265
|
+
* The date and time after which the coupon will stop applying to customer's invoices. Once the expiration date is reached, the coupon will no longer be applicable, and any further invoices generated for the customer will not include the coupon discount.
|
|
266
|
+
* @format date-time
|
|
267
|
+
* @example "2022-04-29T08:59:51Z"
|
|
268
|
+
*/
|
|
269
|
+
expiration_at?: string | null;
|
|
270
|
+
/**
|
|
271
|
+
* The date and time when the coupon was assigned to a customer. It is expressed in UTC format according to the ISO 8601 datetime standard.
|
|
272
|
+
* @format date-time
|
|
273
|
+
* @example "2022-04-29T08:59:51Z"
|
|
274
|
+
*/
|
|
275
|
+
created_at: string;
|
|
276
|
+
/**
|
|
277
|
+
* This field indicates the specific moment when the coupon amount is fully utilized or when the coupon is removed from the customer's coupon list. It is expressed in UTC format according to the ISO 8601 datetime standard.
|
|
278
|
+
* @format date-time
|
|
279
|
+
* @example "2022-04-29T08:59:51Z"
|
|
280
|
+
*/
|
|
281
|
+
terminated_at?: string | null;
|
|
282
|
+
}
|
|
283
|
+
export type AppliedCouponObjectExtended = AppliedCouponObject & {
|
|
284
|
+
credits: CreditObject[];
|
|
285
|
+
};
|
|
286
|
+
export interface AppliedCouponsPaginated {
|
|
287
|
+
applied_coupons: AppliedCouponObjectExtended[];
|
|
288
|
+
meta: PaginationMeta;
|
|
289
|
+
}
|
|
290
|
+
export interface BaseAppliedTax {
|
|
291
|
+
/**
|
|
292
|
+
* Unique identifier of the applied tax, created by Lago.
|
|
293
|
+
* @format uuid
|
|
294
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
295
|
+
*/
|
|
296
|
+
lago_id?: string;
|
|
297
|
+
/**
|
|
298
|
+
* Unique identifier of the tax, created by Lago.
|
|
299
|
+
* @format uuid
|
|
300
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
301
|
+
*/
|
|
302
|
+
lago_tax_id?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Name of the tax.
|
|
305
|
+
* @example "TVA"
|
|
306
|
+
*/
|
|
307
|
+
tax_name?: string;
|
|
308
|
+
/**
|
|
309
|
+
* Unique code used to identify the tax associated with the API request.
|
|
310
|
+
* @example "french_standard_vat"
|
|
311
|
+
*/
|
|
312
|
+
tax_code?: string;
|
|
313
|
+
/**
|
|
314
|
+
* The percentage rate of the tax
|
|
315
|
+
* @example 20
|
|
316
|
+
*/
|
|
317
|
+
tax_rate?: number;
|
|
318
|
+
/**
|
|
319
|
+
* Internal description of the taxe
|
|
320
|
+
* @example "French standard VAT"
|
|
321
|
+
*/
|
|
322
|
+
tax_description?: string;
|
|
323
|
+
/**
|
|
324
|
+
* Amount of the tax
|
|
325
|
+
* @example 2000
|
|
326
|
+
*/
|
|
327
|
+
amount_cents?: number;
|
|
328
|
+
/** Currency of the tax */
|
|
329
|
+
amount_currency?: Currency;
|
|
330
|
+
/**
|
|
331
|
+
* The date and time when the applied tax was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the applied tax was initially created.
|
|
332
|
+
* @format date-time
|
|
333
|
+
* @example "2022-09-14T16:35:31Z"
|
|
334
|
+
*/
|
|
335
|
+
created_at?: string;
|
|
336
|
+
}
|
|
337
|
+
export interface BillableMetric {
|
|
338
|
+
billable_metric: BillableMetricObject;
|
|
339
|
+
}
|
|
340
|
+
export interface BillableMetricObject {
|
|
341
|
+
/**
|
|
342
|
+
* Unique identifier of the billable metric created by Lago.
|
|
343
|
+
* @format uuid
|
|
344
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
345
|
+
*/
|
|
346
|
+
lago_id: string;
|
|
347
|
+
/**
|
|
348
|
+
* Name of the billable metric.
|
|
349
|
+
* @example "Storage"
|
|
350
|
+
*/
|
|
351
|
+
name: string;
|
|
352
|
+
/**
|
|
353
|
+
* Unique code used to identify the billable metric associated with the API request. This code associates each event with the correct metric.
|
|
354
|
+
* @example "storage"
|
|
355
|
+
*/
|
|
356
|
+
code: string;
|
|
357
|
+
/**
|
|
358
|
+
* Internal description of the billable metric.
|
|
359
|
+
* @example "GB of storage used in my application"
|
|
360
|
+
*/
|
|
361
|
+
description?: string | null;
|
|
362
|
+
/**
|
|
363
|
+
* Defines if the billable metric is persisted billing period over billing period.
|
|
364
|
+
*
|
|
365
|
+
* - If set to `true`: the accumulated number of units calculated from the previous billing period is persisted to the next billing period.
|
|
366
|
+
* - If set to `false`: the accumulated number of units is reset to 0 at the end of the billing period.
|
|
367
|
+
* - If not defined in the request, default value is `false`.
|
|
368
|
+
* @example false
|
|
369
|
+
*/
|
|
370
|
+
recurring: boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Creation date of the billable metric.
|
|
373
|
+
* @format date-time
|
|
374
|
+
* @example "2022-09-14T16:35:31Z"
|
|
375
|
+
*/
|
|
376
|
+
created_at: string;
|
|
377
|
+
/**
|
|
378
|
+
* Property of the billable metric used for aggregating usage data. This field is not required for `count_agg`.
|
|
379
|
+
* @example "gb"
|
|
380
|
+
*/
|
|
381
|
+
field_name?: string | null;
|
|
382
|
+
/**
|
|
383
|
+
* Aggregation method used to compute usage for this billable metric. Possible values are `count_agg`, `sum_agg`, `max_agg` or `unique_count_agg`.
|
|
384
|
+
* @example "sum_agg"
|
|
385
|
+
*/
|
|
386
|
+
aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "weighted_sum_agg";
|
|
387
|
+
/**
|
|
388
|
+
* Parameter exclusively utilized in conjunction with the `weighted_sum` aggregation type. It serves to adjust the aggregation result by assigning weights and proration to the result based on time intervals. When this field is not provided, the default time interval is assumed to be in `seconds`.
|
|
389
|
+
* @example "seconds"
|
|
390
|
+
*/
|
|
391
|
+
weighted_interval?: "seconds" | null;
|
|
392
|
+
/** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
|
|
393
|
+
group?: BillableMetricGroup;
|
|
394
|
+
/**
|
|
395
|
+
* Number of active subscriptions using this billable metric.
|
|
396
|
+
* @example 4
|
|
397
|
+
*/
|
|
398
|
+
active_subscriptions_count: number;
|
|
399
|
+
/**
|
|
400
|
+
* Number of draft invoices for which this billable metric is listed as an invoice item.
|
|
401
|
+
* @example 10
|
|
402
|
+
*/
|
|
403
|
+
draft_invoices_count: number;
|
|
404
|
+
/**
|
|
405
|
+
* Number of plans using this billable metric.
|
|
406
|
+
* @example 4
|
|
407
|
+
*/
|
|
408
|
+
plans_count: number;
|
|
409
|
+
}
|
|
410
|
+
export interface BillableMetricBaseInput {
|
|
411
|
+
/**
|
|
412
|
+
* Name of the billable metric.
|
|
413
|
+
* @example "Storage"
|
|
414
|
+
*/
|
|
415
|
+
name?: string;
|
|
416
|
+
/**
|
|
417
|
+
* Unique code used to identify the billable metric associated with the API request. This code associates each event with the correct metric.
|
|
418
|
+
* @example "storage"
|
|
419
|
+
*/
|
|
420
|
+
code?: string;
|
|
421
|
+
/**
|
|
422
|
+
* Internal description of the billable metric.
|
|
423
|
+
* @example "GB of storage used in my application"
|
|
424
|
+
*/
|
|
425
|
+
description?: string | null;
|
|
426
|
+
/**
|
|
427
|
+
* Defines if the billable metric is persisted billing period over billing period.
|
|
428
|
+
*
|
|
429
|
+
* - If set to `true`: the accumulated number of units calculated from the previous billing period is persisted to the next billing period.
|
|
430
|
+
* - If set to `false`: the accumulated number of units is reset to 0 at the end of the billing period.
|
|
431
|
+
* - If not defined in the request, default value is `false`.
|
|
432
|
+
* @example false
|
|
433
|
+
*/
|
|
434
|
+
recurring?: boolean;
|
|
435
|
+
/**
|
|
436
|
+
* Property of the billable metric used for aggregating usage data. This field is not required for `count_agg`.
|
|
437
|
+
* @example "gb"
|
|
438
|
+
*/
|
|
439
|
+
field_name?: string | null;
|
|
440
|
+
/**
|
|
441
|
+
* Aggregation method used to compute usage for this billable metric. Possible values are `count_agg`, `sum_agg`, `max_agg` or `unique_count_agg`.
|
|
442
|
+
* @example "sum_agg"
|
|
443
|
+
*/
|
|
444
|
+
aggregation_type?: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "weighted_sum_agg";
|
|
445
|
+
/**
|
|
446
|
+
* Parameter exclusively utilized in conjunction with the `weighted_sum` aggregation type. It serves to adjust the aggregation result by assigning weights and proration to the result based on time intervals. When this field is not provided, the default time interval is assumed to be in `seconds`.
|
|
447
|
+
* @example "seconds"
|
|
448
|
+
*/
|
|
449
|
+
weighted_interval?: "seconds" | null;
|
|
450
|
+
/** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
|
|
451
|
+
group?: BillableMetricGroup;
|
|
452
|
+
}
|
|
453
|
+
export interface BillableMetricCreateInput {
|
|
454
|
+
billable_metric: BillableMetricBaseInput;
|
|
455
|
+
}
|
|
456
|
+
export interface BillableMetricUpdateInput {
|
|
457
|
+
billable_metric: BillableMetricBaseInput;
|
|
458
|
+
}
|
|
459
|
+
/** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
|
|
460
|
+
export interface BillableMetricGroup {
|
|
461
|
+
/**
|
|
462
|
+
* Name of the event property used to group values.
|
|
463
|
+
* @example "region"
|
|
464
|
+
*/
|
|
465
|
+
key: string;
|
|
466
|
+
/**
|
|
467
|
+
* Array of strings or objects representing all possible values.
|
|
468
|
+
* @example ["us-east-1","us-east-2","eu-west-1"]
|
|
469
|
+
*/
|
|
470
|
+
values: (string | {
|
|
471
|
+
/**
|
|
472
|
+
* Name of the event property used to group values.
|
|
473
|
+
* @example "region"
|
|
474
|
+
*/
|
|
475
|
+
key: string;
|
|
476
|
+
/**
|
|
477
|
+
* Array of strings representing all possible values.
|
|
478
|
+
* @example ["us-east-1","us-east-2","eu-west-1"]
|
|
479
|
+
*/
|
|
480
|
+
values: string[];
|
|
481
|
+
})[];
|
|
482
|
+
}
|
|
483
|
+
export interface BillableMetricsPaginated {
|
|
484
|
+
billable_metrics: BillableMetricObject[];
|
|
485
|
+
meta: PaginationMeta;
|
|
486
|
+
}
|
|
487
|
+
export interface ChargeObject {
|
|
488
|
+
/**
|
|
489
|
+
* Unique identifier of charge, created by Lago.
|
|
490
|
+
* @format uuid
|
|
491
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
492
|
+
*/
|
|
493
|
+
lago_id: string;
|
|
494
|
+
/**
|
|
495
|
+
* Unique identifier of the billable metric created by Lago.
|
|
496
|
+
* @format uuid
|
|
497
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
498
|
+
*/
|
|
499
|
+
lago_billable_metric_id: string;
|
|
500
|
+
/**
|
|
501
|
+
* Unique code identifying a billable metric.
|
|
502
|
+
* @example "requests"
|
|
503
|
+
*/
|
|
504
|
+
billable_metric_code: string;
|
|
505
|
+
/**
|
|
506
|
+
* The date and time when the charge was created. It is expressed in UTC format according to the ISO 8601 datetime standard.
|
|
507
|
+
* @format date-time
|
|
508
|
+
* @example "2022-09-14T16:35:31Z"
|
|
509
|
+
*/
|
|
510
|
+
created_at: string;
|
|
511
|
+
/** Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage`, `package`, `percentage` or `volume`. */
|
|
512
|
+
charge_model: "standard" | "graduated" | "graduated_percentage" | "package" | "percentage" | "volume";
|
|
513
|
+
/**
|
|
514
|
+
* This field determines the billing timing for this specific usage-based charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to `false`, the charge is due and invoiced at the end of each billing period.
|
|
515
|
+
* @example true
|
|
516
|
+
*/
|
|
517
|
+
pay_in_advance?: boolean;
|
|
518
|
+
/**
|
|
519
|
+
* This field specifies whether the charge should be included in a proper invoice. If set to `false`, no invoice will be issued for this charge. You can only set it to `false` when `pay_in_advance` is `true`.
|
|
520
|
+
* @example true
|
|
521
|
+
*/
|
|
522
|
+
invoiceable?: boolean;
|
|
523
|
+
/**
|
|
524
|
+
* Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
|
|
525
|
+
*
|
|
526
|
+
* - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
|
|
527
|
+
* - If set to `false`, the charge is billed in full.
|
|
528
|
+
* - If not defined in the request, default value is `false`.
|
|
529
|
+
* @example false
|
|
530
|
+
*/
|
|
531
|
+
prorated?: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
|
|
534
|
+
* @example 1200
|
|
535
|
+
*/
|
|
536
|
+
min_amount_cents?: number;
|
|
537
|
+
/** List of all thresholds utilized for calculating the charge. */
|
|
538
|
+
properties?: ChargeProperties;
|
|
539
|
+
/** All charge information, sorted by groups. */
|
|
540
|
+
group_properties?: GroupPropertiesObject[];
|
|
541
|
+
/** All taxes applied to the charge. */
|
|
542
|
+
taxes?: TaxObject[];
|
|
543
|
+
}
|
|
544
|
+
export interface ChargeProperties {
|
|
545
|
+
/** Graduated ranges, sorted from bottom to top tiers, used for a `graduated` charge model. */
|
|
546
|
+
graduated_ranges?: {
|
|
547
|
+
/**
|
|
548
|
+
* Specifies the lower value of a tier for a `graduated` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
|
|
549
|
+
* @example 0
|
|
550
|
+
*/
|
|
551
|
+
from_value: number;
|
|
552
|
+
/**
|
|
553
|
+
* Specifies the highest value of a tier for a `graduated` charge model.
|
|
554
|
+
* - This value must be higher than the from_value of the same tier.
|
|
555
|
+
* - This value must be null for the last tier.
|
|
556
|
+
* @example 10
|
|
557
|
+
*/
|
|
558
|
+
to_value: number | null;
|
|
559
|
+
/**
|
|
560
|
+
* The flat amount for a whole tier, excluding tax, for a `graduated` charge model. It is expressed as a decimal value.
|
|
561
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
562
|
+
* @example "10"
|
|
563
|
+
*/
|
|
564
|
+
flat_amount: string;
|
|
565
|
+
/**
|
|
566
|
+
* The unit price, excluding tax, for a specific tier of a `graduated` charge model. It is expressed as a decimal value.
|
|
567
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
568
|
+
* @example "0.5"
|
|
569
|
+
*/
|
|
570
|
+
per_unit_amount: string;
|
|
571
|
+
}[];
|
|
572
|
+
/** Graduated percentage ranges, sorted from bottom to top tiers, used for a `graduated_percentage` charge model. */
|
|
573
|
+
graduated_percentage_ranges?: {
|
|
574
|
+
/**
|
|
575
|
+
* Specifies the lower value of a tier for a `graduated_percentage` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
|
|
576
|
+
* @example 0
|
|
577
|
+
*/
|
|
578
|
+
from_value: number;
|
|
579
|
+
/**
|
|
580
|
+
* Specifies the highest value of a tier for a `graduated_percentage` charge model.
|
|
581
|
+
* - This value must be higher than the from_value of the same tier.
|
|
582
|
+
* - This value must be null for the last tier.
|
|
583
|
+
* @example 10
|
|
584
|
+
*/
|
|
585
|
+
to_value: number | null;
|
|
586
|
+
/**
|
|
587
|
+
* The percentage rate that is applied to the amount of each transaction in the tier for a `graduated_percentage` charge model. It is expressed as a decimal value.
|
|
588
|
+
* @format ^[0-9]+.?[0-9]*$
|
|
589
|
+
* @example "1"
|
|
590
|
+
*/
|
|
591
|
+
rate: string;
|
|
592
|
+
/**
|
|
593
|
+
* The flat amount for a whole tier, excluding tax, for a `graduated_percentage` charge model. It is expressed as a decimal value.
|
|
594
|
+
* @format ^[0-9]+.?[0-9]*$
|
|
595
|
+
* @example "10"
|
|
596
|
+
*/
|
|
597
|
+
flat_amount: string;
|
|
598
|
+
}[];
|
|
599
|
+
/**
|
|
600
|
+
* - The unit price, excluding tax, for a `standard` charge model. It is expressed as a decimal value.
|
|
601
|
+
* - The amount, excluding tax, for a complete set of units in a `package` charge model. It is expressed as a decimal value.
|
|
602
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
603
|
+
* @example "30"
|
|
604
|
+
*/
|
|
605
|
+
amount?: string;
|
|
606
|
+
/**
|
|
607
|
+
* The quantity of units that are provided free of charge for each billing period in a `package` charge model. This field specifies the number of units that customers can use without incurring any additional cost during each billing cycle.
|
|
608
|
+
* @example 100
|
|
609
|
+
*/
|
|
610
|
+
free_units?: number;
|
|
611
|
+
/**
|
|
612
|
+
* The quantity of units included in each pack or set for a `package` charge model. It indicates the number of units that are bundled together as a single package or set within the pricing structure.
|
|
613
|
+
* @example 1000
|
|
614
|
+
*/
|
|
615
|
+
package_size?: number;
|
|
616
|
+
/**
|
|
617
|
+
* The percentage rate that is applied to the amount of each transaction for a `percentage` charge model. It is expressed as a decimal value.
|
|
618
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
619
|
+
* @example "1"
|
|
620
|
+
*/
|
|
621
|
+
rate?: string;
|
|
622
|
+
/**
|
|
623
|
+
* The fixed fee that is applied to each transaction for a `percentage` charge model. It is expressed as a decimal value.
|
|
624
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
625
|
+
* @example "0.5"
|
|
626
|
+
*/
|
|
627
|
+
fixed_amount?: string;
|
|
628
|
+
/**
|
|
629
|
+
* The count of transactions that are not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the number of transactions that are exempt from the calculation of charges based on the specified percentage rate and fixed fee.
|
|
630
|
+
* @example 5
|
|
631
|
+
*/
|
|
632
|
+
free_units_per_events?: number | null;
|
|
633
|
+
/**
|
|
634
|
+
* The transaction amount that is not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the portion of the transaction amount that is exempt from the calculation of charges based on the specified percentage rate and fixed fee.
|
|
635
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
636
|
+
* @example "500"
|
|
637
|
+
*/
|
|
638
|
+
free_units_per_total_aggregation?: string | null;
|
|
639
|
+
/**
|
|
640
|
+
* Specifies the maximum allowable spending for a single transaction. Working as a transaction cap.
|
|
641
|
+
* @format ^[0-9]+.?[0-9]*$
|
|
642
|
+
* @example "3.75"
|
|
643
|
+
*/
|
|
644
|
+
per_transaction_max_amount?: string | null;
|
|
645
|
+
/**
|
|
646
|
+
* Specifies the minimum allowable spending for a single transaction. Working as a transaction floor.
|
|
647
|
+
* @format ^[0-9]+.?[0-9]*$
|
|
648
|
+
* @example "1.75"
|
|
649
|
+
*/
|
|
650
|
+
per_transaction_min_amount?: string | null;
|
|
651
|
+
/** Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. */
|
|
652
|
+
volume_ranges?: {
|
|
653
|
+
/**
|
|
654
|
+
* Specifies the lower value of a tier for a `volume` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
|
|
655
|
+
* @example 0
|
|
656
|
+
*/
|
|
657
|
+
from_value: number;
|
|
658
|
+
/**
|
|
659
|
+
* Specifies the highest value of a tier for a `volume` charge model.
|
|
660
|
+
* - This value must be higher than the `from_value` of the same tier.
|
|
661
|
+
* - This value must be `null` for the last tier.
|
|
662
|
+
* @example 10
|
|
663
|
+
*/
|
|
664
|
+
to_value: number | null;
|
|
665
|
+
/**
|
|
666
|
+
* The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
|
|
667
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
668
|
+
* @example "10"
|
|
669
|
+
*/
|
|
670
|
+
flat_amount: string;
|
|
671
|
+
/**
|
|
672
|
+
* The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
|
|
673
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
674
|
+
* @example "0.5"
|
|
675
|
+
*/
|
|
676
|
+
per_unit_amount: string;
|
|
677
|
+
}[];
|
|
678
|
+
}
|
|
679
|
+
/** @example "US" */
|
|
680
|
+
export type Country = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";
|
|
681
|
+
export interface Coupon {
|
|
682
|
+
coupon: CouponObject;
|
|
683
|
+
}
|
|
684
|
+
export interface CouponBaseInput {
|
|
685
|
+
/**
|
|
686
|
+
* The name of the coupon.
|
|
687
|
+
* @example "Startup Deal"
|
|
688
|
+
*/
|
|
689
|
+
name?: string;
|
|
690
|
+
/**
|
|
691
|
+
* Unique code used to identify the coupon.
|
|
692
|
+
* @example "startup_deal"
|
|
693
|
+
*/
|
|
694
|
+
code?: string;
|
|
695
|
+
/**
|
|
696
|
+
* Description of the coupon.
|
|
697
|
+
* @example "I am a coupon description"
|
|
698
|
+
*/
|
|
699
|
+
description?: string | null;
|
|
700
|
+
/**
|
|
701
|
+
* The type of the coupon. It can have two possible values: `fixed_amount` or `percentage`.
|
|
702
|
+
*
|
|
703
|
+
* - If set to `fixed_amount`, the coupon represents a fixed amount discount.
|
|
704
|
+
* - If set to `percentage`, the coupon represents a percentage-based discount.
|
|
705
|
+
* @example "fixed_amount"
|
|
706
|
+
*/
|
|
707
|
+
coupon_type?: "fixed_amount" | "percentage";
|
|
708
|
+
/**
|
|
709
|
+
* The amount of the coupon in cents. This field is required only for coupon with `fixed_amount` type.
|
|
710
|
+
* @example 5000
|
|
711
|
+
*/
|
|
712
|
+
amount_cents?: number | null;
|
|
713
|
+
/** The currency of the coupon. This field is required only for coupon with `fixed_amount` type. */
|
|
714
|
+
amount_currency?: Currency;
|
|
715
|
+
/**
|
|
716
|
+
* Indicates whether the coupon can be reused or not. If set to `true`, the coupon is reusable, meaning it can be applied multiple times to the same customer. If set to `false`, the coupon can only be used once and is not reusable. If not specified, this field is set to `true` by default.
|
|
717
|
+
* @example false
|
|
718
|
+
*/
|
|
719
|
+
reusable?: boolean;
|
|
720
|
+
/**
|
|
721
|
+
* The percentage rate of the coupon. This field is required only for coupons with a `percentage` coupon type.
|
|
722
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
723
|
+
* @example null
|
|
724
|
+
*/
|
|
725
|
+
percentage_rate?: string | null;
|
|
726
|
+
/**
|
|
727
|
+
* The type of frequency for the coupon. It can have three possible values: `once`, `recurring` or `forever`.
|
|
728
|
+
*
|
|
729
|
+
* - If set to `once`, the coupon is applicable only for a single use.
|
|
730
|
+
* - If set to `recurring`, the coupon can be used multiple times for recurring billing periods.
|
|
731
|
+
* - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
|
|
732
|
+
* @example "recurring"
|
|
733
|
+
*/
|
|
734
|
+
frequency?: "once" | "recurring";
|
|
735
|
+
/**
|
|
736
|
+
* Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
|
|
737
|
+
* @example 6
|
|
738
|
+
*/
|
|
739
|
+
frequency_duration?: number | null;
|
|
740
|
+
/**
|
|
741
|
+
* Specifies the type of expiration for the coupon. It can have two possible values: `time_limit` or `no_expiration`.
|
|
742
|
+
*
|
|
743
|
+
* - If set to `time_limit`, the coupon has an expiration based on a specified time limit.
|
|
744
|
+
* - If set to `no_expiration`, the coupon does not have an expiration date and remains valid indefinitely.
|
|
745
|
+
* @example "time_limit"
|
|
746
|
+
*/
|
|
747
|
+
expiration?: "no_expiration" | "time_limit";
|
|
748
|
+
/**
|
|
749
|
+
* The expiration date and time of the coupon. This field is required only for coupons with `expiration` set to `time_limit`. The expiration date and time should be specified in UTC format according to the ISO 8601 datetime standard. It indicates the exact moment when the coupon will expire and is no longer valid.
|
|
750
|
+
* @format date-time
|
|
751
|
+
* @example "2022-08-08T23:59:59Z"
|
|
752
|
+
*/
|
|
753
|
+
expiration_at?: string | null;
|
|
754
|
+
/** Set coupon limitations to plans or specific metrics. */
|
|
755
|
+
applies_to?: {
|
|
756
|
+
/**
|
|
757
|
+
* An array of plan codes to which the coupon is applicable. By specifying the plan codes in this field, you can restrict the coupon's usage to specific plans only.
|
|
758
|
+
* @example ["startup_plan"]
|
|
759
|
+
*/
|
|
760
|
+
plan_codes?: string[] | null;
|
|
761
|
+
/**
|
|
762
|
+
* An array of billable metric codes to which the coupon is applicable. By specifying the billable metric codes in this field, you can restrict the coupon's usage to specific metrics only.
|
|
763
|
+
* @example []
|
|
764
|
+
*/
|
|
765
|
+
billable_metric_codes?: string[] | null;
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
export interface CouponCreateInput {
|
|
769
|
+
coupon: CouponBaseInput;
|
|
770
|
+
}
|
|
771
|
+
export interface CouponObject {
|
|
772
|
+
/**
|
|
773
|
+
* Unique identifier of the coupon, created by Lago.
|
|
774
|
+
* @format uuid
|
|
775
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
776
|
+
*/
|
|
777
|
+
lago_id: string;
|
|
778
|
+
/**
|
|
779
|
+
* The name of the coupon.
|
|
780
|
+
* @example "Startup Deal"
|
|
781
|
+
*/
|
|
782
|
+
name: string;
|
|
783
|
+
/**
|
|
784
|
+
* Unique code used to identify the coupon.
|
|
785
|
+
* @example "startup_deal"
|
|
786
|
+
*/
|
|
787
|
+
code: string;
|
|
788
|
+
/**
|
|
789
|
+
* Description of the coupon.
|
|
790
|
+
* @example "I am a coupon description"
|
|
791
|
+
*/
|
|
792
|
+
description?: string | null;
|
|
793
|
+
/**
|
|
794
|
+
* The type of the coupon. It can have two possible values: `fixed_amount` or `percentage`.
|
|
795
|
+
*
|
|
796
|
+
* - If set to `fixed_amount`, the coupon represents a fixed amount discount.
|
|
797
|
+
* - If set to `percentage`, the coupon represents a percentage-based discount.
|
|
798
|
+
* @example "fixed_amount"
|
|
799
|
+
*/
|
|
800
|
+
coupon_type: "fixed_amount" | "percentage";
|
|
801
|
+
/**
|
|
802
|
+
* The amount of the coupon in cents. This field is required only for coupon with `fixed_amount` type.
|
|
803
|
+
* @example 5000
|
|
804
|
+
*/
|
|
805
|
+
amount_cents?: number | null;
|
|
806
|
+
/** The currency of the coupon. This field is required only for coupon with `fixed_amount` type. */
|
|
807
|
+
amount_currency?: Currency;
|
|
808
|
+
/**
|
|
809
|
+
* Indicates whether the coupon can be reused or not. If set to `true`, the coupon is reusable, meaning it can be applied multiple times to the same customer. If set to `false`, the coupon can only be used once and is not reusable. If not specified, this field is set to `true` by default.
|
|
810
|
+
* @example true
|
|
811
|
+
*/
|
|
812
|
+
reusable: boolean;
|
|
813
|
+
/**
|
|
814
|
+
* The coupon is limited to specific plans. The possible values can be `true` or `false`.
|
|
815
|
+
* @example true
|
|
816
|
+
*/
|
|
817
|
+
limited_plans: boolean;
|
|
818
|
+
/**
|
|
819
|
+
* An array of plan codes to which the coupon is applicable. By specifying the plan codes in this field, you can restrict the coupon's usage to specific plans only.
|
|
820
|
+
* @example ["startup_plan"]
|
|
821
|
+
*/
|
|
822
|
+
plan_codes?: string[];
|
|
823
|
+
/**
|
|
824
|
+
* The coupon is limited to specific billable metrics. The possible values can be `true` or `false`.
|
|
825
|
+
* @example false
|
|
826
|
+
*/
|
|
827
|
+
limited_billable_metrics: boolean;
|
|
828
|
+
/**
|
|
829
|
+
* An array of billable metric codes to which the coupon is applicable. By specifying the billable metric codes in this field, you can restrict the coupon's usage to specific metrics only.
|
|
830
|
+
* @example []
|
|
831
|
+
*/
|
|
832
|
+
billable_metric_codes?: string[];
|
|
833
|
+
/**
|
|
834
|
+
* The percentage rate of the coupon. This field is required only for coupons with a `percentage` coupon type.
|
|
835
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
836
|
+
* @example null
|
|
837
|
+
*/
|
|
838
|
+
percentage_rate?: string | null;
|
|
839
|
+
/**
|
|
840
|
+
* The type of frequency for the coupon. It can have three possible values: `once`, `recurring`, or `forever`.
|
|
841
|
+
*
|
|
842
|
+
* - If set to `once`, the coupon is applicable only for a single use.
|
|
843
|
+
* - If set to `recurring`, the coupon can be used multiple times for recurring billing periods.
|
|
844
|
+
* - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
|
|
845
|
+
* @example "recurring"
|
|
846
|
+
*/
|
|
847
|
+
frequency: "once" | "recurring";
|
|
848
|
+
/**
|
|
849
|
+
* Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
|
|
850
|
+
* @example 6
|
|
851
|
+
*/
|
|
852
|
+
frequency_duration?: number | null;
|
|
853
|
+
/**
|
|
854
|
+
* Specifies the type of expiration for the coupon. It can have two possible values: `time_limit` or `no_expiration`.
|
|
855
|
+
*
|
|
856
|
+
* - If set to `time_limit`, the coupon has an expiration based on a specified time limit.
|
|
857
|
+
* - If set to `no_expiration`, the coupon does not have an expiration date and remains valid indefinitely.
|
|
858
|
+
* @example "time_limit"
|
|
859
|
+
*/
|
|
860
|
+
expiration: "no_expiration" | "time_limit";
|
|
861
|
+
/**
|
|
862
|
+
* The expiration date and time of the coupon. This field is required only for coupons with `expiration` set to `time_limit`. The expiration date and time should be specified in UTC format according to the ISO 8601 datetime standard. It indicates the exact moment when the coupon will expire and is no longer valid.
|
|
863
|
+
* @format date-time
|
|
864
|
+
* @example "2022-08-08T23:59:59Z"
|
|
865
|
+
*/
|
|
866
|
+
expiration_at?: string | null;
|
|
867
|
+
/**
|
|
868
|
+
* The date and time when the coupon was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the coupon was initially created.
|
|
869
|
+
* @format date-time
|
|
870
|
+
* @example "2022-04-29T08:59:51Z"
|
|
871
|
+
*/
|
|
872
|
+
created_at: string;
|
|
873
|
+
/**
|
|
874
|
+
* This field indicates if the coupon has been terminated and is no longer usable. If it's not null, it won't be removed for existing customers using it, but it prevents the coupon from being applied in the future.
|
|
875
|
+
* @format date-time
|
|
876
|
+
* @example "2022-08-08T23:59:59Z"
|
|
877
|
+
*/
|
|
878
|
+
terminated_at?: string;
|
|
879
|
+
}
|
|
880
|
+
export interface CouponsPaginated {
|
|
881
|
+
coupons: CouponObject[];
|
|
882
|
+
meta: PaginationMeta;
|
|
883
|
+
}
|
|
884
|
+
export interface CouponUpdateInput {
|
|
885
|
+
coupon: CouponBaseInput;
|
|
886
|
+
}
|
|
887
|
+
export interface CreditObject {
|
|
888
|
+
/**
|
|
889
|
+
* Unique identifier assigned to the credit within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit’s item record within the Lago system.
|
|
890
|
+
* @format uuid
|
|
891
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
892
|
+
*/
|
|
893
|
+
lago_id: string;
|
|
894
|
+
/**
|
|
895
|
+
* The amount of credit associated with the invoice, expressed in cents.
|
|
896
|
+
* @example 1200
|
|
897
|
+
*/
|
|
898
|
+
amount_cents: number;
|
|
899
|
+
/** The currency of the credit. */
|
|
900
|
+
amount_currency: Currency;
|
|
901
|
+
/**
|
|
902
|
+
* Indicates whether the credit is applied on the amount before taxes (coupons) or after taxes (credit notes). This flag helps determine the order in which credits are applied to the invoice calculation
|
|
903
|
+
* @example false
|
|
904
|
+
*/
|
|
905
|
+
before_taxes: boolean;
|
|
906
|
+
/** The item attached to the credit. */
|
|
907
|
+
item: {
|
|
908
|
+
/**
|
|
909
|
+
* Unique identifier assigned to the credit item within the Lago application.
|
|
910
|
+
* @format uuid
|
|
911
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
912
|
+
*/
|
|
913
|
+
lago_item_id: string;
|
|
914
|
+
/**
|
|
915
|
+
* The type of credit applied. Possible values are `coupon` or `credit_note`.
|
|
916
|
+
* @example "coupon"
|
|
917
|
+
*/
|
|
918
|
+
type: "coupon" | "credit_note";
|
|
919
|
+
/**
|
|
920
|
+
* The code of the credit applied. It can be the code of the coupon attached to the credit or the credit note's number.
|
|
921
|
+
* @example "startup_deal"
|
|
922
|
+
*/
|
|
923
|
+
code: string;
|
|
924
|
+
/**
|
|
925
|
+
* The name of the credit applied. It can be the name of the coupon attached to the credit or the initial invoice's number linked to the credit note.
|
|
926
|
+
* @example "Startup Deal"
|
|
927
|
+
*/
|
|
928
|
+
name: string;
|
|
929
|
+
};
|
|
930
|
+
invoice: {
|
|
931
|
+
/**
|
|
932
|
+
* @format uuid
|
|
933
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
934
|
+
*/
|
|
935
|
+
lago_id: string;
|
|
936
|
+
/** @example "succeeded" */
|
|
937
|
+
payment_status: "pending" | "succeeded" | "failed";
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
export interface CreditNote {
|
|
941
|
+
credit_note: CreditNoteObject;
|
|
942
|
+
}
|
|
943
|
+
export type CreditNoteAppliedTaxObject = BaseAppliedTax & {
|
|
944
|
+
/**
|
|
945
|
+
* Unique identifier of the credit note, created by Lago.
|
|
946
|
+
* @format uuid
|
|
947
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
948
|
+
*/
|
|
949
|
+
lago_credit_note_id?: string;
|
|
950
|
+
/** @example 100 */
|
|
951
|
+
base_amount_cents?: number;
|
|
952
|
+
};
|
|
953
|
+
export interface CreditNoteItemObject {
|
|
954
|
+
/**
|
|
955
|
+
* The credit note’s item unique identifier, created by Lago.
|
|
956
|
+
* @format uuid
|
|
957
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
958
|
+
*/
|
|
959
|
+
lago_id: string;
|
|
960
|
+
/**
|
|
961
|
+
* The credit note’s item amount, expressed in cents.
|
|
962
|
+
* @example 100
|
|
963
|
+
*/
|
|
964
|
+
amount_cents: number;
|
|
965
|
+
/** The credit note’s item currency. */
|
|
966
|
+
amount_currency: Currency;
|
|
967
|
+
/** The fee object related to the credit note item. */
|
|
968
|
+
fee: FeeObject;
|
|
969
|
+
}
|
|
970
|
+
export interface CreditNoteObject {
|
|
971
|
+
/**
|
|
972
|
+
* The credit note unique identifier, created by Lago.
|
|
973
|
+
* @format uuid
|
|
974
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
975
|
+
*/
|
|
976
|
+
lago_id: string;
|
|
977
|
+
/**
|
|
978
|
+
* The sequential identifier of the credit note, specifically scoped on the associated invoice. It provides a unique numerical identifier for the credit note within the context of the invoice.
|
|
979
|
+
* @example 2
|
|
980
|
+
*/
|
|
981
|
+
sequential_id: number;
|
|
982
|
+
/**
|
|
983
|
+
* The credit note unique number.
|
|
984
|
+
* @example "LAG-1234-CN2"
|
|
985
|
+
*/
|
|
986
|
+
number: string;
|
|
987
|
+
/**
|
|
988
|
+
* Unique identifier assigned to the invoice that the credit note belongs to
|
|
989
|
+
* @format uuid
|
|
990
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
991
|
+
*/
|
|
992
|
+
lago_invoice_id: string;
|
|
993
|
+
/**
|
|
994
|
+
* The invoice unique number, related to the credit note.
|
|
995
|
+
* @example "LAG-1234"
|
|
996
|
+
*/
|
|
997
|
+
invoice_number: string;
|
|
998
|
+
/**
|
|
999
|
+
* The date of creation of the credit note. It follows the ISO 8601 date format and provides the specific date when the credit note was created.
|
|
1000
|
+
* @format date
|
|
1001
|
+
* @example "2022-12-06"
|
|
1002
|
+
*/
|
|
1003
|
+
issuing_date: string;
|
|
1004
|
+
/**
|
|
1005
|
+
* The status of the credit portion of the credit note. It indicates the current state or condition of the credit amount associated with the credit note. The possible values for this field are:
|
|
1006
|
+
*
|
|
1007
|
+
* - `available`: this status indicates that an amount remains available for future usage. The credit can be applied towards future transactions or invoices.
|
|
1008
|
+
* - `consumed`: this status indicates that the credit amount has been fully consumed. The remaining amount is 0, indicating that the credit has been utilized in its entirety.
|
|
1009
|
+
* - `voided`: this status indicates that the remaining amount of the credit cannot be used any further. The credit has been voided and is no longer available for application or redemption.
|
|
1010
|
+
* @example "available"
|
|
1011
|
+
*/
|
|
1012
|
+
credit_status?: "available" | "consumed" | "voided" | null;
|
|
1013
|
+
/**
|
|
1014
|
+
* The status of the refund portion of the credit note. It indicates the current state or condition of the refund associated with the credit note. The possible values for this field are:
|
|
1015
|
+
*
|
|
1016
|
+
* - `pending`: this status indicates that the refund is pending execution. The refund request has been initiated but has not been processed or completed yet.
|
|
1017
|
+
* - `succeeded`: this status indicates that the refund has been successfully executed. The refund amount has been processed and returned to the customer or the designated recipient.
|
|
1018
|
+
* - `failed`: this status indicates that the refund failed to execute. The refund request encountered an error or unsuccessful processing, and the refund amount could not be returned.
|
|
1019
|
+
* @example "pending"
|
|
1020
|
+
*/
|
|
1021
|
+
refund_status?: "pending" | "succeeded" | "failed" | null;
|
|
1022
|
+
/**
|
|
1023
|
+
* The reason of the credit note creation.
|
|
1024
|
+
* Possible values are `duplicated_charge`, `product_unsatisfactory`, `order_change`, `order_cancellation`, `fraudulent_charge` or `other`.
|
|
1025
|
+
* @example "other"
|
|
1026
|
+
*/
|
|
1027
|
+
reason: "duplicated_charge" | "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "other";
|
|
1028
|
+
/**
|
|
1029
|
+
* The description of the credit note.
|
|
1030
|
+
* @example "Free text"
|
|
1031
|
+
*/
|
|
1032
|
+
description?: string | null;
|
|
1033
|
+
/** The currency of the credit note. */
|
|
1034
|
+
currency: Currency;
|
|
1035
|
+
/**
|
|
1036
|
+
* The total amount of the credit note, expressed in cents.
|
|
1037
|
+
* @example 120
|
|
1038
|
+
*/
|
|
1039
|
+
total_amount_cents: number;
|
|
1040
|
+
/**
|
|
1041
|
+
* The tax amount of the credit note, expressed in cents.
|
|
1042
|
+
* @example 20
|
|
1043
|
+
*/
|
|
1044
|
+
taxes_amount_cents: number;
|
|
1045
|
+
/**
|
|
1046
|
+
* The tax rate associated with this specific credit note.
|
|
1047
|
+
* @example 20
|
|
1048
|
+
*/
|
|
1049
|
+
taxes_rate: number;
|
|
1050
|
+
/**
|
|
1051
|
+
* The subtotal of the credit note excluding any applicable taxes, expressed in cents.
|
|
1052
|
+
* @example 100
|
|
1053
|
+
*/
|
|
1054
|
+
sub_total_excluding_taxes_amount_cents: number;
|
|
1055
|
+
/**
|
|
1056
|
+
* The remaining credit note amount, expressed in cents.
|
|
1057
|
+
* @example 100
|
|
1058
|
+
*/
|
|
1059
|
+
balance_amount_cents: number;
|
|
1060
|
+
/**
|
|
1061
|
+
* The credited amount of the credit note, expressed in cents.
|
|
1062
|
+
* @example 100
|
|
1063
|
+
*/
|
|
1064
|
+
credit_amount_cents: number;
|
|
1065
|
+
/**
|
|
1066
|
+
* The refunded amount of the credit note, expressed in cents.
|
|
1067
|
+
* @example 0
|
|
1068
|
+
*/
|
|
1069
|
+
refund_amount_cents: number;
|
|
1070
|
+
/**
|
|
1071
|
+
* The pro-rated amount of the coupons applied to the source invoice.
|
|
1072
|
+
* @example 20
|
|
1073
|
+
*/
|
|
1074
|
+
coupons_adjustement_amount_cents: number;
|
|
1075
|
+
/**
|
|
1076
|
+
* The date when the credit note was created. It is expressed in Coordinated Universal Time (UTC).
|
|
1077
|
+
* @format date-time
|
|
1078
|
+
* @example "2022-09-14T16:35:31Z"
|
|
1079
|
+
*/
|
|
1080
|
+
created_at: string;
|
|
1081
|
+
/**
|
|
1082
|
+
* The date when the credit note was last updated. It is expressed in Coordinated Universal Time (UTC).
|
|
1083
|
+
* @format date-time
|
|
1084
|
+
* @example "2022-09-14T16:35:31Z"
|
|
1085
|
+
*/
|
|
1086
|
+
updated_at: string;
|
|
1087
|
+
/**
|
|
1088
|
+
* The PDF file of the credit note.
|
|
1089
|
+
* @example "https://getlago.com/credit_note/file"
|
|
1090
|
+
*/
|
|
1091
|
+
file_url?: string | null;
|
|
1092
|
+
/** Array of credit note’s items. */
|
|
1093
|
+
items?: CreditNoteItemObject[];
|
|
1094
|
+
applied_taxes?: CreditNoteAppliedTaxObject[];
|
|
1095
|
+
}
|
|
1096
|
+
export interface CreditNotes {
|
|
1097
|
+
credit_notes: CreditNoteObject[];
|
|
1098
|
+
}
|
|
1099
|
+
export interface CreditNoteCreateInput {
|
|
1100
|
+
credit_note: {
|
|
1101
|
+
/**
|
|
1102
|
+
* The invoice unique identifier, created by Lago.
|
|
1103
|
+
* @format uuid
|
|
1104
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1105
|
+
*/
|
|
1106
|
+
invoice_id: string;
|
|
1107
|
+
/**
|
|
1108
|
+
* The reason of the credit note creation.
|
|
1109
|
+
* Possible values are `duplicated_charge`, `product_unsatisfactory`, `order_change`, `order_cancellation`, `fraudulent_charge` or `other`.
|
|
1110
|
+
* @example "duplicated_charge"
|
|
1111
|
+
*/
|
|
1112
|
+
reason?: "duplicated_charge" | "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "other" | null;
|
|
1113
|
+
/**
|
|
1114
|
+
* The description of the credit note.
|
|
1115
|
+
* @example "description"
|
|
1116
|
+
*/
|
|
1117
|
+
description?: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* The total amount to be credited on the customer balance.
|
|
1120
|
+
* @example 10
|
|
1121
|
+
*/
|
|
1122
|
+
credit_amount_cents?: number | null;
|
|
1123
|
+
/**
|
|
1124
|
+
* The total amount to be refunded to the customer.
|
|
1125
|
+
* @example 5
|
|
1126
|
+
*/
|
|
1127
|
+
refund_amount_cents?: number | null;
|
|
1128
|
+
/**
|
|
1129
|
+
* The list of credit note’s items.
|
|
1130
|
+
* @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":10},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":5}]
|
|
1131
|
+
*/
|
|
1132
|
+
items: {
|
|
1133
|
+
/**
|
|
1134
|
+
* The fee unique identifier, created by Lago.
|
|
1135
|
+
* @format uuid
|
|
1136
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1137
|
+
*/
|
|
1138
|
+
fee_id: string;
|
|
1139
|
+
/**
|
|
1140
|
+
* The amount of the credit note item, expressed in cents.
|
|
1141
|
+
* @example 10
|
|
1142
|
+
*/
|
|
1143
|
+
amount_cents: number;
|
|
1144
|
+
}[];
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
export interface CreditNoteUpdateInput {
|
|
1148
|
+
credit_note: {
|
|
1149
|
+
/**
|
|
1150
|
+
* The status of the refund portion of the credit note. It indicates the current state or condition of the refund associated with the credit note. The possible values for this field are:
|
|
1151
|
+
*
|
|
1152
|
+
* - `pending`: this status indicates that the refund is pending execution. The refund request has been initiated but has not been processed or completed yet.
|
|
1153
|
+
* - `succeeded`: this status indicates that the refund has been successfully executed. The refund amount has been processed and returned to the customer or the designated recipient.
|
|
1154
|
+
* - `failed`: this status indicates that the refund failed to execute. The refund request encountered an error or unsuccessful processing, and the refund amount could not be returned.
|
|
1155
|
+
* @example "succeeded"
|
|
1156
|
+
*/
|
|
1157
|
+
refund_status: "pending" | "succeeded" | "failed";
|
|
1158
|
+
};
|
|
1159
|
+
}
|
|
1160
|
+
/** @example "USD" */
|
|
1161
|
+
export type Currency = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SZL" | "THB" | "TJS" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW";
|
|
1162
|
+
export interface Customer {
|
|
1163
|
+
customer: CustomerObjectExtended;
|
|
1164
|
+
}
|
|
1165
|
+
/** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
|
|
1166
|
+
export interface CustomerBillingConfiguration {
|
|
1167
|
+
/**
|
|
1168
|
+
* The grace period, expressed in days, for the invoice. This period refers to the additional time granted to the customer beyond the invoice due date to adjust usage and line items
|
|
1169
|
+
* @example 3
|
|
1170
|
+
*/
|
|
1171
|
+
invoice_grace_period?: number;
|
|
1172
|
+
/**
|
|
1173
|
+
* The payment provider utilized to initiate payments for invoices issued by Lago.
|
|
1174
|
+
* Accepted values: `stripe`, `adyen`, `gocardless` or null. This field is required if you intend to assign a `provider_customer_id`.
|
|
1175
|
+
* @example "stripe"
|
|
1176
|
+
*/
|
|
1177
|
+
payment_provider?: "stripe" | "adyen" | "gocardless";
|
|
1178
|
+
/**
|
|
1179
|
+
* The customer ID within the payment provider's system. If this field is not provided, Lago has the option to create a new customer record within the payment provider's system on behalf of the customer
|
|
1180
|
+
* @example "cus_12345"
|
|
1181
|
+
*/
|
|
1182
|
+
provider_customer_id?: string;
|
|
1183
|
+
/**
|
|
1184
|
+
* Set this field to `true` if you want to create the customer in the payment provider synchronously with the customer creation process in Lago. This option is applicable only when the `provider_customer_id` is `null` and the customer is automatically created in the payment provider through Lago. By default, the value is set to `false`
|
|
1185
|
+
* @example true
|
|
1186
|
+
*/
|
|
1187
|
+
sync?: boolean;
|
|
1188
|
+
/**
|
|
1189
|
+
* Set this field to `true` if you want to create a customer record in the payment provider's system. This option is applicable only when the `provider_customer_id` is null and the `sync_with_provider` field is set to `true`. By default, the value is set to `false`
|
|
1190
|
+
* @example true
|
|
1191
|
+
*/
|
|
1192
|
+
sync_with_provider?: boolean;
|
|
1193
|
+
/**
|
|
1194
|
+
* The document locale, specified in the ISO 639-1 format. This field represents the language or locale used for the documents issued by Lago
|
|
1195
|
+
* @example "fr"
|
|
1196
|
+
*/
|
|
1197
|
+
document_locale?: string;
|
|
1198
|
+
/**
|
|
1199
|
+
* Specifies the available payment methods that can be used for this customer when `payment_provider` is set to `stripe`. The `provider_payment_methods` field is an array that allows multiple payment options to be defined. If this field is not explicitly set, all the payment methods are selected. For now, possible values are `card` and `sepa_debit`.
|
|
1200
|
+
* @example ["card","sepa_debit"]
|
|
1201
|
+
*/
|
|
1202
|
+
provider_payment_methods?: string[] | null;
|
|
1203
|
+
}
|
|
1204
|
+
export interface CustomerChargeUsageObject {
|
|
1205
|
+
/**
|
|
1206
|
+
* The number of units consumed by the customer for a specific charge item.
|
|
1207
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
1208
|
+
* @example "1.0"
|
|
1209
|
+
*/
|
|
1210
|
+
units: string;
|
|
1211
|
+
/**
|
|
1212
|
+
* The amount in cents, tax excluded, consumed by the customer for a specific charge item.
|
|
1213
|
+
* @example 123
|
|
1214
|
+
*/
|
|
1215
|
+
amount_cents: number;
|
|
1216
|
+
/** The currency of a usage item consumed by the customer. */
|
|
1217
|
+
amount_currency: Currency;
|
|
1218
|
+
/** Object listing all the properties for a specific charge item. */
|
|
1219
|
+
charge: {
|
|
1220
|
+
/**
|
|
1221
|
+
* Unique identifier assigned to the charge within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the charge’s record within the Lago system.
|
|
1222
|
+
* @format uuid
|
|
1223
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1224
|
+
*/
|
|
1225
|
+
lago_id: string;
|
|
1226
|
+
/**
|
|
1227
|
+
* The pricing model applied to this charge. Possible values are standard, `graduated`, `percentage`, `package` or `volume`.
|
|
1228
|
+
* @example "graduated"
|
|
1229
|
+
*/
|
|
1230
|
+
charge_model: "standard" | "graduated" | "package" | "percentage" | "volume";
|
|
1231
|
+
};
|
|
1232
|
+
/** The related billable metric object. */
|
|
1233
|
+
billable_metric: {
|
|
1234
|
+
/**
|
|
1235
|
+
* Unique identifier assigned to the billable metric within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the billable metric’s record within the Lago system.
|
|
1236
|
+
* @format uuid
|
|
1237
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1238
|
+
*/
|
|
1239
|
+
lago_id: string;
|
|
1240
|
+
/**
|
|
1241
|
+
* The name of the billable metric used for this charge.
|
|
1242
|
+
* @example "Storage"
|
|
1243
|
+
*/
|
|
1244
|
+
name: string;
|
|
1245
|
+
/**
|
|
1246
|
+
* The code of the billable metric used for this charge.
|
|
1247
|
+
* @example "storage"
|
|
1248
|
+
*/
|
|
1249
|
+
code: string;
|
|
1250
|
+
/**
|
|
1251
|
+
* The aggregation type of the billable metric used for this charge. Possible values are `count_agg`, `sum_agg`, `max_agg` or `unique_count_agg`.
|
|
1252
|
+
* @example "sum_agg"
|
|
1253
|
+
*/
|
|
1254
|
+
aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg";
|
|
1255
|
+
};
|
|
1256
|
+
/** Array of group object, representing multiple dimensions for a charge item. */
|
|
1257
|
+
groups: {
|
|
1258
|
+
/**
|
|
1259
|
+
* Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system.
|
|
1260
|
+
* @format uuid
|
|
1261
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1262
|
+
*/
|
|
1263
|
+
lago_id?: string;
|
|
1264
|
+
/**
|
|
1265
|
+
* The group key, only returned for groups with two dimensions.
|
|
1266
|
+
* @example null
|
|
1267
|
+
*/
|
|
1268
|
+
key?: string | null;
|
|
1269
|
+
/**
|
|
1270
|
+
* The group value.
|
|
1271
|
+
* @example "europe"
|
|
1272
|
+
*/
|
|
1273
|
+
value?: string;
|
|
1274
|
+
/**
|
|
1275
|
+
* The number of units consumed for a specific group related to a charge item.
|
|
1276
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
1277
|
+
* @example "0.9"
|
|
1278
|
+
*/
|
|
1279
|
+
units?: string;
|
|
1280
|
+
/**
|
|
1281
|
+
* The amount in cents, tax excluded, consumed for a specific group related to a charge item.
|
|
1282
|
+
* @example 1000
|
|
1283
|
+
*/
|
|
1284
|
+
amount_cents?: number;
|
|
1285
|
+
}[];
|
|
1286
|
+
}
|
|
1287
|
+
export interface CustomerCreateInput {
|
|
1288
|
+
customer: {
|
|
1289
|
+
/**
|
|
1290
|
+
* The customer external unique identifier (provided by your own application)
|
|
1291
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
1292
|
+
*/
|
|
1293
|
+
external_id: string;
|
|
1294
|
+
/**
|
|
1295
|
+
* The first line of the billing address
|
|
1296
|
+
* @example "5230 Penfield Ave"
|
|
1297
|
+
*/
|
|
1298
|
+
address_line1?: string | null;
|
|
1299
|
+
/**
|
|
1300
|
+
* The second line of the billing address
|
|
1301
|
+
* @example ""
|
|
1302
|
+
*/
|
|
1303
|
+
address_line2?: string | null;
|
|
1304
|
+
/**
|
|
1305
|
+
* The city of the customer's billing address
|
|
1306
|
+
* @example "Woodland Hills"
|
|
1307
|
+
*/
|
|
1308
|
+
city?: string | null;
|
|
1309
|
+
/** Country code of the customer's billing address. Format must be ISO 3166 (alpha-2) */
|
|
1310
|
+
country?: Country;
|
|
1311
|
+
/** Currency of the customer. Format must be ISO 4217 */
|
|
1312
|
+
currency?: Currency;
|
|
1313
|
+
/**
|
|
1314
|
+
* The email of the customer
|
|
1315
|
+
* @format email
|
|
1316
|
+
* @example "dinesh@piedpiper.test"
|
|
1317
|
+
*/
|
|
1318
|
+
email?: string | null;
|
|
1319
|
+
/**
|
|
1320
|
+
* The legal company name of the customer
|
|
1321
|
+
* @example "Coleman-Blair"
|
|
1322
|
+
*/
|
|
1323
|
+
legal_name?: string | null;
|
|
1324
|
+
/**
|
|
1325
|
+
* The legal company number of the customer
|
|
1326
|
+
* @example "49-008-2965"
|
|
1327
|
+
*/
|
|
1328
|
+
legal_number?: string | null;
|
|
1329
|
+
/**
|
|
1330
|
+
* The logo URL of the customer
|
|
1331
|
+
* @example "http://hooli.com/logo.png"
|
|
1332
|
+
*/
|
|
1333
|
+
logo_url?: string | null;
|
|
1334
|
+
/**
|
|
1335
|
+
* The full name of the customer
|
|
1336
|
+
* @example "Gavin Belson"
|
|
1337
|
+
*/
|
|
1338
|
+
name?: string | null;
|
|
1339
|
+
/**
|
|
1340
|
+
* The phone number of the customer
|
|
1341
|
+
* @example "1-171-883-3711 x245"
|
|
1342
|
+
*/
|
|
1343
|
+
phone?: string | null;
|
|
1344
|
+
/**
|
|
1345
|
+
* The state of the customer's billing address
|
|
1346
|
+
* @example "CA"
|
|
1347
|
+
*/
|
|
1348
|
+
state?: string | null;
|
|
1349
|
+
/**
|
|
1350
|
+
* List of unique code used to identify the taxes.
|
|
1351
|
+
* @example ["french_standard_vat"]
|
|
1352
|
+
*/
|
|
1353
|
+
tax_codes?: string[];
|
|
1354
|
+
/**
|
|
1355
|
+
* The tax identification number of the customer
|
|
1356
|
+
* @example "EU123456789"
|
|
1357
|
+
*/
|
|
1358
|
+
tax_identification_number?: string | null;
|
|
1359
|
+
/** The customer's timezone, used for billing purposes in their local time. Overrides the organization's timezone */
|
|
1360
|
+
timezone?: Timezone;
|
|
1361
|
+
/**
|
|
1362
|
+
* The custom website URL of the customer
|
|
1363
|
+
* @example "http://hooli.com"
|
|
1364
|
+
*/
|
|
1365
|
+
url?: string | null;
|
|
1366
|
+
/**
|
|
1367
|
+
* The zipcode of the customer's billing address
|
|
1368
|
+
* @example "91364"
|
|
1369
|
+
*/
|
|
1370
|
+
zipcode?: string | null;
|
|
1371
|
+
/**
|
|
1372
|
+
* The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
|
|
1373
|
+
* @example 30
|
|
1374
|
+
*/
|
|
1375
|
+
net_payment_term?: number | null;
|
|
1376
|
+
/** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
|
|
1377
|
+
billing_configuration?: CustomerBillingConfiguration;
|
|
1378
|
+
/** Set of key-value pairs that you can attach to a customer. This can be useful for storing additional information about the customer in a structured format */
|
|
1379
|
+
metadata?: {
|
|
1380
|
+
/**
|
|
1381
|
+
* Identifier for the metadata object, only required when updating a key-value pair
|
|
1382
|
+
* @format uuid
|
|
1383
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1384
|
+
*/
|
|
1385
|
+
id?: string;
|
|
1386
|
+
/**
|
|
1387
|
+
* The metadata object key
|
|
1388
|
+
* @example "Purchase Order"
|
|
1389
|
+
*/
|
|
1390
|
+
key: string;
|
|
1391
|
+
/**
|
|
1392
|
+
* The metadata object value
|
|
1393
|
+
* @example "123456789"
|
|
1394
|
+
*/
|
|
1395
|
+
value: string;
|
|
1396
|
+
/**
|
|
1397
|
+
* Determines whether the item or information should be displayed in the invoice. If set to true, the item or information will be included and visible in the generated invoice. If set to false, the item or information will be excluded and not displayed in the invoice.
|
|
1398
|
+
* @example true
|
|
1399
|
+
*/
|
|
1400
|
+
display_in_invoice: boolean;
|
|
1401
|
+
}[];
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
/** Set of key-value pairs that you can attach to a customer. This can be useful for storing additional information about the customer in a structured format */
|
|
1405
|
+
export interface CustomerMetadata {
|
|
1406
|
+
/**
|
|
1407
|
+
* A unique identifier for the customer metadata object in the Lago application. Can be used to update a key-value pair
|
|
1408
|
+
* @format uuid
|
|
1409
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1410
|
+
*/
|
|
1411
|
+
lago_id: string;
|
|
1412
|
+
/**
|
|
1413
|
+
* The metadata object key
|
|
1414
|
+
* @example "Purchase Order"
|
|
1415
|
+
*/
|
|
1416
|
+
key: string;
|
|
1417
|
+
/**
|
|
1418
|
+
* The metadata object value
|
|
1419
|
+
* @example "123456789"
|
|
1420
|
+
*/
|
|
1421
|
+
value: string;
|
|
1422
|
+
/**
|
|
1423
|
+
* Determines whether the item or information should be displayed in the invoice. If set to true, the item or information will be included and visible in the generated invoice. If set to false, the item or information will be excluded and not displayed in the invoice.
|
|
1424
|
+
* @example true
|
|
1425
|
+
*/
|
|
1426
|
+
display_in_invoice: boolean;
|
|
1427
|
+
/**
|
|
1428
|
+
* The date of the metadata object creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the metadata object was created
|
|
1429
|
+
* @format date-time
|
|
1430
|
+
* @example "2022-04-29T08:59:51Z"
|
|
1431
|
+
*/
|
|
1432
|
+
created_at: string;
|
|
1433
|
+
}
|
|
1434
|
+
export interface CustomerObject {
|
|
1435
|
+
/**
|
|
1436
|
+
* Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
|
|
1437
|
+
* @format uuid
|
|
1438
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1439
|
+
*/
|
|
1440
|
+
lago_id: string;
|
|
1441
|
+
/**
|
|
1442
|
+
* The unique identifier assigned to the customer within the organization's scope. This identifier is used to track and reference the customer's order of creation within the organization's system. It ensures that each customer has a distinct `sequential_id`` associated with them, allowing for easy identification and sorting based on the order of creation
|
|
1443
|
+
* @example 1
|
|
1444
|
+
*/
|
|
1445
|
+
sequential_id: number;
|
|
1446
|
+
/**
|
|
1447
|
+
* A concise and unique identifier for the customer, formed by combining the Organization's `name`, `id`, and customer's `sequential_id`
|
|
1448
|
+
* @example "LAG-1234-001"
|
|
1449
|
+
*/
|
|
1450
|
+
slug: string;
|
|
1451
|
+
/**
|
|
1452
|
+
* The customer external unique identifier (provided by your own application)
|
|
1453
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
1454
|
+
*/
|
|
1455
|
+
external_id: string;
|
|
1456
|
+
/**
|
|
1457
|
+
* The first line of the billing address
|
|
1458
|
+
* @example "5230 Penfield Ave"
|
|
1459
|
+
*/
|
|
1460
|
+
address_line1?: string | null;
|
|
1461
|
+
/**
|
|
1462
|
+
* The second line of the billing address
|
|
1463
|
+
* @example null
|
|
1464
|
+
*/
|
|
1465
|
+
address_line2?: string | null;
|
|
1466
|
+
/** The customer's applicable timezone, used for billing purposes in their local time. */
|
|
1467
|
+
applicable_timezone: Timezone;
|
|
1468
|
+
/**
|
|
1469
|
+
* The city of the customer's billing address
|
|
1470
|
+
* @example "Woodland Hills"
|
|
1471
|
+
*/
|
|
1472
|
+
city?: string | null;
|
|
1473
|
+
/** Country code of the customer's billing address. Format must be ISO 3166 (alpha-2) */
|
|
1474
|
+
country?: Country;
|
|
1475
|
+
/** Currency of the customer. Format must be ISO 4217 */
|
|
1476
|
+
currency?: Currency;
|
|
1477
|
+
/**
|
|
1478
|
+
* The email of the customer
|
|
1479
|
+
* @format email
|
|
1480
|
+
* @example "dinesh@piedpiper.test"
|
|
1481
|
+
*/
|
|
1482
|
+
email?: string | null;
|
|
1483
|
+
/**
|
|
1484
|
+
* The legal company name of the customer
|
|
1485
|
+
* @example "Coleman-Blair"
|
|
1486
|
+
*/
|
|
1487
|
+
legal_name?: string | null;
|
|
1488
|
+
/**
|
|
1489
|
+
* The legal company number of the customer
|
|
1490
|
+
* @example "49-008-2965"
|
|
1491
|
+
*/
|
|
1492
|
+
legal_number?: string | null;
|
|
1493
|
+
/**
|
|
1494
|
+
* The logo URL of the customer
|
|
1495
|
+
* @example "http://hooli.com/logo.png"
|
|
1496
|
+
*/
|
|
1497
|
+
logo_url?: string | null;
|
|
1498
|
+
/**
|
|
1499
|
+
* The full name of the customer
|
|
1500
|
+
* @example "Gavin Belson"
|
|
1501
|
+
*/
|
|
1502
|
+
name?: string | null;
|
|
1503
|
+
/**
|
|
1504
|
+
* The phone number of the customer
|
|
1505
|
+
* @example "1-171-883-3711 x245"
|
|
1506
|
+
*/
|
|
1507
|
+
phone?: string | null;
|
|
1508
|
+
/**
|
|
1509
|
+
* The state of the customer's billing address
|
|
1510
|
+
* @example "CA"
|
|
1511
|
+
*/
|
|
1512
|
+
state?: string | null;
|
|
1513
|
+
/**
|
|
1514
|
+
* The tax identification number of the customer
|
|
1515
|
+
* @example "EU123456789"
|
|
1516
|
+
*/
|
|
1517
|
+
tax_identification_number?: string | null;
|
|
1518
|
+
/** The customer's timezone, used for billing purposes in their local time. Overrides the organization's timezone */
|
|
1519
|
+
timezone?: Timezone;
|
|
1520
|
+
/**
|
|
1521
|
+
* The custom website URL of the customer
|
|
1522
|
+
* @example "http://hooli.com"
|
|
1523
|
+
*/
|
|
1524
|
+
url?: string | null;
|
|
1525
|
+
/**
|
|
1526
|
+
* The zipcode of the customer's billing address
|
|
1527
|
+
* @example "91364"
|
|
1528
|
+
*/
|
|
1529
|
+
zipcode?: string | null;
|
|
1530
|
+
/**
|
|
1531
|
+
* The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
|
|
1532
|
+
* @example 30
|
|
1533
|
+
*/
|
|
1534
|
+
net_payment_term?: number | null;
|
|
1535
|
+
/**
|
|
1536
|
+
* The date of the customer creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the customer object was created
|
|
1537
|
+
* @format date-time
|
|
1538
|
+
* @example "2022-04-29T08:59:51Z"
|
|
1539
|
+
*/
|
|
1540
|
+
created_at: string;
|
|
1541
|
+
/**
|
|
1542
|
+
* The date of the customer update, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The update_date provides a standardized and internationally recognized timestamp for when the customer object was updated
|
|
1543
|
+
* @format date-time
|
|
1544
|
+
* @example "2022-04-29T08:59:51Z"
|
|
1545
|
+
*/
|
|
1546
|
+
updated_at?: string;
|
|
1547
|
+
/** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
|
|
1548
|
+
billing_configuration?: CustomerBillingConfiguration;
|
|
1549
|
+
metadata?: CustomerMetadata[];
|
|
1550
|
+
}
|
|
1551
|
+
export type CustomerObjectExtended = CustomerObject & {
|
|
1552
|
+
metadata?: CustomerMetadata[];
|
|
1553
|
+
/** List of customer taxes */
|
|
1554
|
+
taxes?: TaxObject[];
|
|
1555
|
+
};
|
|
1556
|
+
export interface CustomersPaginated {
|
|
1557
|
+
customers: CustomerObjectExtended[];
|
|
1558
|
+
meta: PaginationMeta;
|
|
1559
|
+
}
|
|
1560
|
+
export interface CustomerUsage {
|
|
1561
|
+
customer_usage: CustomerUsageObject;
|
|
1562
|
+
}
|
|
1563
|
+
export interface CustomerUsageObject {
|
|
1564
|
+
/**
|
|
1565
|
+
* The lower bound of the billing period, expressed in the ISO 8601 datetime format in Coordinated Universal Time (UTC).
|
|
1566
|
+
* @format date-time
|
|
1567
|
+
* @example "2022-07-01T00:00:00Z"
|
|
1568
|
+
*/
|
|
1569
|
+
from_datetime: string;
|
|
1570
|
+
/**
|
|
1571
|
+
* The upper bound of the billing period, expressed in the ISO 8601 datetime format in Coordinated Universal Time (UTC).
|
|
1572
|
+
* @format date-time
|
|
1573
|
+
* @example "2022-07-31T23:59:59Z"
|
|
1574
|
+
*/
|
|
1575
|
+
to_datetime: string;
|
|
1576
|
+
/**
|
|
1577
|
+
* The date of creation of the invoice.
|
|
1578
|
+
* @format date-time
|
|
1579
|
+
* @example "2022-08-01T23:59:59Z"
|
|
1580
|
+
*/
|
|
1581
|
+
issuing_date: string;
|
|
1582
|
+
/** The currency of the customer’s current usage. */
|
|
1583
|
+
currency?: Currency;
|
|
1584
|
+
/**
|
|
1585
|
+
* The amount in cents, tax excluded.
|
|
1586
|
+
* @example 123
|
|
1587
|
+
*/
|
|
1588
|
+
amount_cents: number;
|
|
1589
|
+
/**
|
|
1590
|
+
* The tax amount in cents.
|
|
1591
|
+
* @example 200
|
|
1592
|
+
*/
|
|
1593
|
+
taxes_amount_cents: number;
|
|
1594
|
+
/**
|
|
1595
|
+
* The total amount in cents, tax included.
|
|
1596
|
+
* @example 123
|
|
1597
|
+
*/
|
|
1598
|
+
total_amount_cents: number;
|
|
1599
|
+
/** Array of charges that comprise the current usage. It contains detailed information about individual charge items associated with the usage. */
|
|
1600
|
+
charges_usage: CustomerChargeUsageObject[];
|
|
1601
|
+
}
|
|
1602
|
+
export interface Event {
|
|
1603
|
+
event: EventObject;
|
|
1604
|
+
}
|
|
1605
|
+
export interface EventBatchInput {
|
|
1606
|
+
event: {
|
|
1607
|
+
/**
|
|
1608
|
+
* This field represents a unique identifier for the event. It is crucial for ensuring idempotency, meaning that each event can be uniquely identified and processed without causing any unintended side effects.
|
|
1609
|
+
* @example "transaction_1234567890"
|
|
1610
|
+
*/
|
|
1611
|
+
transaction_id: string;
|
|
1612
|
+
/**
|
|
1613
|
+
* The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_ids`, targeting a specific subscription.
|
|
1614
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
1615
|
+
*/
|
|
1616
|
+
external_customer_id?: string;
|
|
1617
|
+
/**
|
|
1618
|
+
* Array of unique identifiers of the targeted subscriptions within your application.
|
|
1619
|
+
* @example ["sub_1234567890","sub_0987654321"]
|
|
1620
|
+
*/
|
|
1621
|
+
external_subscription_ids: string[];
|
|
1622
|
+
/**
|
|
1623
|
+
* The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
|
|
1624
|
+
* @example "storage"
|
|
1625
|
+
*/
|
|
1626
|
+
code: string;
|
|
1627
|
+
/**
|
|
1628
|
+
* This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception.
|
|
1629
|
+
* @example 1651240791
|
|
1630
|
+
*/
|
|
1631
|
+
timestamp?: number;
|
|
1632
|
+
/**
|
|
1633
|
+
* This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required.
|
|
1634
|
+
* @example {"gb":10}
|
|
1635
|
+
*/
|
|
1636
|
+
properties?: {
|
|
1637
|
+
/** The `operation_type` field is only necessary when adding or removing a specific unit when the targeted billable metric adopts a `unique_count_agg` aggregation method. In other cases, the `operation_type` field is not required. The valid values for the `operation_type` field are `add` or `remove`, which indicate whether the unit is being added or removed from the unique count aggregation, respectively. */
|
|
1638
|
+
operation_type?: "add" | "remove";
|
|
1639
|
+
[key: string]: any;
|
|
1640
|
+
};
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
export interface EventEstimateFeesInput {
|
|
1644
|
+
event: {
|
|
1645
|
+
/**
|
|
1646
|
+
* The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
|
|
1647
|
+
* @example "storage"
|
|
1648
|
+
*/
|
|
1649
|
+
code: string;
|
|
1650
|
+
/**
|
|
1651
|
+
* The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
|
|
1652
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
1653
|
+
*/
|
|
1654
|
+
external_customer_id?: string;
|
|
1655
|
+
/**
|
|
1656
|
+
* The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided.
|
|
1657
|
+
* @example "sub_1234567890"
|
|
1658
|
+
*/
|
|
1659
|
+
external_subscription_id?: string;
|
|
1660
|
+
/** This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. */
|
|
1661
|
+
properties?: object;
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
export interface EventInput {
|
|
1665
|
+
event: {
|
|
1666
|
+
/**
|
|
1667
|
+
* This field represents a unique identifier for the event. It is crucial for ensuring idempotency, meaning that each event can be uniquely identified and processed without causing any unintended side effects.
|
|
1668
|
+
* @example "transaction_1234567890"
|
|
1669
|
+
*/
|
|
1670
|
+
transaction_id: string;
|
|
1671
|
+
/**
|
|
1672
|
+
* The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
|
|
1673
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
1674
|
+
*/
|
|
1675
|
+
external_customer_id?: string;
|
|
1676
|
+
/**
|
|
1677
|
+
* The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided.
|
|
1678
|
+
* @example "sub_1234567890"
|
|
1679
|
+
*/
|
|
1680
|
+
external_subscription_id?: string;
|
|
1681
|
+
/**
|
|
1682
|
+
* The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
|
|
1683
|
+
* @example "storage"
|
|
1684
|
+
*/
|
|
1685
|
+
code: string;
|
|
1686
|
+
/**
|
|
1687
|
+
* This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC).
|
|
1688
|
+
* If this timestamp is not provided, the API will automatically set it to the time of event reception.
|
|
1689
|
+
* You can also provide miliseconds precision by appending decimals to the timestamp.
|
|
1690
|
+
* @example "1651240791.123"
|
|
1691
|
+
*/
|
|
1692
|
+
timestamp?: number | string;
|
|
1693
|
+
/**
|
|
1694
|
+
* This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required.
|
|
1695
|
+
* @example {"gb":10}
|
|
1696
|
+
*/
|
|
1697
|
+
properties?: Record<string, string>;
|
|
1698
|
+
};
|
|
1699
|
+
}
|
|
1700
|
+
export interface EventObject {
|
|
1701
|
+
/**
|
|
1702
|
+
* Unique identifier assigned to the event within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the event's record within the Lago system
|
|
1703
|
+
* @format uuid
|
|
1704
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1705
|
+
*/
|
|
1706
|
+
lago_id: string;
|
|
1707
|
+
/**
|
|
1708
|
+
* This field represents a unique identifier for the event. It is crucial for ensuring idempotency, meaning that each event can be uniquely identified and processed without causing any unintended side effects.
|
|
1709
|
+
* @example "transaction_1234567890"
|
|
1710
|
+
*/
|
|
1711
|
+
transaction_id: string;
|
|
1712
|
+
/**
|
|
1713
|
+
* Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
|
|
1714
|
+
* @format uuid
|
|
1715
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1716
|
+
*/
|
|
1717
|
+
lago_customer_id: string;
|
|
1718
|
+
/**
|
|
1719
|
+
* The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
|
|
1720
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
1721
|
+
*/
|
|
1722
|
+
external_customer_id: string;
|
|
1723
|
+
/**
|
|
1724
|
+
* The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
|
|
1725
|
+
* @example "storage"
|
|
1726
|
+
*/
|
|
1727
|
+
code: string;
|
|
1728
|
+
/**
|
|
1729
|
+
* This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception.
|
|
1730
|
+
* @format date-time
|
|
1731
|
+
* @example "2022-04-29T08:59:51.123Z"
|
|
1732
|
+
*/
|
|
1733
|
+
timestamp: string;
|
|
1734
|
+
/**
|
|
1735
|
+
* This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required.
|
|
1736
|
+
* @example {"gb":10}
|
|
1737
|
+
*/
|
|
1738
|
+
properties?: {
|
|
1739
|
+
/** The `operation_type` field is only necessary when adding or removing a specific unit when the targeted billable metric adopts a `unique_count_agg` aggregation method. In other cases, the `operation_type` field is not required. The valid values for the `operation_type` field are `add` or `remove`, which indicate whether the unit is being added or removed from the unique count aggregation, respectively. */
|
|
1740
|
+
operation_type?: "add" | "remove";
|
|
1741
|
+
[key: string]: any;
|
|
1742
|
+
};
|
|
1743
|
+
/**
|
|
1744
|
+
* Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s record within the Lago system
|
|
1745
|
+
* @format uuid
|
|
1746
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1747
|
+
*/
|
|
1748
|
+
lago_subscription_id: string;
|
|
1749
|
+
/**
|
|
1750
|
+
* The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided.
|
|
1751
|
+
* @example "sub_1234567890"
|
|
1752
|
+
*/
|
|
1753
|
+
external_subscription_id: string;
|
|
1754
|
+
/**
|
|
1755
|
+
* The creation date of the event's record in the Lago application, presented in the ISO 8601 datetime format, specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record was created within the Lago application
|
|
1756
|
+
* @format date-time
|
|
1757
|
+
* @example "2022-04-29T08:59:51Z"
|
|
1758
|
+
*/
|
|
1759
|
+
created_at: string;
|
|
1760
|
+
}
|
|
1761
|
+
export interface Fee {
|
|
1762
|
+
fee: FeeObject;
|
|
1763
|
+
}
|
|
1764
|
+
export type FeeAppliedTaxObject = BaseAppliedTax & {
|
|
1765
|
+
/**
|
|
1766
|
+
* Unique identifier of the fee, created by Lago.
|
|
1767
|
+
* @format uuid
|
|
1768
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1769
|
+
*/
|
|
1770
|
+
lago_fee_id?: string;
|
|
1771
|
+
};
|
|
1772
|
+
export interface FeeObject {
|
|
1773
|
+
/**
|
|
1774
|
+
* Unique identifier assigned to the fee within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the fee’s record within the Lago system.
|
|
1775
|
+
* @format uuid
|
|
1776
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1777
|
+
*/
|
|
1778
|
+
lago_id?: string | null;
|
|
1779
|
+
/**
|
|
1780
|
+
* Unique identifier assigned to the group that the fee belongs to
|
|
1781
|
+
* @format uuid
|
|
1782
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1783
|
+
*/
|
|
1784
|
+
lago_group_id?: string | null;
|
|
1785
|
+
/**
|
|
1786
|
+
* Unique identifier assigned to the invoice that the fee belongs to
|
|
1787
|
+
* @format uuid
|
|
1788
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1789
|
+
*/
|
|
1790
|
+
lago_invoice_id?: string | null;
|
|
1791
|
+
/**
|
|
1792
|
+
* Unique identifier assigned to the true-up fee when a minimum has been set to the charge. This identifier helps to distinguish and manage the true-up fee associated with the charge, which may be applicable when a minimum threshold or limit is set for the charge amount.
|
|
1793
|
+
* @format uuid
|
|
1794
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1795
|
+
*/
|
|
1796
|
+
lago_true_up_fee_id?: string | null;
|
|
1797
|
+
/**
|
|
1798
|
+
* Unique identifier assigned to the parent fee on which the true-up fee is assigned. This identifier establishes the relationship between the parent fee and the associated true-up fee.
|
|
1799
|
+
* @format uuid
|
|
1800
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1801
|
+
*/
|
|
1802
|
+
lago_true_up_parent_fee_id?: string | null;
|
|
1803
|
+
/**
|
|
1804
|
+
* Unique identifier assigned to the subscription, created by Lago. This field is specifically displayed when the fee type is charge and the payment for the fee is made in advance (`pay_in_advance` is set to true).
|
|
1805
|
+
* @format uuid
|
|
1806
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1807
|
+
*/
|
|
1808
|
+
lago_subscription_id?: string | null;
|
|
1809
|
+
/**
|
|
1810
|
+
* Unique identifier assigned to the customer, created by Lago. This field is specifically displayed when the fee type is charge and the payment for the fee is made in advance (`pay_in_advance` is set to true).
|
|
1811
|
+
* @format uuid
|
|
1812
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1813
|
+
*/
|
|
1814
|
+
lago_customer_id?: string | null;
|
|
1815
|
+
/**
|
|
1816
|
+
* Unique identifier assigned to the customer in your application. This field is specifically displayed when the fee type is charge and the payment for the fee is made in advance (`pay_in_advance` is set to true).
|
|
1817
|
+
* @example "external_id"
|
|
1818
|
+
*/
|
|
1819
|
+
external_customer_id?: string | null;
|
|
1820
|
+
/**
|
|
1821
|
+
* Unique identifier assigned to the subscription in your application. This field is specifically displayed when the fee type is charge and the payment for the fee is made in advance (`pay_in_advance` is set to true).
|
|
1822
|
+
* @example "external_id"
|
|
1823
|
+
*/
|
|
1824
|
+
external_subscription_id?: string | null;
|
|
1825
|
+
/**
|
|
1826
|
+
* The cost of this specific fee, excluding any applicable taxes.
|
|
1827
|
+
* @example 100
|
|
1828
|
+
*/
|
|
1829
|
+
amount_cents: number;
|
|
1830
|
+
/** The currency of this specific fee. It indicates the monetary unit in which the fee’s cost is expressed. */
|
|
1831
|
+
amount_currency: Currency;
|
|
1832
|
+
/**
|
|
1833
|
+
* The cost of the tax associated with this specific fee.
|
|
1834
|
+
* @example 20
|
|
1835
|
+
*/
|
|
1836
|
+
taxes_amount_cents: number;
|
|
1837
|
+
/**
|
|
1838
|
+
* The tax rate associated with this specific fee.
|
|
1839
|
+
* @example 20
|
|
1840
|
+
*/
|
|
1841
|
+
taxes_rate: number;
|
|
1842
|
+
/**
|
|
1843
|
+
* The number of units used to charge the customer. This field indicates the quantity or count of units consumed or utilized in the context of the charge. It helps in determining the basis for calculating the fee or cost associated with the usage of the service or product provided to the customer.
|
|
1844
|
+
* @example "0.32"
|
|
1845
|
+
*/
|
|
1846
|
+
units: string;
|
|
1847
|
+
/**
|
|
1848
|
+
* The cost of this specific fee, including any applicable taxes.
|
|
1849
|
+
* @example 120
|
|
1850
|
+
*/
|
|
1851
|
+
total_amount_cents: number;
|
|
1852
|
+
/** The currency of this specific fee, including any applicable taxes. */
|
|
1853
|
+
total_amount_currency: Currency;
|
|
1854
|
+
/**
|
|
1855
|
+
* The number of events that have been sent and used to charge the customer. This field indicates the count or quantity of events that have been processed and considered in the charging process.
|
|
1856
|
+
* @example 23
|
|
1857
|
+
*/
|
|
1858
|
+
events_count?: number;
|
|
1859
|
+
/**
|
|
1860
|
+
* Flag that indicates whether the fee was paid in advance. It serves as a boolean value, where `true` represents that the fee was paid in advance (straightaway), and `false` indicates that the fee was not paid in arrears (at the end of the period).
|
|
1861
|
+
* @example true
|
|
1862
|
+
*/
|
|
1863
|
+
pay_in_advance: boolean;
|
|
1864
|
+
/**
|
|
1865
|
+
* Flag that indicates whether the fee was included on the invoice. It serves as a boolean value, where `true` represents that the fee was included on the invoice, and `false` indicates that the fee was not included on the invoice.
|
|
1866
|
+
* @example true
|
|
1867
|
+
*/
|
|
1868
|
+
invoiceable: boolean;
|
|
1869
|
+
/**
|
|
1870
|
+
* The beginning date of the period that the fee covers. It is applicable only to `subscription` and `charge` fees. This field indicates the start date of the billing period or subscription period associated with the fee.
|
|
1871
|
+
* @format date-time
|
|
1872
|
+
* @example "2022-04-29T08:59:51Z"
|
|
1873
|
+
*/
|
|
1874
|
+
from_date?: string | null;
|
|
1875
|
+
/**
|
|
1876
|
+
* The ending date of the period that the fee covers. It is applicable only to `subscription` and `charge` fees. This field indicates the end date of the billing period or subscription period associated with the fee.
|
|
1877
|
+
* @format date-time
|
|
1878
|
+
* @example "2022-05-29T08:59:51Z"
|
|
1879
|
+
*/
|
|
1880
|
+
to_date?: string | null;
|
|
1881
|
+
/**
|
|
1882
|
+
* Indicates the payment status of the fee. It represents the current status of the payment associated with the fee. The possible values for this field are `pending`, `succeeded`, `failed` and `refunded`.
|
|
1883
|
+
* @example "pending"
|
|
1884
|
+
*/
|
|
1885
|
+
payment_status: "pending" | "succeeded" | "failed" | "refunded";
|
|
1886
|
+
/**
|
|
1887
|
+
* The date and time when the fee was created. It is provided in Coordinated Universal Time (UTC) format.
|
|
1888
|
+
* @format date-time
|
|
1889
|
+
* @example "2022-08-24T14:58:59Z"
|
|
1890
|
+
*/
|
|
1891
|
+
created_at?: string | null;
|
|
1892
|
+
/**
|
|
1893
|
+
* The date and time when the payment for the fee was successfully processed. It is provided in Coordinated Universal Time (UTC) format.
|
|
1894
|
+
* @format date-time
|
|
1895
|
+
* @example "2022-08-24T14:58:59Z"
|
|
1896
|
+
*/
|
|
1897
|
+
succeeded_at?: string | null;
|
|
1898
|
+
/**
|
|
1899
|
+
* The date and time when the payment for the fee failed to process. It is provided in Coordinated Universal Time (UTC) format.
|
|
1900
|
+
* @format date-time
|
|
1901
|
+
* @example "2022-08-24T14:58:59Z"
|
|
1902
|
+
*/
|
|
1903
|
+
failed_at?: string | null;
|
|
1904
|
+
/**
|
|
1905
|
+
* The date and time when the payment for the fee was refunded. It is provided in Coordinated Universal Time (UTC) format
|
|
1906
|
+
* @format date-time
|
|
1907
|
+
* @example "2022-08-24T14:58:59Z"
|
|
1908
|
+
*/
|
|
1909
|
+
refunded_at?: string | null;
|
|
1910
|
+
/**
|
|
1911
|
+
* Unique identifier assigned to the transaction. This field is specifically displayed when the fee type is `charge` and the payment for the fee is made in advance (`pay_in_advance` is set to `true`).
|
|
1912
|
+
* @example "transaction_1234567890"
|
|
1913
|
+
*/
|
|
1914
|
+
event_transaction_id?: string | null;
|
|
1915
|
+
/** Item attached to the fee */
|
|
1916
|
+
item: {
|
|
1917
|
+
/**
|
|
1918
|
+
* The fee type. Possible values are `add-on`, `charge`, `credit` or `subscription`.
|
|
1919
|
+
* @example "subscription"
|
|
1920
|
+
*/
|
|
1921
|
+
type: "charge" | "add_on" | "subscription" | "credit";
|
|
1922
|
+
/**
|
|
1923
|
+
* The code of the fee item. It can be the code of the `add-o`n, the code of the `charge`, the code of the `credit` or the code of the `subscription`.
|
|
1924
|
+
* @example "startup"
|
|
1925
|
+
*/
|
|
1926
|
+
code: string;
|
|
1927
|
+
/**
|
|
1928
|
+
* The name of the fee item. It can be the name of the `add-on`, the name of the `charge`, the name of the `credit` or the name of the `subscription`.
|
|
1929
|
+
* @example "Startup"
|
|
1930
|
+
*/
|
|
1931
|
+
name: string;
|
|
1932
|
+
/**
|
|
1933
|
+
* Unique identifier of the fee item, created by Lago. It can be the identifier of the `add-on`, the identifier of the `charge`, the identifier of the `credit` or the identifier of the `subscription`.
|
|
1934
|
+
* @format uuid
|
|
1935
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1936
|
+
*/
|
|
1937
|
+
lago_item_id: string;
|
|
1938
|
+
/**
|
|
1939
|
+
* The type of the fee item. Possible values are `AddOn`, `BillableMetric`, `WalletTransaction` or `Subscription`.
|
|
1940
|
+
* @example "Subscription"
|
|
1941
|
+
*/
|
|
1942
|
+
item_type: "AddOn" | "BillableMetric" | "Subscription" | "WalletTransaction";
|
|
1943
|
+
};
|
|
1944
|
+
/** List of fee applied taxes */
|
|
1945
|
+
applied_taxes?: FeeAppliedTaxObject[];
|
|
1946
|
+
}
|
|
1947
|
+
export interface Fees {
|
|
1948
|
+
fees: FeeObject[];
|
|
1949
|
+
}
|
|
1950
|
+
export type FeesPaginated = Fees & {
|
|
1951
|
+
meta: PaginationMeta;
|
|
1952
|
+
};
|
|
1953
|
+
export interface FeeUpdateInput {
|
|
1954
|
+
fee: {
|
|
1955
|
+
/**
|
|
1956
|
+
* The payment status of the fee. Possible values are `pending`, `succeeded`, `failed` or `refunded`.
|
|
1957
|
+
* @example "succeeded"
|
|
1958
|
+
*/
|
|
1959
|
+
payment_status: "pending" | "succeeded" | "failed" | "refunded";
|
|
1960
|
+
};
|
|
1961
|
+
}
|
|
1962
|
+
export interface GroupObject {
|
|
1963
|
+
/**
|
|
1964
|
+
* Unique identifier of a specific group associated with the billable metric.
|
|
1965
|
+
* @format uuid
|
|
1966
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1967
|
+
*/
|
|
1968
|
+
lago_id: string;
|
|
1969
|
+
/**
|
|
1970
|
+
* Key of a specific group associated with the billable metric.
|
|
1971
|
+
* @example "region"
|
|
1972
|
+
*/
|
|
1973
|
+
key: string;
|
|
1974
|
+
/**
|
|
1975
|
+
* One of the values for a specific group associated with the billable metric.
|
|
1976
|
+
* @example "us-east-1"
|
|
1977
|
+
*/
|
|
1978
|
+
value: string;
|
|
1979
|
+
}
|
|
1980
|
+
export interface GroupPropertiesObject {
|
|
1981
|
+
/**
|
|
1982
|
+
* Unique identifier of a billable metric group, created by Lago.
|
|
1983
|
+
* @format uuid
|
|
1984
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1985
|
+
*/
|
|
1986
|
+
group_id: string;
|
|
1987
|
+
/** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
|
|
1988
|
+
values: ChargeProperties;
|
|
1989
|
+
}
|
|
1990
|
+
export interface GroupsPaginated {
|
|
1991
|
+
groups: GroupObject[];
|
|
1992
|
+
meta: PaginationMeta;
|
|
1993
|
+
}
|
|
1994
|
+
export interface Invoice {
|
|
1995
|
+
invoice: InvoiceObjectExtended;
|
|
1996
|
+
}
|
|
1997
|
+
export type InvoiceAppliedTaxObject = BaseAppliedTax & {
|
|
1998
|
+
/**
|
|
1999
|
+
* Unique identifier of the invoice, created by Lago.
|
|
2000
|
+
* @format uuid
|
|
2001
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2002
|
+
*/
|
|
2003
|
+
lago_invoice_id?: string;
|
|
2004
|
+
/**
|
|
2005
|
+
* Fees total amount on which the tax is applied
|
|
2006
|
+
* @example 20000
|
|
2007
|
+
*/
|
|
2008
|
+
fees_amount_cents?: number;
|
|
2009
|
+
};
|
|
2010
|
+
export interface InvoiceMetadataObject {
|
|
2011
|
+
/**
|
|
2012
|
+
* Unique identifier assigned to the invoice metadata within the Lago application.
|
|
2013
|
+
* @format uuid
|
|
2014
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2015
|
+
*/
|
|
2016
|
+
lago_id?: string;
|
|
2017
|
+
/**
|
|
2018
|
+
* Represents the key of the metadata’s key-value pair.
|
|
2019
|
+
* @example "digital_ref_id"
|
|
2020
|
+
*/
|
|
2021
|
+
key?: string;
|
|
2022
|
+
/**
|
|
2023
|
+
* Represents the value of the metadata’s key-value pair.
|
|
2024
|
+
* @example "INV-0123456-98765"
|
|
2025
|
+
*/
|
|
2026
|
+
value?: string;
|
|
2027
|
+
/**
|
|
2028
|
+
* The date and time when the metadata object was created. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
|
|
2029
|
+
* @format date-time
|
|
2030
|
+
* @example "2022-04-29T08:59:51Z"
|
|
2031
|
+
*/
|
|
2032
|
+
created_at?: string;
|
|
2033
|
+
}
|
|
2034
|
+
export interface InvoiceObject {
|
|
2035
|
+
/**
|
|
2036
|
+
* Unique identifier assigned to the fee within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the fee’s record within the Lago system.
|
|
2037
|
+
* @format uuid
|
|
2038
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2039
|
+
*/
|
|
2040
|
+
lago_id: string;
|
|
2041
|
+
/**
|
|
2042
|
+
* This ID helps in uniquely identifying and organizing the invoices associated with a specific customer. It provides a sequential numbering system specific to the customer, allowing for easy tracking and management of invoices within the customer's context.
|
|
2043
|
+
* @example 2
|
|
2044
|
+
*/
|
|
2045
|
+
sequential_id: number;
|
|
2046
|
+
/**
|
|
2047
|
+
* The unique number assigned to the invoice. This number serves as a distinct identifier for the invoice and helps in differentiating it from other invoices in the system.
|
|
2048
|
+
* @example "LAG-1234-001-002"
|
|
2049
|
+
*/
|
|
2050
|
+
number: string;
|
|
2051
|
+
/**
|
|
2052
|
+
* The date when the invoice was issued. It is provided in the ISO 8601 date format.
|
|
2053
|
+
* @format date
|
|
2054
|
+
* @example "2022-04-30"
|
|
2055
|
+
*/
|
|
2056
|
+
issuing_date: string;
|
|
2057
|
+
/**
|
|
2058
|
+
* The payment due date for the invoice, specified in the ISO 8601 date format.
|
|
2059
|
+
* @format date
|
|
2060
|
+
* @example "2022-04-30"
|
|
2061
|
+
*/
|
|
2062
|
+
payment_due_date?: string;
|
|
2063
|
+
/**
|
|
2064
|
+
* The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
|
|
2065
|
+
* @example 30
|
|
2066
|
+
*/
|
|
2067
|
+
net_payment_term?: number;
|
|
2068
|
+
/**
|
|
2069
|
+
* The type of invoice issued. Possible values are `subscription`, `one-off` or `credit`.
|
|
2070
|
+
* @example "subscription"
|
|
2071
|
+
*/
|
|
2072
|
+
invoice_type: "subscription" | "add_on" | "credit" | "one_off";
|
|
2073
|
+
/**
|
|
2074
|
+
* The status of the invoice. It indicates the current state of the invoice and can have two possible values:
|
|
2075
|
+
* - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice.
|
|
2076
|
+
* - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore.
|
|
2077
|
+
* @example "finalized"
|
|
2078
|
+
*/
|
|
2079
|
+
status: "draft" | "finalized";
|
|
2080
|
+
/**
|
|
2081
|
+
* The status of the payment associated with the invoice. It can have one of the following values:
|
|
2082
|
+
* - `pending`: the payment is pending, waiting for payment processing in Stripe or when the invoice is emitted but users have not updated the payment status through the endpoint.
|
|
2083
|
+
* - `succeeded`: the payment of the invoice has been successfully processed.
|
|
2084
|
+
* - `failed`: the payment of the invoice has failed or encountered an error during processing.
|
|
2085
|
+
* @example "succeeded"
|
|
2086
|
+
*/
|
|
2087
|
+
payment_status: "pending" | "succeeded" | "failed";
|
|
2088
|
+
/** The currency of the invoice issued. */
|
|
2089
|
+
currency: Currency;
|
|
2090
|
+
/**
|
|
2091
|
+
* The total sum of fees amount in cents. It calculates the cumulative amount of all the fees associated with the invoice, providing a consolidated value.
|
|
2092
|
+
* @example 100
|
|
2093
|
+
*/
|
|
2094
|
+
fees_amount_cents: number;
|
|
2095
|
+
/**
|
|
2096
|
+
* The total sum of all coupons discounted on the invoice. It calculates the cumulative discount amount applied by coupons, expressed in cents.
|
|
2097
|
+
* @example 10
|
|
2098
|
+
*/
|
|
2099
|
+
coupons_amount_cents: number;
|
|
2100
|
+
/**
|
|
2101
|
+
* The total sum of all credit notes discounted on the invoice. It calculates the cumulative discount amount applied by credit notes, expressed in cents.
|
|
2102
|
+
* @example 10
|
|
2103
|
+
*/
|
|
2104
|
+
credit_notes_amount_cents: number;
|
|
2105
|
+
/**
|
|
2106
|
+
* Subtotal amount, excluding taxes, expressed in cents.
|
|
2107
|
+
* This field depends on the version number. Here are the definitions based on the version:
|
|
2108
|
+
* - Version 1: is equal to the sum of `fees_amount_cents`, minus `coupons_amount_cents`, and minus `prepaid_credit_amount_cents`.
|
|
2109
|
+
* - Version 2: is equal to the `fees_amount_cents`.
|
|
2110
|
+
* - Version 3: is equal to the `fees_amount_cents`, minus `coupons_amount_cents`
|
|
2111
|
+
* @example 100
|
|
2112
|
+
*/
|
|
2113
|
+
sub_total_excluding_taxes_amount_cents: number;
|
|
2114
|
+
/**
|
|
2115
|
+
* The sum of tax amount associated with the invoice, expressed in cents.
|
|
2116
|
+
* @example 20
|
|
2117
|
+
*/
|
|
2118
|
+
taxes_amount_cents: number;
|
|
2119
|
+
/**
|
|
2120
|
+
* Subtotal amount, including taxes, expressed in cents.
|
|
2121
|
+
* This field depends on the version number. Here are the definitions based on the version:
|
|
2122
|
+
* - Version 1: is equal to the `total_amount_cents`.
|
|
2123
|
+
* - Version 2: is equal to the sum of `fees_amount_cents` and `taxes_amount_cents`.
|
|
2124
|
+
* - Version 3: is equal to the sum `sub_total_excluding_taxes_amount_cents` and `taxes_amount_cents`
|
|
2125
|
+
* @example 120
|
|
2126
|
+
*/
|
|
2127
|
+
sub_total_including_taxes_amount_cents: number;
|
|
2128
|
+
/**
|
|
2129
|
+
* The total sum of all prepaid credits discounted on the invoice. It calculates the cumulative discount amount applied by prepaid credits, expressed in cents.
|
|
2130
|
+
* @example 0
|
|
2131
|
+
*/
|
|
2132
|
+
prepaid_credit_amount_cents: number;
|
|
2133
|
+
/**
|
|
2134
|
+
* The sum of the amount and taxes amount on the invoice, expressed in cents. It calculates the total financial value of the invoice, including both the original amount and any applicable taxes.
|
|
2135
|
+
* @example 100
|
|
2136
|
+
*/
|
|
2137
|
+
total_amount_cents: number;
|
|
2138
|
+
/** @example 3 */
|
|
2139
|
+
version_number: number;
|
|
2140
|
+
/**
|
|
2141
|
+
* Contains the URL that provides direct access to the invoice PDF file. You can use this URL to download or view the PDF document of the invoice
|
|
2142
|
+
* @format uri
|
|
2143
|
+
* @example "https://getlago.com/invoice/file"
|
|
2144
|
+
*/
|
|
2145
|
+
file_url?: string;
|
|
2146
|
+
/** The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
|
|
2147
|
+
customer?: CustomerObject;
|
|
2148
|
+
metadata?: InvoiceMetadataObject[];
|
|
2149
|
+
applied_taxes?: InvoiceAppliedTaxObject[];
|
|
2150
|
+
}
|
|
2151
|
+
export type InvoiceObjectExtended = InvoiceObject & {
|
|
2152
|
+
credits?: CreditObject[];
|
|
2153
|
+
fees?: FeeObject[];
|
|
2154
|
+
subscriptions?: SubscriptionObject[];
|
|
2155
|
+
};
|
|
2156
|
+
export interface InvoiceOneOffCreateInput {
|
|
2157
|
+
invoice: {
|
|
2158
|
+
/**
|
|
2159
|
+
* Unique identifier assigned to the customer in your application.
|
|
2160
|
+
* @example "hooli_1234"
|
|
2161
|
+
*/
|
|
2162
|
+
external_customer_id: string;
|
|
2163
|
+
/** The currency of the invoice. */
|
|
2164
|
+
currency?: Currency;
|
|
2165
|
+
fees: {
|
|
2166
|
+
/**
|
|
2167
|
+
* The code of the add-on used as invoice item.
|
|
2168
|
+
* @example "setup_fee"
|
|
2169
|
+
*/
|
|
2170
|
+
add_on_code: string;
|
|
2171
|
+
/**
|
|
2172
|
+
* The amount of the fee per unit, expressed in cents. By default, the amount of the add-on is used.
|
|
2173
|
+
* @example 12000
|
|
2174
|
+
*/
|
|
2175
|
+
unit_amount_cents?: number | null;
|
|
2176
|
+
/**
|
|
2177
|
+
* The quantity of units associated with the fee. By default, only 1 unit is added to the invoice.
|
|
2178
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2179
|
+
* @example "2.5"
|
|
2180
|
+
*/
|
|
2181
|
+
units?: string | null;
|
|
2182
|
+
/**
|
|
2183
|
+
* This is a description
|
|
2184
|
+
* @example "The description of the fee line item in the invoice. By default, the description of the add-on is used."
|
|
2185
|
+
*/
|
|
2186
|
+
description?: string | null;
|
|
2187
|
+
/**
|
|
2188
|
+
* List of unique code used to identify the taxes.
|
|
2189
|
+
* @example ["french_standard_vat"]
|
|
2190
|
+
*/
|
|
2191
|
+
tax_codes?: string[];
|
|
2192
|
+
}[];
|
|
2193
|
+
};
|
|
2194
|
+
}
|
|
2195
|
+
export interface InvoicesPaginated {
|
|
2196
|
+
invoices: InvoiceObject[];
|
|
2197
|
+
meta: PaginationMeta;
|
|
2198
|
+
}
|
|
2199
|
+
export interface InvoiceUpdateInput {
|
|
2200
|
+
invoice: {
|
|
2201
|
+
/**
|
|
2202
|
+
* The payment status of the invoice. Possible values are `pending`, `failed` or `succeeded`.
|
|
2203
|
+
* @example "succeeded"
|
|
2204
|
+
*/
|
|
2205
|
+
payment_status?: "pending" | "succeeded" | "failed";
|
|
2206
|
+
metadata?: {
|
|
2207
|
+
/**
|
|
2208
|
+
* The metadata object identifier. Only required when updating existing metadata.
|
|
2209
|
+
* @format uuid
|
|
2210
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2211
|
+
*/
|
|
2212
|
+
id?: string;
|
|
2213
|
+
/**
|
|
2214
|
+
* The key in the key-value pair of the metadata.
|
|
2215
|
+
* @example "digital_ref_id"
|
|
2216
|
+
*/
|
|
2217
|
+
key?: string;
|
|
2218
|
+
/**
|
|
2219
|
+
* The value in the key-value pair of the metadata.
|
|
2220
|
+
* @example "INV-0123456-98765"
|
|
2221
|
+
*/
|
|
2222
|
+
value?: string;
|
|
2223
|
+
}[];
|
|
2224
|
+
};
|
|
2225
|
+
}
|
|
2226
|
+
export interface Organization {
|
|
2227
|
+
organization: OrganizationObject;
|
|
2228
|
+
}
|
|
2229
|
+
/** The custom billing settings for your organization. */
|
|
2230
|
+
export interface OrganizationBillingConfiguration {
|
|
2231
|
+
/**
|
|
2232
|
+
* The customer invoice message that appears at the bottom of each billing documents.
|
|
2233
|
+
* @example "This is my customer footer"
|
|
2234
|
+
*/
|
|
2235
|
+
invoice_footer?: string | null;
|
|
2236
|
+
/**
|
|
2237
|
+
* The grace period, expressed in days, for finalizing the invoice. This period refers to the additional time granted to your customers beyond the invoice due date to adjust usage and line items. Can be overwritten by the customer’s grace period.
|
|
2238
|
+
* @example 3
|
|
2239
|
+
*/
|
|
2240
|
+
invoice_grace_period?: number;
|
|
2241
|
+
/**
|
|
2242
|
+
* The locale of the billing documents, expressed in the ISO 639-1 format. This field indicates the language or regional variant used for the documents content issued or the embeddable customer portal.
|
|
2243
|
+
* @example "en"
|
|
2244
|
+
*/
|
|
2245
|
+
document_locale?: string;
|
|
2246
|
+
}
|
|
2247
|
+
export interface OrganizationObject {
|
|
2248
|
+
/**
|
|
2249
|
+
* Unique identifier assigned to the organization within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the organization's record within the Lago system
|
|
2250
|
+
* @format uuid
|
|
2251
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2252
|
+
*/
|
|
2253
|
+
lago_id: string;
|
|
2254
|
+
/**
|
|
2255
|
+
* The name of your organization.
|
|
2256
|
+
* @example "Name1"
|
|
2257
|
+
*/
|
|
2258
|
+
name: string;
|
|
2259
|
+
/**
|
|
2260
|
+
* The date of creation of your organization, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
2261
|
+
* @format date-time
|
|
2262
|
+
* @example "2022-05-02T13:04:09Z"
|
|
2263
|
+
*/
|
|
2264
|
+
created_at: string | null;
|
|
2265
|
+
/**
|
|
2266
|
+
* The URL of your newest updated webhook endpoint. This URL allows your organization to receive important messages, notifications, or data from the Lago system. By configuring your webhook endpoint to this URL, you can ensure that your organization stays informed and receives relevant information in a timely manner.
|
|
2267
|
+
* @example "https://webhook.brex.com"
|
|
2268
|
+
*/
|
|
2269
|
+
webhook_url?: string | null;
|
|
2270
|
+
/**
|
|
2271
|
+
* The array containing your webhooks URLs.
|
|
2272
|
+
* @example ["https://webhook.brex.com","https://webhook2.brex.com"]
|
|
2273
|
+
*/
|
|
2274
|
+
webhook_urls?: string[] | null;
|
|
2275
|
+
/** The country of your organization. */
|
|
2276
|
+
country?: Country;
|
|
2277
|
+
/**
|
|
2278
|
+
* The first line of your organization’s billing address.
|
|
2279
|
+
* @example "100 Brex Street"
|
|
2280
|
+
*/
|
|
2281
|
+
address_line1?: string | null;
|
|
2282
|
+
/**
|
|
2283
|
+
* The second line of your organization’s billing address.
|
|
2284
|
+
* @example null
|
|
2285
|
+
*/
|
|
2286
|
+
address_line2?: string | null;
|
|
2287
|
+
/**
|
|
2288
|
+
* The state of your organization’s billing address.
|
|
2289
|
+
* @example "NYC"
|
|
2290
|
+
*/
|
|
2291
|
+
state?: string | null;
|
|
2292
|
+
/**
|
|
2293
|
+
* The zipcode of your organization’s billing address.
|
|
2294
|
+
* @example "10000"
|
|
2295
|
+
*/
|
|
2296
|
+
zipcode?: string | null;
|
|
2297
|
+
/**
|
|
2298
|
+
* The email address of your organization used to bill your customers.
|
|
2299
|
+
* @format email
|
|
2300
|
+
* @example "brex@brex.com"
|
|
2301
|
+
*/
|
|
2302
|
+
email?: string | null;
|
|
2303
|
+
/**
|
|
2304
|
+
* The city of your organization’s billing address.
|
|
2305
|
+
* @example "New York"
|
|
2306
|
+
*/
|
|
2307
|
+
city?: string | null;
|
|
2308
|
+
/**
|
|
2309
|
+
* The legal name of your organization.
|
|
2310
|
+
* @example null
|
|
2311
|
+
*/
|
|
2312
|
+
legal_name?: string | null;
|
|
2313
|
+
/**
|
|
2314
|
+
* The legal number of your organization.
|
|
2315
|
+
* @example null
|
|
2316
|
+
*/
|
|
2317
|
+
legal_number?: string | null;
|
|
2318
|
+
/**
|
|
2319
|
+
* The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
|
|
2320
|
+
* @example 30
|
|
2321
|
+
*/
|
|
2322
|
+
net_payment_term?: number;
|
|
2323
|
+
/**
|
|
2324
|
+
* The tax identification number of your organization.
|
|
2325
|
+
* @example "US123456789"
|
|
2326
|
+
*/
|
|
2327
|
+
tax_identification_number?: string | null;
|
|
2328
|
+
/** Your organization’s timezone, used for billing purposes in your own local time. Can be overwritten by the customer’s timezone. */
|
|
2329
|
+
timezone?: Timezone;
|
|
2330
|
+
/** The custom billing settings for your organization. */
|
|
2331
|
+
billing_configuration: OrganizationBillingConfiguration;
|
|
2332
|
+
/** List of default organization taxes */
|
|
2333
|
+
taxes?: TaxObject[];
|
|
2334
|
+
}
|
|
2335
|
+
export interface OrganizationUpdateInput {
|
|
2336
|
+
organization: {
|
|
2337
|
+
/**
|
|
2338
|
+
* The URL of your newest updated webhook endpoint. This URL allows your organization to receive important messages, notifications, or data from the Lago system. By configuring your webhook endpoint to this URL, you can ensure that your organization stays informed and receives relevant information in a timely manner.
|
|
2339
|
+
* @example "https://webhook.brex.com"
|
|
2340
|
+
*/
|
|
2341
|
+
webhook_url?: string | null;
|
|
2342
|
+
/** The country of your organization. */
|
|
2343
|
+
country?: Country;
|
|
2344
|
+
/**
|
|
2345
|
+
* The first line of your organization’s billing address.
|
|
2346
|
+
* @example "100 Brex Street"
|
|
2347
|
+
*/
|
|
2348
|
+
address_line1?: string | null;
|
|
2349
|
+
/**
|
|
2350
|
+
* The second line of your organization’s billing address.
|
|
2351
|
+
* @example null
|
|
2352
|
+
*/
|
|
2353
|
+
address_line2?: string | null;
|
|
2354
|
+
/**
|
|
2355
|
+
* The state of your organization’s billing address.
|
|
2356
|
+
* @example "NYC"
|
|
2357
|
+
*/
|
|
2358
|
+
state?: string | null;
|
|
2359
|
+
/**
|
|
2360
|
+
* The zipcode of your organization’s billing address.
|
|
2361
|
+
* @example "10000"
|
|
2362
|
+
*/
|
|
2363
|
+
zipcode?: string | null;
|
|
2364
|
+
/**
|
|
2365
|
+
* The email address of your organization used to bill your customers.
|
|
2366
|
+
* @format email
|
|
2367
|
+
* @example "brex@brex.com"
|
|
2368
|
+
*/
|
|
2369
|
+
email?: string | null;
|
|
2370
|
+
/**
|
|
2371
|
+
* The city of your organization’s billing address.
|
|
2372
|
+
* @example "New York"
|
|
2373
|
+
*/
|
|
2374
|
+
city?: string | null;
|
|
2375
|
+
/**
|
|
2376
|
+
* The legal name of your organization.
|
|
2377
|
+
* @example null
|
|
2378
|
+
*/
|
|
2379
|
+
legal_name?: string | null;
|
|
2380
|
+
/**
|
|
2381
|
+
* The legal number of your organization.
|
|
2382
|
+
* @example null
|
|
2383
|
+
*/
|
|
2384
|
+
legal_number?: string | null;
|
|
2385
|
+
/**
|
|
2386
|
+
* The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
|
|
2387
|
+
* @example 30
|
|
2388
|
+
*/
|
|
2389
|
+
net_payment_term?: number;
|
|
2390
|
+
/**
|
|
2391
|
+
* The tax identification number of your organization.
|
|
2392
|
+
* @example "US123456789"
|
|
2393
|
+
*/
|
|
2394
|
+
tax_identification_number?: string | null;
|
|
2395
|
+
/** Your organization’s timezone, used for billing purposes in your own local time. Can be overwritten by the customer’s timezone. */
|
|
2396
|
+
timezone?: Timezone;
|
|
2397
|
+
/**
|
|
2398
|
+
* Represents the email settings of the organization. It allows you to define which documents are sent by email. The field value determines the types of documents that trigger email notifications. Possible values for are `invoice.finalized` and `credit_note.created`. By configuring this field, you can specify whether invoices, credit notes, or both should be sent to recipients via email.
|
|
2399
|
+
* @example ["invoice.finalized","credit_note.created"]
|
|
2400
|
+
*/
|
|
2401
|
+
email_settings?: ("invoice.finalized" | "credit_note.created")[];
|
|
2402
|
+
/** The custom billing settings for your organization. */
|
|
2403
|
+
billing_configuration?: OrganizationBillingConfiguration;
|
|
2404
|
+
};
|
|
2405
|
+
}
|
|
2406
|
+
export interface PaginationMeta {
|
|
2407
|
+
/**
|
|
2408
|
+
* Current page.
|
|
2409
|
+
* @example 2
|
|
2410
|
+
*/
|
|
2411
|
+
current_page: number;
|
|
2412
|
+
/**
|
|
2413
|
+
* Next page.
|
|
2414
|
+
* @example 3
|
|
2415
|
+
*/
|
|
2416
|
+
next_page?: number | null;
|
|
2417
|
+
/**
|
|
2418
|
+
* Previous page.
|
|
2419
|
+
* @example 1
|
|
2420
|
+
*/
|
|
2421
|
+
prev_page?: number | null;
|
|
2422
|
+
/**
|
|
2423
|
+
* Total number of pages.
|
|
2424
|
+
* @example 4
|
|
2425
|
+
*/
|
|
2426
|
+
total_pages: number;
|
|
2427
|
+
/**
|
|
2428
|
+
* Total number of records.
|
|
2429
|
+
* @example 70
|
|
2430
|
+
*/
|
|
2431
|
+
total_count: number;
|
|
2432
|
+
}
|
|
2433
|
+
export interface Plan {
|
|
2434
|
+
plan: PlanObject;
|
|
2435
|
+
}
|
|
2436
|
+
export interface PlanCreateInput {
|
|
2437
|
+
plan: {
|
|
2438
|
+
/**
|
|
2439
|
+
* The name of the plan.
|
|
2440
|
+
* @example "Startup"
|
|
2441
|
+
*/
|
|
2442
|
+
name?: string;
|
|
2443
|
+
/**
|
|
2444
|
+
* The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
|
|
2445
|
+
* @example "startup"
|
|
2446
|
+
*/
|
|
2447
|
+
code?: string;
|
|
2448
|
+
/**
|
|
2449
|
+
* The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `quarterly`, `monthly`, or `weekly`.
|
|
2450
|
+
* @example "monthly"
|
|
2451
|
+
*/
|
|
2452
|
+
interval?: "weekly" | "monthly" | "quarterly" | "yearly";
|
|
2453
|
+
/**
|
|
2454
|
+
* The description on the plan.
|
|
2455
|
+
* @example "Plan for early stage startups."
|
|
2456
|
+
*/
|
|
2457
|
+
description?: string;
|
|
2458
|
+
/**
|
|
2459
|
+
* The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
|
|
2460
|
+
* @example 10000
|
|
2461
|
+
*/
|
|
2462
|
+
amount_cents?: number;
|
|
2463
|
+
/** The currency of the plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed. */
|
|
2464
|
+
amount_currency?: Currency;
|
|
2465
|
+
/**
|
|
2466
|
+
* The duration in days during which the base cost of the plan is offered for free.
|
|
2467
|
+
* @example 5
|
|
2468
|
+
*/
|
|
2469
|
+
trial_period?: number;
|
|
2470
|
+
/**
|
|
2471
|
+
* This field determines the billing timing for the plan. When set to `true`, the base cost of the plan is due at the beginning of each billing period. Conversely, when set to `false`, the base cost of the plan is due at the end of each billing period.
|
|
2472
|
+
* @example true
|
|
2473
|
+
*/
|
|
2474
|
+
pay_in_advance?: boolean;
|
|
2475
|
+
/**
|
|
2476
|
+
* This field, when set to `true`, enables to invoice usage-based charges on monthly basis, even if the cadence of the plan is yearly. This allows customers to pay charges overage on a monthly basis. This can be set to true only if the plan’s interval is `yearly`.
|
|
2477
|
+
* @example null
|
|
2478
|
+
*/
|
|
2479
|
+
bill_charges_monthly?: boolean | null;
|
|
2480
|
+
/**
|
|
2481
|
+
* List of unique code used to identify the taxes.
|
|
2482
|
+
* @example ["french_standard_vat"]
|
|
2483
|
+
*/
|
|
2484
|
+
tax_codes?: string[];
|
|
2485
|
+
/**
|
|
2486
|
+
* Additional usage-based charges for this plan.
|
|
2487
|
+
* @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
|
|
2488
|
+
*/
|
|
2489
|
+
charges?: {
|
|
2490
|
+
/**
|
|
2491
|
+
* Unique identifier of the billable metric created by Lago.
|
|
2492
|
+
* @format uuid
|
|
2493
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2494
|
+
*/
|
|
2495
|
+
billable_metric_id?: string;
|
|
2496
|
+
/**
|
|
2497
|
+
* Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage` `package`, `percentage` or `volume`.
|
|
2498
|
+
* @example "standard"
|
|
2499
|
+
*/
|
|
2500
|
+
charge_model?: "standard" | "graduated" | "graduated_percentage" | "package" | "percentage" | "volume";
|
|
2501
|
+
/**
|
|
2502
|
+
* This field determines the billing timing for this specific usage-based charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to false, the charge is due and invoiced at the end of each billing period.
|
|
2503
|
+
* @example false
|
|
2504
|
+
*/
|
|
2505
|
+
pay_in_advance?: boolean;
|
|
2506
|
+
/**
|
|
2507
|
+
* This field specifies whether the charge should be included in a proper invoice. If set to false, no invoice will be issued for this charge. You can only set it to `false` when `pay_in_advance` is `true`.
|
|
2508
|
+
* @example true
|
|
2509
|
+
*/
|
|
2510
|
+
invoiceable?: boolean;
|
|
2511
|
+
/**
|
|
2512
|
+
* Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
|
|
2513
|
+
*
|
|
2514
|
+
* - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
|
|
2515
|
+
* - If set to `false`, the charge is billed in full.
|
|
2516
|
+
* - If not defined in the request, default value is `false`.
|
|
2517
|
+
* @example false
|
|
2518
|
+
*/
|
|
2519
|
+
prorated?: boolean;
|
|
2520
|
+
/**
|
|
2521
|
+
* The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
|
|
2522
|
+
* @example 0
|
|
2523
|
+
*/
|
|
2524
|
+
min_amount_cents?: number;
|
|
2525
|
+
/** List of all thresholds utilized for calculating the charge. */
|
|
2526
|
+
properties?: ChargeProperties;
|
|
2527
|
+
/** All charge information, sorted by groups. */
|
|
2528
|
+
group_properties?: {
|
|
2529
|
+
/**
|
|
2530
|
+
* Unique identifier of a billable metric group, created by Lago.
|
|
2531
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2532
|
+
*/
|
|
2533
|
+
group_id: string;
|
|
2534
|
+
/** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
|
|
2535
|
+
values: ChargeProperties;
|
|
2536
|
+
}[];
|
|
2537
|
+
/**
|
|
2538
|
+
* List of unique code used to identify the taxes.
|
|
2539
|
+
* @example ["french_standard_vat"]
|
|
2540
|
+
*/
|
|
2541
|
+
tax_codes?: string[];
|
|
2542
|
+
}[];
|
|
2543
|
+
};
|
|
2544
|
+
}
|
|
2545
|
+
export interface PlanUpdateInput {
|
|
2546
|
+
plan: {
|
|
2547
|
+
/**
|
|
2548
|
+
* The name of the plan.
|
|
2549
|
+
* @example "Startup"
|
|
2550
|
+
*/
|
|
2551
|
+
name?: string;
|
|
2552
|
+
/**
|
|
2553
|
+
* The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
|
|
2554
|
+
* @example "startup"
|
|
2555
|
+
*/
|
|
2556
|
+
code?: string;
|
|
2557
|
+
/**
|
|
2558
|
+
* The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `quarterly`, `monthly`, or `weekly`.
|
|
2559
|
+
* @example "monthly"
|
|
2560
|
+
*/
|
|
2561
|
+
interval?: "weekly" | "monthly" | "quarterly" | "yearly";
|
|
2562
|
+
/**
|
|
2563
|
+
* The description on the plan.
|
|
2564
|
+
* @example "Plan for early stage startups."
|
|
2565
|
+
*/
|
|
2566
|
+
description?: string;
|
|
2567
|
+
/**
|
|
2568
|
+
* The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
|
|
2569
|
+
* @example 10000
|
|
2570
|
+
*/
|
|
2571
|
+
amount_cents?: number;
|
|
2572
|
+
/** The currency of the plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed. */
|
|
2573
|
+
amount_currency?: Currency;
|
|
2574
|
+
/**
|
|
2575
|
+
* The duration in days during which the base cost of the plan is offered for free.
|
|
2576
|
+
* @example 5
|
|
2577
|
+
*/
|
|
2578
|
+
trial_period?: number;
|
|
2579
|
+
/**
|
|
2580
|
+
* This field determines the billing timing for the plan. When set to `true`, the base cost of the plan is due at the beginning of each billing period. Conversely, when set to `false`, the base cost of the plan is due at the end of each billing period.
|
|
2581
|
+
* @example true
|
|
2582
|
+
*/
|
|
2583
|
+
pay_in_advance?: boolean;
|
|
2584
|
+
/**
|
|
2585
|
+
* This field, when set to `true`, enables to invoice usage-based charges on monthly basis, even if the cadence of the plan is yearly. This allows customers to pay charges overage on a monthly basis. This can be set to true only if the plan’s interval is `yearly`.
|
|
2586
|
+
* @example null
|
|
2587
|
+
*/
|
|
2588
|
+
bill_charges_monthly?: boolean | null;
|
|
2589
|
+
/**
|
|
2590
|
+
* List of unique code used to identify the taxes.
|
|
2591
|
+
* @example ["french_standard_vat"]
|
|
2592
|
+
*/
|
|
2593
|
+
tax_codes?: string[];
|
|
2594
|
+
/**
|
|
2595
|
+
* Additional usage-based charges for this plan.
|
|
2596
|
+
* @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
|
|
2597
|
+
*/
|
|
2598
|
+
charges?: {
|
|
2599
|
+
/**
|
|
2600
|
+
* Unique identifier of the charge created by Lago.
|
|
2601
|
+
* @format uuid
|
|
2602
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2603
|
+
*/
|
|
2604
|
+
id?: string;
|
|
2605
|
+
/**
|
|
2606
|
+
* Unique identifier of the billable metric created by Lago.
|
|
2607
|
+
* @format uuid
|
|
2608
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2609
|
+
*/
|
|
2610
|
+
billable_metric_id?: string;
|
|
2611
|
+
/**
|
|
2612
|
+
* Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage`, `package`, `percentage` or `volume`.
|
|
2613
|
+
* @example "standard"
|
|
2614
|
+
*/
|
|
2615
|
+
charge_model?: "standard" | "graduated" | "graduated_percentage" | "package" | "percentage" | "volume";
|
|
2616
|
+
/**
|
|
2617
|
+
* This field determines the billing timing for this specific usage-based charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to false, the charge is due and invoiced at the end of each billing period.
|
|
2618
|
+
* @example false
|
|
2619
|
+
*/
|
|
2620
|
+
pay_in_advance?: boolean;
|
|
2621
|
+
/**
|
|
2622
|
+
* This field specifies whether the charge should be included in a proper invoice. If set to false, no invoice will be issued for this charge. You can only set it to `false` when `pay_in_advance` is `true`.
|
|
2623
|
+
* @example true
|
|
2624
|
+
*/
|
|
2625
|
+
invoiceable?: boolean;
|
|
2626
|
+
/**
|
|
2627
|
+
* Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
|
|
2628
|
+
*
|
|
2629
|
+
* - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
|
|
2630
|
+
* - If set to `false`, the charge is billed in full.
|
|
2631
|
+
* - If not defined in the request, default value is `false`.
|
|
2632
|
+
* @example false
|
|
2633
|
+
*/
|
|
2634
|
+
prorated?: boolean;
|
|
2635
|
+
/**
|
|
2636
|
+
* The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
|
|
2637
|
+
* @example 0
|
|
2638
|
+
*/
|
|
2639
|
+
min_amount_cents?: number;
|
|
2640
|
+
/** List of all thresholds utilized for calculating the charge. */
|
|
2641
|
+
properties?: ChargeProperties;
|
|
2642
|
+
/** All charge information, sorted by groups. */
|
|
2643
|
+
group_properties?: {
|
|
2644
|
+
/**
|
|
2645
|
+
* Unique identifier of a billable metric group, created by Lago.
|
|
2646
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2647
|
+
*/
|
|
2648
|
+
group_id: string;
|
|
2649
|
+
/** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
|
|
2650
|
+
values: ChargeProperties;
|
|
2651
|
+
}[];
|
|
2652
|
+
/**
|
|
2653
|
+
* List of unique code used to identify the taxes.
|
|
2654
|
+
* @example ["french_standard_vat"]
|
|
2655
|
+
*/
|
|
2656
|
+
tax_codes?: string[];
|
|
2657
|
+
}[];
|
|
2658
|
+
};
|
|
2659
|
+
}
|
|
2660
|
+
export interface PlanObject {
|
|
2661
|
+
/**
|
|
2662
|
+
* Unique identifier of the plan created by Lago.
|
|
2663
|
+
* @format uuid
|
|
2664
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2665
|
+
*/
|
|
2666
|
+
lago_id: string;
|
|
2667
|
+
/**
|
|
2668
|
+
* The name of the plan.
|
|
2669
|
+
* @example "Startup"
|
|
2670
|
+
*/
|
|
2671
|
+
name: string;
|
|
2672
|
+
/**
|
|
2673
|
+
* The date and time when the plan was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the plan was initially created.
|
|
2674
|
+
* @format date-time
|
|
2675
|
+
* @example "2023-06-27T19:43:42Z"
|
|
2676
|
+
*/
|
|
2677
|
+
created_at: string;
|
|
2678
|
+
/**
|
|
2679
|
+
* The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
|
|
2680
|
+
* @example "startup"
|
|
2681
|
+
*/
|
|
2682
|
+
code: string;
|
|
2683
|
+
/**
|
|
2684
|
+
* The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `quarterly`, `monthly` or `weekly`.
|
|
2685
|
+
* @example "monthly"
|
|
2686
|
+
*/
|
|
2687
|
+
interval: "weekly" | "monthly" | "quarterly" | "yearly";
|
|
2688
|
+
/**
|
|
2689
|
+
* The description on the plan.
|
|
2690
|
+
* @example ""
|
|
2691
|
+
*/
|
|
2692
|
+
description?: string;
|
|
2693
|
+
/**
|
|
2694
|
+
* The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
|
|
2695
|
+
* @example 10000
|
|
2696
|
+
*/
|
|
2697
|
+
amount_cents: number;
|
|
2698
|
+
/** The currency of the plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed. */
|
|
2699
|
+
amount_currency: Currency;
|
|
2700
|
+
/**
|
|
2701
|
+
* The duration in days during which the base cost of the plan is offered for free.
|
|
2702
|
+
* @example 5
|
|
2703
|
+
*/
|
|
2704
|
+
trial_period?: number;
|
|
2705
|
+
/**
|
|
2706
|
+
* This field determines the billing timing for the plan. When set to `true`, the base cost of the plan is due at the beginning of each billing period. Conversely, when set to `false`, the base cost of the plan is due at the end of each billing period.
|
|
2707
|
+
* @example true
|
|
2708
|
+
*/
|
|
2709
|
+
pay_in_advance?: boolean;
|
|
2710
|
+
/**
|
|
2711
|
+
* This field, when set to `true`, enables to invoice usage-based charges on monthly basis, even if the cadence of the plan is yearly. This allows customers to pay charges overage on a monthly basis. This can be set to true only if the plan’s interval is `yearly`.
|
|
2712
|
+
* @example null
|
|
2713
|
+
*/
|
|
2714
|
+
bill_charges_monthly?: boolean | null;
|
|
2715
|
+
/**
|
|
2716
|
+
* The count of active subscriptions that are currently associated with the plan. This field provides valuable information regarding the impact of deleting the plan. By checking the value of this field, you can determine the number of subscriptions that will be affected if the plan is deleted.
|
|
2717
|
+
* @example 0
|
|
2718
|
+
*/
|
|
2719
|
+
active_subscriptions_count: number;
|
|
2720
|
+
/**
|
|
2721
|
+
* The number of draft invoices that include a subscription attached to the plan. This field provides valuable information about the impact of deleting the plan. By checking the value of this field, you can determine the number of draft invoices that will be affected if the plan is deleted.
|
|
2722
|
+
* @example 0
|
|
2723
|
+
*/
|
|
2724
|
+
draft_invoices_count: number;
|
|
2725
|
+
/**
|
|
2726
|
+
* Additional usage-based charges for this plan.
|
|
2727
|
+
* @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
|
|
2728
|
+
*/
|
|
2729
|
+
charges?: ChargeObject[];
|
|
2730
|
+
/** All taxes applied to the plan. */
|
|
2731
|
+
taxes?: TaxObject[];
|
|
2732
|
+
}
|
|
2733
|
+
export interface PlansPaginated {
|
|
2734
|
+
plans: PlanObject[];
|
|
2735
|
+
meta: PaginationMeta;
|
|
2736
|
+
}
|
|
2737
|
+
export interface Subscription {
|
|
2738
|
+
subscription: SubscriptionObject;
|
|
2739
|
+
}
|
|
2740
|
+
export interface SubscriptionCreateInput {
|
|
2741
|
+
subscription: {
|
|
2742
|
+
/**
|
|
2743
|
+
* The customer external unique identifier (provided by your own application)
|
|
2744
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
2745
|
+
*/
|
|
2746
|
+
external_customer_id: string;
|
|
2747
|
+
/**
|
|
2748
|
+
* The unique code representing the plan to be attached to the customer. This code must correspond to the `code` property of one of the active plans.
|
|
2749
|
+
* @example "premium"
|
|
2750
|
+
*/
|
|
2751
|
+
plan_code: string;
|
|
2752
|
+
/**
|
|
2753
|
+
* The display name of the subscription on an invoice. This field allows for customization of the subscription's name for billing purposes, especially useful when a single customer has multiple subscriptions using the same plan.
|
|
2754
|
+
* @example "Repository A"
|
|
2755
|
+
*/
|
|
2756
|
+
name?: string;
|
|
2757
|
+
/**
|
|
2758
|
+
* The unique external identifier for the subscription. This identifier serves as an idempotency key, ensuring that each subscription is unique.
|
|
2759
|
+
* @example "my_sub_1234567890"
|
|
2760
|
+
*/
|
|
2761
|
+
external_id: string;
|
|
2762
|
+
/**
|
|
2763
|
+
* The billing time for the subscription, which can be set as either `anniversary` or `calendar`. If not explicitly provided, it will default to `calendar`. The billing time determines the timing of recurring billing cycles for the subscription. By specifying `anniversary`, the billing cycle will be based on the specific date the subscription started (billed fully), while `calendar` sets the billing cycle at the first day of the week/month/year (billed with proration).
|
|
2764
|
+
* @example "anniversary"
|
|
2765
|
+
*/
|
|
2766
|
+
billing_time?: "calendar" | "anniversary";
|
|
2767
|
+
/**
|
|
2768
|
+
* The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC).
|
|
2769
|
+
* @format date-time
|
|
2770
|
+
* @example "2022-10-08T00:00:00Z"
|
|
2771
|
+
*/
|
|
2772
|
+
ending_at?: string;
|
|
2773
|
+
/**
|
|
2774
|
+
* The start date for the subscription, allowing for the creation of subscriptions that can begin in the past or future. Please note that it cannot be used to update the start date of a pending subscription or schedule an upgrade/downgrade. The start_date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
2775
|
+
* @format date-time
|
|
2776
|
+
* @example "2022-08-08T00:00:00Z"
|
|
2777
|
+
*/
|
|
2778
|
+
subscription_at?: string;
|
|
2779
|
+
};
|
|
2780
|
+
}
|
|
2781
|
+
export interface SubscriptionUpdateInput {
|
|
2782
|
+
subscription: {
|
|
2783
|
+
/**
|
|
2784
|
+
* The display name of the subscription on an invoice. This field allows for customization of the subscription's name for billing purposes, especially useful when a single customer has multiple subscriptions using the same plan.
|
|
2785
|
+
* @example "Repository B"
|
|
2786
|
+
*/
|
|
2787
|
+
name?: string | null;
|
|
2788
|
+
/**
|
|
2789
|
+
* The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC).
|
|
2790
|
+
* @format date-time
|
|
2791
|
+
* @example "2022-10-08T00:00:00Z"
|
|
2792
|
+
*/
|
|
2793
|
+
ending_at?: string;
|
|
2794
|
+
/**
|
|
2795
|
+
* The start date and time of the subscription. This field can only be modified for pending subscriptions that have not yet started. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
2796
|
+
* @format date-time
|
|
2797
|
+
* @example "2022-08-08T00:00:00Z"
|
|
2798
|
+
*/
|
|
2799
|
+
subscription_at?: string;
|
|
2800
|
+
};
|
|
2801
|
+
}
|
|
2802
|
+
export interface SubscriptionObject {
|
|
2803
|
+
/**
|
|
2804
|
+
* Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s record within the Lago system
|
|
2805
|
+
* @format uuid
|
|
2806
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2807
|
+
*/
|
|
2808
|
+
lago_id: string;
|
|
2809
|
+
/**
|
|
2810
|
+
* The subscription external unique identifier (provided by your own application).
|
|
2811
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
2812
|
+
*/
|
|
2813
|
+
external_id: string;
|
|
2814
|
+
/**
|
|
2815
|
+
* Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
|
|
2816
|
+
* @format uuid
|
|
2817
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2818
|
+
*/
|
|
2819
|
+
lago_customer_id: string;
|
|
2820
|
+
/**
|
|
2821
|
+
* The customer external unique identifier (provided by your own application).
|
|
2822
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
2823
|
+
*/
|
|
2824
|
+
external_customer_id: string;
|
|
2825
|
+
/**
|
|
2826
|
+
* The billing time for the subscription, which can be set as either `anniversary` or `calendar`. If not explicitly provided, it will default to `calendar`. The billing time determines the timing of recurring billing cycles for the subscription. By specifying `anniversary`, the billing cycle will be based on the specific date the subscription started (billed fully), while `calendar` sets the billing cycle at the first day of the week/month/year (billed with proration).
|
|
2827
|
+
* @example "anniversary"
|
|
2828
|
+
*/
|
|
2829
|
+
billing_time: "calendar" | "anniversary";
|
|
2830
|
+
/**
|
|
2831
|
+
* The display name of the subscription on an invoice. This field allows for customization of the subscription's name for billing purposes, especially useful when a single customer has multiple subscriptions using the same plan.
|
|
2832
|
+
* @example "Repository A"
|
|
2833
|
+
*/
|
|
2834
|
+
name?: string | null;
|
|
2835
|
+
/**
|
|
2836
|
+
* The unique code representing the plan to be attached to the customer. This code must correspond to the `code` property of one of the active plans.
|
|
2837
|
+
* @example "premium"
|
|
2838
|
+
*/
|
|
2839
|
+
plan_code: string;
|
|
2840
|
+
/**
|
|
2841
|
+
* The status of the subscription, which can have the following values:
|
|
2842
|
+
* - `pending`: a previous subscription has been downgraded, and the current one is awaiting automatic activation at the end of the billing period.
|
|
2843
|
+
* - `active`: the subscription is currently active and applied to the customer.
|
|
2844
|
+
* - `terminated`: the subscription is no longer active.
|
|
2845
|
+
* - `canceled`: the subscription has been stopped before its activation. This can occur when two consecutive downgrades have been applied to a customer or when a subscription with a pending status is terminated.
|
|
2846
|
+
* @example "active"
|
|
2847
|
+
*/
|
|
2848
|
+
status: "active" | "pending" | "terminated" | "canceled";
|
|
2849
|
+
/**
|
|
2850
|
+
* The creation date of the subscription, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). This date provides a timestamp indicating when the subscription was initially created.
|
|
2851
|
+
* @format date-time
|
|
2852
|
+
* @example "2022-08-08T00:00:00Z"
|
|
2853
|
+
*/
|
|
2854
|
+
created_at: string;
|
|
2855
|
+
/**
|
|
2856
|
+
* The cancellation date of the subscription. This field is not null when the subscription is `canceled`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
2857
|
+
* @format date-time
|
|
2858
|
+
* @example "2022-09-14T16:35:31Z"
|
|
2859
|
+
*/
|
|
2860
|
+
canceled_at?: string | null;
|
|
2861
|
+
/**
|
|
2862
|
+
* The effective start date of the subscription. This field can be null if the subscription is `pending` or `canceled`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
2863
|
+
* @format date-time
|
|
2864
|
+
* @example "2022-08-08T00:00:00Z"
|
|
2865
|
+
*/
|
|
2866
|
+
started_at?: string | null;
|
|
2867
|
+
/**
|
|
2868
|
+
* The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC).
|
|
2869
|
+
* @format date-time
|
|
2870
|
+
* @example "2022-10-08T00:00:00Z"
|
|
2871
|
+
*/
|
|
2872
|
+
ending_at?: string;
|
|
2873
|
+
/**
|
|
2874
|
+
* The anniversary date and time of the initial subscription. This date serves as the basis for billing subscriptions with `anniversary` billing time. The `anniversary_date` should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
2875
|
+
* @format date-time
|
|
2876
|
+
* @example "2022-08-08T00:00:00Z"
|
|
2877
|
+
*/
|
|
2878
|
+
subscription_at: string;
|
|
2879
|
+
/**
|
|
2880
|
+
* The termination date of the subscription. This field is not null when the subscription is `terminated`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC)
|
|
2881
|
+
* @format date-time
|
|
2882
|
+
* @example "2022-09-14T16:35:31Z"
|
|
2883
|
+
*/
|
|
2884
|
+
terminated_at?: string | null;
|
|
2885
|
+
/**
|
|
2886
|
+
* The code identifying the previous plan associated with this subscription.
|
|
2887
|
+
* @example null
|
|
2888
|
+
*/
|
|
2889
|
+
previous_plan_code?: string | null;
|
|
2890
|
+
/**
|
|
2891
|
+
* The code identifying the next plan in the case of a downgrade.
|
|
2892
|
+
* @example null
|
|
2893
|
+
*/
|
|
2894
|
+
next_plan_code?: string | null;
|
|
2895
|
+
/**
|
|
2896
|
+
* The date when the plan will be downgraded, represented in ISO 8601 date format.
|
|
2897
|
+
* @format date-time
|
|
2898
|
+
* @example null
|
|
2899
|
+
*/
|
|
2900
|
+
downgrade_plan_date?: string | null;
|
|
2901
|
+
}
|
|
2902
|
+
export interface SubscriptionsPaginated {
|
|
2903
|
+
subscriptions: SubscriptionObject[];
|
|
2904
|
+
meta: PaginationMeta;
|
|
2905
|
+
}
|
|
2906
|
+
export interface Tax {
|
|
2907
|
+
tax: TaxObject;
|
|
2908
|
+
}
|
|
2909
|
+
export interface TaxBaseInput {
|
|
2910
|
+
/**
|
|
2911
|
+
* Name of the tax.
|
|
2912
|
+
* @example "TVA"
|
|
2913
|
+
*/
|
|
2914
|
+
name?: string;
|
|
2915
|
+
/**
|
|
2916
|
+
* Unique code used to identify the tax associated with the API request.
|
|
2917
|
+
* @example "french_standard_vat"
|
|
2918
|
+
*/
|
|
2919
|
+
code?: string;
|
|
2920
|
+
/**
|
|
2921
|
+
* The percentage rate of the tax
|
|
2922
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2923
|
+
* @example "20.0"
|
|
2924
|
+
*/
|
|
2925
|
+
rate?: string;
|
|
2926
|
+
/**
|
|
2927
|
+
* Internal description of the taxe
|
|
2928
|
+
* @example "French standard VAT"
|
|
2929
|
+
*/
|
|
2930
|
+
description?: string | null;
|
|
2931
|
+
/**
|
|
2932
|
+
* Set to `true` if the tax is used as one of the organization's default
|
|
2933
|
+
* @example true
|
|
2934
|
+
*/
|
|
2935
|
+
applied_to_organization?: boolean;
|
|
2936
|
+
}
|
|
2937
|
+
export interface TaxCreateInput {
|
|
2938
|
+
tax: TaxBaseInput;
|
|
2939
|
+
}
|
|
2940
|
+
export interface TaxesPaginated {
|
|
2941
|
+
taxes: TaxObject[];
|
|
2942
|
+
meta: PaginationMeta;
|
|
2943
|
+
}
|
|
2944
|
+
export interface TaxObject {
|
|
2945
|
+
/**
|
|
2946
|
+
* Unique identifier of the tax, created by Lago.
|
|
2947
|
+
* @format uuid
|
|
2948
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2949
|
+
*/
|
|
2950
|
+
lago_id: string;
|
|
2951
|
+
/**
|
|
2952
|
+
* Name of the tax.
|
|
2953
|
+
* @example "TVA"
|
|
2954
|
+
*/
|
|
2955
|
+
name: string;
|
|
2956
|
+
/**
|
|
2957
|
+
* Unique code used to identify the tax associated with the API request.
|
|
2958
|
+
* @example "french_standard_vat"
|
|
2959
|
+
*/
|
|
2960
|
+
code: string;
|
|
2961
|
+
/**
|
|
2962
|
+
* Internal description of the taxe
|
|
2963
|
+
* @example "French standard VAT"
|
|
2964
|
+
*/
|
|
2965
|
+
description?: string;
|
|
2966
|
+
/**
|
|
2967
|
+
* The percentage rate of the tax
|
|
2968
|
+
* @example 20
|
|
2969
|
+
*/
|
|
2970
|
+
rate: number;
|
|
2971
|
+
/**
|
|
2972
|
+
* Set to `true` if the tax is used as one of the organization's default
|
|
2973
|
+
* @example true
|
|
2974
|
+
*/
|
|
2975
|
+
applied_to_organization: boolean;
|
|
2976
|
+
/**
|
|
2977
|
+
* Number of add-ons this tax is applied to.
|
|
2978
|
+
* @example 0
|
|
2979
|
+
*/
|
|
2980
|
+
add_ons_count?: number;
|
|
2981
|
+
/**
|
|
2982
|
+
* Number of charges this tax is applied to.
|
|
2983
|
+
* @example 0
|
|
2984
|
+
*/
|
|
2985
|
+
charges_count?: number;
|
|
2986
|
+
/**
|
|
2987
|
+
* Number of customers this tax is applied to (directly or via the organization's default).
|
|
2988
|
+
* @example 0
|
|
2989
|
+
*/
|
|
2990
|
+
customers_count: number;
|
|
2991
|
+
/**
|
|
2992
|
+
* Number of plans this tax is applied to.
|
|
2993
|
+
* @example 0
|
|
2994
|
+
*/
|
|
2995
|
+
plans_count?: number;
|
|
2996
|
+
/**
|
|
2997
|
+
* Creation date of the tax.
|
|
2998
|
+
* @format date-time
|
|
2999
|
+
* @example "2023-07-06T14:35:58Z"
|
|
3000
|
+
*/
|
|
3001
|
+
created_at: string;
|
|
3002
|
+
}
|
|
3003
|
+
export interface TaxUpdateInput {
|
|
3004
|
+
tax: TaxBaseInput;
|
|
3005
|
+
}
|
|
3006
|
+
/** @example "America/Los_Angeles" */
|
|
3007
|
+
export type Timezone = "UTC" | "Africa/Algiers" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Monrovia" | "Africa/Nairobi" | "America/Argentina/Buenos_Aires" | "America/Bogota" | "America/Caracas" | "America/Chicago" | "America/Chihuahua" | "America/Denver" | "America/Godthab" | "America/Guatemala" | "America/Guyana" | "America/Halifax" | "America/Indiana/Indianapolis" | "America/Juneau" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Mazatlan" | "America/Mexico_City" | "America/Monterrey" | "America/Montevideo" | "America/New_York" | "America/Phoenix" | "America/Puerto_Rico" | "America/Regina" | "America/Santiago" | "America/Sao_Paulo" | "America/St_Johns" | "America/Tijuana" | "Asia/Almaty" | "Asia/Baghdad" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Dhaka" | "Asia/Hong_Kong" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kathmandu" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuwait" | "Asia/Magadan" | "Asia/Muscat" | "Asia/Novosibirsk" | "Asia/Rangoon" | "Asia/Riyadh" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tokyo" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Cape_Verde" | "Atlantic/South_Georgia" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Darwin" | "Australia/Hobart" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "Europe/Amsterdam" | "Europe/Athens" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Helsinki" | "Europe/Istanbul" | "Europe/Kaliningrad" | "Europe/Kiev" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Madrid" | "Europe/Minsk" | "Europe/Moscow" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zurich" | "GMT+12" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Chatham" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Majuro" | "Pacific/Midway" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Port_Moresby" | "Pacific/Tongatapu";
|
|
3008
|
+
export interface Wallet {
|
|
3009
|
+
wallet: WalletObject;
|
|
3010
|
+
}
|
|
3011
|
+
export interface WalletCreateInput {
|
|
3012
|
+
wallet?: {
|
|
3013
|
+
/**
|
|
3014
|
+
* The name of the wallet.
|
|
3015
|
+
* @example "Prepaid"
|
|
3016
|
+
*/
|
|
3017
|
+
name?: string;
|
|
3018
|
+
/**
|
|
3019
|
+
* The rate of conversion between credits and the amount in the specified currency. It indicates the ratio or factor used to convert credits into the corresponding monetary value in the currency of the transaction.
|
|
3020
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3021
|
+
* @example "1.5"
|
|
3022
|
+
*/
|
|
3023
|
+
rate_amount: string;
|
|
3024
|
+
/** The currency of the wallet. */
|
|
3025
|
+
currency: Currency;
|
|
3026
|
+
/**
|
|
3027
|
+
* The number of paid credits. Required only if there is no granted credits.
|
|
3028
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3029
|
+
* @example "20.0"
|
|
3030
|
+
*/
|
|
3031
|
+
paid_credits?: string | null;
|
|
3032
|
+
/**
|
|
3033
|
+
* The number of free granted credits. Required only if there is no paid credits.
|
|
3034
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3035
|
+
* @example "10.0"
|
|
3036
|
+
*/
|
|
3037
|
+
granted_credits?: string | null;
|
|
3038
|
+
/**
|
|
3039
|
+
* The customer external unique identifier (provided by your own application)
|
|
3040
|
+
* @example "hooli_1234"
|
|
3041
|
+
*/
|
|
3042
|
+
external_customer_id: string;
|
|
3043
|
+
/**
|
|
3044
|
+
* The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
|
|
3045
|
+
* @format date-time
|
|
3046
|
+
* @example "2022-07-07T23:59:59Z"
|
|
3047
|
+
*/
|
|
3048
|
+
expiration_at?: string | null;
|
|
3049
|
+
};
|
|
3050
|
+
}
|
|
3051
|
+
export interface WalletObject {
|
|
3052
|
+
/**
|
|
3053
|
+
* Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet’s record within the Lago system.
|
|
3054
|
+
* @format uuid
|
|
3055
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3056
|
+
*/
|
|
3057
|
+
lago_id: string;
|
|
3058
|
+
/**
|
|
3059
|
+
* Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer’s record within the Lago system.
|
|
3060
|
+
* @format uuid
|
|
3061
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3062
|
+
*/
|
|
3063
|
+
lago_customer_id: string;
|
|
3064
|
+
/**
|
|
3065
|
+
* The customer external unique identifier (provided by your own application)
|
|
3066
|
+
* @example "hooli_1234"
|
|
3067
|
+
*/
|
|
3068
|
+
external_customer_id: string;
|
|
3069
|
+
/**
|
|
3070
|
+
* The status of the wallet. Possible values are `active` or `terminated`.
|
|
3071
|
+
* @example "active"
|
|
3072
|
+
*/
|
|
3073
|
+
status: "active" | "terminated";
|
|
3074
|
+
/** The currency of the wallet. */
|
|
3075
|
+
currency: Currency;
|
|
3076
|
+
/**
|
|
3077
|
+
* The name of the wallet.
|
|
3078
|
+
* @example "Prepaid"
|
|
3079
|
+
*/
|
|
3080
|
+
name?: string;
|
|
3081
|
+
/**
|
|
3082
|
+
* The rate of conversion between credits and the amount in the specified currency. It indicates the ratio or factor used to convert credits into the corresponding monetary value in the currency of the transaction.
|
|
3083
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3084
|
+
* @example "1.5"
|
|
3085
|
+
*/
|
|
3086
|
+
rate_amount: string;
|
|
3087
|
+
/**
|
|
3088
|
+
* The current wallet balance expressed in credits.
|
|
3089
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3090
|
+
* @example "28.0"
|
|
3091
|
+
*/
|
|
3092
|
+
credits_balance: string;
|
|
3093
|
+
/**
|
|
3094
|
+
* The current wallet balance expressed in cents.
|
|
3095
|
+
* @example 1000
|
|
3096
|
+
*/
|
|
3097
|
+
balance_cents: number;
|
|
3098
|
+
/**
|
|
3099
|
+
* The number of consumed credits.
|
|
3100
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3101
|
+
* @example "2.0"
|
|
3102
|
+
*/
|
|
3103
|
+
consumed_credits: string;
|
|
3104
|
+
/**
|
|
3105
|
+
* The date of the wallet creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
3106
|
+
* @format date-time
|
|
3107
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3108
|
+
*/
|
|
3109
|
+
created_at: string;
|
|
3110
|
+
/**
|
|
3111
|
+
* The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
|
|
3112
|
+
* @format date-time
|
|
3113
|
+
* @example null
|
|
3114
|
+
*/
|
|
3115
|
+
expiration_at?: string | null;
|
|
3116
|
+
/**
|
|
3117
|
+
* The date and time of the last balance top-up. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
|
|
3118
|
+
* @format date-time
|
|
3119
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3120
|
+
*/
|
|
3121
|
+
last_balance_sync_at?: string | null;
|
|
3122
|
+
/**
|
|
3123
|
+
* The date and time of the last credits consumption. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
|
|
3124
|
+
* @format date-time
|
|
3125
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3126
|
+
*/
|
|
3127
|
+
last_consumed_credit_at?: string | null;
|
|
3128
|
+
/**
|
|
3129
|
+
* The date of terminaison of the wallet. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
|
|
3130
|
+
* @format date-time
|
|
3131
|
+
* @example "2022-09-14T16:35:31Z"
|
|
3132
|
+
*/
|
|
3133
|
+
terminated_at?: string | null;
|
|
3134
|
+
}
|
|
3135
|
+
export interface WalletsPaginated {
|
|
3136
|
+
wallets: WalletObject[];
|
|
3137
|
+
meta: PaginationMeta;
|
|
3138
|
+
}
|
|
3139
|
+
export interface WalletTransactionCreateInput {
|
|
3140
|
+
wallet_transaction: {
|
|
3141
|
+
/**
|
|
3142
|
+
* Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet’s record within the Lago system.
|
|
3143
|
+
* @format uuid
|
|
3144
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3145
|
+
*/
|
|
3146
|
+
wallet_id: string;
|
|
3147
|
+
/**
|
|
3148
|
+
* The number of paid credits. Required only if there is no granted credits.
|
|
3149
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3150
|
+
* @example "20.0"
|
|
3151
|
+
*/
|
|
3152
|
+
paid_credits?: string;
|
|
3153
|
+
/**
|
|
3154
|
+
* The number of free granted credits. Required only if there is no paid credits.
|
|
3155
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3156
|
+
* @example "10.0"
|
|
3157
|
+
*/
|
|
3158
|
+
granted_credits?: string;
|
|
3159
|
+
};
|
|
3160
|
+
}
|
|
3161
|
+
export interface WalletTransactionObject {
|
|
3162
|
+
/**
|
|
3163
|
+
* Unique identifier assigned to the wallet transaction within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet transaction’s record within the Lago system.
|
|
3164
|
+
* @format uuid
|
|
3165
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3166
|
+
*/
|
|
3167
|
+
lago_id: string;
|
|
3168
|
+
/**
|
|
3169
|
+
* Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet’s record within the Lago system.
|
|
3170
|
+
* @format uuid
|
|
3171
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3172
|
+
*/
|
|
3173
|
+
lago_wallet_id: string;
|
|
3174
|
+
/**
|
|
3175
|
+
* The status of the wallet transaction. Possible values are `pending` or `settled`.
|
|
3176
|
+
* @example "settled"
|
|
3177
|
+
*/
|
|
3178
|
+
status: "pending" | "settled";
|
|
3179
|
+
/**
|
|
3180
|
+
* The type of transaction. Possible values are `inbound` (increasing the balance) or `outbound` (decreasing the balance).
|
|
3181
|
+
* @example "inbound"
|
|
3182
|
+
*/
|
|
3183
|
+
transaction_type: "inbound" | "outbound";
|
|
3184
|
+
/**
|
|
3185
|
+
* The amount of credits based on the rate and the currency.
|
|
3186
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3187
|
+
* @example "10.0"
|
|
3188
|
+
*/
|
|
3189
|
+
amount: string;
|
|
3190
|
+
/**
|
|
3191
|
+
* The number of credits used in the wallet transaction.
|
|
3192
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3193
|
+
* @example "100.0"
|
|
3194
|
+
*/
|
|
3195
|
+
credit_amount: string;
|
|
3196
|
+
/**
|
|
3197
|
+
* The date when wallet transaction is settled, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
3198
|
+
* @format date-time
|
|
3199
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3200
|
+
*/
|
|
3201
|
+
settled_at?: string;
|
|
3202
|
+
/**
|
|
3203
|
+
* The date of the wallet transaction creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
3204
|
+
* @format date-time
|
|
3205
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3206
|
+
*/
|
|
3207
|
+
created_at: string;
|
|
3208
|
+
}
|
|
3209
|
+
export interface WalletTransactions {
|
|
3210
|
+
wallet_transactions: WalletTransactionObject[];
|
|
3211
|
+
}
|
|
3212
|
+
export type WalletTransactionsPaginated = WalletTransactions & {
|
|
3213
|
+
meta: PaginationMeta;
|
|
3214
|
+
};
|
|
3215
|
+
export interface WalletUpdateInput {
|
|
3216
|
+
wallet: {
|
|
3217
|
+
/**
|
|
3218
|
+
* The name of the wallet.
|
|
3219
|
+
* @example "new_name"
|
|
3220
|
+
*/
|
|
3221
|
+
name?: string | null;
|
|
3222
|
+
/**
|
|
3223
|
+
* The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
|
|
3224
|
+
* @format date-time
|
|
3225
|
+
* @example "2022-07-07T23:59:59Z"
|
|
3226
|
+
*/
|
|
3227
|
+
expiration_at?: string | null;
|
|
3228
|
+
};
|
|
3229
|
+
}
|
|
3230
|
+
export interface WebhookEndpoint {
|
|
3231
|
+
webhook_endpoint: WebhookEndpointObject;
|
|
3232
|
+
}
|
|
3233
|
+
export interface WebhookEndpointCreateInput {
|
|
3234
|
+
webhook_endpoint?: {
|
|
3235
|
+
/**
|
|
3236
|
+
* The URL of the webhook endpoint.
|
|
3237
|
+
* @example "https://foo.bar"
|
|
3238
|
+
*/
|
|
3239
|
+
webhook_url: string;
|
|
3240
|
+
/**
|
|
3241
|
+
* The signature used for the webhook. If no value is passed,
|
|
3242
|
+
* @example "hmac"
|
|
3243
|
+
*/
|
|
3244
|
+
signature_algo?: "jwt" | "hmac" | null;
|
|
3245
|
+
};
|
|
3246
|
+
}
|
|
3247
|
+
export interface WebhookEndpointObject {
|
|
3248
|
+
/**
|
|
3249
|
+
* Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the webhook endpoint's record within the Lago system.
|
|
3250
|
+
* @format uuid
|
|
3251
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3252
|
+
*/
|
|
3253
|
+
lago_id: string;
|
|
3254
|
+
/**
|
|
3255
|
+
* Unique identifier assigned to the organization attached to the webhook endpoint within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the organization’s record within the Lago system.
|
|
3256
|
+
* @format uuid
|
|
3257
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3258
|
+
*/
|
|
3259
|
+
lago_organization_id: string;
|
|
3260
|
+
/**
|
|
3261
|
+
* The name of the wallet.
|
|
3262
|
+
* @example "Prepaid"
|
|
3263
|
+
*/
|
|
3264
|
+
webhook_url: string;
|
|
3265
|
+
/**
|
|
3266
|
+
* The signature algo for the webhook.
|
|
3267
|
+
* @example "hmac"
|
|
3268
|
+
*/
|
|
3269
|
+
signature_algo?: "jwt" | "hmac";
|
|
3270
|
+
/**
|
|
3271
|
+
* The date of the webhook endpoint creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
3272
|
+
* @format date-time
|
|
3273
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3274
|
+
*/
|
|
3275
|
+
created_at: string;
|
|
3276
|
+
}
|
|
3277
|
+
export interface WebhookEndpointsPaginated {
|
|
3278
|
+
webhook_endpoints: WebhookEndpointObject[];
|
|
3279
|
+
meta: PaginationMeta;
|
|
3280
|
+
}
|
|
3281
|
+
export interface WebhookEndpointUpdateInput {
|
|
3282
|
+
webhook_endpoint?: {
|
|
3283
|
+
/**
|
|
3284
|
+
* The URL of the webhook endpoint.
|
|
3285
|
+
* @example "https://foo.bar"
|
|
3286
|
+
*/
|
|
3287
|
+
webhook_url: string;
|
|
3288
|
+
/**
|
|
3289
|
+
* The signature used for the webhook. If no value is passed,
|
|
3290
|
+
* @example "hmac"
|
|
3291
|
+
*/
|
|
3292
|
+
signature_algo?: "jwt" | "hmac" | null;
|
|
3293
|
+
};
|
|
3294
|
+
}
|
|
3295
|
+
export type QueryParamsType = Record<string | number, any>;
|
|
3296
|
+
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
|
|
3297
|
+
export interface FullRequestParams extends Omit<RequestInit, "body"> {
|
|
3298
|
+
/** set parameter to `true` for call `securityWorker` for this request */
|
|
3299
|
+
secure?: boolean;
|
|
3300
|
+
/** request path */
|
|
3301
|
+
path: string;
|
|
3302
|
+
/** content type of request body */
|
|
3303
|
+
type?: ContentType;
|
|
3304
|
+
/** query params */
|
|
3305
|
+
query?: QueryParamsType;
|
|
3306
|
+
/** format of response (i.e. response.json() -> format: "json") */
|
|
3307
|
+
format?: ResponseFormat;
|
|
3308
|
+
/** request body */
|
|
3309
|
+
body?: unknown;
|
|
3310
|
+
/** base url */
|
|
3311
|
+
baseUrl?: string;
|
|
3312
|
+
/** request cancellation token */
|
|
3313
|
+
cancelToken?: CancelToken;
|
|
3314
|
+
}
|
|
3315
|
+
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
|
|
3316
|
+
export interface ApiConfig<SecurityDataType = unknown> {
|
|
3317
|
+
baseUrl?: string;
|
|
3318
|
+
baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
|
|
3319
|
+
securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
|
|
3320
|
+
customFetch?: typeof fetch;
|
|
3321
|
+
}
|
|
3322
|
+
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
|
|
3323
|
+
data: D;
|
|
3324
|
+
error: E;
|
|
3325
|
+
}
|
|
3326
|
+
type CancelToken = Symbol | string | number;
|
|
3327
|
+
export declare enum ContentType {
|
|
3328
|
+
Json = "application/json",
|
|
3329
|
+
FormData = "multipart/form-data",
|
|
3330
|
+
UrlEncoded = "application/x-www-form-urlencoded",
|
|
3331
|
+
Text = "text/plain"
|
|
3332
|
+
}
|
|
3333
|
+
export declare class HttpClient<SecurityDataType = unknown> {
|
|
3334
|
+
baseUrl: string;
|
|
3335
|
+
private securityData;
|
|
3336
|
+
private securityWorker?;
|
|
3337
|
+
private abortControllers;
|
|
3338
|
+
private customFetch;
|
|
3339
|
+
private baseApiParams;
|
|
3340
|
+
constructor(apiConfig?: ApiConfig<SecurityDataType>);
|
|
3341
|
+
setSecurityData: (data: SecurityDataType | null) => void;
|
|
3342
|
+
protected encodeQueryParam(key: string, value: any): string;
|
|
3343
|
+
protected addQueryParam(query: QueryParamsType, key: string): string;
|
|
3344
|
+
protected addArrayQueryParam(query: QueryParamsType, key: string): any;
|
|
3345
|
+
protected toQueryString(rawQuery?: QueryParamsType): string;
|
|
3346
|
+
protected addQueryParams(rawQuery?: QueryParamsType): string;
|
|
3347
|
+
private contentFormatters;
|
|
3348
|
+
protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams;
|
|
3349
|
+
protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined;
|
|
3350
|
+
abortRequest: (cancelToken: CancelToken) => void;
|
|
3351
|
+
request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<HttpResponse<T, E>>;
|
|
3352
|
+
}
|
|
3353
|
+
/**
|
|
3354
|
+
* @title Lago API documentation
|
|
3355
|
+
* @version 0.48.0-beta
|
|
3356
|
+
* @license AGPLv3
|
|
3357
|
+
* @baseUrl https://api.getlago.com/api/v1
|
|
3358
|
+
* @externalDocs https://github.com/getlago
|
|
3359
|
+
* @contact <tech@getlago.com>
|
|
3360
|
+
*
|
|
3361
|
+
* Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
|
|
3362
|
+
*/
|
|
3363
|
+
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
3364
|
+
addOns: {
|
|
3365
|
+
/**
|
|
3366
|
+
* @description This endpoint is used to create an add-on that can be then attached to a one-off invoice.
|
|
3367
|
+
*
|
|
3368
|
+
* @tags add_ons
|
|
3369
|
+
* @name CreateAddOn
|
|
3370
|
+
* @summary Create an add-on
|
|
3371
|
+
* @request POST:/add_ons
|
|
3372
|
+
* @secure
|
|
3373
|
+
*/
|
|
3374
|
+
createAddOn: (data: AddOnCreateInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
3375
|
+
/**
|
|
3376
|
+
* @description This endpoint is used to list all existing add-ons.
|
|
3377
|
+
*
|
|
3378
|
+
* @tags add_ons
|
|
3379
|
+
* @name FindAllAddOns
|
|
3380
|
+
* @summary List all add-ons
|
|
3381
|
+
* @request GET:/add_ons
|
|
3382
|
+
* @secure
|
|
3383
|
+
*/
|
|
3384
|
+
findAllAddOns: (query?: {
|
|
3385
|
+
/**
|
|
3386
|
+
* Page number.
|
|
3387
|
+
* @example 1
|
|
3388
|
+
*/
|
|
3389
|
+
page?: number;
|
|
3390
|
+
/**
|
|
3391
|
+
* Number of records per page.
|
|
3392
|
+
* @example 20
|
|
3393
|
+
*/
|
|
3394
|
+
per_page?: number;
|
|
3395
|
+
}, params?: RequestParams) => Promise<HttpResponse<AddOnsPaginated, ApiErrorUnauthorized>>;
|
|
3396
|
+
/**
|
|
3397
|
+
* @description This endpoint is used to update an existing add-on.
|
|
3398
|
+
*
|
|
3399
|
+
* @tags add_ons
|
|
3400
|
+
* @name UpdateAddOn
|
|
3401
|
+
* @summary Update an add-on
|
|
3402
|
+
* @request PUT:/add_ons/{code}
|
|
3403
|
+
* @secure
|
|
3404
|
+
*/
|
|
3405
|
+
updateAddOn: (code: string, data: AddOnUpdateInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
3406
|
+
/**
|
|
3407
|
+
* @description This endpoint is used to retrieve a specific add-on.
|
|
3408
|
+
*
|
|
3409
|
+
* @tags add_ons
|
|
3410
|
+
* @name FindAddOn
|
|
3411
|
+
* @summary Retrieve an add-on
|
|
3412
|
+
* @request GET:/add_ons/{code}
|
|
3413
|
+
* @secure
|
|
3414
|
+
*/
|
|
3415
|
+
findAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3416
|
+
/**
|
|
3417
|
+
* @description This endpoint is used to delete an existing add-on.
|
|
3418
|
+
*
|
|
3419
|
+
* @tags add_ons
|
|
3420
|
+
* @name DestroyAddOn
|
|
3421
|
+
* @summary Delete an add-on
|
|
3422
|
+
* @request DELETE:/add_ons/{code}
|
|
3423
|
+
* @secure
|
|
3424
|
+
*/
|
|
3425
|
+
destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3426
|
+
};
|
|
3427
|
+
appliedCoupons: {
|
|
3428
|
+
/**
|
|
3429
|
+
* @description This endpoint is used to apply a specific coupon to a customer, before or during a subscription.
|
|
3430
|
+
*
|
|
3431
|
+
* @tags coupons
|
|
3432
|
+
* @name ApplyCoupon
|
|
3433
|
+
* @summary Apply a coupon to a customer
|
|
3434
|
+
* @request POST:/applied_coupons
|
|
3435
|
+
* @secure
|
|
3436
|
+
*/
|
|
3437
|
+
applyCoupon: (data: AppliedCouponInput, params?: RequestParams) => Promise<HttpResponse<AppliedCoupon, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
3438
|
+
/**
|
|
3439
|
+
* @description This endpoint is used to list all applied coupons. You can filter by coupon status and by customer.
|
|
3440
|
+
*
|
|
3441
|
+
* @tags coupons
|
|
3442
|
+
* @name FindAllAppliedCoupons
|
|
3443
|
+
* @summary List all applied coupons
|
|
3444
|
+
* @request GET:/applied_coupons
|
|
3445
|
+
* @secure
|
|
3446
|
+
*/
|
|
3447
|
+
findAllAppliedCoupons: (query?: {
|
|
3448
|
+
/**
|
|
3449
|
+
* Page number.
|
|
3450
|
+
* @example 1
|
|
3451
|
+
*/
|
|
3452
|
+
page?: number;
|
|
3453
|
+
/**
|
|
3454
|
+
* Number of records per page.
|
|
3455
|
+
* @example 20
|
|
3456
|
+
*/
|
|
3457
|
+
per_page?: number;
|
|
3458
|
+
/**
|
|
3459
|
+
* The status of the coupon. Can be either `active` or `terminated`.
|
|
3460
|
+
* @example "active"
|
|
3461
|
+
*/
|
|
3462
|
+
status?: "active" | "terminated";
|
|
3463
|
+
/**
|
|
3464
|
+
* The customer external unique identifier (provided by your own application)
|
|
3465
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3466
|
+
*/
|
|
3467
|
+
external_customer_id?: string;
|
|
3468
|
+
}, params?: RequestParams) => Promise<HttpResponse<AppliedCouponsPaginated, ApiErrorUnauthorized>>;
|
|
3469
|
+
};
|
|
3470
|
+
billableMetrics: {
|
|
3471
|
+
/**
|
|
3472
|
+
* @description This endpoint creates a new billable metric representing a pricing component of your application.
|
|
3473
|
+
*
|
|
3474
|
+
* @tags billable_metrics
|
|
3475
|
+
* @name CreateBillableMetric
|
|
3476
|
+
* @summary Create a billable metric
|
|
3477
|
+
* @request POST:/billable_metrics
|
|
3478
|
+
* @secure
|
|
3479
|
+
*/
|
|
3480
|
+
createBillableMetric: (data: BillableMetricCreateInput, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
3481
|
+
/**
|
|
3482
|
+
* @description This endpoint retrieves all existing billable metrics that represent pricing components of your application.
|
|
3483
|
+
*
|
|
3484
|
+
* @tags billable_metrics
|
|
3485
|
+
* @name FindAllBillableMetrics
|
|
3486
|
+
* @summary List all billable metrics
|
|
3487
|
+
* @request GET:/billable_metrics
|
|
3488
|
+
* @secure
|
|
3489
|
+
*/
|
|
3490
|
+
findAllBillableMetrics: (query?: {
|
|
3491
|
+
/**
|
|
3492
|
+
* Page number.
|
|
3493
|
+
* @example 1
|
|
3494
|
+
*/
|
|
3495
|
+
page?: number;
|
|
3496
|
+
/**
|
|
3497
|
+
* Number of records per page.
|
|
3498
|
+
* @example 20
|
|
3499
|
+
*/
|
|
3500
|
+
per_page?: number;
|
|
3501
|
+
}, params?: RequestParams) => Promise<HttpResponse<BillableMetricsPaginated, ApiErrorUnauthorized>>;
|
|
3502
|
+
/**
|
|
3503
|
+
* @description This endpoint updates an existing billable metric representing a pricing component of your application.
|
|
3504
|
+
*
|
|
3505
|
+
* @tags billable_metrics
|
|
3506
|
+
* @name UpdateBillableMetric
|
|
3507
|
+
* @summary Update a billable metric
|
|
3508
|
+
* @request PUT:/billable_metrics/{code}
|
|
3509
|
+
* @secure
|
|
3510
|
+
*/
|
|
3511
|
+
updateBillableMetric: (code: string, data: BillableMetricUpdateInput, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
3512
|
+
/**
|
|
3513
|
+
* @description This endpoint deletes an existing billable metric representing a pricing component of your application.
|
|
3514
|
+
*
|
|
3515
|
+
* @tags billable_metrics
|
|
3516
|
+
* @name DestroyBillableMetric
|
|
3517
|
+
* @summary Delete a billable metric
|
|
3518
|
+
* @request DELETE:/billable_metrics/{code}
|
|
3519
|
+
* @secure
|
|
3520
|
+
*/
|
|
3521
|
+
destroyBillableMetric: (code: string, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3522
|
+
/**
|
|
3523
|
+
* @description This endpoint retrieves an existing billable metric that represents a pricing component of your application. The billable metric is identified by its unique code.
|
|
3524
|
+
*
|
|
3525
|
+
* @tags billable_metrics
|
|
3526
|
+
* @name FindBillableMetric
|
|
3527
|
+
* @summary Retrieve a billable metric
|
|
3528
|
+
* @request GET:/billable_metrics/{code}
|
|
3529
|
+
* @secure
|
|
3530
|
+
*/
|
|
3531
|
+
findBillableMetric: (code: string, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3532
|
+
/**
|
|
3533
|
+
* @description This endpoint retrieves all groups for a billable metric.
|
|
3534
|
+
*
|
|
3535
|
+
* @tags billable_metrics
|
|
3536
|
+
* @name FindAllBillableMetricGroups
|
|
3537
|
+
* @summary Find a billable metric's groups
|
|
3538
|
+
* @request GET:/billable_metrics/{code}/groups
|
|
3539
|
+
* @secure
|
|
3540
|
+
*/
|
|
3541
|
+
findAllBillableMetricGroups: (code: string, query?: {
|
|
3542
|
+
/**
|
|
3543
|
+
* Page number.
|
|
3544
|
+
* @example 1
|
|
3545
|
+
*/
|
|
3546
|
+
page?: number;
|
|
3547
|
+
/**
|
|
3548
|
+
* Number of records per page.
|
|
3549
|
+
* @example 20
|
|
3550
|
+
*/
|
|
3551
|
+
per_page?: number;
|
|
3552
|
+
}, params?: RequestParams) => Promise<HttpResponse<GroupsPaginated, ApiErrorUnauthorized>>;
|
|
3553
|
+
};
|
|
3554
|
+
coupons: {
|
|
3555
|
+
/**
|
|
3556
|
+
* @description This endpoint is used to create a coupon that can be then attached to a customer to create a discount.
|
|
3557
|
+
*
|
|
3558
|
+
* @tags coupons
|
|
3559
|
+
* @name CreateCoupon
|
|
3560
|
+
* @summary Create a coupon
|
|
3561
|
+
* @request POST:/coupons
|
|
3562
|
+
* @secure
|
|
3563
|
+
*/
|
|
3564
|
+
createCoupon: (data: CouponCreateInput, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
3565
|
+
/**
|
|
3566
|
+
* @description This endpoint is used to list all existing coupons.
|
|
3567
|
+
*
|
|
3568
|
+
* @tags coupons
|
|
3569
|
+
* @name FindAllCoupons
|
|
3570
|
+
* @summary List all coupons
|
|
3571
|
+
* @request GET:/coupons
|
|
3572
|
+
* @secure
|
|
3573
|
+
*/
|
|
3574
|
+
findAllCoupons: (query?: {
|
|
3575
|
+
/**
|
|
3576
|
+
* Page number.
|
|
3577
|
+
* @example 1
|
|
3578
|
+
*/
|
|
3579
|
+
page?: number;
|
|
3580
|
+
/**
|
|
3581
|
+
* Number of records per page.
|
|
3582
|
+
* @example 20
|
|
3583
|
+
*/
|
|
3584
|
+
per_page?: number;
|
|
3585
|
+
}, params?: RequestParams) => Promise<HttpResponse<CouponsPaginated, ApiErrorUnauthorized>>;
|
|
3586
|
+
/**
|
|
3587
|
+
* @description This endpoint is used to update a coupon that can be then attached to a customer to create a discount.
|
|
3588
|
+
*
|
|
3589
|
+
* @tags coupons
|
|
3590
|
+
* @name UpdateCoupon
|
|
3591
|
+
* @summary Update a coupon
|
|
3592
|
+
* @request PUT:/coupons/{code}
|
|
3593
|
+
* @secure
|
|
3594
|
+
*/
|
|
3595
|
+
updateCoupon: (code: string, data: CouponUpdateInput, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
3596
|
+
/**
|
|
3597
|
+
* @description This endpoint is used to retrieve a specific coupon.
|
|
3598
|
+
*
|
|
3599
|
+
* @tags coupons
|
|
3600
|
+
* @name FindCoupon
|
|
3601
|
+
* @summary Retrieve a coupon
|
|
3602
|
+
* @request GET:/coupons/{code}
|
|
3603
|
+
* @secure
|
|
3604
|
+
*/
|
|
3605
|
+
findCoupon: (code: string, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3606
|
+
/**
|
|
3607
|
+
* @description This endpoint is used to delete a coupon.
|
|
3608
|
+
*
|
|
3609
|
+
* @tags coupons
|
|
3610
|
+
* @name DestroyCoupon
|
|
3611
|
+
* @summary Delete a coupon
|
|
3612
|
+
* @request DELETE:/coupons/{code}
|
|
3613
|
+
* @secure
|
|
3614
|
+
*/
|
|
3615
|
+
destroyCoupon: (code: string, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3616
|
+
};
|
|
3617
|
+
creditNotes: {
|
|
3618
|
+
/**
|
|
3619
|
+
* @description This endpoint creates a new credit note.
|
|
3620
|
+
*
|
|
3621
|
+
* @tags credit_notes
|
|
3622
|
+
* @name CreateCreditNote
|
|
3623
|
+
* @summary Create a credit note
|
|
3624
|
+
* @request POST:/credit_notes
|
|
3625
|
+
* @secure
|
|
3626
|
+
*/
|
|
3627
|
+
createCreditNote: (data: CreditNoteCreateInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
3628
|
+
/**
|
|
3629
|
+
* @description This endpoint list all existing credit notes.
|
|
3630
|
+
*
|
|
3631
|
+
* @tags credit_notes
|
|
3632
|
+
* @name FindAllCreditNotes
|
|
3633
|
+
* @summary List all credit notes
|
|
3634
|
+
* @request GET:/credit_notes
|
|
3635
|
+
* @secure
|
|
3636
|
+
*/
|
|
3637
|
+
findAllCreditNotes: (query?: {
|
|
3638
|
+
/**
|
|
3639
|
+
* Page number.
|
|
3640
|
+
* @example 1
|
|
3641
|
+
*/
|
|
3642
|
+
page?: number;
|
|
3643
|
+
/**
|
|
3644
|
+
* Number of records per page.
|
|
3645
|
+
* @example 20
|
|
3646
|
+
*/
|
|
3647
|
+
per_page?: number;
|
|
3648
|
+
/**
|
|
3649
|
+
* Unique identifier assigned to the customer in your application.
|
|
3650
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3651
|
+
*/
|
|
3652
|
+
external_customer_id?: string;
|
|
3653
|
+
}, params?: RequestParams) => Promise<HttpResponse<CreditNotes, ApiErrorUnauthorized>>;
|
|
3654
|
+
/**
|
|
3655
|
+
* @description This endpoint updates an existing credit note.
|
|
3656
|
+
*
|
|
3657
|
+
* @tags credit_notes
|
|
3658
|
+
* @name UpdateCreditNote
|
|
3659
|
+
* @summary Update a credit note
|
|
3660
|
+
* @request PUT:/credit_notes/{lago_id}
|
|
3661
|
+
* @secure
|
|
3662
|
+
*/
|
|
3663
|
+
updateCreditNote: (lagoId: string, data: CreditNoteUpdateInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
3664
|
+
/**
|
|
3665
|
+
* @description This endpoint retrieves an existing credit note.
|
|
3666
|
+
*
|
|
3667
|
+
* @tags credit_notes
|
|
3668
|
+
* @name FindCreditNote
|
|
3669
|
+
* @summary Retrieve a credit note
|
|
3670
|
+
* @request GET:/credit_notes/{lago_id}
|
|
3671
|
+
* @secure
|
|
3672
|
+
*/
|
|
3673
|
+
findCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3674
|
+
/**
|
|
3675
|
+
* @description This endpoint downloads the PDF of an existing credit note.
|
|
3676
|
+
*
|
|
3677
|
+
* @tags credit_notes
|
|
3678
|
+
* @name DownloadCreditNote
|
|
3679
|
+
* @summary Download a credit note PDF
|
|
3680
|
+
* @request POST:/credit_notes/{lago_id}/download
|
|
3681
|
+
* @secure
|
|
3682
|
+
*/
|
|
3683
|
+
downloadCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3684
|
+
/**
|
|
3685
|
+
* @description This endpoint voids an existing credit note.
|
|
3686
|
+
*
|
|
3687
|
+
* @tags credit_notes
|
|
3688
|
+
* @name VoidCreditNote
|
|
3689
|
+
* @summary Void a credit note
|
|
3690
|
+
* @request PUT:/credit_notes/{lago_id}/void
|
|
3691
|
+
* @secure
|
|
3692
|
+
*/
|
|
3693
|
+
voidCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
|
|
3694
|
+
};
|
|
3695
|
+
customers: {
|
|
3696
|
+
/**
|
|
3697
|
+
* @description This endpoint creates a new customer.
|
|
3698
|
+
*
|
|
3699
|
+
* @tags customers
|
|
3700
|
+
* @name CreateCustomer
|
|
3701
|
+
* @summary Create a customer
|
|
3702
|
+
* @request POST:/customers
|
|
3703
|
+
* @secure
|
|
3704
|
+
*/
|
|
3705
|
+
createCustomer: (data: CustomerCreateInput, params?: RequestParams) => Promise<HttpResponse<Customer, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
3706
|
+
/**
|
|
3707
|
+
* @description This endpoint retrieves all existing customers.
|
|
3708
|
+
*
|
|
3709
|
+
* @tags customers
|
|
3710
|
+
* @name FindAllCustomers
|
|
3711
|
+
* @summary List all customers
|
|
3712
|
+
* @request GET:/customers
|
|
3713
|
+
* @secure
|
|
3714
|
+
*/
|
|
3715
|
+
findAllCustomers: (query?: {
|
|
3716
|
+
/**
|
|
3717
|
+
* Page number.
|
|
3718
|
+
* @example 1
|
|
3719
|
+
*/
|
|
3720
|
+
page?: number;
|
|
3721
|
+
/**
|
|
3722
|
+
* Number of records per page.
|
|
3723
|
+
* @example 20
|
|
3724
|
+
*/
|
|
3725
|
+
per_page?: number;
|
|
3726
|
+
}, params?: RequestParams) => Promise<HttpResponse<CustomersPaginated, ApiErrorUnauthorized>>;
|
|
3727
|
+
/**
|
|
3728
|
+
* @description This endpoint retrieves an existing customer.
|
|
3729
|
+
*
|
|
3730
|
+
* @tags customers
|
|
3731
|
+
* @name FindCustomer
|
|
3732
|
+
* @summary Retrieve a customer
|
|
3733
|
+
* @request GET:/customers/{external_id}
|
|
3734
|
+
* @secure
|
|
3735
|
+
*/
|
|
3736
|
+
findCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3737
|
+
/**
|
|
3738
|
+
* @description This endpoint deletes an existing customer.
|
|
3739
|
+
*
|
|
3740
|
+
* @tags customers
|
|
3741
|
+
* @name DestroyCustomer
|
|
3742
|
+
* @summary Delete a customer
|
|
3743
|
+
* @request DELETE:/customers/{external_id}
|
|
3744
|
+
* @secure
|
|
3745
|
+
*/
|
|
3746
|
+
destroyCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3747
|
+
/**
|
|
3748
|
+
* @description This endpoint is used to delete a specific coupon that has been applied to a customer.
|
|
3749
|
+
*
|
|
3750
|
+
* @tags coupons, customers
|
|
3751
|
+
* @name DeleteAppliedCoupon
|
|
3752
|
+
* @summary Delete an applied coupon
|
|
3753
|
+
* @request DELETE:/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}
|
|
3754
|
+
* @secure
|
|
3755
|
+
*/
|
|
3756
|
+
deleteAppliedCoupon: (externalCustomerId: string, appliedCouponId: string, params?: RequestParams) => Promise<HttpResponse<AppliedCoupon, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3757
|
+
/**
|
|
3758
|
+
* @description Retrieves an embeddable link for displaying a customer portal. This endpoint allows you to fetch the URL that can be embedded to provide customers access to a dedicated portal
|
|
3759
|
+
*
|
|
3760
|
+
* @tags customers
|
|
3761
|
+
* @name GetCustomerPortalUrl
|
|
3762
|
+
* @summary Get a customer portal URL
|
|
3763
|
+
* @request GET:/customers/{external_customer_id}/portal_url
|
|
3764
|
+
* @secure
|
|
3765
|
+
*/
|
|
3766
|
+
getCustomerPortalUrl: (externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<{
|
|
3767
|
+
customer: {
|
|
3768
|
+
/**
|
|
3769
|
+
* An embeddable link for displaying a customer portal
|
|
3770
|
+
* @example "https://app.lago.com/customer-portal/1234567890"
|
|
3771
|
+
*/
|
|
3772
|
+
portal_url: string;
|
|
3773
|
+
};
|
|
3774
|
+
}, ApiErrorForbidden | ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3775
|
+
/**
|
|
3776
|
+
* @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period.
|
|
3777
|
+
*
|
|
3778
|
+
* @tags customers
|
|
3779
|
+
* @name FindCustomerCurrentUsage
|
|
3780
|
+
* @summary Retrieve customer current usage
|
|
3781
|
+
* @request GET:/customers/{external_customer_id}/current_usage
|
|
3782
|
+
* @secure
|
|
3783
|
+
*/
|
|
3784
|
+
findCustomerCurrentUsage: (externalCustomerId: string, query: {
|
|
3785
|
+
/**
|
|
3786
|
+
* The unique identifier of the subscription within your application.
|
|
3787
|
+
* @example "sub_1234567890"
|
|
3788
|
+
*/
|
|
3789
|
+
external_subscription_id: string;
|
|
3790
|
+
}, params?: RequestParams) => Promise<HttpResponse<CustomerUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3791
|
+
};
|
|
3792
|
+
events: {
|
|
3793
|
+
/**
|
|
3794
|
+
* @description This endpoint is used for transmitting usage measurement events to either a designated customer or a specific subscription.
|
|
3795
|
+
*
|
|
3796
|
+
* @tags events
|
|
3797
|
+
* @name CreateEvent
|
|
3798
|
+
* @summary Send usage events
|
|
3799
|
+
* @request POST:/events
|
|
3800
|
+
* @secure
|
|
3801
|
+
*/
|
|
3802
|
+
createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
3803
|
+
/**
|
|
3804
|
+
* @description This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer.
|
|
3805
|
+
*
|
|
3806
|
+
* @tags events
|
|
3807
|
+
* @name CreateBatchEvents
|
|
3808
|
+
* @summary Batch multiple events
|
|
3809
|
+
* @request POST:/events/batch
|
|
3810
|
+
* @secure
|
|
3811
|
+
*/
|
|
3812
|
+
createBatchEvents: (data: EventBatchInput, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
3813
|
+
/**
|
|
3814
|
+
* @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple pay in advance charges
|
|
3815
|
+
*
|
|
3816
|
+
* @tags events
|
|
3817
|
+
* @name EventEstimateFees
|
|
3818
|
+
* @summary Estimate fees for a pay in advance charge
|
|
3819
|
+
* @request POST:/events/estimate_fees
|
|
3820
|
+
* @secure
|
|
3821
|
+
*/
|
|
3822
|
+
eventEstimateFees: (data: EventEstimateFeesInput, params?: RequestParams) => Promise<HttpResponse<Fees, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
3823
|
+
/**
|
|
3824
|
+
* @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
|
|
3825
|
+
*
|
|
3826
|
+
* @tags events
|
|
3827
|
+
* @name FindEvent
|
|
3828
|
+
* @summary Retrieve a specific event
|
|
3829
|
+
* @request GET:/events/{transaction_id}
|
|
3830
|
+
* @secure
|
|
3831
|
+
*/
|
|
3832
|
+
findEvent: (transactionId: string, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3833
|
+
};
|
|
3834
|
+
fees: {
|
|
3835
|
+
/**
|
|
3836
|
+
* @description This endpoint is used for retrieving all fees that has been issued.
|
|
3837
|
+
*
|
|
3838
|
+
* @tags fees
|
|
3839
|
+
* @name FindAllFees
|
|
3840
|
+
* @summary List all fees
|
|
3841
|
+
* @request GET:/fees
|
|
3842
|
+
* @secure
|
|
3843
|
+
*/
|
|
3844
|
+
findAllFees: (query?: {
|
|
3845
|
+
/**
|
|
3846
|
+
* Page number.
|
|
3847
|
+
* @example 1
|
|
3848
|
+
*/
|
|
3849
|
+
page?: number;
|
|
3850
|
+
/**
|
|
3851
|
+
* Number of records per page.
|
|
3852
|
+
* @example 20
|
|
3853
|
+
*/
|
|
3854
|
+
per_page?: number;
|
|
3855
|
+
/**
|
|
3856
|
+
* Unique identifier assigned to the customer in your application.
|
|
3857
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3858
|
+
*/
|
|
3859
|
+
external_customer_id?: string;
|
|
3860
|
+
/**
|
|
3861
|
+
* External subscription ID
|
|
3862
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3863
|
+
*/
|
|
3864
|
+
external_subscription_id?: string;
|
|
3865
|
+
/** Filter results by fee’s currency. */
|
|
3866
|
+
currency?: Currency;
|
|
3867
|
+
/**
|
|
3868
|
+
* The fee type. Possible values are `add-on`, `charge`, `credit` or `subscription`.
|
|
3869
|
+
* @example "charge"
|
|
3870
|
+
*/
|
|
3871
|
+
fee_type?: "charge" | "add_on" | "subscription" | "credit" | "instant_charge";
|
|
3872
|
+
/**
|
|
3873
|
+
* Filter results by the `code` of the billable metric attached to the fee. Only applies to `charge` types.
|
|
3874
|
+
* @example "bm_code"
|
|
3875
|
+
*/
|
|
3876
|
+
billable_metric_code?: string;
|
|
3877
|
+
/**
|
|
3878
|
+
* Indicates the payment status of the fee. It represents the current status of the payment associated with the fee. The possible values for this field are `pending`, `succeeded`, `failed` and refunded`.
|
|
3879
|
+
* @example "succeeded"
|
|
3880
|
+
*/
|
|
3881
|
+
payment_status?: "pending" | "succeeded" | "failed" | "refunded";
|
|
3882
|
+
/**
|
|
3883
|
+
* Filter results created after creation date and time in UTC.
|
|
3884
|
+
* @format date-time
|
|
3885
|
+
* @example "2023-03-28T12:21:51Z"
|
|
3886
|
+
*/
|
|
3887
|
+
created_at_from?: string;
|
|
3888
|
+
/**
|
|
3889
|
+
* Filter results created before creation date and time in UTC.
|
|
3890
|
+
* @format date-time
|
|
3891
|
+
* @example "2023-03-28T12:21:51Z"
|
|
3892
|
+
*/
|
|
3893
|
+
created_at_to?: string;
|
|
3894
|
+
/**
|
|
3895
|
+
* Filter results with payment success after creation date and time in UTC.
|
|
3896
|
+
* @format date-time
|
|
3897
|
+
* @example "2023-03-28T12:21:51Z"
|
|
3898
|
+
*/
|
|
3899
|
+
succeeded_at_from?: string;
|
|
3900
|
+
/**
|
|
3901
|
+
* Filter results with payment success after creation date and time in UTC.
|
|
3902
|
+
* @format date-time
|
|
3903
|
+
* @example "2023-03-28T12:21:51Z"
|
|
3904
|
+
*/
|
|
3905
|
+
succeeded_at_to?: string;
|
|
3906
|
+
/**
|
|
3907
|
+
* Filter results with payment failure after creation date and time in UTC.
|
|
3908
|
+
* @format date-time
|
|
3909
|
+
* @example "2023-03-28T12:21:51Z"
|
|
3910
|
+
*/
|
|
3911
|
+
failed_at_from?: string;
|
|
3912
|
+
/**
|
|
3913
|
+
* Filter results with payment failure after creation date and time in UTC.
|
|
3914
|
+
* @format date-time
|
|
3915
|
+
* @example "2023-03-28T12:21:51Z"
|
|
3916
|
+
*/
|
|
3917
|
+
failed_at_to?: string;
|
|
3918
|
+
/**
|
|
3919
|
+
* Filter results with payment refund after creation date and time in UTC.
|
|
3920
|
+
* @format date-time
|
|
3921
|
+
* @example "2023-03-28T12:21:51Z"
|
|
3922
|
+
*/
|
|
3923
|
+
refunded_at_from?: string;
|
|
3924
|
+
/**
|
|
3925
|
+
* Filter results with payment refund after creation date and time in UTC.
|
|
3926
|
+
* @format date-time
|
|
3927
|
+
* @example "2023-03-28T12:21:51Z"
|
|
3928
|
+
*/
|
|
3929
|
+
refunded_at_to?: string;
|
|
3930
|
+
}, params?: RequestParams) => Promise<HttpResponse<FeesPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
3931
|
+
/**
|
|
3932
|
+
* @description This endpoint is used for retrieving a specific fee that has been issued.
|
|
3933
|
+
*
|
|
3934
|
+
* @tags fees
|
|
3935
|
+
* @name FindFee
|
|
3936
|
+
* @summary Retrieve a specific fee
|
|
3937
|
+
* @request GET:/fees/{lago_id}
|
|
3938
|
+
* @secure
|
|
3939
|
+
*/
|
|
3940
|
+
findFee: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Fee, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3941
|
+
/**
|
|
3942
|
+
* @description This endpoint is used for updating a specific fee that has been issued.
|
|
3943
|
+
*
|
|
3944
|
+
* @tags fees
|
|
3945
|
+
* @name UpdateFee
|
|
3946
|
+
* @summary Update a fee
|
|
3947
|
+
* @request PUT:/fees/{lago_id}
|
|
3948
|
+
* @secure
|
|
3949
|
+
*/
|
|
3950
|
+
updateFee: (lagoId: string, data: FeeUpdateInput, params?: RequestParams) => Promise<HttpResponse<Fee, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
3951
|
+
};
|
|
3952
|
+
invoices: {
|
|
3953
|
+
/**
|
|
3954
|
+
* @description This endpoint is used for issuing a one-off invoice.
|
|
3955
|
+
*
|
|
3956
|
+
* @tags invoices
|
|
3957
|
+
* @name CreateInvoice
|
|
3958
|
+
* @summary Create a one-off invoice
|
|
3959
|
+
* @request POST:/invoices
|
|
3960
|
+
* @secure
|
|
3961
|
+
*/
|
|
3962
|
+
createInvoice: (data: InvoiceOneOffCreateInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
3963
|
+
/**
|
|
3964
|
+
* @description This endpoint is used for retrievign all invoices.
|
|
3965
|
+
*
|
|
3966
|
+
* @tags invoices
|
|
3967
|
+
* @name FindAllInvoices
|
|
3968
|
+
* @summary List all invoices
|
|
3969
|
+
* @request GET:/invoices
|
|
3970
|
+
* @secure
|
|
3971
|
+
*/
|
|
3972
|
+
findAllInvoices: (query?: {
|
|
3973
|
+
/**
|
|
3974
|
+
* Page number.
|
|
3975
|
+
* @example 1
|
|
3976
|
+
*/
|
|
3977
|
+
page?: number;
|
|
3978
|
+
/**
|
|
3979
|
+
* Number of records per page.
|
|
3980
|
+
* @example 20
|
|
3981
|
+
*/
|
|
3982
|
+
per_page?: number;
|
|
3983
|
+
/**
|
|
3984
|
+
* Unique identifier assigned to the customer in your application.
|
|
3985
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3986
|
+
*/
|
|
3987
|
+
external_customer_id?: string;
|
|
3988
|
+
/**
|
|
3989
|
+
* Filter invoices starting from a specific date.
|
|
3990
|
+
* @format date
|
|
3991
|
+
* @example "2022-07-08"
|
|
3992
|
+
*/
|
|
3993
|
+
issuing_date_from?: string;
|
|
3994
|
+
/**
|
|
3995
|
+
* Filter invoices up to a specific date.
|
|
3996
|
+
* @format date
|
|
3997
|
+
* @example "2022-08-09"
|
|
3998
|
+
*/
|
|
3999
|
+
issuing_date_to?: string;
|
|
4000
|
+
/** Filter invoices by status. Possible values are `draft` or `finalized`. */
|
|
4001
|
+
status?: "draft" | "finalized";
|
|
4002
|
+
/** Filter invoices by payment status. Possible values are `pending`, `failed` or `succeeded`. */
|
|
4003
|
+
payment_status?: "pending" | "failed" | "succeeded";
|
|
4004
|
+
}, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized>>;
|
|
4005
|
+
/**
|
|
4006
|
+
* @description This endpoint is used for updating an existing invoice.
|
|
4007
|
+
*
|
|
4008
|
+
* @tags invoices
|
|
4009
|
+
* @name UpdateInvoice
|
|
4010
|
+
* @summary Update an invoice
|
|
4011
|
+
* @request PUT:/invoices/{lago_id}
|
|
4012
|
+
* @secure
|
|
4013
|
+
*/
|
|
4014
|
+
updateInvoice: (lagoId: string, data: InvoiceUpdateInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4015
|
+
/**
|
|
4016
|
+
* @description This endpoint is used for retrieving a specific invoice that has been issued.
|
|
4017
|
+
*
|
|
4018
|
+
* @tags invoices
|
|
4019
|
+
* @name FindInvoice
|
|
4020
|
+
* @summary Retrieve an invoice
|
|
4021
|
+
* @request GET:/invoices/{lago_id}
|
|
4022
|
+
* @secure
|
|
4023
|
+
*/
|
|
4024
|
+
findInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4025
|
+
/**
|
|
4026
|
+
* @description This endpoint is used for downloading a specific invoice PDF document.
|
|
4027
|
+
*
|
|
4028
|
+
* @tags invoices
|
|
4029
|
+
* @name DownloadInvoice
|
|
4030
|
+
* @summary Download an invoice PDF
|
|
4031
|
+
* @request POST:/invoices/{lago_id}/download
|
|
4032
|
+
* @secure
|
|
4033
|
+
*/
|
|
4034
|
+
downloadInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4035
|
+
/**
|
|
4036
|
+
* @description This endpoint is used for finalizing a draft invoice.
|
|
4037
|
+
*
|
|
4038
|
+
* @tags invoices
|
|
4039
|
+
* @name FinalizeInvoice
|
|
4040
|
+
* @summary Finalize a draft invoice
|
|
4041
|
+
* @request PUT:/invoices/{lago_id}/finalize
|
|
4042
|
+
* @secure
|
|
4043
|
+
*/
|
|
4044
|
+
finalizeInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4045
|
+
/**
|
|
4046
|
+
* @description This endpoint is used for refreshing a draft invoice.
|
|
4047
|
+
*
|
|
4048
|
+
* @tags invoices
|
|
4049
|
+
* @name RefreshInvoice
|
|
4050
|
+
* @summary Refresh a draft invoice
|
|
4051
|
+
* @request PUT:/invoices/{lago_id}/refresh
|
|
4052
|
+
* @secure
|
|
4053
|
+
*/
|
|
4054
|
+
refreshInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4055
|
+
/**
|
|
4056
|
+
* @description This endpoint resends an invoice for collection and retry a payment.
|
|
4057
|
+
*
|
|
4058
|
+
* @tags invoices
|
|
4059
|
+
* @name RetryPayment
|
|
4060
|
+
* @summary Retry an invoice payment
|
|
4061
|
+
* @request POST:/invoices/{lago_id}/retry_payment
|
|
4062
|
+
* @secure
|
|
4063
|
+
*/
|
|
4064
|
+
retryPayment: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
|
|
4065
|
+
};
|
|
4066
|
+
organizations: {
|
|
4067
|
+
/**
|
|
4068
|
+
* @description This endpoint is used to update your own organization's settings.
|
|
4069
|
+
*
|
|
4070
|
+
* @tags organizations
|
|
4071
|
+
* @name UpdateOrganization
|
|
4072
|
+
* @summary Update your organization
|
|
4073
|
+
* @request PUT:/organizations
|
|
4074
|
+
* @secure
|
|
4075
|
+
*/
|
|
4076
|
+
updateOrganization: (data: OrganizationUpdateInput, params?: RequestParams) => Promise<HttpResponse<Organization, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
4077
|
+
};
|
|
4078
|
+
plans: {
|
|
4079
|
+
/**
|
|
4080
|
+
* @description This endpoint creates a plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.
|
|
4081
|
+
*
|
|
4082
|
+
* @tags plans
|
|
4083
|
+
* @name CreatePlan
|
|
4084
|
+
* @summary Create a plan
|
|
4085
|
+
* @request POST:/plans
|
|
4086
|
+
* @secure
|
|
4087
|
+
*/
|
|
4088
|
+
createPlan: (data: PlanCreateInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4089
|
+
/**
|
|
4090
|
+
* @description This endpoint retrieves all existing plans.
|
|
4091
|
+
*
|
|
4092
|
+
* @tags plans
|
|
4093
|
+
* @name FindAllPlans
|
|
4094
|
+
* @summary List all plans
|
|
4095
|
+
* @request GET:/plans
|
|
4096
|
+
* @secure
|
|
4097
|
+
*/
|
|
4098
|
+
findAllPlans: (query?: {
|
|
4099
|
+
/**
|
|
4100
|
+
* Page number.
|
|
4101
|
+
* @example 1
|
|
4102
|
+
*/
|
|
4103
|
+
page?: number;
|
|
4104
|
+
/**
|
|
4105
|
+
* Number of records per page.
|
|
4106
|
+
* @example 20
|
|
4107
|
+
*/
|
|
4108
|
+
per_page?: number;
|
|
4109
|
+
}, params?: RequestParams) => Promise<HttpResponse<PlansPaginated, ApiErrorUnauthorized>>;
|
|
4110
|
+
/**
|
|
4111
|
+
* @description This endpoint updates a specific plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.
|
|
4112
|
+
*
|
|
4113
|
+
* @tags plans
|
|
4114
|
+
* @name UpdatePlan
|
|
4115
|
+
* @summary Update a plan
|
|
4116
|
+
* @request PUT:/plans/{code}
|
|
4117
|
+
* @secure
|
|
4118
|
+
*/
|
|
4119
|
+
updatePlan: (code: string, data: PlanUpdateInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4120
|
+
/**
|
|
4121
|
+
* @description This endpoint retrieves a specific plan.
|
|
4122
|
+
*
|
|
4123
|
+
* @tags plans
|
|
4124
|
+
* @name FindPlan
|
|
4125
|
+
* @summary Retrieve a plan
|
|
4126
|
+
* @request GET:/plans/{code}
|
|
4127
|
+
* @secure
|
|
4128
|
+
*/
|
|
4129
|
+
findPlan: (code: string, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4130
|
+
/**
|
|
4131
|
+
* @description This endpoint deletes a specific plan. Note that this plan could be associated with active subscriptions.
|
|
4132
|
+
*
|
|
4133
|
+
* @tags plans
|
|
4134
|
+
* @name DestroyPlan
|
|
4135
|
+
* @summary Delete a plan
|
|
4136
|
+
* @request DELETE:/plans/{code}
|
|
4137
|
+
* @secure
|
|
4138
|
+
*/
|
|
4139
|
+
destroyPlan: (code: string, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4140
|
+
};
|
|
4141
|
+
subscriptions: {
|
|
4142
|
+
/**
|
|
4143
|
+
* @description This endpoint assigns a plan to a customer, creating or modifying a subscription. Ideal for initial subscriptions or plan changes (upgrades/downgrades).
|
|
4144
|
+
*
|
|
4145
|
+
* @tags subscriptions
|
|
4146
|
+
* @name CreateSubscription
|
|
4147
|
+
* @summary Assign a plan to a customer
|
|
4148
|
+
* @request POST:/subscriptions
|
|
4149
|
+
* @secure
|
|
4150
|
+
*/
|
|
4151
|
+
createSubscription: (data: SubscriptionCreateInput, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4152
|
+
/**
|
|
4153
|
+
* @description This endpoint retrieves all active subscriptions.
|
|
4154
|
+
*
|
|
4155
|
+
* @tags subscriptions
|
|
4156
|
+
* @name FindAllSubscriptions
|
|
4157
|
+
* @summary List all subscriptions
|
|
4158
|
+
* @request GET:/subscriptions
|
|
4159
|
+
* @secure
|
|
4160
|
+
*/
|
|
4161
|
+
findAllSubscriptions: (query?: {
|
|
4162
|
+
/**
|
|
4163
|
+
* Page number.
|
|
4164
|
+
* @example 1
|
|
4165
|
+
*/
|
|
4166
|
+
page?: number;
|
|
4167
|
+
/**
|
|
4168
|
+
* Number of records per page.
|
|
4169
|
+
* @example 20
|
|
4170
|
+
*/
|
|
4171
|
+
per_page?: number;
|
|
4172
|
+
/**
|
|
4173
|
+
* The customer external unique identifier (provided by your own application)
|
|
4174
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
4175
|
+
*/
|
|
4176
|
+
external_customer_id?: string;
|
|
4177
|
+
/**
|
|
4178
|
+
* The unique code representing the plan to be attached to the customer. This code must correspond to the code property of one of the active plans.
|
|
4179
|
+
* @example "premium"
|
|
4180
|
+
*/
|
|
4181
|
+
plan_code?: string;
|
|
4182
|
+
/**
|
|
4183
|
+
* If the field is not defined, Lago will return only `active` subscriptions. However, if you wish to fetch subscriptions by different status you can define them in a status[] query param. Available filter values: `pending`, `canceled`, `terminated`, `active`.
|
|
4184
|
+
* @example ["active","pending"]
|
|
4185
|
+
*/
|
|
4186
|
+
status?: ("pending" | "canceled" | "terminated" | "active")[];
|
|
4187
|
+
}, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4188
|
+
/**
|
|
4189
|
+
* @description This endpoint allows you to update a subscription.
|
|
4190
|
+
*
|
|
4191
|
+
* @tags subscriptions
|
|
4192
|
+
* @name UpdateSubscription
|
|
4193
|
+
* @summary Update a subscription
|
|
4194
|
+
* @request PUT:/subscriptions/{external_id}
|
|
4195
|
+
* @secure
|
|
4196
|
+
*/
|
|
4197
|
+
updateSubscription: (externalId: string, data: SubscriptionUpdateInput, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4198
|
+
/**
|
|
4199
|
+
* @description This endpoint allows you to terminate a subscription.
|
|
4200
|
+
*
|
|
4201
|
+
* @tags subscriptions
|
|
4202
|
+
* @name DestroySubscription
|
|
4203
|
+
* @summary Terminate a subscription
|
|
4204
|
+
* @request DELETE:/subscriptions/{external_id}
|
|
4205
|
+
* @secure
|
|
4206
|
+
*/
|
|
4207
|
+
destroySubscription: (externalId: string, query?: {
|
|
4208
|
+
/**
|
|
4209
|
+
* If the field is not defined, Lago will terminate only `active` subscriptions. However, if you wish to cancel a `pending` subscription, please ensure that you include `status=pending` in your request.
|
|
4210
|
+
* @example "pending"
|
|
4211
|
+
*/
|
|
4212
|
+
status?: string;
|
|
4213
|
+
}, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
|
|
4214
|
+
};
|
|
4215
|
+
taxes: {
|
|
4216
|
+
/**
|
|
4217
|
+
* @description This endpoint creates a new tax representing a customizable tax rate applicable to either the organization or a specific customer.
|
|
4218
|
+
*
|
|
4219
|
+
* @tags taxes
|
|
4220
|
+
* @name CreateTax
|
|
4221
|
+
* @summary Create a tax
|
|
4222
|
+
* @request POST:/taxes
|
|
4223
|
+
* @secure
|
|
4224
|
+
*/
|
|
4225
|
+
createTax: (data: TaxCreateInput, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
4226
|
+
/**
|
|
4227
|
+
* @description This endpoint retrieves all existing taxes representing a customizable tax rate applicable to either the organization or a specific customer.
|
|
4228
|
+
*
|
|
4229
|
+
* @tags taxes
|
|
4230
|
+
* @name FindAllTaxes
|
|
4231
|
+
* @summary List all taxes
|
|
4232
|
+
* @request GET:/taxes
|
|
4233
|
+
* @secure
|
|
4234
|
+
*/
|
|
4235
|
+
findAllTaxes: (query?: {
|
|
4236
|
+
/**
|
|
4237
|
+
* Page number.
|
|
4238
|
+
* @example 1
|
|
4239
|
+
*/
|
|
4240
|
+
page?: number;
|
|
4241
|
+
/**
|
|
4242
|
+
* Number of records per page.
|
|
4243
|
+
* @example 20
|
|
4244
|
+
*/
|
|
4245
|
+
per_page?: number;
|
|
4246
|
+
}, params?: RequestParams) => Promise<HttpResponse<TaxesPaginated, ApiErrorUnauthorized>>;
|
|
4247
|
+
/**
|
|
4248
|
+
* @description This endpoint updates an existing tax representing a customizable tax rate applicable to either the organization or a specific customer.
|
|
4249
|
+
*
|
|
4250
|
+
* @tags taxes
|
|
4251
|
+
* @name UpdateTax
|
|
4252
|
+
* @summary Update a tax
|
|
4253
|
+
* @request PUT:/taxes/{code}
|
|
4254
|
+
* @secure
|
|
4255
|
+
*/
|
|
4256
|
+
updateTax: (code: string, data: TaxUpdateInput, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4257
|
+
/**
|
|
4258
|
+
* @description This endpoint retrieves an existing tax representing a customizable tax rate applicable to either the organization or a specific customer. The tax is identified by its unique code.
|
|
4259
|
+
*
|
|
4260
|
+
* @tags taxes
|
|
4261
|
+
* @name FindTax
|
|
4262
|
+
* @summary Retrieve a Tax
|
|
4263
|
+
* @request GET:/taxes/{code}
|
|
4264
|
+
* @secure
|
|
4265
|
+
*/
|
|
4266
|
+
findTax: (code: string, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4267
|
+
/**
|
|
4268
|
+
* @description This endpoint is used to delete a tax.
|
|
4269
|
+
*
|
|
4270
|
+
* @tags taxes
|
|
4271
|
+
* @name DestroyTax
|
|
4272
|
+
* @summary Delete a tax
|
|
4273
|
+
* @request DELETE:/taxes/{code}
|
|
4274
|
+
* @secure
|
|
4275
|
+
*/
|
|
4276
|
+
destroyTax: (code: string, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4277
|
+
};
|
|
4278
|
+
wallets: {
|
|
4279
|
+
/**
|
|
4280
|
+
* @description This endpoint is used to create a wallet with prepaid credits.
|
|
4281
|
+
*
|
|
4282
|
+
* @tags wallets
|
|
4283
|
+
* @name CreateWallet
|
|
4284
|
+
* @summary Create a wallet
|
|
4285
|
+
* @request POST:/wallets
|
|
4286
|
+
* @secure
|
|
4287
|
+
*/
|
|
4288
|
+
createWallet: (data: WalletCreateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
4289
|
+
/**
|
|
4290
|
+
* @description This endpoint is used to list all wallets with prepaid credits.
|
|
4291
|
+
*
|
|
4292
|
+
* @tags wallets
|
|
4293
|
+
* @name FindAllWallets
|
|
4294
|
+
* @summary List all wallets
|
|
4295
|
+
* @request GET:/wallets
|
|
4296
|
+
* @secure
|
|
4297
|
+
*/
|
|
4298
|
+
findAllWallets: (query: {
|
|
4299
|
+
/**
|
|
4300
|
+
* Page number.
|
|
4301
|
+
* @example 1
|
|
4302
|
+
*/
|
|
4303
|
+
page?: number;
|
|
4304
|
+
/**
|
|
4305
|
+
* Number of records per page.
|
|
4306
|
+
* @example 20
|
|
4307
|
+
*/
|
|
4308
|
+
per_page?: number;
|
|
4309
|
+
/**
|
|
4310
|
+
* The customer external unique identifier (provided by your own application).
|
|
4311
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
4312
|
+
*/
|
|
4313
|
+
external_customer_id: string;
|
|
4314
|
+
}, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized>>;
|
|
4315
|
+
/**
|
|
4316
|
+
* @description This endpoint is used to update an existing wallet with prepaid credits.
|
|
4317
|
+
*
|
|
4318
|
+
* @tags wallets
|
|
4319
|
+
* @name UpdateWallet
|
|
4320
|
+
* @summary Update a wallet
|
|
4321
|
+
* @request PUT:/wallets/{lago_id}
|
|
4322
|
+
* @secure
|
|
4323
|
+
*/
|
|
4324
|
+
updateWallet: (lagoId: string, data: WalletUpdateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4325
|
+
/**
|
|
4326
|
+
* @description This endpoint is used to retrieve an existing wallet with prepaid credits.
|
|
4327
|
+
*
|
|
4328
|
+
* @tags wallets
|
|
4329
|
+
* @name FindWallet
|
|
4330
|
+
* @summary Retrieve a wallet
|
|
4331
|
+
* @request GET:/wallets/{lago_id}
|
|
4332
|
+
* @secure
|
|
4333
|
+
*/
|
|
4334
|
+
findWallet: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4335
|
+
/**
|
|
4336
|
+
* @description This endpoint is used to terminate an existing wallet with prepaid credits.
|
|
4337
|
+
*
|
|
4338
|
+
* @tags wallets
|
|
4339
|
+
* @name DestroyWallet
|
|
4340
|
+
* @summary Terminate a wallet
|
|
4341
|
+
* @request DELETE:/wallets/{lago_id}
|
|
4342
|
+
* @secure
|
|
4343
|
+
*/
|
|
4344
|
+
destroyWallet: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
|
|
4345
|
+
/**
|
|
4346
|
+
* @description This endpoint is used to list all wallet transactions.
|
|
4347
|
+
*
|
|
4348
|
+
* @tags wallets
|
|
4349
|
+
* @name FindAllWalletTransactions
|
|
4350
|
+
* @summary List all wallet transactions
|
|
4351
|
+
* @request GET:/wallets/{lago_id}/wallet_transactions
|
|
4352
|
+
* @secure
|
|
4353
|
+
*/
|
|
4354
|
+
findAllWalletTransactions: (lagoId: string, query?: {
|
|
4355
|
+
/**
|
|
4356
|
+
* Page number.
|
|
4357
|
+
* @example 1
|
|
4358
|
+
*/
|
|
4359
|
+
page?: number;
|
|
4360
|
+
/**
|
|
4361
|
+
* Number of records per page.
|
|
4362
|
+
* @example 20
|
|
4363
|
+
*/
|
|
4364
|
+
per_page?: number;
|
|
4365
|
+
/**
|
|
4366
|
+
* The status of the wallet transaction. Possible values are `pending` or `settled`.
|
|
4367
|
+
* @example "pending"
|
|
4368
|
+
*/
|
|
4369
|
+
status?: string;
|
|
4370
|
+
/**
|
|
4371
|
+
* The transaction type of the wallet transaction. Possible values are `inbound` (increasing the wallet balance) or `outbound` (decreasing the wallet balance).
|
|
4372
|
+
* @example "inbound"
|
|
4373
|
+
*/
|
|
4374
|
+
transaction_type?: string;
|
|
4375
|
+
}, params?: RequestParams) => Promise<HttpResponse<WalletTransactionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4376
|
+
};
|
|
4377
|
+
walletTransactions: {
|
|
4378
|
+
/**
|
|
4379
|
+
* @description This endpoint is used to top-up an active wallet.
|
|
4380
|
+
*
|
|
4381
|
+
* @tags wallets
|
|
4382
|
+
* @name CreateWalletTransaction
|
|
4383
|
+
* @summary Top up a wallet
|
|
4384
|
+
* @request POST:/wallet_transactions
|
|
4385
|
+
* @secure
|
|
4386
|
+
*/
|
|
4387
|
+
createWalletTransaction: (data: WalletTransactionCreateInput, params?: RequestParams) => Promise<HttpResponse<WalletTransactions, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
4388
|
+
};
|
|
4389
|
+
webhooks: {
|
|
4390
|
+
/**
|
|
4391
|
+
* @description This endpoint is used to retrieve the public key used to verify the webhooks signature
|
|
4392
|
+
*
|
|
4393
|
+
* @tags webhooks
|
|
4394
|
+
* @name FetchPublicKey
|
|
4395
|
+
* @summary Retrieve webhook public key
|
|
4396
|
+
* @request GET:/webhooks/public_key
|
|
4397
|
+
* @secure
|
|
4398
|
+
*/
|
|
4399
|
+
fetchPublicKey: (params?: RequestParams) => Promise<HttpResponse<string, ApiErrorUnauthorized>>;
|
|
4400
|
+
};
|
|
4401
|
+
webhookEndpoints: {
|
|
4402
|
+
/**
|
|
4403
|
+
* @description This endpoint is used to create a webhook endpoint.
|
|
4404
|
+
*
|
|
4405
|
+
* @tags webhook_endpoints
|
|
4406
|
+
* @name CreateWebhookEndpoint
|
|
4407
|
+
* @summary Create a webhook_endpoint
|
|
4408
|
+
* @request POST:/webhook_endpoints
|
|
4409
|
+
* @secure
|
|
4410
|
+
*/
|
|
4411
|
+
createWebhookEndpoint: (data: WebhookEndpointCreateInput, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
4412
|
+
/**
|
|
4413
|
+
* @description This endpoint is used to list all webhook endpoints.
|
|
4414
|
+
*
|
|
4415
|
+
* @tags webhook_endpoints
|
|
4416
|
+
* @name FindAllWebhookEndpoints
|
|
4417
|
+
* @summary List all webhook endpoints
|
|
4418
|
+
* @request GET:/webhook_endpoints
|
|
4419
|
+
* @secure
|
|
4420
|
+
*/
|
|
4421
|
+
findAllWebhookEndpoints: (query?: {
|
|
4422
|
+
/**
|
|
4423
|
+
* Page number.
|
|
4424
|
+
* @example 1
|
|
4425
|
+
*/
|
|
4426
|
+
page?: number;
|
|
4427
|
+
/**
|
|
4428
|
+
* Number of records per page.
|
|
4429
|
+
* @example 20
|
|
4430
|
+
*/
|
|
4431
|
+
per_page?: number;
|
|
4432
|
+
}, params?: RequestParams) => Promise<HttpResponse<WebhookEndpointsPaginated, ApiErrorUnauthorized>>;
|
|
4433
|
+
/**
|
|
4434
|
+
* @description This endpoint is used to update an existing webhook endpoint.
|
|
4435
|
+
*
|
|
4436
|
+
* @tags webhook_endpoints
|
|
4437
|
+
* @name UpdateWebhookEndpoint
|
|
4438
|
+
* @summary Update a webhook endpoint
|
|
4439
|
+
* @request PUT:/webhook_endpoints/{lago_id}
|
|
4440
|
+
* @secure
|
|
4441
|
+
*/
|
|
4442
|
+
updateWebhookEndpoint: (lagoId: string, data: WebhookEndpointUpdateInput, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4443
|
+
/**
|
|
4444
|
+
* @description This endpoint is used to retrieve an existing webhook endpoint.
|
|
4445
|
+
*
|
|
4446
|
+
* @tags webhook_endpoints
|
|
4447
|
+
* @name FindWebhookEndpoint
|
|
4448
|
+
* @summary Retrieve a webhook endpoint
|
|
4449
|
+
* @request GET:/webhook_endpoints/{lago_id}
|
|
4450
|
+
* @secure
|
|
4451
|
+
*/
|
|
4452
|
+
findWebhookEndpoint: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4453
|
+
/**
|
|
4454
|
+
* @description This endpoint is used to delete an existing webhook endpoint.
|
|
4455
|
+
*
|
|
4456
|
+
* @tags webhook_endpoints
|
|
4457
|
+
* @name DestroyWebhookEndpoint
|
|
4458
|
+
* @summary Delete a webhook endpoint
|
|
4459
|
+
* @request DELETE:/webhook_endpoints/{lago_id}
|
|
4460
|
+
* @secure
|
|
4461
|
+
*/
|
|
4462
|
+
destroyWebhookEndpoint: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
|
|
4463
|
+
};
|
|
4464
|
+
}
|
|
4465
|
+
export {};
|