lago-javascript-client 1.20.0 → 1.26.0

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.
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 1.20.0
155
+ * @version 1.26.0
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://api.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -161,6 +161,40 @@ exports.HttpClient = HttpClient;
161
161
  * Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
162
162
  */
163
163
  class Api extends HttpClient {
164
+ billingEntities = {
165
+ /**
166
+ * @description This endpoint returns a list of all billing entities in the organization
167
+ *
168
+ * @tags billing_entities
169
+ * @name ListBillingEntities
170
+ * @summary List all billing entities
171
+ * @request GET:/billing_entities
172
+ * @secure
173
+ */
174
+ listBillingEntities: (params = {}) => this.request({
175
+ path: `/billing_entities`,
176
+ method: "GET",
177
+ secure: true,
178
+ format: "json",
179
+ ...params,
180
+ }),
181
+ /**
182
+ * @description This endpoint returns a specific billing entity by its code
183
+ *
184
+ * @tags billing_entities
185
+ * @name GetBillingEntity
186
+ * @summary Retrieve a billing entity
187
+ * @request GET:/billing_entities/{code}
188
+ * @secure
189
+ */
190
+ getBillingEntity: (code, params = {}) => this.request({
191
+ path: `/billing_entities/${code}`,
192
+ method: "GET",
193
+ secure: true,
194
+ format: "json",
195
+ ...params,
196
+ }),
197
+ };
164
198
  addOns = {
165
199
  /**
166
200
  * @description This endpoint is used to create an add-on that can be then attached to a one-off invoice.
@@ -727,11 +761,11 @@ class Api extends HttpClient {
727
761
  * @tags customers
728
762
  * @name FindCustomer
729
763
  * @summary Retrieve a customer
730
- * @request GET:/customers/{external_id}
764
+ * @request GET:/customers/{external_customer_id}
731
765
  * @secure
732
766
  */
733
- findCustomer: (externalId, params = {}) => this.request({
734
- path: `/customers/${externalId}`,
767
+ findCustomer: (externalCustomerId, params = {}) => this.request({
768
+ path: `/customers/${externalCustomerId}`,
735
769
  method: "GET",
736
770
  secure: true,
737
771
  format: "json",
@@ -743,11 +777,11 @@ class Api extends HttpClient {
743
777
  * @tags customers
744
778
  * @name DestroyCustomer
745
779
  * @summary Delete a customer
746
- * @request DELETE:/customers/{external_id}
780
+ * @request DELETE:/customers/{external_customer_id}
747
781
  * @secure
748
782
  */
749
- destroyCustomer: (externalId, params = {}) => this.request({
750
- path: `/customers/${externalId}`,
783
+ destroyCustomer: (externalCustomerId, params = {}) => this.request({
784
+ path: `/customers/${externalCustomerId}`,
751
785
  method: "DELETE",
752
786
  secure: true,
753
787
  format: "json",
@@ -1159,6 +1193,24 @@ class Api extends HttpClient {
1159
1193
  format: "json",
1160
1194
  ...params,
1161
1195
  }),
1196
+ /**
1197
+ * @description This endpoint is used for generating invoice preview.
1198
+ *
1199
+ * @tags invoices
1200
+ * @name InvoicePreview
1201
+ * @summary Create an invoice preview
1202
+ * @request POST:/invoices/preview
1203
+ * @secure
1204
+ */
1205
+ invoicePreview: (data, params = {}) => this.request({
1206
+ path: `/invoices/preview`,
1207
+ method: "POST",
1208
+ body: data,
1209
+ secure: true,
1210
+ type: ContentType.Json,
1211
+ format: "json",
1212
+ ...params,
1213
+ }),
1162
1214
  /**
1163
1215
  * @description This endpoint resends an invoice for collection and retry a payment.
1164
1216
  *
@@ -1211,6 +1263,41 @@ class Api extends HttpClient {
1211
1263
  ...params,
1212
1264
  }),
1213
1265
  };
1266
+ paymentReceipts = {
1267
+ /**
1268
+ * @description This endpoint is used to list all existing payment receipts.
1269
+ *
1270
+ * @tags payment_receipts
1271
+ * @name FindAllPaymentReceipts
1272
+ * @summary List all payment receipts
1273
+ * @request GET:/payment_receipts
1274
+ * @secure
1275
+ */
1276
+ findAllPaymentReceipts: (query, params = {}) => this.request({
1277
+ path: `/payment_receipts`,
1278
+ method: "GET",
1279
+ query: query,
1280
+ secure: true,
1281
+ format: "json",
1282
+ ...params,
1283
+ }),
1284
+ /**
1285
+ * @description This endpoint retrieves a specific payment receipt.
1286
+ *
1287
+ * @tags payment_receipts
1288
+ * @name FindPaymentReceipt
1289
+ * @summary Retrieve a payment receipt
1290
+ * @request GET:/payment_receipts/{lago_id}
1291
+ * @secure
1292
+ */
1293
+ findPaymentReceipt: (lagoId, params = {}) => this.request({
1294
+ path: `/payment_receipts/${lagoId}`,
1295
+ method: "GET",
1296
+ secure: true,
1297
+ format: "json",
1298
+ ...params,
1299
+ }),
1300
+ };
1214
1301
  paymentRequests = {
1215
1302
  /**
1216
1303
  * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
@@ -1248,6 +1335,59 @@ class Api extends HttpClient {
1248
1335
  ...params,
1249
1336
  }),
1250
1337
  };
1338
+ payments = {
1339
+ /**
1340
+ * @description This endpoint is used to create a manual payment
1341
+ *
1342
+ * @tags payments
1343
+ * @name CreatePayment
1344
+ * @summary Create a payment
1345
+ * @request POST:/payments
1346
+ * @secure
1347
+ */
1348
+ createPayment: (data, params = {}) => this.request({
1349
+ path: `/payments`,
1350
+ method: "POST",
1351
+ body: data,
1352
+ secure: true,
1353
+ type: ContentType.Json,
1354
+ format: "json",
1355
+ ...params,
1356
+ }),
1357
+ /**
1358
+ * @description This endpoint is used to list all payments
1359
+ *
1360
+ * @tags payments
1361
+ * @name FindAllPayments
1362
+ * @summary List all payments
1363
+ * @request GET:/payments
1364
+ * @secure
1365
+ */
1366
+ findAllPayments: (query, params = {}) => this.request({
1367
+ path: `/payments`,
1368
+ method: "GET",
1369
+ query: query,
1370
+ secure: true,
1371
+ format: "json",
1372
+ ...params,
1373
+ }),
1374
+ /**
1375
+ * @description This endpoint retrieves a specific payment by its ID.
1376
+ *
1377
+ * @tags payments
1378
+ * @name FindPayment
1379
+ * @summary Retrieve a payment
1380
+ * @request GET:/payments/{lago_id}
1381
+ * @secure
1382
+ */
1383
+ findPayment: (lagoId, params = {}) => this.request({
1384
+ path: `/payments/${lagoId}`,
1385
+ method: "GET",
1386
+ secure: true,
1387
+ format: "json",
1388
+ ...params,
1389
+ }),
1390
+ };
1251
1391
  plans = {
1252
1392
  /**
1253
1393
  * @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.
@@ -1667,6 +1807,38 @@ class Api extends HttpClient {
1667
1807
  format: "json",
1668
1808
  ...params,
1669
1809
  }),
1810
+ /**
1811
+ * @description This endpoint is used to retrieve a specific wallet transactions.
1812
+ *
1813
+ * @tags wallets
1814
+ * @name FindWalletTransaction
1815
+ * @summary Retrieve a wallet transaction
1816
+ * @request GET:/wallet_transactions/{lago_id}
1817
+ * @secure
1818
+ */
1819
+ findWalletTransaction: (lagoId, params = {}) => this.request({
1820
+ path: `/wallet_transactions/${lagoId}`,
1821
+ method: "GET",
1822
+ secure: true,
1823
+ format: "json",
1824
+ ...params,
1825
+ }),
1826
+ /**
1827
+ * @description This endpoint generates a checkout link for a specific wallet transaction.
1828
+ *
1829
+ * @tags wallets
1830
+ * @name WalletTransactionPaymentUrl
1831
+ * @summary Generate a payment URL
1832
+ * @request POST:/wallet_transactions/{lago_id}/payment_url
1833
+ * @secure
1834
+ */
1835
+ walletTransactionPaymentUrl: (lagoId, params = {}) => this.request({
1836
+ path: `/wallet_transactions/${lagoId}/payment_url`,
1837
+ method: "POST",
1838
+ secure: true,
1839
+ format: "json",
1840
+ ...params,
1841
+ }),
1670
1842
  };
1671
1843
  webhooks = {
1672
1844
  /**