lago-javascript-client 0.49.0-beta → 0.53.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.
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 0.49.0-beta
155
+ * @version 0.53.0-beta
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://api.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -248,6 +248,76 @@ class Api extends HttpClient {
248
248
  ...params,
249
249
  }),
250
250
  };
251
+ analytics = {
252
+ /**
253
+ * @description Gross revenue is the sum of monthly `finalized` invoice payments and fees paid in advance that are not invoiceable. This total is calculated after deducting taxes and discounts.
254
+ *
255
+ * @tags analytics
256
+ * @name FindAllGrossRevenues
257
+ * @summary List gross revenue
258
+ * @request GET:/analytics/gross_revenue
259
+ * @secure
260
+ */
261
+ findAllGrossRevenues: (query, params = {}) => this.request({
262
+ path: `/analytics/gross_revenue`,
263
+ method: "GET",
264
+ query: query,
265
+ secure: true,
266
+ format: "json",
267
+ ...params,
268
+ }),
269
+ /**
270
+ * @description Represents a monthly aggregation, detailing both the total count and the cumulative amount of invoices that have been marked as `finalized`. This report sorts invoices categorically based on their `payment_status`.
271
+ *
272
+ * @tags analytics
273
+ * @name FindAllInvoiceCollections
274
+ * @summary List of finalized invoices
275
+ * @request GET:/analytics/invoice_collection
276
+ * @secure
277
+ */
278
+ findAllInvoiceCollections: (query, params = {}) => this.request({
279
+ path: `/analytics/invoice_collection`,
280
+ method: "GET",
281
+ query: query,
282
+ secure: true,
283
+ format: "json",
284
+ ...params,
285
+ }),
286
+ /**
287
+ * @description Reports a monthly analysis focused on the revenue generated from all usage-based fees. It exclusively accounts for revenue that has been formally invoiced. Importantly, this report does not include revenue related to the usage in the current billing period, limiting its scope to previously invoiced amounts.
288
+ *
289
+ * @tags analytics
290
+ * @name FindAllInvoicedUsages
291
+ * @summary List usage revenue
292
+ * @request GET:/analytics/invoiced_usage
293
+ * @secure
294
+ */
295
+ findAllInvoicedUsages: (query, params = {}) => this.request({
296
+ path: `/analytics/invoiced_usage`,
297
+ method: "GET",
298
+ query: query,
299
+ secure: true,
300
+ format: "json",
301
+ ...params,
302
+ }),
303
+ /**
304
+ * @description This endpoint is used to list MRR.
305
+ *
306
+ * @tags analytics
307
+ * @name FindAllMrrs
308
+ * @summary List MRR
309
+ * @request GET:/analytics/mrr
310
+ * @secure
311
+ */
312
+ findAllMrrs: (query, params = {}) => this.request({
313
+ path: `/analytics/mrr`,
314
+ method: "GET",
315
+ query: query,
316
+ secure: true,
317
+ format: "json",
318
+ ...params,
319
+ }),
320
+ };
251
321
  appliedCoupons = {
252
322
  /**
253
323
  * @description This endpoint is used to apply a specific coupon to a customer, before or during a subscription.
@@ -562,6 +632,24 @@ class Api extends HttpClient {
562
632
  format: "json",
563
633
  ...params,
564
634
  }),
635
+ /**
636
+ * @description This endpoint allows you to retrieve amounts for a new credit note creation.
637
+ *
638
+ * @tags credit_notes
639
+ * @name EstimateCreditNote
640
+ * @summary Estimate amounts for a new credit note
641
+ * @request POST:/credit_notes/estimate
642
+ * @secure
643
+ */
644
+ estimateCreditNote: (data, params = {}) => this.request({
645
+ path: `/credit_notes/estimate`,
646
+ method: "POST",
647
+ body: data,
648
+ secure: true,
649
+ type: ContentType.Json,
650
+ format: "json",
651
+ ...params,
652
+ }),
565
653
  /**
566
654
  * @description This endpoint voids an existing credit note.
567
655
  *
@@ -713,6 +801,22 @@ class Api extends HttpClient {
713
801
  format: "json",
714
802
  ...params,
715
803
  }),
804
+ /**
805
+ * @description This endpoint regenerates the Payment Provider Checkout URL of a Customer.
806
+ *
807
+ * @tags customers
808
+ * @name GenerateCustomerCheckoutUrl
809
+ * @summary Generate a Customer Payment Provider Checkout URL
810
+ * @request POST:/customers/{external_customer_id}/checkout_url
811
+ * @secure
812
+ */
813
+ generateCustomerCheckoutUrl: (externalCustomerId, params = {}) => this.request({
814
+ path: `/customers/${externalCustomerId}/checkout_url`,
815
+ method: "POST",
816
+ secure: true,
817
+ format: "json",
818
+ ...params,
819
+ }),
716
820
  };
717
821
  events = {
718
822
  /**
@@ -730,6 +834,7 @@ class Api extends HttpClient {
730
834
  body: data,
731
835
  secure: true,
732
836
  type: ContentType.Json,
837
+ format: "json",
733
838
  ...params,
734
839
  }),
735
840
  /**
@@ -971,6 +1076,22 @@ class Api extends HttpClient {
971
1076
  secure: true,
972
1077
  ...params,
973
1078
  }),
1079
+ /**
1080
+ * @description This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`.
1081
+ *
1082
+ * @tags invoices
1083
+ * @name VoidInvoice
1084
+ * @summary Void an invoice
1085
+ * @request POST:/invoices/{lago_id}/void
1086
+ * @secure
1087
+ */
1088
+ voidInvoice: (lagoId, params = {}) => this.request({
1089
+ path: `/invoices/${lagoId}/void`,
1090
+ method: "POST",
1091
+ secure: true,
1092
+ format: "json",
1093
+ ...params,
1094
+ }),
974
1095
  };
975
1096
  organizations = {
976
1097
  /**