lago-javascript-client 0.22.0-beta → 0.26.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/esm/swagger/client.js +35 -1
- package/package.json +1 -1
- package/script/swagger/client.js +35 -1
- package/types/swagger/client.d.ts +388 -298
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
export interface BillableMetricGroup {
|
|
2
2
|
/** @example "region" */
|
|
3
|
-
key
|
|
4
|
-
values
|
|
3
|
+
key: string;
|
|
4
|
+
values: (string | object)[];
|
|
5
5
|
}
|
|
6
6
|
export interface BillableMetricObject {
|
|
7
7
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
8
|
-
lago_id
|
|
8
|
+
lago_id: string;
|
|
9
9
|
/** @example "bm1" */
|
|
10
|
-
name
|
|
10
|
+
name: string;
|
|
11
11
|
/** @example "example_code" */
|
|
12
|
-
code
|
|
12
|
+
code: string;
|
|
13
13
|
/** @example "description" */
|
|
14
14
|
description?: string;
|
|
15
15
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
16
|
-
created_at
|
|
16
|
+
created_at: string;
|
|
17
17
|
/** @example "amount" */
|
|
18
18
|
field_name?: string;
|
|
19
19
|
/** Aggregation type */
|
|
20
|
-
aggregation_type
|
|
20
|
+
aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "recurring_count_agg";
|
|
21
21
|
group?: BillableMetricGroup;
|
|
22
22
|
/** @example 0 */
|
|
23
|
-
active_subscriptions_count
|
|
23
|
+
active_subscriptions_count: number;
|
|
24
24
|
/** @example 0 */
|
|
25
|
-
draft_invoices_count
|
|
25
|
+
draft_invoices_count: number;
|
|
26
|
+
/** @example 0 */
|
|
27
|
+
plans_count: number;
|
|
26
28
|
}
|
|
27
29
|
export interface BillableMetric {
|
|
28
|
-
billable_metric
|
|
30
|
+
billable_metric: BillableMetricObject;
|
|
29
31
|
}
|
|
30
32
|
export interface BillableMetrics {
|
|
31
|
-
billable_metrics
|
|
33
|
+
billable_metrics: BillableMetricObject[];
|
|
32
34
|
}
|
|
33
35
|
export interface BillableMetricInput {
|
|
34
|
-
billable_metric
|
|
36
|
+
billable_metric: {
|
|
35
37
|
/** @example "bm1" */
|
|
36
38
|
name?: string;
|
|
37
39
|
/** @example "example_code" */
|
|
@@ -46,40 +48,40 @@ export interface BillableMetricInput {
|
|
|
46
48
|
};
|
|
47
49
|
}
|
|
48
50
|
export interface GroupObject {
|
|
51
|
+
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
52
|
+
lago_id: string;
|
|
49
53
|
/** @example "region" */
|
|
50
|
-
key
|
|
54
|
+
key: string;
|
|
51
55
|
/** @example "EU" */
|
|
52
|
-
value
|
|
53
|
-
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
54
|
-
lago_id?: string;
|
|
56
|
+
value: string;
|
|
55
57
|
}
|
|
56
58
|
export interface Groups {
|
|
57
|
-
groups
|
|
59
|
+
groups: GroupObject[];
|
|
58
60
|
}
|
|
59
61
|
export interface AddOnObject {
|
|
60
62
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
61
|
-
lago_id
|
|
63
|
+
lago_id: string;
|
|
62
64
|
/** @example "example name" */
|
|
63
|
-
name
|
|
65
|
+
name: string;
|
|
64
66
|
/** @example "example_code" */
|
|
65
|
-
code
|
|
67
|
+
code: string;
|
|
66
68
|
/** @example "description" */
|
|
67
69
|
description?: string;
|
|
68
70
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
69
|
-
created_at
|
|
71
|
+
created_at: string;
|
|
70
72
|
/** @example 1200 */
|
|
71
|
-
amount_cents
|
|
73
|
+
amount_cents: number;
|
|
72
74
|
/** @example "EUR" */
|
|
73
|
-
amount_currency
|
|
75
|
+
amount_currency: string;
|
|
74
76
|
}
|
|
75
77
|
export interface AddOn {
|
|
76
|
-
add_on
|
|
78
|
+
add_on: AddOnObject;
|
|
77
79
|
}
|
|
78
80
|
export interface AddOns {
|
|
79
|
-
add_ons
|
|
81
|
+
add_ons: AddOnObject[];
|
|
80
82
|
}
|
|
81
83
|
export interface AddOnInput {
|
|
82
|
-
add_on
|
|
84
|
+
add_on: {
|
|
83
85
|
/** @example "example name" */
|
|
84
86
|
name?: string;
|
|
85
87
|
/** @example "example_code" */
|
|
@@ -94,31 +96,31 @@ export interface AddOnInput {
|
|
|
94
96
|
}
|
|
95
97
|
export interface AppliedAddOnObject {
|
|
96
98
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
97
|
-
lago_id
|
|
99
|
+
lago_id: string;
|
|
98
100
|
/** @example "457uj93c-c007-4fbb-afcd-b00c07c41kki" */
|
|
99
|
-
lago_add_on_id
|
|
101
|
+
lago_add_on_id: string;
|
|
100
102
|
/** @example "code" */
|
|
101
|
-
add_on_code
|
|
103
|
+
add_on_code: string;
|
|
102
104
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
103
|
-
lago_customer_id
|
|
104
|
-
/** @example 1234567 */
|
|
105
|
-
external_customer_id
|
|
105
|
+
lago_customer_id: string;
|
|
106
|
+
/** @example "1234567" */
|
|
107
|
+
external_customer_id: string;
|
|
106
108
|
/** @example 1200 */
|
|
107
|
-
amount_cents
|
|
109
|
+
amount_cents: number;
|
|
108
110
|
/** @example "EUR" */
|
|
109
|
-
amount_currency
|
|
111
|
+
amount_currency: string;
|
|
110
112
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
111
|
-
created_at
|
|
113
|
+
created_at: string;
|
|
112
114
|
}
|
|
113
115
|
export interface AppliedAddOn {
|
|
114
|
-
applied_add_on
|
|
116
|
+
applied_add_on: AppliedAddOnObject;
|
|
115
117
|
}
|
|
116
118
|
export interface AppliedAddOnInput {
|
|
117
|
-
applied_add_on
|
|
118
|
-
/** @example 1234567 */
|
|
119
|
-
external_customer_id
|
|
119
|
+
applied_add_on: {
|
|
120
|
+
/** @example "1234567" */
|
|
121
|
+
external_customer_id: string;
|
|
120
122
|
/** @example "code" */
|
|
121
|
-
add_on_code
|
|
123
|
+
add_on_code: string;
|
|
122
124
|
/** @example 1200 */
|
|
123
125
|
amount_cents?: number;
|
|
124
126
|
/** @example "EUR" */
|
|
@@ -127,40 +129,43 @@ export interface AppliedAddOnInput {
|
|
|
127
129
|
}
|
|
128
130
|
export interface CouponObject {
|
|
129
131
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
130
|
-
lago_id
|
|
132
|
+
lago_id: string;
|
|
131
133
|
/** @example "coupon1" */
|
|
132
|
-
name
|
|
134
|
+
name: string;
|
|
133
135
|
/** @example "example_code" */
|
|
134
|
-
code
|
|
136
|
+
code: string;
|
|
135
137
|
/** Coupon type */
|
|
136
|
-
coupon_type
|
|
138
|
+
coupon_type: "fixed_amount" | "percentage";
|
|
137
139
|
/** @example 1200 */
|
|
138
140
|
amount_cents?: number;
|
|
139
141
|
/** @example "EUR" */
|
|
140
142
|
amount_currency?: string;
|
|
141
143
|
/** @example true */
|
|
142
144
|
reusable?: boolean;
|
|
145
|
+
/** @example true */
|
|
146
|
+
limited_plans?: boolean;
|
|
147
|
+
plan_codes?: string[];
|
|
143
148
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
144
|
-
created_at
|
|
149
|
+
created_at: string;
|
|
145
150
|
/** @example 25 */
|
|
146
151
|
percentage_rate?: number;
|
|
147
152
|
/** Frequency type */
|
|
148
|
-
frequency
|
|
153
|
+
frequency: "once" | "recurring";
|
|
149
154
|
/** @example 3 */
|
|
150
155
|
frequency_duration?: number;
|
|
151
156
|
/** @example "2022-09-14T23:59:59.000Z" */
|
|
152
157
|
expiration_at?: string;
|
|
153
158
|
/** Expiration type */
|
|
154
|
-
expiration
|
|
159
|
+
expiration: "no_expiration" | "time_limit";
|
|
155
160
|
}
|
|
156
161
|
export interface Coupon {
|
|
157
|
-
coupon
|
|
162
|
+
coupon: CouponObject;
|
|
158
163
|
}
|
|
159
164
|
export interface Coupons {
|
|
160
|
-
coupons
|
|
165
|
+
coupons: CouponObject[];
|
|
161
166
|
}
|
|
162
167
|
export interface CouponInput {
|
|
163
|
-
coupon
|
|
168
|
+
coupon: {
|
|
164
169
|
/** @example "coupon1" */
|
|
165
170
|
name?: string;
|
|
166
171
|
/** @example "example_code" */
|
|
@@ -183,31 +188,34 @@ export interface CouponInput {
|
|
|
183
188
|
expiration_at?: string;
|
|
184
189
|
/** Expiration type */
|
|
185
190
|
expiration?: "no_expiration" | "time_limit";
|
|
191
|
+
applies_to?: {
|
|
192
|
+
plan_codes?: string[];
|
|
193
|
+
};
|
|
186
194
|
};
|
|
187
195
|
}
|
|
188
196
|
export interface AppliedCouponObject {
|
|
189
197
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
190
|
-
lago_id
|
|
198
|
+
lago_id: string;
|
|
191
199
|
/** @example "544da83c-c007-4fbb-afcd-b00c07c41iit" */
|
|
192
|
-
lago_coupon_id
|
|
200
|
+
lago_coupon_id: string;
|
|
193
201
|
/** @example "example_code" */
|
|
194
|
-
coupon_code
|
|
202
|
+
coupon_code: string;
|
|
195
203
|
/** @example "321da83c-c007-4fbb-afcd-b00c07c41ssd" */
|
|
196
|
-
lago_customer_id
|
|
197
|
-
/** @example 123456 */
|
|
198
|
-
external_customer_id
|
|
204
|
+
lago_customer_id: string;
|
|
205
|
+
/** @example "123456" */
|
|
206
|
+
external_customer_id: string;
|
|
199
207
|
/** Status */
|
|
200
|
-
status
|
|
208
|
+
status: "active" | "terminated";
|
|
201
209
|
/** @example 1200 */
|
|
202
|
-
amount_cents
|
|
210
|
+
amount_cents: number;
|
|
203
211
|
/** @example 800 */
|
|
204
212
|
amount_cents_remaining?: number;
|
|
205
213
|
/** @example "EUR" */
|
|
206
|
-
amount_currency
|
|
214
|
+
amount_currency: string;
|
|
207
215
|
/** @example 25 */
|
|
208
216
|
percentage_rate?: number;
|
|
209
217
|
/** Frequency type */
|
|
210
|
-
frequency
|
|
218
|
+
frequency: "once" | "recurring";
|
|
211
219
|
/** @example 3 */
|
|
212
220
|
frequency_duration?: number;
|
|
213
221
|
/** @example 2 */
|
|
@@ -215,22 +223,23 @@ export interface AppliedCouponObject {
|
|
|
215
223
|
/** @example "2022-09-14T23:59:59.000Z" */
|
|
216
224
|
expiration_at?: string;
|
|
217
225
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
218
|
-
created_at
|
|
226
|
+
created_at: string;
|
|
219
227
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
220
228
|
terminated_at?: string;
|
|
229
|
+
credits: CreditObject[];
|
|
221
230
|
}
|
|
222
231
|
export interface AppliedCoupon {
|
|
223
|
-
applied_coupon
|
|
232
|
+
applied_coupon: AppliedCouponObject;
|
|
224
233
|
}
|
|
225
234
|
export interface AppliedCoupons {
|
|
226
|
-
applied_coupons
|
|
235
|
+
applied_coupons: AppliedCouponObject[];
|
|
227
236
|
}
|
|
228
237
|
export interface AppliedCouponInput {
|
|
229
|
-
applied_coupon
|
|
230
|
-
/** @example 123456 */
|
|
231
|
-
external_customer_id
|
|
238
|
+
applied_coupon: {
|
|
239
|
+
/** @example "123456" */
|
|
240
|
+
external_customer_id: string;
|
|
232
241
|
/** @example "example_code" */
|
|
233
|
-
coupon_code
|
|
242
|
+
coupon_code: string;
|
|
234
243
|
/** Frequency type */
|
|
235
244
|
frequency?: "once" | "recurring";
|
|
236
245
|
/** @example 3 */
|
|
@@ -248,6 +257,8 @@ export interface BillingConfigurationOrganization {
|
|
|
248
257
|
invoice_footer?: string;
|
|
249
258
|
/** @example 5 */
|
|
250
259
|
invoice_grace_period?: number;
|
|
260
|
+
/** @example "fr" */
|
|
261
|
+
document_locale?: string;
|
|
251
262
|
/** @example 25 */
|
|
252
263
|
vat_rate?: number;
|
|
253
264
|
}
|
|
@@ -255,9 +266,9 @@ export interface OrganizationObject {
|
|
|
255
266
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
256
267
|
lago_id?: string;
|
|
257
268
|
/** @example "example name" */
|
|
258
|
-
name
|
|
269
|
+
name: string;
|
|
259
270
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
260
|
-
created_at
|
|
271
|
+
created_at: string;
|
|
261
272
|
/** @example "https://example.com" */
|
|
262
273
|
webhook_url?: string;
|
|
263
274
|
/** @example "CZ" */
|
|
@@ -268,25 +279,25 @@ export interface OrganizationObject {
|
|
|
268
279
|
address_line2?: string;
|
|
269
280
|
/** @example "state1" */
|
|
270
281
|
state?: string;
|
|
271
|
-
/** @example 10000 */
|
|
272
|
-
|
|
282
|
+
/** @example "10000" */
|
|
283
|
+
zipcode?: string;
|
|
273
284
|
/** @example "example@example.com" */
|
|
274
285
|
email?: string;
|
|
275
286
|
/** @example "City" */
|
|
276
287
|
city?: string;
|
|
277
288
|
/** @example "name1" */
|
|
278
289
|
legal_name?: string;
|
|
279
|
-
/** @example 10000 */
|
|
290
|
+
/** @example "10000" */
|
|
280
291
|
legal_number?: string;
|
|
281
292
|
/** @example "UTC" */
|
|
282
293
|
timezone?: string;
|
|
283
294
|
billing_configuration?: BillingConfigurationOrganization;
|
|
284
295
|
}
|
|
285
296
|
export interface Organization {
|
|
286
|
-
organization
|
|
297
|
+
organization: OrganizationObject;
|
|
287
298
|
}
|
|
288
299
|
export interface OrganizationInput {
|
|
289
|
-
organization
|
|
300
|
+
organization: {
|
|
290
301
|
/** @example "https://example.com" */
|
|
291
302
|
webhook_url?: string;
|
|
292
303
|
/** @example "CZ" */
|
|
@@ -297,8 +308,8 @@ export interface OrganizationInput {
|
|
|
297
308
|
address_line2?: string;
|
|
298
309
|
/** @example "state1" */
|
|
299
310
|
state?: string;
|
|
300
|
-
/** @example 10000 */
|
|
301
|
-
|
|
311
|
+
/** @example "10000" */
|
|
312
|
+
zipcode?: string;
|
|
302
313
|
/** @example "example@example.com" */
|
|
303
314
|
email?: string;
|
|
304
315
|
/** @example "City" */
|
|
@@ -317,25 +328,39 @@ export interface BillingConfigurationCustomer {
|
|
|
317
328
|
invoice_grace_period?: number;
|
|
318
329
|
/** Payment provider type */
|
|
319
330
|
payment_provider?: "stripe" | "gocardless";
|
|
320
|
-
/** @example 123456 */
|
|
331
|
+
/** @example "123456" */
|
|
321
332
|
provider_customer_id?: string;
|
|
322
333
|
/** @example true */
|
|
323
334
|
sync_with_provider?: boolean;
|
|
335
|
+
/** @example "fr" */
|
|
336
|
+
document_locale?: string;
|
|
324
337
|
/** @example 25 */
|
|
325
338
|
vat_rate?: number;
|
|
326
339
|
[key: string]: any;
|
|
327
340
|
}
|
|
328
|
-
export interface
|
|
341
|
+
export interface CustomerMetadataObject {
|
|
329
342
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
330
343
|
lago_id?: string;
|
|
344
|
+
/** @example "name" */
|
|
345
|
+
key?: string;
|
|
346
|
+
/** @example "John" */
|
|
347
|
+
value?: string;
|
|
348
|
+
/** @example false */
|
|
349
|
+
display_in_invoice?: boolean;
|
|
350
|
+
/** @example "2022-09-14T16:35:31.000Z" */
|
|
351
|
+
created_at?: string;
|
|
352
|
+
}
|
|
353
|
+
export interface CustomerObject {
|
|
354
|
+
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
355
|
+
lago_id: string;
|
|
331
356
|
/** @example "886da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
332
|
-
external_id
|
|
357
|
+
external_id: string;
|
|
333
358
|
/** @example "John Doe" */
|
|
334
359
|
name?: string;
|
|
335
360
|
/** @example 12345 */
|
|
336
|
-
sequential_id
|
|
361
|
+
sequential_id: number;
|
|
337
362
|
/** @example "slug" */
|
|
338
|
-
slug
|
|
363
|
+
slug: string;
|
|
339
364
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
340
365
|
created_at?: string;
|
|
341
366
|
/** @example "CZ" */
|
|
@@ -347,7 +372,7 @@ export interface CustomerObject {
|
|
|
347
372
|
/** @example "state1" */
|
|
348
373
|
state?: string;
|
|
349
374
|
/** @example 10000 */
|
|
350
|
-
|
|
375
|
+
zipcode?: string;
|
|
351
376
|
/** @example "example@example.com" */
|
|
352
377
|
email?: string;
|
|
353
378
|
/** @example "City" */
|
|
@@ -369,17 +394,18 @@ export interface CustomerObject {
|
|
|
369
394
|
/** @example "UTC" */
|
|
370
395
|
applicable_timezone?: string;
|
|
371
396
|
billing_configuration?: BillingConfigurationCustomer;
|
|
397
|
+
metadata?: CustomerMetadataObject[];
|
|
372
398
|
}
|
|
373
399
|
export interface Customer {
|
|
374
|
-
customer
|
|
400
|
+
customer: CustomerObject;
|
|
375
401
|
}
|
|
376
402
|
export interface Customers {
|
|
377
|
-
customers
|
|
403
|
+
customers: CustomerObject[];
|
|
378
404
|
}
|
|
379
405
|
export interface CustomerInput {
|
|
380
|
-
customer
|
|
406
|
+
customer: {
|
|
381
407
|
/** @example "886da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
382
|
-
external_id
|
|
408
|
+
external_id: string;
|
|
383
409
|
/** @example "John Doe" */
|
|
384
410
|
name?: string;
|
|
385
411
|
/** @example "CZ" */
|
|
@@ -391,7 +417,7 @@ export interface CustomerInput {
|
|
|
391
417
|
/** @example "state1" */
|
|
392
418
|
state?: string;
|
|
393
419
|
/** @example 10000 */
|
|
394
|
-
|
|
420
|
+
zipcode?: string;
|
|
395
421
|
/** @example "example@example.com" */
|
|
396
422
|
email?: string;
|
|
397
423
|
/** @example "City" */
|
|
@@ -411,22 +437,32 @@ export interface CustomerInput {
|
|
|
411
437
|
/** @example "Europe/Paris" */
|
|
412
438
|
timezone?: string;
|
|
413
439
|
billing_configuration?: BillingConfigurationCustomer;
|
|
440
|
+
metadata?: {
|
|
441
|
+
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
442
|
+
id?: string;
|
|
443
|
+
/** @example "name" */
|
|
444
|
+
key?: string;
|
|
445
|
+
/** @example "John" */
|
|
446
|
+
value?: string;
|
|
447
|
+
/** @example false */
|
|
448
|
+
display_in_invoice?: boolean;
|
|
449
|
+
}[];
|
|
414
450
|
};
|
|
415
451
|
}
|
|
416
452
|
export interface ChargeUsageObject {
|
|
417
453
|
/** @example 3 */
|
|
418
|
-
units
|
|
454
|
+
units: number;
|
|
419
455
|
/** @example 1200 */
|
|
420
|
-
amount_cents
|
|
456
|
+
amount_cents: number;
|
|
421
457
|
/** @example "EUR" */
|
|
422
|
-
amount_currency
|
|
423
|
-
charge
|
|
458
|
+
amount_currency: string;
|
|
459
|
+
charge: {
|
|
424
460
|
/** @example "278da83c-c007-4fbb-afcd-b00c07c41utg" */
|
|
425
461
|
lago_id?: string;
|
|
426
462
|
/** Charge model type */
|
|
427
463
|
charge_model?: "standard" | "graduated" | "package" | "percentage" | "volume";
|
|
428
464
|
};
|
|
429
|
-
billable_metric
|
|
465
|
+
billable_metric: {
|
|
430
466
|
/** @example "278da83c-c007-4fbb-afcd-b00c07c41utg" */
|
|
431
467
|
lago_id?: string;
|
|
432
468
|
/** @example "Example name" */
|
|
@@ -436,7 +472,7 @@ export interface ChargeUsageObject {
|
|
|
436
472
|
/** Aggregation type */
|
|
437
473
|
aggregation_type?: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "recurring_count_agg";
|
|
438
474
|
};
|
|
439
|
-
groups
|
|
475
|
+
groups: {
|
|
440
476
|
/** @example "278da83c-c007-4fbb-afcd-b00c07c41utg" */
|
|
441
477
|
lago_id?: string;
|
|
442
478
|
/** @example "key" */
|
|
@@ -451,131 +487,137 @@ export interface ChargeUsageObject {
|
|
|
451
487
|
}
|
|
452
488
|
export interface CustomerUsageObject {
|
|
453
489
|
/** @example "2022-09-14T00:00:00.000Z" */
|
|
454
|
-
from_datetime
|
|
490
|
+
from_datetime: string;
|
|
455
491
|
/** @example "2022-09-14T00:00:00.000Z" */
|
|
456
|
-
to_datetime
|
|
492
|
+
to_datetime: string;
|
|
457
493
|
/** @example "2022-09-15T00:00:00.000Z" */
|
|
458
|
-
issuing_date
|
|
494
|
+
issuing_date: string;
|
|
459
495
|
/** @example 1200 */
|
|
460
|
-
amount_cents
|
|
496
|
+
amount_cents: number;
|
|
461
497
|
/** @example "EUR" */
|
|
462
|
-
amount_currency
|
|
498
|
+
amount_currency: string;
|
|
463
499
|
/** @example 1400 */
|
|
464
|
-
total_amount_cents
|
|
500
|
+
total_amount_cents: number;
|
|
465
501
|
/** @example "EUR" */
|
|
466
|
-
total_amount_currency
|
|
502
|
+
total_amount_currency: string;
|
|
467
503
|
/** @example 200 */
|
|
468
|
-
vat_amount_cents
|
|
504
|
+
vat_amount_cents: number;
|
|
469
505
|
/** @example "EUR" */
|
|
470
|
-
vat_amount_currency
|
|
471
|
-
charges_usage
|
|
506
|
+
vat_amount_currency: string;
|
|
507
|
+
charges_usage: ChargeUsageObject[];
|
|
472
508
|
}
|
|
473
509
|
export interface CustomerUsage {
|
|
474
|
-
customer_usage
|
|
510
|
+
customer_usage: CustomerUsageObject;
|
|
475
511
|
}
|
|
476
512
|
export interface EventObject {
|
|
477
513
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
478
|
-
lago_id
|
|
479
|
-
/** @example 987654321 */
|
|
480
|
-
transaction_id
|
|
514
|
+
lago_id: string;
|
|
515
|
+
/** @example "987654321" */
|
|
516
|
+
transaction_id: string;
|
|
481
517
|
/** @example "111da83c-c007-4fbb-afcd-b00c07c41iop" */
|
|
482
|
-
lago_customer_id
|
|
483
|
-
/** @example 123456 */
|
|
484
|
-
external_customer_id
|
|
518
|
+
lago_customer_id: string;
|
|
519
|
+
/** @example "123456" */
|
|
520
|
+
external_customer_id: string;
|
|
485
521
|
/** @example "code" */
|
|
486
|
-
code
|
|
522
|
+
code: string;
|
|
487
523
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
488
|
-
timestamp
|
|
524
|
+
timestamp: string;
|
|
489
525
|
properties?: object;
|
|
490
526
|
/** @example "447da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
491
|
-
lago_subscription_id
|
|
492
|
-
/** @example 123456 */
|
|
493
|
-
external_subscription_id
|
|
527
|
+
lago_subscription_id: string;
|
|
528
|
+
/** @example "123456" */
|
|
529
|
+
external_subscription_id: string;
|
|
494
530
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
495
|
-
created_at
|
|
531
|
+
created_at: string;
|
|
496
532
|
}
|
|
497
533
|
export interface Event {
|
|
498
|
-
event
|
|
534
|
+
event: EventObject;
|
|
499
535
|
}
|
|
500
536
|
export interface EventInput {
|
|
501
|
-
event
|
|
502
|
-
/** @example 123456 */
|
|
503
|
-
transaction_id
|
|
504
|
-
/** @example 654321 */
|
|
537
|
+
event: {
|
|
538
|
+
/** @example "123456" */
|
|
539
|
+
transaction_id: string;
|
|
540
|
+
/** @example "654321" */
|
|
505
541
|
external_customer_id?: string;
|
|
506
542
|
/** @example "code" */
|
|
507
|
-
code
|
|
543
|
+
code: string;
|
|
508
544
|
/** @example 1669823754 */
|
|
509
545
|
timestamp?: number;
|
|
510
|
-
/** @example 123456 */
|
|
546
|
+
/** @example "123456" */
|
|
511
547
|
external_subscription_id?: string;
|
|
512
548
|
properties?: object;
|
|
513
549
|
};
|
|
514
550
|
}
|
|
515
551
|
export interface BatchEventInput {
|
|
516
|
-
event
|
|
517
|
-
/** @example 123456 */
|
|
518
|
-
transaction_id
|
|
519
|
-
/** @example 654321 */
|
|
552
|
+
event: {
|
|
553
|
+
/** @example "123456" */
|
|
554
|
+
transaction_id: string;
|
|
555
|
+
/** @example "654321" */
|
|
520
556
|
external_customer_id?: string;
|
|
521
557
|
/** @example "code" */
|
|
522
|
-
code
|
|
558
|
+
code: string;
|
|
523
559
|
/** @example 1669823754 */
|
|
524
560
|
timestamp?: number;
|
|
525
|
-
external_subscription_ids
|
|
561
|
+
external_subscription_ids: string[];
|
|
526
562
|
properties?: object;
|
|
527
563
|
};
|
|
528
564
|
}
|
|
529
565
|
export interface GroupPropertiesObject {
|
|
530
|
-
/** @example 123456 */
|
|
531
|
-
group_id
|
|
532
|
-
values
|
|
566
|
+
/** @example "123456" */
|
|
567
|
+
group_id: string;
|
|
568
|
+
values: object;
|
|
533
569
|
}
|
|
534
570
|
export interface ChargeObject {
|
|
535
571
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
536
|
-
lago_id
|
|
572
|
+
lago_id: string;
|
|
537
573
|
/** @example "278da83c-c007-4fbb-afcd-b00c07c41utg" */
|
|
538
|
-
lago_billable_metric_id
|
|
574
|
+
lago_billable_metric_id: string;
|
|
575
|
+
/** @example "bm_code" */
|
|
576
|
+
billable_metric_code: string;
|
|
539
577
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
540
|
-
created_at
|
|
578
|
+
created_at: string;
|
|
541
579
|
/** Charge model type */
|
|
542
|
-
charge_model
|
|
580
|
+
charge_model: "standard" | "graduated" | "package" | "percentage" | "volume";
|
|
543
581
|
properties?: object;
|
|
544
582
|
group_properties?: GroupPropertiesObject[];
|
|
545
583
|
}
|
|
546
584
|
export interface PlanObject {
|
|
547
585
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
548
|
-
lago_id
|
|
586
|
+
lago_id: string;
|
|
549
587
|
/** @example "example name" */
|
|
550
|
-
name
|
|
588
|
+
name: string;
|
|
551
589
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
552
|
-
created_at
|
|
590
|
+
created_at: string;
|
|
553
591
|
/** @example "example_code" */
|
|
554
|
-
code
|
|
592
|
+
code: string;
|
|
555
593
|
/** Plan interval */
|
|
556
|
-
interval
|
|
594
|
+
interval: "weekly" | "monthly" | "yearly";
|
|
557
595
|
/** @example "description" */
|
|
558
596
|
description?: string;
|
|
559
597
|
/** @example 1200 */
|
|
560
|
-
amount_cents
|
|
598
|
+
amount_cents: number;
|
|
561
599
|
/** @example "EUR" */
|
|
562
|
-
amount_currency
|
|
600
|
+
amount_currency: string;
|
|
563
601
|
/** @example 2 */
|
|
564
602
|
trial_period?: number;
|
|
565
603
|
/** @example true */
|
|
566
604
|
pay_in_advance?: boolean;
|
|
567
605
|
/** @example false */
|
|
568
606
|
bill_charges_monthly?: boolean;
|
|
607
|
+
/** @example 2 */
|
|
608
|
+
active_subscriptions_count: number;
|
|
609
|
+
/** @example 2 */
|
|
610
|
+
draft_invoices_count: number;
|
|
569
611
|
charges?: ChargeObject[];
|
|
570
612
|
}
|
|
571
613
|
export interface Plan {
|
|
572
|
-
plan
|
|
614
|
+
plan: PlanObject;
|
|
573
615
|
}
|
|
574
616
|
export interface Plans {
|
|
575
|
-
plans
|
|
617
|
+
plans: PlanObject[];
|
|
576
618
|
}
|
|
577
619
|
export interface PlanInput {
|
|
578
|
-
plan
|
|
620
|
+
plan: {
|
|
579
621
|
/** @example "example name" */
|
|
580
622
|
name?: string;
|
|
581
623
|
/** @example "example_code" */
|
|
@@ -603,40 +645,40 @@ export interface PlanInput {
|
|
|
603
645
|
charge_model?: "standard" | "graduated" | "package" | "percentage" | "volume";
|
|
604
646
|
properties?: object;
|
|
605
647
|
group_properties?: {
|
|
606
|
-
/** @example 123456 */
|
|
607
|
-
group_id
|
|
608
|
-
values
|
|
648
|
+
/** @example "123456" */
|
|
649
|
+
group_id: string;
|
|
650
|
+
values: object;
|
|
609
651
|
}[];
|
|
610
652
|
}[];
|
|
611
653
|
};
|
|
612
654
|
}
|
|
613
655
|
export interface SubscriptionObject {
|
|
614
656
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
615
|
-
lago_id
|
|
657
|
+
lago_id: string;
|
|
616
658
|
/** @example 12345 */
|
|
617
|
-
external_id
|
|
659
|
+
external_id: string;
|
|
618
660
|
/** @example "995da83c-c007-4fbb-afcd-b00c07c41tre" */
|
|
619
|
-
lago_customer_id
|
|
661
|
+
lago_customer_id: string;
|
|
620
662
|
/** @example 54321 */
|
|
621
|
-
external_customer_id
|
|
663
|
+
external_customer_id: string;
|
|
622
664
|
/** @example "Test subscription" */
|
|
623
665
|
name?: string;
|
|
624
666
|
/** @example "plan_code" */
|
|
625
|
-
plan_code
|
|
667
|
+
plan_code: string;
|
|
626
668
|
/** Subscription status */
|
|
627
|
-
status
|
|
669
|
+
status: "active" | "pending" | "terminated" | "canceled";
|
|
628
670
|
/** Billing time */
|
|
629
|
-
billing_time
|
|
671
|
+
billing_time: "calendar" | "anniversary";
|
|
630
672
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
631
|
-
subscription_at
|
|
673
|
+
subscription_at: string;
|
|
632
674
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
633
|
-
started_at
|
|
675
|
+
started_at: string;
|
|
634
676
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
635
677
|
terminated_at?: string;
|
|
636
678
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
637
679
|
canceled_at?: string;
|
|
638
680
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
639
|
-
created_at
|
|
681
|
+
created_at: string;
|
|
640
682
|
/** @example "previous_code" */
|
|
641
683
|
previous_plan_code?: string;
|
|
642
684
|
/** @example "next_code" */
|
|
@@ -645,21 +687,21 @@ export interface SubscriptionObject {
|
|
|
645
687
|
downgrade_plan_date?: string;
|
|
646
688
|
}
|
|
647
689
|
export interface Subscription {
|
|
648
|
-
subscription
|
|
690
|
+
subscription: SubscriptionObject;
|
|
649
691
|
}
|
|
650
692
|
export interface Subscriptions {
|
|
651
|
-
subscriptions
|
|
693
|
+
subscriptions: SubscriptionObject[];
|
|
652
694
|
}
|
|
653
695
|
export interface SubscriptionCreateInput {
|
|
654
|
-
subscription
|
|
696
|
+
subscription: {
|
|
655
697
|
/** @example 12345 */
|
|
656
|
-
external_customer_id
|
|
698
|
+
external_customer_id: string;
|
|
657
699
|
/** @example "example_code" */
|
|
658
|
-
plan_code
|
|
700
|
+
plan_code: string;
|
|
659
701
|
/** @example "Test name" */
|
|
660
702
|
name?: string;
|
|
661
703
|
/** @example 54321 */
|
|
662
|
-
external_id
|
|
704
|
+
external_id: string;
|
|
663
705
|
/** Billing time */
|
|
664
706
|
billing_time?: "calendar" | "anniversary";
|
|
665
707
|
/** @example "2022-08-08T00:00:00.000Z" */
|
|
@@ -667,7 +709,7 @@ export interface SubscriptionCreateInput {
|
|
|
667
709
|
};
|
|
668
710
|
}
|
|
669
711
|
export interface SubscriptionUpdateInput {
|
|
670
|
-
subscription
|
|
712
|
+
subscription: {
|
|
671
713
|
/** @example "New name" */
|
|
672
714
|
name?: string;
|
|
673
715
|
/** @example "2022-08-08T00:00:00.000Z" */
|
|
@@ -676,120 +718,146 @@ export interface SubscriptionUpdateInput {
|
|
|
676
718
|
}
|
|
677
719
|
export interface CreditObject {
|
|
678
720
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
679
|
-
lago_id
|
|
721
|
+
lago_id: string;
|
|
680
722
|
/** @example 1200 */
|
|
681
|
-
amount_cents
|
|
723
|
+
amount_cents: number;
|
|
682
724
|
/** @example "EUR" */
|
|
683
|
-
amount_currency
|
|
684
|
-
item
|
|
725
|
+
amount_currency: string;
|
|
726
|
+
item: {
|
|
685
727
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
686
|
-
lago_id
|
|
728
|
+
lago_id: string;
|
|
687
729
|
/** @example "coupon" */
|
|
688
|
-
type
|
|
730
|
+
type: string;
|
|
689
731
|
/** @example "code" */
|
|
690
|
-
code
|
|
732
|
+
code: string;
|
|
691
733
|
/** @example "name" */
|
|
692
|
-
name
|
|
734
|
+
name: string;
|
|
735
|
+
};
|
|
736
|
+
invoice: {
|
|
737
|
+
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
738
|
+
lago_id: string;
|
|
739
|
+
payment_status: "pending" | "succeeded" | "failed";
|
|
693
740
|
};
|
|
694
741
|
}
|
|
695
742
|
export interface FeeObject {
|
|
696
743
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
697
|
-
lago_id
|
|
744
|
+
lago_id: string;
|
|
698
745
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
699
746
|
lago_group_id?: string;
|
|
700
747
|
/** @example 1200 */
|
|
701
|
-
amount_cents
|
|
748
|
+
amount_cents: number;
|
|
702
749
|
/** @example "EUR" */
|
|
703
|
-
amount_currency
|
|
750
|
+
amount_currency: string;
|
|
704
751
|
/** @example 1200 */
|
|
705
|
-
vat_amount_cents
|
|
752
|
+
vat_amount_cents: number;
|
|
706
753
|
/** @example "EUR" */
|
|
707
|
-
vat_amount_currency
|
|
754
|
+
vat_amount_currency: string;
|
|
708
755
|
/** @example 2.5 */
|
|
709
|
-
units
|
|
756
|
+
units: number;
|
|
710
757
|
/** @example 5 */
|
|
711
758
|
events_count?: number;
|
|
712
|
-
item
|
|
759
|
+
item: {
|
|
713
760
|
/** Billing time */
|
|
714
|
-
type
|
|
761
|
+
type: "charge" | "add_on" | "subscription" | "credit";
|
|
715
762
|
/** @example "code" */
|
|
716
|
-
code
|
|
763
|
+
code: string;
|
|
717
764
|
/** @example "name" */
|
|
718
|
-
name
|
|
765
|
+
name: string;
|
|
719
766
|
};
|
|
720
767
|
}
|
|
721
|
-
export interface
|
|
768
|
+
export interface InvoiceMetadataObject {
|
|
722
769
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
723
770
|
lago_id?: string;
|
|
771
|
+
/** @example "name" */
|
|
772
|
+
key?: string;
|
|
773
|
+
/** @example "John" */
|
|
774
|
+
value?: string;
|
|
775
|
+
/** @example "2022-09-14T16:35:31.000Z" */
|
|
776
|
+
created_at?: string;
|
|
777
|
+
}
|
|
778
|
+
export interface InvoiceObject {
|
|
779
|
+
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
780
|
+
lago_id: string;
|
|
724
781
|
/** @example 12345 */
|
|
725
|
-
sequential_id
|
|
782
|
+
sequential_id: number;
|
|
726
783
|
/** @example 222345 */
|
|
727
|
-
number
|
|
784
|
+
number: string;
|
|
785
|
+
/** @example "2022-09-14T16:35:31.000Z" */
|
|
786
|
+
charges_from_date: string;
|
|
728
787
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
729
|
-
issuing_date
|
|
788
|
+
issuing_date: string;
|
|
730
789
|
invoice_type?: "subscription" | "add_on" | "credit";
|
|
731
|
-
status
|
|
732
|
-
payment_status
|
|
790
|
+
status: "draft" | "finalized";
|
|
791
|
+
payment_status: "pending" | "succeeded" | "failed";
|
|
733
792
|
/** @example 1200 */
|
|
734
|
-
amount_cents
|
|
793
|
+
amount_cents: number;
|
|
735
794
|
/** @example "EUR" */
|
|
736
|
-
amount_currency
|
|
795
|
+
amount_currency: string;
|
|
737
796
|
/** @example 20 */
|
|
738
|
-
vat_amount_cents
|
|
797
|
+
vat_amount_cents: number;
|
|
739
798
|
/** @example "EUR" */
|
|
740
|
-
vat_amount_currency
|
|
799
|
+
vat_amount_currency: string;
|
|
741
800
|
/** @example 20 */
|
|
742
|
-
credit_amount_cents
|
|
801
|
+
credit_amount_cents: number;
|
|
743
802
|
/** @example "EUR" */
|
|
744
|
-
credit_amount_currency
|
|
803
|
+
credit_amount_currency: string;
|
|
745
804
|
/** @example 1220 */
|
|
746
|
-
total_amount_cents
|
|
805
|
+
total_amount_cents: number;
|
|
747
806
|
/** @example "EUR" */
|
|
748
|
-
total_amount_currency
|
|
807
|
+
total_amount_currency: string;
|
|
749
808
|
/** @example true */
|
|
750
|
-
legacy
|
|
809
|
+
legacy: boolean;
|
|
751
810
|
/** @example "https://example.com" */
|
|
752
811
|
file_url?: string;
|
|
753
|
-
customer
|
|
754
|
-
subscriptions
|
|
755
|
-
|
|
756
|
-
|
|
812
|
+
customer: CustomerObject;
|
|
813
|
+
subscriptions: SubscriptionObject[];
|
|
814
|
+
metadata?: InvoiceMetadataObject[];
|
|
815
|
+
fees: FeeObject[];
|
|
816
|
+
credits: CreditObject[];
|
|
757
817
|
}
|
|
758
818
|
export interface Invoice {
|
|
759
|
-
invoice
|
|
819
|
+
invoice: InvoiceObject;
|
|
760
820
|
}
|
|
761
821
|
export interface Invoices {
|
|
762
|
-
invoices
|
|
822
|
+
invoices: InvoiceObject[];
|
|
763
823
|
}
|
|
764
824
|
export interface InvoiceInput {
|
|
765
|
-
invoice
|
|
825
|
+
invoice: {
|
|
766
826
|
/** Status */
|
|
767
|
-
payment_status
|
|
827
|
+
payment_status: "pending" | "succeeded" | "failed";
|
|
828
|
+
metadata?: {
|
|
829
|
+
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
830
|
+
id?: string;
|
|
831
|
+
/** @example "name" */
|
|
832
|
+
key?: string;
|
|
833
|
+
/** @example "John" */
|
|
834
|
+
value?: string;
|
|
835
|
+
}[];
|
|
768
836
|
};
|
|
769
837
|
}
|
|
770
838
|
export interface WalletObject {
|
|
771
839
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
772
|
-
lago_id
|
|
840
|
+
lago_id: string;
|
|
773
841
|
/** @example "254da83c-c007-4fbb-afcd-b00c07c41oit" */
|
|
774
|
-
lago_customer_id
|
|
842
|
+
lago_customer_id: string;
|
|
775
843
|
/** @example 12345 */
|
|
776
|
-
external_customer_id
|
|
844
|
+
external_customer_id: string;
|
|
777
845
|
/** Status */
|
|
778
|
-
status
|
|
846
|
+
status: "active" | "terminated";
|
|
779
847
|
/** @example "EUR" */
|
|
780
|
-
currency
|
|
848
|
+
currency: string;
|
|
781
849
|
/** @example "Name" */
|
|
782
850
|
name?: string;
|
|
783
851
|
/** @example 2 */
|
|
784
|
-
rate_amount
|
|
852
|
+
rate_amount: number;
|
|
785
853
|
/** @example 500 */
|
|
786
|
-
credits_balance
|
|
854
|
+
credits_balance: number;
|
|
787
855
|
/** @example 1000 */
|
|
788
|
-
balance
|
|
856
|
+
balance: number;
|
|
789
857
|
/** @example 100 */
|
|
790
|
-
consumed_credits
|
|
858
|
+
consumed_credits: number;
|
|
791
859
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
792
|
-
created_at
|
|
860
|
+
created_at: string;
|
|
793
861
|
/** @example "2022-09-14T23:59:59.000Z" */
|
|
794
862
|
expiration_at?: string;
|
|
795
863
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
@@ -800,31 +868,31 @@ export interface WalletObject {
|
|
|
800
868
|
terminated_at?: string;
|
|
801
869
|
}
|
|
802
870
|
export interface Wallet {
|
|
803
|
-
wallet
|
|
871
|
+
wallet: WalletObject;
|
|
804
872
|
}
|
|
805
873
|
export interface Wallets {
|
|
806
|
-
wallets
|
|
874
|
+
wallets: WalletObject[];
|
|
807
875
|
}
|
|
808
876
|
export interface WalletInput {
|
|
809
877
|
wallet?: {
|
|
810
878
|
/** @example "Wallet name" */
|
|
811
879
|
name?: string;
|
|
812
880
|
/** @example 2 */
|
|
813
|
-
rate_amount
|
|
881
|
+
rate_amount: number;
|
|
814
882
|
/** @example "EUR" */
|
|
815
|
-
currency
|
|
883
|
+
currency: string;
|
|
816
884
|
/** @example 500 */
|
|
817
885
|
paid_credits?: number;
|
|
818
886
|
/** @example 10 */
|
|
819
887
|
granted_credits?: number;
|
|
820
888
|
/** @example 12345 */
|
|
821
|
-
external_customer_id
|
|
889
|
+
external_customer_id: string;
|
|
822
890
|
/** @example "2022-09-14T23:59:59.000Z" */
|
|
823
891
|
expiration_at?: string;
|
|
824
892
|
};
|
|
825
893
|
}
|
|
826
894
|
export interface WalletUpdateInput {
|
|
827
|
-
wallet
|
|
895
|
+
wallet: {
|
|
828
896
|
/** @example "Wallet name" */
|
|
829
897
|
name?: string;
|
|
830
898
|
/** @example "2022-09-14T23:59:59.000Z" */
|
|
@@ -833,32 +901,32 @@ export interface WalletUpdateInput {
|
|
|
833
901
|
}
|
|
834
902
|
export interface WalletTransactionObject {
|
|
835
903
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
836
|
-
lago_id
|
|
904
|
+
lago_id: string;
|
|
837
905
|
/** @example "985da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
838
|
-
lago_wallet_id
|
|
906
|
+
lago_wallet_id: string;
|
|
839
907
|
/** Status */
|
|
840
|
-
status
|
|
908
|
+
status: "pending" | "settled";
|
|
841
909
|
/** Transaction type */
|
|
842
|
-
transaction_type
|
|
910
|
+
transaction_type: "inbound" | "outbound";
|
|
843
911
|
/** @example 500 */
|
|
844
|
-
amount
|
|
912
|
+
amount: number;
|
|
845
913
|
/** @example 100 */
|
|
846
|
-
credit_amount
|
|
914
|
+
credit_amount: number;
|
|
847
915
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
848
916
|
settled_at?: string;
|
|
849
917
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
850
|
-
created_at
|
|
918
|
+
created_at: string;
|
|
851
919
|
}
|
|
852
920
|
export interface WalletTransaction {
|
|
853
|
-
wallet_transaction
|
|
921
|
+
wallet_transaction: WalletTransactionObject;
|
|
854
922
|
}
|
|
855
923
|
export interface WalletTransactions {
|
|
856
|
-
wallet_transactions
|
|
924
|
+
wallet_transactions: WalletTransactionObject[];
|
|
857
925
|
}
|
|
858
926
|
export interface WalletTransactionInput {
|
|
859
|
-
wallet_transaction
|
|
927
|
+
wallet_transaction: {
|
|
860
928
|
/** @example "985da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
861
|
-
wallet_id
|
|
929
|
+
wallet_id: string;
|
|
862
930
|
/** @example 100 */
|
|
863
931
|
paid_credits?: number;
|
|
864
932
|
/** @example 10 */
|
|
@@ -867,97 +935,97 @@ export interface WalletTransactionInput {
|
|
|
867
935
|
}
|
|
868
936
|
export interface CreditNoteItemObject {
|
|
869
937
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
870
|
-
lago_id
|
|
938
|
+
lago_id: string;
|
|
871
939
|
/** @example 1220 */
|
|
872
|
-
amount_cents
|
|
940
|
+
amount_cents: number;
|
|
873
941
|
/** @example "EUR" */
|
|
874
|
-
amount_currency
|
|
875
|
-
fee
|
|
942
|
+
amount_currency: string;
|
|
943
|
+
fee: FeeObject;
|
|
876
944
|
}
|
|
877
945
|
export interface CreditNoteObject {
|
|
878
946
|
/** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
879
|
-
lago_id
|
|
947
|
+
lago_id: string;
|
|
880
948
|
/** @example 1234 */
|
|
881
|
-
sequential_id
|
|
882
|
-
/** @example 123456789 */
|
|
883
|
-
number
|
|
949
|
+
sequential_id: number;
|
|
950
|
+
/** @example "123456789" */
|
|
951
|
+
number: string;
|
|
884
952
|
/** @example "144da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
885
|
-
lago_invoice_id
|
|
886
|
-
/** @example 123456789 */
|
|
887
|
-
invoice_number
|
|
953
|
+
lago_invoice_id: string;
|
|
954
|
+
/** @example "123456789" */
|
|
955
|
+
invoice_number: string;
|
|
888
956
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
889
|
-
issuing_date
|
|
957
|
+
issuing_date: string;
|
|
890
958
|
/** Credit status */
|
|
891
959
|
credit_status?: "available" | "consumed" | "voided";
|
|
892
960
|
/** Refund status */
|
|
893
961
|
refund_status?: "pending" | "succeeded" | "failed";
|
|
894
962
|
/** Reason */
|
|
895
|
-
reason
|
|
963
|
+
reason: "duplicated_charge" | "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "other";
|
|
896
964
|
/** @example "description" */
|
|
897
965
|
description?: string;
|
|
898
966
|
/** @example 1220 */
|
|
899
|
-
total_amount_cents
|
|
967
|
+
total_amount_cents: number;
|
|
900
968
|
/** @example "EUR" */
|
|
901
|
-
total_amount_currency
|
|
969
|
+
total_amount_currency: string;
|
|
902
970
|
/** @example 20 */
|
|
903
|
-
vat_amount_cents
|
|
971
|
+
vat_amount_cents: number;
|
|
904
972
|
/** @example "EUR" */
|
|
905
|
-
vat_amount_currency
|
|
973
|
+
vat_amount_currency: string;
|
|
906
974
|
/** @example 1000 */
|
|
907
|
-
sub_total_vat_excluded_amount_cents
|
|
975
|
+
sub_total_vat_excluded_amount_cents: number;
|
|
908
976
|
/** @example "EUR" */
|
|
909
|
-
sub_total_vat_excluded_amount_currency
|
|
977
|
+
sub_total_vat_excluded_amount_currency: string;
|
|
910
978
|
/** @example 20 */
|
|
911
|
-
balance_amount_cents
|
|
979
|
+
balance_amount_cents: number;
|
|
912
980
|
/** @example "EUR" */
|
|
913
|
-
balance_amount_currency
|
|
981
|
+
balance_amount_currency: string;
|
|
914
982
|
/** @example 20 */
|
|
915
|
-
credit_amount_cents
|
|
983
|
+
credit_amount_cents: number;
|
|
916
984
|
/** @example "EUR" */
|
|
917
|
-
credit_amount_currency
|
|
985
|
+
credit_amount_currency: string;
|
|
918
986
|
/** @example 20 */
|
|
919
|
-
refund_amount_cents
|
|
987
|
+
refund_amount_cents: number;
|
|
920
988
|
/** @example "EUR" */
|
|
921
|
-
refund_amount_currency
|
|
989
|
+
refund_amount_currency: string;
|
|
922
990
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
923
|
-
created_at
|
|
991
|
+
created_at: string;
|
|
924
992
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
925
|
-
updated_at
|
|
993
|
+
updated_at: string;
|
|
926
994
|
/** @example "https://example.com" */
|
|
927
995
|
file_url?: string;
|
|
928
996
|
customer?: CustomerObject;
|
|
929
997
|
items?: CreditNoteItemObject[];
|
|
930
998
|
}
|
|
931
999
|
export interface CreditNote {
|
|
932
|
-
credit_note
|
|
1000
|
+
credit_note: CreditNoteObject;
|
|
933
1001
|
}
|
|
934
1002
|
export interface CreditNotes {
|
|
935
|
-
credit_notes
|
|
1003
|
+
credit_notes: CreditNoteObject[];
|
|
936
1004
|
}
|
|
937
1005
|
export interface CreditNoteInput {
|
|
938
|
-
credit_note
|
|
1006
|
+
credit_note: {
|
|
939
1007
|
/** @example "194da83c-c007-4fbb-afcd-b00c07c41fzh" */
|
|
940
|
-
invoice_id
|
|
1008
|
+
invoice_id: string;
|
|
941
1009
|
/** Reason */
|
|
942
|
-
reason
|
|
1010
|
+
reason: "duplicated_charge" | "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "other";
|
|
943
1011
|
/** @example "description" */
|
|
944
1012
|
description?: string;
|
|
945
1013
|
/** @example 20 */
|
|
946
|
-
credit_amount_cents
|
|
1014
|
+
credit_amount_cents: number;
|
|
947
1015
|
/** @example 20 */
|
|
948
|
-
refund_amount_cents
|
|
949
|
-
items
|
|
1016
|
+
refund_amount_cents: number;
|
|
1017
|
+
items: {
|
|
950
1018
|
/** @example "144da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
951
|
-
fee_id
|
|
1019
|
+
fee_id: string;
|
|
952
1020
|
/** @example 20 */
|
|
953
|
-
amount_cents
|
|
1021
|
+
amount_cents: number;
|
|
954
1022
|
}[];
|
|
955
1023
|
};
|
|
956
1024
|
}
|
|
957
1025
|
export interface CreditNoteUpdateInput {
|
|
958
|
-
credit_note
|
|
1026
|
+
credit_note: {
|
|
959
1027
|
/** Refund status */
|
|
960
|
-
refund_status
|
|
1028
|
+
refund_status: "pending" | "succeeded" | "failed";
|
|
961
1029
|
};
|
|
962
1030
|
}
|
|
963
1031
|
export interface ApiResponseBadRequest {
|
|
@@ -965,52 +1033,52 @@ export interface ApiResponseBadRequest {
|
|
|
965
1033
|
* @format int32
|
|
966
1034
|
* @example 400
|
|
967
1035
|
*/
|
|
968
|
-
status
|
|
1036
|
+
status: number;
|
|
969
1037
|
/** @example "Bad request" */
|
|
970
|
-
error
|
|
1038
|
+
error: string;
|
|
971
1039
|
}
|
|
972
1040
|
export interface ApiResponseUnauthorized {
|
|
973
1041
|
/**
|
|
974
1042
|
* @format int32
|
|
975
1043
|
* @example 401
|
|
976
1044
|
*/
|
|
977
|
-
status
|
|
1045
|
+
status: number;
|
|
978
1046
|
/** @example "Unauthorized" */
|
|
979
|
-
error
|
|
1047
|
+
error: string;
|
|
980
1048
|
}
|
|
981
1049
|
export interface ApiResponseUnprocessableEntity {
|
|
982
1050
|
/**
|
|
983
1051
|
* @format int32
|
|
984
1052
|
* @example 422
|
|
985
1053
|
*/
|
|
986
|
-
status
|
|
1054
|
+
status: number;
|
|
987
1055
|
/** @example "Unprocessable entity" */
|
|
988
|
-
error
|
|
1056
|
+
error: string;
|
|
989
1057
|
/** @example "validation_errors" */
|
|
990
|
-
code
|
|
991
|
-
error_details
|
|
1058
|
+
code: string;
|
|
1059
|
+
error_details: object;
|
|
992
1060
|
}
|
|
993
1061
|
export interface ApiResponseNotFound {
|
|
994
1062
|
/**
|
|
995
1063
|
* @format int32
|
|
996
1064
|
* @example 404
|
|
997
1065
|
*/
|
|
998
|
-
status
|
|
1066
|
+
status: number;
|
|
999
1067
|
/** @example "Not Found" */
|
|
1000
|
-
error
|
|
1068
|
+
error: string;
|
|
1001
1069
|
/** @example "object_not_found" */
|
|
1002
|
-
code
|
|
1070
|
+
code: string;
|
|
1003
1071
|
}
|
|
1004
1072
|
export interface ApiResponseNotAllowed {
|
|
1005
1073
|
/**
|
|
1006
1074
|
* @format int32
|
|
1007
1075
|
* @example 405
|
|
1008
1076
|
*/
|
|
1009
|
-
status
|
|
1077
|
+
status: number;
|
|
1010
1078
|
/** @example "Method Not Allowed" */
|
|
1011
|
-
error
|
|
1079
|
+
error: string;
|
|
1012
1080
|
/** @example "not_allowed" */
|
|
1013
|
-
code
|
|
1081
|
+
code: string;
|
|
1014
1082
|
}
|
|
1015
1083
|
export type QueryParamsType = Record<string | number, any>;
|
|
1016
1084
|
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
|
|
@@ -1072,7 +1140,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
1072
1140
|
}
|
|
1073
1141
|
/**
|
|
1074
1142
|
* @title Lago API documentation
|
|
1075
|
-
* @version 0.
|
|
1143
|
+
* @version 0.26.0-beta
|
|
1076
1144
|
* @baseUrl https://api.getlago.com/api/v1
|
|
1077
1145
|
* @externalDocs https://github.com/getlago
|
|
1078
1146
|
* @contact <tech@getlago.com>
|
|
@@ -1204,7 +1272,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1204
1272
|
* @request DELETE:/add_ons/{code}
|
|
1205
1273
|
* @secure
|
|
1206
1274
|
*/
|
|
1207
|
-
destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiResponseUnauthorized | ApiResponseNotFound
|
|
1275
|
+
destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1208
1276
|
/**
|
|
1209
1277
|
* @description Find all add-ons in certain organisation
|
|
1210
1278
|
*
|
|
@@ -1279,7 +1347,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1279
1347
|
* @request DELETE:/coupons/{code}
|
|
1280
1348
|
* @secure
|
|
1281
1349
|
*/
|
|
1282
|
-
destroyCoupon: (code: string, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiResponseUnauthorized | ApiResponseNotFound
|
|
1350
|
+
destroyCoupon: (code: string, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1283
1351
|
/**
|
|
1284
1352
|
* @description Find all coupons in certain organisation
|
|
1285
1353
|
*
|
|
@@ -1337,7 +1405,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1337
1405
|
status?: "active" | "terminated";
|
|
1338
1406
|
/**
|
|
1339
1407
|
* External customer ID
|
|
1340
|
-
* @example 12345
|
|
1408
|
+
* @example "12345"
|
|
1341
1409
|
*/
|
|
1342
1410
|
external_customer_id?: string;
|
|
1343
1411
|
}, params?: RequestParams) => Promise<HttpResponse<AppliedCoupons, ApiResponseUnauthorized>>;
|
|
@@ -1384,7 +1452,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1384
1452
|
* @request DELETE:/customers/{external_id}
|
|
1385
1453
|
* @secure
|
|
1386
1454
|
*/
|
|
1387
|
-
deleteCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiResponseUnauthorized | ApiResponseNotFound
|
|
1455
|
+
deleteCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1388
1456
|
/**
|
|
1389
1457
|
* @description Return a customer current usage
|
|
1390
1458
|
*
|
|
@@ -1397,10 +1465,20 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1397
1465
|
findCustomerCurrentUsage: (customerExternalId: string, query: {
|
|
1398
1466
|
/**
|
|
1399
1467
|
* External subscription ID
|
|
1400
|
-
* @example 54321
|
|
1468
|
+
* @example "54321"
|
|
1401
1469
|
*/
|
|
1402
1470
|
external_subscription_id: string;
|
|
1403
1471
|
}, params?: RequestParams) => Promise<HttpResponse<CustomerUsage, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1472
|
+
/**
|
|
1473
|
+
* @description Delete customer's appplied coupon
|
|
1474
|
+
*
|
|
1475
|
+
* @tags customers
|
|
1476
|
+
* @name DeleteAppliedCoupon
|
|
1477
|
+
* @summary Delete customer's appplied coupon
|
|
1478
|
+
* @request DELETE:/customers/{customer_external_id}/applied_coupons/{applied_coupon_id}
|
|
1479
|
+
* @secure
|
|
1480
|
+
*/
|
|
1481
|
+
deleteAppliedCoupon: (customerExternalId: string, appliedCouponId: string, params?: RequestParams) => Promise<HttpResponse<AppliedCoupon, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1404
1482
|
/**
|
|
1405
1483
|
* @description Find all customers in certain organisation
|
|
1406
1484
|
*
|
|
@@ -1495,7 +1573,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1495
1573
|
* @request DELETE:/plans/{code}
|
|
1496
1574
|
* @secure
|
|
1497
1575
|
*/
|
|
1498
|
-
destroyPlan: (code: string, params?: RequestParams) => Promise<HttpResponse<Plan, ApiResponseUnauthorized | ApiResponseNotFound
|
|
1576
|
+
destroyPlan: (code: string, params?: RequestParams) => Promise<HttpResponse<Plan, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1499
1577
|
/**
|
|
1500
1578
|
* @description Find all plans in certain organisation
|
|
1501
1579
|
*
|
|
@@ -1571,7 +1649,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1571
1649
|
per_page?: number;
|
|
1572
1650
|
/**
|
|
1573
1651
|
* External customer ID
|
|
1574
|
-
* @example 12345
|
|
1652
|
+
* @example "12345"
|
|
1575
1653
|
*/
|
|
1576
1654
|
external_customer_id: string;
|
|
1577
1655
|
}, params?: RequestParams) => Promise<HttpResponse<Subscriptions, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
@@ -1671,7 +1749,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1671
1749
|
per_page?: number;
|
|
1672
1750
|
/**
|
|
1673
1751
|
* External customer ID
|
|
1674
|
-
* @example 12345
|
|
1752
|
+
* @example "12345"
|
|
1675
1753
|
*/
|
|
1676
1754
|
external_customer_id?: string;
|
|
1677
1755
|
/**
|
|
@@ -1691,6 +1769,18 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1691
1769
|
status?: string;
|
|
1692
1770
|
}, params?: RequestParams) => Promise<HttpResponse<Invoices, ApiResponseUnauthorized>>;
|
|
1693
1771
|
};
|
|
1772
|
+
fees: {
|
|
1773
|
+
/**
|
|
1774
|
+
* @description Return a single fee
|
|
1775
|
+
*
|
|
1776
|
+
* @tags fees
|
|
1777
|
+
* @name FindFee
|
|
1778
|
+
* @summary Find fee by ID
|
|
1779
|
+
* @request GET:/fees/{id}
|
|
1780
|
+
* @secure
|
|
1781
|
+
*/
|
|
1782
|
+
findFee: (id: string, params?: RequestParams) => Promise<HttpResponse<FeeObject, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1783
|
+
};
|
|
1694
1784
|
wallets: {
|
|
1695
1785
|
/**
|
|
1696
1786
|
* @description Create a new wallet
|
|
@@ -1754,7 +1844,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1754
1844
|
per_page?: number;
|
|
1755
1845
|
/**
|
|
1756
1846
|
* External customer ID
|
|
1757
|
-
* @example 12345
|
|
1847
|
+
* @example "12345"
|
|
1758
1848
|
*/
|
|
1759
1849
|
external_customer_id: string;
|
|
1760
1850
|
}, params?: RequestParams) => Promise<HttpResponse<Wallets, ApiResponseUnauthorized>>;
|
|
@@ -1875,7 +1965,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1875
1965
|
per_page?: number;
|
|
1876
1966
|
/**
|
|
1877
1967
|
* External customer ID
|
|
1878
|
-
* @example 12345
|
|
1968
|
+
* @example "12345"
|
|
1879
1969
|
*/
|
|
1880
1970
|
external_customer_id?: string;
|
|
1881
1971
|
}, params?: RequestParams) => Promise<HttpResponse<CreditNotes, ApiResponseUnauthorized>>;
|