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.
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 1.20.0
151
+ * @version 1.26.0
152
152
  * @license AGPLv3
153
153
  * @baseUrl https://api.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
@@ -157,6 +157,40 @@ export class HttpClient {
157
157
  * Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
158
158
  */
159
159
  export class Api extends HttpClient {
160
+ billingEntities = {
161
+ /**
162
+ * @description This endpoint returns a list of all billing entities in the organization
163
+ *
164
+ * @tags billing_entities
165
+ * @name ListBillingEntities
166
+ * @summary List all billing entities
167
+ * @request GET:/billing_entities
168
+ * @secure
169
+ */
170
+ listBillingEntities: (params = {}) => this.request({
171
+ path: `/billing_entities`,
172
+ method: "GET",
173
+ secure: true,
174
+ format: "json",
175
+ ...params,
176
+ }),
177
+ /**
178
+ * @description This endpoint returns a specific billing entity by its code
179
+ *
180
+ * @tags billing_entities
181
+ * @name GetBillingEntity
182
+ * @summary Retrieve a billing entity
183
+ * @request GET:/billing_entities/{code}
184
+ * @secure
185
+ */
186
+ getBillingEntity: (code, params = {}) => this.request({
187
+ path: `/billing_entities/${code}`,
188
+ method: "GET",
189
+ secure: true,
190
+ format: "json",
191
+ ...params,
192
+ }),
193
+ };
160
194
  addOns = {
161
195
  /**
162
196
  * @description This endpoint is used to create an add-on that can be then attached to a one-off invoice.
@@ -723,11 +757,11 @@ export class Api extends HttpClient {
723
757
  * @tags customers
724
758
  * @name FindCustomer
725
759
  * @summary Retrieve a customer
726
- * @request GET:/customers/{external_id}
760
+ * @request GET:/customers/{external_customer_id}
727
761
  * @secure
728
762
  */
729
- findCustomer: (externalId, params = {}) => this.request({
730
- path: `/customers/${externalId}`,
763
+ findCustomer: (externalCustomerId, params = {}) => this.request({
764
+ path: `/customers/${externalCustomerId}`,
731
765
  method: "GET",
732
766
  secure: true,
733
767
  format: "json",
@@ -739,11 +773,11 @@ export class Api extends HttpClient {
739
773
  * @tags customers
740
774
  * @name DestroyCustomer
741
775
  * @summary Delete a customer
742
- * @request DELETE:/customers/{external_id}
776
+ * @request DELETE:/customers/{external_customer_id}
743
777
  * @secure
744
778
  */
745
- destroyCustomer: (externalId, params = {}) => this.request({
746
- path: `/customers/${externalId}`,
779
+ destroyCustomer: (externalCustomerId, params = {}) => this.request({
780
+ path: `/customers/${externalCustomerId}`,
747
781
  method: "DELETE",
748
782
  secure: true,
749
783
  format: "json",
@@ -1155,6 +1189,24 @@ export class Api extends HttpClient {
1155
1189
  format: "json",
1156
1190
  ...params,
1157
1191
  }),
1192
+ /**
1193
+ * @description This endpoint is used for generating invoice preview.
1194
+ *
1195
+ * @tags invoices
1196
+ * @name InvoicePreview
1197
+ * @summary Create an invoice preview
1198
+ * @request POST:/invoices/preview
1199
+ * @secure
1200
+ */
1201
+ invoicePreview: (data, params = {}) => this.request({
1202
+ path: `/invoices/preview`,
1203
+ method: "POST",
1204
+ body: data,
1205
+ secure: true,
1206
+ type: ContentType.Json,
1207
+ format: "json",
1208
+ ...params,
1209
+ }),
1158
1210
  /**
1159
1211
  * @description This endpoint resends an invoice for collection and retry a payment.
1160
1212
  *
@@ -1207,6 +1259,41 @@ export class Api extends HttpClient {
1207
1259
  ...params,
1208
1260
  }),
1209
1261
  };
1262
+ paymentReceipts = {
1263
+ /**
1264
+ * @description This endpoint is used to list all existing payment receipts.
1265
+ *
1266
+ * @tags payment_receipts
1267
+ * @name FindAllPaymentReceipts
1268
+ * @summary List all payment receipts
1269
+ * @request GET:/payment_receipts
1270
+ * @secure
1271
+ */
1272
+ findAllPaymentReceipts: (query, params = {}) => this.request({
1273
+ path: `/payment_receipts`,
1274
+ method: "GET",
1275
+ query: query,
1276
+ secure: true,
1277
+ format: "json",
1278
+ ...params,
1279
+ }),
1280
+ /**
1281
+ * @description This endpoint retrieves a specific payment receipt.
1282
+ *
1283
+ * @tags payment_receipts
1284
+ * @name FindPaymentReceipt
1285
+ * @summary Retrieve a payment receipt
1286
+ * @request GET:/payment_receipts/{lago_id}
1287
+ * @secure
1288
+ */
1289
+ findPaymentReceipt: (lagoId, params = {}) => this.request({
1290
+ path: `/payment_receipts/${lagoId}`,
1291
+ method: "GET",
1292
+ secure: true,
1293
+ format: "json",
1294
+ ...params,
1295
+ }),
1296
+ };
1210
1297
  paymentRequests = {
1211
1298
  /**
1212
1299
  * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
@@ -1244,6 +1331,59 @@ export class Api extends HttpClient {
1244
1331
  ...params,
1245
1332
  }),
1246
1333
  };
1334
+ payments = {
1335
+ /**
1336
+ * @description This endpoint is used to create a manual payment
1337
+ *
1338
+ * @tags payments
1339
+ * @name CreatePayment
1340
+ * @summary Create a payment
1341
+ * @request POST:/payments
1342
+ * @secure
1343
+ */
1344
+ createPayment: (data, params = {}) => this.request({
1345
+ path: `/payments`,
1346
+ method: "POST",
1347
+ body: data,
1348
+ secure: true,
1349
+ type: ContentType.Json,
1350
+ format: "json",
1351
+ ...params,
1352
+ }),
1353
+ /**
1354
+ * @description This endpoint is used to list all payments
1355
+ *
1356
+ * @tags payments
1357
+ * @name FindAllPayments
1358
+ * @summary List all payments
1359
+ * @request GET:/payments
1360
+ * @secure
1361
+ */
1362
+ findAllPayments: (query, params = {}) => this.request({
1363
+ path: `/payments`,
1364
+ method: "GET",
1365
+ query: query,
1366
+ secure: true,
1367
+ format: "json",
1368
+ ...params,
1369
+ }),
1370
+ /**
1371
+ * @description This endpoint retrieves a specific payment by its ID.
1372
+ *
1373
+ * @tags payments
1374
+ * @name FindPayment
1375
+ * @summary Retrieve a payment
1376
+ * @request GET:/payments/{lago_id}
1377
+ * @secure
1378
+ */
1379
+ findPayment: (lagoId, params = {}) => this.request({
1380
+ path: `/payments/${lagoId}`,
1381
+ method: "GET",
1382
+ secure: true,
1383
+ format: "json",
1384
+ ...params,
1385
+ }),
1386
+ };
1247
1387
  plans = {
1248
1388
  /**
1249
1389
  * @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.
@@ -1663,6 +1803,38 @@ export class Api extends HttpClient {
1663
1803
  format: "json",
1664
1804
  ...params,
1665
1805
  }),
1806
+ /**
1807
+ * @description This endpoint is used to retrieve a specific wallet transactions.
1808
+ *
1809
+ * @tags wallets
1810
+ * @name FindWalletTransaction
1811
+ * @summary Retrieve a wallet transaction
1812
+ * @request GET:/wallet_transactions/{lago_id}
1813
+ * @secure
1814
+ */
1815
+ findWalletTransaction: (lagoId, params = {}) => this.request({
1816
+ path: `/wallet_transactions/${lagoId}`,
1817
+ method: "GET",
1818
+ secure: true,
1819
+ format: "json",
1820
+ ...params,
1821
+ }),
1822
+ /**
1823
+ * @description This endpoint generates a checkout link for a specific wallet transaction.
1824
+ *
1825
+ * @tags wallets
1826
+ * @name WalletTransactionPaymentUrl
1827
+ * @summary Generate a payment URL
1828
+ * @request POST:/wallet_transactions/{lago_id}/payment_url
1829
+ * @secure
1830
+ */
1831
+ walletTransactionPaymentUrl: (lagoId, params = {}) => this.request({
1832
+ path: `/wallet_transactions/${lagoId}/payment_url`,
1833
+ method: "POST",
1834
+ secure: true,
1835
+ format: "json",
1836
+ ...params,
1837
+ }),
1666
1838
  };
1667
1839
  webhooks = {
1668
1840
  /**
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./script/mod.js",
4
4
  "name": "lago-javascript-client",
5
5
  "sideEffects": false,
6
- "version": "v1.20.0",
6
+ "version": "v1.26.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",