lago-javascript-client 0.53.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.
@@ -174,7 +174,7 @@ export interface AppliedCouponInput {
174
174
  * - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
175
175
  * @example "recurring"
176
176
  */
177
- frequency?: "once" | "recurring" | null;
177
+ frequency?: "once" | "recurring" | "forever" | null;
178
178
  /**
179
179
  * Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
180
180
  * @example 3
@@ -260,7 +260,7 @@ export interface AppliedCouponObject {
260
260
  * - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
261
261
  * @example "recurring"
262
262
  */
263
- frequency: "once" | "recurring";
263
+ frequency: "once" | "recurring" | "forever";
264
264
  /**
265
265
  * Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
266
266
  * @example 3
@@ -663,6 +663,11 @@ export interface ChargeProperties {
663
663
  * @example "1.75"
664
664
  */
665
665
  per_transaction_min_amount?: string | null;
666
+ /**
667
+ * The list of event properties that are used to group the events on the invoice for a `standard` charge model.
668
+ * @example ["agent_name"]
669
+ */
670
+ grouped_by?: string[];
666
671
  /** Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. */
667
672
  volume_ranges?: {
668
673
  /**
@@ -746,7 +751,7 @@ export interface CouponBaseInput {
746
751
  * - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
747
752
  * @example "recurring"
748
753
  */
749
- frequency?: "once" | "recurring";
754
+ frequency?: "once" | "recurring" | "forever";
750
755
  /**
751
756
  * Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
752
757
  * @example 6
@@ -859,7 +864,7 @@ export interface CouponObject {
859
864
  * - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
860
865
  * @example "recurring"
861
866
  */
862
- frequency: "once" | "recurring";
867
+ frequency: "once" | "recurring" | "forever";
863
868
  /**
864
869
  * Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
865
870
  * @example 6
@@ -1315,6 +1320,11 @@ export interface CustomerBillingConfiguration {
1315
1320
  * @example "stripe"
1316
1321
  */
1317
1322
  payment_provider?: "stripe" | "adyen" | "gocardless";
1323
+ /**
1324
+ * Unique code used to identify a payment provider connection.
1325
+ * @example "stripe-eu-1"
1326
+ */
1327
+ payment_provider_code?: string;
1318
1328
  /**
1319
1329
  * The customer ID within the payment provider's system. If this field is not provided, Lago has the option to create a new customer record within the payment provider's system on behalf of the customer
1320
1330
  * @example "cus_12345"
@@ -1341,6 +1351,64 @@ export interface CustomerBillingConfiguration {
1341
1351
  */
1342
1352
  provider_payment_methods?: string[] | null;
1343
1353
  }
1354
+ /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
1355
+ export type CustomerChargeGroupedUsageObject = {
1356
+ /**
1357
+ * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
1358
+ * @example 1000
1359
+ */
1360
+ amount_cents?: number;
1361
+ /**
1362
+ * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
1363
+ * @example 10
1364
+ */
1365
+ events_count?: number;
1366
+ /**
1367
+ * The number of units consumed for a specific group related to a charge item.
1368
+ * @pattern ^[0-9]+.?[0-9]*$
1369
+ * @example "0.9"
1370
+ */
1371
+ units?: string;
1372
+ /** Key value list of event properties aggregated by the charge model */
1373
+ grouped_by?: Record<string, string>;
1374
+ /** Array of group object, representing multiple dimensions for a charge item. */
1375
+ groups?: CustomerChargeGroupsUsageObject;
1376
+ }[];
1377
+ /** Array of group object, representing multiple dimensions for a charge item. */
1378
+ export type CustomerChargeGroupsUsageObject = {
1379
+ /**
1380
+ * Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system.
1381
+ * @format uuid
1382
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1383
+ */
1384
+ lago_id?: string;
1385
+ /**
1386
+ * The group key, only returned for groups with two dimensions.
1387
+ * @example null
1388
+ */
1389
+ key?: string | null;
1390
+ /**
1391
+ * The group value.
1392
+ * @example "europe"
1393
+ */
1394
+ value?: string;
1395
+ /**
1396
+ * The number of units consumed for a specific group related to a charge item.
1397
+ * @pattern ^[0-9]+.?[0-9]*$
1398
+ * @example "0.9"
1399
+ */
1400
+ units?: string;
1401
+ /**
1402
+ * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
1403
+ * @example 10
1404
+ */
1405
+ events_count?: number;
1406
+ /**
1407
+ * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
1408
+ * @example 1000
1409
+ */
1410
+ amount_cents?: number;
1411
+ }[];
1344
1412
  export interface CustomerChargeUsageObject {
1345
1413
  /**
1346
1414
  * The number of units consumed by the customer for a specific charge item.
@@ -1404,40 +1472,9 @@ export interface CustomerChargeUsageObject {
1404
1472
  aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg";
1405
1473
  };
1406
1474
  /** Array of group object, representing multiple dimensions for a charge item. */
1407
- groups: {
1408
- /**
1409
- * Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system.
1410
- * @format uuid
1411
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1412
- */
1413
- lago_id?: string;
1414
- /**
1415
- * The group key, only returned for groups with two dimensions.
1416
- * @example null
1417
- */
1418
- key?: string | null;
1419
- /**
1420
- * The group value.
1421
- * @example "europe"
1422
- */
1423
- value?: string;
1424
- /**
1425
- * The number of units consumed for a specific group related to a charge item.
1426
- * @pattern ^[0-9]+.?[0-9]*$
1427
- * @example "0.9"
1428
- */
1429
- units?: string;
1430
- /**
1431
- * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
1432
- * @example 10
1433
- */
1434
- events_count?: number;
1435
- /**
1436
- * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
1437
- * @example 1000
1438
- */
1439
- amount_cents?: number;
1440
- }[];
1475
+ groups: CustomerChargeGroupsUsageObject;
1476
+ /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
1477
+ grouped_usage?: CustomerChargeGroupedUsageObject;
1441
1478
  }
1442
1479
  export interface CustomerCreateInput {
1443
1480
  customer: {
@@ -1768,42 +1805,7 @@ export interface Event {
1768
1805
  event: EventObject;
1769
1806
  }
1770
1807
  export interface EventBatchInput {
1771
- event: {
1772
- /**
1773
- * This field represents a unique identifier for the event. It is crucial for ensuring idempotency, meaning that each event can be uniquely identified and processed without causing any unintended side effects.
1774
- * @example "transaction_1234567890"
1775
- */
1776
- transaction_id: string;
1777
- /**
1778
- * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_ids`, targeting a specific subscription.
1779
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1780
- */
1781
- external_customer_id?: string;
1782
- /**
1783
- * Array of unique identifiers of the targeted subscriptions within your application.
1784
- * @example ["sub_1234567890","sub_0987654321"]
1785
- */
1786
- external_subscription_ids: string[];
1787
- /**
1788
- * The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
1789
- * @example "storage"
1790
- */
1791
- code: string;
1792
- /**
1793
- * This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception.
1794
- * @example 1651240791
1795
- */
1796
- timestamp?: number;
1797
- /**
1798
- * This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required.
1799
- * @example {"gb":10}
1800
- */
1801
- properties?: {
1802
- /** The `operation_type` field is only necessary when adding or removing a specific unit when the targeted billable metric adopts a `unique_count_agg` aggregation method. In other cases, the `operation_type` field is not required. The valid values for the `operation_type` field are `add` or `remove`, which indicate whether the unit is being added or removed from the unique count aggregation, respectively. */
1803
- operation_type?: "add" | "remove";
1804
- [key: string]: any;
1805
- };
1806
- };
1808
+ events: EventInput[];
1807
1809
  }
1808
1810
  export interface EventEstimateFeesInput {
1809
1811
  event: {
@@ -1814,6 +1816,8 @@ export interface EventEstimateFeesInput {
1814
1816
  code: string;
1815
1817
  /**
1816
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
1817
1821
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1818
1822
  */
1819
1823
  external_customer_id?: string;
@@ -1835,6 +1839,8 @@ export interface EventInput {
1835
1839
  transaction_id: string;
1836
1840
  /**
1837
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
1838
1844
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1839
1845
  */
1840
1846
  external_customer_id?: string;
@@ -1882,6 +1888,8 @@ export interface EventObject {
1882
1888
  lago_customer_id: string | null;
1883
1889
  /**
1884
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
1885
1893
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1886
1894
  */
1887
1895
  external_customer_id: string | null;
@@ -2156,10 +2164,11 @@ export interface FeeObject {
2156
2164
  */
2157
2165
  flat_unit_amount: string;
2158
2166
  /**
2159
- * Amount per unit within a specified tier.
2167
+ * Percentage rate applied within a specified tier.
2168
+ * @format ^[0-9]+.?[0-9]*$
2160
2169
  * @example "1.0"
2161
2170
  */
2162
- per_unit_amount: string;
2171
+ rate: string;
2163
2172
  /**
2164
2173
  * Total amount of received units to be charged within a specified tier.
2165
2174
  * @example "10.0"
@@ -2206,10 +2215,11 @@ export interface FeeObject {
2206
2215
  */
2207
2216
  free_events?: number;
2208
2217
  /**
2209
- * Amount per unit for the Percentage charge model.
2218
+ * Percentage rate applied for the Percentage charge model.
2219
+ * @format ^[0-9]+.?[0-9]*$
2210
2220
  * @example "1.0"
2211
2221
  */
2212
- per_unit_amount?: string;
2222
+ rate?: string;
2213
2223
  /**
2214
2224
  * Total amount of received units to be charged for the Percentage charge model.
2215
2225
  * @example "10.0"
@@ -2295,6 +2305,8 @@ export interface FeeObject {
2295
2305
  * @example "Subscription"
2296
2306
  */
2297
2307
  item_type: "AddOn" | "BillableMetric" | "Subscription" | "WalletTransaction";
2308
+ /** Key value list of event properties aggregated by the charge model */
2309
+ grouped_by?: Record<string, string>;
2298
2310
  };
2299
2311
  /** List of fee applied taxes */
2300
2312
  applied_taxes?: FeeAppliedTaxObject[];
@@ -2517,9 +2529,10 @@ export interface InvoiceObject {
2517
2529
  * The status of the invoice. It indicates the current state of the invoice and can have two possible values:
2518
2530
  * - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice.
2519
2531
  * - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore.
2532
+ * - `voided`: the invoice has been issued and subsequently voided. In this state, events cannot be ingested or added to the invoice anymore.
2520
2533
  * @example "finalized"
2521
2534
  */
2522
- status: "draft" | "finalized";
2535
+ status: "draft" | "finalized" | "voided";
2523
2536
  /**
2524
2537
  * The status of the payment associated with the invoice. It can have one of the following values:
2525
2538
  * - `pending`: the payment is pending, waiting for payment processing in Stripe or when the invoice is emitted but users have not updated the payment status through the endpoint.
@@ -3789,6 +3802,28 @@ export interface WalletObject {
3789
3802
  */
3790
3803
  created_at: string;
3791
3804
  }[];
3805
+ /**
3806
+ * The wallet ongoing balance expressed in cents.
3807
+ * @example 800
3808
+ */
3809
+ ongoing_balance_cents: number;
3810
+ /**
3811
+ * The wallet ongoing usage balance expressed in cents.
3812
+ * @example 200
3813
+ */
3814
+ ongoing_usage_balance_cents: number;
3815
+ /**
3816
+ * The wallet ongoing balance expressed in credits.
3817
+ * @pattern ^[0-9]+.?[0-9]*$
3818
+ * @example "8.0"
3819
+ */
3820
+ credits_ongoing_balance: string;
3821
+ /**
3822
+ * The wallet ongoing usage balance expressed in credits.
3823
+ * @pattern ^[0-9]+.?[0-9]*$
3824
+ * @example "2.0"
3825
+ */
3826
+ credits_ongoing_usage_balance: string;
3792
3827
  }
3793
3828
  export interface WalletsPaginated {
3794
3829
  wallets: WalletObject[];
@@ -4047,7 +4082,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4047
4082
  }
4048
4083
  /**
4049
4084
  * @title Lago API documentation
4050
- * @version 0.53.0-beta
4085
+ * @version 0.57.0-beta
4051
4086
  * @license AGPLv3
4052
4087
  * @baseUrl https://api.getlago.com/api/v1
4053
4088
  * @externalDocs https://github.com/getlago
@@ -4458,11 +4493,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4458
4493
  */
4459
4494
  estimateCreditNote: (data: CreditNoteEstimateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteEstimated, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4460
4495
  /**
4461
- * @description This endpoint voids an existing credit note.
4496
+ * @description This endpoint voids the available credit linked to a specific credit note.
4462
4497
  *
4463
4498
  * @tags credit_notes
4464
4499
  * @name VoidCreditNote
4465
- * @summary Void a credit note
4500
+ * @summary Void available credit
4466
4501
  * @request PUT:/credit_notes/{lago_id}/void
4467
4502
  * @secure
4468
4503
  */
@@ -4610,26 +4645,28 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4610
4645
  * @secure
4611
4646
  */
4612
4647
  generateCustomerCheckoutUrl: (externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<{
4613
- /**
4614
- * 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
4615
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4616
- */
4617
- lago_customer_id?: string | undefined;
4618
- /**
4619
- * The customer external unique identifier (provided by your own application)
4620
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4621
- */
4622
- external_customer_id?: string | undefined;
4623
- /**
4624
- * The Payment Provider name linked to the Customer.
4625
- * @example "stripe"
4626
- */
4627
- payment_provider?: string | undefined;
4628
- /**
4629
- * The new generated Payment Provider Checkout URL for the Customer.
4630
- * @example "https://foo.bar"
4631
- */
4632
- checkout_url?: string | undefined;
4648
+ customer?: {
4649
+ /**
4650
+ * 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
4651
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4652
+ */
4653
+ lago_customer_id?: string | undefined;
4654
+ /**
4655
+ * The customer external unique identifier (provided by your own application)
4656
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4657
+ */
4658
+ external_customer_id?: string | undefined;
4659
+ /**
4660
+ * The Payment Provider name linked to the Customer.
4661
+ * @example "stripe"
4662
+ */
4663
+ payment_provider?: string | undefined;
4664
+ /**
4665
+ * The new generated Payment Provider Checkout URL for the Customer.
4666
+ * @example "https://foo.bar"
4667
+ */
4668
+ checkout_url?: string | undefined;
4669
+ } | undefined;
4633
4670
  }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4634
4671
  };
4635
4672
  events: {
@@ -4644,13 +4681,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4644
4681
  */
4645
4682
  createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4646
4683
  /**
4647
- * @description This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer.
4684
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
4648
4685
  *
4649
4686
  * @tags events
4650
4687
  * @name CreateBatchEvents
4651
4688
  * @summary Batch multiple events
4652
4689
  * @request POST:/events/batch
4653
- * @deprecated
4654
4690
  * @secure
4655
4691
  */
4656
4692
  createBatchEvents: (data: EventBatchInput, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
@@ -4896,6 +4932,44 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4896
4932
  * @secure
4897
4933
  */
4898
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>>;
4899
4973
  /**
4900
4974
  * @description This endpoint resends an invoice for collection and retry a payment.
4901
4975
  *
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 0.53.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,13 +834,12 @@ export class Api extends HttpClient {
834
834
  ...params,
835
835
  }),
836
836
  /**
837
- * @description This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer.
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
841
841
  * @summary Batch multiple events
842
842
  * @request POST:/events/batch
843
- * @deprecated
844
843
  * @secure
845
844
  */
846
845
  createBatchEvents: (data, params = {}) => this.request({
@@ -1057,6 +1056,22 @@ export class Api extends HttpClient {
1057
1056
  format: "json",
1058
1057
  ...params,
1059
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
+ }),
1060
1075
  /**
1061
1076
  * @description This endpoint resends an invoice for collection and retry a payment.
1062
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.53.0-beta",
6
+ "version": "v1.0.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",
@@ -174,7 +174,7 @@ export interface AppliedCouponInput {
174
174
  * - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
175
175
  * @example "recurring"
176
176
  */
177
- frequency?: "once" | "recurring" | null;
177
+ frequency?: "once" | "recurring" | "forever" | null;
178
178
  /**
179
179
  * Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
180
180
  * @example 3
@@ -260,7 +260,7 @@ export interface AppliedCouponObject {
260
260
  * - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
261
261
  * @example "recurring"
262
262
  */
263
- frequency: "once" | "recurring";
263
+ frequency: "once" | "recurring" | "forever";
264
264
  /**
265
265
  * Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
266
266
  * @example 3
@@ -663,6 +663,11 @@ export interface ChargeProperties {
663
663
  * @example "1.75"
664
664
  */
665
665
  per_transaction_min_amount?: string | null;
666
+ /**
667
+ * The list of event properties that are used to group the events on the invoice for a `standard` charge model.
668
+ * @example ["agent_name"]
669
+ */
670
+ grouped_by?: string[];
666
671
  /** Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. */
667
672
  volume_ranges?: {
668
673
  /**
@@ -746,7 +751,7 @@ export interface CouponBaseInput {
746
751
  * - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
747
752
  * @example "recurring"
748
753
  */
749
- frequency?: "once" | "recurring";
754
+ frequency?: "once" | "recurring" | "forever";
750
755
  /**
751
756
  * Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
752
757
  * @example 6
@@ -859,7 +864,7 @@ export interface CouponObject {
859
864
  * - If set to `forever`, the coupon has unlimited usage and can be applied indefinitely.
860
865
  * @example "recurring"
861
866
  */
862
- frequency: "once" | "recurring";
867
+ frequency: "once" | "recurring" | "forever";
863
868
  /**
864
869
  * Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
865
870
  * @example 6
@@ -1315,6 +1320,11 @@ export interface CustomerBillingConfiguration {
1315
1320
  * @example "stripe"
1316
1321
  */
1317
1322
  payment_provider?: "stripe" | "adyen" | "gocardless";
1323
+ /**
1324
+ * Unique code used to identify a payment provider connection.
1325
+ * @example "stripe-eu-1"
1326
+ */
1327
+ payment_provider_code?: string;
1318
1328
  /**
1319
1329
  * The customer ID within the payment provider's system. If this field is not provided, Lago has the option to create a new customer record within the payment provider's system on behalf of the customer
1320
1330
  * @example "cus_12345"
@@ -1341,6 +1351,64 @@ export interface CustomerBillingConfiguration {
1341
1351
  */
1342
1352
  provider_payment_methods?: string[] | null;
1343
1353
  }
1354
+ /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
1355
+ export type CustomerChargeGroupedUsageObject = {
1356
+ /**
1357
+ * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
1358
+ * @example 1000
1359
+ */
1360
+ amount_cents?: number;
1361
+ /**
1362
+ * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
1363
+ * @example 10
1364
+ */
1365
+ events_count?: number;
1366
+ /**
1367
+ * The number of units consumed for a specific group related to a charge item.
1368
+ * @pattern ^[0-9]+.?[0-9]*$
1369
+ * @example "0.9"
1370
+ */
1371
+ units?: string;
1372
+ /** Key value list of event properties aggregated by the charge model */
1373
+ grouped_by?: Record<string, string>;
1374
+ /** Array of group object, representing multiple dimensions for a charge item. */
1375
+ groups?: CustomerChargeGroupsUsageObject;
1376
+ }[];
1377
+ /** Array of group object, representing multiple dimensions for a charge item. */
1378
+ export type CustomerChargeGroupsUsageObject = {
1379
+ /**
1380
+ * Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system.
1381
+ * @format uuid
1382
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1383
+ */
1384
+ lago_id?: string;
1385
+ /**
1386
+ * The group key, only returned for groups with two dimensions.
1387
+ * @example null
1388
+ */
1389
+ key?: string | null;
1390
+ /**
1391
+ * The group value.
1392
+ * @example "europe"
1393
+ */
1394
+ value?: string;
1395
+ /**
1396
+ * The number of units consumed for a specific group related to a charge item.
1397
+ * @pattern ^[0-9]+.?[0-9]*$
1398
+ * @example "0.9"
1399
+ */
1400
+ units?: string;
1401
+ /**
1402
+ * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
1403
+ * @example 10
1404
+ */
1405
+ events_count?: number;
1406
+ /**
1407
+ * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
1408
+ * @example 1000
1409
+ */
1410
+ amount_cents?: number;
1411
+ }[];
1344
1412
  export interface CustomerChargeUsageObject {
1345
1413
  /**
1346
1414
  * The number of units consumed by the customer for a specific charge item.
@@ -1404,40 +1472,9 @@ export interface CustomerChargeUsageObject {
1404
1472
  aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg";
1405
1473
  };
1406
1474
  /** Array of group object, representing multiple dimensions for a charge item. */
1407
- groups: {
1408
- /**
1409
- * Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system.
1410
- * @format uuid
1411
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1412
- */
1413
- lago_id?: string;
1414
- /**
1415
- * The group key, only returned for groups with two dimensions.
1416
- * @example null
1417
- */
1418
- key?: string | null;
1419
- /**
1420
- * The group value.
1421
- * @example "europe"
1422
- */
1423
- value?: string;
1424
- /**
1425
- * The number of units consumed for a specific group related to a charge item.
1426
- * @pattern ^[0-9]+.?[0-9]*$
1427
- * @example "0.9"
1428
- */
1429
- units?: string;
1430
- /**
1431
- * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
1432
- * @example 10
1433
- */
1434
- events_count?: number;
1435
- /**
1436
- * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
1437
- * @example 1000
1438
- */
1439
- amount_cents?: number;
1440
- }[];
1475
+ groups: CustomerChargeGroupsUsageObject;
1476
+ /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
1477
+ grouped_usage?: CustomerChargeGroupedUsageObject;
1441
1478
  }
1442
1479
  export interface CustomerCreateInput {
1443
1480
  customer: {
@@ -1768,42 +1805,7 @@ export interface Event {
1768
1805
  event: EventObject;
1769
1806
  }
1770
1807
  export interface EventBatchInput {
1771
- event: {
1772
- /**
1773
- * This field represents a unique identifier for the event. It is crucial for ensuring idempotency, meaning that each event can be uniquely identified and processed without causing any unintended side effects.
1774
- * @example "transaction_1234567890"
1775
- */
1776
- transaction_id: string;
1777
- /**
1778
- * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_ids`, targeting a specific subscription.
1779
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1780
- */
1781
- external_customer_id?: string;
1782
- /**
1783
- * Array of unique identifiers of the targeted subscriptions within your application.
1784
- * @example ["sub_1234567890","sub_0987654321"]
1785
- */
1786
- external_subscription_ids: string[];
1787
- /**
1788
- * The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
1789
- * @example "storage"
1790
- */
1791
- code: string;
1792
- /**
1793
- * This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception.
1794
- * @example 1651240791
1795
- */
1796
- timestamp?: number;
1797
- /**
1798
- * This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required.
1799
- * @example {"gb":10}
1800
- */
1801
- properties?: {
1802
- /** The `operation_type` field is only necessary when adding or removing a specific unit when the targeted billable metric adopts a `unique_count_agg` aggregation method. In other cases, the `operation_type` field is not required. The valid values for the `operation_type` field are `add` or `remove`, which indicate whether the unit is being added or removed from the unique count aggregation, respectively. */
1803
- operation_type?: "add" | "remove";
1804
- [key: string]: any;
1805
- };
1806
- };
1808
+ events: EventInput[];
1807
1809
  }
1808
1810
  export interface EventEstimateFeesInput {
1809
1811
  event: {
@@ -1814,6 +1816,8 @@ export interface EventEstimateFeesInput {
1814
1816
  code: string;
1815
1817
  /**
1816
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
1817
1821
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1818
1822
  */
1819
1823
  external_customer_id?: string;
@@ -1835,6 +1839,8 @@ export interface EventInput {
1835
1839
  transaction_id: string;
1836
1840
  /**
1837
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
1838
1844
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1839
1845
  */
1840
1846
  external_customer_id?: string;
@@ -1882,6 +1888,8 @@ export interface EventObject {
1882
1888
  lago_customer_id: string | null;
1883
1889
  /**
1884
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
1885
1893
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1886
1894
  */
1887
1895
  external_customer_id: string | null;
@@ -2156,10 +2164,11 @@ export interface FeeObject {
2156
2164
  */
2157
2165
  flat_unit_amount: string;
2158
2166
  /**
2159
- * Amount per unit within a specified tier.
2167
+ * Percentage rate applied within a specified tier.
2168
+ * @format ^[0-9]+.?[0-9]*$
2160
2169
  * @example "1.0"
2161
2170
  */
2162
- per_unit_amount: string;
2171
+ rate: string;
2163
2172
  /**
2164
2173
  * Total amount of received units to be charged within a specified tier.
2165
2174
  * @example "10.0"
@@ -2206,10 +2215,11 @@ export interface FeeObject {
2206
2215
  */
2207
2216
  free_events?: number;
2208
2217
  /**
2209
- * Amount per unit for the Percentage charge model.
2218
+ * Percentage rate applied for the Percentage charge model.
2219
+ * @format ^[0-9]+.?[0-9]*$
2210
2220
  * @example "1.0"
2211
2221
  */
2212
- per_unit_amount?: string;
2222
+ rate?: string;
2213
2223
  /**
2214
2224
  * Total amount of received units to be charged for the Percentage charge model.
2215
2225
  * @example "10.0"
@@ -2295,6 +2305,8 @@ export interface FeeObject {
2295
2305
  * @example "Subscription"
2296
2306
  */
2297
2307
  item_type: "AddOn" | "BillableMetric" | "Subscription" | "WalletTransaction";
2308
+ /** Key value list of event properties aggregated by the charge model */
2309
+ grouped_by?: Record<string, string>;
2298
2310
  };
2299
2311
  /** List of fee applied taxes */
2300
2312
  applied_taxes?: FeeAppliedTaxObject[];
@@ -2517,9 +2529,10 @@ export interface InvoiceObject {
2517
2529
  * The status of the invoice. It indicates the current state of the invoice and can have two possible values:
2518
2530
  * - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice.
2519
2531
  * - `finalized`: the invoice has been issued and finalized. In this state, events cannot be ingested or added to the invoice anymore.
2532
+ * - `voided`: the invoice has been issued and subsequently voided. In this state, events cannot be ingested or added to the invoice anymore.
2520
2533
  * @example "finalized"
2521
2534
  */
2522
- status: "draft" | "finalized";
2535
+ status: "draft" | "finalized" | "voided";
2523
2536
  /**
2524
2537
  * The status of the payment associated with the invoice. It can have one of the following values:
2525
2538
  * - `pending`: the payment is pending, waiting for payment processing in Stripe or when the invoice is emitted but users have not updated the payment status through the endpoint.
@@ -3789,6 +3802,28 @@ export interface WalletObject {
3789
3802
  */
3790
3803
  created_at: string;
3791
3804
  }[];
3805
+ /**
3806
+ * The wallet ongoing balance expressed in cents.
3807
+ * @example 800
3808
+ */
3809
+ ongoing_balance_cents: number;
3810
+ /**
3811
+ * The wallet ongoing usage balance expressed in cents.
3812
+ * @example 200
3813
+ */
3814
+ ongoing_usage_balance_cents: number;
3815
+ /**
3816
+ * The wallet ongoing balance expressed in credits.
3817
+ * @pattern ^[0-9]+.?[0-9]*$
3818
+ * @example "8.0"
3819
+ */
3820
+ credits_ongoing_balance: string;
3821
+ /**
3822
+ * The wallet ongoing usage balance expressed in credits.
3823
+ * @pattern ^[0-9]+.?[0-9]*$
3824
+ * @example "2.0"
3825
+ */
3826
+ credits_ongoing_usage_balance: string;
3792
3827
  }
3793
3828
  export interface WalletsPaginated {
3794
3829
  wallets: WalletObject[];
@@ -4047,7 +4082,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4047
4082
  }
4048
4083
  /**
4049
4084
  * @title Lago API documentation
4050
- * @version 0.53.0-beta
4085
+ * @version 0.57.0-beta
4051
4086
  * @license AGPLv3
4052
4087
  * @baseUrl https://api.getlago.com/api/v1
4053
4088
  * @externalDocs https://github.com/getlago
@@ -4458,11 +4493,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4458
4493
  */
4459
4494
  estimateCreditNote: (data: CreditNoteEstimateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteEstimated, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4460
4495
  /**
4461
- * @description This endpoint voids an existing credit note.
4496
+ * @description This endpoint voids the available credit linked to a specific credit note.
4462
4497
  *
4463
4498
  * @tags credit_notes
4464
4499
  * @name VoidCreditNote
4465
- * @summary Void a credit note
4500
+ * @summary Void available credit
4466
4501
  * @request PUT:/credit_notes/{lago_id}/void
4467
4502
  * @secure
4468
4503
  */
@@ -4610,26 +4645,28 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4610
4645
  * @secure
4611
4646
  */
4612
4647
  generateCustomerCheckoutUrl: (externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<{
4613
- /**
4614
- * 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
4615
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4616
- */
4617
- lago_customer_id?: string | undefined;
4618
- /**
4619
- * The customer external unique identifier (provided by your own application)
4620
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4621
- */
4622
- external_customer_id?: string | undefined;
4623
- /**
4624
- * The Payment Provider name linked to the Customer.
4625
- * @example "stripe"
4626
- */
4627
- payment_provider?: string | undefined;
4628
- /**
4629
- * The new generated Payment Provider Checkout URL for the Customer.
4630
- * @example "https://foo.bar"
4631
- */
4632
- checkout_url?: string | undefined;
4648
+ customer?: {
4649
+ /**
4650
+ * 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
4651
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4652
+ */
4653
+ lago_customer_id?: string | undefined;
4654
+ /**
4655
+ * The customer external unique identifier (provided by your own application)
4656
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4657
+ */
4658
+ external_customer_id?: string | undefined;
4659
+ /**
4660
+ * The Payment Provider name linked to the Customer.
4661
+ * @example "stripe"
4662
+ */
4663
+ payment_provider?: string | undefined;
4664
+ /**
4665
+ * The new generated Payment Provider Checkout URL for the Customer.
4666
+ * @example "https://foo.bar"
4667
+ */
4668
+ checkout_url?: string | undefined;
4669
+ } | undefined;
4633
4670
  }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4634
4671
  };
4635
4672
  events: {
@@ -4644,13 +4681,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4644
4681
  */
4645
4682
  createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4646
4683
  /**
4647
- * @description This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer.
4684
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
4648
4685
  *
4649
4686
  * @tags events
4650
4687
  * @name CreateBatchEvents
4651
4688
  * @summary Batch multiple events
4652
4689
  * @request POST:/events/batch
4653
- * @deprecated
4654
4690
  * @secure
4655
4691
  */
4656
4692
  createBatchEvents: (data: EventBatchInput, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
@@ -4896,6 +4932,44 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4896
4932
  * @secure
4897
4933
  */
4898
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>>;
4899
4973
  /**
4900
4974
  * @description This endpoint resends an invoice for collection and retry a payment.
4901
4975
  *
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 0.53.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,13 +838,12 @@ class Api extends HttpClient {
838
838
  ...params,
839
839
  }),
840
840
  /**
841
- * @description This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer.
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
845
845
  * @summary Batch multiple events
846
846
  * @request POST:/events/batch
847
- * @deprecated
848
847
  * @secure
849
848
  */
850
849
  createBatchEvents: (data, params = {}) => this.request({
@@ -1061,6 +1060,22 @@ class Api extends HttpClient {
1061
1060
  format: "json",
1062
1061
  ...params,
1063
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
+ }),
1064
1079
  /**
1065
1080
  * @description This endpoint resends an invoice for collection and retry a payment.
1066
1081
  *