lago-javascript-client 1.3.0 → 1.6.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.
@@ -973,7 +973,7 @@ export interface CreditNoteEstimateInput {
973
973
  */
974
974
  invoice_id: string;
975
975
  /**
976
- * The list of credit note’s items.
976
+ * The list of credit note's items.
977
977
  * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":10},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":5}]
978
978
  */
979
979
  items: {
@@ -1036,15 +1036,15 @@ export interface CreditNoteEstimated {
1036
1036
  * @example 20
1037
1037
  */
1038
1038
  coupons_adjustment_amount_cents: number;
1039
- /** Array of credit note’s items. */
1039
+ /** Array of credit note's items. */
1040
1040
  items: {
1041
1041
  /**
1042
- * The credit note’s item amount, expressed in cents.
1042
+ * The credit note's item amount, expressed in cents.
1043
1043
  * @example 100
1044
1044
  */
1045
1045
  amount_cents: number;
1046
1046
  /**
1047
- * 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.
1047
+ * 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.
1048
1048
  * @format uuid
1049
1049
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1050
1050
  */
@@ -1091,7 +1091,7 @@ export interface CreditNoteEstimated {
1091
1091
  }
1092
1092
  export interface CreditObject {
1093
1093
  /**
1094
- * Unique identifier assigned to the credit within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit’s item record within the Lago system.
1094
+ * Unique identifier assigned to the credit within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit's item record within the Lago system.
1095
1095
  * @format uuid
1096
1096
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1097
1097
  */
@@ -1157,17 +1157,17 @@ export type CreditNoteAppliedTaxObject = BaseAppliedTax & {
1157
1157
  };
1158
1158
  export interface CreditNoteItemObject {
1159
1159
  /**
1160
- * The credit note’s item unique identifier, created by Lago.
1160
+ * The credit note's item unique identifier, created by Lago.
1161
1161
  * @format uuid
1162
1162
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1163
1163
  */
1164
1164
  lago_id: string;
1165
1165
  /**
1166
- * The credit note’s item amount, expressed in cents.
1166
+ * The credit note's item amount, expressed in cents.
1167
1167
  * @example 100
1168
1168
  */
1169
1169
  amount_cents: number;
1170
- /** The credit note’s item currency. */
1170
+ /** The credit note's item currency. */
1171
1171
  amount_currency: Currency;
1172
1172
  /** The fee object related to the credit note item. */
1173
1173
  fee: FeeObject;
@@ -1294,7 +1294,7 @@ export interface CreditNoteObject {
1294
1294
  * @example "https://getlago.com/credit_note/file"
1295
1295
  */
1296
1296
  file_url?: string | null;
1297
- /** Array of credit note’s items. */
1297
+ /** Array of credit note's items. */
1298
1298
  items?: CreditNoteItemObject[];
1299
1299
  applied_taxes?: CreditNoteAppliedTaxObject[];
1300
1300
  }
@@ -1331,7 +1331,7 @@ export interface CreditNoteCreateInput {
1331
1331
  */
1332
1332
  refund_amount_cents?: number | null;
1333
1333
  /**
1334
- * The list of credit note’s items.
1334
+ * The list of credit note's items.
1335
1335
  * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":10},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":5}]
1336
1336
  */
1337
1337
  items: {
@@ -1411,6 +1411,41 @@ export interface CustomerBillingConfiguration {
1411
1411
  */
1412
1412
  provider_payment_methods?: string[] | null;
1413
1413
  }
1414
+ /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
1415
+ export interface IntegrationCustomer {
1416
+ /**
1417
+ * A unique identifier for the integration customer object in the Lago application.
1418
+ * @format uuid
1419
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1420
+ */
1421
+ lago_id?: string;
1422
+ /**
1423
+ * The integration type used for accounting and tax syncs.
1424
+ * Accepted values: `netsuite`.
1425
+ * @example "netsuite"
1426
+ */
1427
+ type?: "netsuite";
1428
+ /**
1429
+ * Unique code used to identify an integration connection.
1430
+ * @example "netsuite-eu-1"
1431
+ */
1432
+ integration_code?: string;
1433
+ /**
1434
+ * 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.
1435
+ * @example "cus_12345"
1436
+ */
1437
+ external_customer_id?: string;
1438
+ /**
1439
+ * 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`
1440
+ * @example true
1441
+ */
1442
+ sync_with_provider?: boolean;
1443
+ /**
1444
+ * This optional field is needed only when working with `netsuite` connection.
1445
+ * @example "2"
1446
+ */
1447
+ subsidiary_id?: string;
1448
+ }
1414
1449
  /** Array of filter object, representing multiple dimensions for a charge item. */
1415
1450
  export type CustomerChargeFiltersUsageObject = {
1416
1451
  /**
@@ -1525,7 +1560,7 @@ export interface CustomerChargeUsageObject {
1525
1560
  /** Object listing all the properties for a specific charge item. */
1526
1561
  charge: {
1527
1562
  /**
1528
- * Unique identifier assigned to the charge within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the charge’s record within the Lago system.
1563
+ * Unique identifier assigned to the charge within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the charge's record within the Lago system.
1529
1564
  * @format uuid
1530
1565
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1531
1566
  */
@@ -1544,7 +1579,7 @@ export interface CustomerChargeUsageObject {
1544
1579
  /** The related billable metric object. */
1545
1580
  billable_metric: {
1546
1581
  /**
1547
- * Unique identifier assigned to the billable metric within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the billable metric’s record within the Lago system.
1582
+ * Unique identifier assigned to the billable metric within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the billable metric's record within the Lago system.
1548
1583
  * @format uuid
1549
1584
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1550
1585
  */
@@ -1663,6 +1698,40 @@ export interface CustomerCreateInput {
1663
1698
  net_payment_term?: number | null;
1664
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. */
1665
1700
  billing_configuration?: CustomerBillingConfiguration;
1701
+ integration_customers?: {
1702
+ /**
1703
+ * A unique identifier for the integration customer object in the Lago application.
1704
+ * @format uuid
1705
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1706
+ */
1707
+ id?: string;
1708
+ /**
1709
+ * The integration type used for accounting and tax syncs.
1710
+ * Accepted values: `netsuite`.
1711
+ * @example "netsuite"
1712
+ */
1713
+ integration_type?: "netsuite";
1714
+ /**
1715
+ * Unique code used to identify an integration connection.
1716
+ * @example "netsuite-eu-1"
1717
+ */
1718
+ integration_code?: string;
1719
+ /**
1720
+ * 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.
1721
+ * @example "cus_12345"
1722
+ */
1723
+ external_customer_id?: string;
1724
+ /**
1725
+ * 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`
1726
+ * @example true
1727
+ */
1728
+ sync_with_provider?: boolean;
1729
+ /**
1730
+ * This optional field is needed only when working with `netsuite` connection.
1731
+ * @example "2"
1732
+ */
1733
+ subsidiary_id?: string;
1734
+ }[];
1666
1735
  /** 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 */
1667
1736
  metadata?: {
1668
1737
  /**
@@ -1834,6 +1903,7 @@ export interface CustomerObject {
1834
1903
  updated_at?: string;
1835
1904
  /** 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. */
1836
1905
  billing_configuration?: CustomerBillingConfiguration;
1906
+ integration_customers?: IntegrationCustomer[];
1837
1907
  metadata?: CustomerMetadata[];
1838
1908
  }
1839
1909
  export type CustomerObjectExtended = CustomerObject & {
@@ -1867,8 +1937,8 @@ export interface CustomerUsageObject {
1867
1937
  to_datetime: string;
1868
1938
  /**
1869
1939
  * The date of creation of the invoice.
1870
- * @format date-time
1871
- * @example "2022-08-01T23:59:59Z"
1940
+ * @format date
1941
+ * @example "2022-08-01"
1872
1942
  */
1873
1943
  issuing_date: string;
1874
1944
  /**
@@ -1877,7 +1947,7 @@ export interface CustomerUsageObject {
1877
1947
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1878
1948
  */
1879
1949
  lago_invoice_id?: string | null;
1880
- /** The currency of the customer’s current usage. */
1950
+ /** The currency of the customer's current usage. */
1881
1951
  currency?: Currency;
1882
1952
  /**
1883
1953
  * The amount in cents, tax excluded.
@@ -1961,7 +2031,7 @@ export interface EventInput {
1961
2031
  * 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.
1962
2032
  * @example {"gb":10}
1963
2033
  */
1964
- properties?: Record<string, string>;
2034
+ properties?: Record<string, string | number>;
1965
2035
  };
1966
2036
  }
1967
2037
  export interface EventObject {
@@ -2010,7 +2080,7 @@ export interface EventObject {
2010
2080
  [key: string]: any;
2011
2081
  };
2012
2082
  /**
2013
- * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s record within the Lago system
2083
+ * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription's record within the Lago system
2014
2084
  * @format uuid
2015
2085
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2016
2086
  */
@@ -2040,7 +2110,7 @@ export type FeeAppliedTaxObject = BaseAppliedTax & {
2040
2110
  };
2041
2111
  export interface FeeObject {
2042
2112
  /**
2043
- * 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.
2113
+ * 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.
2044
2114
  * @format uuid
2045
2115
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2046
2116
  */
@@ -2108,7 +2178,7 @@ export interface FeeObject {
2108
2178
  * @example 100
2109
2179
  */
2110
2180
  amount_cents: number;
2111
- /** The currency of this specific fee. It indicates the monetary unit in which the fee’s cost is expressed. */
2181
+ /** The currency of this specific fee. It indicates the monetary unit in which the fee's cost is expressed. */
2112
2182
  amount_currency: Currency;
2113
2183
  /**
2114
2184
  * The cost of the tax associated with this specific fee.
@@ -2641,12 +2711,12 @@ export interface InvoiceMetadataObject {
2641
2711
  */
2642
2712
  lago_id?: string;
2643
2713
  /**
2644
- * Represents the key of the metadata’s key-value pair.
2714
+ * Represents the key of the metadata's key-value pair.
2645
2715
  * @example "digital_ref_id"
2646
2716
  */
2647
2717
  key?: string;
2648
2718
  /**
2649
- * Represents the value of the metadata’s key-value pair.
2719
+ * Represents the value of the metadata's key-value pair.
2650
2720
  * @example "INV-0123456-98765"
2651
2721
  */
2652
2722
  value?: string;
@@ -2659,7 +2729,7 @@ export interface InvoiceMetadataObject {
2659
2729
  }
2660
2730
  export interface InvoiceObject {
2661
2731
  /**
2662
- * 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.
2732
+ * 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.
2663
2733
  * @format uuid
2664
2734
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2665
2735
  */
@@ -2692,6 +2762,11 @@ export interface InvoiceObject {
2692
2762
  * @example "2022-04-30"
2693
2763
  */
2694
2764
  payment_due_date?: string;
2765
+ /**
2766
+ * Specifies if the payment is considered as overdue.
2767
+ * @example true
2768
+ */
2769
+ payment_overdue?: boolean;
2695
2770
  /**
2696
2771
  * The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
2697
2772
  * @example 30
@@ -2872,7 +2947,7 @@ export interface OrganizationBillingConfiguration {
2872
2947
  */
2873
2948
  invoice_footer?: string | null;
2874
2949
  /**
2875
- * The grace period, expressed in days, for finalizing the invoice. This period refers to the additional time granted to your customers beyond the invoice due date to adjust usage and line items. Can be overwritten by the customer’s grace period.
2950
+ * The grace period, expressed in days, for finalizing the invoice. This period refers to the additional time granted to your customers beyond the invoice due date to adjust usage and line items. Can be overwritten by the customer's grace period.
2876
2951
  * @example 3
2877
2952
  */
2878
2953
  invoice_grace_period?: number;
@@ -2915,22 +2990,22 @@ export interface OrganizationObject {
2915
2990
  /** The default currency of an organization. */
2916
2991
  default_currency?: Currency;
2917
2992
  /**
2918
- * The first line of your organization’s billing address.
2993
+ * The first line of your organization's billing address.
2919
2994
  * @example "100 Brex Street"
2920
2995
  */
2921
2996
  address_line1?: string | null;
2922
2997
  /**
2923
- * The second line of your organization’s billing address.
2998
+ * The second line of your organization's billing address.
2924
2999
  * @example null
2925
3000
  */
2926
3001
  address_line2?: string | null;
2927
3002
  /**
2928
- * The state of your organization’s billing address.
3003
+ * The state of your organization's billing address.
2929
3004
  * @example "NYC"
2930
3005
  */
2931
3006
  state?: string | null;
2932
3007
  /**
2933
- * The zipcode of your organization’s billing address.
3008
+ * The zipcode of your organization's billing address.
2934
3009
  * @example "10000"
2935
3010
  */
2936
3011
  zipcode?: string | null;
@@ -2941,7 +3016,7 @@ export interface OrganizationObject {
2941
3016
  */
2942
3017
  email?: string | null;
2943
3018
  /**
2944
- * The city of your organization’s billing address.
3019
+ * The city of your organization's billing address.
2945
3020
  * @example "New York"
2946
3021
  */
2947
3022
  city?: string | null;
@@ -2980,7 +3055,7 @@ export interface OrganizationObject {
2980
3055
  * @example "US123456789"
2981
3056
  */
2982
3057
  tax_identification_number?: string | null;
2983
- /** Your organization’s timezone, used for billing purposes in your own local time. Can be overwritten by the customer’s timezone. */
3058
+ /** Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone. */
2984
3059
  timezone?: Timezone;
2985
3060
  /** The custom billing settings for your organization. */
2986
3061
  billing_configuration: OrganizationBillingConfiguration;
@@ -2999,22 +3074,22 @@ export interface OrganizationUpdateInput {
2999
3074
  /** The default currency of an organization. */
3000
3075
  default_currency?: Currency;
3001
3076
  /**
3002
- * The first line of your organization’s billing address.
3077
+ * The first line of your organization's billing address.
3003
3078
  * @example "100 Brex Street"
3004
3079
  */
3005
3080
  address_line1?: string | null;
3006
3081
  /**
3007
- * The second line of your organization’s billing address.
3082
+ * The second line of your organization's billing address.
3008
3083
  * @example null
3009
3084
  */
3010
3085
  address_line2?: string | null;
3011
3086
  /**
3012
- * The state of your organization’s billing address.
3087
+ * The state of your organization's billing address.
3013
3088
  * @example "NYC"
3014
3089
  */
3015
3090
  state?: string | null;
3016
3091
  /**
3017
- * The zipcode of your organization’s billing address.
3092
+ * The zipcode of your organization's billing address.
3018
3093
  * @example "10000"
3019
3094
  */
3020
3095
  zipcode?: string | null;
@@ -3025,7 +3100,7 @@ export interface OrganizationUpdateInput {
3025
3100
  */
3026
3101
  email?: string | null;
3027
3102
  /**
3028
- * The city of your organization’s billing address.
3103
+ * The city of your organization's billing address.
3029
3104
  * @example "New York"
3030
3105
  */
3031
3106
  city?: string | null;
@@ -3064,7 +3139,7 @@ export interface OrganizationUpdateInput {
3064
3139
  * @example "US123456789"
3065
3140
  */
3066
3141
  tax_identification_number?: string | null;
3067
- /** Your organization’s timezone, used for billing purposes in your own local time. Can be overwritten by the customer’s timezone. */
3142
+ /** Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone. */
3068
3143
  timezone?: Timezone;
3069
3144
  /**
3070
3145
  * Represents the email settings of the organization. It allows you to define which documents are sent by email. The field value determines the types of documents that trigger email notifications. Possible values for are `invoice.finalized` and `credit_note.created`. By configuring this field, you can specify whether invoices, credit notes, or both should be sent to recipients via email.
@@ -3150,7 +3225,7 @@ export interface PlanCreateInput {
3150
3225
  */
3151
3226
  pay_in_advance?: boolean;
3152
3227
  /**
3153
- * 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`.
3228
+ * 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`.
3154
3229
  * @example null
3155
3230
  */
3156
3231
  bill_charges_monthly?: boolean | null;
@@ -3359,7 +3434,7 @@ export interface PlanUpdateInput {
3359
3434
  */
3360
3435
  pay_in_advance?: boolean;
3361
3436
  /**
3362
- * 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`.
3437
+ * 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`.
3363
3438
  * @example null
3364
3439
  */
3365
3440
  bill_charges_monthly?: boolean | null;
@@ -3502,7 +3577,7 @@ export interface PlanObject {
3502
3577
  */
3503
3578
  pay_in_advance?: boolean;
3504
3579
  /**
3505
- * 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`.
3580
+ * 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`.
3506
3581
  * @example null
3507
3582
  */
3508
3583
  bill_charges_monthly?: boolean | null;
@@ -3605,7 +3680,7 @@ export interface SubscriptionUpdateInput {
3605
3680
  }
3606
3681
  export interface SubscriptionObject {
3607
3682
  /**
3608
- * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s record within the Lago system
3683
+ * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription's record within the Lago system
3609
3684
  * @format uuid
3610
3685
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3611
3686
  */
@@ -3861,6 +3936,23 @@ export interface WalletCreateInput {
3861
3936
  expiration_at?: string | null;
3862
3937
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
3863
3938
  recurring_transaction_rules?: {
3939
+ /**
3940
+ * The number of paid credits used for recurring top-up.
3941
+ * @pattern ^[0-9]+.?[0-9]*$
3942
+ * @example "20.0"
3943
+ */
3944
+ paid_credits?: string | null;
3945
+ /**
3946
+ * The number of free granted credits used for recurring top-up.
3947
+ * @pattern ^[0-9]+.?[0-9]*$
3948
+ * @example "10.0"
3949
+ */
3950
+ granted_credits?: string | null;
3951
+ /**
3952
+ * The method used for recurring top-up. Possible values are `fixed` or `target`.
3953
+ * @example "target"
3954
+ */
3955
+ method?: "fixed" | "target";
3864
3956
  /**
3865
3957
  * The trigger. Possible values are `interval` or `threshold`.
3866
3958
  * @example "interval"
@@ -3871,24 +3963,36 @@ export interface WalletCreateInput {
3871
3963
  * @example "monthly"
3872
3964
  */
3873
3965
  interval?: "weekly" | "monthly" | "quarterly" | "yearly";
3966
+ /**
3967
+ * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3968
+ * @format date-time
3969
+ * @example "2022-08-08T00:00:00Z"
3970
+ */
3971
+ started_at?: string;
3874
3972
  /**
3875
3973
  * The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when trigger is set to `threshold`.
3876
3974
  * @pattern ^[0-9]+.?[0-9]*$
3877
3975
  * @example "20.0"
3878
3976
  */
3879
3977
  threshold_credits?: string;
3978
+ /**
3979
+ * The target ongoing balance is the value set for the ongoing balance to be reached by the automatic top-up. Required only when trigger is set to `target`.
3980
+ * @pattern ^[0-9]+.?[0-9]*$
3981
+ * @example "200.0"
3982
+ */
3983
+ target_ongoing_balance?: string;
3880
3984
  }[];
3881
3985
  };
3882
3986
  }
3883
3987
  export interface WalletObject {
3884
3988
  /**
3885
- * 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 wallet’s record within the Lago system.
3989
+ * 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 wallet's record within the Lago system.
3886
3990
  * @format uuid
3887
3991
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3888
3992
  */
3889
3993
  lago_id: string;
3890
3994
  /**
3891
- * 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.
3995
+ * 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.
3892
3996
  * @format uuid
3893
3997
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3894
3998
  */
@@ -3976,17 +4080,22 @@ export interface WalletObject {
3976
4080
  * @example "interval"
3977
4081
  */
3978
4082
  trigger: "interval" | "threshold";
4083
+ /**
4084
+ * The method used for recurring top-up. Possible values are `fixed` or `target`.
4085
+ * @example "target"
4086
+ */
4087
+ method: "fixed" | "target";
3979
4088
  /**
3980
4089
  * The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only if trigger is set to `interval`.
3981
4090
  * @example "monthly"
3982
4091
  */
3983
- interval?: "weekly" | "monthly" | "quarterly" | "yearly";
4092
+ interval: "weekly" | "monthly" | "quarterly" | "yearly";
3984
4093
  /**
3985
4094
  * The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when trigger is set to `threshold`.
3986
4095
  * @pattern ^[0-9]+.?[0-9]*$
3987
4096
  * @example "20.0"
3988
4097
  */
3989
- threshold_credits?: string;
4098
+ threshold_credits: string;
3990
4099
  /**
3991
4100
  * The number of paid credits. Required only if there is no granted credits.
3992
4101
  * @pattern ^[0-9]+.?[0-9]*$
@@ -3999,6 +4108,18 @@ export interface WalletObject {
3999
4108
  * @example "10.0"
4000
4109
  */
4001
4110
  granted_credits: string;
4111
+ /**
4112
+ * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4113
+ * @format date-time
4114
+ * @example "2022-08-08T00:00:00Z"
4115
+ */
4116
+ started_at?: string;
4117
+ /**
4118
+ * The target ongoing balance is the value set for the ongoing balance to be reached by the automatic top-up. Required only when trigger is set to `target`.
4119
+ * @pattern ^[0-9]+.?[0-9]*$
4120
+ * @example "200.0"
4121
+ */
4122
+ target_ongoing_balance: string;
4002
4123
  /**
4003
4124
  * The date of the metadata object creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the metadata object was created
4004
4125
  * @format date-time
@@ -4036,7 +4157,7 @@ export interface WalletsPaginated {
4036
4157
  export interface WalletTransactionCreateInput {
4037
4158
  wallet_transaction: {
4038
4159
  /**
4039
- * 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 wallet’s record within the Lago system.
4160
+ * 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 wallet's record within the Lago system.
4040
4161
  * @format uuid
4041
4162
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4042
4163
  */
@@ -4063,13 +4184,13 @@ export interface WalletTransactionCreateInput {
4063
4184
  }
4064
4185
  export interface WalletTransactionObject {
4065
4186
  /**
4066
- * Unique identifier assigned to the wallet transaction within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet transaction’s record within the Lago system.
4187
+ * Unique identifier assigned to the wallet transaction within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet transaction's record within the Lago system.
4067
4188
  * @format uuid
4068
4189
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4069
4190
  */
4070
4191
  lago_id: string;
4071
4192
  /**
4072
- * 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 wallet’s record within the Lago system.
4193
+ * 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 wallet's record within the Lago system.
4073
4194
  * @format uuid
4074
4195
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4075
4196
  */
@@ -4146,6 +4267,11 @@ export interface WalletUpdateInput {
4146
4267
  * @example "interval"
4147
4268
  */
4148
4269
  trigger?: "interval" | "threshold";
4270
+ /**
4271
+ * The method used for recurring top-up. Possible values are `fixed` or `target`.
4272
+ * @example "target"
4273
+ */
4274
+ method?: "fixed" | "target";
4149
4275
  /**
4150
4276
  * The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only when trigger is set to `interval`.
4151
4277
  * @example "monthly"
@@ -4169,6 +4295,18 @@ export interface WalletUpdateInput {
4169
4295
  * @example "10.0"
4170
4296
  */
4171
4297
  granted_credits?: string;
4298
+ /**
4299
+ * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4300
+ * @format date-time
4301
+ * @example "2022-08-08T00:00:00Z"
4302
+ */
4303
+ started_at?: string;
4304
+ /**
4305
+ * The target ongoing balance is the value set for the ongoing balance to be reached by the automatic top-up. Required only when trigger is set to `target`.
4306
+ * @pattern ^[0-9]+.?[0-9]*$
4307
+ * @example "200.0"
4308
+ */
4309
+ target_ongoing_balance?: string;
4172
4310
  }[];
4173
4311
  };
4174
4312
  }
@@ -4197,7 +4335,7 @@ export interface WebhookEndpointObject {
4197
4335
  */
4198
4336
  lago_id: string;
4199
4337
  /**
4200
- * 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.
4338
+ * 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.
4201
4339
  * @format uuid
4202
4340
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4203
4341
  */
@@ -4297,9 +4435,9 @@ export declare class HttpClient<SecurityDataType = unknown> {
4297
4435
  }
4298
4436
  /**
4299
4437
  * @title Lago API documentation
4300
- * @version 1.2.0
4438
+ * @version 1.6.0
4301
4439
  * @license AGPLv3
4302
- * @baseUrl https://api.getlago.com/api/v1
4440
+ * @baseUrl https://{region}.getlago.com/api/v1
4303
4441
  * @externalDocs https://github.com/getlago
4304
4442
  * @contact <tech@getlago.com>
4305
4443
  *
@@ -4973,7 +5111,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4973
5111
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4974
5112
  */
4975
5113
  external_subscription_id?: string;
4976
- /** Filter results by fee’s currency. */
5114
+ /** Filter results by fee's currency. */
4977
5115
  currency?: Currency;
4978
5116
  /**
4979
5117
  * The fee type. Possible values are `add-on`, `charge`, `credit` or `subscription`.
@@ -5112,6 +5250,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5112
5250
  status?: "draft" | "finalized";
5113
5251
  /** Filter invoices by payment status. Possible values are `pending`, `failed` or `succeeded`. */
5114
5252
  payment_status?: "pending" | "failed" | "succeeded";
5253
+ /**
5254
+ * Filter invoices by payment_overdue. Possible values are `true` or `false`.
5255
+ * @example true
5256
+ */
5257
+ payment_overdue?: boolean;
5115
5258
  }, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized>>;
5116
5259
  /**
5117
5260
  * @description This endpoint is used for updating an existing invoice.
@@ -16,7 +16,7 @@ export var ContentType;
16
16
  ContentType["Text"] = "text/plain";
17
17
  })(ContentType || (ContentType = {}));
18
18
  export class HttpClient {
19
- baseUrl = "https://api.getlago.com/api/v1";
19
+ baseUrl = "https://{region}.getlago.com/api/v1";
20
20
  securityData = null;
21
21
  securityWorker;
22
22
  abortControllers = new Map();
@@ -148,9 +148,9 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 1.2.0
151
+ * @version 1.6.0
152
152
  * @license AGPLv3
153
- * @baseUrl https://api.getlago.com/api/v1
153
+ * @baseUrl https://{region}.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
155
155
  * @contact <tech@getlago.com>
156
156
  *
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.3.0",
6
+ "version": "v1.6.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",
@@ -973,7 +973,7 @@ export interface CreditNoteEstimateInput {
973
973
  */
974
974
  invoice_id: string;
975
975
  /**
976
- * The list of credit note’s items.
976
+ * The list of credit note's items.
977
977
  * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":10},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":5}]
978
978
  */
979
979
  items: {
@@ -1036,15 +1036,15 @@ export interface CreditNoteEstimated {
1036
1036
  * @example 20
1037
1037
  */
1038
1038
  coupons_adjustment_amount_cents: number;
1039
- /** Array of credit note’s items. */
1039
+ /** Array of credit note's items. */
1040
1040
  items: {
1041
1041
  /**
1042
- * The credit note’s item amount, expressed in cents.
1042
+ * The credit note's item amount, expressed in cents.
1043
1043
  * @example 100
1044
1044
  */
1045
1045
  amount_cents: number;
1046
1046
  /**
1047
- * 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.
1047
+ * 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.
1048
1048
  * @format uuid
1049
1049
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1050
1050
  */
@@ -1091,7 +1091,7 @@ export interface CreditNoteEstimated {
1091
1091
  }
1092
1092
  export interface CreditObject {
1093
1093
  /**
1094
- * Unique identifier assigned to the credit within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit’s item record within the Lago system.
1094
+ * Unique identifier assigned to the credit within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit's item record within the Lago system.
1095
1095
  * @format uuid
1096
1096
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1097
1097
  */
@@ -1157,17 +1157,17 @@ export type CreditNoteAppliedTaxObject = BaseAppliedTax & {
1157
1157
  };
1158
1158
  export interface CreditNoteItemObject {
1159
1159
  /**
1160
- * The credit note’s item unique identifier, created by Lago.
1160
+ * The credit note's item unique identifier, created by Lago.
1161
1161
  * @format uuid
1162
1162
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1163
1163
  */
1164
1164
  lago_id: string;
1165
1165
  /**
1166
- * The credit note’s item amount, expressed in cents.
1166
+ * The credit note's item amount, expressed in cents.
1167
1167
  * @example 100
1168
1168
  */
1169
1169
  amount_cents: number;
1170
- /** The credit note’s item currency. */
1170
+ /** The credit note's item currency. */
1171
1171
  amount_currency: Currency;
1172
1172
  /** The fee object related to the credit note item. */
1173
1173
  fee: FeeObject;
@@ -1294,7 +1294,7 @@ export interface CreditNoteObject {
1294
1294
  * @example "https://getlago.com/credit_note/file"
1295
1295
  */
1296
1296
  file_url?: string | null;
1297
- /** Array of credit note’s items. */
1297
+ /** Array of credit note's items. */
1298
1298
  items?: CreditNoteItemObject[];
1299
1299
  applied_taxes?: CreditNoteAppliedTaxObject[];
1300
1300
  }
@@ -1331,7 +1331,7 @@ export interface CreditNoteCreateInput {
1331
1331
  */
1332
1332
  refund_amount_cents?: number | null;
1333
1333
  /**
1334
- * The list of credit note’s items.
1334
+ * The list of credit note's items.
1335
1335
  * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":10},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":5}]
1336
1336
  */
1337
1337
  items: {
@@ -1411,6 +1411,41 @@ export interface CustomerBillingConfiguration {
1411
1411
  */
1412
1412
  provider_payment_methods?: string[] | null;
1413
1413
  }
1414
+ /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
1415
+ export interface IntegrationCustomer {
1416
+ /**
1417
+ * A unique identifier for the integration customer object in the Lago application.
1418
+ * @format uuid
1419
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1420
+ */
1421
+ lago_id?: string;
1422
+ /**
1423
+ * The integration type used for accounting and tax syncs.
1424
+ * Accepted values: `netsuite`.
1425
+ * @example "netsuite"
1426
+ */
1427
+ type?: "netsuite";
1428
+ /**
1429
+ * Unique code used to identify an integration connection.
1430
+ * @example "netsuite-eu-1"
1431
+ */
1432
+ integration_code?: string;
1433
+ /**
1434
+ * 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.
1435
+ * @example "cus_12345"
1436
+ */
1437
+ external_customer_id?: string;
1438
+ /**
1439
+ * 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`
1440
+ * @example true
1441
+ */
1442
+ sync_with_provider?: boolean;
1443
+ /**
1444
+ * This optional field is needed only when working with `netsuite` connection.
1445
+ * @example "2"
1446
+ */
1447
+ subsidiary_id?: string;
1448
+ }
1414
1449
  /** Array of filter object, representing multiple dimensions for a charge item. */
1415
1450
  export type CustomerChargeFiltersUsageObject = {
1416
1451
  /**
@@ -1525,7 +1560,7 @@ export interface CustomerChargeUsageObject {
1525
1560
  /** Object listing all the properties for a specific charge item. */
1526
1561
  charge: {
1527
1562
  /**
1528
- * Unique identifier assigned to the charge within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the charge’s record within the Lago system.
1563
+ * Unique identifier assigned to the charge within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the charge's record within the Lago system.
1529
1564
  * @format uuid
1530
1565
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1531
1566
  */
@@ -1544,7 +1579,7 @@ export interface CustomerChargeUsageObject {
1544
1579
  /** The related billable metric object. */
1545
1580
  billable_metric: {
1546
1581
  /**
1547
- * Unique identifier assigned to the billable metric within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the billable metric’s record within the Lago system.
1582
+ * Unique identifier assigned to the billable metric within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the billable metric's record within the Lago system.
1548
1583
  * @format uuid
1549
1584
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1550
1585
  */
@@ -1663,6 +1698,40 @@ export interface CustomerCreateInput {
1663
1698
  net_payment_term?: number | null;
1664
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. */
1665
1700
  billing_configuration?: CustomerBillingConfiguration;
1701
+ integration_customers?: {
1702
+ /**
1703
+ * A unique identifier for the integration customer object in the Lago application.
1704
+ * @format uuid
1705
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1706
+ */
1707
+ id?: string;
1708
+ /**
1709
+ * The integration type used for accounting and tax syncs.
1710
+ * Accepted values: `netsuite`.
1711
+ * @example "netsuite"
1712
+ */
1713
+ integration_type?: "netsuite";
1714
+ /**
1715
+ * Unique code used to identify an integration connection.
1716
+ * @example "netsuite-eu-1"
1717
+ */
1718
+ integration_code?: string;
1719
+ /**
1720
+ * 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.
1721
+ * @example "cus_12345"
1722
+ */
1723
+ external_customer_id?: string;
1724
+ /**
1725
+ * 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`
1726
+ * @example true
1727
+ */
1728
+ sync_with_provider?: boolean;
1729
+ /**
1730
+ * This optional field is needed only when working with `netsuite` connection.
1731
+ * @example "2"
1732
+ */
1733
+ subsidiary_id?: string;
1734
+ }[];
1666
1735
  /** 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 */
1667
1736
  metadata?: {
1668
1737
  /**
@@ -1834,6 +1903,7 @@ export interface CustomerObject {
1834
1903
  updated_at?: string;
1835
1904
  /** 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. */
1836
1905
  billing_configuration?: CustomerBillingConfiguration;
1906
+ integration_customers?: IntegrationCustomer[];
1837
1907
  metadata?: CustomerMetadata[];
1838
1908
  }
1839
1909
  export type CustomerObjectExtended = CustomerObject & {
@@ -1867,8 +1937,8 @@ export interface CustomerUsageObject {
1867
1937
  to_datetime: string;
1868
1938
  /**
1869
1939
  * The date of creation of the invoice.
1870
- * @format date-time
1871
- * @example "2022-08-01T23:59:59Z"
1940
+ * @format date
1941
+ * @example "2022-08-01"
1872
1942
  */
1873
1943
  issuing_date: string;
1874
1944
  /**
@@ -1877,7 +1947,7 @@ export interface CustomerUsageObject {
1877
1947
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1878
1948
  */
1879
1949
  lago_invoice_id?: string | null;
1880
- /** The currency of the customer’s current usage. */
1950
+ /** The currency of the customer's current usage. */
1881
1951
  currency?: Currency;
1882
1952
  /**
1883
1953
  * The amount in cents, tax excluded.
@@ -1961,7 +2031,7 @@ export interface EventInput {
1961
2031
  * 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.
1962
2032
  * @example {"gb":10}
1963
2033
  */
1964
- properties?: Record<string, string>;
2034
+ properties?: Record<string, string | number>;
1965
2035
  };
1966
2036
  }
1967
2037
  export interface EventObject {
@@ -2010,7 +2080,7 @@ export interface EventObject {
2010
2080
  [key: string]: any;
2011
2081
  };
2012
2082
  /**
2013
- * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s record within the Lago system
2083
+ * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription's record within the Lago system
2014
2084
  * @format uuid
2015
2085
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2016
2086
  */
@@ -2040,7 +2110,7 @@ export type FeeAppliedTaxObject = BaseAppliedTax & {
2040
2110
  };
2041
2111
  export interface FeeObject {
2042
2112
  /**
2043
- * 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.
2113
+ * 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.
2044
2114
  * @format uuid
2045
2115
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2046
2116
  */
@@ -2108,7 +2178,7 @@ export interface FeeObject {
2108
2178
  * @example 100
2109
2179
  */
2110
2180
  amount_cents: number;
2111
- /** The currency of this specific fee. It indicates the monetary unit in which the fee’s cost is expressed. */
2181
+ /** The currency of this specific fee. It indicates the monetary unit in which the fee's cost is expressed. */
2112
2182
  amount_currency: Currency;
2113
2183
  /**
2114
2184
  * The cost of the tax associated with this specific fee.
@@ -2641,12 +2711,12 @@ export interface InvoiceMetadataObject {
2641
2711
  */
2642
2712
  lago_id?: string;
2643
2713
  /**
2644
- * Represents the key of the metadata’s key-value pair.
2714
+ * Represents the key of the metadata's key-value pair.
2645
2715
  * @example "digital_ref_id"
2646
2716
  */
2647
2717
  key?: string;
2648
2718
  /**
2649
- * Represents the value of the metadata’s key-value pair.
2719
+ * Represents the value of the metadata's key-value pair.
2650
2720
  * @example "INV-0123456-98765"
2651
2721
  */
2652
2722
  value?: string;
@@ -2659,7 +2729,7 @@ export interface InvoiceMetadataObject {
2659
2729
  }
2660
2730
  export interface InvoiceObject {
2661
2731
  /**
2662
- * 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.
2732
+ * 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.
2663
2733
  * @format uuid
2664
2734
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2665
2735
  */
@@ -2692,6 +2762,11 @@ export interface InvoiceObject {
2692
2762
  * @example "2022-04-30"
2693
2763
  */
2694
2764
  payment_due_date?: string;
2765
+ /**
2766
+ * Specifies if the payment is considered as overdue.
2767
+ * @example true
2768
+ */
2769
+ payment_overdue?: boolean;
2695
2770
  /**
2696
2771
  * The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
2697
2772
  * @example 30
@@ -2872,7 +2947,7 @@ export interface OrganizationBillingConfiguration {
2872
2947
  */
2873
2948
  invoice_footer?: string | null;
2874
2949
  /**
2875
- * The grace period, expressed in days, for finalizing the invoice. This period refers to the additional time granted to your customers beyond the invoice due date to adjust usage and line items. Can be overwritten by the customer’s grace period.
2950
+ * The grace period, expressed in days, for finalizing the invoice. This period refers to the additional time granted to your customers beyond the invoice due date to adjust usage and line items. Can be overwritten by the customer's grace period.
2876
2951
  * @example 3
2877
2952
  */
2878
2953
  invoice_grace_period?: number;
@@ -2915,22 +2990,22 @@ export interface OrganizationObject {
2915
2990
  /** The default currency of an organization. */
2916
2991
  default_currency?: Currency;
2917
2992
  /**
2918
- * The first line of your organization’s billing address.
2993
+ * The first line of your organization's billing address.
2919
2994
  * @example "100 Brex Street"
2920
2995
  */
2921
2996
  address_line1?: string | null;
2922
2997
  /**
2923
- * The second line of your organization’s billing address.
2998
+ * The second line of your organization's billing address.
2924
2999
  * @example null
2925
3000
  */
2926
3001
  address_line2?: string | null;
2927
3002
  /**
2928
- * The state of your organization’s billing address.
3003
+ * The state of your organization's billing address.
2929
3004
  * @example "NYC"
2930
3005
  */
2931
3006
  state?: string | null;
2932
3007
  /**
2933
- * The zipcode of your organization’s billing address.
3008
+ * The zipcode of your organization's billing address.
2934
3009
  * @example "10000"
2935
3010
  */
2936
3011
  zipcode?: string | null;
@@ -2941,7 +3016,7 @@ export interface OrganizationObject {
2941
3016
  */
2942
3017
  email?: string | null;
2943
3018
  /**
2944
- * The city of your organization’s billing address.
3019
+ * The city of your organization's billing address.
2945
3020
  * @example "New York"
2946
3021
  */
2947
3022
  city?: string | null;
@@ -2980,7 +3055,7 @@ export interface OrganizationObject {
2980
3055
  * @example "US123456789"
2981
3056
  */
2982
3057
  tax_identification_number?: string | null;
2983
- /** Your organization’s timezone, used for billing purposes in your own local time. Can be overwritten by the customer’s timezone. */
3058
+ /** Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone. */
2984
3059
  timezone?: Timezone;
2985
3060
  /** The custom billing settings for your organization. */
2986
3061
  billing_configuration: OrganizationBillingConfiguration;
@@ -2999,22 +3074,22 @@ export interface OrganizationUpdateInput {
2999
3074
  /** The default currency of an organization. */
3000
3075
  default_currency?: Currency;
3001
3076
  /**
3002
- * The first line of your organization’s billing address.
3077
+ * The first line of your organization's billing address.
3003
3078
  * @example "100 Brex Street"
3004
3079
  */
3005
3080
  address_line1?: string | null;
3006
3081
  /**
3007
- * The second line of your organization’s billing address.
3082
+ * The second line of your organization's billing address.
3008
3083
  * @example null
3009
3084
  */
3010
3085
  address_line2?: string | null;
3011
3086
  /**
3012
- * The state of your organization’s billing address.
3087
+ * The state of your organization's billing address.
3013
3088
  * @example "NYC"
3014
3089
  */
3015
3090
  state?: string | null;
3016
3091
  /**
3017
- * The zipcode of your organization’s billing address.
3092
+ * The zipcode of your organization's billing address.
3018
3093
  * @example "10000"
3019
3094
  */
3020
3095
  zipcode?: string | null;
@@ -3025,7 +3100,7 @@ export interface OrganizationUpdateInput {
3025
3100
  */
3026
3101
  email?: string | null;
3027
3102
  /**
3028
- * The city of your organization’s billing address.
3103
+ * The city of your organization's billing address.
3029
3104
  * @example "New York"
3030
3105
  */
3031
3106
  city?: string | null;
@@ -3064,7 +3139,7 @@ export interface OrganizationUpdateInput {
3064
3139
  * @example "US123456789"
3065
3140
  */
3066
3141
  tax_identification_number?: string | null;
3067
- /** Your organization’s timezone, used for billing purposes in your own local time. Can be overwritten by the customer’s timezone. */
3142
+ /** Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone. */
3068
3143
  timezone?: Timezone;
3069
3144
  /**
3070
3145
  * Represents the email settings of the organization. It allows you to define which documents are sent by email. The field value determines the types of documents that trigger email notifications. Possible values for are `invoice.finalized` and `credit_note.created`. By configuring this field, you can specify whether invoices, credit notes, or both should be sent to recipients via email.
@@ -3150,7 +3225,7 @@ export interface PlanCreateInput {
3150
3225
  */
3151
3226
  pay_in_advance?: boolean;
3152
3227
  /**
3153
- * 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`.
3228
+ * 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`.
3154
3229
  * @example null
3155
3230
  */
3156
3231
  bill_charges_monthly?: boolean | null;
@@ -3359,7 +3434,7 @@ export interface PlanUpdateInput {
3359
3434
  */
3360
3435
  pay_in_advance?: boolean;
3361
3436
  /**
3362
- * 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`.
3437
+ * 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`.
3363
3438
  * @example null
3364
3439
  */
3365
3440
  bill_charges_monthly?: boolean | null;
@@ -3502,7 +3577,7 @@ export interface PlanObject {
3502
3577
  */
3503
3578
  pay_in_advance?: boolean;
3504
3579
  /**
3505
- * 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`.
3580
+ * 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`.
3506
3581
  * @example null
3507
3582
  */
3508
3583
  bill_charges_monthly?: boolean | null;
@@ -3605,7 +3680,7 @@ export interface SubscriptionUpdateInput {
3605
3680
  }
3606
3681
  export interface SubscriptionObject {
3607
3682
  /**
3608
- * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s record within the Lago system
3683
+ * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription's record within the Lago system
3609
3684
  * @format uuid
3610
3685
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3611
3686
  */
@@ -3861,6 +3936,23 @@ export interface WalletCreateInput {
3861
3936
  expiration_at?: string | null;
3862
3937
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
3863
3938
  recurring_transaction_rules?: {
3939
+ /**
3940
+ * The number of paid credits used for recurring top-up.
3941
+ * @pattern ^[0-9]+.?[0-9]*$
3942
+ * @example "20.0"
3943
+ */
3944
+ paid_credits?: string | null;
3945
+ /**
3946
+ * The number of free granted credits used for recurring top-up.
3947
+ * @pattern ^[0-9]+.?[0-9]*$
3948
+ * @example "10.0"
3949
+ */
3950
+ granted_credits?: string | null;
3951
+ /**
3952
+ * The method used for recurring top-up. Possible values are `fixed` or `target`.
3953
+ * @example "target"
3954
+ */
3955
+ method?: "fixed" | "target";
3864
3956
  /**
3865
3957
  * The trigger. Possible values are `interval` or `threshold`.
3866
3958
  * @example "interval"
@@ -3871,24 +3963,36 @@ export interface WalletCreateInput {
3871
3963
  * @example "monthly"
3872
3964
  */
3873
3965
  interval?: "weekly" | "monthly" | "quarterly" | "yearly";
3966
+ /**
3967
+ * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3968
+ * @format date-time
3969
+ * @example "2022-08-08T00:00:00Z"
3970
+ */
3971
+ started_at?: string;
3874
3972
  /**
3875
3973
  * The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when trigger is set to `threshold`.
3876
3974
  * @pattern ^[0-9]+.?[0-9]*$
3877
3975
  * @example "20.0"
3878
3976
  */
3879
3977
  threshold_credits?: string;
3978
+ /**
3979
+ * The target ongoing balance is the value set for the ongoing balance to be reached by the automatic top-up. Required only when trigger is set to `target`.
3980
+ * @pattern ^[0-9]+.?[0-9]*$
3981
+ * @example "200.0"
3982
+ */
3983
+ target_ongoing_balance?: string;
3880
3984
  }[];
3881
3985
  };
3882
3986
  }
3883
3987
  export interface WalletObject {
3884
3988
  /**
3885
- * 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 wallet’s record within the Lago system.
3989
+ * 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 wallet's record within the Lago system.
3886
3990
  * @format uuid
3887
3991
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3888
3992
  */
3889
3993
  lago_id: string;
3890
3994
  /**
3891
- * 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.
3995
+ * 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.
3892
3996
  * @format uuid
3893
3997
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3894
3998
  */
@@ -3976,17 +4080,22 @@ export interface WalletObject {
3976
4080
  * @example "interval"
3977
4081
  */
3978
4082
  trigger: "interval" | "threshold";
4083
+ /**
4084
+ * The method used for recurring top-up. Possible values are `fixed` or `target`.
4085
+ * @example "target"
4086
+ */
4087
+ method: "fixed" | "target";
3979
4088
  /**
3980
4089
  * The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only if trigger is set to `interval`.
3981
4090
  * @example "monthly"
3982
4091
  */
3983
- interval?: "weekly" | "monthly" | "quarterly" | "yearly";
4092
+ interval: "weekly" | "monthly" | "quarterly" | "yearly";
3984
4093
  /**
3985
4094
  * The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when trigger is set to `threshold`.
3986
4095
  * @pattern ^[0-9]+.?[0-9]*$
3987
4096
  * @example "20.0"
3988
4097
  */
3989
- threshold_credits?: string;
4098
+ threshold_credits: string;
3990
4099
  /**
3991
4100
  * The number of paid credits. Required only if there is no granted credits.
3992
4101
  * @pattern ^[0-9]+.?[0-9]*$
@@ -3999,6 +4108,18 @@ export interface WalletObject {
3999
4108
  * @example "10.0"
4000
4109
  */
4001
4110
  granted_credits: string;
4111
+ /**
4112
+ * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4113
+ * @format date-time
4114
+ * @example "2022-08-08T00:00:00Z"
4115
+ */
4116
+ started_at?: string;
4117
+ /**
4118
+ * The target ongoing balance is the value set for the ongoing balance to be reached by the automatic top-up. Required only when trigger is set to `target`.
4119
+ * @pattern ^[0-9]+.?[0-9]*$
4120
+ * @example "200.0"
4121
+ */
4122
+ target_ongoing_balance: string;
4002
4123
  /**
4003
4124
  * The date of the metadata object creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the metadata object was created
4004
4125
  * @format date-time
@@ -4036,7 +4157,7 @@ export interface WalletsPaginated {
4036
4157
  export interface WalletTransactionCreateInput {
4037
4158
  wallet_transaction: {
4038
4159
  /**
4039
- * 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 wallet’s record within the Lago system.
4160
+ * 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 wallet's record within the Lago system.
4040
4161
  * @format uuid
4041
4162
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4042
4163
  */
@@ -4063,13 +4184,13 @@ export interface WalletTransactionCreateInput {
4063
4184
  }
4064
4185
  export interface WalletTransactionObject {
4065
4186
  /**
4066
- * Unique identifier assigned to the wallet transaction within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet transaction’s record within the Lago system.
4187
+ * Unique identifier assigned to the wallet transaction within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet transaction's record within the Lago system.
4067
4188
  * @format uuid
4068
4189
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4069
4190
  */
4070
4191
  lago_id: string;
4071
4192
  /**
4072
- * 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 wallet’s record within the Lago system.
4193
+ * 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 wallet's record within the Lago system.
4073
4194
  * @format uuid
4074
4195
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4075
4196
  */
@@ -4146,6 +4267,11 @@ export interface WalletUpdateInput {
4146
4267
  * @example "interval"
4147
4268
  */
4148
4269
  trigger?: "interval" | "threshold";
4270
+ /**
4271
+ * The method used for recurring top-up. Possible values are `fixed` or `target`.
4272
+ * @example "target"
4273
+ */
4274
+ method?: "fixed" | "target";
4149
4275
  /**
4150
4276
  * The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly` or `yearly`. Required only when trigger is set to `interval`.
4151
4277
  * @example "monthly"
@@ -4169,6 +4295,18 @@ export interface WalletUpdateInput {
4169
4295
  * @example "10.0"
4170
4296
  */
4171
4297
  granted_credits?: string;
4298
+ /**
4299
+ * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4300
+ * @format date-time
4301
+ * @example "2022-08-08T00:00:00Z"
4302
+ */
4303
+ started_at?: string;
4304
+ /**
4305
+ * The target ongoing balance is the value set for the ongoing balance to be reached by the automatic top-up. Required only when trigger is set to `target`.
4306
+ * @pattern ^[0-9]+.?[0-9]*$
4307
+ * @example "200.0"
4308
+ */
4309
+ target_ongoing_balance?: string;
4172
4310
  }[];
4173
4311
  };
4174
4312
  }
@@ -4197,7 +4335,7 @@ export interface WebhookEndpointObject {
4197
4335
  */
4198
4336
  lago_id: string;
4199
4337
  /**
4200
- * 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.
4338
+ * 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.
4201
4339
  * @format uuid
4202
4340
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4203
4341
  */
@@ -4297,9 +4435,9 @@ export declare class HttpClient<SecurityDataType = unknown> {
4297
4435
  }
4298
4436
  /**
4299
4437
  * @title Lago API documentation
4300
- * @version 1.2.0
4438
+ * @version 1.6.0
4301
4439
  * @license AGPLv3
4302
- * @baseUrl https://api.getlago.com/api/v1
4440
+ * @baseUrl https://{region}.getlago.com/api/v1
4303
4441
  * @externalDocs https://github.com/getlago
4304
4442
  * @contact <tech@getlago.com>
4305
4443
  *
@@ -4973,7 +5111,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4973
5111
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4974
5112
  */
4975
5113
  external_subscription_id?: string;
4976
- /** Filter results by fee’s currency. */
5114
+ /** Filter results by fee's currency. */
4977
5115
  currency?: Currency;
4978
5116
  /**
4979
5117
  * The fee type. Possible values are `add-on`, `charge`, `credit` or `subscription`.
@@ -5112,6 +5250,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5112
5250
  status?: "draft" | "finalized";
5113
5251
  /** Filter invoices by payment status. Possible values are `pending`, `failed` or `succeeded`. */
5114
5252
  payment_status?: "pending" | "failed" | "succeeded";
5253
+ /**
5254
+ * Filter invoices by payment_overdue. Possible values are `true` or `false`.
5255
+ * @example true
5256
+ */
5257
+ payment_overdue?: boolean;
5115
5258
  }, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized>>;
5116
5259
  /**
5117
5260
  * @description This endpoint is used for updating an existing invoice.
@@ -19,7 +19,7 @@ var ContentType;
19
19
  ContentType["Text"] = "text/plain";
20
20
  })(ContentType = exports.ContentType || (exports.ContentType = {}));
21
21
  class HttpClient {
22
- baseUrl = "https://api.getlago.com/api/v1";
22
+ baseUrl = "https://{region}.getlago.com/api/v1";
23
23
  securityData = null;
24
24
  securityWorker;
25
25
  abortControllers = new Map();
@@ -152,9 +152,9 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 1.2.0
155
+ * @version 1.6.0
156
156
  * @license AGPLv3
157
- * @baseUrl https://api.getlago.com/api/v1
157
+ * @baseUrl https://{region}.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
159
159
  * @contact <tech@getlago.com>
160
160
  *