lago-javascript-client 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -399,8 +399,6 @@ export interface BillableMetricObject {
399
399
  * @example "seconds"
400
400
  */
401
401
  weighted_interval?: "seconds" | null;
402
- /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
403
- group?: BillableMetricGroup;
404
402
  filters?: BillableMetricFilterObject[];
405
403
  /**
406
404
  * Number of active subscriptions using this billable metric.
@@ -458,8 +456,6 @@ export interface BillableMetricBaseInput {
458
456
  * @example "seconds"
459
457
  */
460
458
  weighted_interval?: "seconds" | null;
461
- /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
462
- group?: BillableMetricGroup;
463
459
  filters?: BillableMetricFilterInput[];
464
460
  }
465
461
  export interface BillableMetricCreateInput {
@@ -488,33 +484,6 @@ export interface BillableMetricFilterObject {
488
484
  export interface BillableMetricUpdateInput {
489
485
  billable_metric: BillableMetricBaseInput;
490
486
  }
491
- /**
492
- * Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric.
493
- * @deprecated
494
- */
495
- export interface BillableMetricGroup {
496
- /**
497
- * Name of the event property used to group values.
498
- * @example "region"
499
- */
500
- key: string;
501
- /**
502
- * Array of strings or objects representing all possible values.
503
- * @example ["us-east-1","us-east-2","eu-west-1"]
504
- */
505
- values: (string | {
506
- /**
507
- * Name of the event property used to group values.
508
- * @example "region"
509
- */
510
- key: string;
511
- /**
512
- * Array of strings representing all possible values.
513
- * @example ["us-east-1","us-east-2","eu-west-1"]
514
- */
515
- values: string[];
516
- })[];
517
- }
518
487
  export interface BillableMetricsPaginated {
519
488
  billable_metrics: BillableMetricObject[];
520
489
  meta: PaginationMeta;
@@ -608,11 +577,6 @@ export interface ChargeObject {
608
577
  properties?: ChargeProperties;
609
578
  /** List of filters used to apply differentiated pricing based on additional event properties. */
610
579
  filters?: ChargeFilterObject[];
611
- /**
612
- * All charge information, sorted by groups.
613
- * @deprecated
614
- */
615
- group_properties?: GroupPropertiesObject[];
616
580
  /** All taxes applied to the charge. */
617
581
  taxes?: TaxObject[];
618
582
  }
@@ -1368,6 +1332,36 @@ export interface Customer {
1368
1332
  customer: CustomerObjectExtended;
1369
1333
  }
1370
1334
  /** 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. */
1335
+ export interface Address {
1336
+ /**
1337
+ * The first line of the billing address
1338
+ * @example "5230 Penfield Ave"
1339
+ */
1340
+ address_line1?: string | null;
1341
+ /**
1342
+ * The second line of the billing address
1343
+ * @example null
1344
+ */
1345
+ address_line2?: string | null;
1346
+ /**
1347
+ * The city of the customer's billing address
1348
+ * @example "Woodland Hills"
1349
+ */
1350
+ city?: string | null;
1351
+ /** Country code of the customer's billing address. Format must be ISO 3166 (alpha-2) */
1352
+ country?: Country;
1353
+ /**
1354
+ * The state of the customer's billing address
1355
+ * @example "CA"
1356
+ */
1357
+ state?: string | null;
1358
+ /**
1359
+ * The zipcode of the customer's billing address
1360
+ * @example "91364"
1361
+ */
1362
+ zipcode?: string | null;
1363
+ }
1364
+ /** 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. */
1371
1365
  export interface CustomerBillingConfiguration {
1372
1366
  /**
1373
1367
  * The grace period, expressed in days, for the invoice. This period refers to the additional time granted to the customer beyond the invoice due date to adjust usage and line items
@@ -1406,19 +1400,25 @@ export interface CustomerBillingConfiguration {
1406
1400
  */
1407
1401
  document_locale?: string;
1408
1402
  /**
1409
- * 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`.
1403
+ * 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, the payment methods will be set to `[card]`. For now, possible values are `card`, `sepa_debit`, `us_bank_account`, `bacs_debit` and `link`. Note that when `link` is selected, `card` should also be provided in the array.
1410
1404
  * @example ["card","sepa_debit"]
1411
1405
  */
1412
1406
  provider_payment_methods?: string[] | null;
1413
1407
  }
1414
1408
  /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
1415
1409
  export interface IntegrationCustomer {
1410
+ /**
1411
+ * A unique identifier for the integration customer object in the Lago application.
1412
+ * @format uuid
1413
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1414
+ */
1415
+ lago_id?: string;
1416
1416
  /**
1417
1417
  * The integration type used for accounting and tax syncs.
1418
1418
  * Accepted values: `netsuite`.
1419
1419
  * @example "netsuite"
1420
1420
  */
1421
- integration_type?: "netsuite";
1421
+ type?: "netsuite";
1422
1422
  /**
1423
1423
  * Unique code used to identify an integration connection.
1424
1424
  * @example "netsuite-eu-1"
@@ -1491,46 +1491,6 @@ export type CustomerChargeGroupedUsageObject = {
1491
1491
  grouped_by?: Record<string, string>;
1492
1492
  /** Array of filter object, representing multiple dimensions for a charge item. */
1493
1493
  filters?: CustomerChargeFiltersUsageObject;
1494
- /** Array of group object, representing multiple dimensions for a charge item. */
1495
- groups?: CustomerChargeGroupsUsageObject;
1496
- }[];
1497
- /**
1498
- * Array of group object, representing multiple dimensions for a charge item.
1499
- * @deprecated
1500
- */
1501
- export type CustomerChargeGroupsUsageObject = {
1502
- /**
1503
- * Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system.
1504
- * @format uuid
1505
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1506
- */
1507
- lago_id?: string;
1508
- /**
1509
- * The group key, only returned for groups with two dimensions.
1510
- * @example null
1511
- */
1512
- key?: string | null;
1513
- /**
1514
- * The group value.
1515
- * @example "europe"
1516
- */
1517
- value?: string;
1518
- /**
1519
- * The number of units consumed for a specific group related to a charge item.
1520
- * @pattern ^[0-9]+.?[0-9]*$
1521
- * @example "0.9"
1522
- */
1523
- units?: string;
1524
- /**
1525
- * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
1526
- * @example 10
1527
- */
1528
- events_count?: number;
1529
- /**
1530
- * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
1531
- * @example 1000
1532
- */
1533
- amount_cents?: number;
1534
1494
  }[];
1535
1495
  export interface CustomerChargeUsageObject {
1536
1496
  /**
@@ -1592,12 +1552,10 @@ export interface CustomerChargeUsageObject {
1592
1552
  * The aggregation type of the billable metric used for this charge. Possible values are `count_agg`, `sum_agg`, `max_agg` or `unique_count_agg`.
1593
1553
  * @example "sum_agg"
1594
1554
  */
1595
- aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg";
1555
+ aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "weighted_sum_agg" | "latest_agg";
1596
1556
  };
1597
1557
  /** Array of filter object, representing multiple dimensions for a charge item. */
1598
1558
  filters?: CustomerChargeFiltersUsageObject;
1599
- /** Array of group object, representing multiple dimensions for a charge item. */
1600
- groups: CustomerChargeGroupsUsageObject;
1601
1559
  /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
1602
1560
  grouped_usage?: CustomerChargeGroupedUsageObject;
1603
1561
  }
@@ -1692,8 +1650,42 @@ export interface CustomerCreateInput {
1692
1650
  net_payment_term?: number | null;
1693
1651
  /** 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. */
1694
1652
  billing_configuration?: CustomerBillingConfiguration;
1695
- /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
1696
- integration_customer?: IntegrationCustomer;
1653
+ /** 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. */
1654
+ shipping_address?: Address;
1655
+ integration_customers?: {
1656
+ /**
1657
+ * A unique identifier for the integration customer object in the Lago application.
1658
+ * @format uuid
1659
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1660
+ */
1661
+ id?: string;
1662
+ /**
1663
+ * The integration type used for accounting and tax syncs.
1664
+ * Accepted values: `netsuite`.
1665
+ * @example "netsuite"
1666
+ */
1667
+ integration_type?: "netsuite";
1668
+ /**
1669
+ * Unique code used to identify an integration connection.
1670
+ * @example "netsuite-eu-1"
1671
+ */
1672
+ integration_code?: string;
1673
+ /**
1674
+ * The customer ID within the integration's system. If this field is not provided, Lago has the option to create a new customer record within the integration's system on behalf of the customer.
1675
+ * @example "cus_12345"
1676
+ */
1677
+ external_customer_id?: string;
1678
+ /**
1679
+ * Set this field to `true` if you want to create a customer record in the integration's system. This option is applicable only when the `external_customer_id` is null and the `sync_with_provider` field is set to `true`. By default, the value is set to `false`
1680
+ * @example true
1681
+ */
1682
+ sync_with_provider?: boolean;
1683
+ /**
1684
+ * This optional field is needed only when working with `netsuite` connection.
1685
+ * @example "2"
1686
+ */
1687
+ subsidiary_id?: string;
1688
+ }[];
1697
1689
  /** Set of key-value pairs that you can attach to a customer. This can be useful for storing additional information about the customer in a structured format */
1698
1690
  metadata?: {
1699
1691
  /**
@@ -1865,8 +1857,9 @@ export interface CustomerObject {
1865
1857
  updated_at?: string;
1866
1858
  /** 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. */
1867
1859
  billing_configuration?: CustomerBillingConfiguration;
1868
- /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
1869
- integration_customer?: IntegrationCustomer;
1860
+ /** 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. */
1861
+ shipping_address?: Address;
1862
+ integration_customers?: IntegrationCustomer[];
1870
1863
  metadata?: CustomerMetadata[];
1871
1864
  }
1872
1865
  export type CustomerObjectExtended = CustomerObject & {
@@ -1934,45 +1927,12 @@ export interface Event {
1934
1927
  event: EventObject;
1935
1928
  }
1936
1929
  export interface EventBatchInput {
1937
- events: EventInput[];
1938
- }
1939
- export interface EventEstimateFeesInput {
1940
- event: {
1941
- /**
1942
- * The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
1943
- * @example "storage"
1944
- */
1945
- code: string;
1946
- /**
1947
- * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1948
- * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1949
- * @deprecated
1950
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1951
- */
1952
- external_customer_id?: string;
1953
- /**
1954
- * The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided.
1955
- * @example "sub_1234567890"
1956
- */
1957
- external_subscription_id?: string;
1958
- /** This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. */
1959
- properties?: object;
1960
- };
1961
- }
1962
- export interface EventInput {
1963
- event: {
1930
+ events: {
1964
1931
  /**
1965
1932
  * This field represents a unique identifier for the event. It is crucial for ensuring idempotency, meaning that each event can be uniquely identified and processed without causing any unintended side effects.
1966
1933
  * @example "transaction_1234567890"
1967
1934
  */
1968
1935
  transaction_id: string;
1969
- /**
1970
- * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1971
- * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1972
- * @deprecated
1973
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1974
- */
1975
- external_customer_id?: string;
1976
1936
  /**
1977
1937
  * The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided.
1978
1938
  * @example "sub_1234567890"
@@ -1995,8 +1955,27 @@ export interface EventInput {
1995
1955
  * @example {"gb":10}
1996
1956
  */
1997
1957
  properties?: Record<string, string | number>;
1958
+ }[];
1959
+ }
1960
+ export interface EventEstimateFeesInput {
1961
+ event: {
1962
+ /**
1963
+ * The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
1964
+ * @example "storage"
1965
+ */
1966
+ code: string;
1967
+ /**
1968
+ * The unique identifier of the subscription within your application.
1969
+ * @example "sub_1234567890"
1970
+ */
1971
+ external_subscription_id: string;
1972
+ /** This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. */
1973
+ properties?: object;
1998
1974
  };
1999
1975
  }
1976
+ export interface EventInput {
1977
+ event: any;
1978
+ }
2000
1979
  export interface EventObject {
2001
1980
  /**
2002
1981
  * Unique identifier assigned to the event within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the event's record within the Lago system
@@ -2015,13 +1994,6 @@ export interface EventObject {
2015
1994
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2016
1995
  */
2017
1996
  lago_customer_id: string | null;
2018
- /**
2019
- * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
2020
- * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
2021
- * @deprecated
2022
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
2023
- */
2024
- external_customer_id: string | null;
2025
1997
  /**
2026
1998
  * The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
2027
1999
  * @example "storage"
@@ -2052,7 +2024,7 @@ export interface EventObject {
2052
2024
  * The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided.
2053
2025
  * @example "sub_1234567890"
2054
2026
  */
2055
- external_subscription_id: string | null;
2027
+ external_subscription_id: string;
2056
2028
  /**
2057
2029
  * The creation date of the event's record in the Lago application, presented in the ISO 8601 datetime format, specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record was created within the Lago application
2058
2030
  * @format date-time
@@ -2078,13 +2050,6 @@ export interface FeeObject {
2078
2050
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2079
2051
  */
2080
2052
  lago_id?: string | null;
2081
- /**
2082
- * Unique identifier assigned to the group that the fee belongs to
2083
- * @deprecated
2084
- * @format uuid
2085
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2086
- */
2087
- lago_group_id?: string | null;
2088
2053
  /**
2089
2054
  * Unique identifier assigned to the charge filter that the fee belongs to
2090
2055
  * @format uuid
@@ -2432,12 +2397,6 @@ export interface FeeObject {
2432
2397
  filter_invoice_display_name?: string;
2433
2398
  /** Key value list of event properties */
2434
2399
  filters?: Record<string, string[]>;
2435
- /**
2436
- * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
2437
- * @deprecated
2438
- * @example "Transactions - ACH"
2439
- */
2440
- group_invoice_display_name?: string;
2441
2400
  /**
2442
2401
  * Unique identifier of the fee item, created by Lago. It can be the identifier of the `add-on`, the identifier of the `charge`, the identifier of the `credit` or the identifier of the `subscription`.
2443
2402
  * @format uuid
@@ -2480,49 +2439,17 @@ export interface GrossRevenueObject {
2480
2439
  * The total amount of revenue for a period, expressed in cents.
2481
2440
  * @example 50000
2482
2441
  */
2483
- amount_cents?: number;
2442
+ amount_cents: number;
2484
2443
  /** The currency of revenue analytics. Format must be ISO 4217. */
2485
- currency?: Currency;
2486
- }
2487
- export interface GrossRevenues {
2488
- gross_revenues: GrossRevenueObject[];
2489
- }
2490
- export interface GroupObject {
2491
- /**
2492
- * Unique identifier of a specific group associated with the billable metric.
2493
- * @format uuid
2494
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2495
- */
2496
- lago_id: string;
2497
- /**
2498
- * Key of a specific group associated with the billable metric.
2499
- * @example "region"
2500
- */
2501
- key: string;
2502
- /**
2503
- * One of the values for a specific group associated with the billable metric.
2504
- * @example "us-east-1"
2505
- */
2506
- value: string;
2507
- }
2508
- export interface GroupPropertiesObject {
2509
- /**
2510
- * Unique identifier of a billable metric group, created by Lago.
2511
- * @format uuid
2512
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2513
- */
2514
- group_id: string;
2444
+ currency: Currency;
2515
2445
  /**
2516
- * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual group will be used as the default display name.
2517
- * @example "AWS"
2446
+ * Contains invoices count.
2447
+ * @example 10
2518
2448
  */
2519
- invoice_display_name?: string;
2520
- /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
2521
- values: ChargeProperties;
2449
+ invoices_count: number;
2522
2450
  }
2523
- export interface GroupsPaginated {
2524
- groups: GroupObject[];
2525
- meta: PaginationMeta;
2451
+ export interface GrossRevenues {
2452
+ gross_revenues: GrossRevenueObject[];
2526
2453
  }
2527
2454
  /** Minimum commitment for this plan. */
2528
2455
  export type MinimumCommitmentInput = {
@@ -2637,7 +2564,7 @@ export interface InvoiceCollectionObject {
2637
2564
  * The total amount of revenue for a period, expressed in cents.
2638
2565
  * @example 50000
2639
2566
  */
2640
- amount_cents: number;
2567
+ amount_cents?: number;
2641
2568
  /** The currency of revenue analytics. Format must be ISO 4217. */
2642
2569
  currency?: Currency;
2643
2570
  }
@@ -2725,6 +2652,11 @@ export interface InvoiceObject {
2725
2652
  * @example "2022-04-30"
2726
2653
  */
2727
2654
  payment_due_date?: string;
2655
+ /**
2656
+ * Specifies if the payment is considered as overdue.
2657
+ * @example true
2658
+ */
2659
+ payment_overdue?: boolean;
2728
2660
  /**
2729
2661
  * The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
2730
2662
  * @example 30
@@ -3108,6 +3040,28 @@ export interface OrganizationUpdateInput {
3108
3040
  billing_configuration?: OrganizationBillingConfiguration;
3109
3041
  };
3110
3042
  }
3043
+ export interface OverdueBalanceObject {
3044
+ /**
3045
+ * Identifies the month to analyze revenue.
3046
+ * @example "2023-11-01T00:00:00.000Z"
3047
+ */
3048
+ month: string;
3049
+ /**
3050
+ * The total amount of revenue for a period, expressed in cents.
3051
+ * @example 50000
3052
+ */
3053
+ amount_cents: number;
3054
+ /** The currency of revenue analytics. Format must be ISO 4217. */
3055
+ currency: Currency;
3056
+ /**
3057
+ * The Lago invoice IDs associated with the revenue.
3058
+ * @example ["5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"]
3059
+ */
3060
+ lago_invoice_ids: string[];
3061
+ }
3062
+ export interface OverdueBalances {
3063
+ overdue_balances: OverdueBalanceObject[];
3064
+ }
3111
3065
  export interface PaginationMeta {
3112
3066
  /**
3113
3067
  * Current page.
@@ -3196,7 +3150,7 @@ export interface PlanCreateInput {
3196
3150
  minimum_commitment?: MinimumCommitmentInput;
3197
3151
  /**
3198
3152
  * Additional usage-based charges for this plan.
3199
- * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","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,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","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,"invoice_display_name":"Setup","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":[]}]
3153
+ * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","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"}]}},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{}},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","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"}]}},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","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"}}]
3200
3154
  */
3201
3155
  charges?: {
3202
3156
  /**
@@ -3241,19 +3195,6 @@ export interface PlanCreateInput {
3241
3195
  min_amount_cents?: number;
3242
3196
  /** List of all thresholds utilized for calculating the charge. */
3243
3197
  properties?: ChargeProperties;
3244
- /**
3245
- * All charge information, sorted by groups.
3246
- * @deprecated
3247
- */
3248
- group_properties?: {
3249
- /**
3250
- * Unique identifier of a billable metric group, created by Lago.
3251
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3252
- */
3253
- group_id: string;
3254
- /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3255
- values: ChargeProperties;
3256
- }[];
3257
3198
  /** List of filters used to apply differentiated pricing based on additional event properties. */
3258
3199
  filters?: ChargeFilterInput[];
3259
3200
  /**
@@ -3325,19 +3266,6 @@ export interface PlanOverridesObject {
3325
3266
  min_amount_cents?: number;
3326
3267
  /** List of all thresholds utilized for calculating the charge. */
3327
3268
  properties?: ChargeProperties;
3328
- /**
3329
- * All charge information, sorted by groups.
3330
- * @deprecated
3331
- */
3332
- group_properties?: {
3333
- /**
3334
- * Unique identifier of a billable metric group, created by Lago.
3335
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3336
- */
3337
- group_id: string;
3338
- /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3339
- values: ChargeProperties;
3340
- }[];
3341
3269
  /** List of filters used to apply differentiated pricing based on additional event properties. */
3342
3270
  filters?: ChargeFilterInput[];
3343
3271
  /**
@@ -3405,7 +3333,7 @@ export interface PlanUpdateInput {
3405
3333
  minimum_commitment?: MinimumCommitmentInput;
3406
3334
  /**
3407
3335
  * Additional usage-based charges for this plan.
3408
- * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","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,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","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,"invoice_display_name":"Setup","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":[]}]
3336
+ * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","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"}]}},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{}},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","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"}]}},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","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"}}]
3409
3337
  */
3410
3338
  charges?: {
3411
3339
  /**
@@ -3456,19 +3384,6 @@ export interface PlanUpdateInput {
3456
3384
  min_amount_cents?: number;
3457
3385
  /** List of all thresholds utilized for calculating the charge. */
3458
3386
  properties?: ChargeProperties;
3459
- /**
3460
- * All charge information, sorted by groups.
3461
- * @deprecated
3462
- */
3463
- group_properties?: {
3464
- /**
3465
- * Unique identifier of a billable metric group, created by Lago.
3466
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3467
- */
3468
- group_id: string;
3469
- /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3470
- values: ChargeProperties;
3471
- }[];
3472
3387
  /** List of filters used to apply differentiated pricing based on additional event properties. */
3473
3388
  filters?: ChargeFilterInput[];
3474
3389
  /**
@@ -4393,9 +4308,9 @@ export declare class HttpClient<SecurityDataType = unknown> {
4393
4308
  }
4394
4309
  /**
4395
4310
  * @title Lago API documentation
4396
- * @version 1.5.0
4311
+ * @version 1.7.0
4397
4312
  * @license AGPLv3
4398
- * @baseUrl https://api.getlago.com/api/v1
4313
+ * @baseUrl https://{region}.getlago.com/api/v1
4399
4314
  * @externalDocs https://github.com/getlago
4400
4315
  * @contact <tech@getlago.com>
4401
4316
  *
@@ -4550,6 +4465,29 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4550
4465
  */
4551
4466
  months?: number;
4552
4467
  }, params?: RequestParams) => Promise<HttpResponse<Mrrs, ApiErrorUnauthorized>>;
4468
+ /**
4469
+ * @description Overdue balance is the total amount associated with overdue invoices (invoices with pending or failed payments which are past their due dates).
4470
+ *
4471
+ * @tags analytics
4472
+ * @name FindAllOverdueBalances
4473
+ * @summary List overdue balance
4474
+ * @request GET:/analytics/overdue_balance
4475
+ * @secure
4476
+ */
4477
+ findAllOverdueBalances: (query?: {
4478
+ /** Currency of revenue analytics. Format must be ISO 4217. */
4479
+ currency?: Currency;
4480
+ /**
4481
+ * The customer external unique identifier (provided by your own application). Use it to filter revenue analytics at the customer level.
4482
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4483
+ */
4484
+ external_customer_id?: string;
4485
+ /**
4486
+ * Show data only for given number of months.
4487
+ * @example 12
4488
+ */
4489
+ months?: number;
4490
+ }, params?: RequestParams) => Promise<HttpResponse<OverdueBalances, ApiErrorUnauthorized>>;
4553
4491
  };
4554
4492
  appliedCoupons: {
4555
4493
  /**
@@ -4656,28 +4594,6 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4656
4594
  * @secure
4657
4595
  */
4658
4596
  findBillableMetric: (code: string, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiErrorUnauthorized | ApiErrorNotFound>>;
4659
- /**
4660
- * @description This endpoint retrieves all groups for a billable metric.
4661
- *
4662
- * @tags billable_metrics
4663
- * @name FindAllBillableMetricGroups
4664
- * @summary Find a billable metric's groups
4665
- * @request GET:/billable_metrics/{code}/groups
4666
- * @deprecated
4667
- * @secure
4668
- */
4669
- findAllBillableMetricGroups: (code: string, query?: {
4670
- /**
4671
- * Page number.
4672
- * @example 1
4673
- */
4674
- page?: number;
4675
- /**
4676
- * Number of records per page.
4677
- * @example 20
4678
- */
4679
- per_page?: number;
4680
- }, params?: RequestParams) => Promise<HttpResponse<GroupsPaginated, ApiErrorUnauthorized>>;
4681
4597
  };
4682
4598
  coupons: {
4683
4599
  /**
@@ -5154,7 +5070,17 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5154
5070
  * @request PUT:/fees/{lago_id}
5155
5071
  * @secure
5156
5072
  */
5157
- updateFee: (lagoId: string, data: FeeUpdateInput, params?: RequestParams) => Promise<HttpResponse<Fee, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
5073
+ updateFee: (lagoId: string, data: FeeUpdateInput, params?: RequestParams) => Promise<HttpResponse<Fee, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotAllowed | ApiErrorNotFound>>;
5074
+ /**
5075
+ * @description This endpoint is used for deleting a specific fee that has not yet been invoiced
5076
+ *
5077
+ * @tags fees
5078
+ * @name DeleteFee
5079
+ * @summary Delete a fee
5080
+ * @request DELETE:/fees/{lago_id}
5081
+ * @secure
5082
+ */
5083
+ deleteFee: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Fee, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
5158
5084
  };
5159
5085
  invoices: {
5160
5086
  /**
@@ -5208,6 +5134,28 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5208
5134
  status?: "draft" | "finalized";
5209
5135
  /** Filter invoices by payment status. Possible values are `pending`, `failed` or `succeeded`. */
5210
5136
  payment_status?: "pending" | "failed" | "succeeded";
5137
+ /**
5138
+ * Filter invoices by payment_overdue. Possible values are `true` or `false`.
5139
+ * @example true
5140
+ */
5141
+ payment_overdue?: boolean;
5142
+ /**
5143
+ * Search invoices by id, number, customer name, customer external_id or customer email.
5144
+ * @example "Jane"
5145
+ */
5146
+ search_term?: string;
5147
+ /**
5148
+ * Filter invoices by currency in. Possible values ISO 4217 currency codes.
5149
+ * @example "EUR"
5150
+ */
5151
+ currency?: string;
5152
+ /**
5153
+ * Filter invoices with a payment dispute lost. Possible values are `true` or `false`.
5154
+ * @example true
5155
+ */
5156
+ payment_dispute_lost?: boolean;
5157
+ /** Filter invoices by invoice type. Possible values are `subscription`, `add_on`, `credit`, `one_off` or `advance_charges` */
5158
+ invoice_type?: "subscription" | "add_on" | "credit" | "one_off" | "advance_charges";
5211
5159
  }, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized>>;
5212
5160
  /**
5213
5161
  * @description This endpoint is used for updating an existing invoice.