lago-javascript-client 0.56.0-beta → 1.0.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.
@@ -1816,6 +1816,8 @@ export interface EventEstimateFeesInput {
1816
1816
  code: string;
1817
1817
  /**
1818
1818
  * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1819
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1820
+ * @deprecated
1819
1821
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1820
1822
  */
1821
1823
  external_customer_id?: string;
@@ -1837,6 +1839,8 @@ export interface EventInput {
1837
1839
  transaction_id: string;
1838
1840
  /**
1839
1841
  * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1842
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1843
+ * @deprecated
1840
1844
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1841
1845
  */
1842
1846
  external_customer_id?: string;
@@ -1884,6 +1888,8 @@ export interface EventObject {
1884
1888
  lago_customer_id: string | null;
1885
1889
  /**
1886
1890
  * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1891
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1892
+ * @deprecated
1887
1893
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1888
1894
  */
1889
1895
  external_customer_id: string | null;
@@ -4076,7 +4082,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4076
4082
  }
4077
4083
  /**
4078
4084
  * @title Lago API documentation
4079
- * @version 0.56.0-beta
4085
+ * @version 0.57.0-beta
4080
4086
  * @license AGPLv3
4081
4087
  * @baseUrl https://api.getlago.com/api/v1
4082
4088
  * @externalDocs https://github.com/getlago
@@ -4487,11 +4493,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4487
4493
  */
4488
4494
  estimateCreditNote: (data: CreditNoteEstimateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteEstimated, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4489
4495
  /**
4490
- * @description This endpoint voids an existing credit note.
4496
+ * @description This endpoint voids the available credit linked to a specific credit note.
4491
4497
  *
4492
4498
  * @tags credit_notes
4493
4499
  * @name VoidCreditNote
4494
- * @summary Void a credit note
4500
+ * @summary Void available credit
4495
4501
  * @request PUT:/credit_notes/{lago_id}/void
4496
4502
  * @secure
4497
4503
  */
@@ -4675,7 +4681,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4675
4681
  */
4676
4682
  createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4677
4683
  /**
4678
- * @description This endpoint is used to send a batch of usage records.
4684
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
4679
4685
  *
4680
4686
  * @tags events
4681
4687
  * @name CreateBatchEvents
@@ -4926,6 +4932,44 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4926
4932
  * @secure
4927
4933
  */
4928
4934
  refreshInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
4935
+ /**
4936
+ * @description This endpoint generates a checkout link for a specific invoice.
4937
+ *
4938
+ * @tags invoices
4939
+ * @name InvoicePaymentUrl
4940
+ * @summary Generate a payment URL
4941
+ * @request POST:/invoices/{lago_id}/payment_url
4942
+ * @secure
4943
+ */
4944
+ invoicePaymentUrl: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<{
4945
+ invoice_payment_details?: {
4946
+ /**
4947
+ * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
4948
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4949
+ */
4950
+ lago_customer_id?: string | undefined;
4951
+ /**
4952
+ * Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system
4953
+ * @example "1e501a90-1a90-1a90-1a90-1a901a901a80"
4954
+ */
4955
+ lago_invoice_id?: string | undefined;
4956
+ /**
4957
+ * The customer external unique identifier (provided by your own application)
4958
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4959
+ */
4960
+ external_customer_id?: string | undefined;
4961
+ /**
4962
+ * The Payment Provider name linked to the Customer.
4963
+ * @example "stripe"
4964
+ */
4965
+ payment_provider?: string | undefined;
4966
+ /**
4967
+ * The generated Payment URL for the Invoice.
4968
+ * @example "https://foo.bar"
4969
+ */
4970
+ payment_url?: string | undefined;
4971
+ } | undefined;
4972
+ }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4929
4973
  /**
4930
4974
  * @description This endpoint resends an invoice for collection and retry a payment.
4931
4975
  *
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 0.56.0-beta
151
+ * @version 0.57.0-beta
152
152
  * @license AGPLv3
153
153
  * @baseUrl https://api.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
@@ -647,11 +647,11 @@ export class Api extends HttpClient {
647
647
  ...params,
648
648
  }),
649
649
  /**
650
- * @description This endpoint voids an existing credit note.
650
+ * @description This endpoint voids the available credit linked to a specific credit note.
651
651
  *
652
652
  * @tags credit_notes
653
653
  * @name VoidCreditNote
654
- * @summary Void a credit note
654
+ * @summary Void available credit
655
655
  * @request PUT:/credit_notes/{lago_id}/void
656
656
  * @secure
657
657
  */
@@ -834,7 +834,7 @@ export class Api extends HttpClient {
834
834
  ...params,
835
835
  }),
836
836
  /**
837
- * @description This endpoint is used to send a batch of usage records.
837
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
838
838
  *
839
839
  * @tags events
840
840
  * @name CreateBatchEvents
@@ -1056,6 +1056,22 @@ export class Api extends HttpClient {
1056
1056
  format: "json",
1057
1057
  ...params,
1058
1058
  }),
1059
+ /**
1060
+ * @description This endpoint generates a checkout link for a specific invoice.
1061
+ *
1062
+ * @tags invoices
1063
+ * @name InvoicePaymentUrl
1064
+ * @summary Generate a payment URL
1065
+ * @request POST:/invoices/{lago_id}/payment_url
1066
+ * @secure
1067
+ */
1068
+ invoicePaymentUrl: (lagoId, params = {}) => this.request({
1069
+ path: `/invoices/${lagoId}/payment_url`,
1070
+ method: "POST",
1071
+ secure: true,
1072
+ format: "json",
1073
+ ...params,
1074
+ }),
1059
1075
  /**
1060
1076
  * @description This endpoint resends an invoice for collection and retry a payment.
1061
1077
  *
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": "v0.56.0-beta",
6
+ "version": "v1.0.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",
@@ -1816,6 +1816,8 @@ export interface EventEstimateFeesInput {
1816
1816
  code: string;
1817
1817
  /**
1818
1818
  * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1819
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1820
+ * @deprecated
1819
1821
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1820
1822
  */
1821
1823
  external_customer_id?: string;
@@ -1837,6 +1839,8 @@ export interface EventInput {
1837
1839
  transaction_id: string;
1838
1840
  /**
1839
1841
  * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1842
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1843
+ * @deprecated
1840
1844
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1841
1845
  */
1842
1846
  external_customer_id?: string;
@@ -1884,6 +1888,8 @@ export interface EventObject {
1884
1888
  lago_customer_id: string | null;
1885
1889
  /**
1886
1890
  * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1891
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1892
+ * @deprecated
1887
1893
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1888
1894
  */
1889
1895
  external_customer_id: string | null;
@@ -4076,7 +4082,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4076
4082
  }
4077
4083
  /**
4078
4084
  * @title Lago API documentation
4079
- * @version 0.56.0-beta
4085
+ * @version 0.57.0-beta
4080
4086
  * @license AGPLv3
4081
4087
  * @baseUrl https://api.getlago.com/api/v1
4082
4088
  * @externalDocs https://github.com/getlago
@@ -4487,11 +4493,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4487
4493
  */
4488
4494
  estimateCreditNote: (data: CreditNoteEstimateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteEstimated, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4489
4495
  /**
4490
- * @description This endpoint voids an existing credit note.
4496
+ * @description This endpoint voids the available credit linked to a specific credit note.
4491
4497
  *
4492
4498
  * @tags credit_notes
4493
4499
  * @name VoidCreditNote
4494
- * @summary Void a credit note
4500
+ * @summary Void available credit
4495
4501
  * @request PUT:/credit_notes/{lago_id}/void
4496
4502
  * @secure
4497
4503
  */
@@ -4675,7 +4681,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4675
4681
  */
4676
4682
  createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4677
4683
  /**
4678
- * @description This endpoint is used to send a batch of usage records.
4684
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
4679
4685
  *
4680
4686
  * @tags events
4681
4687
  * @name CreateBatchEvents
@@ -4926,6 +4932,44 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4926
4932
  * @secure
4927
4933
  */
4928
4934
  refreshInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
4935
+ /**
4936
+ * @description This endpoint generates a checkout link for a specific invoice.
4937
+ *
4938
+ * @tags invoices
4939
+ * @name InvoicePaymentUrl
4940
+ * @summary Generate a payment URL
4941
+ * @request POST:/invoices/{lago_id}/payment_url
4942
+ * @secure
4943
+ */
4944
+ invoicePaymentUrl: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<{
4945
+ invoice_payment_details?: {
4946
+ /**
4947
+ * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
4948
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4949
+ */
4950
+ lago_customer_id?: string | undefined;
4951
+ /**
4952
+ * Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system
4953
+ * @example "1e501a90-1a90-1a90-1a90-1a901a901a80"
4954
+ */
4955
+ lago_invoice_id?: string | undefined;
4956
+ /**
4957
+ * The customer external unique identifier (provided by your own application)
4958
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4959
+ */
4960
+ external_customer_id?: string | undefined;
4961
+ /**
4962
+ * The Payment Provider name linked to the Customer.
4963
+ * @example "stripe"
4964
+ */
4965
+ payment_provider?: string | undefined;
4966
+ /**
4967
+ * The generated Payment URL for the Invoice.
4968
+ * @example "https://foo.bar"
4969
+ */
4970
+ payment_url?: string | undefined;
4971
+ } | undefined;
4972
+ }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4929
4973
  /**
4930
4974
  * @description This endpoint resends an invoice for collection and retry a payment.
4931
4975
  *
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 0.56.0-beta
155
+ * @version 0.57.0-beta
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://api.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -651,11 +651,11 @@ class Api extends HttpClient {
651
651
  ...params,
652
652
  }),
653
653
  /**
654
- * @description This endpoint voids an existing credit note.
654
+ * @description This endpoint voids the available credit linked to a specific credit note.
655
655
  *
656
656
  * @tags credit_notes
657
657
  * @name VoidCreditNote
658
- * @summary Void a credit note
658
+ * @summary Void available credit
659
659
  * @request PUT:/credit_notes/{lago_id}/void
660
660
  * @secure
661
661
  */
@@ -838,7 +838,7 @@ class Api extends HttpClient {
838
838
  ...params,
839
839
  }),
840
840
  /**
841
- * @description This endpoint is used to send a batch of usage records.
841
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
842
842
  *
843
843
  * @tags events
844
844
  * @name CreateBatchEvents
@@ -1060,6 +1060,22 @@ class Api extends HttpClient {
1060
1060
  format: "json",
1061
1061
  ...params,
1062
1062
  }),
1063
+ /**
1064
+ * @description This endpoint generates a checkout link for a specific invoice.
1065
+ *
1066
+ * @tags invoices
1067
+ * @name InvoicePaymentUrl
1068
+ * @summary Generate a payment URL
1069
+ * @request POST:/invoices/{lago_id}/payment_url
1070
+ * @secure
1071
+ */
1072
+ invoicePaymentUrl: (lagoId, params = {}) => this.request({
1073
+ path: `/invoices/${lagoId}/payment_url`,
1074
+ method: "POST",
1075
+ secure: true,
1076
+ format: "json",
1077
+ ...params,
1078
+ }),
1063
1079
  /**
1064
1080
  * @description This endpoint resends an invoice for collection and retry a payment.
1065
1081
  *