lago-javascript-client 1.47.1 → 1.49.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.
@@ -2030,6 +2030,16 @@ export interface PricingUnitDetailsObject {
2030
2030
  */
2031
2031
  conversion_rate: string;
2032
2032
  }
2033
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
2034
+ export type PresentationBreakdownsObject = {
2035
+ /** Key value list of event properties used for presentation grouping. */
2036
+ presentation_by?: Record<string, string>;
2037
+ /**
2038
+ * The number of units consumed for a specific presentation group.
2039
+ * @example "9.0"
2040
+ */
2041
+ units?: string;
2042
+ }[];
2033
2043
  export interface FeeObject {
2034
2044
  /**
2035
2045
  * 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.
@@ -2313,6 +2323,8 @@ export interface FeeObject {
2313
2323
  applied_taxes?: FeeAppliedTaxObject[];
2314
2324
  /** Details about the pricing unit used and amounts for this fee. */
2315
2325
  pricing_unit_details?: object | null;
2326
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
2327
+ presentation_breakdowns?: PresentationBreakdownsObject;
2316
2328
  }
2317
2329
  export interface CreditNoteItemObject {
2318
2330
  /**
@@ -3505,54 +3517,6 @@ export interface InvoiceBaseObject {
3505
3517
  */
3506
3518
  updated_at: string;
3507
3519
  }
3508
- export interface BillingPeriodObject {
3509
- /**
3510
- * Unique identifier assigned to the subscription, created by Lago.
3511
- * @format uuid
3512
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3513
- */
3514
- lago_subscription_id: string;
3515
- /**
3516
- * Unique identifier assigned to the subscription in your application.
3517
- * @example "external_id"
3518
- */
3519
- external_subscription_id: string;
3520
- /**
3521
- * Unique identifier assigned to the plan, created by Lago.
3522
- * @format uuid
3523
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3524
- */
3525
- lago_plan_id: string;
3526
- /**
3527
- * The beginning date of the subscription billing period. This field indicates the start date of the billing period associated with the subscription fee.
3528
- * @format date-time
3529
- * @example "2022-04-29T08:59:51Z"
3530
- */
3531
- subscription_from_datetime: string;
3532
- /**
3533
- * The ending date of the subscription billing period. This field indicates the end date of the billing period associated with the subscription fee.
3534
- * @format date-time
3535
- * @example "2022-05-29T08:59:51Z"
3536
- */
3537
- subscription_to_datetime: string;
3538
- /**
3539
- * The beginning date of the period that covers the charge fees. It is applicable only to the `charge` fees attached to the subscription. This field indicates the start date of the billing period or subscription period associated with the fees.
3540
- * @format date-time
3541
- * @example "2022-04-29T08:59:51Z"
3542
- */
3543
- charges_from_datetime: string;
3544
- /**
3545
- * The ending date of the period that covers the charge fees. It is applicable only to the `charge` fees attached to the subscription. This field indicates the end date of the billing period or subscription period associated with the fees.
3546
- * @format date-time
3547
- * @example "2022-05-29T08:59:51Z"
3548
- */
3549
- charges_to_datetime: string;
3550
- /**
3551
- * The reason explaining why this subscription appears on the invoice.
3552
- * @example "subscription_starting"
3553
- */
3554
- invoicing_reason: "subscription_starting" | "subscription_periodic" | "subscription_terminating" | "in_advance_charge" | "in_advance_charge_periodic" | "progressive_billing";
3555
- }
3556
3520
  export interface InvoiceMetadataObject {
3557
3521
  /**
3558
3522
  * Unique identifier assigned to the invoice metadata within the Lago application.
@@ -3677,7 +3641,6 @@ export interface AppliedUsageThresholdObject {
3677
3641
  export type InvoiceObject = InvoiceBaseObject & {
3678
3642
  /** The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
3679
3643
  customer?: CustomerObject;
3680
- billing_periods?: BillingPeriodObject[];
3681
3644
  metadata?: InvoiceMetadataObject[];
3682
3645
  applied_taxes?: InvoiceAppliedTaxObject[];
3683
3646
  /** The invoice custom sections applied to this invoice for PDF generation. */
@@ -3899,6 +3862,11 @@ export interface SubscriptionObject {
3899
3862
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
3900
3863
  */
3901
3864
  external_customer_id: string;
3865
+ /**
3866
+ * The code of the billing entity associated with the subscription.
3867
+ * @example "default"
3868
+ */
3869
+ billing_entity_code?: string;
3902
3870
  /**
3903
3871
  * The billing time for the subscription, which can be set as either `anniversary` or `calendar`. If not explicitly provided, it will default to `calendar`. The billing time determines the timing of recurring billing cycles for the subscription. By specifying `anniversary`, the billing cycle will be based on the specific date the subscription started (billed fully), while `calendar` sets the billing cycle at the first day of the week/month/year (billed with proration).
3904
3872
  * @example "anniversary"
@@ -4030,6 +3998,15 @@ export interface SubscriptionObject {
4030
3998
  applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
4031
3999
  /** The payment method assigned to this subscription for processing payments. */
4032
4000
  payment_method?: PaymentMethodReference;
4001
+ /**
4002
+ * Controls whether this subscription is eligible to be grouped with other subscriptions of the same customer on a consolidated recurring invoice.
4003
+ *
4004
+ * - `true` (default): the subscription is included in the customer's standard invoice grouping (by billing entity, currency and payment method).
4005
+ * - `false`: the subscription is excluded from consolidation and always billed on its own dedicated invoice, regardless of other grouping criteria.
4006
+ * @default true
4007
+ * @example true
4008
+ */
4009
+ consolidate_invoice?: boolean;
4033
4010
  }
4034
4011
  export interface SubscriptionsPaginated {
4035
4012
  subscriptions: SubscriptionObject[];
@@ -4081,6 +4058,11 @@ export interface WalletRecurringTransactionRule {
4081
4058
  * @example "10.0"
4082
4059
  */
4083
4060
  granted_credits: string;
4061
+ /**
4062
+ * Applies only to `target` rules. When `true`, the recurring top-up grants free credits to reach the target ongoing balance instead of creating a paid top-up (and bypasses the paid top-up minimum). When `false`, the gap is filled with a paid top-up. `null` for `fixed` rules. Defaults to `false` for target rules when omitted.
4063
+ * @example false
4064
+ */
4065
+ grants_target_top_up: boolean | null;
4084
4066
  /**
4085
4067
  * 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).
4086
4068
  * @format date-time
@@ -4153,6 +4135,11 @@ export interface WalletObject {
4153
4135
  * @example "hooli_1234"
4154
4136
  */
4155
4137
  external_customer_id: string;
4138
+ /**
4139
+ * The code of the billing entity associated with the wallet.
4140
+ * @example "default"
4141
+ */
4142
+ billing_entity_code?: string;
4156
4143
  /**
4157
4144
  * The status of the wallet. Possible values are `active` or `terminated`.
4158
4145
  * @example "active"
@@ -4359,6 +4346,11 @@ export interface WalletCreateInput {
4359
4346
  * @example "hooli_1234"
4360
4347
  */
4361
4348
  external_customer_id: string;
4349
+ /**
4350
+ * The code of the billing entity associated with the wallet. If not provided, the customer's billing entity is used.
4351
+ * @example "default"
4352
+ */
4353
+ billing_entity_code?: string;
4362
4354
  /**
4363
4355
  * The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
4364
4356
  * @format date-time
@@ -4451,6 +4443,11 @@ export interface WalletUpdateInput {
4451
4443
  * @example false
4452
4444
  */
4453
4445
  invoice_requires_successful_payment?: boolean;
4446
+ /**
4447
+ * The code of the billing entity associated with the wallet.
4448
+ * @example "default"
4449
+ */
4450
+ billing_entity_code?: string;
4454
4451
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
4455
4452
  invoice_custom_section?: InvoiceCustomSectionInput;
4456
4453
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
@@ -4494,6 +4491,11 @@ export interface WalletUpdateInput {
4494
4491
  * @example "10.0"
4495
4492
  */
4496
4493
  granted_credits?: string | null;
4494
+ /**
4495
+ * Applies only to `target` rules. When `true`, the recurring top-up grants free credits to reach the target ongoing balance instead of creating a paid top-up (and bypasses the paid top-up minimum). When `false`, the gap is filled with a paid top-up. `null` for `fixed` rules. Defaults to `false` for target rules when omitted.
4496
+ * @example false
4497
+ */
4498
+ grants_target_top_up?: boolean | null;
4497
4499
  /**
4498
4500
  * 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).
4499
4501
  * @format date-time
@@ -4784,6 +4786,8 @@ export type CustomerChargeFiltersUsageObject = {
4784
4786
  * @example {"region":["us-east-1"]}
4785
4787
  */
4786
4788
  values?: Record<string, string[]>;
4789
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
4790
+ presentation_breakdowns?: PresentationBreakdownsObject;
4787
4791
  }[];
4788
4792
  /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
4789
4793
  export type CustomerChargeGroupedUsageObject = {
@@ -4815,6 +4819,8 @@ export type CustomerChargeGroupedUsageObject = {
4815
4819
  grouped_by?: Record<string, string>;
4816
4820
  /** Array of filter object, representing multiple dimensions for a charge item. */
4817
4821
  filters?: CustomerChargeFiltersUsageObject;
4822
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
4823
+ presentation_breakdowns?: PresentationBreakdownsObject;
4818
4824
  }[];
4819
4825
  export interface CustomerChargeUsageObject {
4820
4826
  /**
@@ -4863,7 +4869,7 @@ export interface CustomerChargeUsageObject {
4863
4869
  * 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.
4864
4870
  * @example "Setup"
4865
4871
  */
4866
- invoice_display_name?: string;
4872
+ invoice_display_name?: string | null;
4867
4873
  };
4868
4874
  /** The related billable metric object. */
4869
4875
  billable_metric: {
@@ -4893,6 +4899,8 @@ export interface CustomerChargeUsageObject {
4893
4899
  filters?: CustomerChargeFiltersUsageObject;
4894
4900
  /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
4895
4901
  grouped_usage?: CustomerChargeGroupedUsageObject;
4902
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
4903
+ presentation_breakdowns?: PresentationBreakdownsObject;
4896
4904
  }
4897
4905
  export interface CustomerUsageObject {
4898
4906
  /**
@@ -4945,6 +4953,179 @@ export interface CustomerUsageObject {
4945
4953
  export interface CustomerUsage {
4946
4954
  customer_usage: CustomerUsageObject;
4947
4955
  }
4956
+ /** Array of filter object, representing multiple dimensions for a charge item. */
4957
+ export type CustomerProjectedChargeFiltersUsageObject = {
4958
+ /**
4959
+ * The number of units consumed for a specific charge filter related to a charge item.
4960
+ * @pattern ^[0-9]+.?[0-9]*$
4961
+ * @example "0.9"
4962
+ */
4963
+ units?: string;
4964
+ /**
4965
+ * The projected number of units that can be consumed for a specific charge filter related to a charge item.
4966
+ * @pattern ^[0-9]+.?[0-9]*$
4967
+ * @example "1.8"
4968
+ */
4969
+ projected_units?: string;
4970
+ /**
4971
+ * The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
4972
+ * @example 1000
4973
+ */
4974
+ amount_cents?: number;
4975
+ /**
4976
+ * The projected amount in cents, tax excluded, that can be consumed for a specific charge filter related to a charge item.
4977
+ * @example 2000
4978
+ */
4979
+ projected_amount_cents?: number;
4980
+ /**
4981
+ * The quantity of usage events that have been recorded for a particular charge filter during the specified time period. These events may also be referred to as the number of transactions in some contexts.
4982
+ * @example 10
4983
+ */
4984
+ events_count?: number;
4985
+ /**
4986
+ * Specifies the name that will be displayed on an invoice.
4987
+ * @example "AWS eu-east-1"
4988
+ */
4989
+ invoice_display_name?: string;
4990
+ /** Details about the pricing unit used for charge usage. */
4991
+ pricing_unit_details?: UsagePricingUnitDetailsObject;
4992
+ /**
4993
+ * List of filter values applied to the usage.
4994
+ * @example {"region":["us-east-1"]}
4995
+ */
4996
+ values?: Record<string, string[]>;
4997
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
4998
+ presentation_breakdowns?: PresentationBreakdownsObject;
4999
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
5000
+ projected_presentation_breakdowns?: PresentationBreakdownsObject;
5001
+ }[];
5002
+ /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
5003
+ export type CustomerProjectedChargeGroupedUsageObject = {
5004
+ /**
5005
+ * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
5006
+ * @example 1000
5007
+ */
5008
+ amount_cents?: number;
5009
+ /**
5010
+ * The projected amount in cents, tax excluded, that can be consumed for a specific group related to a charge item.
5011
+ * @example 2000
5012
+ */
5013
+ projected_amount_cents?: number;
5014
+ /**
5015
+ * 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.
5016
+ * @example 10
5017
+ */
5018
+ events_count?: number;
5019
+ /**
5020
+ * The number of units consumed for a specific group related to a charge item.
5021
+ * @pattern ^[0-9]+.?[0-9]*$
5022
+ * @example "0.9"
5023
+ */
5024
+ units?: string;
5025
+ /**
5026
+ * The projected number of units that can be consumed for a specific group related to a charge item.
5027
+ * @pattern ^[0-9]+.?[0-9]*$
5028
+ * @example "1.8"
5029
+ */
5030
+ projected_units?: string;
5031
+ /** Details about the pricing unit used for charge usage. */
5032
+ pricing_unit_details?: UsagePricingUnitDetailsObject;
5033
+ /** Key value list of event properties aggregated by the charge model */
5034
+ grouped_by?: Record<string, string>;
5035
+ /** Array of filter object, representing multiple dimensions for a charge item. */
5036
+ filters?: CustomerProjectedChargeFiltersUsageObject;
5037
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
5038
+ presentation_breakdowns?: PresentationBreakdownsObject;
5039
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
5040
+ projected_presentation_breakdowns?: PresentationBreakdownsObject;
5041
+ }[];
5042
+ export interface CustomerProjectedChargeUsageObject {
5043
+ /**
5044
+ * The number of units consumed by the customer for a specific charge item.
5045
+ * @pattern ^[0-9]+.?[0-9]*$
5046
+ * @example "1.0"
5047
+ */
5048
+ units: string;
5049
+ /**
5050
+ * The projected number of units that can be consumed by the customer for a specific charge item.
5051
+ * @pattern ^[0-9]+.?[0-9]*$
5052
+ * @example "2.0"
5053
+ */
5054
+ projected_units: string;
5055
+ /**
5056
+ * 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.
5057
+ * @example 10
5058
+ */
5059
+ events_count: number;
5060
+ /**
5061
+ * The amount in cents, tax excluded, consumed by the customer for a specific charge item.
5062
+ * @example 123
5063
+ */
5064
+ amount_cents: number;
5065
+ /**
5066
+ * The projected amount in cents, tax excluded, that can be consumed by the customer for a specific charge item.
5067
+ * @example 256
5068
+ */
5069
+ projected_amount_cents: number;
5070
+ /**
5071
+ * The currency of a usage item consumed by the customer.
5072
+ * @example "EUR"
5073
+ */
5074
+ amount_currency: Currency;
5075
+ /** Details about the pricing unit used for charge usage. */
5076
+ pricing_unit_details?: UsagePricingUnitDetailsObject;
5077
+ /** Object listing all the properties for a specific charge item. */
5078
+ charge: {
5079
+ /**
5080
+ * 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.
5081
+ * @format uuid
5082
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5083
+ */
5084
+ lago_id: string;
5085
+ /**
5086
+ * The pricing model applied to this charge. Possible values are standard, `graduated`, `percentage`, `package` or `volume`.
5087
+ * @example "graduated"
5088
+ */
5089
+ charge_model: "standard" | "graduated" | "package" | "percentage" | "volume";
5090
+ /**
5091
+ * 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.
5092
+ * @example "Setup"
5093
+ */
5094
+ invoice_display_name?: string;
5095
+ };
5096
+ /** The related billable metric object. */
5097
+ billable_metric: {
5098
+ /**
5099
+ * 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.
5100
+ * @format uuid
5101
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5102
+ */
5103
+ lago_id: string;
5104
+ /**
5105
+ * The name of the billable metric used for this charge.
5106
+ * @example "Storage"
5107
+ */
5108
+ name: string;
5109
+ /**
5110
+ * The code of the billable metric used for this charge.
5111
+ * @example "storage"
5112
+ */
5113
+ code: string;
5114
+ /**
5115
+ * The aggregation type of the billable metric used for this charge. Possible values are `count_agg`, `sum_agg`, `max_agg` or `unique_count_agg`.
5116
+ * @example "sum_agg"
5117
+ */
5118
+ aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "weighted_sum_agg" | "latest_agg";
5119
+ };
5120
+ /** Array of filter object, representing multiple dimensions for a charge item. */
5121
+ filters?: CustomerProjectedChargeFiltersUsageObject;
5122
+ /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
5123
+ grouped_usage?: CustomerProjectedChargeGroupedUsageObject;
5124
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
5125
+ presentation_breakdowns?: PresentationBreakdownsObject;
5126
+ /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
5127
+ projected_presentation_breakdowns?: PresentationBreakdownsObject;
5128
+ }
4948
5129
  export interface CustomerProjectedUsageObject {
4949
5130
  /**
4950
5131
  * The lower bound of the billing period, expressed in the ISO 8601 datetime format in Coordinated Universal Time (UTC).
@@ -4996,13 +5177,13 @@ export interface CustomerProjectedUsageObject {
4996
5177
  */
4997
5178
  total_amount_cents: number;
4998
5179
  /** Array of charges that comprise the current usage. It contains detailed information about individual charge items associated with the usage. */
4999
- charges_usage: CustomerChargeUsageObject[];
5180
+ charges_usage: CustomerProjectedChargeUsageObject[];
5000
5181
  }
5001
5182
  export interface CustomerProjectedUsage {
5002
5183
  customer_projected_usage: CustomerProjectedUsageObject;
5003
5184
  }
5004
5185
  export interface CustomerPastUsage {
5005
- usage_periods: CustomerUsage[];
5186
+ usage_periods: CustomerUsageObject[];
5006
5187
  meta: PaginationMeta;
5007
5188
  }
5008
5189
  export interface CustomerCheckoutUrl {
@@ -5457,6 +5638,11 @@ export interface InvoiceOneOffCreateInput {
5457
5638
  * @example "hooli_1234"
5458
5639
  */
5459
5640
  external_customer_id: string;
5641
+ /**
5642
+ * The code of the billing entity to issue the invoice from. If not provided, the customer's billing entity is used.
5643
+ * @example "default"
5644
+ */
5645
+ billing_entity_code?: string;
5460
5646
  /**
5461
5647
  * The currency of the invoice.
5462
5648
  * @example "EUR"
@@ -5516,7 +5702,56 @@ export interface InvoiceOneOffCreateInput {
5516
5702
  payment_method?: PaymentMethodReference;
5517
5703
  };
5518
5704
  }
5705
+ export interface BillingPeriodObject {
5706
+ /**
5707
+ * Unique identifier assigned to the subscription, created by Lago.
5708
+ * @format uuid
5709
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5710
+ */
5711
+ lago_subscription_id: string;
5712
+ /**
5713
+ * Unique identifier assigned to the subscription in your application.
5714
+ * @example "external_id"
5715
+ */
5716
+ external_subscription_id: string;
5717
+ /**
5718
+ * Unique identifier assigned to the plan, created by Lago.
5719
+ * @format uuid
5720
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5721
+ */
5722
+ lago_plan_id: string;
5723
+ /**
5724
+ * The beginning date of the subscription billing period. This field indicates the start date of the billing period associated with the subscription fee.
5725
+ * @format date-time
5726
+ * @example "2022-04-29T08:59:51Z"
5727
+ */
5728
+ subscription_from_datetime: string;
5729
+ /**
5730
+ * The ending date of the subscription billing period. This field indicates the end date of the billing period associated with the subscription fee.
5731
+ * @format date-time
5732
+ * @example "2022-05-29T08:59:51Z"
5733
+ */
5734
+ subscription_to_datetime: string;
5735
+ /**
5736
+ * The beginning date of the period that covers the charge fees. It is applicable only to the `charge` fees attached to the subscription. This field indicates the start date of the billing period or subscription period associated with the fees.
5737
+ * @format date-time
5738
+ * @example "2022-04-29T08:59:51Z"
5739
+ */
5740
+ charges_from_datetime: string;
5741
+ /**
5742
+ * The ending date of the period that covers the charge fees. It is applicable only to the `charge` fees attached to the subscription. This field indicates the end date of the billing period or subscription period associated with the fees.
5743
+ * @format date-time
5744
+ * @example "2022-05-29T08:59:51Z"
5745
+ */
5746
+ charges_to_datetime: string;
5747
+ /**
5748
+ * The reason explaining why this subscription appears on the invoice.
5749
+ * @example "subscription_starting"
5750
+ */
5751
+ invoicing_reason: "subscription_starting" | "subscription_periodic" | "subscription_terminating" | "in_advance_charge" | "in_advance_charge_periodic" | "progressive_billing";
5752
+ }
5519
5753
  export type InvoiceObjectExtended = InvoiceObject & {
5754
+ billing_periods?: BillingPeriodObject[];
5520
5755
  credits?: CreditObject[];
5521
5756
  fees?: FeeObject[];
5522
5757
  subscriptions?: SubscriptionObject[];
@@ -5981,6 +6216,8 @@ export interface OrganizationObject {
5981
6216
  * @example false
5982
6217
  */
5983
6218
  finalize_zero_amount_invoice?: boolean;
6219
+ /** @example "clickhouse" */
6220
+ events_store?: "clickhouse" | "postgres";
5984
6221
  }
5985
6222
  export interface Organization {
5986
6223
  organization: OrganizationObject;
@@ -6262,6 +6499,23 @@ export interface ChargeProperties {
6262
6499
  per_unit_amount: string;
6263
6500
  }[];
6264
6501
  }
6502
+ export type ChargeObjectProperties = ChargeProperties & {
6503
+ /**
6504
+ * Groups usage into sub-items on invoices for display only, without affecting pricing or aggregation.
6505
+ * @example [{"value":"region","options":{"display_in_invoice":true}}]
6506
+ */
6507
+ presentation_group_keys?: {
6508
+ /**
6509
+ * The event property to group by.
6510
+ * @example "region"
6511
+ */
6512
+ value?: string;
6513
+ options?: {
6514
+ /** @example true */
6515
+ display_in_invoice?: boolean;
6516
+ };
6517
+ }[];
6518
+ };
6265
6519
  /** Values used to apply differentiated pricing based on additional event properties. */
6266
6520
  export interface ChargeFilterObject {
6267
6521
  /**
@@ -6356,7 +6610,7 @@ export interface ChargeObject {
6356
6610
  */
6357
6611
  min_amount_cents: number;
6358
6612
  /** List of all thresholds utilized for calculating the charge. */
6359
- properties: ChargeProperties;
6613
+ properties: ChargeObjectProperties;
6360
6614
  /** List of filters used to apply differentiated pricing based on additional event properties. */
6361
6615
  filters: ChargeFilterObject[];
6362
6616
  /** All taxes applied to the charge. */
@@ -6506,6 +6760,8 @@ export interface FixedChargeObject {
6506
6760
  properties: FixedChargeProperties;
6507
6761
  /**
6508
6762
  * The number of units for the fixed charge.
6763
+ *
6764
+ * When retrieved through a subscription-scoped endpoint (e.g. `GET /subscriptions/{external_id}/fixed_charges`), this reflects the per-subscription unit override when one exists, and falls back to the plan-level units otherwise. Plan-scoped endpoints always return the plan-level units.
6509
6765
  * @example 1
6510
6766
  */
6511
6767
  units: number;
@@ -6820,7 +7076,7 @@ export interface PlanCreateInput {
6820
7076
  */
6821
7077
  min_amount_cents?: number;
6822
7078
  /** List of all thresholds utilized for calculating the charge. */
6823
- properties?: ChargeProperties;
7079
+ properties?: ChargeObjectProperties;
6824
7080
  /** List of filters used to apply differentiated pricing based on additional event properties. */
6825
7081
  filters?: ChargeFilterInput[];
6826
7082
  /** List of unique code used to identify the taxes. */
@@ -7043,7 +7299,7 @@ export interface PlanUpdateInput {
7043
7299
  */
7044
7300
  min_amount_cents?: number;
7045
7301
  /** List of all thresholds utilized for calculating the charge. */
7046
- properties?: ChargeProperties;
7302
+ properties?: ChargeObjectProperties;
7047
7303
  /** List of filters used to apply differentiated pricing based on additional event properties. */
7048
7304
  filters?: ChargeFilterInput[];
7049
7305
  /** List of unique code used to identify the taxes. */
@@ -7175,7 +7431,7 @@ export interface ChargeOverridableInput {
7175
7431
  */
7176
7432
  min_amount_cents?: number;
7177
7433
  /** List of all thresholds utilized for calculating the charge. */
7178
- properties?: ChargeProperties;
7434
+ properties?: ChargeObjectProperties;
7179
7435
  /** List of filters used to apply differentiated pricing based on additional event properties. */
7180
7436
  filters?: ChargeFilterInput[];
7181
7437
  /** List of unique code used to identify the taxes. */
@@ -7541,7 +7797,7 @@ export interface PlanOverridesObject {
7541
7797
  */
7542
7798
  min_amount_cents?: number;
7543
7799
  /** List of all thresholds utilized for calculating the charge. */
7544
- properties?: ChargeProperties;
7800
+ properties?: ChargeObjectProperties;
7545
7801
  /** List of filters used to apply differentiated pricing based on additional event properties. */
7546
7802
  filters?: ChargeFilterInput[];
7547
7803
  /** List of unique code used to identify the taxes. */
@@ -7557,7 +7813,7 @@ export interface PlanOverridesObject {
7557
7813
  conversion_rate?: string;
7558
7814
  };
7559
7815
  }[];
7560
- /** Additional fixed charges for this plan. */
7816
+ /** Fixed charge overrides for the subscription. When `plan_overrides` contains only `fixed_charges` and every entry contains only `id`, `units`, and optionally `apply_units_immediately`, the units are recorded as a per-subscription override without creating a plan override, and subscription-scoped reads return these units. If any entry carries other fields, or `plan_overrides` contains any other key, the request is applied as a full plan override for the subscription instead. */
7561
7817
  fixed_charges?: {
7562
7818
  /**
7563
7819
  * Unique identifier of the fixed charge created by Lago.
@@ -7656,12 +7912,21 @@ export interface SubscriptionCreateInput {
7656
7912
  * @example "2022-08-08T00:00:00Z"
7657
7913
  */
7658
7914
  subscription_at?: string;
7659
- /** Based plan overrides. */
7915
+ /** Overrides applied to the plan for this subscription. A units-only `fixed_charges` override is recorded as a per-subscription unit override without creating a plan override; any other override creates a plan override for the subscription. See `fixed_charges` for the exact rule. */
7660
7916
  plan_overrides?: PlanOverridesObject;
7661
7917
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
7662
7918
  invoice_custom_section?: InvoiceCustomSectionInput;
7663
7919
  /** Optional payment method to use for processing subscription payments. */
7664
7920
  payment_method?: PaymentMethodReference;
7921
+ /**
7922
+ * Defines whether this subscription should be grouped with other subscriptions of the same customer when generating recurring invoices.
7923
+ *
7924
+ * - `true` (default): the subscription is included in the customer's standard invoice grouping (by billing entity, currency and payment method).
7925
+ * - `false`: the subscription is excluded from consolidation and always billed on its own dedicated invoice.
7926
+ * @default true
7927
+ * @example true
7928
+ */
7929
+ consolidate_invoice?: boolean;
7665
7930
  };
7666
7931
  }
7667
7932
  export interface ApplicableUsageThreshold {
@@ -7713,12 +7978,25 @@ export interface SubscriptionUpdateInput {
7713
7978
  * @example "2022-08-08T00:00:00Z"
7714
7979
  */
7715
7980
  subscription_at?: string;
7716
- /** Based plan overrides. */
7981
+ /** Overrides applied to the plan for this subscription. A units-only `fixed_charges` override is recorded as a per-subscription unit override without creating a plan override; any other override creates a plan override for the subscription. See `fixed_charges` for the exact rule. */
7717
7982
  plan_overrides?: PlanOverridesObject;
7718
7983
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
7719
7984
  invoice_custom_section?: InvoiceCustomSectionInput;
7720
7985
  /** Optional payment method to use for processing subscription payments. */
7721
7986
  payment_method?: PaymentMethodReference;
7987
+ /**
7988
+ * Defines whether this subscription should be grouped with other subscriptions of the same customer when generating recurring invoices.
7989
+ *
7990
+ * - `true`: the subscription is included in the customer's standard invoice grouping (by billing entity, currency and payment method).
7991
+ * - `false`: the subscription is excluded from consolidation and always billed on its own dedicated invoice.
7992
+ * @example false
7993
+ */
7994
+ consolidate_invoice?: boolean;
7995
+ /**
7996
+ * The code of the billing entity associated with the subscription. Updates take effect on future invoices only.
7997
+ * @example "default"
7998
+ */
7999
+ billing_entity_code?: string;
7722
8000
  };
7723
8001
  }
7724
8002
  export interface Subscription {
@@ -8857,7 +9135,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
8857
9135
  }
8858
9136
  /**
8859
9137
  * @title Lago API documentation
8860
- * @version 1.45.2
9138
+ * @version 1.49.0
8861
9139
  * @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
8862
9140
  * @baseUrl https://api.getlago.com/api/v1
8863
9141
  * @externalDocs https://github.com/getlago
@@ -10070,6 +10348,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10070
10348
  * @example "pending"
10071
10349
  */
10072
10350
  payment_status?: "pending" | "failed" | "succeeded";
10351
+ /**
10352
+ * Filter payment requests by billing entity codes.
10353
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
10354
+ */
10355
+ "billing_entity_codes[]"?: string[];
10073
10356
  }, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
10074
10357
  /**
10075
10358
  * @description Retrieves an embeddable link for displaying a customer portal. This endpoint allows you to fetch the URL that can be embedded to provide customers access to a dedicated portal
@@ -10119,6 +10402,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10119
10402
  * @example ["active","pending"]
10120
10403
  */
10121
10404
  "status[]"?: ("pending" | "canceled" | "terminated" | "active")[];
10405
+ /**
10406
+ * Filter subscriptions by billing entity codes.
10407
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
10408
+ */
10409
+ "billing_entity_codes[]"?: string[];
10122
10410
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
10123
10411
  /**
10124
10412
  * @description This endpoint is used to create a wallet with prepaid credits.
@@ -10150,6 +10438,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10150
10438
  * @example 20
10151
10439
  */
10152
10440
  per_page?: number;
10441
+ /**
10442
+ * Filter wallets by billing entity codes.
10443
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
10444
+ */
10445
+ "billing_entity_codes[]"?: string[];
10153
10446
  }, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
10154
10447
  /**
10155
10448
  * @description This endpoint is used to update an existing wallet with prepaid credits.
@@ -10348,6 +10641,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10348
10641
  * @example true
10349
10642
  */
10350
10643
  full_usage?: boolean;
10644
+ /**
10645
+ * Filter `presentation_breakdowns` by a JSON-encoded array of presentation group key values. Only breakdowns matching the provided values will be returned. Pass an empty array to disable `presentation_breakdowns` entirely.
10646
+ * @example "["engineering", "operations"]"
10647
+ */
10648
+ filter_by_presentation?: string;
10351
10649
  }, params?: RequestParams) => Promise<HttpResponse<CustomerUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
10352
10650
  /**
10353
10651
  * @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period. It also returns the projected usage for the current period based on the current usage.
@@ -11009,6 +11307,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11009
11307
  * @example "pending"
11010
11308
  */
11011
11309
  payment_status?: "pending" | "failed" | "succeeded";
11310
+ /**
11311
+ * Filter payment requests by billing entity codes.
11312
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
11313
+ */
11314
+ "billing_entity_codes[]"?: string[];
11012
11315
  }, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized>>;
11013
11316
  /**
11014
11317
  * @description This endpoint retrieves a specific payment request by its ID.
@@ -11467,6 +11770,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11467
11770
  * @example ["active","pending"]
11468
11771
  */
11469
11772
  "status[]"?: ("active" | "canceled" | "pending" | "terminated")[];
11773
+ /**
11774
+ * Filter subscriptions by billing entity codes.
11775
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
11776
+ */
11777
+ "billing_entity_codes[]"?: string[];
11470
11778
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized>>;
11471
11779
  /**
11472
11780
  * @description This endpoint retrieves a specific subscription.
@@ -11732,7 +12040,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11732
12040
  subscription_status?: "pending" | "active" | "terminated" | "canceled";
11733
12041
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorBadRequest | ApiErrorNotFound>>;
11734
12042
  /**
11735
- * @description This endpoint retrieves all effective fixed charges for a specific subscription. If the subscription has plan overrides with fixed charge overrides, the overridden fixed charges are returned.
12043
+ * @description This endpoint retrieves all effective fixed charges for a specific subscription. The `units` of each fixed charge reflect any per-subscription unit override applied to the subscription; when no override exists, the plan-level units are returned.
11736
12044
  *
11737
12045
  * @tags subscriptions
11738
12046
  * @name FindAllSubscriptionFixedCharges
@@ -11915,7 +12223,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11915
12223
  subscription_status?: "pending" | "active" | "terminated" | "canceled";
11916
12224
  }, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
11917
12225
  /**
11918
- * @description This endpoint retrieves a specific effective fixed charge for a subscription. If the subscription has a plan override with a fixed charge override, the overridden fixed charge is returned.
12226
+ * @description This endpoint retrieves a specific effective fixed charge for a subscription. The `units` reflect any per-subscription unit override applied to the subscription; when no override exists, the plan-level units are returned.
11919
12227
  *
11920
12228
  * @tags subscriptions
11921
12229
  * @name FindSubscriptionFixedCharge
@@ -11932,7 +12240,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11932
12240
  subscription_status?: "pending" | "active" | "terminated" | "canceled";
11933
12241
  }, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorNotFound>>;
11934
12242
  /**
11935
- * @description This endpoint creates or updates a fixed charge override for a specific subscription. If the subscription does not have a plan override yet, one will be created automatically. The fixed charge override allows customizing specific fixed charge properties (invoice_display_name, units, properties, taxes) without affecting the original plan fixed charge. This is a premium feature.
12243
+ * @description This endpoint creates or updates a fixed charge override for a subscription, without affecting the original plan fixed charge. When the body contains only `units` (and optionally `apply_units_immediately`), the change is recorded as a per-subscription unit override. When the body also sets `invoice_display_name`, `properties`, or `tax_codes`, it is applied as a full plan override for the subscription instead. With `apply_units_immediately: true` on a pay-in-advance fixed charge the change is billed mid-period; otherwise it takes effect at the next billing period. This is a premium feature.
11936
12244
  *
11937
12245
  * @tags subscriptions
11938
12246
  * @name OverrideSubscriptionFixedCharge
@@ -12048,6 +12356,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12048
12356
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
12049
12357
  */
12050
12358
  external_customer_id: string;
12359
+ /**
12360
+ * Filter wallets by billing entity codes.
12361
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
12362
+ */
12363
+ "billing_entity_codes[]"?: string[];
12051
12364
  }, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden>>;
12052
12365
  /**
12053
12366
  * @description This endpoint is used to update an existing wallet with prepaid credits.