lago-javascript-client 0.39.1-beta → 0.41.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -648,7 +648,7 @@ export class HttpClient {
648
648
  ...(requestParams.headers || {}),
649
649
  ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
650
650
  },
651
- signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
651
+ signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
652
652
  body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
653
653
  }).then(async (response) => {
654
654
  const r = response;
@@ -681,7 +681,7 @@ export class HttpClient {
681
681
  }
682
682
  /**
683
683
  * @title Lago API documentation
684
- * @version 0.39.0-beta
684
+ * @version 0.41.0-beta
685
685
  * @license AGPLv3
686
686
  * @baseUrl https://api.getlago.com/api/v1
687
687
  * @externalDocs https://github.com/getlago
@@ -1708,9 +1708,10 @@ export class Api extends HttpClient {
1708
1708
  * @request DELETE:/subscriptions/{external_id}
1709
1709
  * @secure
1710
1710
  */
1711
- destroySubscription: (externalId, params = {}) => this.request({
1711
+ destroySubscription: (externalId, query, params = {}) => this.request({
1712
1712
  path: `/subscriptions/${externalId}`,
1713
1713
  method: "DELETE",
1714
+ query: query,
1714
1715
  secure: true,
1715
1716
  format: "json",
1716
1717
  ...params,
@@ -1718,7 +1719,7 @@ export class Api extends HttpClient {
1718
1719
  };
1719
1720
  taxes = {
1720
1721
  /**
1721
- * @description Create a tax
1722
+ * @description This endpoint creates a new tax representing a customizable tax rate applicable to either the organization or a specific customer.
1722
1723
  *
1723
1724
  * @tags taxes
1724
1725
  * @name CreateTax
@@ -1736,11 +1737,11 @@ export class Api extends HttpClient {
1736
1737
  ...params,
1737
1738
  }),
1738
1739
  /**
1739
- * @description Find all taxes in certain organization
1740
+ * @description This endpoint retrieves all existing taxes representing a customizable tax rate applicable to either the organization or a specific customer.
1740
1741
  *
1741
1742
  * @tags taxes
1742
1743
  * @name FindAllTaxes
1743
- * @summary Find taxes
1744
+ * @summary List all taxes
1744
1745
  * @request GET:/taxes
1745
1746
  * @secure
1746
1747
  */
@@ -1753,11 +1754,11 @@ export class Api extends HttpClient {
1753
1754
  ...params,
1754
1755
  }),
1755
1756
  /**
1756
- * @description Update an existing tax by code
1757
+ * @description This endpoint updates an existing tax representing a customizable tax rate applicable to either the organization or a specific customer.
1757
1758
  *
1758
1759
  * @tags taxes
1759
1760
  * @name UpdateTax
1760
- * @summary Update an existing tax
1761
+ * @summary Update a tax
1761
1762
  * @request PUT:/taxes/{code}
1762
1763
  * @secure
1763
1764
  */
@@ -1771,11 +1772,11 @@ export class Api extends HttpClient {
1771
1772
  ...params,
1772
1773
  }),
1773
1774
  /**
1774
- * @description Return a single tax
1775
+ * @description This endpoint retrieves an existing tax representing a customizable tax rate applicable to either the organization or a specific customer. The tax is identified by its unique code.
1775
1776
  *
1776
1777
  * @tags taxes
1777
1778
  * @name FindTax
1778
- * @summary Find tax by code
1779
+ * @summary Retrieve a Tax
1779
1780
  * @request GET:/taxes/{code}
1780
1781
  * @secure
1781
1782
  */
@@ -1787,7 +1788,7 @@ export class Api extends HttpClient {
1787
1788
  ...params,
1788
1789
  }),
1789
1790
  /**
1790
- * @description Delete a tax
1791
+ * @description This endpoint is used to delete a tax.
1791
1792
  *
1792
1793
  * @tags taxes
1793
1794
  * @name DestroyTax
@@ -1944,4 +1945,91 @@ export class Api extends HttpClient {
1944
1945
  ...params,
1945
1946
  }),
1946
1947
  };
1948
+ webhookEndpoints = {
1949
+ /**
1950
+ * @description This endpoint is used to create a webhook endpoint.
1951
+ *
1952
+ * @tags webhook_endpoints
1953
+ * @name CreateWebhookEndpoint
1954
+ * @summary Create a webhook_endpoint
1955
+ * @request POST:/webhook_endpoints
1956
+ * @secure
1957
+ */
1958
+ createWebhookEndpoint: (data, params = {}) => this.request({
1959
+ path: `/webhook_endpoints`,
1960
+ method: "POST",
1961
+ body: data,
1962
+ secure: true,
1963
+ type: ContentType.Json,
1964
+ format: "json",
1965
+ ...params,
1966
+ }),
1967
+ /**
1968
+ * @description This endpoint is used to list all webhook endpoints.
1969
+ *
1970
+ * @tags webhook_endpoints
1971
+ * @name FindAllWebhookEndpoints
1972
+ * @summary List all webhook endpoints
1973
+ * @request GET:/webhook_endpoints
1974
+ * @secure
1975
+ */
1976
+ findAllWebhookEndpoints: (query, params = {}) => this.request({
1977
+ path: `/webhook_endpoints`,
1978
+ method: "GET",
1979
+ query: query,
1980
+ secure: true,
1981
+ format: "json",
1982
+ ...params,
1983
+ }),
1984
+ /**
1985
+ * @description This endpoint is used to update an existing webhook endpoint.
1986
+ *
1987
+ * @tags webhook_endpoints
1988
+ * @name UpdateWebhookEndpoint
1989
+ * @summary Update a webhook endpoint
1990
+ * @request PUT:/webhook_endpoints/{lago_id}
1991
+ * @secure
1992
+ */
1993
+ updateWebhookEndpoint: (lagoId, data, params = {}) => this.request({
1994
+ path: `/webhook_endpoints/${lagoId}`,
1995
+ method: "PUT",
1996
+ body: data,
1997
+ secure: true,
1998
+ type: ContentType.Json,
1999
+ format: "json",
2000
+ ...params,
2001
+ }),
2002
+ /**
2003
+ * @description This endpoint is used to retrieve an existing webhook endpoint.
2004
+ *
2005
+ * @tags webhook_endpoints
2006
+ * @name FindWebhookEndpoint
2007
+ * @summary Retrieve a webhook endpoint
2008
+ * @request GET:/webhook_endpoints/{lago_id}
2009
+ * @secure
2010
+ */
2011
+ findWebhookEndpoint: (lagoId, params = {}) => this.request({
2012
+ path: `/webhook_endpoints/${lagoId}`,
2013
+ method: "GET",
2014
+ secure: true,
2015
+ format: "json",
2016
+ ...params,
2017
+ }),
2018
+ /**
2019
+ * @description This endpoint is used to delete an existing webhook endpoint.
2020
+ *
2021
+ * @tags webhook_endpoints
2022
+ * @name DestroyWebhookEndpoint
2023
+ * @summary Delete a webhook endpoint
2024
+ * @request DELETE:/webhook_endpoints/{lago_id}
2025
+ * @secure
2026
+ */
2027
+ destroyWebhookEndpoint: (lagoId, params = {}) => this.request({
2028
+ path: `/webhook_endpoints/${lagoId}`,
2029
+ method: "DELETE",
2030
+ secure: true,
2031
+ format: "json",
2032
+ ...params,
2033
+ }),
2034
+ };
1947
2035
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "types": "./types/mod.d.ts",
5
5
  "name": "lago-javascript-client",
6
6
  "sideEffects": false,
7
- "version": "v0.39.1-beta",
7
+ "version": "v0.41.0-beta",
8
8
  "description": "Lago JavaScript API Client",
9
9
  "repository": {
10
10
  "type": "git",
@@ -651,7 +651,7 @@ class HttpClient {
651
651
  ...(requestParams.headers || {}),
652
652
  ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
653
653
  },
654
- signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
654
+ signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
655
655
  body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
656
656
  }).then(async (response) => {
657
657
  const r = response;
@@ -685,7 +685,7 @@ class HttpClient {
685
685
  exports.HttpClient = HttpClient;
686
686
  /**
687
687
  * @title Lago API documentation
688
- * @version 0.39.0-beta
688
+ * @version 0.41.0-beta
689
689
  * @license AGPLv3
690
690
  * @baseUrl https://api.getlago.com/api/v1
691
691
  * @externalDocs https://github.com/getlago
@@ -1712,9 +1712,10 @@ class Api extends HttpClient {
1712
1712
  * @request DELETE:/subscriptions/{external_id}
1713
1713
  * @secure
1714
1714
  */
1715
- destroySubscription: (externalId, params = {}) => this.request({
1715
+ destroySubscription: (externalId, query, params = {}) => this.request({
1716
1716
  path: `/subscriptions/${externalId}`,
1717
1717
  method: "DELETE",
1718
+ query: query,
1718
1719
  secure: true,
1719
1720
  format: "json",
1720
1721
  ...params,
@@ -1722,7 +1723,7 @@ class Api extends HttpClient {
1722
1723
  };
1723
1724
  taxes = {
1724
1725
  /**
1725
- * @description Create a tax
1726
+ * @description This endpoint creates a new tax representing a customizable tax rate applicable to either the organization or a specific customer.
1726
1727
  *
1727
1728
  * @tags taxes
1728
1729
  * @name CreateTax
@@ -1740,11 +1741,11 @@ class Api extends HttpClient {
1740
1741
  ...params,
1741
1742
  }),
1742
1743
  /**
1743
- * @description Find all taxes in certain organization
1744
+ * @description This endpoint retrieves all existing taxes representing a customizable tax rate applicable to either the organization or a specific customer.
1744
1745
  *
1745
1746
  * @tags taxes
1746
1747
  * @name FindAllTaxes
1747
- * @summary Find taxes
1748
+ * @summary List all taxes
1748
1749
  * @request GET:/taxes
1749
1750
  * @secure
1750
1751
  */
@@ -1757,11 +1758,11 @@ class Api extends HttpClient {
1757
1758
  ...params,
1758
1759
  }),
1759
1760
  /**
1760
- * @description Update an existing tax by code
1761
+ * @description This endpoint updates an existing tax representing a customizable tax rate applicable to either the organization or a specific customer.
1761
1762
  *
1762
1763
  * @tags taxes
1763
1764
  * @name UpdateTax
1764
- * @summary Update an existing tax
1765
+ * @summary Update a tax
1765
1766
  * @request PUT:/taxes/{code}
1766
1767
  * @secure
1767
1768
  */
@@ -1775,11 +1776,11 @@ class Api extends HttpClient {
1775
1776
  ...params,
1776
1777
  }),
1777
1778
  /**
1778
- * @description Return a single tax
1779
+ * @description This endpoint retrieves an existing tax representing a customizable tax rate applicable to either the organization or a specific customer. The tax is identified by its unique code.
1779
1780
  *
1780
1781
  * @tags taxes
1781
1782
  * @name FindTax
1782
- * @summary Find tax by code
1783
+ * @summary Retrieve a Tax
1783
1784
  * @request GET:/taxes/{code}
1784
1785
  * @secure
1785
1786
  */
@@ -1791,7 +1792,7 @@ class Api extends HttpClient {
1791
1792
  ...params,
1792
1793
  }),
1793
1794
  /**
1794
- * @description Delete a tax
1795
+ * @description This endpoint is used to delete a tax.
1795
1796
  *
1796
1797
  * @tags taxes
1797
1798
  * @name DestroyTax
@@ -1948,5 +1949,92 @@ class Api extends HttpClient {
1948
1949
  ...params,
1949
1950
  }),
1950
1951
  };
1952
+ webhookEndpoints = {
1953
+ /**
1954
+ * @description This endpoint is used to create a webhook endpoint.
1955
+ *
1956
+ * @tags webhook_endpoints
1957
+ * @name CreateWebhookEndpoint
1958
+ * @summary Create a webhook_endpoint
1959
+ * @request POST:/webhook_endpoints
1960
+ * @secure
1961
+ */
1962
+ createWebhookEndpoint: (data, params = {}) => this.request({
1963
+ path: `/webhook_endpoints`,
1964
+ method: "POST",
1965
+ body: data,
1966
+ secure: true,
1967
+ type: ContentType.Json,
1968
+ format: "json",
1969
+ ...params,
1970
+ }),
1971
+ /**
1972
+ * @description This endpoint is used to list all webhook endpoints.
1973
+ *
1974
+ * @tags webhook_endpoints
1975
+ * @name FindAllWebhookEndpoints
1976
+ * @summary List all webhook endpoints
1977
+ * @request GET:/webhook_endpoints
1978
+ * @secure
1979
+ */
1980
+ findAllWebhookEndpoints: (query, params = {}) => this.request({
1981
+ path: `/webhook_endpoints`,
1982
+ method: "GET",
1983
+ query: query,
1984
+ secure: true,
1985
+ format: "json",
1986
+ ...params,
1987
+ }),
1988
+ /**
1989
+ * @description This endpoint is used to update an existing webhook endpoint.
1990
+ *
1991
+ * @tags webhook_endpoints
1992
+ * @name UpdateWebhookEndpoint
1993
+ * @summary Update a webhook endpoint
1994
+ * @request PUT:/webhook_endpoints/{lago_id}
1995
+ * @secure
1996
+ */
1997
+ updateWebhookEndpoint: (lagoId, data, params = {}) => this.request({
1998
+ path: `/webhook_endpoints/${lagoId}`,
1999
+ method: "PUT",
2000
+ body: data,
2001
+ secure: true,
2002
+ type: ContentType.Json,
2003
+ format: "json",
2004
+ ...params,
2005
+ }),
2006
+ /**
2007
+ * @description This endpoint is used to retrieve an existing webhook endpoint.
2008
+ *
2009
+ * @tags webhook_endpoints
2010
+ * @name FindWebhookEndpoint
2011
+ * @summary Retrieve a webhook endpoint
2012
+ * @request GET:/webhook_endpoints/{lago_id}
2013
+ * @secure
2014
+ */
2015
+ findWebhookEndpoint: (lagoId, params = {}) => this.request({
2016
+ path: `/webhook_endpoints/${lagoId}`,
2017
+ method: "GET",
2018
+ secure: true,
2019
+ format: "json",
2020
+ ...params,
2021
+ }),
2022
+ /**
2023
+ * @description This endpoint is used to delete an existing webhook endpoint.
2024
+ *
2025
+ * @tags webhook_endpoints
2026
+ * @name DestroyWebhookEndpoint
2027
+ * @summary Delete a webhook endpoint
2028
+ * @request DELETE:/webhook_endpoints/{lago_id}
2029
+ * @secure
2030
+ */
2031
+ destroyWebhookEndpoint: (lagoId, params = {}) => this.request({
2032
+ path: `/webhook_endpoints/${lagoId}`,
2033
+ method: "DELETE",
2034
+ secure: true,
2035
+ format: "json",
2036
+ ...params,
2037
+ }),
2038
+ };
1951
2039
  }
1952
2040
  exports.Api = Api;
@@ -360,29 +360,31 @@ export interface BaseAppliedTax {
360
360
  */
361
361
  lago_tax_id?: string;
362
362
  /**
363
- * The name of the tax.
364
- * @example "example name"
363
+ * Name of the tax.
364
+ * @example "TVA"
365
365
  */
366
366
  tax_name?: string;
367
367
  /**
368
- * The code of the tax.
369
- * @example "example_code"
368
+ * Unique code used to identify the tax associated with the API request.
369
+ * @example "french_standard_vat"
370
370
  */
371
371
  tax_code?: string;
372
372
  /**
373
- * The rate of the tax.
374
- * @format ^[0-9]+.?[0-9]*$
375
- * @example "25.0"
373
+ * The percentage rate of the tax
374
+ * @example 20
376
375
  */
377
- tax_rate?: string;
376
+ tax_rate?: number;
378
377
  /**
379
- * The description of the tax.
380
- * @example "description"
378
+ * Internal description of the taxe
379
+ * @example "French standard VAT"
381
380
  */
382
381
  tax_description?: string;
383
- /** @example 20 */
382
+ /**
383
+ * Amount of the tax
384
+ * @example 2000
385
+ */
384
386
  amount_cents?: number;
385
- /** The currency of the tax. */
387
+ /** Currency of the tax */
386
388
  amount_currency?: Currency;
387
389
  /**
388
390
  * The date and time when the applied tax 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 applied tax was initially created.
@@ -416,6 +418,15 @@ export interface BillableMetricObject {
416
418
  * @example "GB of storage used in my application"
417
419
  */
418
420
  description?: string | null;
421
+ /**
422
+ * Defines if the billable metric is persisted billing period over billing period.
423
+ *
424
+ * - If set to `true`: the accumulated number of units calculated from the previous billing period is persisted to the next billing period.
425
+ * - If set to `false`: the accumulated number of units is reset to 0 at the end of the billing period.
426
+ * - If not defined in the request, default value is `false`.
427
+ * @example false
428
+ */
429
+ recurring: boolean;
419
430
  /**
420
431
  * Creation date of the billable metric.
421
432
  * @format date-time
@@ -466,6 +477,15 @@ export interface BillableMetricBaseInput {
466
477
  * @example "GB of storage used in my application"
467
478
  */
468
479
  description?: string | null;
480
+ /**
481
+ * Defines if the billable metric is persisted billing period over billing period.
482
+ *
483
+ * - If set to `true`: the accumulated number of units calculated from the previous billing period is persisted to the next billing period.
484
+ * - If set to `false`: the accumulated number of units is reset to 0 at the end of the billing period.
485
+ * - If not defined in the request, default value is `false`.
486
+ * @example false
487
+ */
488
+ recurring?: boolean;
469
489
  /**
470
490
  * Property of the billable metric used for aggregating usage data. This field is not required for `count_agg`.
471
491
  * @example "gb"
@@ -549,6 +569,15 @@ export interface ChargeObject {
549
569
  * @example true
550
570
  */
551
571
  invoiceable?: boolean;
572
+ /**
573
+ * Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
574
+ *
575
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
576
+ * - If set to `false`, the charge is billed in full.
577
+ * - If not defined in the request, default value is `false`.
578
+ * @example false
579
+ */
580
+ prorated?: boolean;
552
581
  /**
553
582
  * The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
554
583
  * @example 1200
@@ -1267,10 +1296,9 @@ export interface CreditNoteObject {
1267
1296
  taxes_amount_cents: number;
1268
1297
  /**
1269
1298
  * The tax rate associated with this specific credit note.
1270
- * @format ^[0-9]+.?[0-9]*$
1271
- * @example "20.0"
1299
+ * @example 20
1272
1300
  */
1273
- taxes_rate: string;
1301
+ taxes_rate: number;
1274
1302
  /**
1275
1303
  * The subtotal of the credit note excluding any applicable taxes, expressed in cents.
1276
1304
  * @example 100
@@ -1605,6 +1633,11 @@ export interface CustomerBillingConfiguration {
1605
1633
  * @example "fr"
1606
1634
  */
1607
1635
  document_locale?: string;
1636
+ /**
1637
+ * Specifies the available payment methods that can be used for this customer when `payment_provider` is set to `stripe`. The `provider_payment_methods` field is an array that allows multiple payment options to be defined. If this field is not explicitly set, all the payment methods are selected. For now, possible values are `card` and `sepa_debit`.
1638
+ * @example ["card","sepa_debit"]
1639
+ */
1640
+ provider_payment_methods?: string[] | null;
1608
1641
  }
1609
1642
  export interface CustomerChargeUsageObject {
1610
1643
  /**
@@ -1673,7 +1706,7 @@ export interface CustomerChargeUsageObject {
1673
1706
  key?: string | null;
1674
1707
  /**
1675
1708
  * The group value.
1676
- * @example "eruope"
1709
+ * @example "europe"
1677
1710
  */
1678
1711
  value?: string;
1679
1712
  /**
@@ -1931,11 +1964,11 @@ export interface CustomerObject {
1931
1964
  /** 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. */
1932
1965
  billing_configuration?: CustomerBillingConfiguration;
1933
1966
  metadata?: CustomerMetadata[];
1934
- /** List of customer taxes */
1935
- taxes?: TaxObject[];
1936
1967
  }
1937
1968
  export type CustomerObjectExtended = CustomerObject & {
1938
1969
  metadata?: CustomerMetadata[];
1970
+ /** List of customer taxes */
1971
+ taxes?: TaxObject[];
1939
1972
  };
1940
1973
  export interface CustomersPaginated {
1941
1974
  customers: CustomerObjectExtended[];
@@ -2222,10 +2255,9 @@ export interface FeeObject {
2222
2255
  taxes_amount_cents: number;
2223
2256
  /**
2224
2257
  * The tax rate associated with this specific fee.
2225
- * @format ^[0-9]+.?[0-9]*$
2226
- * @example "20.0"
2258
+ * @example 20
2227
2259
  */
2228
- taxes_rate: string;
2260
+ taxes_rate: number;
2229
2261
  /**
2230
2262
  * The number of units used to charge the customer. This field indicates the quantity or count of units consumed or utilized in the context of the charge. It helps in determining the basis for calculating the fee or cost associated with the usage of the service or product provided to the customer.
2231
2263
  * @example "0.32"
@@ -2789,7 +2821,7 @@ export interface PaginationMeta {
2789
2821
  export interface Plan {
2790
2822
  plan: PlanObject;
2791
2823
  }
2792
- export interface PlanInput {
2824
+ export interface PlanCreateInput {
2793
2825
  plan: {
2794
2826
  /**
2795
2827
  * The name of the plan.
@@ -2835,7 +2867,106 @@ export interface PlanInput {
2835
2867
  bill_charges_monthly?: boolean | null;
2836
2868
  /**
2837
2869
  * Additional usage-based charges for this plan.
2838
- * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"pay_in_advance":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
2870
+ * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
2871
+ */
2872
+ charges?: {
2873
+ /**
2874
+ * Unique identifier of the billable metric created by Lago.
2875
+ * @format uuid
2876
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2877
+ */
2878
+ billable_metric_id?: string;
2879
+ /**
2880
+ * Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `package`, `percentage` or `volume`.
2881
+ * @example "standard"
2882
+ */
2883
+ charge_model?: "standard" | "graduated" | "package" | "percentage" | "volume";
2884
+ /**
2885
+ * This field determines the billing timing for this specific usage-based charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to false, the charge is due and invoiced at the end of each billing period.
2886
+ * @example false
2887
+ */
2888
+ pay_in_advance?: boolean;
2889
+ /**
2890
+ * This field specifies whether the charge should be included in a proper invoice. If set to false, no invoice will be issued for this charge. You can only set it to `false` when `pay_in_advance` is `true`.
2891
+ * @example true
2892
+ */
2893
+ invoiceable?: boolean;
2894
+ /**
2895
+ * Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
2896
+ *
2897
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
2898
+ * - If set to `false`, the charge is billed in full.
2899
+ * - If not defined in the request, default value is `false`.
2900
+ * @example false
2901
+ */
2902
+ prorated?: boolean;
2903
+ /**
2904
+ * The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
2905
+ * @example 0
2906
+ */
2907
+ min_amount_cents?: number;
2908
+ /** List of all thresholds utilized for calculating the charge. */
2909
+ properties?: ChargeProperties;
2910
+ /** All charge information, sorted by groups. */
2911
+ group_properties?: {
2912
+ /**
2913
+ * Unique identifier of a billable metric group, created by Lago.
2914
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2915
+ */
2916
+ group_id: string;
2917
+ /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
2918
+ values: ChargeProperties;
2919
+ }[];
2920
+ }[];
2921
+ };
2922
+ }
2923
+ export interface PlanUpdateInput {
2924
+ plan: {
2925
+ /**
2926
+ * The name of the plan.
2927
+ * @example "Startup"
2928
+ */
2929
+ name?: string;
2930
+ /**
2931
+ * The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
2932
+ * @example "startup"
2933
+ */
2934
+ code?: string;
2935
+ /**
2936
+ * The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `monthly`, or `weekly`.
2937
+ * @example "monthly"
2938
+ */
2939
+ interval?: "weekly" | "monthly" | "yearly";
2940
+ /**
2941
+ * The description on the plan.
2942
+ * @example "Plan for early stage startups."
2943
+ */
2944
+ description?: string;
2945
+ /**
2946
+ * The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
2947
+ * @example 10000
2948
+ */
2949
+ amount_cents?: number;
2950
+ /** The currency of the plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed. */
2951
+ amount_currency?: Currency;
2952
+ /**
2953
+ * The duration in days during which the base cost of the plan is offered for free.
2954
+ * @example 5
2955
+ */
2956
+ trial_period?: number;
2957
+ /**
2958
+ * This field determines the billing timing for the plan. When set to `true`, the base cost of the plan is due at the beginning of each billing period. Conversely, when set to `false`, the base cost of the plan is due at the end of each billing period.
2959
+ * @example true
2960
+ */
2961
+ pay_in_advance?: boolean;
2962
+ /**
2963
+ * This field, when set to `true`, enables to invoice usage-based charges on monthly basis, even if the cadence of the plan is yearly. This allows customers to pay charges overage on a monthly basis. This can be set to true only if the plan’s interval is `yearly`.
2964
+ * @example null
2965
+ */
2966
+ bill_charges_monthly?: boolean | null;
2967
+ /**
2968
+ * Additional usage-based charges for this plan.
2969
+ * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
2839
2970
  */
2840
2971
  charges?: {
2841
2972
  /**
@@ -2865,6 +2996,15 @@ export interface PlanInput {
2865
2996
  * @example true
2866
2997
  */
2867
2998
  invoiceable?: boolean;
2999
+ /**
3000
+ * Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
3001
+ *
3002
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
3003
+ * - If set to `false`, the charge is billed in full.
3004
+ * - If not defined in the request, default value is `false`.
3005
+ * @example false
3006
+ */
3007
+ prorated?: boolean;
2868
3008
  /**
2869
3009
  * The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
2870
3010
  * @example 0
@@ -2952,7 +3092,7 @@ export interface PlanObject {
2952
3092
  draft_invoices_count: number;
2953
3093
  /**
2954
3094
  * Additional usage-based charges for this plan.
2955
- * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"pay_in_advance":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
3095
+ * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
2956
3096
  */
2957
3097
  charges?: ChargeObject[];
2958
3098
  }
@@ -3114,84 +3254,88 @@ export interface SubscriptionsPaginated {
3114
3254
  export interface Tax {
3115
3255
  tax: TaxObject;
3116
3256
  }
3257
+ export interface TaxBaseInput {
3258
+ /**
3259
+ * Name of the tax.
3260
+ * @example "TVA"
3261
+ */
3262
+ name?: string;
3263
+ /**
3264
+ * Unique code used to identify the tax associated with the API request.
3265
+ * @example "french_standard_vat"
3266
+ */
3267
+ code?: string;
3268
+ /**
3269
+ * The percentage rate of the tax
3270
+ * @format ^[0-9]+.?[0-9]*$
3271
+ * @example "20.0"
3272
+ */
3273
+ rate?: string;
3274
+ /**
3275
+ * Internal description of the taxe
3276
+ * @example "French standard VAT"
3277
+ */
3278
+ description?: string | null;
3279
+ /**
3280
+ * Set to `true` if the tax is used as one of the organization's default
3281
+ * @example true
3282
+ */
3283
+ applied_to_organization?: boolean;
3284
+ }
3285
+ export interface TaxCreateInput {
3286
+ tax: TaxBaseInput;
3287
+ }
3117
3288
  export interface TaxesPaginated {
3118
3289
  taxes: TaxObject[];
3119
3290
  meta: PaginationMeta;
3120
3291
  }
3121
- export interface TaxInput {
3122
- tax: {
3123
- /**
3124
- * The name of the tax.
3125
- * @example "French VAT"
3126
- */
3127
- name?: string;
3128
- /**
3129
- * Unique code used to identify the tax.
3130
- * @example "vat_fr"
3131
- */
3132
- code?: string;
3133
- /**
3134
- * The rate of the tax
3135
- * @format ^[0-9]+.?[0-9]*$
3136
- * @example "15.0"
3137
- */
3138
- rate?: string;
3139
- /**
3140
- * Description of the tax.
3141
- * @example "description"
3142
- */
3143
- description?: string;
3144
- /**
3145
- * Set to `true` if the tax is used as one of the organization's default.
3146
- * @example false
3147
- */
3148
- applied_to_organization?: boolean;
3149
- };
3150
- }
3151
3292
  export interface TaxObject {
3152
3293
  /**
3294
+ * Unique identifier of the tax, created by Lago.
3153
3295
  * @format uuid
3154
3296
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3155
3297
  */
3156
3298
  lago_id: string;
3157
3299
  /**
3158
- * The name of the tax.
3159
- * @example "French VAT"
3300
+ * Name of the tax.
3301
+ * @example "TVA"
3160
3302
  */
3161
3303
  name: string;
3162
3304
  /**
3163
- * Unique code used to identify the tax.
3164
- * @example "vat_fr"
3305
+ * Unique code used to identify the tax associated with the API request.
3306
+ * @example "french_standard_vat"
3165
3307
  */
3166
3308
  code: string;
3167
3309
  /**
3168
- * Description of the tax.
3169
- * @example "description"
3310
+ * Internal description of the taxe
3311
+ * @example "French standard VAT"
3170
3312
  */
3171
3313
  description?: string;
3172
3314
  /**
3173
- * The rate of the tax
3174
- * @format ^[0-9]+.?[0-9]*$
3175
- * @example "25.0"
3315
+ * The percentage rate of the tax
3316
+ * @example 20
3176
3317
  */
3177
- rate?: string;
3318
+ rate: number;
3178
3319
  /**
3179
- * Set to `true` if the tax is used as one of the organization's default.
3320
+ * Set to `true` if the tax is used as one of the organization's default
3180
3321
  * @example true
3181
3322
  */
3182
3323
  applied_to_organization: boolean;
3183
3324
  /**
3184
- * Number of customers this tax is applied to (directly or via the organization's default).
3185
- * @example 12
3325
+ * Number of customers this tax is applied to (directly or via the organization's default)
3326
+ * @example 0
3186
3327
  */
3187
3328
  customers_count: number;
3188
3329
  /**
3189
- * The date and time when the tax 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 tax was initially created.
3330
+ * Creation date of the tax.
3190
3331
  * @format date-time
3191
- * @example "2022-09-14T16:35:31Z"
3332
+ * @example "2023-07-06T14:35:58Z"
3192
3333
  */
3193
3334
  created_at: string;
3194
3335
  }
3336
+ export interface TaxUpdateInput {
3337
+ tax: TaxBaseInput;
3338
+ }
3195
3339
  /** @example "America/Los_Angeles" */
3196
3340
  export declare enum Timezone {
3197
3341
  UTC = "UTC",
@@ -3612,7 +3756,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
3612
3756
  }
3613
3757
  /**
3614
3758
  * @title Lago API documentation
3615
- * @version 0.39.0-beta
3759
+ * @version 0.41.0-beta
3616
3760
  * @license AGPLv3
3617
3761
  * @baseUrl https://api.getlago.com/api/v1
3618
3762
  * @externalDocs https://github.com/getlago
@@ -4378,7 +4522,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4378
4522
  * @request POST:/plans
4379
4523
  * @secure
4380
4524
  */
4381
- createPlan: (data: PlanInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4525
+ createPlan: (data: PlanCreateInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4382
4526
  /**
4383
4527
  * @description This endpoint retrieves all existing plans.
4384
4528
  *
@@ -4409,7 +4553,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4409
4553
  * @request PUT:/plans/{code}
4410
4554
  * @secure
4411
4555
  */
4412
- updatePlan: (code: string, data: PlanInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4556
+ updatePlan: (code: string, data: PlanUpdateInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4413
4557
  /**
4414
4558
  * @description This endpoint retrieves a specific plan.
4415
4559
  *
@@ -4472,6 +4616,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4472
4616
  * @example "premium"
4473
4617
  */
4474
4618
  plan_code?: string;
4619
+ /**
4620
+ * If the field is not defined, Lago will return only `active` subscriptions. However, if you wish to fetch subscriptions by different status you can define them in a status[] query param. Available filter values: `pending`, `canceled`, `terminated`, `active`.
4621
+ * @example ["active","pending"]
4622
+ */
4623
+ status?: ("pending" | "canceled" | "terminated" | "active")[];
4475
4624
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
4476
4625
  /**
4477
4626
  * @description This endpoint allows you to update a subscription.
@@ -4492,11 +4641,17 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4492
4641
  * @request DELETE:/subscriptions/{external_id}
4493
4642
  * @secure
4494
4643
  */
4495
- destroySubscription: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
4644
+ destroySubscription: (externalId: string, query?: {
4645
+ /**
4646
+ * If the field is not defined, Lago will terminate only `active` subscriptions. However, if you wish to cancel a `pending` subscription, please ensure that you include `status=pending` in your request.
4647
+ * @example "pending"
4648
+ */
4649
+ status?: string;
4650
+ }, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
4496
4651
  };
4497
4652
  taxes: {
4498
4653
  /**
4499
- * @description Create a tax
4654
+ * @description This endpoint creates a new tax representing a customizable tax rate applicable to either the organization or a specific customer.
4500
4655
  *
4501
4656
  * @tags taxes
4502
4657
  * @name CreateTax
@@ -4504,50 +4659,50 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4504
4659
  * @request POST:/taxes
4505
4660
  * @secure
4506
4661
  */
4507
- createTax: (data: TaxInput, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4662
+ createTax: (data: TaxCreateInput, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4508
4663
  /**
4509
- * @description Find all taxes in certain organization
4664
+ * @description This endpoint retrieves all existing taxes representing a customizable tax rate applicable to either the organization or a specific customer.
4510
4665
  *
4511
4666
  * @tags taxes
4512
4667
  * @name FindAllTaxes
4513
- * @summary Find taxes
4668
+ * @summary List all taxes
4514
4669
  * @request GET:/taxes
4515
4670
  * @secure
4516
4671
  */
4517
4672
  findAllTaxes: (query?: {
4518
4673
  /**
4519
- * Number of page
4520
- * @example 2
4674
+ * Page number.
4675
+ * @example 1
4521
4676
  */
4522
4677
  page?: number;
4523
4678
  /**
4524
- * Number of records per page
4679
+ * Number of records per page.
4525
4680
  * @example 20
4526
4681
  */
4527
4682
  per_page?: number;
4528
4683
  }, params?: RequestParams) => Promise<HttpResponse<TaxesPaginated, ApiErrorUnauthorized>>;
4529
4684
  /**
4530
- * @description Update an existing tax by code
4685
+ * @description This endpoint updates an existing tax representing a customizable tax rate applicable to either the organization or a specific customer.
4531
4686
  *
4532
4687
  * @tags taxes
4533
4688
  * @name UpdateTax
4534
- * @summary Update an existing tax
4689
+ * @summary Update a tax
4535
4690
  * @request PUT:/taxes/{code}
4536
4691
  * @secure
4537
4692
  */
4538
- updateTax: (code: string, data: TaxInput, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4693
+ updateTax: (code: string, data: TaxUpdateInput, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4539
4694
  /**
4540
- * @description Return a single tax
4695
+ * @description This endpoint retrieves an existing tax representing a customizable tax rate applicable to either the organization or a specific customer. The tax is identified by its unique code.
4541
4696
  *
4542
4697
  * @tags taxes
4543
4698
  * @name FindTax
4544
- * @summary Find tax by code
4699
+ * @summary Retrieve a Tax
4545
4700
  * @request GET:/taxes/{code}
4546
4701
  * @secure
4547
4702
  */
4548
4703
  findTax: (code: string, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorUnauthorized | ApiErrorNotFound>>;
4549
4704
  /**
4550
- * @description Delete a tax
4705
+ * @description This endpoint is used to delete a tax.
4551
4706
  *
4552
4707
  * @tags taxes
4553
4708
  * @name DestroyTax
@@ -4680,5 +4835,113 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4680
4835
  */
4681
4836
  fetchPublicKey: (params?: RequestParams) => Promise<HttpResponse<string, ApiErrorUnauthorized>>;
4682
4837
  };
4838
+ webhookEndpoints: {
4839
+ /**
4840
+ * @description This endpoint is used to create a webhook endpoint.
4841
+ *
4842
+ * @tags webhook_endpoints
4843
+ * @name CreateWebhookEndpoint
4844
+ * @summary Create a webhook_endpoint
4845
+ * @request POST:/webhook_endpoints
4846
+ * @secure
4847
+ */
4848
+ createWebhookEndpoint: (data: {
4849
+ webhook_endpoint?: {
4850
+ /**
4851
+ * The URL of the webhook endpoint.
4852
+ * @example "https://foo.bar"
4853
+ */
4854
+ webhook_url: string;
4855
+ };
4856
+ }, params?: RequestParams) => Promise<HttpResponse<{
4857
+ webhook_endpoint: {
4858
+ /**
4859
+ * Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the webhook endpoint's record within the Lago system.
4860
+ * @format uuid
4861
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4862
+ */
4863
+ lago_id: string;
4864
+ /**
4865
+ * Unique identifier assigned to the organization attached to the webhook endpoint within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the organization’s record within the Lago system.
4866
+ * @format uuid
4867
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4868
+ */
4869
+ lago_organization_id: string;
4870
+ /**
4871
+ * The name of the wallet.
4872
+ * @example "Prepaid"
4873
+ */
4874
+ webhook_url: string;
4875
+ /**
4876
+ * The date of the webhook endpoint creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4877
+ * @format date-time
4878
+ * @example "2022-04-29T08:59:51Z"
4879
+ */
4880
+ created_at: string;
4881
+ };
4882
+ }, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4883
+ /**
4884
+ * @description This endpoint is used to list all webhook endpoints.
4885
+ *
4886
+ * @tags webhook_endpoints
4887
+ * @name FindAllWebhookEndpoints
4888
+ * @summary List all webhook endpoints
4889
+ * @request GET:/webhook_endpoints
4890
+ * @secure
4891
+ */
4892
+ findAllWebhookEndpoints: (query?: {
4893
+ /**
4894
+ * Page number.
4895
+ * @example 1
4896
+ */
4897
+ page?: number;
4898
+ /**
4899
+ * Number of records per page.
4900
+ * @example 20
4901
+ */
4902
+ per_page?: number;
4903
+ }, params?: RequestParams) => Promise<HttpResponse<{
4904
+ webhook_endpoints: any[];
4905
+ meta: PaginationMeta;
4906
+ }, ApiErrorUnauthorized>>;
4907
+ /**
4908
+ * @description This endpoint is used to update an existing webhook endpoint.
4909
+ *
4910
+ * @tags webhook_endpoints
4911
+ * @name UpdateWebhookEndpoint
4912
+ * @summary Update a webhook endpoint
4913
+ * @request PUT:/webhook_endpoints/{lago_id}
4914
+ * @secure
4915
+ */
4916
+ updateWebhookEndpoint: (lagoId: string, data: {
4917
+ webhook_endpoint?: {
4918
+ /**
4919
+ * The URL of the webhook endpoint.
4920
+ * @example "https://foo.bar"
4921
+ */
4922
+ webhook_url: string;
4923
+ };
4924
+ }, params?: RequestParams) => Promise<HttpResponse<any, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4925
+ /**
4926
+ * @description This endpoint is used to retrieve an existing webhook endpoint.
4927
+ *
4928
+ * @tags webhook_endpoints
4929
+ * @name FindWebhookEndpoint
4930
+ * @summary Retrieve a webhook endpoint
4931
+ * @request GET:/webhook_endpoints/{lago_id}
4932
+ * @secure
4933
+ */
4934
+ findWebhookEndpoint: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<any, ApiErrorUnauthorized | ApiErrorNotFound>>;
4935
+ /**
4936
+ * @description This endpoint is used to delete an existing webhook endpoint.
4937
+ *
4938
+ * @tags webhook_endpoints
4939
+ * @name DestroyWebhookEndpoint
4940
+ * @summary Delete a webhook endpoint
4941
+ * @request DELETE:/webhook_endpoints/{lago_id}
4942
+ * @secure
4943
+ */
4944
+ destroyWebhookEndpoint: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<any, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
4945
+ };
4683
4946
  }
4684
4947
  export {};