lago-javascript-client 1.10.0 → 1.12.2

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.
@@ -1437,10 +1437,10 @@ export interface IntegrationCustomer {
1437
1437
  lago_id?: string;
1438
1438
  /**
1439
1439
  * The integration type used for accounting and tax syncs.
1440
- * Accepted values: `netsuite`.
1440
+ * Accepted values: `netsuite, anrok`.
1441
1441
  * @example "netsuite"
1442
1442
  */
1443
- type?: "netsuite";
1443
+ type?: "netsuite" | "anrok";
1444
1444
  /**
1445
1445
  * Unique code used to identify an integration connection.
1446
1446
  * @example "netsuite-eu-1"
@@ -1633,6 +1633,22 @@ export interface CustomerCreateInput {
1633
1633
  * @example "Gavin Belson"
1634
1634
  */
1635
1635
  name?: string | null;
1636
+ /**
1637
+ * First name of the customer
1638
+ * @example "Gavin"
1639
+ */
1640
+ firstname?: string | null;
1641
+ /**
1642
+ * Last name of the customer
1643
+ * @example "Belson"
1644
+ */
1645
+ lastname?: string | null;
1646
+ /**
1647
+ * The type of the customer. It can have one of the following values:
1648
+ * - `company`: the customer is a company.
1649
+ * - `individual`: the customer is an individual.
1650
+ */
1651
+ customer_type?: "company" | "individual" | null;
1636
1652
  /**
1637
1653
  * The phone number of the customer
1638
1654
  * @example "1-171-883-3711 x245"
@@ -1670,6 +1686,14 @@ export interface CustomerCreateInput {
1670
1686
  * @example 30
1671
1687
  */
1672
1688
  net_payment_term?: number | null;
1689
+ /**
1690
+ * Specifies how invoices with a zero total amount should be handled:
1691
+ * - `inherit`: (Default) Follows the organization-level configuration.
1692
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
1693
+ * - `skip`: Invoices with a total amount of zero are not finalized.
1694
+ * @example "inherit"
1695
+ */
1696
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
1673
1697
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1674
1698
  billing_configuration?: CustomerBillingConfiguration;
1675
1699
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
@@ -1683,10 +1707,10 @@ export interface CustomerCreateInput {
1683
1707
  id?: string;
1684
1708
  /**
1685
1709
  * The integration type used for accounting and tax syncs.
1686
- * Accepted values: `netsuite`.
1710
+ * Accepted values: `netsuite, anrok, xero`.
1687
1711
  * @example "netsuite"
1688
1712
  */
1689
- integration_type?: "netsuite";
1713
+ integration_type?: "netsuite" | "anrok" | "xero";
1690
1714
  /**
1691
1715
  * Unique code used to identify an integration connection.
1692
1716
  * @example "netsuite-eu-1"
@@ -1764,7 +1788,7 @@ export interface CustomerMetadata {
1764
1788
  */
1765
1789
  created_at: string;
1766
1790
  }
1767
- export interface CustomerObject {
1791
+ export type CustomerObject = {
1768
1792
  /**
1769
1793
  * 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
1770
1794
  * @format uuid
@@ -1833,6 +1857,22 @@ export interface CustomerObject {
1833
1857
  * @example "Gavin Belson"
1834
1858
  */
1835
1859
  name?: string | null;
1860
+ /**
1861
+ * First name of the customer
1862
+ * @example "Gavin"
1863
+ */
1864
+ firstname?: string | null;
1865
+ /**
1866
+ * Last name of the customer
1867
+ * @example "Belson"
1868
+ */
1869
+ lastname?: string | null;
1870
+ /**
1871
+ * The type of the customer. It can have one of the following values:
1872
+ * - `company`: the customer is a company.
1873
+ * - `individual`: the customer is an individual.
1874
+ */
1875
+ customer_type?: "company" | "individual" | null;
1836
1876
  /**
1837
1877
  * The phone number of the customer
1838
1878
  * @example "1-171-883-3711 x245"
@@ -1877,13 +1917,22 @@ export interface CustomerObject {
1877
1917
  * @example "2022-04-29T08:59:51Z"
1878
1918
  */
1879
1919
  updated_at?: string;
1920
+ /**
1921
+ * Specifies how invoices with a zero total amount should be handled:
1922
+ * - `inherit`: (Default) Follows the organization-level configuration.
1923
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
1924
+ * - `skip`: Invoices with a total amount of zero are not finalized.
1925
+ * @example "inherit"
1926
+ */
1927
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
1880
1928
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1881
1929
  billing_configuration?: CustomerBillingConfiguration;
1882
1930
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1883
1931
  shipping_address?: Address;
1884
- integration_customers?: IntegrationCustomer[];
1885
1932
  metadata?: CustomerMetadata[];
1886
- }
1933
+ } & {
1934
+ integration_customers?: IntegrationCustomer[];
1935
+ };
1887
1936
  export type CustomerObjectExtended = CustomerObject & {
1888
1937
  metadata?: CustomerMetadata[];
1889
1938
  /** List of customer taxes */
@@ -2128,6 +2177,16 @@ export interface FeeObject {
2128
2177
  * @example 100
2129
2178
  */
2130
2179
  amount_cents: number;
2180
+ /**
2181
+ * The cost of this specific fee, excluding any applicable taxes, with precision.
2182
+ * @example "1.0001"
2183
+ */
2184
+ precise_amount?: string;
2185
+ /**
2186
+ * The cost of this specific fee, including any applicable taxes, with precision.
2187
+ * @example "1.0212"
2188
+ */
2189
+ precise_total_amount?: string;
2131
2190
  /** The currency of this specific fee. It indicates the monetary unit in which the fee's cost is expressed. */
2132
2191
  amount_currency: Currency;
2133
2192
  /**
@@ -2135,6 +2194,11 @@ export interface FeeObject {
2135
2194
  * @example 20
2136
2195
  */
2137
2196
  taxes_amount_cents: number;
2197
+ /**
2198
+ * The cost of the tax associated with this specific fee, with precision.
2199
+ * @example "0.20123"
2200
+ */
2201
+ taxes_precise_amount?: string;
2138
2202
  /**
2139
2203
  * The tax rate associated with this specific fee.
2140
2204
  * @example 20
@@ -2473,6 +2537,84 @@ export interface GrossRevenueObject {
2473
2537
  export interface GrossRevenues {
2474
2538
  gross_revenues: GrossRevenueObject[];
2475
2539
  }
2540
+ export interface LifetimeUsage {
2541
+ lifetime_usage: LifetimeUsageObject;
2542
+ }
2543
+ export interface LifetimeUsageInput {
2544
+ lifetime_usage: {
2545
+ /**
2546
+ * The historical usage amount in cents for the subscription (provided by your own application).
2547
+ * @example 100
2548
+ */
2549
+ external_historical_usage_amount_cents: number;
2550
+ };
2551
+ }
2552
+ export interface LifetimeUsageObject {
2553
+ /**
2554
+ * Unique identifier assigned to the lifetime usage record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the lifetime usage record within the Lago system
2555
+ * @format uuid
2556
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2557
+ */
2558
+ lago_id: string;
2559
+ /**
2560
+ * Unique identifier assigned to the subscription record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription record within the Lago system
2561
+ * @format uuid
2562
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2563
+ */
2564
+ lago_subscription_id: string;
2565
+ /**
2566
+ * The subscription external unique identifier (provided by your own application).
2567
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
2568
+ */
2569
+ external_subscription_id: string;
2570
+ /**
2571
+ * The historical usage amount in cents for the subscription (provided by your own application).
2572
+ * @example 100
2573
+ */
2574
+ external_historical_usage_amount_cents: number;
2575
+ /**
2576
+ * The total invoiced usage amount in cents for the subscription.
2577
+ * @example 100
2578
+ */
2579
+ invoiced_usage_amount_cents: number;
2580
+ /**
2581
+ * The current usage amount in cents for the subscription on the current billing period.
2582
+ * @example 100
2583
+ */
2584
+ current_usage_amount_cents: number;
2585
+ /**
2586
+ * The recording start date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
2587
+ * @format date-time
2588
+ * @example "2024-01-01T00:00:00Z"
2589
+ */
2590
+ from_datetime: string;
2591
+ /**
2592
+ * The recording end date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
2593
+ * @format date-time
2594
+ * @example "2024-12-31T23:59:59Z"
2595
+ */
2596
+ to_datetime: string;
2597
+ /** Array of usage thresholds attached to the subscription's plan. */
2598
+ usage_thresholds?: LifetimeUsageThresholdObject[];
2599
+ }
2600
+ export interface LifetimeUsageThresholdObject {
2601
+ /**
2602
+ * The usage threshold amount in cents.
2603
+ * @example 100
2604
+ */
2605
+ amount_cents: number;
2606
+ /**
2607
+ * The completion ratio of the usage threshold.
2608
+ * @example 0.5
2609
+ */
2610
+ completion_ratio: number;
2611
+ /**
2612
+ * The date and time when the usage threshold was reached. The date and time must be in ISO 8601 format.
2613
+ * @format date-time
2614
+ * @example "2024-01-01T00:00:00Z"
2615
+ */
2616
+ reached_at: string | null;
2617
+ }
2476
2618
  /** Minimum commitment for this plan. */
2477
2619
  export type MinimumCommitmentInput = {
2478
2620
  /**
@@ -2639,7 +2781,7 @@ export interface InvoiceMetadataObject {
2639
2781
  */
2640
2782
  created_at?: string;
2641
2783
  }
2642
- export interface InvoiceObject {
2784
+ export type InvoiceObject = {
2643
2785
  /**
2644
2786
  * Unique identifier assigned to the fee within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the fee's record within the Lago system.
2645
2787
  * @format uuid
@@ -2769,12 +2911,13 @@ export interface InvoiceObject {
2769
2911
  * @example "https://getlago.com/invoice/file"
2770
2912
  */
2771
2913
  file_url?: string;
2914
+ } & {
2772
2915
  /** The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
2773
2916
  customer?: CustomerObject;
2774
2917
  metadata?: InvoiceMetadataObject[];
2775
2918
  applied_taxes?: InvoiceAppliedTaxObject[];
2776
2919
  applied_usage_thresholds?: AppliedUsageThresholdObject[] | null;
2777
- }
2920
+ };
2778
2921
  export type InvoiceObjectExtended = InvoiceObject & {
2779
2922
  credits?: CreditObject[];
2780
2923
  fees?: FeeObject[];
@@ -2998,6 +3141,11 @@ export interface OrganizationObject {
2998
3141
  billing_configuration: OrganizationBillingConfiguration;
2999
3142
  /** List of default organization taxes */
3000
3143
  taxes?: TaxObject[];
3144
+ /**
3145
+ * Indicates whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
3146
+ * @example false
3147
+ */
3148
+ finalize_zero_amount_invoice?: boolean;
3001
3149
  }
3002
3150
  export interface OrganizationUpdateInput {
3003
3151
  organization: {
@@ -3085,6 +3233,11 @@ export interface OrganizationUpdateInput {
3085
3233
  email_settings?: ("invoice.finalized" | "credit_note.created")[];
3086
3234
  /** The custom billing settings for your organization. */
3087
3235
  billing_configuration?: OrganizationBillingConfiguration;
3236
+ /**
3237
+ * Determines whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
3238
+ * @example false
3239
+ */
3240
+ finalize_zero_amount_invoice?: boolean;
3088
3241
  };
3089
3242
  }
3090
3243
  export interface OverdueBalanceObject {
@@ -3136,6 +3289,48 @@ export interface PaginationMeta {
3136
3289
  */
3137
3290
  total_count: number;
3138
3291
  }
3292
+ export interface PaymentRequestObject {
3293
+ /**
3294
+ * Unique identifier of the payment request, created by Lago.
3295
+ * @format uuid
3296
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3297
+ */
3298
+ lago_id: string;
3299
+ /**
3300
+ * The customer's email address used for sending dunning notifications
3301
+ * @format email
3302
+ * @example "dinesh@piedpiper.test"
3303
+ */
3304
+ email: string;
3305
+ /**
3306
+ * The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
3307
+ * @example 100
3308
+ */
3309
+ amount_cents: number;
3310
+ /** The currency of the payment request. */
3311
+ amount_currency: Currency;
3312
+ /**
3313
+ * The status of the payment associated with the payment request. It can have one of the following values:
3314
+ * - `pending`: the payment is pending, waiting for payment processing in the payment provider or when the invoice is emitted but users have not updated the payment status through the endpoint.
3315
+ * - `succeeded`: the payment of the payment request has been successfully processed.
3316
+ * - `failed`: the payment of the payment request has failed or encountered an error during processing.
3317
+ * @example "succeeded"
3318
+ */
3319
+ payment_status: "pending" | "succeeded" | "failed";
3320
+ /**
3321
+ * The date and time when the payment request was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the payment request was initially created.
3322
+ * @format date-time
3323
+ * @example "2022-04-29T08:59:51Z"
3324
+ */
3325
+ created_at: string;
3326
+ /** The customer on which the payment request applies. It refers to the customer account or entity associated with the payment request. */
3327
+ customer: any;
3328
+ invoices: any[];
3329
+ }
3330
+ export interface PaymentRequestsPaginated {
3331
+ payment_requests: PaymentRequestObject[];
3332
+ meta: PaginationMeta;
3333
+ }
3139
3334
  export interface Plan {
3140
3335
  plan: PlanObject;
3141
3336
  }
@@ -4055,13 +4250,13 @@ export interface WalletObject {
4055
4250
  */
4056
4251
  rate_amount: string;
4057
4252
  /**
4058
- * The current wallet balance expressed in credits.
4253
+ * The current wallet balance expressed in credits. This reflects the available balance after all transactions are settled.
4059
4254
  * @pattern ^[0-9]+.?[0-9]*$
4060
4255
  * @example "28.0"
4061
4256
  */
4062
4257
  credits_balance: string;
4063
4258
  /**
4064
- * The current wallet balance expressed in cents.
4259
+ * The current wallet balance expressed in cents. This reflects the available balance after all transactions are settled.
4065
4260
  * @example 1000
4066
4261
  */
4067
4262
  balance_cents: number;
@@ -4182,23 +4377,23 @@ export interface WalletObject {
4182
4377
  }[];
4183
4378
  }[];
4184
4379
  /**
4185
- * The wallet ongoing balance expressed in cents.
4380
+ * The ongoing wallet balance expressed in cents. This represents the `balance_cents` minus the `ongoing_usage_balance_cents`, showing the real time balance after accounting for current usage including taxes.
4186
4381
  * @example 800
4187
4382
  */
4188
4383
  ongoing_balance_cents: number;
4189
4384
  /**
4190
- * The wallet ongoing usage balance expressed in cents.
4385
+ * The ongoing usage balance of the wallet, expressed in cents. This reflects all current usage including taxes.
4191
4386
  * @example 200
4192
4387
  */
4193
4388
  ongoing_usage_balance_cents: number;
4194
4389
  /**
4195
- * The wallet ongoing balance expressed in credits.
4390
+ * The ongoing wallet balance expressed in credits. This represents the `credits_balance` minus the `credits_ongoing_usage_balance`, showing the real time balance after accounting for current usage including taxes.
4196
4391
  * @pattern ^[0-9]+.?[0-9]*$
4197
4392
  * @example "8.0"
4198
4393
  */
4199
4394
  credits_ongoing_balance: string;
4200
4395
  /**
4201
- * The wallet ongoing usage balance expressed in credits.
4396
+ * The ongoing usage balance of the wallet, expressed in credits. This reflects all current usage including taxes.
4202
4397
  * @pattern ^[0-9]+.?[0-9]*$
4203
4398
  * @example "2.0"
4204
4399
  */
@@ -4544,7 +4739,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4544
4739
  }
4545
4740
  /**
4546
4741
  * @title Lago API documentation
4547
- * @version 1.10.0
4742
+ * @version 1.12.2
4548
4743
  * @license AGPLv3
4549
4744
  * @baseUrl https://{region}.getlago.com/api/v1
4550
4745
  * @externalDocs https://github.com/getlago
@@ -5061,7 +5256,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5061
5256
  */
5062
5257
  portal_url: string;
5063
5258
  };
5064
- }, ApiErrorForbidden | ApiErrorUnauthorized | ApiErrorNotFound>>;
5259
+ }, ApiErrorUnauthorized | ApiErrorNotFound>>;
5065
5260
  /**
5066
5261
  * @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period.
5067
5262
  *
@@ -5534,6 +5729,62 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5534
5729
  */
5535
5730
  updateOrganization: (data: OrganizationUpdateInput, params?: RequestParams) => Promise<HttpResponse<Organization, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
5536
5731
  };
5732
+ paymentRequests: {
5733
+ /**
5734
+ * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
5735
+ *
5736
+ * @tags payment_requests
5737
+ * @name CreatePaymentRequest
5738
+ * @summary Create a payment request
5739
+ * @request POST:/payment_requests
5740
+ * @secure
5741
+ */
5742
+ createPaymentRequest: (data: {
5743
+ payment_request: {
5744
+ /**
5745
+ * The customer external unique identifier (provided by your own application)
5746
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5747
+ */
5748
+ customer_external_id?: string;
5749
+ /**
5750
+ * The customer's email address used for sending dunning notifications
5751
+ * @format email
5752
+ * @example "dinesh@piedpiper.test"
5753
+ */
5754
+ email: string;
5755
+ /** A list of Lago IDs for the customer's overdue invoices to start the dunning process */
5756
+ lago_invoice_ids: string[];
5757
+ };
5758
+ }, params?: RequestParams) => Promise<HttpResponse<{
5759
+ payment_request: PaymentRequestObject;
5760
+ }, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
5761
+ /**
5762
+ * @description This endpoint is used to list all existing payment requests.
5763
+ *
5764
+ * @tags payment_requests
5765
+ * @name FindAllPaymentRequests
5766
+ * @summary List all payment requests
5767
+ * @request GET:/payment_requests
5768
+ * @secure
5769
+ */
5770
+ findAllPaymentRequests: (query?: {
5771
+ /**
5772
+ * Page number.
5773
+ * @example 1
5774
+ */
5775
+ page?: number;
5776
+ /**
5777
+ * Number of records per page.
5778
+ * @example 20
5779
+ */
5780
+ per_page?: number;
5781
+ /**
5782
+ * Unique identifier assigned to the customer in your application.
5783
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5784
+ */
5785
+ external_customer_id?: string;
5786
+ }, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized>>;
5787
+ };
5537
5788
  plans: {
5538
5789
  /**
5539
5790
  * @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.
@@ -5680,6 +5931,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5680
5931
  */
5681
5932
  status?: string;
5682
5933
  }, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
5934
+ /**
5935
+ * @description This endpoint enables the retrieval of the lifetime usage of a subscription.
5936
+ *
5937
+ * @tags subscriptions
5938
+ * @name GetSubscriptionLifetimeUsage
5939
+ * @summary Retrive subscription lifetime usage
5940
+ * @request GET:/subscriptions/{external_id}/lifetime_usage
5941
+ * @secure
5942
+ */
5943
+ getSubscriptionLifetimeUsage: (externalId: string, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
5944
+ /**
5945
+ * @description This endpoint allows you to update the lifetime usage of a subscription.
5946
+ *
5947
+ * @tags subscriptions
5948
+ * @name UpdateSubscriptionLifetimeUsage
5949
+ * @summary Update a subscription lifetime usage
5950
+ * @request PUT:/subscriptions/{external_id}/lifetime_usage
5951
+ * @secure
5952
+ */
5953
+ updateSubscriptionLifetimeUsage: (externalId: string, data: LifetimeUsageInput, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
5683
5954
  };
5684
5955
  taxes: {
5685
5956
  /**
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 1.10.0
151
+ * @version 1.12.2
152
152
  * @license AGPLv3
153
153
  * @baseUrl https://{region}.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
@@ -1172,6 +1172,43 @@ export class Api extends HttpClient {
1172
1172
  ...params,
1173
1173
  }),
1174
1174
  };
1175
+ paymentRequests = {
1176
+ /**
1177
+ * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
1178
+ *
1179
+ * @tags payment_requests
1180
+ * @name CreatePaymentRequest
1181
+ * @summary Create a payment request
1182
+ * @request POST:/payment_requests
1183
+ * @secure
1184
+ */
1185
+ createPaymentRequest: (data, params = {}) => this.request({
1186
+ path: `/payment_requests`,
1187
+ method: "POST",
1188
+ body: data,
1189
+ secure: true,
1190
+ type: ContentType.Json,
1191
+ format: "json",
1192
+ ...params,
1193
+ }),
1194
+ /**
1195
+ * @description This endpoint is used to list all existing payment requests.
1196
+ *
1197
+ * @tags payment_requests
1198
+ * @name FindAllPaymentRequests
1199
+ * @summary List all payment requests
1200
+ * @request GET:/payment_requests
1201
+ * @secure
1202
+ */
1203
+ findAllPaymentRequests: (query, params = {}) => this.request({
1204
+ path: `/payment_requests`,
1205
+ method: "GET",
1206
+ query: query,
1207
+ secure: true,
1208
+ format: "json",
1209
+ ...params,
1210
+ }),
1211
+ };
1175
1212
  plans = {
1176
1213
  /**
1177
1214
  * @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.
@@ -1346,6 +1383,40 @@ export class Api extends HttpClient {
1346
1383
  format: "json",
1347
1384
  ...params,
1348
1385
  }),
1386
+ /**
1387
+ * @description This endpoint enables the retrieval of the lifetime usage of a subscription.
1388
+ *
1389
+ * @tags subscriptions
1390
+ * @name GetSubscriptionLifetimeUsage
1391
+ * @summary Retrive subscription lifetime usage
1392
+ * @request GET:/subscriptions/{external_id}/lifetime_usage
1393
+ * @secure
1394
+ */
1395
+ getSubscriptionLifetimeUsage: (externalId, params = {}) => this.request({
1396
+ path: `/subscriptions/${externalId}/lifetime_usage`,
1397
+ method: "GET",
1398
+ secure: true,
1399
+ format: "json",
1400
+ ...params,
1401
+ }),
1402
+ /**
1403
+ * @description This endpoint allows you to update the lifetime usage of a subscription.
1404
+ *
1405
+ * @tags subscriptions
1406
+ * @name UpdateSubscriptionLifetimeUsage
1407
+ * @summary Update a subscription lifetime usage
1408
+ * @request PUT:/subscriptions/{external_id}/lifetime_usage
1409
+ * @secure
1410
+ */
1411
+ updateSubscriptionLifetimeUsage: (externalId, data, params = {}) => this.request({
1412
+ path: `/subscriptions/${externalId}/lifetime_usage`,
1413
+ method: "PUT",
1414
+ body: data,
1415
+ secure: true,
1416
+ type: ContentType.Json,
1417
+ format: "json",
1418
+ ...params,
1419
+ }),
1349
1420
  };
1350
1421
  taxes = {
1351
1422
  /**
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.10.0",
6
+ "version": "v1.12.2",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",
@@ -1437,10 +1437,10 @@ export interface IntegrationCustomer {
1437
1437
  lago_id?: string;
1438
1438
  /**
1439
1439
  * The integration type used for accounting and tax syncs.
1440
- * Accepted values: `netsuite`.
1440
+ * Accepted values: `netsuite, anrok`.
1441
1441
  * @example "netsuite"
1442
1442
  */
1443
- type?: "netsuite";
1443
+ type?: "netsuite" | "anrok";
1444
1444
  /**
1445
1445
  * Unique code used to identify an integration connection.
1446
1446
  * @example "netsuite-eu-1"
@@ -1633,6 +1633,22 @@ export interface CustomerCreateInput {
1633
1633
  * @example "Gavin Belson"
1634
1634
  */
1635
1635
  name?: string | null;
1636
+ /**
1637
+ * First name of the customer
1638
+ * @example "Gavin"
1639
+ */
1640
+ firstname?: string | null;
1641
+ /**
1642
+ * Last name of the customer
1643
+ * @example "Belson"
1644
+ */
1645
+ lastname?: string | null;
1646
+ /**
1647
+ * The type of the customer. It can have one of the following values:
1648
+ * - `company`: the customer is a company.
1649
+ * - `individual`: the customer is an individual.
1650
+ */
1651
+ customer_type?: "company" | "individual" | null;
1636
1652
  /**
1637
1653
  * The phone number of the customer
1638
1654
  * @example "1-171-883-3711 x245"
@@ -1670,6 +1686,14 @@ export interface CustomerCreateInput {
1670
1686
  * @example 30
1671
1687
  */
1672
1688
  net_payment_term?: number | null;
1689
+ /**
1690
+ * Specifies how invoices with a zero total amount should be handled:
1691
+ * - `inherit`: (Default) Follows the organization-level configuration.
1692
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
1693
+ * - `skip`: Invoices with a total amount of zero are not finalized.
1694
+ * @example "inherit"
1695
+ */
1696
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
1673
1697
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1674
1698
  billing_configuration?: CustomerBillingConfiguration;
1675
1699
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
@@ -1683,10 +1707,10 @@ export interface CustomerCreateInput {
1683
1707
  id?: string;
1684
1708
  /**
1685
1709
  * The integration type used for accounting and tax syncs.
1686
- * Accepted values: `netsuite`.
1710
+ * Accepted values: `netsuite, anrok, xero`.
1687
1711
  * @example "netsuite"
1688
1712
  */
1689
- integration_type?: "netsuite";
1713
+ integration_type?: "netsuite" | "anrok" | "xero";
1690
1714
  /**
1691
1715
  * Unique code used to identify an integration connection.
1692
1716
  * @example "netsuite-eu-1"
@@ -1764,7 +1788,7 @@ export interface CustomerMetadata {
1764
1788
  */
1765
1789
  created_at: string;
1766
1790
  }
1767
- export interface CustomerObject {
1791
+ export type CustomerObject = {
1768
1792
  /**
1769
1793
  * 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
1770
1794
  * @format uuid
@@ -1833,6 +1857,22 @@ export interface CustomerObject {
1833
1857
  * @example "Gavin Belson"
1834
1858
  */
1835
1859
  name?: string | null;
1860
+ /**
1861
+ * First name of the customer
1862
+ * @example "Gavin"
1863
+ */
1864
+ firstname?: string | null;
1865
+ /**
1866
+ * Last name of the customer
1867
+ * @example "Belson"
1868
+ */
1869
+ lastname?: string | null;
1870
+ /**
1871
+ * The type of the customer. It can have one of the following values:
1872
+ * - `company`: the customer is a company.
1873
+ * - `individual`: the customer is an individual.
1874
+ */
1875
+ customer_type?: "company" | "individual" | null;
1836
1876
  /**
1837
1877
  * The phone number of the customer
1838
1878
  * @example "1-171-883-3711 x245"
@@ -1877,13 +1917,22 @@ export interface CustomerObject {
1877
1917
  * @example "2022-04-29T08:59:51Z"
1878
1918
  */
1879
1919
  updated_at?: string;
1920
+ /**
1921
+ * Specifies how invoices with a zero total amount should be handled:
1922
+ * - `inherit`: (Default) Follows the organization-level configuration.
1923
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
1924
+ * - `skip`: Invoices with a total amount of zero are not finalized.
1925
+ * @example "inherit"
1926
+ */
1927
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
1880
1928
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1881
1929
  billing_configuration?: CustomerBillingConfiguration;
1882
1930
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1883
1931
  shipping_address?: Address;
1884
- integration_customers?: IntegrationCustomer[];
1885
1932
  metadata?: CustomerMetadata[];
1886
- }
1933
+ } & {
1934
+ integration_customers?: IntegrationCustomer[];
1935
+ };
1887
1936
  export type CustomerObjectExtended = CustomerObject & {
1888
1937
  metadata?: CustomerMetadata[];
1889
1938
  /** List of customer taxes */
@@ -2128,6 +2177,16 @@ export interface FeeObject {
2128
2177
  * @example 100
2129
2178
  */
2130
2179
  amount_cents: number;
2180
+ /**
2181
+ * The cost of this specific fee, excluding any applicable taxes, with precision.
2182
+ * @example "1.0001"
2183
+ */
2184
+ precise_amount?: string;
2185
+ /**
2186
+ * The cost of this specific fee, including any applicable taxes, with precision.
2187
+ * @example "1.0212"
2188
+ */
2189
+ precise_total_amount?: string;
2131
2190
  /** The currency of this specific fee. It indicates the monetary unit in which the fee's cost is expressed. */
2132
2191
  amount_currency: Currency;
2133
2192
  /**
@@ -2135,6 +2194,11 @@ export interface FeeObject {
2135
2194
  * @example 20
2136
2195
  */
2137
2196
  taxes_amount_cents: number;
2197
+ /**
2198
+ * The cost of the tax associated with this specific fee, with precision.
2199
+ * @example "0.20123"
2200
+ */
2201
+ taxes_precise_amount?: string;
2138
2202
  /**
2139
2203
  * The tax rate associated with this specific fee.
2140
2204
  * @example 20
@@ -2473,6 +2537,84 @@ export interface GrossRevenueObject {
2473
2537
  export interface GrossRevenues {
2474
2538
  gross_revenues: GrossRevenueObject[];
2475
2539
  }
2540
+ export interface LifetimeUsage {
2541
+ lifetime_usage: LifetimeUsageObject;
2542
+ }
2543
+ export interface LifetimeUsageInput {
2544
+ lifetime_usage: {
2545
+ /**
2546
+ * The historical usage amount in cents for the subscription (provided by your own application).
2547
+ * @example 100
2548
+ */
2549
+ external_historical_usage_amount_cents: number;
2550
+ };
2551
+ }
2552
+ export interface LifetimeUsageObject {
2553
+ /**
2554
+ * Unique identifier assigned to the lifetime usage record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the lifetime usage record within the Lago system
2555
+ * @format uuid
2556
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2557
+ */
2558
+ lago_id: string;
2559
+ /**
2560
+ * Unique identifier assigned to the subscription record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription record within the Lago system
2561
+ * @format uuid
2562
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2563
+ */
2564
+ lago_subscription_id: string;
2565
+ /**
2566
+ * The subscription external unique identifier (provided by your own application).
2567
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
2568
+ */
2569
+ external_subscription_id: string;
2570
+ /**
2571
+ * The historical usage amount in cents for the subscription (provided by your own application).
2572
+ * @example 100
2573
+ */
2574
+ external_historical_usage_amount_cents: number;
2575
+ /**
2576
+ * The total invoiced usage amount in cents for the subscription.
2577
+ * @example 100
2578
+ */
2579
+ invoiced_usage_amount_cents: number;
2580
+ /**
2581
+ * The current usage amount in cents for the subscription on the current billing period.
2582
+ * @example 100
2583
+ */
2584
+ current_usage_amount_cents: number;
2585
+ /**
2586
+ * The recording start date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
2587
+ * @format date-time
2588
+ * @example "2024-01-01T00:00:00Z"
2589
+ */
2590
+ from_datetime: string;
2591
+ /**
2592
+ * The recording end date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
2593
+ * @format date-time
2594
+ * @example "2024-12-31T23:59:59Z"
2595
+ */
2596
+ to_datetime: string;
2597
+ /** Array of usage thresholds attached to the subscription's plan. */
2598
+ usage_thresholds?: LifetimeUsageThresholdObject[];
2599
+ }
2600
+ export interface LifetimeUsageThresholdObject {
2601
+ /**
2602
+ * The usage threshold amount in cents.
2603
+ * @example 100
2604
+ */
2605
+ amount_cents: number;
2606
+ /**
2607
+ * The completion ratio of the usage threshold.
2608
+ * @example 0.5
2609
+ */
2610
+ completion_ratio: number;
2611
+ /**
2612
+ * The date and time when the usage threshold was reached. The date and time must be in ISO 8601 format.
2613
+ * @format date-time
2614
+ * @example "2024-01-01T00:00:00Z"
2615
+ */
2616
+ reached_at: string | null;
2617
+ }
2476
2618
  /** Minimum commitment for this plan. */
2477
2619
  export type MinimumCommitmentInput = {
2478
2620
  /**
@@ -2639,7 +2781,7 @@ export interface InvoiceMetadataObject {
2639
2781
  */
2640
2782
  created_at?: string;
2641
2783
  }
2642
- export interface InvoiceObject {
2784
+ export type InvoiceObject = {
2643
2785
  /**
2644
2786
  * Unique identifier assigned to the fee within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the fee's record within the Lago system.
2645
2787
  * @format uuid
@@ -2769,12 +2911,13 @@ export interface InvoiceObject {
2769
2911
  * @example "https://getlago.com/invoice/file"
2770
2912
  */
2771
2913
  file_url?: string;
2914
+ } & {
2772
2915
  /** The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
2773
2916
  customer?: CustomerObject;
2774
2917
  metadata?: InvoiceMetadataObject[];
2775
2918
  applied_taxes?: InvoiceAppliedTaxObject[];
2776
2919
  applied_usage_thresholds?: AppliedUsageThresholdObject[] | null;
2777
- }
2920
+ };
2778
2921
  export type InvoiceObjectExtended = InvoiceObject & {
2779
2922
  credits?: CreditObject[];
2780
2923
  fees?: FeeObject[];
@@ -2998,6 +3141,11 @@ export interface OrganizationObject {
2998
3141
  billing_configuration: OrganizationBillingConfiguration;
2999
3142
  /** List of default organization taxes */
3000
3143
  taxes?: TaxObject[];
3144
+ /**
3145
+ * Indicates whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
3146
+ * @example false
3147
+ */
3148
+ finalize_zero_amount_invoice?: boolean;
3001
3149
  }
3002
3150
  export interface OrganizationUpdateInput {
3003
3151
  organization: {
@@ -3085,6 +3233,11 @@ export interface OrganizationUpdateInput {
3085
3233
  email_settings?: ("invoice.finalized" | "credit_note.created")[];
3086
3234
  /** The custom billing settings for your organization. */
3087
3235
  billing_configuration?: OrganizationBillingConfiguration;
3236
+ /**
3237
+ * Determines whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
3238
+ * @example false
3239
+ */
3240
+ finalize_zero_amount_invoice?: boolean;
3088
3241
  };
3089
3242
  }
3090
3243
  export interface OverdueBalanceObject {
@@ -3136,6 +3289,48 @@ export interface PaginationMeta {
3136
3289
  */
3137
3290
  total_count: number;
3138
3291
  }
3292
+ export interface PaymentRequestObject {
3293
+ /**
3294
+ * Unique identifier of the payment request, created by Lago.
3295
+ * @format uuid
3296
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3297
+ */
3298
+ lago_id: string;
3299
+ /**
3300
+ * The customer's email address used for sending dunning notifications
3301
+ * @format email
3302
+ * @example "dinesh@piedpiper.test"
3303
+ */
3304
+ email: string;
3305
+ /**
3306
+ * The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
3307
+ * @example 100
3308
+ */
3309
+ amount_cents: number;
3310
+ /** The currency of the payment request. */
3311
+ amount_currency: Currency;
3312
+ /**
3313
+ * The status of the payment associated with the payment request. It can have one of the following values:
3314
+ * - `pending`: the payment is pending, waiting for payment processing in the payment provider or when the invoice is emitted but users have not updated the payment status through the endpoint.
3315
+ * - `succeeded`: the payment of the payment request has been successfully processed.
3316
+ * - `failed`: the payment of the payment request has failed or encountered an error during processing.
3317
+ * @example "succeeded"
3318
+ */
3319
+ payment_status: "pending" | "succeeded" | "failed";
3320
+ /**
3321
+ * The date and time when the payment request was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the payment request was initially created.
3322
+ * @format date-time
3323
+ * @example "2022-04-29T08:59:51Z"
3324
+ */
3325
+ created_at: string;
3326
+ /** The customer on which the payment request applies. It refers to the customer account or entity associated with the payment request. */
3327
+ customer: any;
3328
+ invoices: any[];
3329
+ }
3330
+ export interface PaymentRequestsPaginated {
3331
+ payment_requests: PaymentRequestObject[];
3332
+ meta: PaginationMeta;
3333
+ }
3139
3334
  export interface Plan {
3140
3335
  plan: PlanObject;
3141
3336
  }
@@ -4055,13 +4250,13 @@ export interface WalletObject {
4055
4250
  */
4056
4251
  rate_amount: string;
4057
4252
  /**
4058
- * The current wallet balance expressed in credits.
4253
+ * The current wallet balance expressed in credits. This reflects the available balance after all transactions are settled.
4059
4254
  * @pattern ^[0-9]+.?[0-9]*$
4060
4255
  * @example "28.0"
4061
4256
  */
4062
4257
  credits_balance: string;
4063
4258
  /**
4064
- * The current wallet balance expressed in cents.
4259
+ * The current wallet balance expressed in cents. This reflects the available balance after all transactions are settled.
4065
4260
  * @example 1000
4066
4261
  */
4067
4262
  balance_cents: number;
@@ -4182,23 +4377,23 @@ export interface WalletObject {
4182
4377
  }[];
4183
4378
  }[];
4184
4379
  /**
4185
- * The wallet ongoing balance expressed in cents.
4380
+ * The ongoing wallet balance expressed in cents. This represents the `balance_cents` minus the `ongoing_usage_balance_cents`, showing the real time balance after accounting for current usage including taxes.
4186
4381
  * @example 800
4187
4382
  */
4188
4383
  ongoing_balance_cents: number;
4189
4384
  /**
4190
- * The wallet ongoing usage balance expressed in cents.
4385
+ * The ongoing usage balance of the wallet, expressed in cents. This reflects all current usage including taxes.
4191
4386
  * @example 200
4192
4387
  */
4193
4388
  ongoing_usage_balance_cents: number;
4194
4389
  /**
4195
- * The wallet ongoing balance expressed in credits.
4390
+ * The ongoing wallet balance expressed in credits. This represents the `credits_balance` minus the `credits_ongoing_usage_balance`, showing the real time balance after accounting for current usage including taxes.
4196
4391
  * @pattern ^[0-9]+.?[0-9]*$
4197
4392
  * @example "8.0"
4198
4393
  */
4199
4394
  credits_ongoing_balance: string;
4200
4395
  /**
4201
- * The wallet ongoing usage balance expressed in credits.
4396
+ * The ongoing usage balance of the wallet, expressed in credits. This reflects all current usage including taxes.
4202
4397
  * @pattern ^[0-9]+.?[0-9]*$
4203
4398
  * @example "2.0"
4204
4399
  */
@@ -4544,7 +4739,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4544
4739
  }
4545
4740
  /**
4546
4741
  * @title Lago API documentation
4547
- * @version 1.10.0
4742
+ * @version 1.12.2
4548
4743
  * @license AGPLv3
4549
4744
  * @baseUrl https://{region}.getlago.com/api/v1
4550
4745
  * @externalDocs https://github.com/getlago
@@ -5061,7 +5256,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5061
5256
  */
5062
5257
  portal_url: string;
5063
5258
  };
5064
- }, ApiErrorForbidden | ApiErrorUnauthorized | ApiErrorNotFound>>;
5259
+ }, ApiErrorUnauthorized | ApiErrorNotFound>>;
5065
5260
  /**
5066
5261
  * @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period.
5067
5262
  *
@@ -5534,6 +5729,62 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5534
5729
  */
5535
5730
  updateOrganization: (data: OrganizationUpdateInput, params?: RequestParams) => Promise<HttpResponse<Organization, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
5536
5731
  };
5732
+ paymentRequests: {
5733
+ /**
5734
+ * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
5735
+ *
5736
+ * @tags payment_requests
5737
+ * @name CreatePaymentRequest
5738
+ * @summary Create a payment request
5739
+ * @request POST:/payment_requests
5740
+ * @secure
5741
+ */
5742
+ createPaymentRequest: (data: {
5743
+ payment_request: {
5744
+ /**
5745
+ * The customer external unique identifier (provided by your own application)
5746
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5747
+ */
5748
+ customer_external_id?: string;
5749
+ /**
5750
+ * The customer's email address used for sending dunning notifications
5751
+ * @format email
5752
+ * @example "dinesh@piedpiper.test"
5753
+ */
5754
+ email: string;
5755
+ /** A list of Lago IDs for the customer's overdue invoices to start the dunning process */
5756
+ lago_invoice_ids: string[];
5757
+ };
5758
+ }, params?: RequestParams) => Promise<HttpResponse<{
5759
+ payment_request: PaymentRequestObject;
5760
+ }, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
5761
+ /**
5762
+ * @description This endpoint is used to list all existing payment requests.
5763
+ *
5764
+ * @tags payment_requests
5765
+ * @name FindAllPaymentRequests
5766
+ * @summary List all payment requests
5767
+ * @request GET:/payment_requests
5768
+ * @secure
5769
+ */
5770
+ findAllPaymentRequests: (query?: {
5771
+ /**
5772
+ * Page number.
5773
+ * @example 1
5774
+ */
5775
+ page?: number;
5776
+ /**
5777
+ * Number of records per page.
5778
+ * @example 20
5779
+ */
5780
+ per_page?: number;
5781
+ /**
5782
+ * Unique identifier assigned to the customer in your application.
5783
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5784
+ */
5785
+ external_customer_id?: string;
5786
+ }, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized>>;
5787
+ };
5537
5788
  plans: {
5538
5789
  /**
5539
5790
  * @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.
@@ -5680,6 +5931,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5680
5931
  */
5681
5932
  status?: string;
5682
5933
  }, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
5934
+ /**
5935
+ * @description This endpoint enables the retrieval of the lifetime usage of a subscription.
5936
+ *
5937
+ * @tags subscriptions
5938
+ * @name GetSubscriptionLifetimeUsage
5939
+ * @summary Retrive subscription lifetime usage
5940
+ * @request GET:/subscriptions/{external_id}/lifetime_usage
5941
+ * @secure
5942
+ */
5943
+ getSubscriptionLifetimeUsage: (externalId: string, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
5944
+ /**
5945
+ * @description This endpoint allows you to update the lifetime usage of a subscription.
5946
+ *
5947
+ * @tags subscriptions
5948
+ * @name UpdateSubscriptionLifetimeUsage
5949
+ * @summary Update a subscription lifetime usage
5950
+ * @request PUT:/subscriptions/{external_id}/lifetime_usage
5951
+ * @secure
5952
+ */
5953
+ updateSubscriptionLifetimeUsage: (externalId: string, data: LifetimeUsageInput, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
5683
5954
  };
5684
5955
  taxes: {
5685
5956
  /**
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 1.10.0
155
+ * @version 1.12.2
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://{region}.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -1176,6 +1176,43 @@ class Api extends HttpClient {
1176
1176
  ...params,
1177
1177
  }),
1178
1178
  };
1179
+ paymentRequests = {
1180
+ /**
1181
+ * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
1182
+ *
1183
+ * @tags payment_requests
1184
+ * @name CreatePaymentRequest
1185
+ * @summary Create a payment request
1186
+ * @request POST:/payment_requests
1187
+ * @secure
1188
+ */
1189
+ createPaymentRequest: (data, params = {}) => this.request({
1190
+ path: `/payment_requests`,
1191
+ method: "POST",
1192
+ body: data,
1193
+ secure: true,
1194
+ type: ContentType.Json,
1195
+ format: "json",
1196
+ ...params,
1197
+ }),
1198
+ /**
1199
+ * @description This endpoint is used to list all existing payment requests.
1200
+ *
1201
+ * @tags payment_requests
1202
+ * @name FindAllPaymentRequests
1203
+ * @summary List all payment requests
1204
+ * @request GET:/payment_requests
1205
+ * @secure
1206
+ */
1207
+ findAllPaymentRequests: (query, params = {}) => this.request({
1208
+ path: `/payment_requests`,
1209
+ method: "GET",
1210
+ query: query,
1211
+ secure: true,
1212
+ format: "json",
1213
+ ...params,
1214
+ }),
1215
+ };
1179
1216
  plans = {
1180
1217
  /**
1181
1218
  * @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.
@@ -1350,6 +1387,40 @@ class Api extends HttpClient {
1350
1387
  format: "json",
1351
1388
  ...params,
1352
1389
  }),
1390
+ /**
1391
+ * @description This endpoint enables the retrieval of the lifetime usage of a subscription.
1392
+ *
1393
+ * @tags subscriptions
1394
+ * @name GetSubscriptionLifetimeUsage
1395
+ * @summary Retrive subscription lifetime usage
1396
+ * @request GET:/subscriptions/{external_id}/lifetime_usage
1397
+ * @secure
1398
+ */
1399
+ getSubscriptionLifetimeUsage: (externalId, params = {}) => this.request({
1400
+ path: `/subscriptions/${externalId}/lifetime_usage`,
1401
+ method: "GET",
1402
+ secure: true,
1403
+ format: "json",
1404
+ ...params,
1405
+ }),
1406
+ /**
1407
+ * @description This endpoint allows you to update the lifetime usage of a subscription.
1408
+ *
1409
+ * @tags subscriptions
1410
+ * @name UpdateSubscriptionLifetimeUsage
1411
+ * @summary Update a subscription lifetime usage
1412
+ * @request PUT:/subscriptions/{external_id}/lifetime_usage
1413
+ * @secure
1414
+ */
1415
+ updateSubscriptionLifetimeUsage: (externalId, data, params = {}) => this.request({
1416
+ path: `/subscriptions/${externalId}/lifetime_usage`,
1417
+ method: "PUT",
1418
+ body: data,
1419
+ secure: true,
1420
+ type: ContentType.Json,
1421
+ format: "json",
1422
+ ...params,
1423
+ }),
1353
1424
  };
1354
1425
  taxes = {
1355
1426
  /**