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.
@@ -2447,7 +2447,7 @@ export interface paths {
2447
2447
  /**
2448
2448
  * List all fixed charges for a subscription
2449
2449
  * @description This endpoint retrieves all effective fixed charges for a specific subscription.
2450
- * If the subscription has plan overrides with fixed charge overrides, the overridden fixed charges are returned.
2450
+ * 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.
2451
2451
  */
2452
2452
  get: operations["findAllSubscriptionFixedCharges"];
2453
2453
  put?: never;
@@ -2594,14 +2594,14 @@ export interface paths {
2594
2594
  /**
2595
2595
  * Retrieve a fixed charge for a subscription
2596
2596
  * @description This endpoint retrieves a specific effective fixed charge for a subscription.
2597
- * If the subscription has a plan override with a fixed charge override, the overridden fixed charge is returned.
2597
+ * The `units` reflect any per-subscription unit override applied to the subscription; when no override exists, the plan-level units are returned.
2598
2598
  */
2599
2599
  get: operations["findSubscriptionFixedCharge"];
2600
2600
  /**
2601
2601
  * Override a fixed charge for a subscription
2602
- * @description This endpoint creates or updates a fixed charge override for a specific subscription.
2603
- * If the subscription does not have a plan override yet, one will be created automatically.
2604
- * The fixed charge override allows customizing specific fixed charge properties (invoice_display_name, units, properties, taxes) without affecting the original plan fixed charge.
2602
+ * @description This endpoint creates or updates a fixed charge override for a subscription, without affecting the original plan fixed charge.
2603
+ * 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.
2604
+ * 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.
2605
2605
  * This is a premium feature.
2606
2606
  */
2607
2607
  put: operations["overrideSubscriptionFixedCharge"];
@@ -2992,6 +2992,66 @@ export interface webhooks {
2992
2992
  patch?: never;
2993
2993
  trace?: never;
2994
2994
  };
2995
+ billable_metric_created: {
2996
+ parameters: {
2997
+ query?: never;
2998
+ header?: never;
2999
+ path?: never;
3000
+ cookie?: never;
3001
+ };
3002
+ get?: never;
3003
+ put?: never;
3004
+ /**
3005
+ * A new billable metric has been created
3006
+ * @description A new billable metric has been created
3007
+ */
3008
+ post: operations["billableMetricCreated"];
3009
+ delete?: never;
3010
+ options?: never;
3011
+ head?: never;
3012
+ patch?: never;
3013
+ trace?: never;
3014
+ };
3015
+ billable_metric_updated: {
3016
+ parameters: {
3017
+ query?: never;
3018
+ header?: never;
3019
+ path?: never;
3020
+ cookie?: never;
3021
+ };
3022
+ get?: never;
3023
+ put?: never;
3024
+ /**
3025
+ * A billable metric has been updated
3026
+ * @description A billable metric has been updated
3027
+ */
3028
+ post: operations["billableMetricUpdated"];
3029
+ delete?: never;
3030
+ options?: never;
3031
+ head?: never;
3032
+ patch?: never;
3033
+ trace?: never;
3034
+ };
3035
+ billable_metric_deleted: {
3036
+ parameters: {
3037
+ query?: never;
3038
+ header?: never;
3039
+ path?: never;
3040
+ cookie?: never;
3041
+ };
3042
+ get?: never;
3043
+ put?: never;
3044
+ /**
3045
+ * A billable metric has been deleted
3046
+ * @description A billable metric has been deleted
3047
+ */
3048
+ post: operations["billableMetricDeleted"];
3049
+ delete?: never;
3050
+ options?: never;
3051
+ head?: never;
3052
+ patch?: never;
3053
+ trace?: never;
3054
+ };
2995
3055
  customer_created: {
2996
3056
  parameters: {
2997
3057
  query?: never;
@@ -6225,6 +6285,18 @@ export interface components {
6225
6285
  */
6226
6286
  conversion_rate: string;
6227
6287
  };
6288
+ /** @description Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
6289
+ PresentationBreakdownsObject: {
6290
+ /** @description Key value list of event properties used for presentation grouping. */
6291
+ presentation_by?: {
6292
+ [key: string]: string;
6293
+ };
6294
+ /**
6295
+ * @description The number of units consumed for a specific presentation group.
6296
+ * @example 9.0
6297
+ */
6298
+ units?: string;
6299
+ }[];
6228
6300
  FeeObject: {
6229
6301
  /**
6230
6302
  * Format: uuid
@@ -6515,6 +6587,7 @@ export interface components {
6515
6587
  applied_taxes?: components["schemas"]["FeeAppliedTaxObject"][];
6516
6588
  /** @description Details about the pricing unit used and amounts for this fee. */
6517
6589
  pricing_unit_details?: components["schemas"]["PricingUnitDetailsObject"];
6590
+ presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
6518
6591
  };
6519
6592
  CreditNoteItemObject: {
6520
6593
  /**
@@ -7766,55 +7839,6 @@ export interface components {
7766
7839
  */
7767
7840
  updated_at: string;
7768
7841
  };
7769
- BillingPeriodObject: {
7770
- /**
7771
- * Format: uuid
7772
- * @description Unique identifier assigned to the subscription, created by Lago.
7773
- * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
7774
- */
7775
- lago_subscription_id: string;
7776
- /**
7777
- * @description Unique identifier assigned to the subscription in your application.
7778
- * @example external_id
7779
- */
7780
- external_subscription_id: string;
7781
- /**
7782
- * Format: uuid
7783
- * @description Unique identifier assigned to the plan, created by Lago.
7784
- * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
7785
- */
7786
- lago_plan_id: string;
7787
- /**
7788
- * Format: date-time
7789
- * @description The beginning date of the subscription billing period. This field indicates the start date of the billing period associated with the subscription fee.
7790
- * @example 2022-04-29T08:59:51Z
7791
- */
7792
- subscription_from_datetime: string;
7793
- /**
7794
- * Format: date-time
7795
- * @description The ending date of the subscription billing period. This field indicates the end date of the billing period associated with the subscription fee.
7796
- * @example 2022-05-29T08:59:51Z
7797
- */
7798
- subscription_to_datetime: string;
7799
- /**
7800
- * Format: date-time
7801
- * @description 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.
7802
- * @example 2022-04-29T08:59:51Z
7803
- */
7804
- charges_from_datetime: string;
7805
- /**
7806
- * Format: date-time
7807
- * @description 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.
7808
- * @example 2022-05-29T08:59:51Z
7809
- */
7810
- charges_to_datetime: string;
7811
- /**
7812
- * @description The reason explaining why this subscription appears on the invoice.
7813
- * @example subscription_starting
7814
- * @enum {string}
7815
- */
7816
- invoicing_reason: "subscription_starting" | "subscription_periodic" | "subscription_terminating" | "in_advance_charge" | "in_advance_charge_periodic" | "progressive_billing";
7817
- };
7818
7842
  InvoiceMetadataObject: {
7819
7843
  /**
7820
7844
  * Format: uuid
@@ -7939,7 +7963,6 @@ export interface components {
7939
7963
  InvoiceObject: components["schemas"]["InvoiceBaseObject"] & {
7940
7964
  /** @description The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
7941
7965
  customer?: components["schemas"]["CustomerObject"];
7942
- billing_periods?: components["schemas"]["BillingPeriodObject"][];
7943
7966
  metadata?: components["schemas"]["InvoiceMetadataObject"][];
7944
7967
  applied_taxes?: components["schemas"]["InvoiceAppliedTaxObject"][];
7945
7968
  /** @description The invoice custom sections applied to this invoice for PDF generation. */
@@ -8175,6 +8198,11 @@ export interface components {
8175
8198
  * @example 5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba
8176
8199
  */
8177
8200
  external_customer_id: string;
8201
+ /**
8202
+ * @description The code of the billing entity associated with the subscription.
8203
+ * @example default
8204
+ */
8205
+ billing_entity_code?: string;
8178
8206
  /**
8179
8207
  * @description 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).
8180
8208
  * @example anniversary
@@ -8310,6 +8338,15 @@ export interface components {
8310
8338
  applied_invoice_custom_sections?: components["schemas"]["AppliedInvoiceCustomSectionObject"][];
8311
8339
  /** @description The payment method assigned to this subscription for processing payments. */
8312
8340
  payment_method?: components["schemas"]["PaymentMethodReference"];
8341
+ /**
8342
+ * @description Controls whether this subscription is eligible to be grouped with other subscriptions of the same customer on a consolidated recurring invoice.
8343
+ *
8344
+ * - `true` (default): the subscription is included in the customer's standard invoice grouping (by billing entity, currency and payment method).
8345
+ * - `false`: the subscription is excluded from consolidation and always billed on its own dedicated invoice, regardless of other grouping criteria.
8346
+ * @default true
8347
+ * @example true
8348
+ */
8349
+ consolidate_invoice: boolean;
8313
8350
  };
8314
8351
  SubscriptionsPaginated: {
8315
8352
  subscriptions: components["schemas"]["SubscriptionObject"][];
@@ -8362,6 +8399,11 @@ export interface components {
8362
8399
  * @example 10.0
8363
8400
  */
8364
8401
  granted_credits: string;
8402
+ /**
8403
+ * @description 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.
8404
+ * @example false
8405
+ */
8406
+ grants_target_top_up: boolean | null;
8365
8407
  /**
8366
8408
  * Format: date-time
8367
8409
  * @description 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).
@@ -8442,6 +8484,11 @@ export interface components {
8442
8484
  * @example hooli_1234
8443
8485
  */
8444
8486
  external_customer_id: string;
8487
+ /**
8488
+ * @description The code of the billing entity associated with the wallet.
8489
+ * @example default
8490
+ */
8491
+ billing_entity_code?: string;
8445
8492
  /**
8446
8493
  * @description The status of the wallet. Possible values are `active` or `terminated`.
8447
8494
  * @example active
@@ -8639,6 +8686,11 @@ export interface components {
8639
8686
  * @example hooli_1234
8640
8687
  */
8641
8688
  external_customer_id: string;
8689
+ /**
8690
+ * @description The code of the billing entity associated with the wallet. If not provided, the customer's billing entity is used.
8691
+ * @example default
8692
+ */
8693
+ billing_entity_code?: string;
8642
8694
  /**
8643
8695
  * Format: date-time
8644
8696
  * @description 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).
@@ -8717,6 +8769,11 @@ export interface components {
8717
8769
  * @example 10.0
8718
8770
  */
8719
8771
  granted_credits?: string | null;
8772
+ /**
8773
+ * @description 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.
8774
+ * @example false
8775
+ */
8776
+ grants_target_top_up?: boolean | null;
8720
8777
  /**
8721
8778
  * @description The method used for recurring top-up. Possible values are `fixed` or `target`.
8722
8779
  * @example target
@@ -8831,6 +8888,11 @@ export interface components {
8831
8888
  * @example false
8832
8889
  */
8833
8890
  invoice_requires_successful_payment?: boolean;
8891
+ /**
8892
+ * @description The code of the billing entity associated with the wallet.
8893
+ * @example default
8894
+ */
8895
+ billing_entity_code?: string;
8834
8896
  invoice_custom_section?: components["schemas"]["InvoiceCustomSectionInput"];
8835
8897
  /** @description List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
8836
8898
  recurring_transaction_rules?: {
@@ -8873,6 +8935,11 @@ export interface components {
8873
8935
  * @example 10.0
8874
8936
  */
8875
8937
  granted_credits?: string | null;
8938
+ /**
8939
+ * @description 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.
8940
+ * @example false
8941
+ */
8942
+ grants_target_top_up?: boolean | null;
8876
8943
  /**
8877
8944
  * Format: date-time
8878
8945
  * @description 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).
@@ -9173,6 +9240,7 @@ export interface components {
9173
9240
  values?: {
9174
9241
  [key: string]: string[];
9175
9242
  };
9243
+ presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
9176
9244
  }[];
9177
9245
  /** @description Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
9178
9246
  CustomerChargeGroupedUsageObject: {
@@ -9202,6 +9270,7 @@ export interface components {
9202
9270
  [key: string]: string;
9203
9271
  };
9204
9272
  filters?: components["schemas"]["CustomerChargeFiltersUsageObject"];
9273
+ presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
9205
9274
  }[];
9206
9275
  CustomerChargeUsageObject: {
9207
9276
  /**
@@ -9248,7 +9317,7 @@ export interface components {
9248
9317
  * @description 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.
9249
9318
  * @example Setup
9250
9319
  */
9251
- invoice_display_name?: string;
9320
+ invoice_display_name?: string | null;
9252
9321
  };
9253
9322
  /** @description The related billable metric object. */
9254
9323
  billable_metric: {
@@ -9277,6 +9346,7 @@ export interface components {
9277
9346
  };
9278
9347
  filters?: components["schemas"]["CustomerChargeFiltersUsageObject"];
9279
9348
  grouped_usage?: components["schemas"]["CustomerChargeGroupedUsageObject"];
9349
+ presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
9280
9350
  };
9281
9351
  CustomerUsageObject: {
9282
9352
  /**
@@ -9329,6 +9399,171 @@ export interface components {
9329
9399
  CustomerUsage: {
9330
9400
  customer_usage: components["schemas"]["CustomerUsageObject"];
9331
9401
  };
9402
+ /** @description Array of filter object, representing multiple dimensions for a charge item. */
9403
+ CustomerProjectedChargeFiltersUsageObject: {
9404
+ /**
9405
+ * @description The number of units consumed for a specific charge filter related to a charge item.
9406
+ * @example 0.9
9407
+ */
9408
+ units?: string;
9409
+ /**
9410
+ * @description The projected number of units that can be consumed for a specific charge filter related to a charge item.
9411
+ * @example 1.8
9412
+ */
9413
+ projected_units?: string;
9414
+ /**
9415
+ * @description The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
9416
+ * @example 1000
9417
+ */
9418
+ amount_cents?: number;
9419
+ /**
9420
+ * @description The projected amount in cents, tax excluded, that can be consumed for a specific charge filter related to a charge item.
9421
+ * @example 2000
9422
+ */
9423
+ projected_amount_cents?: number;
9424
+ /**
9425
+ * @description 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.
9426
+ * @example 10
9427
+ */
9428
+ events_count?: number;
9429
+ /**
9430
+ * @description Specifies the name that will be displayed on an invoice.
9431
+ * @example AWS eu-east-1
9432
+ */
9433
+ invoice_display_name?: string;
9434
+ pricing_unit_details?: components["schemas"]["UsagePricingUnitDetailsObject"];
9435
+ /**
9436
+ * @description List of filter values applied to the usage.
9437
+ * @example {
9438
+ * "region": [
9439
+ * "us-east-1"
9440
+ * ]
9441
+ * }
9442
+ */
9443
+ values?: {
9444
+ [key: string]: string[];
9445
+ };
9446
+ presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
9447
+ projected_presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
9448
+ }[];
9449
+ /** @description Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
9450
+ CustomerProjectedChargeGroupedUsageObject: {
9451
+ /**
9452
+ * @description The amount in cents, tax excluded, consumed for a specific group related to a charge item.
9453
+ * @example 1000
9454
+ */
9455
+ amount_cents?: number;
9456
+ /**
9457
+ * @description The projected amount in cents, tax excluded, that can be consumed for a specific group related to a charge item.
9458
+ * @example 2000
9459
+ */
9460
+ projected_amount_cents?: number;
9461
+ /**
9462
+ * @description 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.
9463
+ * @example 10
9464
+ */
9465
+ events_count?: number;
9466
+ /**
9467
+ * @description The number of units consumed for a specific group related to a charge item.
9468
+ * @example 0.9
9469
+ */
9470
+ units?: string;
9471
+ /**
9472
+ * @description The projected number of units that can be consumed for a specific group related to a charge item.
9473
+ * @example 1.8
9474
+ */
9475
+ projected_units?: string;
9476
+ pricing_unit_details?: components["schemas"]["UsagePricingUnitDetailsObject"];
9477
+ /** @description Key value list of event properties aggregated by the charge model */
9478
+ grouped_by?: {
9479
+ [key: string]: string;
9480
+ };
9481
+ filters?: components["schemas"]["CustomerProjectedChargeFiltersUsageObject"];
9482
+ presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
9483
+ projected_presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
9484
+ }[];
9485
+ CustomerProjectedChargeUsageObject: {
9486
+ /**
9487
+ * @description The number of units consumed by the customer for a specific charge item.
9488
+ * @example 1.0
9489
+ */
9490
+ units: string;
9491
+ /**
9492
+ * @description The projected number of units that can be consumed by the customer for a specific charge item.
9493
+ * @example 2.0
9494
+ */
9495
+ projected_units: string;
9496
+ /**
9497
+ * @description 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.
9498
+ * @example 10
9499
+ */
9500
+ events_count: number;
9501
+ /**
9502
+ * @description The amount in cents, tax excluded, consumed by the customer for a specific charge item.
9503
+ * @example 123
9504
+ */
9505
+ amount_cents: number;
9506
+ /**
9507
+ * @description The projected amount in cents, tax excluded, that can be consumed by the customer for a specific charge item.
9508
+ * @example 256
9509
+ */
9510
+ projected_amount_cents: number;
9511
+ /**
9512
+ * @description The currency of a usage item consumed by the customer.
9513
+ * @example EUR
9514
+ */
9515
+ amount_currency: components["schemas"]["Currency"];
9516
+ pricing_unit_details?: components["schemas"]["UsagePricingUnitDetailsObject"];
9517
+ /** @description Object listing all the properties for a specific charge item. */
9518
+ charge: {
9519
+ /**
9520
+ * Format: uuid
9521
+ * @description 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.
9522
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
9523
+ */
9524
+ lago_id: string;
9525
+ /**
9526
+ * @description The pricing model applied to this charge. Possible values are standard, `graduated`, `percentage`, `package` or `volume`.
9527
+ * @example graduated
9528
+ * @enum {string}
9529
+ */
9530
+ charge_model: "standard" | "graduated" | "package" | "percentage" | "volume";
9531
+ /**
9532
+ * @description 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.
9533
+ * @example Setup
9534
+ */
9535
+ invoice_display_name?: string;
9536
+ };
9537
+ /** @description The related billable metric object. */
9538
+ billable_metric: {
9539
+ /**
9540
+ * Format: uuid
9541
+ * @description 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.
9542
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
9543
+ */
9544
+ lago_id: string;
9545
+ /**
9546
+ * @description The name of the billable metric used for this charge.
9547
+ * @example Storage
9548
+ */
9549
+ name: string;
9550
+ /**
9551
+ * @description The code of the billable metric used for this charge.
9552
+ * @example storage
9553
+ */
9554
+ code: string;
9555
+ /**
9556
+ * @description The aggregation type of the billable metric used for this charge. Possible values are `count_agg`, `sum_agg`, `max_agg` or `unique_count_agg`.
9557
+ * @example sum_agg
9558
+ * @enum {string}
9559
+ */
9560
+ aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "weighted_sum_agg" | "latest_agg";
9561
+ };
9562
+ filters?: components["schemas"]["CustomerProjectedChargeFiltersUsageObject"];
9563
+ grouped_usage?: components["schemas"]["CustomerProjectedChargeGroupedUsageObject"];
9564
+ presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
9565
+ projected_presentation_breakdowns?: components["schemas"]["PresentationBreakdownsObject"];
9566
+ };
9332
9567
  CustomerProjectedUsageObject: {
9333
9568
  /**
9334
9569
  * Format: date-time
@@ -9380,13 +9615,13 @@ export interface components {
9380
9615
  */
9381
9616
  total_amount_cents: number;
9382
9617
  /** @description Array of charges that comprise the current usage. It contains detailed information about individual charge items associated with the usage. */
9383
- charges_usage: components["schemas"]["CustomerChargeUsageObject"][];
9618
+ charges_usage: components["schemas"]["CustomerProjectedChargeUsageObject"][];
9384
9619
  };
9385
9620
  CustomerProjectedUsage: {
9386
9621
  customer_projected_usage: components["schemas"]["CustomerProjectedUsageObject"];
9387
9622
  };
9388
9623
  CustomerPastUsage: {
9389
- usage_periods: components["schemas"]["CustomerUsage"][];
9624
+ usage_periods: components["schemas"]["CustomerUsageObject"][];
9390
9625
  meta: components["schemas"]["PaginationMeta"];
9391
9626
  };
9392
9627
  CustomerCheckoutUrl: {
@@ -9860,6 +10095,11 @@ export interface components {
9860
10095
  * @example hooli_1234
9861
10096
  */
9862
10097
  external_customer_id: string;
10098
+ /**
10099
+ * @description The code of the billing entity to issue the invoice from. If not provided, the customer's billing entity is used.
10100
+ * @example default
10101
+ */
10102
+ billing_entity_code?: string;
9863
10103
  /**
9864
10104
  * @description The currency of the invoice.
9865
10105
  * @example EUR
@@ -9916,7 +10156,57 @@ export interface components {
9916
10156
  payment_method?: components["schemas"]["PaymentMethodReference"];
9917
10157
  };
9918
10158
  };
10159
+ BillingPeriodObject: {
10160
+ /**
10161
+ * Format: uuid
10162
+ * @description Unique identifier assigned to the subscription, created by Lago.
10163
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
10164
+ */
10165
+ lago_subscription_id: string;
10166
+ /**
10167
+ * @description Unique identifier assigned to the subscription in your application.
10168
+ * @example external_id
10169
+ */
10170
+ external_subscription_id: string;
10171
+ /**
10172
+ * Format: uuid
10173
+ * @description Unique identifier assigned to the plan, created by Lago.
10174
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
10175
+ */
10176
+ lago_plan_id: string;
10177
+ /**
10178
+ * Format: date-time
10179
+ * @description The beginning date of the subscription billing period. This field indicates the start date of the billing period associated with the subscription fee.
10180
+ * @example 2022-04-29T08:59:51Z
10181
+ */
10182
+ subscription_from_datetime: string;
10183
+ /**
10184
+ * Format: date-time
10185
+ * @description The ending date of the subscription billing period. This field indicates the end date of the billing period associated with the subscription fee.
10186
+ * @example 2022-05-29T08:59:51Z
10187
+ */
10188
+ subscription_to_datetime: string;
10189
+ /**
10190
+ * Format: date-time
10191
+ * @description 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.
10192
+ * @example 2022-04-29T08:59:51Z
10193
+ */
10194
+ charges_from_datetime: string;
10195
+ /**
10196
+ * Format: date-time
10197
+ * @description 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.
10198
+ * @example 2022-05-29T08:59:51Z
10199
+ */
10200
+ charges_to_datetime: string;
10201
+ /**
10202
+ * @description The reason explaining why this subscription appears on the invoice.
10203
+ * @example subscription_starting
10204
+ * @enum {string}
10205
+ */
10206
+ invoicing_reason: "subscription_starting" | "subscription_periodic" | "subscription_terminating" | "in_advance_charge" | "in_advance_charge_periodic" | "progressive_billing";
10207
+ };
9919
10208
  InvoiceObjectExtended: components["schemas"]["InvoiceObject"] & {
10209
+ billing_periods?: components["schemas"]["BillingPeriodObject"][];
9920
10210
  credits?: components["schemas"]["CreditObject"][];
9921
10211
  fees?: components["schemas"]["FeeObject"][];
9922
10212
  subscriptions?: components["schemas"]["SubscriptionObject"][];
@@ -10385,6 +10675,11 @@ export interface components {
10385
10675
  * @example false
10386
10676
  */
10387
10677
  finalize_zero_amount_invoice?: boolean;
10678
+ /**
10679
+ * @example clickhouse
10680
+ * @enum {string}
10681
+ */
10682
+ events_store?: "clickhouse" | "postgres";
10388
10683
  };
10389
10684
  Organization: {
10390
10685
  organization: components["schemas"]["OrganizationObject"];
@@ -10664,6 +10959,30 @@ export interface components {
10664
10959
  per_unit_amount: string;
10665
10960
  }[];
10666
10961
  };
10962
+ ChargeObjectProperties: components["schemas"]["ChargeProperties"] & {
10963
+ /**
10964
+ * @description Groups usage into sub-items on invoices for display only, without affecting pricing or aggregation.
10965
+ * @example [
10966
+ * {
10967
+ * "value": "region",
10968
+ * "options": {
10969
+ * "display_in_invoice": true
10970
+ * }
10971
+ * }
10972
+ * ]
10973
+ */
10974
+ presentation_group_keys?: {
10975
+ /**
10976
+ * @description The event property to group by.
10977
+ * @example region
10978
+ */
10979
+ value?: string;
10980
+ options?: {
10981
+ /** @example true */
10982
+ display_in_invoice?: boolean;
10983
+ };
10984
+ }[];
10985
+ };
10667
10986
  /** @description Values used to apply differentiated pricing based on additional event properties. */
10668
10987
  ChargeFilterObject: {
10669
10988
  /**
@@ -10755,7 +11074,7 @@ export interface components {
10755
11074
  */
10756
11075
  min_amount_cents: number;
10757
11076
  /** @description List of all thresholds utilized for calculating the charge. */
10758
- properties: components["schemas"]["ChargeProperties"];
11077
+ properties: components["schemas"]["ChargeObjectProperties"];
10759
11078
  /** @description List of filters used to apply differentiated pricing based on additional event properties. */
10760
11079
  filters: components["schemas"]["ChargeFilterObject"][];
10761
11080
  /** @description All taxes applied to the charge. */
@@ -10901,6 +11220,8 @@ export interface components {
10901
11220
  properties: components["schemas"]["FixedChargeProperties"];
10902
11221
  /**
10903
11222
  * @description The number of units for the fixed charge.
11223
+ *
11224
+ * 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.
10904
11225
  * @example 1
10905
11226
  */
10906
11227
  units: number;
@@ -11573,7 +11894,7 @@ export interface components {
11573
11894
  */
11574
11895
  min_amount_cents?: number;
11575
11896
  /** @description List of all thresholds utilized for calculating the charge. */
11576
- properties?: components["schemas"]["ChargeProperties"];
11897
+ properties?: components["schemas"]["ChargeObjectProperties"];
11577
11898
  /** @description List of filters used to apply differentiated pricing based on additional event properties. */
11578
11899
  filters?: components["schemas"]["ChargeFilterInput"][];
11579
11900
  tax_codes?: components["schemas"]["TaxCodes"];
@@ -11941,7 +12262,7 @@ export interface components {
11941
12262
  */
11942
12263
  min_amount_cents?: number;
11943
12264
  /** @description List of all thresholds utilized for calculating the charge. */
11944
- properties?: components["schemas"]["ChargeProperties"];
12265
+ properties?: components["schemas"]["ChargeObjectProperties"];
11945
12266
  /** @description List of filters used to apply differentiated pricing based on additional event properties. */
11946
12267
  filters?: components["schemas"]["ChargeFilterInput"][];
11947
12268
  tax_codes?: components["schemas"]["TaxCodes"];
@@ -12150,7 +12471,7 @@ export interface components {
12150
12471
  */
12151
12472
  min_amount_cents?: number;
12152
12473
  /** @description List of all thresholds utilized for calculating the charge. */
12153
- properties?: components["schemas"]["ChargeProperties"];
12474
+ properties?: components["schemas"]["ChargeObjectProperties"];
12154
12475
  /** @description List of filters used to apply differentiated pricing based on additional event properties. */
12155
12476
  filters?: components["schemas"]["ChargeFilterInput"][];
12156
12477
  tax_codes?: components["schemas"]["TaxCodes"];
@@ -12505,7 +12826,7 @@ export interface components {
12505
12826
  */
12506
12827
  min_amount_cents?: number;
12507
12828
  /** @description List of all thresholds utilized for calculating the charge. */
12508
- properties?: components["schemas"]["ChargeProperties"];
12829
+ properties?: components["schemas"]["ChargeObjectProperties"];
12509
12830
  /** @description List of filters used to apply differentiated pricing based on additional event properties. */
12510
12831
  filters?: components["schemas"]["ChargeFilterInput"][];
12511
12832
  tax_codes?: components["schemas"]["TaxCodes"];
@@ -12520,7 +12841,7 @@ export interface components {
12520
12841
  conversion_rate?: string;
12521
12842
  };
12522
12843
  }[];
12523
- /** @description Additional fixed charges for this plan. */
12844
+ /** @description 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. */
12524
12845
  fixed_charges?: {
12525
12846
  /**
12526
12847
  * Format: uuid
@@ -12619,10 +12940,20 @@ export interface components {
12619
12940
  * @example 2022-08-08T00:00:00Z
12620
12941
  */
12621
12942
  subscription_at?: string;
12943
+ /** @description 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. */
12622
12944
  plan_overrides?: components["schemas"]["PlanOverridesObject"];
12623
12945
  invoice_custom_section?: components["schemas"]["InvoiceCustomSectionInput"];
12624
12946
  /** @description Optional payment method to use for processing subscription payments. */
12625
12947
  payment_method?: components["schemas"]["PaymentMethodReference"];
12948
+ /**
12949
+ * @description Defines whether this subscription should be grouped with other subscriptions of the same customer when generating recurring invoices.
12950
+ *
12951
+ * - `true` (default): the subscription is included in the customer's standard invoice grouping (by billing entity, currency and payment method).
12952
+ * - `false`: the subscription is excluded from consolidation and always billed on its own dedicated invoice.
12953
+ * @default true
12954
+ * @example true
12955
+ */
12956
+ consolidate_invoice: boolean;
12626
12957
  };
12627
12958
  };
12628
12959
  ApplicableUsageThreshold: {
@@ -12675,10 +13006,24 @@ export interface components {
12675
13006
  * @example 2022-08-08T00:00:00Z
12676
13007
  */
12677
13008
  subscription_at?: string;
13009
+ /** @description 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. */
12678
13010
  plan_overrides?: components["schemas"]["PlanOverridesObject"];
12679
13011
  invoice_custom_section?: components["schemas"]["InvoiceCustomSectionInput"];
12680
13012
  /** @description Optional payment method to use for processing subscription payments. */
12681
13013
  payment_method?: components["schemas"]["PaymentMethodReference"];
13014
+ /**
13015
+ * @description Defines whether this subscription should be grouped with other subscriptions of the same customer when generating recurring invoices.
13016
+ *
13017
+ * - `true`: the subscription is included in the customer's standard invoice grouping (by billing entity, currency and payment method).
13018
+ * - `false`: the subscription is excluded from consolidation and always billed on its own dedicated invoice.
13019
+ * @example false
13020
+ */
13021
+ consolidate_invoice?: boolean;
13022
+ /**
13023
+ * @description The code of the billing entity associated with the subscription. Updates take effect on future invoices only.
13024
+ * @example default
13025
+ */
13026
+ billing_entity_code?: string;
12682
13027
  };
12683
13028
  };
12684
13029
  Subscription: {
@@ -15734,6 +16079,8 @@ export interface operations {
15734
16079
  per_page?: components["parameters"]["per_page"];
15735
16080
  /** @description Filter by payment status. Possible values are `pending`, `failed` or `succeeded`. */
15736
16081
  payment_status?: components["parameters"]["payment_status"];
16082
+ /** @description Filter payment requests by billing entity codes. */
16083
+ "billing_entity_codes[]"?: string[];
15737
16084
  };
15738
16085
  header?: never;
15739
16086
  path: {
@@ -15801,6 +16148,8 @@ export interface operations {
15801
16148
  plan_code?: string;
15802
16149
  /** @description If the field is not defined, Lago will return only `active` subscriptions. However, if you wish to fetch subscriptions by different status you can define them in a status[] query param. Available filter values: `pending`, `canceled`, `terminated`, `active`. */
15803
16150
  "status[]"?: ("pending" | "canceled" | "terminated" | "active")[];
16151
+ /** @description Filter subscriptions by billing entity codes. */
16152
+ "billing_entity_codes[]"?: string[];
15804
16153
  };
15805
16154
  header?: never;
15806
16155
  path: {
@@ -15831,6 +16180,8 @@ export interface operations {
15831
16180
  page?: components["parameters"]["page"];
15832
16181
  /** @description Number of records per page. */
15833
16182
  per_page?: components["parameters"]["per_page"];
16183
+ /** @description Filter wallets by billing entity codes. */
16184
+ "billing_entity_codes[]"?: string[];
15834
16185
  };
15835
16186
  header?: never;
15836
16187
  path: {
@@ -16315,6 +16666,8 @@ export interface operations {
16315
16666
  };
16316
16667
  /** @description When `true`, returns usage since subscription start instead of the current billing period. Requires one of `charge_id`, `charge_code`, `group` (or their deprecated `filter_by_*` equivalents) to be set. */
16317
16668
  full_usage?: boolean;
16669
+ /** @description 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. */
16670
+ filter_by_presentation?: string;
16318
16671
  };
16319
16672
  header?: never;
16320
16673
  path: {
@@ -17344,6 +17697,8 @@ export interface operations {
17344
17697
  external_customer_id?: components["parameters"]["external_customer_id"];
17345
17698
  /** @description Filter by payment status. Possible values are `pending`, `failed` or `succeeded`. */
17346
17699
  payment_status?: components["parameters"]["payment_status"];
17700
+ /** @description Filter payment requests by billing entity codes. */
17701
+ "billing_entity_codes[]"?: string[];
17347
17702
  };
17348
17703
  header?: never;
17349
17704
  path?: never;
@@ -18408,6 +18763,8 @@ export interface operations {
18408
18763
  plan_code?: string;
18409
18764
  /** @description If the field is not defined, Lago will return only `active` subscriptions. However, if you wish to fetch subscriptions by different status you can define them in a status[] query param. Available filter values: `pending`, `canceled`, `terminated`, `active`. */
18410
18765
  "status[]"?: ("active" | "canceled" | "pending" | "terminated")[];
18766
+ /** @description Filter subscriptions by billing entity codes. */
18767
+ "billing_entity_codes[]"?: string[];
18411
18768
  };
18412
18769
  header?: never;
18413
18770
  path?: never;
@@ -19490,6 +19847,8 @@ export interface operations {
19490
19847
  per_page?: components["parameters"]["per_page"];
19491
19848
  /** @description The customer external unique identifier (provided by your own application). */
19492
19849
  external_customer_id: string;
19850
+ /** @description Filter wallets by billing entity codes. */
19851
+ "billing_entity_codes[]"?: string[];
19493
19852
  };
19494
19853
  header?: never;
19495
19854
  path?: never;
@@ -20120,6 +20479,132 @@ export interface operations {
20120
20479
  };
20121
20480
  };
20122
20481
  };
20482
+ billableMetricCreated: {
20483
+ parameters: {
20484
+ query?: never;
20485
+ header: {
20486
+ /** @description Signature of the webhook payload */
20487
+ "X-Lago-Signature": components["parameters"]["webhook_signature"];
20488
+ /** @description Algorithm used to generate the signature */
20489
+ "X-Lago-Signature-Algorithm": components["parameters"]["webhook_signature_algorithm"];
20490
+ /** @description Unique id of the webhook. It can be used for idempotency */
20491
+ "X-Lago-Unique-Key": components["parameters"]["webhook_unique_key"];
20492
+ };
20493
+ path?: never;
20494
+ cookie?: never;
20495
+ };
20496
+ /** @description Details of the new billable metric */
20497
+ requestBody?: {
20498
+ content: {
20499
+ "application/json": {
20500
+ /** @enum {string} */
20501
+ webhook_type: "billable_metric.created";
20502
+ /** @enum {string} */
20503
+ object_type: "billable_metric";
20504
+ /**
20505
+ * Format: uuid
20506
+ * @description Unique identifier of the organization, created by Lago.
20507
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
20508
+ */
20509
+ organization_id: string;
20510
+ billable_metric: components["schemas"]["BillableMetricObject"];
20511
+ };
20512
+ };
20513
+ };
20514
+ responses: {
20515
+ /** @description Return a 200 status to indicate that the data was received successfully */
20516
+ 200: {
20517
+ headers: {
20518
+ [name: string]: unknown;
20519
+ };
20520
+ content?: never;
20521
+ };
20522
+ };
20523
+ };
20524
+ billableMetricUpdated: {
20525
+ parameters: {
20526
+ query?: never;
20527
+ header: {
20528
+ /** @description Signature of the webhook payload */
20529
+ "X-Lago-Signature": components["parameters"]["webhook_signature"];
20530
+ /** @description Algorithm used to generate the signature */
20531
+ "X-Lago-Signature-Algorithm": components["parameters"]["webhook_signature_algorithm"];
20532
+ /** @description Unique id of the webhook. It can be used for idempotency */
20533
+ "X-Lago-Unique-Key": components["parameters"]["webhook_unique_key"];
20534
+ };
20535
+ path?: never;
20536
+ cookie?: never;
20537
+ };
20538
+ /** @description Details of the billable metric */
20539
+ requestBody?: {
20540
+ content: {
20541
+ "application/json": {
20542
+ /** @enum {string} */
20543
+ webhook_type: "billable_metric.updated";
20544
+ /** @enum {string} */
20545
+ object_type: "billable_metric";
20546
+ /**
20547
+ * Format: uuid
20548
+ * @description Unique identifier of the organization, created by Lago.
20549
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
20550
+ */
20551
+ organization_id: string;
20552
+ billable_metric: components["schemas"]["BillableMetricObject"];
20553
+ };
20554
+ };
20555
+ };
20556
+ responses: {
20557
+ /** @description Return a 200 status to indicate that the data was received successfully */
20558
+ 200: {
20559
+ headers: {
20560
+ [name: string]: unknown;
20561
+ };
20562
+ content?: never;
20563
+ };
20564
+ };
20565
+ };
20566
+ billableMetricDeleted: {
20567
+ parameters: {
20568
+ query?: never;
20569
+ header: {
20570
+ /** @description Signature of the webhook payload */
20571
+ "X-Lago-Signature": components["parameters"]["webhook_signature"];
20572
+ /** @description Algorithm used to generate the signature */
20573
+ "X-Lago-Signature-Algorithm": components["parameters"]["webhook_signature_algorithm"];
20574
+ /** @description Unique id of the webhook. It can be used for idempotency */
20575
+ "X-Lago-Unique-Key": components["parameters"]["webhook_unique_key"];
20576
+ };
20577
+ path?: never;
20578
+ cookie?: never;
20579
+ };
20580
+ /** @description Details of the billable metric */
20581
+ requestBody?: {
20582
+ content: {
20583
+ "application/json": {
20584
+ /** @enum {string} */
20585
+ webhook_type: "billable_metric.deleted";
20586
+ /** @enum {string} */
20587
+ object_type: "billable_metric";
20588
+ /**
20589
+ * Format: uuid
20590
+ * @description Unique identifier of the organization, created by Lago.
20591
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
20592
+ */
20593
+ organization_id: string;
20594
+ billable_metric: components["schemas"]["BillableMetricObject"];
20595
+ };
20596
+ };
20597
+ };
20598
+ responses: {
20599
+ /** @description Return a 200 status to indicate that the data was received successfully */
20600
+ 200: {
20601
+ headers: {
20602
+ [name: string]: unknown;
20603
+ };
20604
+ content?: never;
20605
+ };
20606
+ };
20607
+ };
20123
20608
  customerCreated: {
20124
20609
  parameters: {
20125
20610
  query?: never;