lago-javascript-client 0.35.0-beta → 0.39.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.
@@ -10,7 +10,287 @@
10
10
  * ---------------------------------------------------------------
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Api = exports.HttpClient = exports.ContentType = void 0;
13
+ exports.Api = exports.HttpClient = exports.ContentType = exports.Timezone = exports.Currency = void 0;
14
+ /** @example "USD" */
15
+ var Currency;
16
+ (function (Currency) {
17
+ Currency["AED"] = "AED";
18
+ Currency["AFN"] = "AFN";
19
+ Currency["ALL"] = "ALL";
20
+ Currency["AMD"] = "AMD";
21
+ Currency["ANG"] = "ANG";
22
+ Currency["AOA"] = "AOA";
23
+ Currency["ARS"] = "ARS";
24
+ Currency["AUD"] = "AUD";
25
+ Currency["AWG"] = "AWG";
26
+ Currency["AZN"] = "AZN";
27
+ Currency["BAM"] = "BAM";
28
+ Currency["BBD"] = "BBD";
29
+ Currency["BDT"] = "BDT";
30
+ Currency["BGN"] = "BGN";
31
+ Currency["BIF"] = "BIF";
32
+ Currency["BMD"] = "BMD";
33
+ Currency["BND"] = "BND";
34
+ Currency["BOB"] = "BOB";
35
+ Currency["BRL"] = "BRL";
36
+ Currency["BSD"] = "BSD";
37
+ Currency["BWP"] = "BWP";
38
+ Currency["BYN"] = "BYN";
39
+ Currency["BZD"] = "BZD";
40
+ Currency["CAD"] = "CAD";
41
+ Currency["CDF"] = "CDF";
42
+ Currency["CHF"] = "CHF";
43
+ Currency["CLF"] = "CLF";
44
+ Currency["CLP"] = "CLP";
45
+ Currency["CNY"] = "CNY";
46
+ Currency["COP"] = "COP";
47
+ Currency["CRC"] = "CRC";
48
+ Currency["CVE"] = "CVE";
49
+ Currency["CZK"] = "CZK";
50
+ Currency["DJF"] = "DJF";
51
+ Currency["DKK"] = "DKK";
52
+ Currency["DOP"] = "DOP";
53
+ Currency["DZD"] = "DZD";
54
+ Currency["EGP"] = "EGP";
55
+ Currency["ETB"] = "ETB";
56
+ Currency["EUR"] = "EUR";
57
+ Currency["FJD"] = "FJD";
58
+ Currency["FKP"] = "FKP";
59
+ Currency["GBP"] = "GBP";
60
+ Currency["GEL"] = "GEL";
61
+ Currency["GIP"] = "GIP";
62
+ Currency["GMD"] = "GMD";
63
+ Currency["GNF"] = "GNF";
64
+ Currency["GTQ"] = "GTQ";
65
+ Currency["GYD"] = "GYD";
66
+ Currency["HKD"] = "HKD";
67
+ Currency["HNL"] = "HNL";
68
+ Currency["HRK"] = "HRK";
69
+ Currency["HTG"] = "HTG";
70
+ Currency["HUF"] = "HUF";
71
+ Currency["IDR"] = "IDR";
72
+ Currency["ILS"] = "ILS";
73
+ Currency["INR"] = "INR";
74
+ Currency["ISK"] = "ISK";
75
+ Currency["JMD"] = "JMD";
76
+ Currency["JPY"] = "JPY";
77
+ Currency["KES"] = "KES";
78
+ Currency["KGS"] = "KGS";
79
+ Currency["KHR"] = "KHR";
80
+ Currency["KMF"] = "KMF";
81
+ Currency["KRW"] = "KRW";
82
+ Currency["KYD"] = "KYD";
83
+ Currency["KZT"] = "KZT";
84
+ Currency["LAK"] = "LAK";
85
+ Currency["LBP"] = "LBP";
86
+ Currency["LKR"] = "LKR";
87
+ Currency["LRD"] = "LRD";
88
+ Currency["LSL"] = "LSL";
89
+ Currency["MAD"] = "MAD";
90
+ Currency["MDL"] = "MDL";
91
+ Currency["MGA"] = "MGA";
92
+ Currency["MKD"] = "MKD";
93
+ Currency["MMK"] = "MMK";
94
+ Currency["MNT"] = "MNT";
95
+ Currency["MOP"] = "MOP";
96
+ Currency["MRO"] = "MRO";
97
+ Currency["MUR"] = "MUR";
98
+ Currency["MVR"] = "MVR";
99
+ Currency["MWK"] = "MWK";
100
+ Currency["MXN"] = "MXN";
101
+ Currency["MYR"] = "MYR";
102
+ Currency["MZN"] = "MZN";
103
+ Currency["NAD"] = "NAD";
104
+ Currency["NGN"] = "NGN";
105
+ Currency["NIO"] = "NIO";
106
+ Currency["NOK"] = "NOK";
107
+ Currency["NPR"] = "NPR";
108
+ Currency["NZD"] = "NZD";
109
+ Currency["PAB"] = "PAB";
110
+ Currency["PEN"] = "PEN";
111
+ Currency["PGK"] = "PGK";
112
+ Currency["PHP"] = "PHP";
113
+ Currency["PKR"] = "PKR";
114
+ Currency["PLN"] = "PLN";
115
+ Currency["PYG"] = "PYG";
116
+ Currency["QAR"] = "QAR";
117
+ Currency["RON"] = "RON";
118
+ Currency["RSD"] = "RSD";
119
+ Currency["RUB"] = "RUB";
120
+ Currency["RWF"] = "RWF";
121
+ Currency["SAR"] = "SAR";
122
+ Currency["SBD"] = "SBD";
123
+ Currency["SCR"] = "SCR";
124
+ Currency["SEK"] = "SEK";
125
+ Currency["SGD"] = "SGD";
126
+ Currency["SHP"] = "SHP";
127
+ Currency["SLL"] = "SLL";
128
+ Currency["SOS"] = "SOS";
129
+ Currency["SRD"] = "SRD";
130
+ Currency["STD"] = "STD";
131
+ Currency["SZL"] = "SZL";
132
+ Currency["THB"] = "THB";
133
+ Currency["TJS"] = "TJS";
134
+ Currency["TOP"] = "TOP";
135
+ Currency["TRY"] = "TRY";
136
+ Currency["TTD"] = "TTD";
137
+ Currency["TWD"] = "TWD";
138
+ Currency["TZS"] = "TZS";
139
+ Currency["UAH"] = "UAH";
140
+ Currency["UGX"] = "UGX";
141
+ Currency["USD"] = "USD";
142
+ Currency["UYU"] = "UYU";
143
+ Currency["UZS"] = "UZS";
144
+ Currency["VND"] = "VND";
145
+ Currency["VUV"] = "VUV";
146
+ Currency["WST"] = "WST";
147
+ Currency["XAF"] = "XAF";
148
+ Currency["XCD"] = "XCD";
149
+ Currency["XOF"] = "XOF";
150
+ Currency["XPF"] = "XPF";
151
+ Currency["YER"] = "YER";
152
+ Currency["ZAR"] = "ZAR";
153
+ Currency["ZMW"] = "ZMW";
154
+ })(Currency = exports.Currency || (exports.Currency = {}));
155
+ /** @example "America/Los_Angeles" */
156
+ var Timezone;
157
+ (function (Timezone) {
158
+ Timezone["UTC"] = "UTC";
159
+ Timezone["AfricaAlgiers"] = "Africa/Algiers";
160
+ Timezone["AfricaCairo"] = "Africa/Cairo";
161
+ Timezone["AfricaCasablanca"] = "Africa/Casablanca";
162
+ Timezone["AfricaHarare"] = "Africa/Harare";
163
+ Timezone["AfricaJohannesburg"] = "Africa/Johannesburg";
164
+ Timezone["AfricaMonrovia"] = "Africa/Monrovia";
165
+ Timezone["AfricaNairobi"] = "Africa/Nairobi";
166
+ Timezone["AmericaArgentinaBuenosAires"] = "America/Argentina/Buenos_Aires";
167
+ Timezone["AmericaBogota"] = "America/Bogota";
168
+ Timezone["AmericaCaracas"] = "America/Caracas";
169
+ Timezone["AmericaChicago"] = "America/Chicago";
170
+ Timezone["AmericaChihuahua"] = "America/Chihuahua";
171
+ Timezone["AmericaDenver"] = "America/Denver";
172
+ Timezone["AmericaGodthab"] = "America/Godthab";
173
+ Timezone["AmericaGuatemala"] = "America/Guatemala";
174
+ Timezone["AmericaGuyana"] = "America/Guyana";
175
+ Timezone["AmericaHalifax"] = "America/Halifax";
176
+ Timezone["AmericaIndianaIndianapolis"] = "America/Indiana/Indianapolis";
177
+ Timezone["AmericaJuneau"] = "America/Juneau";
178
+ Timezone["AmericaLaPaz"] = "America/La_Paz";
179
+ Timezone["AmericaLima"] = "America/Lima";
180
+ Timezone["AmericaLosAngeles"] = "America/Los_Angeles";
181
+ Timezone["AmericaMazatlan"] = "America/Mazatlan";
182
+ Timezone["AmericaMexicoCity"] = "America/Mexico_City";
183
+ Timezone["AmericaMonterrey"] = "America/Monterrey";
184
+ Timezone["AmericaMontevideo"] = "America/Montevideo";
185
+ Timezone["AmericaNewYork"] = "America/New_York";
186
+ Timezone["AmericaPhoenix"] = "America/Phoenix";
187
+ Timezone["AmericaPuertoRico"] = "America/Puerto_Rico";
188
+ Timezone["AmericaRegina"] = "America/Regina";
189
+ Timezone["AmericaSantiago"] = "America/Santiago";
190
+ Timezone["AmericaSaoPaulo"] = "America/Sao_Paulo";
191
+ Timezone["AmericaStJohns"] = "America/St_Johns";
192
+ Timezone["AmericaTijuana"] = "America/Tijuana";
193
+ Timezone["AsiaAlmaty"] = "Asia/Almaty";
194
+ Timezone["AsiaBaghdad"] = "Asia/Baghdad";
195
+ Timezone["AsiaBaku"] = "Asia/Baku";
196
+ Timezone["AsiaBangkok"] = "Asia/Bangkok";
197
+ Timezone["AsiaChongqing"] = "Asia/Chongqing";
198
+ Timezone["AsiaColombo"] = "Asia/Colombo";
199
+ Timezone["AsiaDhaka"] = "Asia/Dhaka";
200
+ Timezone["AsiaHongKong"] = "Asia/Hong_Kong";
201
+ Timezone["AsiaIrkutsk"] = "Asia/Irkutsk";
202
+ Timezone["AsiaJakarta"] = "Asia/Jakarta";
203
+ Timezone["AsiaJerusalem"] = "Asia/Jerusalem";
204
+ Timezone["AsiaKabul"] = "Asia/Kabul";
205
+ Timezone["AsiaKamchatka"] = "Asia/Kamchatka";
206
+ Timezone["AsiaKarachi"] = "Asia/Karachi";
207
+ Timezone["AsiaKathmandu"] = "Asia/Kathmandu";
208
+ Timezone["AsiaKolkata"] = "Asia/Kolkata";
209
+ Timezone["AsiaKrasnoyarsk"] = "Asia/Krasnoyarsk";
210
+ Timezone["AsiaKualaLumpur"] = "Asia/Kuala_Lumpur";
211
+ Timezone["AsiaKuwait"] = "Asia/Kuwait";
212
+ Timezone["AsiaMagadan"] = "Asia/Magadan";
213
+ Timezone["AsiaMuscat"] = "Asia/Muscat";
214
+ Timezone["AsiaNovosibirsk"] = "Asia/Novosibirsk";
215
+ Timezone["AsiaRangoon"] = "Asia/Rangoon";
216
+ Timezone["AsiaRiyadh"] = "Asia/Riyadh";
217
+ Timezone["AsiaSeoul"] = "Asia/Seoul";
218
+ Timezone["AsiaShanghai"] = "Asia/Shanghai";
219
+ Timezone["AsiaSingapore"] = "Asia/Singapore";
220
+ Timezone["AsiaSrednekolymsk"] = "Asia/Srednekolymsk";
221
+ Timezone["AsiaTaipei"] = "Asia/Taipei";
222
+ Timezone["AsiaTashkent"] = "Asia/Tashkent";
223
+ Timezone["AsiaTbilisi"] = "Asia/Tbilisi";
224
+ Timezone["AsiaTehran"] = "Asia/Tehran";
225
+ Timezone["AsiaTokyo"] = "Asia/Tokyo";
226
+ Timezone["AsiaUlaanbaatar"] = "Asia/Ulaanbaatar";
227
+ Timezone["AsiaUrumqi"] = "Asia/Urumqi";
228
+ Timezone["AsiaVladivostok"] = "Asia/Vladivostok";
229
+ Timezone["AsiaYakutsk"] = "Asia/Yakutsk";
230
+ Timezone["AsiaYekaterinburg"] = "Asia/Yekaterinburg";
231
+ Timezone["AsiaYerevan"] = "Asia/Yerevan";
232
+ Timezone["AtlanticAzores"] = "Atlantic/Azores";
233
+ Timezone["AtlanticCapeVerde"] = "Atlantic/Cape_Verde";
234
+ Timezone["AtlanticSouthGeorgia"] = "Atlantic/South_Georgia";
235
+ Timezone["AustraliaAdelaide"] = "Australia/Adelaide";
236
+ Timezone["AustraliaBrisbane"] = "Australia/Brisbane";
237
+ Timezone["AustraliaDarwin"] = "Australia/Darwin";
238
+ Timezone["AustraliaHobart"] = "Australia/Hobart";
239
+ Timezone["AustraliaMelbourne"] = "Australia/Melbourne";
240
+ Timezone["AustraliaPerth"] = "Australia/Perth";
241
+ Timezone["AustraliaSydney"] = "Australia/Sydney";
242
+ Timezone["EuropeAmsterdam"] = "Europe/Amsterdam";
243
+ Timezone["EuropeAthens"] = "Europe/Athens";
244
+ Timezone["EuropeBelgrade"] = "Europe/Belgrade";
245
+ Timezone["EuropeBerlin"] = "Europe/Berlin";
246
+ Timezone["EuropeBratislava"] = "Europe/Bratislava";
247
+ Timezone["EuropeBrussels"] = "Europe/Brussels";
248
+ Timezone["EuropeBucharest"] = "Europe/Bucharest";
249
+ Timezone["EuropeBudapest"] = "Europe/Budapest";
250
+ Timezone["EuropeCopenhagen"] = "Europe/Copenhagen";
251
+ Timezone["EuropeDublin"] = "Europe/Dublin";
252
+ Timezone["EuropeHelsinki"] = "Europe/Helsinki";
253
+ Timezone["EuropeIstanbul"] = "Europe/Istanbul";
254
+ Timezone["EuropeKaliningrad"] = "Europe/Kaliningrad";
255
+ Timezone["EuropeKiev"] = "Europe/Kiev";
256
+ Timezone["EuropeLisbon"] = "Europe/Lisbon";
257
+ Timezone["EuropeLjubljana"] = "Europe/Ljubljana";
258
+ Timezone["EuropeLondon"] = "Europe/London";
259
+ Timezone["EuropeMadrid"] = "Europe/Madrid";
260
+ Timezone["EuropeMinsk"] = "Europe/Minsk";
261
+ Timezone["EuropeMoscow"] = "Europe/Moscow";
262
+ Timezone["EuropeParis"] = "Europe/Paris";
263
+ Timezone["EuropePrague"] = "Europe/Prague";
264
+ Timezone["EuropeRiga"] = "Europe/Riga";
265
+ Timezone["EuropeRome"] = "Europe/Rome";
266
+ Timezone["EuropeSamara"] = "Europe/Samara";
267
+ Timezone["EuropeSarajevo"] = "Europe/Sarajevo";
268
+ Timezone["EuropeSkopje"] = "Europe/Skopje";
269
+ Timezone["EuropeSofia"] = "Europe/Sofia";
270
+ Timezone["EuropeStockholm"] = "Europe/Stockholm";
271
+ Timezone["EuropeTallinn"] = "Europe/Tallinn";
272
+ Timezone["EuropeVienna"] = "Europe/Vienna";
273
+ Timezone["EuropeVilnius"] = "Europe/Vilnius";
274
+ Timezone["EuropeVolgograd"] = "Europe/Volgograd";
275
+ Timezone["EuropeWarsaw"] = "Europe/Warsaw";
276
+ Timezone["EuropeZagreb"] = "Europe/Zagreb";
277
+ Timezone["EuropeZurich"] = "Europe/Zurich";
278
+ Timezone["GMT12"] = "GMT+12";
279
+ Timezone["PacificApia"] = "Pacific/Apia";
280
+ Timezone["PacificAuckland"] = "Pacific/Auckland";
281
+ Timezone["PacificChatham"] = "Pacific/Chatham";
282
+ Timezone["PacificFakaofo"] = "Pacific/Fakaofo";
283
+ Timezone["PacificFiji"] = "Pacific/Fiji";
284
+ Timezone["PacificGuadalcanal"] = "Pacific/Guadalcanal";
285
+ Timezone["PacificGuam"] = "Pacific/Guam";
286
+ Timezone["PacificHonolulu"] = "Pacific/Honolulu";
287
+ Timezone["PacificMajuro"] = "Pacific/Majuro";
288
+ Timezone["PacificMidway"] = "Pacific/Midway";
289
+ Timezone["PacificNoumea"] = "Pacific/Noumea";
290
+ Timezone["PacificPagoPago"] = "Pacific/Pago_Pago";
291
+ Timezone["PacificPortMoresby"] = "Pacific/Port_Moresby";
292
+ Timezone["PacificTongatapu"] = "Pacific/Tongatapu";
293
+ })(Timezone = exports.Timezone || (exports.Timezone = {}));
14
294
  var ContentType;
15
295
  (function (ContentType) {
16
296
  ContentType["Json"] = "application/json";
@@ -152,7 +432,8 @@ class HttpClient {
152
432
  exports.HttpClient = HttpClient;
153
433
  /**
154
434
  * @title Lago API documentation
155
- * @version 0.35.0-beta
435
+ * @version 0.39.0-beta
436
+ * @license AGPLv3
156
437
  * @baseUrl https://api.getlago.com/api/v1
157
438
  * @externalDocs https://github.com/getlago
158
439
  * @contact <tech@getlago.com>
@@ -160,18 +441,18 @@ exports.HttpClient = HttpClient;
160
441
  * Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
161
442
  */
162
443
  class Api extends HttpClient {
163
- billableMetrics = {
444
+ addOns = {
164
445
  /**
165
- * @description Create a new billable metric
446
+ * @description This endpoint is used to create an add-on that can be then attached to a one-off invoice.
166
447
  *
167
- * @tags billable_metrics
168
- * @name CreateBillableMetric
169
- * @summary Create a new billable metric
170
- * @request POST:/billable_metrics
448
+ * @tags add_ons
449
+ * @name CreateAddOn
450
+ * @summary Create an add-on
451
+ * @request POST:/add_ons
171
452
  * @secure
172
453
  */
173
- createBillableMetric: (data, params = {}) => this.request({
174
- path: `/billable_metrics`,
454
+ createAddOn: (data, params = {}) => this.request({
455
+ path: `/add_ons`,
175
456
  method: "POST",
176
457
  body: data,
177
458
  secure: true,
@@ -180,16 +461,16 @@ class Api extends HttpClient {
180
461
  ...params,
181
462
  }),
182
463
  /**
183
- * @description Find all billable metrics in certain organisation
464
+ * @description This endpoint is used to list all existing add-ons.
184
465
  *
185
- * @tags billable_metrics
186
- * @name FindAllBillableMetrics
187
- * @summary Find Billable metrics
188
- * @request GET:/billable_metrics
466
+ * @tags add_ons
467
+ * @name FindAllAddOns
468
+ * @summary List all add-ons
469
+ * @request GET:/add_ons
189
470
  * @secure
190
471
  */
191
- findAllBillableMetrics: (query, params = {}) => this.request({
192
- path: `/billable_metrics`,
472
+ findAllAddOns: (query, params = {}) => this.request({
473
+ path: `/add_ons`,
193
474
  method: "GET",
194
475
  query: query,
195
476
  secure: true,
@@ -197,16 +478,16 @@ class Api extends HttpClient {
197
478
  ...params,
198
479
  }),
199
480
  /**
200
- * @description Update an existing billable metric by code
481
+ * @description This endpoint is used to update an existing add-on.
201
482
  *
202
- * @tags billable_metrics
203
- * @name UpdateBillableMetric
204
- * @summary Update an existing billable metric
205
- * @request PUT:/billable_metrics/{code}
483
+ * @tags add_ons
484
+ * @name UpdateAddOn
485
+ * @summary Update an add-on
486
+ * @request PUT:/add_ons/{code}
206
487
  * @secure
207
488
  */
208
- updateBillableMetric: (code, data, params = {}) => this.request({
209
- path: `/billable_metrics/${code}`,
489
+ updateAddOn: (code, data, params = {}) => this.request({
490
+ path: `/add_ons/${code}`,
210
491
  method: "PUT",
211
492
  body: data,
212
493
  secure: true,
@@ -215,48 +496,89 @@ class Api extends HttpClient {
215
496
  ...params,
216
497
  }),
217
498
  /**
218
- * @description Return a single billable metric
499
+ * @description This endpoint is used to retrieve a specific add-on.
219
500
  *
220
- * @tags billable_metrics
221
- * @name FindBillableMetric
222
- * @summary Find billable metric by code
223
- * @request GET:/billable_metrics/{code}
501
+ * @tags add_ons
502
+ * @name FindAddOn
503
+ * @summary Retrieve an add-on
504
+ * @request GET:/add_ons/{code}
224
505
  * @secure
225
506
  */
226
- findBillableMetric: (code, params = {}) => this.request({
227
- path: `/billable_metrics/${code}`,
507
+ findAddOn: (code, params = {}) => this.request({
508
+ path: `/add_ons/${code}`,
228
509
  method: "GET",
229
510
  secure: true,
230
511
  format: "json",
231
512
  ...params,
232
513
  }),
233
514
  /**
234
- * @description Delete a billable metric
515
+ * @description This endpoint is used to delete an existing add-on.
235
516
  *
236
- * @tags billable_metrics
237
- * @name DestroyBillableMetric
238
- * @summary Delete a billable metric
239
- * @request DELETE:/billable_metrics/{code}
517
+ * @tags add_ons
518
+ * @name DestroyAddOn
519
+ * @summary Delete an add-on
520
+ * @request DELETE:/add_ons/{code}
240
521
  * @secure
241
522
  */
242
- destroyBillableMetric: (code, params = {}) => this.request({
243
- path: `/billable_metrics/${code}`,
523
+ destroyAddOn: (code, params = {}) => this.request({
524
+ path: `/add_ons/${code}`,
244
525
  method: "DELETE",
245
526
  secure: true,
246
527
  format: "json",
247
528
  ...params,
248
529
  }),
530
+ };
531
+ appliedAddOns = {
249
532
  /**
250
- * @description Find all billable metric groups in certain organisation
533
+ * @description Apply an add-on to a customer
251
534
  *
252
- * @tags billable_metrics
253
- * @name FindAllBillableMetricGroups
254
- * @summary Find Billable metric groups
255
- * @request GET:/billable_metrics/{code}/groups
535
+ * @tags add_ons
536
+ * @name ApplyAddOn
537
+ * @summary Apply an add-on to a customer
538
+ * @request POST:/applied_add_ons
539
+ * @deprecated
256
540
  * @secure
257
541
  */
258
- findAllBillableMetricGroups: (code, query, params = {}) => this.request({
259
- path: `/billable_metrics/${code}/groups`,
542
+ applyAddOn: (data, params = {}) => this.request({
543
+ path: `/applied_add_ons`,
544
+ method: "POST",
545
+ body: data,
546
+ secure: true,
547
+ type: ContentType.Json,
548
+ format: "json",
549
+ ...params,
550
+ }),
551
+ };
552
+ appliedCoupons = {
553
+ /**
554
+ * @description This endpoint is used to apply a specific coupon to a customer, before or during a subscription.
555
+ *
556
+ * @tags coupons
557
+ * @name ApplyCoupon
558
+ * @summary Apply a coupon to a customer
559
+ * @request POST:/applied_coupons
560
+ * @secure
561
+ */
562
+ applyCoupon: (data, params = {}) => this.request({
563
+ path: `/applied_coupons`,
564
+ method: "POST",
565
+ body: data,
566
+ secure: true,
567
+ type: ContentType.Json,
568
+ format: "json",
569
+ ...params,
570
+ }),
571
+ /**
572
+ * @description This endpoint is used to list all applied coupons. You can filter by coupon status and by customer.
573
+ *
574
+ * @tags coupons
575
+ * @name FindAllAppliedCoupons
576
+ * @summary List all applied coupons
577
+ * @request GET:/applied_coupons
578
+ * @secure
579
+ */
580
+ findAllAppliedCoupons: (query, params = {}) => this.request({
581
+ path: `/applied_coupons`,
260
582
  method: "GET",
261
583
  query: query,
262
584
  secure: true,
@@ -264,18 +586,18 @@ class Api extends HttpClient {
264
586
  ...params,
265
587
  }),
266
588
  };
267
- addOns = {
589
+ billableMetrics = {
268
590
  /**
269
- * @description Create a new add-on
591
+ * @description This endpoint creates a new billable metric representing a pricing component of your application.
270
592
  *
271
- * @tags add_ons
272
- * @name CreateAddOn
273
- * @summary Create a new add-on
274
- * @request POST:/add_ons
593
+ * @tags billable_metrics
594
+ * @name CreateBillableMetric
595
+ * @summary Create a billable metric
596
+ * @request POST:/billable_metrics
275
597
  * @secure
276
598
  */
277
- createAddOn: (data, params = {}) => this.request({
278
- path: `/add_ons`,
599
+ createBillableMetric: (data, params = {}) => this.request({
600
+ path: `/billable_metrics`,
279
601
  method: "POST",
280
602
  body: data,
281
603
  secure: true,
@@ -284,16 +606,16 @@ class Api extends HttpClient {
284
606
  ...params,
285
607
  }),
286
608
  /**
287
- * @description Find all add-ons in certain organisation
609
+ * @description This endpoint retrieves all existing billable metrics that represent pricing components of your application.
288
610
  *
289
- * @tags add_ons
290
- * @name FindAllAddOns
291
- * @summary Find add-ons
292
- * @request GET:/add_ons
611
+ * @tags billable_metrics
612
+ * @name FindAllBillableMetrics
613
+ * @summary List all billable metrics
614
+ * @request GET:/billable_metrics
293
615
  * @secure
294
616
  */
295
- findAllAddOns: (query, params = {}) => this.request({
296
- path: `/add_ons`,
617
+ findAllBillableMetrics: (query, params = {}) => this.request({
618
+ path: `/billable_metrics`,
297
619
  method: "GET",
298
620
  query: query,
299
621
  secure: true,
@@ -301,16 +623,16 @@ class Api extends HttpClient {
301
623
  ...params,
302
624
  }),
303
625
  /**
304
- * @description Update an existing add-on by code
626
+ * @description This endpoint updates an existing billable metric representing a pricing component of your application.
305
627
  *
306
- * @tags add_ons
307
- * @name UpdateAddOn
308
- * @summary Update an existing add-on
309
- * @request PUT:/add_ons/{code}
628
+ * @tags billable_metrics
629
+ * @name UpdateBillableMetric
630
+ * @summary Update a billable metric
631
+ * @request PUT:/billable_metrics/{code}
310
632
  * @secure
311
633
  */
312
- updateAddOn: (code, data, params = {}) => this.request({
313
- path: `/add_ons/${code}`,
634
+ updateBillableMetric: (code, data, params = {}) => this.request({
635
+ path: `/billable_metrics/${code}`,
314
636
  method: "PUT",
315
637
  body: data,
316
638
  secure: true,
@@ -319,65 +641,62 @@ class Api extends HttpClient {
319
641
  ...params,
320
642
  }),
321
643
  /**
322
- * @description Return a single add-on
644
+ * @description This endpoint deletes an existing billable metric representing a pricing component of your application.
323
645
  *
324
- * @tags add_ons
325
- * @name FindAddOn
326
- * @summary Find add-on by code
327
- * @request GET:/add_ons/{code}
646
+ * @tags billable_metrics
647
+ * @name DestroyBillableMetric
648
+ * @summary Delete a billable metric
649
+ * @request DELETE:/billable_metrics/{code}
328
650
  * @secure
329
651
  */
330
- findAddOn: (code, params = {}) => this.request({
331
- path: `/add_ons/${code}`,
332
- method: "GET",
652
+ destroyBillableMetric: (code, params = {}) => this.request({
653
+ path: `/billable_metrics/${code}`,
654
+ method: "DELETE",
333
655
  secure: true,
334
656
  format: "json",
335
657
  ...params,
336
658
  }),
337
659
  /**
338
- * @description Delete an add-on
660
+ * @description This endpoint retrieves an existing billable metric that represents a pricing component of your application. The billable metric is identified by its unique code.
339
661
  *
340
- * @tags add_ons
341
- * @name DestroyAddOn
342
- * @summary Delete an add-on
343
- * @request DELETE:/add_ons/{code}
662
+ * @tags billable_metrics
663
+ * @name FindBillableMetric
664
+ * @summary Retrieve a billable metric
665
+ * @request GET:/billable_metrics/{code}
344
666
  * @secure
345
667
  */
346
- destroyAddOn: (code, params = {}) => this.request({
347
- path: `/add_ons/${code}`,
348
- method: "DELETE",
668
+ findBillableMetric: (code, params = {}) => this.request({
669
+ path: `/billable_metrics/${code}`,
670
+ method: "GET",
349
671
  secure: true,
350
672
  format: "json",
351
673
  ...params,
352
674
  }),
353
- };
354
- appliedAddOns = {
355
675
  /**
356
- * @description Apply an add-on to a customer
676
+ * @description This endpoint retrieves all groups for a billable metric.
357
677
  *
358
- * @tags add_ons
359
- * @name ApplyAddOn
360
- * @summary Apply an add-on to a customer
361
- * @request POST:/applied_add_ons
678
+ * @tags billable_metrics
679
+ * @name FindAllBillableMetricGroups
680
+ * @summary Find a billable metric's groups
681
+ * @request GET:/billable_metrics/{code}/groups
362
682
  * @secure
363
683
  */
364
- applyAddOn: (data, params = {}) => this.request({
365
- path: `/applied_add_ons`,
366
- method: "POST",
367
- body: data,
684
+ findAllBillableMetricGroups: (code, query, params = {}) => this.request({
685
+ path: `/billable_metrics/${code}/groups`,
686
+ method: "GET",
687
+ query: query,
368
688
  secure: true,
369
- type: ContentType.Json,
370
689
  format: "json",
371
690
  ...params,
372
691
  }),
373
692
  };
374
693
  coupons = {
375
694
  /**
376
- * @description Create a new coupon
695
+ * @description This endpoint is used to create a coupon that can be then attached to a customer to create a discount.
377
696
  *
378
697
  * @tags coupons
379
698
  * @name CreateCoupon
380
- * @summary Create a new coupon
699
+ * @summary Create a coupon
381
700
  * @request POST:/coupons
382
701
  * @secure
383
702
  */
@@ -391,11 +710,11 @@ class Api extends HttpClient {
391
710
  ...params,
392
711
  }),
393
712
  /**
394
- * @description Find all coupons in certain organisation
713
+ * @description This endpoint is used to list all existing coupons.
395
714
  *
396
715
  * @tags coupons
397
716
  * @name FindAllCoupons
398
- * @summary Find Coupons
717
+ * @summary List all coupons
399
718
  * @request GET:/coupons
400
719
  * @secure
401
720
  */
@@ -408,11 +727,11 @@ class Api extends HttpClient {
408
727
  ...params,
409
728
  }),
410
729
  /**
411
- * @description Update an existing coupon by code
730
+ * @description This endpoint is used to update a coupon that can be then attached to a customer to create a discount.
412
731
  *
413
732
  * @tags coupons
414
733
  * @name UpdateCoupon
415
- * @summary Update an existing coupon
734
+ * @summary Update a coupon
416
735
  * @request PUT:/coupons/{code}
417
736
  * @secure
418
737
  */
@@ -426,11 +745,11 @@ class Api extends HttpClient {
426
745
  ...params,
427
746
  }),
428
747
  /**
429
- * @description Return a single coupon
748
+ * @description This endpoint is used to retrieve a specific coupon.
430
749
  *
431
750
  * @tags coupons
432
751
  * @name FindCoupon
433
- * @summary Find coupon by code
752
+ * @summary Retrieve a coupon
434
753
  * @request GET:/coupons/{code}
435
754
  * @secure
436
755
  */
@@ -442,7 +761,7 @@ class Api extends HttpClient {
442
761
  ...params,
443
762
  }),
444
763
  /**
445
- * @description Delete a coupon
764
+ * @description This endpoint is used to delete a coupon.
446
765
  *
447
766
  * @tags coupons
448
767
  * @name DestroyCoupon
@@ -458,18 +777,18 @@ class Api extends HttpClient {
458
777
  ...params,
459
778
  }),
460
779
  };
461
- appliedCoupons = {
780
+ creditNotes = {
462
781
  /**
463
- * @description Apply a coupon to a customer
782
+ * @description This endpoint creates a new credit note.
464
783
  *
465
- * @tags coupons
466
- * @name ApplyCoupon
467
- * @summary Apply a coupon to a customer
468
- * @request POST:/applied_coupons
784
+ * @tags credit_notes
785
+ * @name CreateCreditNote
786
+ * @summary Create a credit note
787
+ * @request POST:/credit_notes
469
788
  * @secure
470
789
  */
471
- applyCoupon: (data, params = {}) => this.request({
472
- path: `/applied_coupons`,
790
+ createCreditNote: (data, params = {}) => this.request({
791
+ path: `/credit_notes`,
473
792
  method: "POST",
474
793
  body: data,
475
794
  secure: true,
@@ -478,35 +797,33 @@ class Api extends HttpClient {
478
797
  ...params,
479
798
  }),
480
799
  /**
481
- * @description Find all applied coupons
800
+ * @description This endpoint list all existing credit notes.
482
801
  *
483
- * @tags coupons
484
- * @name FindAllAppliedCoupons
485
- * @summary Find Applied Coupons
486
- * @request GET:/applied_coupons
802
+ * @tags credit_notes
803
+ * @name FindAllCreditNotes
804
+ * @summary List all credit notes
805
+ * @request GET:/credit_notes
487
806
  * @secure
488
807
  */
489
- findAllAppliedCoupons: (query, params = {}) => this.request({
490
- path: `/applied_coupons`,
808
+ findAllCreditNotes: (query, params = {}) => this.request({
809
+ path: `/credit_notes`,
491
810
  method: "GET",
492
811
  query: query,
493
812
  secure: true,
494
813
  format: "json",
495
814
  ...params,
496
815
  }),
497
- };
498
- organizations = {
499
816
  /**
500
- * @description Update an existing organization
817
+ * @description This endpoint updates an existing credit note.
501
818
  *
502
- * @tags organizations
503
- * @name UpdateOrganization
504
- * @summary Update an existing Organization
505
- * @request PUT:/organizations
819
+ * @tags credit_notes
820
+ * @name UpdateCreditNote
821
+ * @summary Update a credit note
822
+ * @request PUT:/credit_notes/{lago_id}
506
823
  * @secure
507
824
  */
508
- updateOrganization: (data, params = {}) => this.request({
509
- path: `/organizations`,
825
+ updateCreditNote: (lagoId, data, params = {}) => this.request({
826
+ path: `/credit_notes/${lagoId}`,
510
827
  method: "PUT",
511
828
  body: data,
512
829
  secure: true,
@@ -514,10 +831,58 @@ class Api extends HttpClient {
514
831
  format: "json",
515
832
  ...params,
516
833
  }),
834
+ /**
835
+ * @description This endpoint retrieves an existing credit note.
836
+ *
837
+ * @tags credit_notes
838
+ * @name FindCreditNote
839
+ * @summary Retrieve a credit note
840
+ * @request GET:/credit_notes/{lago_id}
841
+ * @secure
842
+ */
843
+ findCreditNote: (lagoId, params = {}) => this.request({
844
+ path: `/credit_notes/${lagoId}`,
845
+ method: "GET",
846
+ secure: true,
847
+ format: "json",
848
+ ...params,
849
+ }),
850
+ /**
851
+ * @description This endpoint downloads the PDF of an existing credit note.
852
+ *
853
+ * @tags credit_notes
854
+ * @name DownloadCreditNote
855
+ * @summary Download a credit note PDF
856
+ * @request POST:/credit_notes/{lago_id}/download
857
+ * @secure
858
+ */
859
+ downloadCreditNote: (lagoId, params = {}) => this.request({
860
+ path: `/credit_notes/${lagoId}/download`,
861
+ method: "POST",
862
+ secure: true,
863
+ format: "json",
864
+ ...params,
865
+ }),
866
+ /**
867
+ * @description This endpoint voids an existing credit note.
868
+ *
869
+ * @tags credit_notes
870
+ * @name VoidCreditNote
871
+ * @summary Void a credit note
872
+ * @request PUT:/credit_notes/{lago_id}/void
873
+ * @secure
874
+ */
875
+ voidCreditNote: (lagoId, params = {}) => this.request({
876
+ path: `/credit_notes/${lagoId}/void`,
877
+ method: "PUT",
878
+ secure: true,
879
+ format: "json",
880
+ ...params,
881
+ }),
517
882
  };
518
883
  customers = {
519
884
  /**
520
- * @description Create a new customer
885
+ * @description This endpoint creates a new customer.
521
886
  *
522
887
  * @tags customers
523
888
  * @name CreateCustomer
@@ -535,11 +900,11 @@ class Api extends HttpClient {
535
900
  ...params,
536
901
  }),
537
902
  /**
538
- * @description Find all customers in certain organisation
903
+ * @description This endpoint retrieves all existing customers.
539
904
  *
540
905
  * @tags customers
541
906
  * @name FindAllCustomers
542
- * @summary Find customers
907
+ * @summary List all customers
543
908
  * @request GET:/customers
544
909
  * @secure
545
910
  */
@@ -552,11 +917,11 @@ class Api extends HttpClient {
552
917
  ...params,
553
918
  }),
554
919
  /**
555
- * @description Return a single customer
920
+ * @description This endpoint retrieves an existing customer.
556
921
  *
557
922
  * @tags customers
558
923
  * @name FindCustomer
559
- * @summary Find customer by external ID
924
+ * @summary Retrieve a customer
560
925
  * @request GET:/customers/{external_id}
561
926
  * @secure
562
927
  */
@@ -568,7 +933,7 @@ class Api extends HttpClient {
568
933
  ...params,
569
934
  }),
570
935
  /**
571
- * @description Return the deleted customer
936
+ * @description This endpoint deletes an existing customer.
572
937
  *
573
938
  * @tags customers
574
939
  * @name DestroyCustomer
@@ -584,118 +949,359 @@ class Api extends HttpClient {
584
949
  ...params,
585
950
  }),
586
951
  /**
587
- * @description Return a customer current usage
952
+ * @description This endpoint is used to delete a specific coupon that has been applied to a customer.
953
+ *
954
+ * @tags coupons, customers
955
+ * @name DeleteAppliedCoupon
956
+ * @summary Delete an applied coupon
957
+ * @request DELETE:/customers/{external_customer_id}/applied_coupons/{applied_coupon_id}
958
+ * @secure
959
+ */
960
+ deleteAppliedCoupon: (externalCustomerId, appliedCouponId, params = {}) => this.request({
961
+ path: `/customers/${externalCustomerId}/applied_coupons/${appliedCouponId}`,
962
+ method: "DELETE",
963
+ secure: true,
964
+ format: "json",
965
+ ...params,
966
+ }),
967
+ /**
968
+ * @description Apply an existing tax to a customer
969
+ *
970
+ * @tags customers
971
+ * @name ApplyTax
972
+ * @summary Apply a tax
973
+ * @request POST:/customers/{external_customer_id}/applied_taxes
974
+ * @secure
975
+ */
976
+ applyTax: (externalCustomerId, data, params = {}) => this.request({
977
+ path: `/customers/${externalCustomerId}/applied_taxes`,
978
+ method: "POST",
979
+ body: data,
980
+ secure: true,
981
+ type: ContentType.Json,
982
+ format: "json",
983
+ ...params,
984
+ }),
985
+ /**
986
+ * @description Delete customer's appplied tax
987
+ *
988
+ * @tags customers
989
+ * @name DeleteAppliedTax
990
+ * @summary Delete customer's appplied tax
991
+ * @request DELETE:/customers/{external_customer_id}/applied_taxes/{tax_code}
992
+ * @secure
993
+ */
994
+ deleteAppliedTax: (externalCustomerId, taxCode, params = {}) => this.request({
995
+ path: `/customers/${externalCustomerId}/applied_taxes/${taxCode}`,
996
+ method: "DELETE",
997
+ secure: true,
998
+ format: "json",
999
+ ...params,
1000
+ }),
1001
+ /**
1002
+ * @description Retrieves an embeddable link for displaying a customer portal. This endpoint allows you to fetch the URL that can be embedded to provide customers access to a dedicated portal
1003
+ *
1004
+ * @tags customers
1005
+ * @name GetCustomerPortalUrl
1006
+ * @summary Get a customer portal URL
1007
+ * @request GET:/customers/{external_customer_id}/portal_url
1008
+ * @secure
1009
+ */
1010
+ getCustomerPortalUrl: (externalCustomerId, params = {}) => this.request({
1011
+ path: `/customers/${externalCustomerId}/portal_url`,
1012
+ method: "GET",
1013
+ secure: true,
1014
+ format: "json",
1015
+ ...params,
1016
+ }),
1017
+ /**
1018
+ * @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period.
1019
+ *
1020
+ * @tags customers
1021
+ * @name FindCustomerCurrentUsage
1022
+ * @summary Retrieve customer current usage
1023
+ * @request GET:/customers/{external_customer_id}/current_usage
1024
+ * @secure
1025
+ */
1026
+ findCustomerCurrentUsage: (externalCustomerId, query, params = {}) => this.request({
1027
+ path: `/customers/${externalCustomerId}/current_usage`,
1028
+ method: "GET",
1029
+ query: query,
1030
+ secure: true,
1031
+ format: "json",
1032
+ ...params,
1033
+ }),
1034
+ };
1035
+ events = {
1036
+ /**
1037
+ * @description This endpoint is used for transmitting usage measurement events to either a designated customer or a specific subscription.
1038
+ *
1039
+ * @tags events
1040
+ * @name CreateEvent
1041
+ * @summary Send usage events
1042
+ * @request POST:/events
1043
+ * @secure
1044
+ */
1045
+ createEvent: (data, params = {}) => this.request({
1046
+ path: `/events`,
1047
+ method: "POST",
1048
+ body: data,
1049
+ secure: true,
1050
+ type: ContentType.Json,
1051
+ ...params,
1052
+ }),
1053
+ /**
1054
+ * @description This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer.
1055
+ *
1056
+ * @tags events
1057
+ * @name CreateBatchEvents
1058
+ * @summary Batch multiple events
1059
+ * @request POST:/events/batch
1060
+ * @secure
1061
+ */
1062
+ createBatchEvents: (data, params = {}) => this.request({
1063
+ path: `/events/batch`,
1064
+ method: "POST",
1065
+ body: data,
1066
+ secure: true,
1067
+ type: ContentType.Json,
1068
+ ...params,
1069
+ }),
1070
+ /**
1071
+ * @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple pay in advance charges
1072
+ *
1073
+ * @tags events
1074
+ * @name EventEstimateFees
1075
+ * @summary Estimate fees for a pay in advance charge
1076
+ * @request POST:/events/estimate_fees
1077
+ * @secure
1078
+ */
1079
+ eventEstimateFees: (data, params = {}) => this.request({
1080
+ path: `/events/estimate_fees`,
1081
+ method: "POST",
1082
+ body: data,
1083
+ secure: true,
1084
+ type: ContentType.Json,
1085
+ format: "json",
1086
+ ...params,
1087
+ }),
1088
+ /**
1089
+ * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
1090
+ *
1091
+ * @tags events
1092
+ * @name FindEvent
1093
+ * @summary Retrieve a specific event
1094
+ * @request GET:/events/{transaction_id}
1095
+ * @secure
1096
+ */
1097
+ findEvent: (transactionId, params = {}) => this.request({
1098
+ path: `/events/${transactionId}`,
1099
+ method: "GET",
1100
+ secure: true,
1101
+ format: "json",
1102
+ ...params,
1103
+ }),
1104
+ };
1105
+ fees = {
1106
+ /**
1107
+ * @description This endpoint is used for retrieving all fees that has been issued.
1108
+ *
1109
+ * @tags fees
1110
+ * @name FindAllFees
1111
+ * @summary List all fees
1112
+ * @request GET:/fees
1113
+ * @secure
1114
+ */
1115
+ findAllFees: (query, params = {}) => this.request({
1116
+ path: `/fees`,
1117
+ method: "GET",
1118
+ query: query,
1119
+ secure: true,
1120
+ format: "json",
1121
+ ...params,
1122
+ }),
1123
+ /**
1124
+ * @description This endpoint is used for retrieving a specific fee that has been issued.
1125
+ *
1126
+ * @tags fees
1127
+ * @name FindFee
1128
+ * @summary Retrieve a specific fee
1129
+ * @request GET:/fees/{lago_id}
1130
+ * @secure
1131
+ */
1132
+ findFee: (lagoId, params = {}) => this.request({
1133
+ path: `/fees/${lagoId}`,
1134
+ method: "GET",
1135
+ secure: true,
1136
+ format: "json",
1137
+ ...params,
1138
+ }),
1139
+ /**
1140
+ * @description This endpoint is used for updating a specific fee that has been issued.
1141
+ *
1142
+ * @tags fees
1143
+ * @name UpdateFee
1144
+ * @summary Update a fee
1145
+ * @request PUT:/fees/{lago_id}
1146
+ * @secure
1147
+ */
1148
+ updateFee: (lagoId, data, params = {}) => this.request({
1149
+ path: `/fees/${lagoId}`,
1150
+ method: "PUT",
1151
+ body: data,
1152
+ secure: true,
1153
+ type: ContentType.Json,
1154
+ format: "json",
1155
+ ...params,
1156
+ }),
1157
+ };
1158
+ invoices = {
1159
+ /**
1160
+ * @description This endpoint is used for issuing a one-off invoice.
1161
+ *
1162
+ * @tags invoices
1163
+ * @name CreateInvoice
1164
+ * @summary Create a one-off invoice
1165
+ * @request POST:/invoices
1166
+ * @secure
1167
+ */
1168
+ createInvoice: (data, params = {}) => this.request({
1169
+ path: `/invoices`,
1170
+ method: "POST",
1171
+ body: data,
1172
+ secure: true,
1173
+ type: ContentType.Json,
1174
+ format: "json",
1175
+ ...params,
1176
+ }),
1177
+ /**
1178
+ * @description This endpoint is used for retrievign all invoices.
1179
+ *
1180
+ * @tags invoices
1181
+ * @name FindAllInvoices
1182
+ * @summary List all invoices
1183
+ * @request GET:/invoices
1184
+ * @secure
1185
+ */
1186
+ findAllInvoices: (query, params = {}) => this.request({
1187
+ path: `/invoices`,
1188
+ method: "GET",
1189
+ query: query,
1190
+ secure: true,
1191
+ format: "json",
1192
+ ...params,
1193
+ }),
1194
+ /**
1195
+ * @description This endpoint is used for updating an existing invoice.
588
1196
  *
589
- * @tags customers
590
- * @name FindCustomerCurrentUsage
591
- * @summary Find customer current usage
592
- * @request GET:/customers/{customer_external_id}/current_usage
1197
+ * @tags invoices
1198
+ * @name UpdateInvoice
1199
+ * @summary Update an invoice
1200
+ * @request PUT:/invoices/{lago_id}
593
1201
  * @secure
594
1202
  */
595
- findCustomerCurrentUsage: (customerExternalId, query, params = {}) => this.request({
596
- path: `/customers/${customerExternalId}/current_usage`,
597
- method: "GET",
598
- query: query,
1203
+ updateInvoice: (lagoId, data, params = {}) => this.request({
1204
+ path: `/invoices/${lagoId}`,
1205
+ method: "PUT",
1206
+ body: data,
599
1207
  secure: true,
1208
+ type: ContentType.Json,
600
1209
  format: "json",
601
1210
  ...params,
602
1211
  }),
603
1212
  /**
604
- * @description Get customer portal URL
1213
+ * @description This endpoint is used for retrieving a specific invoice that has been issued.
605
1214
  *
606
- * @tags customers
607
- * @name GetCustomerPortalUrl
608
- * @summary Get customer portal URL
609
- * @request GET:/customers/{customer_external_id}/portal_url
1215
+ * @tags invoices
1216
+ * @name FindInvoice
1217
+ * @summary Retrieve an invoice
1218
+ * @request GET:/invoices/{lago_id}
610
1219
  * @secure
611
1220
  */
612
- getCustomerPortalUrl: (customerExternalId, params = {}) => this.request({
613
- path: `/customers/${customerExternalId}/portal_url`,
1221
+ findInvoice: (lagoId, params = {}) => this.request({
1222
+ path: `/invoices/${lagoId}`,
614
1223
  method: "GET",
615
1224
  secure: true,
616
1225
  format: "json",
617
1226
  ...params,
618
1227
  }),
619
1228
  /**
620
- * @description Delete customer's appplied coupon
1229
+ * @description This endpoint is used for downloading a specific invoice PDF document.
621
1230
  *
622
- * @tags customers
623
- * @name DeleteAppliedCoupon
624
- * @summary Delete customer's appplied coupon
625
- * @request DELETE:/customers/{customer_external_id}/applied_coupons/{applied_coupon_id}
1231
+ * @tags invoices
1232
+ * @name DownloadInvoice
1233
+ * @summary Download an invoice PDF
1234
+ * @request POST:/invoices/{lago_id}/download
626
1235
  * @secure
627
1236
  */
628
- deleteAppliedCoupon: (customerExternalId, appliedCouponId, params = {}) => this.request({
629
- path: `/customers/${customerExternalId}/applied_coupons/${appliedCouponId}`,
630
- method: "DELETE",
1237
+ downloadInvoice: (lagoId, params = {}) => this.request({
1238
+ path: `/invoices/${lagoId}/download`,
1239
+ method: "POST",
631
1240
  secure: true,
632
1241
  format: "json",
633
1242
  ...params,
634
1243
  }),
635
- };
636
- events = {
637
1244
  /**
638
- * @description Create a new event
1245
+ * @description This endpoint is used for finalizing a draft invoice.
639
1246
  *
640
- * @tags events
641
- * @name CreateEvent
642
- * @summary Create a new event
643
- * @request POST:/events
1247
+ * @tags invoices
1248
+ * @name FinalizeInvoice
1249
+ * @summary Finalize a draft invoice
1250
+ * @request PUT:/invoices/{lago_id}/finalize
644
1251
  * @secure
645
1252
  */
646
- createEvent: (data, params = {}) => this.request({
647
- path: `/events`,
648
- method: "POST",
649
- body: data,
1253
+ finalizeInvoice: (lagoId, params = {}) => this.request({
1254
+ path: `/invoices/${lagoId}/finalize`,
1255
+ method: "PUT",
650
1256
  secure: true,
651
- type: ContentType.Json,
1257
+ format: "json",
652
1258
  ...params,
653
1259
  }),
654
1260
  /**
655
- * @description Create batch events
1261
+ * @description This endpoint is used for refreshing a draft invoice.
656
1262
  *
657
- * @tags events
658
- * @name CreateBatchEvents
659
- * @summary Create batch events
660
- * @request POST:/events/batch
1263
+ * @tags invoices
1264
+ * @name RefreshInvoice
1265
+ * @summary Refresh a draft invoice
1266
+ * @request PUT:/invoices/{lago_id}/refresh
661
1267
  * @secure
662
1268
  */
663
- createBatchEvents: (data, params = {}) => this.request({
664
- path: `/events/batch`,
665
- method: "POST",
666
- body: data,
1269
+ refreshInvoice: (lagoId, params = {}) => this.request({
1270
+ path: `/invoices/${lagoId}/refresh`,
1271
+ method: "PUT",
667
1272
  secure: true,
668
- type: ContentType.Json,
1273
+ format: "json",
669
1274
  ...params,
670
1275
  }),
671
1276
  /**
672
- * @description Return a single event
1277
+ * @description This endpoint resends an invoice for collection and retry a payment.
673
1278
  *
674
- * @tags events
675
- * @name FindEvent
676
- * @summary Find event by transaction ID
677
- * @request GET:/events/{id}
1279
+ * @tags invoices
1280
+ * @name RetryPayment
1281
+ * @summary Retry an invoice payment
1282
+ * @request POST:/invoices/{lago_id}/retry_payment
678
1283
  * @secure
679
1284
  */
680
- findEvent: (id, params = {}) => this.request({
681
- path: `/events/${id}`,
682
- method: "GET",
1285
+ retryPayment: (lagoId, params = {}) => this.request({
1286
+ path: `/invoices/${lagoId}/retry_payment`,
1287
+ method: "POST",
683
1288
  secure: true,
684
- format: "json",
685
1289
  ...params,
686
1290
  }),
1291
+ };
1292
+ organizations = {
687
1293
  /**
688
- * @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple pay in advance charges
1294
+ * @description This endpoint is used to update your own organization's settings.
689
1295
  *
690
- * @tags events
691
- * @name EventEstimateFees
692
- * @summary Estimate fees for an pay in advance charge
693
- * @request POST:/events/estimate_fees
1296
+ * @tags organizations
1297
+ * @name UpdateOrganization
1298
+ * @summary Update your organization
1299
+ * @request PUT:/organizations
694
1300
  * @secure
695
1301
  */
696
- eventEstimateFees: (data, params = {}) => this.request({
697
- path: `/events/estimate_fees`,
698
- method: "POST",
1302
+ updateOrganization: (data, params = {}) => this.request({
1303
+ path: `/organizations`,
1304
+ method: "PUT",
699
1305
  body: data,
700
1306
  secure: true,
701
1307
  type: ContentType.Json,
@@ -705,11 +1311,11 @@ class Api extends HttpClient {
705
1311
  };
706
1312
  plans = {
707
1313
  /**
708
- * @description Create a new plan
1314
+ * @description This endpoint creates a plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.
709
1315
  *
710
1316
  * @tags plans
711
1317
  * @name CreatePlan
712
- * @summary Create a new plan
1318
+ * @summary Create a plan
713
1319
  * @request POST:/plans
714
1320
  * @secure
715
1321
  */
@@ -723,11 +1329,11 @@ class Api extends HttpClient {
723
1329
  ...params,
724
1330
  }),
725
1331
  /**
726
- * @description Find all plans in certain organisation
1332
+ * @description This endpoint retrieves all existing plans.
727
1333
  *
728
1334
  * @tags plans
729
1335
  * @name FindAllPlans
730
- * @summary Find plans
1336
+ * @summary List all plans
731
1337
  * @request GET:/plans
732
1338
  * @secure
733
1339
  */
@@ -740,11 +1346,11 @@ class Api extends HttpClient {
740
1346
  ...params,
741
1347
  }),
742
1348
  /**
743
- * @description Update an existing plan by code
1349
+ * @description This endpoint updates a specific plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.
744
1350
  *
745
1351
  * @tags plans
746
1352
  * @name UpdatePlan
747
- * @summary Update an existing plan
1353
+ * @summary Update a plan
748
1354
  * @request PUT:/plans/{code}
749
1355
  * @secure
750
1356
  */
@@ -758,11 +1364,11 @@ class Api extends HttpClient {
758
1364
  ...params,
759
1365
  }),
760
1366
  /**
761
- * @description Return a single plan
1367
+ * @description This endpoint retrieves a specific plan.
762
1368
  *
763
1369
  * @tags plans
764
1370
  * @name FindPlan
765
- * @summary Find plan by code
1371
+ * @summary Retrieve a plan
766
1372
  * @request GET:/plans/{code}
767
1373
  * @secure
768
1374
  */
@@ -774,7 +1380,7 @@ class Api extends HttpClient {
774
1380
  ...params,
775
1381
  }),
776
1382
  /**
777
- * @description Delete a plan
1383
+ * @description This endpoint deletes a specific plan. Note that this plan could be associated with active subscriptions.
778
1384
  *
779
1385
  * @tags plans
780
1386
  * @name DestroyPlan
@@ -792,7 +1398,7 @@ class Api extends HttpClient {
792
1398
  };
793
1399
  subscriptions = {
794
1400
  /**
795
- * @description Assign a plan to a customer
1401
+ * @description This endpoint assigns a plan to a customer, creating or modifying a subscription. Ideal for initial subscriptions or plan changes (upgrades/downgrades).
796
1402
  *
797
1403
  * @tags subscriptions
798
1404
  * @name CreateSubscription
@@ -810,11 +1416,11 @@ class Api extends HttpClient {
810
1416
  ...params,
811
1417
  }),
812
1418
  /**
813
- * @description Find all suscriptions for certain customer
1419
+ * @description This endpoint retrieves all active subscriptions.
814
1420
  *
815
1421
  * @tags subscriptions
816
1422
  * @name FindAllSubscriptions
817
- * @summary Find subscriptions
1423
+ * @summary List all subscriptions
818
1424
  * @request GET:/subscriptions
819
1425
  * @secure
820
1426
  */
@@ -827,11 +1433,11 @@ class Api extends HttpClient {
827
1433
  ...params,
828
1434
  }),
829
1435
  /**
830
- * @description Update an existing subscription by external ID
1436
+ * @description This endpoint allows you to update a subscription.
831
1437
  *
832
1438
  * @tags subscriptions
833
1439
  * @name UpdateSubscription
834
- * @summary Update an existing subscription
1440
+ * @summary Update a subscription
835
1441
  * @request PUT:/subscriptions/{external_id}
836
1442
  * @secure
837
1443
  */
@@ -845,7 +1451,7 @@ class Api extends HttpClient {
845
1451
  ...params,
846
1452
  }),
847
1453
  /**
848
- * @description Terminate a subscription
1454
+ * @description This endpoint allows you to terminate a subscription.
849
1455
  *
850
1456
  * @tags subscriptions
851
1457
  * @name DestroySubscription
@@ -861,35 +1467,18 @@ class Api extends HttpClient {
861
1467
  ...params,
862
1468
  }),
863
1469
  };
864
- webhooks = {
865
- /**
866
- * @description Webhook public key
867
- *
868
- * @tags webhooks
869
- * @name FetchPublicKey
870
- * @summary Fetch webhook public key
871
- * @request GET:/webhooks/public_key
872
- * @secure
873
- */
874
- fetchPublicKey: (params = {}) => this.request({
875
- path: `/webhooks/public_key`,
876
- method: "GET",
877
- secure: true,
878
- ...params,
879
- }),
880
- };
881
- invoices = {
1470
+ taxes = {
882
1471
  /**
883
- * @description Create a new one off Invoice
1472
+ * @description Create a tax
884
1473
  *
885
- * @tags invoices
886
- * @name CreateInvoice
887
- * @summary Create a new invoice
888
- * @request POST:/invoices
1474
+ * @tags taxes
1475
+ * @name CreateTax
1476
+ * @summary Create a tax
1477
+ * @request POST:/taxes
889
1478
  * @secure
890
1479
  */
891
- createInvoice: (data, params = {}) => this.request({
892
- path: `/invoices`,
1480
+ createTax: (data, params = {}) => this.request({
1481
+ path: `/taxes`,
893
1482
  method: "POST",
894
1483
  body: data,
895
1484
  secure: true,
@@ -898,16 +1487,16 @@ class Api extends HttpClient {
898
1487
  ...params,
899
1488
  }),
900
1489
  /**
901
- * @description Find all invoices in certain organisation
1490
+ * @description Find all taxes in certain organization
902
1491
  *
903
- * @tags invoices
904
- * @name FindAllInvoices
905
- * @summary Find all invoices
906
- * @request GET:/invoices
1492
+ * @tags taxes
1493
+ * @name FindAllTaxes
1494
+ * @summary Find taxes
1495
+ * @request GET:/taxes
907
1496
  * @secure
908
1497
  */
909
- findAllInvoices: (query, params = {}) => this.request({
910
- path: `/invoices`,
1498
+ findAllTaxes: (query, params = {}) => this.request({
1499
+ path: `/taxes`,
911
1500
  method: "GET",
912
1501
  query: query,
913
1502
  secure: true,
@@ -915,16 +1504,16 @@ class Api extends HttpClient {
915
1504
  ...params,
916
1505
  }),
917
1506
  /**
918
- * @description Update an existing invoice
1507
+ * @description Update an existing tax by code
919
1508
  *
920
- * @tags invoices
921
- * @name UpdateInvoice
922
- * @summary Update an existing invoice status
923
- * @request PUT:/invoices/{id}
1509
+ * @tags taxes
1510
+ * @name UpdateTax
1511
+ * @summary Update an existing tax
1512
+ * @request PUT:/taxes/{code}
924
1513
  * @secure
925
1514
  */
926
- updateInvoice: (id, data, params = {}) => this.request({
927
- path: `/invoices/${id}`,
1515
+ updateTax: (code, data, params = {}) => this.request({
1516
+ path: `/taxes/${code}`,
928
1517
  method: "PUT",
929
1518
  body: data,
930
1519
  secure: true,
@@ -933,133 +1522,33 @@ class Api extends HttpClient {
933
1522
  ...params,
934
1523
  }),
935
1524
  /**
936
- * @description Return a single invoice
937
- *
938
- * @tags invoices
939
- * @name FindInvoice
940
- * @summary Find invoice by ID
941
- * @request GET:/invoices/{id}
942
- * @secure
943
- */
944
- findInvoice: (id, params = {}) => this.request({
945
- path: `/invoices/${id}`,
946
- method: "GET",
947
- secure: true,
948
- format: "json",
949
- ...params,
950
- }),
951
- /**
952
- * @description Download an existing invoice
953
- *
954
- * @tags invoices
955
- * @name DownloadInvoice
956
- * @summary Download an existing invoice
957
- * @request POST:/invoices/{id}/download
958
- * @secure
959
- */
960
- downloadInvoice: (id, params = {}) => this.request({
961
- path: `/invoices/${id}/download`,
962
- method: "POST",
963
- secure: true,
964
- format: "json",
965
- ...params,
966
- }),
967
- /**
968
- * @description Retry invoice payment
969
- *
970
- * @tags invoices
971
- * @name RetryPayment
972
- * @summary Retry invoice payment
973
- * @request POST:/invoices/{id}/retry_payment
974
- * @secure
975
- */
976
- retryPayment: (id, params = {}) => this.request({
977
- path: `/invoices/${id}/retry_payment`,
978
- method: "POST",
979
- secure: true,
980
- ...params,
981
- }),
982
- /**
983
- * @description Refresh a draft invoice
984
- *
985
- * @tags invoices
986
- * @name RefreshInvoice
987
- * @summary Refresh a draft invoice
988
- * @request PUT:/invoices/{id}/refresh
989
- * @secure
990
- */
991
- refreshInvoice: (id, params = {}) => this.request({
992
- path: `/invoices/${id}/refresh`,
993
- method: "PUT",
994
- secure: true,
995
- format: "json",
996
- ...params,
997
- }),
998
- /**
999
- * @description Finalize a draft invoice
1000
- *
1001
- * @tags invoices
1002
- * @name FinalizeInvoice
1003
- * @summary Finalize a draft invoice
1004
- * @request PUT:/invoices/{id}/finalize
1005
- * @secure
1006
- */
1007
- finalizeInvoice: (id, params = {}) => this.request({
1008
- path: `/invoices/${id}/finalize`,
1009
- method: "PUT",
1010
- secure: true,
1011
- format: "json",
1012
- ...params,
1013
- }),
1014
- };
1015
- fees = {
1016
- /**
1017
- * @description Return a single fee
1525
+ * @description Return a single tax
1018
1526
  *
1019
- * @tags fees
1020
- * @name FindFee
1021
- * @summary Find fee by ID
1022
- * @request GET:/fees/{id}
1527
+ * @tags taxes
1528
+ * @name FindTax
1529
+ * @summary Find tax by code
1530
+ * @request GET:/taxes/{code}
1023
1531
  * @secure
1024
1532
  */
1025
- findFee: (id, params = {}) => this.request({
1026
- path: `/fees/${id}`,
1533
+ findTax: (code, params = {}) => this.request({
1534
+ path: `/taxes/${code}`,
1027
1535
  method: "GET",
1028
1536
  secure: true,
1029
1537
  format: "json",
1030
1538
  ...params,
1031
1539
  }),
1032
1540
  /**
1033
- * @description Update an existing fee
1034
- *
1035
- * @tags fees
1036
- * @name UpdateFee
1037
- * @summary Update an existing fee
1038
- * @request PUT:/fees/{id}
1039
- * @secure
1040
- */
1041
- updateFee: (id, data, params = {}) => this.request({
1042
- path: `/fees/${id}`,
1043
- method: "PUT",
1044
- body: data,
1045
- secure: true,
1046
- type: ContentType.Json,
1047
- format: "json",
1048
- ...params,
1049
- }),
1050
- /**
1051
- * @description Find all fees of an organization and filter them
1541
+ * @description Delete a tax
1052
1542
  *
1053
- * @tags fees
1054
- * @name FindAllFees
1055
- * @summary Find all fees
1056
- * @request GET:/fees
1543
+ * @tags taxes
1544
+ * @name DestroyTax
1545
+ * @summary Delete a tax
1546
+ * @request DELETE:/taxes/{code}
1057
1547
  * @secure
1058
1548
  */
1059
- findAllFees: (query, params = {}) => this.request({
1060
- path: `/fees`,
1061
- method: "GET",
1062
- query: query,
1549
+ destroyTax: (code, params = {}) => this.request({
1550
+ path: `/taxes/${code}`,
1551
+ method: "DELETE",
1063
1552
  secure: true,
1064
1553
  format: "json",
1065
1554
  ...params,
@@ -1067,11 +1556,11 @@ class Api extends HttpClient {
1067
1556
  };
1068
1557
  wallets = {
1069
1558
  /**
1070
- * @description Create a new wallet
1559
+ * @description This endpoint is used to create a wallet with prepaid credits.
1071
1560
  *
1072
1561
  * @tags wallets
1073
1562
  * @name CreateWallet
1074
- * @summary Create a new wallet
1563
+ * @summary Create a wallet
1075
1564
  * @request POST:/wallets
1076
1565
  * @secure
1077
1566
  */
@@ -1085,11 +1574,11 @@ class Api extends HttpClient {
1085
1574
  ...params,
1086
1575
  }),
1087
1576
  /**
1088
- * @description Find all wallets for certain customer
1577
+ * @description This endpoint is used to list all wallets with prepaid credits.
1089
1578
  *
1090
1579
  * @tags wallets
1091
1580
  * @name FindAllWallets
1092
- * @summary Find wallets
1581
+ * @summary List all wallets
1093
1582
  * @request GET:/wallets
1094
1583
  * @secure
1095
1584
  */
@@ -1102,16 +1591,16 @@ class Api extends HttpClient {
1102
1591
  ...params,
1103
1592
  }),
1104
1593
  /**
1105
- * @description Update an existing wallet
1594
+ * @description This endpoint is used to update an existing wallet with prepaid credits.
1106
1595
  *
1107
1596
  * @tags wallets
1108
1597
  * @name UpdateWallet
1109
- * @summary Update an existing wallet
1110
- * @request PUT:/wallets/{id}
1598
+ * @summary Update a wallet
1599
+ * @request PUT:/wallets/{lago_id}
1111
1600
  * @secure
1112
1601
  */
1113
- updateWallet: (id, data, params = {}) => this.request({
1114
- path: `/wallets/${id}`,
1602
+ updateWallet: (lagoId, data, params = {}) => this.request({
1603
+ path: `/wallets/${lagoId}`,
1115
1604
  method: "PUT",
1116
1605
  body: data,
1117
1606
  secure: true,
@@ -1120,48 +1609,48 @@ class Api extends HttpClient {
1120
1609
  ...params,
1121
1610
  }),
1122
1611
  /**
1123
- * @description Return a wallet
1612
+ * @description This endpoint is used to retrieve an existing wallet with prepaid credits.
1124
1613
  *
1125
1614
  * @tags wallets
1126
1615
  * @name FindWallet
1127
- * @summary Find wallet
1128
- * @request GET:/wallets/{id}
1616
+ * @summary Retrieve a wallet
1617
+ * @request GET:/wallets/{lago_id}
1129
1618
  * @secure
1130
1619
  */
1131
- findWallet: (id, params = {}) => this.request({
1132
- path: `/wallets/${id}`,
1620
+ findWallet: (lagoId, params = {}) => this.request({
1621
+ path: `/wallets/${lagoId}`,
1133
1622
  method: "GET",
1134
1623
  secure: true,
1135
1624
  format: "json",
1136
1625
  ...params,
1137
1626
  }),
1138
1627
  /**
1139
- * @description Delete a wallet
1628
+ * @description This endpoint is used to terminate an existing wallet with prepaid credits.
1140
1629
  *
1141
1630
  * @tags wallets
1142
1631
  * @name DestroyWallet
1143
- * @summary Delete a wallet
1144
- * @request DELETE:/wallets/{id}
1632
+ * @summary Terminate a wallet
1633
+ * @request DELETE:/wallets/{lago_id}
1145
1634
  * @secure
1146
1635
  */
1147
- destroyWallet: (id, params = {}) => this.request({
1148
- path: `/wallets/${id}`,
1636
+ destroyWallet: (lagoId, params = {}) => this.request({
1637
+ path: `/wallets/${lagoId}`,
1149
1638
  method: "DELETE",
1150
1639
  secure: true,
1151
1640
  format: "json",
1152
1641
  ...params,
1153
1642
  }),
1154
1643
  /**
1155
- * @description Find all wallet transactions for certain wallet
1644
+ * @description This endpoint is used to list all wallet transactions.
1156
1645
  *
1157
1646
  * @tags wallets
1158
1647
  * @name FindAllWalletTransactions
1159
- * @summary Find wallet transactions
1160
- * @request GET:/wallets/{id}/wallet_transactions
1648
+ * @summary List all wallet transactions
1649
+ * @request GET:/wallets/{lago_id}/wallet_transactions
1161
1650
  * @secure
1162
1651
  */
1163
- findAllWalletTransactions: (id, query, params = {}) => this.request({
1164
- path: `/wallets/${id}/wallet_transactions`,
1652
+ findAllWalletTransactions: (lagoId, query, params = {}) => this.request({
1653
+ path: `/wallets/${lagoId}/wallet_transactions`,
1165
1654
  method: "GET",
1166
1655
  query: query,
1167
1656
  secure: true,
@@ -1171,11 +1660,11 @@ class Api extends HttpClient {
1171
1660
  };
1172
1661
  walletTransactions = {
1173
1662
  /**
1174
- * @description Create a new wallet transaction
1663
+ * @description This endpoint is used to top-up an active wallet.
1175
1664
  *
1176
1665
  * @tags wallets
1177
1666
  * @name CreateWalletTransaction
1178
- * @summary Create a new wallet transaction
1667
+ * @summary Top up a wallet
1179
1668
  * @request POST:/wallet_transactions
1180
1669
  * @secure
1181
1670
  */
@@ -1189,106 +1678,20 @@ class Api extends HttpClient {
1189
1678
  ...params,
1190
1679
  }),
1191
1680
  };
1192
- creditNotes = {
1193
- /**
1194
- * @description Create a new credit note
1195
- *
1196
- * @tags credit_notes
1197
- * @name CreateCreditNote
1198
- * @summary Create a new Credit note
1199
- * @request POST:/credit_notes
1200
- * @secure
1201
- */
1202
- createCreditNote: (data, params = {}) => this.request({
1203
- path: `/credit_notes`,
1204
- method: "POST",
1205
- body: data,
1206
- secure: true,
1207
- type: ContentType.Json,
1208
- format: "json",
1209
- ...params,
1210
- }),
1211
- /**
1212
- * @description Find all credit notes in certain organisation
1213
- *
1214
- * @tags credit_notes
1215
- * @name FindAllCreditNotes
1216
- * @summary Find Credit notes
1217
- * @request GET:/credit_notes
1218
- * @secure
1219
- */
1220
- findAllCreditNotes: (query, params = {}) => this.request({
1221
- path: `/credit_notes`,
1222
- method: "GET",
1223
- query: query,
1224
- secure: true,
1225
- format: "json",
1226
- ...params,
1227
- }),
1228
- /**
1229
- * @description Update an existing credit note
1230
- *
1231
- * @tags credit_notes
1232
- * @name UpdateCreditNote
1233
- * @summary Update an existing credit note
1234
- * @request PUT:/credit_notes/{id}
1235
- * @secure
1236
- */
1237
- updateCreditNote: (id, data, params = {}) => this.request({
1238
- path: `/credit_notes/${id}`,
1239
- method: "PUT",
1240
- body: data,
1241
- secure: true,
1242
- type: ContentType.Json,
1243
- format: "json",
1244
- ...params,
1245
- }),
1681
+ webhooks = {
1246
1682
  /**
1247
- * @description Return a single credit note
1683
+ * @description This endpoint is used to retrieve the public key used to verify the webhooks signature
1248
1684
  *
1249
- * @tags credit_notes
1250
- * @name FindCreditNote
1251
- * @summary Find credit note
1252
- * @request GET:/credit_notes/{id}
1685
+ * @tags webhooks
1686
+ * @name FetchPublicKey
1687
+ * @summary Retrieve webhook public key
1688
+ * @request GET:/webhooks/public_key
1253
1689
  * @secure
1254
1690
  */
1255
- findCreditNote: (id, params = {}) => this.request({
1256
- path: `/credit_notes/${id}`,
1691
+ fetchPublicKey: (params = {}) => this.request({
1692
+ path: `/webhooks/public_key`,
1257
1693
  method: "GET",
1258
1694
  secure: true,
1259
- format: "json",
1260
- ...params,
1261
- }),
1262
- /**
1263
- * @description Download an existing credit note
1264
- *
1265
- * @tags credit_notes
1266
- * @name DownloadCreditNote
1267
- * @summary Download an existing credit note
1268
- * @request POST:/credit_notes/{id}/download
1269
- * @secure
1270
- */
1271
- downloadCreditNote: (id, params = {}) => this.request({
1272
- path: `/credit_notes/${id}/download`,
1273
- method: "POST",
1274
- secure: true,
1275
- format: "json",
1276
- ...params,
1277
- }),
1278
- /**
1279
- * @description Void an existing credit note
1280
- *
1281
- * @tags credit_notes
1282
- * @name VoidCreditNote
1283
- * @summary Void existing credit note
1284
- * @request PUT:/credit_notes/{id}/void
1285
- * @secure
1286
- */
1287
- voidCreditNote: (id, params = {}) => this.request({
1288
- path: `/credit_notes/${id}/void`,
1289
- method: "PUT",
1290
- secure: true,
1291
- format: "json",
1292
1695
  ...params,
1293
1696
  }),
1294
1697
  };