lago-javascript-client 0.19.4-alpha

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.
@@ -0,0 +1,1802 @@
1
+ export interface BillableMetricGroup {
2
+ /** @example "region" */
3
+ key?: string;
4
+ values?: (string | object)[];
5
+ }
6
+ export interface BillableMetricObject {
7
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
8
+ lago_id?: string;
9
+ /** @example "bm1" */
10
+ name?: string;
11
+ /** @example "example_code" */
12
+ code?: string;
13
+ /** @example "description" */
14
+ description?: string;
15
+ /** @example "2022-09-14T16:35:31.000Z" */
16
+ created_at?: string;
17
+ /** @example "amount" */
18
+ field_name?: string;
19
+ /** Aggregation type */
20
+ aggregation_type?: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "recurring_count_agg";
21
+ group?: BillableMetricGroup;
22
+ }
23
+ export interface BillableMetric {
24
+ billable_metric?: BillableMetricObject;
25
+ }
26
+ export interface BillableMetrics {
27
+ billable_metrics?: BillableMetricObject[];
28
+ }
29
+ export interface BillableMetricInput {
30
+ billable_metric?: {
31
+ /** @example "bm1" */
32
+ name?: string;
33
+ /** @example "example_code" */
34
+ code?: string;
35
+ /** @example "description" */
36
+ description?: string;
37
+ /** @example "amount" */
38
+ field_name?: string;
39
+ /** Aggregation type */
40
+ aggregation_type?: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "recurring_count_agg";
41
+ group?: BillableMetricGroup;
42
+ };
43
+ }
44
+ export interface GroupObject {
45
+ /** @example "region" */
46
+ key?: string;
47
+ /** @example "EU" */
48
+ value?: string;
49
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
50
+ lago_id?: string;
51
+ }
52
+ export interface Groups {
53
+ groups?: GroupObject[];
54
+ }
55
+ export interface AddOnObject {
56
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
57
+ lago_id?: string;
58
+ /** @example "example name" */
59
+ name?: string;
60
+ /** @example "example_code" */
61
+ code?: string;
62
+ /** @example "description" */
63
+ description?: string;
64
+ /** @example "2022-09-14T16:35:31.000Z" */
65
+ created_at?: string;
66
+ /** @example 1200 */
67
+ amount_cents?: number;
68
+ /** @example "EUR" */
69
+ amount_currency?: string;
70
+ }
71
+ export interface AddOn {
72
+ add_on?: AddOnObject;
73
+ }
74
+ export interface AddOns {
75
+ add_ons?: AddOnObject[];
76
+ }
77
+ export interface AddOnInput {
78
+ add_on?: {
79
+ /** @example "example name" */
80
+ name?: string;
81
+ /** @example "example_code" */
82
+ code?: string;
83
+ /** @example "description" */
84
+ description?: string;
85
+ /** @example 1200 */
86
+ amount_cents?: number;
87
+ /** @example "EUR" */
88
+ amount_currency?: string;
89
+ };
90
+ }
91
+ export interface AppliedAddOnObject {
92
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
93
+ lago_id?: string;
94
+ /** @example "457uj93c-c007-4fbb-afcd-b00c07c41kki" */
95
+ lago_add_on_id?: string;
96
+ /** @example "code" */
97
+ add_on_code?: string;
98
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
99
+ lago_customer_id?: string;
100
+ /** @example 1234567 */
101
+ external_customer_id?: string;
102
+ /** @example 1200 */
103
+ amount_cents?: number;
104
+ /** @example "EUR" */
105
+ amount_currency?: string;
106
+ /** @example "2022-09-14T16:35:31.000Z" */
107
+ created_at?: string;
108
+ }
109
+ export interface AppliedAddOn {
110
+ applied_add_on?: AppliedAddOnObject;
111
+ }
112
+ export interface AppliedAddOnInput {
113
+ applied_add_on?: {
114
+ /** @example 1234567 */
115
+ external_customer_id?: string;
116
+ /** @example "code" */
117
+ add_on_code?: string;
118
+ /** @example 1200 */
119
+ amount_cents?: number;
120
+ /** @example "EUR" */
121
+ amount_currency?: string;
122
+ };
123
+ }
124
+ export interface CouponObject {
125
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
126
+ lago_id?: string;
127
+ /** @example "coupon1" */
128
+ name?: string;
129
+ /** @example "example_code" */
130
+ code?: string;
131
+ /** Coupon type */
132
+ coupon_type?: "fixed_amount" | "percentage";
133
+ /** @example 1200 */
134
+ amount_cents?: number;
135
+ /** @example "EUR" */
136
+ amount_currency?: string;
137
+ /** @example true */
138
+ reusable?: boolean;
139
+ /** @example "2022-09-14T16:35:31.000Z" */
140
+ created_at?: string;
141
+ /** @example 25 */
142
+ percentage_rate?: number;
143
+ /** Frequency type */
144
+ frequency?: "once" | "recurring";
145
+ /** @example 3 */
146
+ frequency_duration?: number;
147
+ /** @example "2022-09-14T23:59:59.000Z" */
148
+ expiration_at?: string;
149
+ /** Expiration type */
150
+ expiration?: "no_expiration" | "time_limit";
151
+ }
152
+ export interface Coupon {
153
+ coupon?: CouponObject;
154
+ }
155
+ export interface Coupons {
156
+ coupons?: CouponObject[];
157
+ }
158
+ export interface CouponInput {
159
+ coupon?: {
160
+ /** @example "coupon1" */
161
+ name?: string;
162
+ /** @example "example_code" */
163
+ code?: string;
164
+ /** Coupon type */
165
+ coupon_type?: "fixed_amount" | "percentage";
166
+ /** @example 1200 */
167
+ amount_cents?: number;
168
+ /** @example "EUR" */
169
+ amount_currency?: string;
170
+ /** @example true */
171
+ reusable?: boolean;
172
+ /** @example 25 */
173
+ percentage_rate?: number;
174
+ /** Frequency type */
175
+ frequency?: "once" | "recurring";
176
+ /** @example 3 */
177
+ frequency_duration?: number;
178
+ /** @example "2022-09-14T23:59:59.000Z" */
179
+ expiration_at?: string;
180
+ /** Expiration type */
181
+ expiration?: "no_expiration" | "time_limit";
182
+ };
183
+ }
184
+ export interface AppliedCouponObject {
185
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
186
+ lago_id?: string;
187
+ /** @example "544da83c-c007-4fbb-afcd-b00c07c41iit" */
188
+ lago_coupon_id?: string;
189
+ /** @example "example_code" */
190
+ coupon_code?: string;
191
+ /** @example "321da83c-c007-4fbb-afcd-b00c07c41ssd" */
192
+ lago_customer_id?: string;
193
+ /** @example 123456 */
194
+ external_customer_id?: string;
195
+ /** Status */
196
+ status?: "active" | "terminated";
197
+ /** @example 1200 */
198
+ amount_cents?: number;
199
+ /** @example 800 */
200
+ amount_cents_remaining?: number;
201
+ /** @example "EUR" */
202
+ amount_currency?: string;
203
+ /** @example 25 */
204
+ percentage_rate?: number;
205
+ /** Frequency type */
206
+ frequency?: "once" | "recurring";
207
+ /** @example 3 */
208
+ frequency_duration?: number;
209
+ /** @example 2 */
210
+ frequency_duration_remaining?: number;
211
+ /** @example "2022-09-14T23:59:59.000Z" */
212
+ expiration_at?: string;
213
+ /** @example "2022-09-14T16:35:31.000Z" */
214
+ created_at?: string;
215
+ /** @example "2022-09-14T16:35:31.000Z" */
216
+ terminated_at?: string;
217
+ }
218
+ export interface AppliedCoupon {
219
+ applied_coupon?: AppliedCouponObject;
220
+ }
221
+ export interface AppliedCoupons {
222
+ applied_coupons?: AppliedCouponObject[];
223
+ }
224
+ export interface AppliedCouponInput {
225
+ applied_coupon?: {
226
+ /** @example 123456 */
227
+ external_customer_id?: string;
228
+ /** @example "example_code" */
229
+ coupon_code?: string;
230
+ /** Frequency type */
231
+ frequency?: "once" | "recurring";
232
+ /** @example 3 */
233
+ frequency_duration?: number;
234
+ /** @example 1200 */
235
+ amount_cents?: number;
236
+ /** @example "EUR" */
237
+ amount_currency?: string;
238
+ /** @example 25 */
239
+ percentage_rate?: number;
240
+ };
241
+ }
242
+ export interface BillingConfigurationOrganization {
243
+ /** @example "text" */
244
+ invoice_footer?: string;
245
+ /** @example 25 */
246
+ vat_rate?: number;
247
+ /** @example 5 */
248
+ invoice_grace_period?: number;
249
+ }
250
+ export interface OrganizationObject {
251
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
252
+ lago_id?: string;
253
+ /** @example "example name" */
254
+ name?: string;
255
+ /** @example "2022-09-14T16:35:31.000Z" */
256
+ created_at?: string;
257
+ /** @example "https://example.com" */
258
+ webhook_url?: string;
259
+ /** @example "CZ" */
260
+ country?: string;
261
+ /** @example "address1" */
262
+ address_line1?: string;
263
+ /** @example "address2" */
264
+ address_line2?: string;
265
+ /** @example "state1" */
266
+ state?: string;
267
+ /** @example 10000 */
268
+ zipode?: string;
269
+ /** @example "example@example.com" */
270
+ email?: string;
271
+ /** @example "City" */
272
+ city?: string;
273
+ /** @example "name1" */
274
+ legal_name?: string;
275
+ /** @example 10000 */
276
+ legal_number?: string;
277
+ /** @example "UTC" */
278
+ timezone?: string;
279
+ billing_configuration?: BillingConfigurationOrganization;
280
+ }
281
+ export interface Organization {
282
+ organization?: OrganizationObject;
283
+ }
284
+ export interface OrganizationInput {
285
+ organization?: {
286
+ /** @example "https://example.com" */
287
+ webhook_url?: string;
288
+ /** @example "CZ" */
289
+ country?: string;
290
+ /** @example "address1" */
291
+ address_line1?: string;
292
+ /** @example "address2" */
293
+ address_line2?: string;
294
+ /** @example "state1" */
295
+ state?: string;
296
+ /** @example 10000 */
297
+ zipode?: string;
298
+ /** @example "example@example.com" */
299
+ email?: string;
300
+ /** @example "City" */
301
+ city?: string;
302
+ /** @example "name1" */
303
+ legal_name?: string;
304
+ /** @example 10000 */
305
+ legal_number?: string;
306
+ /** @example "Europe/Paris" */
307
+ timezone?: string;
308
+ billing_configuration?: BillingConfigurationOrganization;
309
+ };
310
+ }
311
+ export interface BillingConfigurationCustomer {
312
+ /** @example 3 */
313
+ invoice_grace_period?: number;
314
+ /** @example 25 */
315
+ vat_rate?: number;
316
+ /** Payment provider type */
317
+ payment_provider?: "stripe" | "gocardless";
318
+ /** @example 123456 */
319
+ provider_customer_id?: string;
320
+ /** @example true */
321
+ sync_with_provider?: boolean;
322
+ [key: string]: any;
323
+ }
324
+ export interface CustomerObject {
325
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
326
+ lago_id?: string;
327
+ /** @example "886da83c-c007-4fbb-afcd-b00c07c41ffe" */
328
+ external_id?: string;
329
+ /** @example "John Doe" */
330
+ name?: string;
331
+ /** @example 12345 */
332
+ sequential_id?: number;
333
+ /** @example "slug" */
334
+ slug?: string;
335
+ /** @example "2022-09-14T16:35:31.000Z" */
336
+ created_at?: string;
337
+ /** @example "CZ" */
338
+ country?: string;
339
+ /** @example "address1" */
340
+ address_line1?: string;
341
+ /** @example "address2" */
342
+ address_line2?: string;
343
+ /** @example "state1" */
344
+ state?: string;
345
+ /** @example 10000 */
346
+ zipode?: string;
347
+ /** @example "example@example.com" */
348
+ email?: string;
349
+ /** @example "City" */
350
+ city?: string;
351
+ /** @example "https://example.com" */
352
+ url?: string;
353
+ /** @example 3551234567 */
354
+ phone?: string;
355
+ /** @example "https://lago.url" */
356
+ lago_url?: string;
357
+ /** @example "name1" */
358
+ legal_name?: string;
359
+ /** @example 10000 */
360
+ legal_number?: string;
361
+ /** @example "EUR" */
362
+ currency?: string;
363
+ /** @example "UTC" */
364
+ timezone?: string;
365
+ /** @example "UTC" */
366
+ applicable_timezone?: string;
367
+ billing_configuration?: BillingConfigurationCustomer;
368
+ }
369
+ export interface Customer {
370
+ customer?: CustomerObject;
371
+ }
372
+ export interface Customers {
373
+ customers?: CustomerObject[];
374
+ }
375
+ export interface CustomerInput {
376
+ customer?: {
377
+ /** @example "886da83c-c007-4fbb-afcd-b00c07c41ffe" */
378
+ external_id?: string;
379
+ /** @example "John Doe" */
380
+ name?: string;
381
+ /** @example "CZ" */
382
+ country?: string;
383
+ /** @example "address1" */
384
+ address_line1?: string;
385
+ /** @example "address2" */
386
+ address_line2?: string;
387
+ /** @example "state1" */
388
+ state?: string;
389
+ /** @example 10000 */
390
+ zipode?: string;
391
+ /** @example "example@example.com" */
392
+ email?: string;
393
+ /** @example "City" */
394
+ city?: string;
395
+ /** @example "https://example.com" */
396
+ url?: string;
397
+ /** @example 3551234567 */
398
+ phone?: string;
399
+ /** @example "https://lago.url" */
400
+ lago_url?: string;
401
+ /** @example "name1" */
402
+ legal_name?: string;
403
+ /** @example 10000 */
404
+ legal_number?: string;
405
+ /** @example "EUR" */
406
+ currency?: string;
407
+ /** @example "Europe/Paris" */
408
+ timezone?: string;
409
+ billing_configuration?: BillingConfigurationCustomer;
410
+ };
411
+ }
412
+ export interface ChargeUsageObject {
413
+ /** @example 3 */
414
+ units?: number;
415
+ /** @example 1200 */
416
+ amount_cents?: number;
417
+ /** @example "EUR" */
418
+ amount_currency?: string;
419
+ charge?: {
420
+ /** @example "278da83c-c007-4fbb-afcd-b00c07c41utg" */
421
+ lago_id?: string;
422
+ /** Charge model type */
423
+ charge_model?: "standard" | "graduated" | "package" | "percentage" | "volume";
424
+ };
425
+ billable_metric?: {
426
+ /** @example "278da83c-c007-4fbb-afcd-b00c07c41utg" */
427
+ lago_id?: string;
428
+ /** @example "Example name" */
429
+ name?: string;
430
+ /** @example "code" */
431
+ code?: string;
432
+ /** Aggregation type */
433
+ aggregation_type?: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "recurring_count_agg";
434
+ };
435
+ groups?: {
436
+ /** @example "278da83c-c007-4fbb-afcd-b00c07c41utg" */
437
+ lago_id?: string;
438
+ /** @example "key" */
439
+ key?: string;
440
+ /** @example "value" */
441
+ value?: string;
442
+ /** @example 3.5 */
443
+ units?: number;
444
+ /** @example 1200 */
445
+ amount_cents?: number;
446
+ }[];
447
+ }
448
+ export interface CustomerUsageObject {
449
+ /** @example "2022-09-14T00:00:00.000Z" */
450
+ from_datetime?: string;
451
+ /** @example "2022-09-14T00:00:00.000Z" */
452
+ to_datetime?: string;
453
+ /** @example "2022-09-15T00:00:00.000Z" */
454
+ issuing_date?: string;
455
+ /** @example 1200 */
456
+ amount_cents?: number;
457
+ /** @example "EUR" */
458
+ amount_currency?: string;
459
+ /** @example 1400 */
460
+ total_amount_cents?: number;
461
+ /** @example "EUR" */
462
+ total_amount_currency?: string;
463
+ /** @example 200 */
464
+ vat_amount_cents?: number;
465
+ /** @example "EUR" */
466
+ vat_amount_currency?: string;
467
+ charges_usage?: ChargeUsageObject[];
468
+ }
469
+ export interface CustomerUsage {
470
+ customer_usage?: CustomerUsageObject;
471
+ }
472
+ export interface EventObject {
473
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
474
+ lago_id?: string;
475
+ /** @example 987654321 */
476
+ transaction_id?: string;
477
+ /** @example "111da83c-c007-4fbb-afcd-b00c07c41iop" */
478
+ lago_customer_id?: string;
479
+ /** @example 123456 */
480
+ external_customer_id?: string;
481
+ /** @example "code" */
482
+ code?: string;
483
+ /** @example "2022-09-14T16:35:31.000Z" */
484
+ timestamp?: string;
485
+ properties?: object;
486
+ /** @example "447da83c-c007-4fbb-afcd-b00c07c41ffe" */
487
+ lago_subscription_id?: string;
488
+ /** @example 123456 */
489
+ external_subscription_id?: string;
490
+ /** @example "2022-09-14T16:35:31.000Z" */
491
+ created_at?: string;
492
+ }
493
+ export interface Event {
494
+ event?: EventObject;
495
+ }
496
+ export interface EventInput {
497
+ event?: {
498
+ /** @example 123456 */
499
+ transaction_id?: string;
500
+ /** @example 654321 */
501
+ external_customer_id?: string;
502
+ /** @example "code" */
503
+ code?: string;
504
+ /** @example 1669823754 */
505
+ timestamp?: number;
506
+ /** @example 123456 */
507
+ external_subscription_id?: string;
508
+ properties?: object;
509
+ };
510
+ }
511
+ export interface BatchEventInput {
512
+ event?: {
513
+ /** @example 123456 */
514
+ transaction_id?: string;
515
+ /** @example 654321 */
516
+ external_customer_id?: string;
517
+ /** @example "code" */
518
+ code?: string;
519
+ /** @example 1669823754 */
520
+ timestamp?: number;
521
+ external_subscription_ids?: string[];
522
+ properties?: object;
523
+ };
524
+ }
525
+ export interface GroupPropertiesObject {
526
+ /** @example 123456 */
527
+ group_id?: string;
528
+ values?: object;
529
+ }
530
+ export interface ChargeObject {
531
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
532
+ lago_id?: string;
533
+ /** @example "278da83c-c007-4fbb-afcd-b00c07c41utg" */
534
+ lago_billable_metric_id?: string;
535
+ /** @example "2022-09-14T16:35:31.000Z" */
536
+ created_at?: string;
537
+ /** Charge model type */
538
+ charge_model?: "standard" | "graduated" | "package" | "percentage" | "volume";
539
+ properties?: object;
540
+ group_properties?: GroupPropertiesObject[];
541
+ }
542
+ export interface PlanObject {
543
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
544
+ lago_id?: string;
545
+ /** @example "example name" */
546
+ name?: string;
547
+ /** @example "2022-09-14T16:35:31.000Z" */
548
+ created_at?: string;
549
+ /** @example "example_code" */
550
+ code?: string;
551
+ /** Plan interval */
552
+ interval?: "weekly" | "monthly" | "yearly";
553
+ /** @example "description" */
554
+ description?: string;
555
+ /** @example 1200 */
556
+ amount_cents?: number;
557
+ /** @example "EUR" */
558
+ amount_currency?: string;
559
+ /** @example 2 */
560
+ trial_period?: number;
561
+ /** @example true */
562
+ pay_in_advance?: boolean;
563
+ /** @example false */
564
+ bill_charges_monthly?: boolean;
565
+ charges?: ChargeObject[];
566
+ }
567
+ export interface Plan {
568
+ plan?: PlanObject;
569
+ }
570
+ export interface Plans {
571
+ plans?: PlanObject[];
572
+ }
573
+ export interface PlanInput {
574
+ plan?: {
575
+ /** @example "example name" */
576
+ name?: string;
577
+ /** @example "example_code" */
578
+ code?: string;
579
+ /** Plan interval */
580
+ interval?: "weekly" | "monthly" | "yearly";
581
+ /** @example "description" */
582
+ description?: string;
583
+ /** @example 1200 */
584
+ amount_cents?: number;
585
+ /** @example "EUR" */
586
+ amount_currency?: string;
587
+ /** @example 2 */
588
+ trial_period?: number;
589
+ /** @example true */
590
+ pay_in_advance?: boolean;
591
+ /** @example false */
592
+ bill_charges_monthly?: boolean;
593
+ charges?: {
594
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
595
+ id?: string;
596
+ /** @example "278da83c-c007-4fbb-afcd-b00c07c41utg" */
597
+ billable_metric_id?: string;
598
+ /** Charge model type */
599
+ charge_model?: "standard" | "graduated" | "package" | "percentage" | "volume";
600
+ properties?: object;
601
+ group_properties?: {
602
+ /** @example 123456 */
603
+ group_id?: string;
604
+ values?: object;
605
+ }[];
606
+ }[];
607
+ };
608
+ }
609
+ export interface SubscriptionObject {
610
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
611
+ lago_id?: string;
612
+ /** @example 12345 */
613
+ external_id?: string;
614
+ /** @example "995da83c-c007-4fbb-afcd-b00c07c41tre" */
615
+ lago_customer_id?: string;
616
+ /** @example 54321 */
617
+ external_customer_id?: string;
618
+ /** @example "Test subscription" */
619
+ name?: string;
620
+ /** @example "plan_code" */
621
+ plan_code?: string;
622
+ /** Subscription status */
623
+ status?: "active" | "pending" | "terminated" | "canceled";
624
+ /** Billing time */
625
+ billing_time?: "calendar" | "anniversary";
626
+ /** @example "2022-09-14T16:35:31.000Z" */
627
+ subscription_at?: string;
628
+ /** @example "2022-09-14T16:35:31.000Z" */
629
+ started_at?: string;
630
+ /** @example "2022-09-14T16:35:31.000Z" */
631
+ terminated_at?: string;
632
+ /** @example "2022-09-14T16:35:31.000Z" */
633
+ canceled_at?: string;
634
+ /** @example "2022-09-14T16:35:31.000Z" */
635
+ created_at?: string;
636
+ /** @example "previous_code" */
637
+ previous_plan_code?: string;
638
+ /** @example "next_code" */
639
+ next_plan_code?: string;
640
+ /** @example "2022-09-14T16:35:31.000Z" */
641
+ downgrade_plan_date?: string;
642
+ }
643
+ export interface Subscription {
644
+ subscription?: SubscriptionObject;
645
+ }
646
+ export interface Subscriptions {
647
+ subscriptions?: SubscriptionObject[];
648
+ }
649
+ export interface SubscriptionCreateInput {
650
+ subscription?: {
651
+ /** @example 12345 */
652
+ external_customer_id?: string;
653
+ /** @example "example_code" */
654
+ plan_code?: string;
655
+ /** @example "Test name" */
656
+ name?: string;
657
+ /** @example 54321 */
658
+ external_id?: string;
659
+ /** Billing time */
660
+ billing_time?: "calendar" | "anniversary";
661
+ /** @example "2022-08-08T00:00:00.000Z" */
662
+ subscription_at?: string;
663
+ };
664
+ }
665
+ export interface SubscriptionUpdateInput {
666
+ subscription?: {
667
+ /** @example "New name" */
668
+ name?: string;
669
+ /** @example "2022-08-08T00:00:00.000Z" */
670
+ subscription_at?: string;
671
+ };
672
+ }
673
+ export interface CreditObject {
674
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
675
+ lago_id?: string;
676
+ /** @example 1200 */
677
+ amount_cents?: number;
678
+ /** @example "EUR" */
679
+ amount_currency?: string;
680
+ item?: {
681
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
682
+ lago_id?: string;
683
+ /** @example "coupon" */
684
+ type?: string;
685
+ /** @example "code" */
686
+ code?: string;
687
+ /** @example "name" */
688
+ name?: string;
689
+ };
690
+ }
691
+ export interface FeeObject {
692
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
693
+ lago_id?: string;
694
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
695
+ lago_group_id?: string;
696
+ /** @example 1200 */
697
+ amount_cents?: number;
698
+ /** @example "EUR" */
699
+ amount_currency?: string;
700
+ /** @example 1200 */
701
+ vat_amount_cents?: number;
702
+ /** @example "EUR" */
703
+ vat_amount_currency?: string;
704
+ /** @example 2.5 */
705
+ units?: number;
706
+ /** @example 5 */
707
+ events_count?: number;
708
+ item?: {
709
+ /** Billing time */
710
+ type?: "charge" | "add_on" | "subscription" | "credit";
711
+ /** @example "code" */
712
+ code?: string;
713
+ /** @example "name" */
714
+ name?: string;
715
+ };
716
+ }
717
+ export interface InvoiceObject {
718
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
719
+ lago_id?: string;
720
+ /** @example 12345 */
721
+ sequential_id?: number;
722
+ /** @example 222345 */
723
+ number?: string;
724
+ /** @example "2022-09-14T16:35:31.000Z" */
725
+ issuing_date?: string;
726
+ /** Invoice type */
727
+ invoice_type?: "subscription" | "add_on" | "credit";
728
+ /** Status */
729
+ payment_status?: "pending" | "succeeded" | "failed";
730
+ /** @example 1200 */
731
+ amount_cents?: number;
732
+ /** @example "EUR" */
733
+ amount_currency?: string;
734
+ /** @example 20 */
735
+ vat_amount_cents?: number;
736
+ /** @example "EUR" */
737
+ vat_amount_currency?: string;
738
+ /** @example 20 */
739
+ credit_amount_cents?: number;
740
+ /** @example "EUR" */
741
+ credit_amount_currency?: string;
742
+ /** @example 1220 */
743
+ total_amount_cents?: number;
744
+ /** @example "EUR" */
745
+ total_amount_currency?: string;
746
+ /** @example true */
747
+ legacy?: boolean;
748
+ /** @example "https://example.com" */
749
+ file_url?: string;
750
+ customer?: CustomerObject;
751
+ subscriptions?: SubscriptionObject[];
752
+ fees?: FeeObject[];
753
+ credits?: CreditObject[];
754
+ }
755
+ export interface Invoice {
756
+ invoice?: InvoiceObject;
757
+ }
758
+ export interface Invoices {
759
+ invoices?: InvoiceObject[];
760
+ }
761
+ export interface InvoiceInput {
762
+ invoice?: {
763
+ /** Status */
764
+ payment_status?: "pending" | "succeeded" | "failed";
765
+ };
766
+ }
767
+ export interface WalletObject {
768
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
769
+ lago_id?: string;
770
+ /** @example "254da83c-c007-4fbb-afcd-b00c07c41oit" */
771
+ lago_customer_id?: string;
772
+ /** @example 12345 */
773
+ external_customer_id?: string;
774
+ /** Status */
775
+ status?: "active" | "terminated";
776
+ /** @example "EUR" */
777
+ currency?: string;
778
+ /** @example "Name" */
779
+ name?: string;
780
+ /** @example 2 */
781
+ rate_amount?: number;
782
+ /** @example 500 */
783
+ credits_balance?: number;
784
+ /** @example 1000 */
785
+ balance?: number;
786
+ /** @example 100 */
787
+ consumed_credits?: number;
788
+ /** @example "2022-09-14T16:35:31.000Z" */
789
+ created_at?: string;
790
+ /** @example "2022-09-14T23:59:59.000Z" */
791
+ expiration_at?: string;
792
+ /** @example "2022-09-14T16:35:31.000Z" */
793
+ last_balance_sync_at?: string;
794
+ /** @example "2022-09-14T16:35:31.000Z" */
795
+ last_consumed_credit_at?: string;
796
+ /** @example "2022-09-14T16:35:31.000Z" */
797
+ terminated_at?: string;
798
+ }
799
+ export interface Wallet {
800
+ wallet?: WalletObject;
801
+ }
802
+ export interface Wallets {
803
+ wallets?: WalletObject[];
804
+ }
805
+ export interface WalletInput {
806
+ wallet?: {
807
+ /** @example "Wallet name" */
808
+ name?: string;
809
+ /** @example 2 */
810
+ rate_amount?: number;
811
+ /** @example "EUR" */
812
+ currency?: string;
813
+ /** @example 500 */
814
+ paid_credits?: number;
815
+ /** @example 10 */
816
+ granted_credits?: number;
817
+ /** @example 12345 */
818
+ external_customer_id?: string;
819
+ /** @example "2022-09-14T23:59:59.000Z" */
820
+ expiration_at?: string;
821
+ };
822
+ }
823
+ export interface WalletUpdateInput {
824
+ wallet?: {
825
+ /** @example "Wallet name" */
826
+ name?: string;
827
+ /** @example "2022-09-14T23:59:59.000Z" */
828
+ expiration_at?: string;
829
+ };
830
+ }
831
+ export interface WalletTransactionObject {
832
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
833
+ lago_id?: string;
834
+ /** @example "985da83c-c007-4fbb-afcd-b00c07c41ffe" */
835
+ lago_wallet_id?: string;
836
+ /** Status */
837
+ status?: "pending" | "settled";
838
+ /** Transaction type */
839
+ transaction_type?: "inbound" | "outbound";
840
+ /** @example 500 */
841
+ amount?: number;
842
+ /** @example 100 */
843
+ credit_amount?: number;
844
+ /** @example "2022-09-14T16:35:31.000Z" */
845
+ settled_at?: string;
846
+ /** @example "2022-09-14T16:35:31.000Z" */
847
+ created_at?: string;
848
+ }
849
+ export interface WalletTransaction {
850
+ wallet_transaction?: WalletTransactionObject;
851
+ }
852
+ export interface WalletTransactionInput {
853
+ wallet_transaction?: {
854
+ /** @example "985da83c-c007-4fbb-afcd-b00c07c41ffe" */
855
+ wallet_id?: string;
856
+ /** @example 100 */
857
+ paid_credits?: number;
858
+ /** @example 10 */
859
+ granted_credits?: number;
860
+ };
861
+ }
862
+ export interface CreditNoteItemObject {
863
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
864
+ lago_id?: string;
865
+ /** @example 1220 */
866
+ amount_cents?: number;
867
+ /** @example "EUR" */
868
+ amount_currency?: string;
869
+ fee?: FeeObject;
870
+ }
871
+ export interface CreditNoteObject {
872
+ /** @example "183da83c-c007-4fbb-afcd-b00c07c41ffe" */
873
+ lago_id?: string;
874
+ /** @example 1234 */
875
+ sequential_id?: number;
876
+ /** @example 123456789 */
877
+ number?: string;
878
+ /** @example "144da83c-c007-4fbb-afcd-b00c07c41ffe" */
879
+ lago_invoice_id?: string;
880
+ /** @example 123456789 */
881
+ invoice_number?: string;
882
+ /** @example "2022-09-14T16:35:31.000Z" */
883
+ issuing_date?: string;
884
+ /** Credit status */
885
+ credit_status?: "available" | "consumed" | "voided";
886
+ /** Refund status */
887
+ refund_status?: "pending" | "succeeded" | "failed";
888
+ /** Reason */
889
+ reason?: "duplicated_charge" | "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "other";
890
+ /** @example "description" */
891
+ description?: string;
892
+ /** @example 1220 */
893
+ total_amount_cents?: number;
894
+ /** @example "EUR" */
895
+ total_amount_currency?: string;
896
+ /** @example 20 */
897
+ vat_amount_cents?: number;
898
+ /** @example "EUR" */
899
+ vat_amount_currency?: string;
900
+ /** @example 1000 */
901
+ sub_total_vat_excluded_amount_cents?: number;
902
+ /** @example "EUR" */
903
+ sub_total_vat_excluded_amount_currency?: string;
904
+ /** @example 20 */
905
+ balance_amount_cents?: number;
906
+ /** @example "EUR" */
907
+ balance_amount_currency?: string;
908
+ /** @example 20 */
909
+ credit_amount_cents?: number;
910
+ /** @example "EUR" */
911
+ credit_amount_currency?: string;
912
+ /** @example 20 */
913
+ refund_amount_cents?: number;
914
+ /** @example "EUR" */
915
+ refund_amount_currency?: string;
916
+ /** @example "2022-09-14T16:35:31.000Z" */
917
+ created_at?: string;
918
+ /** @example "2022-09-14T16:35:31.000Z" */
919
+ updated_at?: string;
920
+ /** @example "https://example.com" */
921
+ file_url?: string;
922
+ customer?: CustomerObject;
923
+ items?: CreditNoteItemObject[];
924
+ }
925
+ export interface CreditNote {
926
+ credit_note?: CreditNoteObject;
927
+ }
928
+ export interface CreditNotes {
929
+ credit_notes?: CreditNoteObject[];
930
+ }
931
+ export interface CreditNoteInput {
932
+ credit_note?: {
933
+ /** @example "194da83c-c007-4fbb-afcd-b00c07c41fzh" */
934
+ invoice_id?: string;
935
+ /** Reason */
936
+ reason?: "duplicated_charge" | "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "other";
937
+ /** @example "description" */
938
+ description?: string;
939
+ /** @example 20 */
940
+ credit_amount_cents?: number;
941
+ /** @example 20 */
942
+ refund_amount_cents?: number;
943
+ items?: {
944
+ /** @example "144da83c-c007-4fbb-afcd-b00c07c41ffe" */
945
+ fee_id?: string;
946
+ /** @example 20 */
947
+ amount_cents?: number;
948
+ }[];
949
+ };
950
+ }
951
+ export interface CreditNoteUpdateInput {
952
+ credit_note?: {
953
+ /** Refund status */
954
+ refund_status?: "pending" | "succeeded" | "failed";
955
+ };
956
+ }
957
+ export interface ApiResponseBadRequest {
958
+ /**
959
+ * @format int32
960
+ * @example 400
961
+ */
962
+ status?: number;
963
+ /** @example "Bad request" */
964
+ error?: string;
965
+ }
966
+ export interface ApiResponseUnauthorized {
967
+ /**
968
+ * @format int32
969
+ * @example 401
970
+ */
971
+ status?: number;
972
+ /** @example "Unauthorized" */
973
+ error?: string;
974
+ }
975
+ export interface ApiResponseUnprocessableEntity {
976
+ /**
977
+ * @format int32
978
+ * @example 422
979
+ */
980
+ status?: number;
981
+ /** @example "Unprocessable entity" */
982
+ error?: string;
983
+ /** @example "validation_errors" */
984
+ code?: string;
985
+ error_details?: object;
986
+ }
987
+ export interface ApiResponseNotFound {
988
+ /**
989
+ * @format int32
990
+ * @example 404
991
+ */
992
+ status?: number;
993
+ /** @example "Not Found" */
994
+ error?: string;
995
+ /** @example "object_not_found" */
996
+ code?: string;
997
+ }
998
+ export interface ApiResponseNotAllowed {
999
+ /**
1000
+ * @format int32
1001
+ * @example 405
1002
+ */
1003
+ status?: number;
1004
+ /** @example "Method Not Allowed" */
1005
+ error?: string;
1006
+ /** @example "not_allowed" */
1007
+ code?: string;
1008
+ }
1009
+ export type QueryParamsType = Record<string | number, any>;
1010
+ export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
1011
+ export interface FullRequestParams extends Omit<RequestInit, "body"> {
1012
+ /** set parameter to `true` for call `securityWorker` for this request */
1013
+ secure?: boolean;
1014
+ /** request path */
1015
+ path: string;
1016
+ /** content type of request body */
1017
+ type?: ContentType;
1018
+ /** query params */
1019
+ query?: QueryParamsType;
1020
+ /** format of response (i.e. response.json() -> format: "json") */
1021
+ format?: ResponseFormat;
1022
+ /** request body */
1023
+ body?: unknown;
1024
+ /** base url */
1025
+ baseUrl?: string;
1026
+ /** request cancellation token */
1027
+ cancelToken?: CancelToken;
1028
+ }
1029
+ export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
1030
+ export interface ApiConfig<SecurityDataType = unknown> {
1031
+ baseUrl?: string;
1032
+ baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
1033
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
1034
+ customFetch?: typeof fetch;
1035
+ }
1036
+ export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
1037
+ data: D;
1038
+ error: E;
1039
+ }
1040
+ type CancelToken = Symbol | string | number;
1041
+ export declare enum ContentType {
1042
+ Json = "application/json",
1043
+ FormData = "multipart/form-data",
1044
+ UrlEncoded = "application/x-www-form-urlencoded",
1045
+ Text = "text/plain"
1046
+ }
1047
+ export declare class HttpClient<SecurityDataType = unknown> {
1048
+ baseUrl: string;
1049
+ private securityData;
1050
+ private securityWorker?;
1051
+ private abortControllers;
1052
+ private customFetch;
1053
+ private baseApiParams;
1054
+ constructor(apiConfig?: ApiConfig<SecurityDataType>);
1055
+ setSecurityData: (data: SecurityDataType | null) => void;
1056
+ protected encodeQueryParam(key: string, value: any): string;
1057
+ protected addQueryParam(query: QueryParamsType, key: string): string;
1058
+ protected addArrayQueryParam(query: QueryParamsType, key: string): any;
1059
+ protected toQueryString(rawQuery?: QueryParamsType): string;
1060
+ protected addQueryParams(rawQuery?: QueryParamsType): string;
1061
+ private contentFormatters;
1062
+ protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams;
1063
+ protected createAbortSignal: (cancelToken: CancelToken) => AbortSignal | undefined;
1064
+ abortRequest: (cancelToken: CancelToken) => void;
1065
+ request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<HttpResponse<T, E>>;
1066
+ }
1067
+ /**
1068
+ * @title Lago API documentation
1069
+ * @version 0.0.1
1070
+ * @baseUrl https://api.getlago.com/api/v1
1071
+ * @externalDocs https://github.com/getlago
1072
+ * @contact <tech@getlago.com>
1073
+ *
1074
+ * Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
1075
+ */
1076
+ export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
1077
+ billableMetrics: {
1078
+ /**
1079
+ * @description Create a new billable metric
1080
+ *
1081
+ * @tags billable_metrics
1082
+ * @name CreateBillableMetric
1083
+ * @summary Create a new billable metric
1084
+ * @request POST:/billable_metrics
1085
+ * @secure
1086
+ */
1087
+ createBillableMetric: (data: BillableMetricInput, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1088
+ /**
1089
+ * @description Update an existing billable metric by code
1090
+ *
1091
+ * @tags billable_metrics
1092
+ * @name UpdateBillableMetric
1093
+ * @summary Update an existing billable metric
1094
+ * @request PUT:/billable_metrics/{code}
1095
+ * @secure
1096
+ */
1097
+ updateBillableMetric: (code: string, data: BillableMetricInput, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1098
+ /**
1099
+ * @description Return a single billable metric
1100
+ *
1101
+ * @tags billable_metrics
1102
+ * @name FindBillableMetric
1103
+ * @summary Find billable metric by code
1104
+ * @request GET:/billable_metrics/{code}
1105
+ * @secure
1106
+ */
1107
+ findBillableMetric: (code: string, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiResponseUnauthorized | ApiResponseNotFound>>;
1108
+ /**
1109
+ * @description Delete a billable metric
1110
+ *
1111
+ * @tags billable_metrics
1112
+ * @name DestroyBillableMetric
1113
+ * @summary Delete a billable metric
1114
+ * @request DELETE:/billable_metrics/{code}
1115
+ * @secure
1116
+ */
1117
+ destroyBillableMetric: (code: string, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiResponseUnauthorized | ApiResponseNotFound | ApiResponseNotAllowed>>;
1118
+ /**
1119
+ * @description Find all billable metrics in certain organisation
1120
+ *
1121
+ * @tags billable_metrics
1122
+ * @name FindAllBillableMetrics
1123
+ * @summary Find Billable metrics
1124
+ * @request GET:/billable_metrics/
1125
+ * @secure
1126
+ */
1127
+ findAllBillableMetrics: (query?: {
1128
+ /**
1129
+ * Number of page
1130
+ * @example 2
1131
+ */
1132
+ page?: number;
1133
+ /**
1134
+ * Number of records per page
1135
+ * @example 20
1136
+ */
1137
+ per_page?: number;
1138
+ }, params?: RequestParams) => Promise<HttpResponse<BillableMetrics, ApiResponseUnauthorized>>;
1139
+ /**
1140
+ * @description Find all billable metric groups in certain organisation
1141
+ *
1142
+ * @tags billable_metrics
1143
+ * @name FindAllBillableMetricGroups
1144
+ * @summary Find Billable metric groups
1145
+ * @request GET:/billable_metrics/{code}/groups
1146
+ * @secure
1147
+ */
1148
+ findAllBillableMetricGroups: (code: string, query?: {
1149
+ /**
1150
+ * Number of page
1151
+ * @example 2
1152
+ */
1153
+ page?: number;
1154
+ /**
1155
+ * Number of records per page
1156
+ * @example 20
1157
+ */
1158
+ per_page?: number;
1159
+ }, params?: RequestParams) => Promise<HttpResponse<Groups, ApiResponseUnauthorized>>;
1160
+ };
1161
+ addOns: {
1162
+ /**
1163
+ * @description Create a new add-on
1164
+ *
1165
+ * @tags add_ons
1166
+ * @name CreateAddOn
1167
+ * @summary Create a new add-on
1168
+ * @request POST:/add_ons
1169
+ * @secure
1170
+ */
1171
+ createAddOn: (data: AddOnInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1172
+ /**
1173
+ * @description Update an existing add-on by code
1174
+ *
1175
+ * @tags add_ons
1176
+ * @name UpdateAddOn
1177
+ * @summary Update an existing add-on
1178
+ * @request PUT:/add_ons/{code}
1179
+ * @secure
1180
+ */
1181
+ updateAddOn: (code: string, data: AddOnInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1182
+ /**
1183
+ * @description Return a single add-on
1184
+ *
1185
+ * @tags add_ons
1186
+ * @name FindAddOn
1187
+ * @summary Find add-on by code
1188
+ * @request GET:/add_ons/{code}
1189
+ * @secure
1190
+ */
1191
+ findAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiResponseUnauthorized | ApiResponseNotFound>>;
1192
+ /**
1193
+ * @description Delete an add-on
1194
+ *
1195
+ * @tags add_ons
1196
+ * @name DestroyAddOn
1197
+ * @summary Delete an add-on
1198
+ * @request DELETE:/add_ons/{code}
1199
+ * @secure
1200
+ */
1201
+ destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiResponseUnauthorized | ApiResponseNotFound | ApiResponseNotAllowed>>;
1202
+ /**
1203
+ * @description Find all add-ons in certain organisation
1204
+ *
1205
+ * @tags add_ons
1206
+ * @name FindAllAddOns
1207
+ * @summary Find add-ons
1208
+ * @request GET:/add_ons/
1209
+ * @secure
1210
+ */
1211
+ findAllAddOns: (query?: {
1212
+ /**
1213
+ * Number of page
1214
+ * @example 2
1215
+ */
1216
+ page?: number;
1217
+ /**
1218
+ * Number of records per page
1219
+ * @example 20
1220
+ */
1221
+ per_page?: number;
1222
+ }, params?: RequestParams) => Promise<HttpResponse<AddOns, ApiResponseUnauthorized>>;
1223
+ };
1224
+ appliedAddOns: {
1225
+ /**
1226
+ * @description Apply an add-on to a customer
1227
+ *
1228
+ * @tags add_ons
1229
+ * @name ApplyAddOn
1230
+ * @summary Apply an add-on to a customer
1231
+ * @request POST:/applied_add_ons
1232
+ * @secure
1233
+ */
1234
+ applyAddOn: (data: AppliedAddOnInput, params?: RequestParams) => Promise<HttpResponse<AppliedAddOn, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1235
+ };
1236
+ coupons: {
1237
+ /**
1238
+ * @description Create a new coupon
1239
+ *
1240
+ * @tags coupons
1241
+ * @name CreateCoupon
1242
+ * @summary Create a new coupon
1243
+ * @request POST:/coupons
1244
+ * @secure
1245
+ */
1246
+ createCoupon: (data: CouponInput, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1247
+ /**
1248
+ * @description Update an existing coupon by code
1249
+ *
1250
+ * @tags coupons
1251
+ * @name UpdateCoupon
1252
+ * @summary Update an existing coupon
1253
+ * @request PUT:/coupons/{code}
1254
+ * @secure
1255
+ */
1256
+ updateCoupon: (code: string, data: CouponInput, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1257
+ /**
1258
+ * @description Return a single coupon
1259
+ *
1260
+ * @tags coupons
1261
+ * @name FindCoupon
1262
+ * @summary Find coupon by code
1263
+ * @request GET:/coupons/{code}
1264
+ * @secure
1265
+ */
1266
+ findCoupon: (code: string, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiResponseUnauthorized | ApiResponseNotFound>>;
1267
+ /**
1268
+ * @description Delete a coupon
1269
+ *
1270
+ * @tags coupons
1271
+ * @name DestroyCoupon
1272
+ * @summary Delete a coupon
1273
+ * @request DELETE:/coupons/{code}
1274
+ * @secure
1275
+ */
1276
+ destroyCoupon: (code: string, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiResponseUnauthorized | ApiResponseNotFound | ApiResponseNotAllowed>>;
1277
+ /**
1278
+ * @description Find all coupons in certain organisation
1279
+ *
1280
+ * @tags coupons
1281
+ * @name FindAllCoupons
1282
+ * @summary Find Coupons
1283
+ * @request GET:/coupons/
1284
+ * @secure
1285
+ */
1286
+ findAllCoupons: (query?: {
1287
+ /**
1288
+ * Number of page
1289
+ * @example 2
1290
+ */
1291
+ page?: number;
1292
+ /**
1293
+ * Number of records per page
1294
+ * @example 20
1295
+ */
1296
+ per_page?: number;
1297
+ }, params?: RequestParams) => Promise<HttpResponse<Coupons, ApiResponseUnauthorized>>;
1298
+ };
1299
+ appliedCoupons: {
1300
+ /**
1301
+ * @description Apply a coupon to a customer
1302
+ *
1303
+ * @tags coupons
1304
+ * @name ApplyCoupon
1305
+ * @summary Apply a coupon to a customer
1306
+ * @request POST:/applied_coupons
1307
+ * @secure
1308
+ */
1309
+ applyCoupon: (data: AppliedCouponInput, params?: RequestParams) => Promise<HttpResponse<AppliedCoupon, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1310
+ /**
1311
+ * @description Find all applied coupons
1312
+ *
1313
+ * @tags coupons
1314
+ * @name FindAllAppliedCoupons
1315
+ * @summary Find Applied Coupons
1316
+ * @request GET:/applied_coupons/
1317
+ * @secure
1318
+ */
1319
+ findAllAppliedCoupons: (query?: {
1320
+ /**
1321
+ * Number of page
1322
+ * @example 2
1323
+ */
1324
+ page?: number;
1325
+ /**
1326
+ * Number of records per page
1327
+ * @example 20
1328
+ */
1329
+ per_page?: number;
1330
+ /** Status */
1331
+ status?: "active" | "terminated";
1332
+ /**
1333
+ * External customer ID
1334
+ * @example 12345
1335
+ */
1336
+ external_customer_id?: string;
1337
+ }, params?: RequestParams) => Promise<HttpResponse<AppliedCoupons, ApiResponseUnauthorized>>;
1338
+ };
1339
+ organizations: {
1340
+ /**
1341
+ * @description Update an existing organization
1342
+ *
1343
+ * @tags organizations
1344
+ * @name UpdateOrganization
1345
+ * @summary Update an existing Organization
1346
+ * @request PUT:/organizations/
1347
+ * @secure
1348
+ */
1349
+ updateOrganization: (data: OrganizationInput, params?: RequestParams) => Promise<HttpResponse<Organization, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1350
+ };
1351
+ customers: {
1352
+ /**
1353
+ * @description Create a new customer
1354
+ *
1355
+ * @tags customers
1356
+ * @name CreateCustomer
1357
+ * @summary Create a customer
1358
+ * @request POST:/customers
1359
+ * @secure
1360
+ */
1361
+ createCustomer: (data: CustomerInput, params?: RequestParams) => Promise<HttpResponse<Customer, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1362
+ /**
1363
+ * @description Return a single customer
1364
+ *
1365
+ * @tags customers
1366
+ * @name FindCustomer
1367
+ * @summary Find customer by external ID
1368
+ * @request GET:/customers/{external_id}
1369
+ * @secure
1370
+ */
1371
+ findCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiResponseUnauthorized | ApiResponseNotFound>>;
1372
+ /**
1373
+ * @description Return a customer current usage
1374
+ *
1375
+ * @tags customers
1376
+ * @name FindCustomerCurrentUsage
1377
+ * @summary Find customer current usage
1378
+ * @request GET:/customers/{customer_external_id}/current_usage
1379
+ * @secure
1380
+ */
1381
+ findCustomerCurrentUsage: (customerExternalId: string, query: {
1382
+ /**
1383
+ * External subscription ID
1384
+ * @example 54321
1385
+ */
1386
+ external_subscription_id: string;
1387
+ }, params?: RequestParams) => Promise<HttpResponse<CustomerUsage, ApiResponseUnauthorized | ApiResponseNotFound>>;
1388
+ /**
1389
+ * @description Find all customers in certain organisation
1390
+ *
1391
+ * @tags customers
1392
+ * @name FindAllCustomers
1393
+ * @summary Find customers
1394
+ * @request GET:/customers/
1395
+ * @secure
1396
+ */
1397
+ findAllCustomers: (query?: {
1398
+ /**
1399
+ * Number of page
1400
+ * @example 2
1401
+ */
1402
+ page?: number;
1403
+ /**
1404
+ * Number of records per page
1405
+ * @example 20
1406
+ */
1407
+ per_page?: number;
1408
+ }, params?: RequestParams) => Promise<HttpResponse<Customers, ApiResponseUnauthorized>>;
1409
+ };
1410
+ events: {
1411
+ /**
1412
+ * @description Create a new event
1413
+ *
1414
+ * @tags events
1415
+ * @name CreateEvent
1416
+ * @summary Create a new event
1417
+ * @request POST:/events
1418
+ * @secure
1419
+ */
1420
+ createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<void, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1421
+ /**
1422
+ * @description Create batch events
1423
+ *
1424
+ * @tags events
1425
+ * @name CreateBatchEvents
1426
+ * @summary Create batch events
1427
+ * @request POST:/events/batch
1428
+ * @secure
1429
+ */
1430
+ createBatchEvents: (data: BatchEventInput, params?: RequestParams) => Promise<HttpResponse<void, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1431
+ /**
1432
+ * @description Return a single event
1433
+ *
1434
+ * @tags events
1435
+ * @name FindEvent
1436
+ * @summary Find event by transaction ID
1437
+ * @request GET:/events/{id}
1438
+ * @secure
1439
+ */
1440
+ findEvent: (id: string, params?: RequestParams) => Promise<HttpResponse<Event, ApiResponseUnauthorized | ApiResponseNotFound>>;
1441
+ };
1442
+ plans: {
1443
+ /**
1444
+ * @description Create a new plan
1445
+ *
1446
+ * @tags plans
1447
+ * @name CreatePlan
1448
+ * @summary Create a new plan
1449
+ * @request POST:/plans
1450
+ * @secure
1451
+ */
1452
+ createPlan: (data: PlanInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1453
+ /**
1454
+ * @description Update an existing plan by code
1455
+ *
1456
+ * @tags plans
1457
+ * @name UpdatePlan
1458
+ * @summary Update an existing plan
1459
+ * @request PUT:/plans/{code}
1460
+ * @secure
1461
+ */
1462
+ updatePlan: (code: string, data: PlanInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1463
+ /**
1464
+ * @description Return a single plan
1465
+ *
1466
+ * @tags plans
1467
+ * @name FindPlan
1468
+ * @summary Fin plan by code
1469
+ * @request GET:/plans/{code}
1470
+ * @secure
1471
+ */
1472
+ findPlan: (code: string, params?: RequestParams) => Promise<HttpResponse<Plan, ApiResponseUnauthorized | ApiResponseNotFound>>;
1473
+ /**
1474
+ * @description Delete a plan
1475
+ *
1476
+ * @tags plans
1477
+ * @name DestroyPlan
1478
+ * @summary Delete a plan
1479
+ * @request DELETE:/plans/{code}
1480
+ * @secure
1481
+ */
1482
+ destroyPlan: (code: string, params?: RequestParams) => Promise<HttpResponse<Plan, ApiResponseUnauthorized | ApiResponseNotFound | ApiResponseNotAllowed>>;
1483
+ /**
1484
+ * @description Find all plans in certain organisation
1485
+ *
1486
+ * @tags plans
1487
+ * @name FindAllPlans
1488
+ * @summary Find plans
1489
+ * @request GET:/plans/
1490
+ * @secure
1491
+ */
1492
+ findAllPlans: (query?: {
1493
+ /**
1494
+ * Number of page
1495
+ * @example 2
1496
+ */
1497
+ page?: number;
1498
+ /**
1499
+ * Number of records per page
1500
+ * @example 20
1501
+ */
1502
+ per_page?: number;
1503
+ }, params?: RequestParams) => Promise<HttpResponse<Plans, ApiResponseUnauthorized>>;
1504
+ };
1505
+ subscriptions: {
1506
+ /**
1507
+ * @description Assign a plan to a customer
1508
+ *
1509
+ * @tags subscriptions
1510
+ * @name CreateSubscription
1511
+ * @summary Assign a plan to a customer
1512
+ * @request POST:/subscriptions
1513
+ * @secure
1514
+ */
1515
+ createSubscription: (data: SubscriptionCreateInput, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1516
+ /**
1517
+ * @description Update an existing subscription by external ID
1518
+ *
1519
+ * @tags subscriptions
1520
+ * @name UpdateSubscription
1521
+ * @summary Update an existing subscription
1522
+ * @request PUT:/subscriptions/{external_id}
1523
+ * @secure
1524
+ */
1525
+ updateSubscription: (externalId: string, data: SubscriptionUpdateInput, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1526
+ /**
1527
+ * @description Terminate a subscription
1528
+ *
1529
+ * @tags subscriptions
1530
+ * @name DestroySubscription
1531
+ * @summary Terminate a subscription
1532
+ * @request DELETE:/subscriptions/{external_id}
1533
+ * @secure
1534
+ */
1535
+ destroySubscription: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiResponseUnauthorized | ApiResponseNotFound | ApiResponseNotAllowed>>;
1536
+ /**
1537
+ * @description Find all suscriptions for certain customer
1538
+ *
1539
+ * @tags subscriptions
1540
+ * @name FindAllSubscriptions
1541
+ * @summary Find subscriptions
1542
+ * @request GET:/subscriptions/
1543
+ * @secure
1544
+ */
1545
+ findAllSubscriptions: (query: {
1546
+ /**
1547
+ * Number of page
1548
+ * @example 2
1549
+ */
1550
+ page?: number;
1551
+ /**
1552
+ * Number of records per page
1553
+ * @example 20
1554
+ */
1555
+ per_page?: number;
1556
+ /**
1557
+ * External customer ID
1558
+ * @example 12345
1559
+ */
1560
+ external_customer_id: string;
1561
+ }, params?: RequestParams) => Promise<HttpResponse<Subscriptions, ApiResponseUnauthorized | ApiResponseNotFound>>;
1562
+ };
1563
+ webhooks: {
1564
+ /**
1565
+ * @description Webhook public key
1566
+ *
1567
+ * @tags webhooks
1568
+ * @name FetchPublicKey
1569
+ * @summary Fetch webhook public key
1570
+ * @request GET:/webhooks/public_key/
1571
+ * @secure
1572
+ */
1573
+ fetchPublicKey: (params?: RequestParams) => Promise<HttpResponse<string, ApiResponseUnauthorized>>;
1574
+ };
1575
+ invoices: {
1576
+ /**
1577
+ * @description Update an existing invoice
1578
+ *
1579
+ * @tags invoices
1580
+ * @name UpdateInvoice
1581
+ * @summary Update an existing invoice status
1582
+ * @request PUT:/invoices/{id}
1583
+ * @secure
1584
+ */
1585
+ updateInvoice: (id: string, data: InvoiceInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1586
+ /**
1587
+ * @description Return a single invoice
1588
+ *
1589
+ * @tags invoices
1590
+ * @name FindInvoice
1591
+ * @summary Find invoice by ID
1592
+ * @request GET:/invoices/{id}
1593
+ * @secure
1594
+ */
1595
+ findInvoice: (id: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiResponseUnauthorized | ApiResponseNotFound>>;
1596
+ /**
1597
+ * @description Download an existing invoice
1598
+ *
1599
+ * @tags invoices
1600
+ * @name DownloadInvoice
1601
+ * @summary Download an existing invoice
1602
+ * @request POST:/invoices/{id}/download
1603
+ * @secure
1604
+ */
1605
+ downloadInvoice: (id: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiResponseUnauthorized | ApiResponseNotFound>>;
1606
+ /**
1607
+ * @description Find all invoices in certain organisation
1608
+ *
1609
+ * @tags invoices
1610
+ * @name FindAllInvoices
1611
+ * @summary Find ainvoices
1612
+ * @request GET:/invoices/
1613
+ * @secure
1614
+ */
1615
+ findAllInvoices: (query?: {
1616
+ /**
1617
+ * Number of page
1618
+ * @example 2
1619
+ */
1620
+ page?: number;
1621
+ /**
1622
+ * Number of records per page
1623
+ * @example 20
1624
+ */
1625
+ per_page?: number;
1626
+ /**
1627
+ * External customer ID
1628
+ * @example 12345
1629
+ */
1630
+ external_customer_id?: string;
1631
+ /**
1632
+ * Date from
1633
+ * @example "2022-07-08T00:00:00.000Z"
1634
+ */
1635
+ issuing_date_from?: string;
1636
+ /**
1637
+ * Date to
1638
+ * @example "2022-08-09T00:00:00.000Z"
1639
+ */
1640
+ issuing_date_to?: string;
1641
+ }, params?: RequestParams) => Promise<HttpResponse<Invoices, ApiResponseUnauthorized>>;
1642
+ };
1643
+ wallets: {
1644
+ /**
1645
+ * @description Create a new wallet
1646
+ *
1647
+ * @tags wallets
1648
+ * @name CreateWallet
1649
+ * @summary Create a new wallet
1650
+ * @request POST:/wallets
1651
+ * @secure
1652
+ */
1653
+ createWallet: (data: WalletInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1654
+ /**
1655
+ * @description Update an existing wallet
1656
+ *
1657
+ * @tags wallets
1658
+ * @name UpdateWallet
1659
+ * @summary Update an existing wallet
1660
+ * @request PUT:/wallets/{id}
1661
+ * @secure
1662
+ */
1663
+ updateWallet: (id: string, data: WalletUpdateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1664
+ /**
1665
+ * @description Return a wallet
1666
+ *
1667
+ * @tags wallets
1668
+ * @name FindWallet
1669
+ * @summary Find wallet
1670
+ * @request GET:/wallets/{id}
1671
+ * @secure
1672
+ */
1673
+ findWallet: (id: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiResponseUnauthorized | ApiResponseNotFound>>;
1674
+ /**
1675
+ * @description Delete a wallet
1676
+ *
1677
+ * @tags wallets
1678
+ * @name DestroyWallet
1679
+ * @summary Delete a wallet
1680
+ * @request DELETE:/wallets/{id}
1681
+ * @secure
1682
+ */
1683
+ destroyWallet: (id: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiResponseUnauthorized | ApiResponseNotFound | ApiResponseNotAllowed>>;
1684
+ /**
1685
+ * @description Find all wallets for certain customer
1686
+ *
1687
+ * @tags wallets
1688
+ * @name FindAllWallets
1689
+ * @summary Find wallets
1690
+ * @request GET:/wallets/
1691
+ * @secure
1692
+ */
1693
+ findAllWallets: (query: {
1694
+ /**
1695
+ * Number of page
1696
+ * @example 2
1697
+ */
1698
+ page?: number;
1699
+ /**
1700
+ * Number of records per page
1701
+ * @example 20
1702
+ */
1703
+ per_page?: number;
1704
+ /**
1705
+ * External customer ID
1706
+ * @example 12345
1707
+ */
1708
+ external_customer_id: string;
1709
+ }, params?: RequestParams) => Promise<HttpResponse<Wallets, ApiResponseUnauthorized>>;
1710
+ };
1711
+ walletTransactions: {
1712
+ /**
1713
+ * @description Create a new wallet transaction
1714
+ *
1715
+ * @tags wallets
1716
+ * @name CreateWalletTransaction
1717
+ * @summary Create a new wallet transaction
1718
+ * @request POST:/wallet_transactions
1719
+ * @secure
1720
+ */
1721
+ createWalletTransaction: (data: WalletTransactionInput, params?: RequestParams) => Promise<HttpResponse<WalletTransaction, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1722
+ };
1723
+ creditNotes: {
1724
+ /**
1725
+ * @description Create a new credit note
1726
+ *
1727
+ * @tags credit_notes
1728
+ * @name CreateCreditNote
1729
+ * @summary Create a new Credit note
1730
+ * @request POST:/credit_notes
1731
+ * @secure
1732
+ */
1733
+ createCreditNote: (data: CreditNoteInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
1734
+ /**
1735
+ * @description Update an existing credit note
1736
+ *
1737
+ * @tags credit_notes
1738
+ * @name UpdateCreditNote
1739
+ * @summary Update an existing credit note
1740
+ * @request PUT:/credit_notes/{id}
1741
+ * @secure
1742
+ */
1743
+ updateCreditNote: (id: string, data: CreditNoteUpdateInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity | ApiResponseNotFound>>;
1744
+ /**
1745
+ * @description Return a single credit note
1746
+ *
1747
+ * @tags credit_notes
1748
+ * @name FindCreditNote
1749
+ * @summary Find credit note
1750
+ * @request GET:/credit_notes/{id}
1751
+ * @secure
1752
+ */
1753
+ findCreditNote: (id: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiResponseUnauthorized | ApiResponseNotFound>>;
1754
+ /**
1755
+ * @description Download an existing credit note
1756
+ *
1757
+ * @tags credit_notes
1758
+ * @name DownloadCreditNote
1759
+ * @summary Download an existing credit note
1760
+ * @request POST:/credit_notes/{id}/download
1761
+ * @secure
1762
+ */
1763
+ downloadCreditNote: (id: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiResponseUnauthorized | ApiResponseNotFound>>;
1764
+ /**
1765
+ * @description Void an existing credit note
1766
+ *
1767
+ * @tags credit_notes
1768
+ * @name VoidCreditNote
1769
+ * @summary Void existing credit note
1770
+ * @request PUT:/credit_notes/{id}/void
1771
+ * @secure
1772
+ */
1773
+ voidCreditNote: (id: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiResponseUnauthorized | ApiResponseNotFound | ApiResponseNotAllowed>>;
1774
+ /**
1775
+ * @description Find all credit notes in certain organisation
1776
+ *
1777
+ * @tags credit_notes
1778
+ * @name FindAllCreditNotes
1779
+ * @summary Find Credit notes
1780
+ * @request GET:/credit_notes/
1781
+ * @secure
1782
+ */
1783
+ findAllCreditNotes: (query?: {
1784
+ /**
1785
+ * Number of page
1786
+ * @example 2
1787
+ */
1788
+ page?: number;
1789
+ /**
1790
+ * Number of records per page
1791
+ * @example 20
1792
+ */
1793
+ per_page?: number;
1794
+ /**
1795
+ * External customer ID
1796
+ * @example 12345
1797
+ */
1798
+ external_customer_id?: string;
1799
+ }, params?: RequestParams) => Promise<HttpResponse<CreditNotes, ApiResponseUnauthorized>>;
1800
+ };
1801
+ }
1802
+ export {};