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.
- package/esm/openapi/client.js +888 -485
- package/package.json +1 -1
- package/script/openapi/client.js +889 -486
- package/types/openapi/client.d.ts +3546 -1719
package/script/openapi/client.js
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
444
|
+
addOns = {
|
|
164
445
|
/**
|
|
165
|
-
* @description
|
|
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
|
|
168
|
-
* @name
|
|
169
|
-
* @summary Create
|
|
170
|
-
* @request POST:/
|
|
448
|
+
* @tags add_ons
|
|
449
|
+
* @name CreateAddOn
|
|
450
|
+
* @summary Create an add-on
|
|
451
|
+
* @request POST:/add_ons
|
|
171
452
|
* @secure
|
|
172
453
|
*/
|
|
173
|
-
|
|
174
|
-
path: `/
|
|
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
|
|
464
|
+
* @description This endpoint is used to list all existing add-ons.
|
|
184
465
|
*
|
|
185
|
-
* @tags
|
|
186
|
-
* @name
|
|
187
|
-
* @summary
|
|
188
|
-
* @request GET:/
|
|
466
|
+
* @tags add_ons
|
|
467
|
+
* @name FindAllAddOns
|
|
468
|
+
* @summary List all add-ons
|
|
469
|
+
* @request GET:/add_ons
|
|
189
470
|
* @secure
|
|
190
471
|
*/
|
|
191
|
-
|
|
192
|
-
path: `/
|
|
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
|
|
481
|
+
* @description This endpoint is used to update an existing add-on.
|
|
201
482
|
*
|
|
202
|
-
* @tags
|
|
203
|
-
* @name
|
|
204
|
-
* @summary Update an
|
|
205
|
-
* @request PUT:/
|
|
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
|
-
|
|
209
|
-
path: `/
|
|
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
|
|
499
|
+
* @description This endpoint is used to retrieve a specific add-on.
|
|
219
500
|
*
|
|
220
|
-
* @tags
|
|
221
|
-
* @name
|
|
222
|
-
* @summary
|
|
223
|
-
* @request GET:/
|
|
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
|
-
|
|
227
|
-
path: `/
|
|
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
|
|
515
|
+
* @description This endpoint is used to delete an existing add-on.
|
|
235
516
|
*
|
|
236
|
-
* @tags
|
|
237
|
-
* @name
|
|
238
|
-
* @summary Delete
|
|
239
|
-
* @request DELETE:/
|
|
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
|
-
|
|
243
|
-
path: `/
|
|
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
|
|
533
|
+
* @description Apply an add-on to a customer
|
|
251
534
|
*
|
|
252
|
-
* @tags
|
|
253
|
-
* @name
|
|
254
|
-
* @summary
|
|
255
|
-
* @request
|
|
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
|
-
|
|
259
|
-
path: `/
|
|
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
|
-
|
|
589
|
+
billableMetrics = {
|
|
268
590
|
/**
|
|
269
|
-
* @description
|
|
591
|
+
* @description This endpoint creates a new billable metric representing a pricing component of your application.
|
|
270
592
|
*
|
|
271
|
-
* @tags
|
|
272
|
-
* @name
|
|
273
|
-
* @summary Create a
|
|
274
|
-
* @request POST:/
|
|
593
|
+
* @tags billable_metrics
|
|
594
|
+
* @name CreateBillableMetric
|
|
595
|
+
* @summary Create a billable metric
|
|
596
|
+
* @request POST:/billable_metrics
|
|
275
597
|
* @secure
|
|
276
598
|
*/
|
|
277
|
-
|
|
278
|
-
path: `/
|
|
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
|
|
609
|
+
* @description This endpoint retrieves all existing billable metrics that represent pricing components of your application.
|
|
288
610
|
*
|
|
289
|
-
* @tags
|
|
290
|
-
* @name
|
|
291
|
-
* @summary
|
|
292
|
-
* @request GET:/
|
|
611
|
+
* @tags billable_metrics
|
|
612
|
+
* @name FindAllBillableMetrics
|
|
613
|
+
* @summary List all billable metrics
|
|
614
|
+
* @request GET:/billable_metrics
|
|
293
615
|
* @secure
|
|
294
616
|
*/
|
|
295
|
-
|
|
296
|
-
path: `/
|
|
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
|
|
626
|
+
* @description This endpoint updates an existing billable metric representing a pricing component of your application.
|
|
305
627
|
*
|
|
306
|
-
* @tags
|
|
307
|
-
* @name
|
|
308
|
-
* @summary Update
|
|
309
|
-
* @request PUT:/
|
|
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
|
-
|
|
313
|
-
path: `/
|
|
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
|
|
644
|
+
* @description This endpoint deletes an existing billable metric representing a pricing component of your application.
|
|
323
645
|
*
|
|
324
|
-
* @tags
|
|
325
|
-
* @name
|
|
326
|
-
* @summary
|
|
327
|
-
* @request
|
|
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
|
-
|
|
331
|
-
path: `/
|
|
332
|
-
method: "
|
|
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
|
|
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
|
|
341
|
-
* @name
|
|
342
|
-
* @summary
|
|
343
|
-
* @request
|
|
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
|
-
|
|
347
|
-
path: `/
|
|
348
|
-
method: "
|
|
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
|
|
676
|
+
* @description This endpoint retrieves all groups for a billable metric.
|
|
357
677
|
*
|
|
358
|
-
* @tags
|
|
359
|
-
* @name
|
|
360
|
-
* @summary
|
|
361
|
-
* @request
|
|
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
|
-
|
|
365
|
-
path: `/
|
|
366
|
-
method: "
|
|
367
|
-
|
|
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
|
|
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
|
|
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
|
|
713
|
+
* @description This endpoint is used to list all existing coupons.
|
|
395
714
|
*
|
|
396
715
|
* @tags coupons
|
|
397
716
|
* @name FindAllCoupons
|
|
398
|
-
* @summary
|
|
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
|
|
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
|
|
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
|
|
748
|
+
* @description This endpoint is used to retrieve a specific coupon.
|
|
430
749
|
*
|
|
431
750
|
* @tags coupons
|
|
432
751
|
* @name FindCoupon
|
|
433
|
-
* @summary
|
|
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
|
|
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
|
-
|
|
780
|
+
creditNotes = {
|
|
462
781
|
/**
|
|
463
|
-
* @description
|
|
782
|
+
* @description This endpoint creates a new credit note.
|
|
464
783
|
*
|
|
465
|
-
* @tags
|
|
466
|
-
* @name
|
|
467
|
-
* @summary
|
|
468
|
-
* @request POST:/
|
|
784
|
+
* @tags credit_notes
|
|
785
|
+
* @name CreateCreditNote
|
|
786
|
+
* @summary Create a credit note
|
|
787
|
+
* @request POST:/credit_notes
|
|
469
788
|
* @secure
|
|
470
789
|
*/
|
|
471
|
-
|
|
472
|
-
path: `/
|
|
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
|
|
800
|
+
* @description This endpoint list all existing credit notes.
|
|
482
801
|
*
|
|
483
|
-
* @tags
|
|
484
|
-
* @name
|
|
485
|
-
* @summary
|
|
486
|
-
* @request GET:/
|
|
802
|
+
* @tags credit_notes
|
|
803
|
+
* @name FindAllCreditNotes
|
|
804
|
+
* @summary List all credit notes
|
|
805
|
+
* @request GET:/credit_notes
|
|
487
806
|
* @secure
|
|
488
807
|
*/
|
|
489
|
-
|
|
490
|
-
path: `/
|
|
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
|
|
817
|
+
* @description This endpoint updates an existing credit note.
|
|
501
818
|
*
|
|
502
|
-
* @tags
|
|
503
|
-
* @name
|
|
504
|
-
* @summary Update
|
|
505
|
-
* @request PUT:/
|
|
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
|
-
|
|
509
|
-
path: `/
|
|
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
|
|
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
|
|
903
|
+
* @description This endpoint retrieves all existing customers.
|
|
539
904
|
*
|
|
540
905
|
* @tags customers
|
|
541
906
|
* @name FindAllCustomers
|
|
542
|
-
* @summary
|
|
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
|
|
920
|
+
* @description This endpoint retrieves an existing customer.
|
|
556
921
|
*
|
|
557
922
|
* @tags customers
|
|
558
923
|
* @name FindCustomer
|
|
559
|
-
* @summary
|
|
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
|
|
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
|
|
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
|
|
590
|
-
* @name
|
|
591
|
-
* @summary
|
|
592
|
-
* @request
|
|
1197
|
+
* @tags invoices
|
|
1198
|
+
* @name UpdateInvoice
|
|
1199
|
+
* @summary Update an invoice
|
|
1200
|
+
* @request PUT:/invoices/{lago_id}
|
|
593
1201
|
* @secure
|
|
594
1202
|
*/
|
|
595
|
-
|
|
596
|
-
path: `/
|
|
597
|
-
method: "
|
|
598
|
-
|
|
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
|
|
1213
|
+
* @description This endpoint is used for retrieving a specific invoice that has been issued.
|
|
605
1214
|
*
|
|
606
|
-
* @tags
|
|
607
|
-
* @name
|
|
608
|
-
* @summary
|
|
609
|
-
* @request GET:/
|
|
1215
|
+
* @tags invoices
|
|
1216
|
+
* @name FindInvoice
|
|
1217
|
+
* @summary Retrieve an invoice
|
|
1218
|
+
* @request GET:/invoices/{lago_id}
|
|
610
1219
|
* @secure
|
|
611
1220
|
*/
|
|
612
|
-
|
|
613
|
-
path: `/
|
|
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
|
|
1229
|
+
* @description This endpoint is used for downloading a specific invoice PDF document.
|
|
621
1230
|
*
|
|
622
|
-
* @tags
|
|
623
|
-
* @name
|
|
624
|
-
* @summary
|
|
625
|
-
* @request
|
|
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
|
-
|
|
629
|
-
path: `/
|
|
630
|
-
method: "
|
|
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
|
|
1245
|
+
* @description This endpoint is used for finalizing a draft invoice.
|
|
639
1246
|
*
|
|
640
|
-
* @tags
|
|
641
|
-
* @name
|
|
642
|
-
* @summary
|
|
643
|
-
* @request
|
|
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
|
-
|
|
647
|
-
path: `/
|
|
648
|
-
method: "
|
|
649
|
-
body: data,
|
|
1253
|
+
finalizeInvoice: (lagoId, params = {}) => this.request({
|
|
1254
|
+
path: `/invoices/${lagoId}/finalize`,
|
|
1255
|
+
method: "PUT",
|
|
650
1256
|
secure: true,
|
|
651
|
-
|
|
1257
|
+
format: "json",
|
|
652
1258
|
...params,
|
|
653
1259
|
}),
|
|
654
1260
|
/**
|
|
655
|
-
* @description
|
|
1261
|
+
* @description This endpoint is used for refreshing a draft invoice.
|
|
656
1262
|
*
|
|
657
|
-
* @tags
|
|
658
|
-
* @name
|
|
659
|
-
* @summary
|
|
660
|
-
* @request
|
|
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
|
-
|
|
664
|
-
path: `/
|
|
665
|
-
method: "
|
|
666
|
-
body: data,
|
|
1269
|
+
refreshInvoice: (lagoId, params = {}) => this.request({
|
|
1270
|
+
path: `/invoices/${lagoId}/refresh`,
|
|
1271
|
+
method: "PUT",
|
|
667
1272
|
secure: true,
|
|
668
|
-
|
|
1273
|
+
format: "json",
|
|
669
1274
|
...params,
|
|
670
1275
|
}),
|
|
671
1276
|
/**
|
|
672
|
-
* @description
|
|
1277
|
+
* @description This endpoint resends an invoice for collection and retry a payment.
|
|
673
1278
|
*
|
|
674
|
-
* @tags
|
|
675
|
-
* @name
|
|
676
|
-
* @summary
|
|
677
|
-
* @request
|
|
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
|
-
|
|
681
|
-
path: `/
|
|
682
|
-
method: "
|
|
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
|
|
1294
|
+
* @description This endpoint is used to update your own organization's settings.
|
|
689
1295
|
*
|
|
690
|
-
* @tags
|
|
691
|
-
* @name
|
|
692
|
-
* @summary
|
|
693
|
-
* @request
|
|
1296
|
+
* @tags organizations
|
|
1297
|
+
* @name UpdateOrganization
|
|
1298
|
+
* @summary Update your organization
|
|
1299
|
+
* @request PUT:/organizations
|
|
694
1300
|
* @secure
|
|
695
1301
|
*/
|
|
696
|
-
|
|
697
|
-
path: `/
|
|
698
|
-
method: "
|
|
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
|
|
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
|
|
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
|
|
1332
|
+
* @description This endpoint retrieves all existing plans.
|
|
727
1333
|
*
|
|
728
1334
|
* @tags plans
|
|
729
1335
|
* @name FindAllPlans
|
|
730
|
-
* @summary
|
|
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
|
|
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
|
|
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
|
|
1367
|
+
* @description This endpoint retrieves a specific plan.
|
|
762
1368
|
*
|
|
763
1369
|
* @tags plans
|
|
764
1370
|
* @name FindPlan
|
|
765
|
-
* @summary
|
|
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
|
|
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
|
|
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
|
|
1419
|
+
* @description This endpoint retrieves all active subscriptions.
|
|
814
1420
|
*
|
|
815
1421
|
* @tags subscriptions
|
|
816
1422
|
* @name FindAllSubscriptions
|
|
817
|
-
* @summary
|
|
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
|
|
1436
|
+
* @description This endpoint allows you to update a subscription.
|
|
831
1437
|
*
|
|
832
1438
|
* @tags subscriptions
|
|
833
1439
|
* @name UpdateSubscription
|
|
834
|
-
* @summary Update
|
|
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
|
|
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
|
-
|
|
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
|
|
1472
|
+
* @description Create a tax
|
|
884
1473
|
*
|
|
885
|
-
* @tags
|
|
886
|
-
* @name
|
|
887
|
-
* @summary Create a
|
|
888
|
-
* @request POST:/
|
|
1474
|
+
* @tags taxes
|
|
1475
|
+
* @name CreateTax
|
|
1476
|
+
* @summary Create a tax
|
|
1477
|
+
* @request POST:/taxes
|
|
889
1478
|
* @secure
|
|
890
1479
|
*/
|
|
891
|
-
|
|
892
|
-
path: `/
|
|
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
|
|
1490
|
+
* @description Find all taxes in certain organization
|
|
902
1491
|
*
|
|
903
|
-
* @tags
|
|
904
|
-
* @name
|
|
905
|
-
* @summary Find
|
|
906
|
-
* @request GET:/
|
|
1492
|
+
* @tags taxes
|
|
1493
|
+
* @name FindAllTaxes
|
|
1494
|
+
* @summary Find taxes
|
|
1495
|
+
* @request GET:/taxes
|
|
907
1496
|
* @secure
|
|
908
1497
|
*/
|
|
909
|
-
|
|
910
|
-
path: `/
|
|
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
|
|
1507
|
+
* @description Update an existing tax by code
|
|
919
1508
|
*
|
|
920
|
-
* @tags
|
|
921
|
-
* @name
|
|
922
|
-
* @summary Update an existing
|
|
923
|
-
* @request PUT:/
|
|
1509
|
+
* @tags taxes
|
|
1510
|
+
* @name UpdateTax
|
|
1511
|
+
* @summary Update an existing tax
|
|
1512
|
+
* @request PUT:/taxes/{code}
|
|
924
1513
|
* @secure
|
|
925
1514
|
*/
|
|
926
|
-
|
|
927
|
-
path: `/
|
|
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
|
|
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
|
|
1020
|
-
* @name
|
|
1021
|
-
* @summary Find
|
|
1022
|
-
* @request GET:/
|
|
1527
|
+
* @tags taxes
|
|
1528
|
+
* @name FindTax
|
|
1529
|
+
* @summary Find tax by code
|
|
1530
|
+
* @request GET:/taxes/{code}
|
|
1023
1531
|
* @secure
|
|
1024
1532
|
*/
|
|
1025
|
-
|
|
1026
|
-
path: `/
|
|
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
|
|
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
|
|
1054
|
-
* @name
|
|
1055
|
-
* @summary
|
|
1056
|
-
* @request
|
|
1543
|
+
* @tags taxes
|
|
1544
|
+
* @name DestroyTax
|
|
1545
|
+
* @summary Delete a tax
|
|
1546
|
+
* @request DELETE:/taxes/{code}
|
|
1057
1547
|
* @secure
|
|
1058
1548
|
*/
|
|
1059
|
-
|
|
1060
|
-
path: `/
|
|
1061
|
-
method: "
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1110
|
-
* @request PUT:/wallets/{
|
|
1598
|
+
* @summary Update a wallet
|
|
1599
|
+
* @request PUT:/wallets/{lago_id}
|
|
1111
1600
|
* @secure
|
|
1112
1601
|
*/
|
|
1113
|
-
updateWallet: (
|
|
1114
|
-
path: `/wallets/${
|
|
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
|
|
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
|
|
1128
|
-
* @request GET:/wallets/{
|
|
1616
|
+
* @summary Retrieve a wallet
|
|
1617
|
+
* @request GET:/wallets/{lago_id}
|
|
1129
1618
|
* @secure
|
|
1130
1619
|
*/
|
|
1131
|
-
findWallet: (
|
|
1132
|
-
path: `/wallets/${
|
|
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
|
|
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
|
|
1144
|
-
* @request DELETE:/wallets/{
|
|
1632
|
+
* @summary Terminate a wallet
|
|
1633
|
+
* @request DELETE:/wallets/{lago_id}
|
|
1145
1634
|
* @secure
|
|
1146
1635
|
*/
|
|
1147
|
-
destroyWallet: (
|
|
1148
|
-
path: `/wallets/${
|
|
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
|
|
1644
|
+
* @description This endpoint is used to list all wallet transactions.
|
|
1156
1645
|
*
|
|
1157
1646
|
* @tags wallets
|
|
1158
1647
|
* @name FindAllWalletTransactions
|
|
1159
|
-
* @summary
|
|
1160
|
-
* @request GET:/wallets/{
|
|
1648
|
+
* @summary List all wallet transactions
|
|
1649
|
+
* @request GET:/wallets/{lago_id}/wallet_transactions
|
|
1161
1650
|
* @secure
|
|
1162
1651
|
*/
|
|
1163
|
-
findAllWalletTransactions: (
|
|
1164
|
-
path: `/wallets/${
|
|
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
|
|
1663
|
+
* @description This endpoint is used to top-up an active wallet.
|
|
1175
1664
|
*
|
|
1176
1665
|
* @tags wallets
|
|
1177
1666
|
* @name CreateWalletTransaction
|
|
1178
|
-
* @summary
|
|
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
|
-
|
|
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
|
|
1683
|
+
* @description This endpoint is used to retrieve the public key used to verify the webhooks signature
|
|
1248
1684
|
*
|
|
1249
|
-
* @tags
|
|
1250
|
-
* @name
|
|
1251
|
-
* @summary
|
|
1252
|
-
* @request GET:/
|
|
1685
|
+
* @tags webhooks
|
|
1686
|
+
* @name FetchPublicKey
|
|
1687
|
+
* @summary Retrieve webhook public key
|
|
1688
|
+
* @request GET:/webhooks/public_key
|
|
1253
1689
|
* @secure
|
|
1254
1690
|
*/
|
|
1255
|
-
|
|
1256
|
-
path: `/
|
|
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
|
};
|