lago-javascript-client 1.36.0 → 1.40.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.
@@ -59,6 +59,16 @@ export interface BillingEntityObject {
59
59
  * @example 0
60
60
  */
61
61
  invoice_grace_period: number;
62
+ /**
63
+ * Defines whether the issuing date follows the current billing period's end date or the next period starting date.
64
+ * @default "next_period_start"
65
+ */
66
+ subscription_invoice_issuing_date_anchor?: "current_period_end" | "next_period_start";
67
+ /**
68
+ * The logic applied on top of the subscription_invoice_issuing_date_anchor rule. You can opt to use the invoice finalization date, that includes any configured grace period.
69
+ * @default "align_with_finalization_date"
70
+ */
71
+ subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
62
72
  /**
63
73
  * Whether this billing entity is the default billing entity for the organization. Default billing entity will be used as fallback in services if no billing entity is specified when billing_entity is not provided. Default billing entity is the billing entity that will be used to generate invoices if no billing entity is specified when invoice is created. is the oldest active billing entity and this flag cannot be changed
64
74
  * @example false
@@ -219,6 +229,16 @@ export interface BillingEntityCreateInput {
219
229
  * @example 0
220
230
  */
221
231
  invoice_grace_period?: number;
232
+ /**
233
+ * Defines whether the issuing date follows the current billing period's end date or the next period starting date.
234
+ * @default "next_period_start"
235
+ */
236
+ subscription_invoice_issuing_date_anchor?: "current_period_end" | "next_period_start";
237
+ /**
238
+ * The logic applied on top of the subscription_invoice_issuing_date_anchor rule. You can opt to use the invoice finalization date, that includes any configured grace period.
239
+ * @default "align_with_finalization_date"
240
+ */
241
+ subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
222
242
  };
223
243
  /**
224
244
  * The net payment term (in days) for this billing entity
@@ -468,6 +488,16 @@ export interface BillingEntityUpdateInput {
468
488
  * @example 0
469
489
  */
470
490
  invoice_grace_period?: number;
491
+ /**
492
+ * Defines whether the issuing date follows the current billing period's end date or the next period starting date.
493
+ * @default "next_period_start"
494
+ */
495
+ subscription_invoice_issuing_date_anchor?: "current_period_end" | "next_period_start";
496
+ /**
497
+ * The logic applied on top of the subscription_invoice_issuing_date_anchor rule. You can opt to use the invoice finalization date, that includes any configured grace period.
498
+ * @default "align_with_finalization_date"
499
+ */
500
+ subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
471
501
  };
472
502
  /**
473
503
  * The net payment term (in days) for this billing entity
@@ -2008,6 +2038,12 @@ export interface FeeObject {
2008
2038
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2009
2039
  */
2010
2040
  lago_charge_filter_id?: string | null;
2041
+ /**
2042
+ * Unique identifier assigned to the fixed charge that the fee belongs to
2043
+ * @format uuid
2044
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2045
+ */
2046
+ lago_fixed_charge_id?: string | null;
2011
2047
  /**
2012
2048
  * Unique identifier assigned to the invoice that the fee belongs to
2013
2049
  * @format uuid
@@ -2124,13 +2160,13 @@ export interface FeeObject {
2124
2160
  */
2125
2161
  invoiceable: boolean;
2126
2162
  /**
2127
- * The beginning date of the period that the fee covers. It is applicable only to `subscription` and `charge` fees. This field indicates the start date of the billing period or subscription period associated with the fee.
2163
+ * The beginning date of the period that the fee covers. It is applicable only to `subscription`, `charge`, `fixed_charge` and `commitment` fees. This field indicates the start date of the billing period or subscription period associated with the fee.
2128
2164
  * @format date-time
2129
2165
  * @example "2022-04-29T08:59:51Z"
2130
2166
  */
2131
2167
  from_date?: string | null;
2132
2168
  /**
2133
- * The ending date of the period that the fee covers. It is applicable only to `subscription` and `charge` fees. This field indicates the end date of the billing period or subscription period associated with the fee.
2169
+ * The ending date of the period that the fee covers. It is applicable only to `subscription`, `charge`, `fixed_charge` and `commitment` fees. This field indicates the end date of the billing period or subscription period associated with the fee.
2134
2170
  * @format date-time
2135
2171
  * @example "2022-05-29T08:59:51Z"
2136
2172
  */
@@ -2189,12 +2225,12 @@ export interface FeeObject {
2189
2225
  /** Item attached to the fee */
2190
2226
  item: {
2191
2227
  /**
2192
- * The fee type. Possible values are `add-on`, `charge`, `credit`, `subscription` or `commitment`.
2228
+ * The fee type. Possible values are `add-on`, `charge`, `fixed_charge`, `credit`, `subscription` or `commitment`.
2193
2229
  * @example "subscription"
2194
2230
  */
2195
- type: "charge" | "add_on" | "subscription" | "credit" | "commitment";
2231
+ type: "charge" | "fixed_charge" | "add_on" | "subscription" | "credit" | "commitment";
2196
2232
  /**
2197
- * The code of the fee item. It can be the code of the `add-on`, the code of the `charge`, the code of the `credit` or the code of the `subscription`.
2233
+ * The code of the fee item. It can be the code of the `add-on`, the code of the `charge`, the code of the `fixed_charge`, the code of the `credit` or the code of the `subscription`.
2198
2234
  * @example "startup"
2199
2235
  */
2200
2236
  code: string;
@@ -2287,6 +2323,12 @@ export type CreditNoteAppliedTaxObject = BaseAppliedTax & {
2287
2323
  /** @example 100 */
2288
2324
  base_amount_cents?: number;
2289
2325
  };
2326
+ /**
2327
+ * Custom metadata stored as key-value pairs.
2328
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
2329
+ * @example {"external_id":"ext-123","synced_at":"2024-01-15","source":null}
2330
+ */
2331
+ export type MetadataObject = object | null;
2290
2332
  export interface CreditNoteErrorDetailsObject {
2291
2333
  /**
2292
2334
  * The credit note error details unique identifier, created by Lago.
@@ -2410,6 +2452,11 @@ export interface CreditNoteObject {
2410
2452
  * @example 0
2411
2453
  */
2412
2454
  refund_amount_cents: number;
2455
+ /**
2456
+ * The ofsetted amount (deducted from the invoice balance) of the credit note, expressed in cents.
2457
+ * @example 0
2458
+ */
2459
+ offset_amount_cents: number;
2413
2460
  /**
2414
2461
  * The pro-rated amount of the coupons applied to the source invoice.
2415
2462
  * @example 20
@@ -2440,12 +2487,22 @@ export interface CreditNoteObject {
2440
2487
  * @example false
2441
2488
  */
2442
2489
  self_billed?: boolean;
2490
+ /**
2491
+ * Custom metadata stored as key-value pairs.
2492
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
2493
+ */
2494
+ metadata?: MetadataObject;
2443
2495
  error_details?: any[] | null;
2444
2496
  }
2445
2497
  export interface CreditNotesPaginated {
2446
2498
  credit_notes: CreditNoteObject[];
2447
2499
  meta: PaginationMeta;
2448
2500
  }
2501
+ /**
2502
+ * Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
2503
+ * @example {"external_id":"ext-123","synced_at":"2024-01-15"}
2504
+ */
2505
+ export type MetadataInput = Record<string, string | null>;
2449
2506
  export interface CreditNoteCreateInput {
2450
2507
  credit_note: {
2451
2508
  /**
@@ -2466,18 +2523,23 @@ export interface CreditNoteCreateInput {
2466
2523
  */
2467
2524
  description?: string;
2468
2525
  /**
2469
- * The total amount to be credited to the customer balance for discounts on future invoices. For a total or partial refund or credit, the amount in cents must include both the item amount and the applicable tax. The refunded and credited amounts should always balance. The total, including taxes, cannot exceed the invoice’s total fees.”
2526
+ * The total amount to be credited to the customer balance for discounts on future invoices. For a total or partial refund, credit or offset, the amount in cents must include both the item amount and the applicable tax. The refunded, credited and offsetted amounts should always balance. The total, including taxes, cannot exceed the invoice’s total fees.”
2470
2527
  * @example 100
2471
2528
  */
2472
2529
  credit_amount_cents?: number | null;
2473
2530
  /**
2474
- * The total amount to be refunded immediately to the payment method used by the customer. For a total or partial refund or credit, the amount in cents must include both the item amount and the applicable tax. The refunded and credited amounts should always balance. The total, including taxes, cannot exceed the invoice’s total fees.”
2531
+ * The total amount to be refunded immediately to the payment method used by the customer. For a total or partial refund, credit or offset, the amount in cents must include both the item amount and the applicable tax. The refunded, credited and offsetted amounts should always balance. The total, including taxes, cannot exceed the invoice’s total fees.”
2475
2532
  * @example 500
2476
2533
  */
2477
2534
  refund_amount_cents?: number | null;
2535
+ /**
2536
+ * The total amount to be immediately deducted from the invoice balance. For a total or partial refund, credit or offset, the amount in cents must include both the item amount and the applicable tax. The refunded, credited and offsetted amounts should always balance. The total, including taxes, cannot exceed the invoice’s total fees.”
2537
+ * @example 200
2538
+ */
2539
+ offset_amount_cents?: number | null;
2478
2540
  /**
2479
2541
  * The list of credit note's items.
2480
- * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":100},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":500}]
2542
+ * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":100},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":500},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","amount_cents":200}]
2481
2543
  */
2482
2544
  items: {
2483
2545
  /**
@@ -2492,6 +2554,8 @@ export interface CreditNoteCreateInput {
2492
2554
  */
2493
2555
  amount_cents: number;
2494
2556
  }[];
2557
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
2558
+ metadata?: MetadataInput;
2495
2559
  };
2496
2560
  }
2497
2561
  export interface CreditNote {
@@ -2508,6 +2572,8 @@ export interface CreditNoteUpdateInput {
2508
2572
  * @example "succeeded"
2509
2573
  */
2510
2574
  refund_status: "pending" | "succeeded" | "failed";
2575
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
2576
+ metadata?: MetadataInput;
2511
2577
  };
2512
2578
  }
2513
2579
  export interface CreditNoteEstimateInput {
@@ -2585,6 +2651,11 @@ export interface CreditNoteEstimated {
2585
2651
  * @example 0
2586
2652
  */
2587
2653
  max_refundable_amount_cents: number;
2654
+ /**
2655
+ * The ofsetted amount of the credit note, expressed in cents.
2656
+ * @example 0
2657
+ */
2658
+ max_offsettable_amount_cents: number;
2588
2659
  /**
2589
2660
  * The pro-rated amount of the coupons applied to the source invoice.
2590
2661
  * @example 20
@@ -2662,6 +2733,13 @@ export interface ApiErrorNotAllowed {
2662
2733
  /** @example "not_allowed" */
2663
2734
  code: string;
2664
2735
  }
2736
+ export interface CreditNoteMetadataResponse {
2737
+ /**
2738
+ * Custom metadata stored as key-value pairs.
2739
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
2740
+ */
2741
+ metadata: MetadataObject;
2742
+ }
2665
2743
  /** @example "US" */
2666
2744
  export type CountryOrNull = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";
2667
2745
  /** @example "America/Los_Angeles" */
@@ -2673,6 +2751,18 @@ export interface CustomerBillingConfiguration {
2673
2751
  * @example 3
2674
2752
  */
2675
2753
  invoice_grace_period?: number;
2754
+ /**
2755
+ * Defines whether the issuing date follows the current billing period's end date or the next period starting date.
2756
+ * @default null
2757
+ * @example "next_period_start"
2758
+ */
2759
+ subscription_invoice_issuing_date_anchor?: "current_period_end" | "next_period_start";
2760
+ /**
2761
+ * The logic applied on top of the subscription_invoice_issuing_date_anchor rule. You can opt to use the invoice finalization date, that includes any configured grace period.
2762
+ * @default null
2763
+ * @example "keep_anchor"
2764
+ */
2765
+ subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
2676
2766
  /**
2677
2767
  * The payment provider utilized to initiate payments for invoices issued by Lago.
2678
2768
  * Accepted values: `stripe`, `adyen`, `gocardless` or null. This field is required if you intend to assign a `provider_customer_id`.
@@ -3920,6 +4010,13 @@ export interface WalletObject {
3920
4010
  * @example "Prepaid"
3921
4011
  */
3922
4012
  name?: string | null;
4013
+ /**
4014
+ * Wallet priority for ordering when a customer has multiple wallets. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
4015
+ * @min 1
4016
+ * @max 50
4017
+ * @example 50
4018
+ */
4019
+ priority?: number;
3923
4020
  /**
3924
4021
  * The rate of conversion between credits and the amount in the specified currency. It indicates the ratio or factor used to convert credits into the corresponding monetary value in the currency of the transaction.
3925
4022
  * @pattern ^[0-9]+.?[0-9]*$
@@ -4025,6 +4122,11 @@ export interface WalletObject {
4025
4122
  * @example 1000
4026
4123
  */
4027
4124
  paid_top_up_max_amount_cents?: number | null;
4125
+ /**
4126
+ * Custom metadata stored as key-value pairs.
4127
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
4128
+ */
4129
+ metadata?: MetadataObject;
4028
4130
  }
4029
4131
  export interface WalletsPaginated {
4030
4132
  wallets: WalletObject[];
@@ -4341,7 +4443,7 @@ export interface EventObject {
4341
4443
  * @format uuid
4342
4444
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4343
4445
  */
4344
- lago_id: string;
4446
+ lago_id?: string | null;
4345
4447
  /**
4346
4448
  * This field represents a unique identifier for the event. It is crucial for ensuring idempotency, meaning that each event can be uniquely identified and processed without causing any unintended side effects.
4347
4449
  * @example "transaction_1234567890"
@@ -4394,7 +4496,7 @@ export interface EventObject {
4394
4496
  * @format date-time
4395
4497
  * @example "2022-04-29T08:59:51Z"
4396
4498
  */
4397
- created_at: string;
4499
+ created_at?: string | null;
4398
4500
  }
4399
4501
  export interface EventsPaginated {
4400
4502
  events: EventObject[];
@@ -5639,6 +5741,138 @@ export interface ChargeObject {
5639
5741
  conversion_rate: string;
5640
5742
  };
5641
5743
  }
5744
+ export interface FixedChargeProperties {
5745
+ /**
5746
+ * - The unit price, excluding tax, for a `standard` charge model. It is expressed as a decimal value.
5747
+ * - The amount, excluding tax, for a complete set of units in a `package` charge model. It is expressed as a decimal value.
5748
+ * @pattern ^[0-9]+.?[0-9]*$
5749
+ * @example "30"
5750
+ */
5751
+ amount?: string;
5752
+ /** Graduated ranges, sorted from bottom to top tiers, used for a `graduated` charge model. */
5753
+ graduated_ranges?: {
5754
+ /**
5755
+ * Specifies the lower value of a tier for a `graduated` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
5756
+ * @example 0
5757
+ */
5758
+ from_value: number;
5759
+ /**
5760
+ * Specifies the highest value of a tier for a `graduated` charge model.
5761
+ * - This value must be higher than the from_value of the same tier.
5762
+ * - This value must be null for the last tier.
5763
+ * @example 10
5764
+ */
5765
+ to_value: number | null;
5766
+ /**
5767
+ * The flat amount for a whole tier, excluding tax, for a `graduated` charge model. It is expressed as a decimal value.
5768
+ * @pattern ^[0-9]+.?[0-9]*$
5769
+ * @example "10"
5770
+ */
5771
+ flat_amount: string;
5772
+ /**
5773
+ * The unit price, excluding tax, for a specific tier of a `graduated` charge model. It is expressed as a decimal value.
5774
+ * @pattern ^[0-9]+.?[0-9]*$
5775
+ * @example "0.5"
5776
+ */
5777
+ per_unit_amount: string;
5778
+ }[];
5779
+ /** Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. */
5780
+ volume_ranges?: {
5781
+ /**
5782
+ * Specifies the lower value of a tier for a `volume` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values.
5783
+ * @example 0
5784
+ */
5785
+ from_value: number;
5786
+ /**
5787
+ * Specifies the highest value of a tier for a `volume` charge model.
5788
+ * - This value must be higher than the `from_value` of the same tier.
5789
+ * - This value must be `null` for the last tier.
5790
+ * @example 10
5791
+ */
5792
+ to_value: number | null;
5793
+ /**
5794
+ * The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
5795
+ * @pattern ^[0-9]+.?[0-9]*$
5796
+ * @example "10"
5797
+ */
5798
+ flat_amount: string;
5799
+ /**
5800
+ * The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
5801
+ * @pattern ^[0-9]+.?[0-9]*$
5802
+ * @example "0.5"
5803
+ */
5804
+ per_unit_amount: string;
5805
+ }[];
5806
+ }
5807
+ export interface FixedChargeObject {
5808
+ /**
5809
+ * Unique identifier of the fixed charge, created by Lago.
5810
+ * @format uuid
5811
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5812
+ */
5813
+ lago_id: string;
5814
+ /**
5815
+ * Unique identifier of the add-on associated with this fixed charge.
5816
+ * @format uuid
5817
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5818
+ */
5819
+ lago_add_on_id: string;
5820
+ /**
5821
+ * 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.
5822
+ * @example "Setup fee"
5823
+ */
5824
+ invoice_display_name: string;
5825
+ /**
5826
+ * Unique code used to identify the add-on.
5827
+ * @example "setup_fee"
5828
+ */
5829
+ add_on_code: string;
5830
+ /**
5831
+ * The date and time when the fixed charge was created. It is expressed in UTC format according to the ISO 8601 datetime standard.
5832
+ * @format date-time
5833
+ * @example "2023-06-27T19:43:42Z"
5834
+ */
5835
+ created_at: string;
5836
+ /**
5837
+ * Unique code for the fixed charge.
5838
+ * @example "setup_fee"
5839
+ */
5840
+ code?: string;
5841
+ /**
5842
+ * The charge model for the fixed charge. Only `standard`, `graduated`, and `volume` models are supported for fixed charges.
5843
+ * @example "standard"
5844
+ */
5845
+ charge_model: "standard" | "graduated" | "volume";
5846
+ /**
5847
+ * This field determines the billing timing for this fixed charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to false, the charge is due and invoiced at the end of each billing period.
5848
+ * @example false
5849
+ */
5850
+ pay_in_advance: boolean;
5851
+ /**
5852
+ * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
5853
+ *
5854
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
5855
+ * - If set to `false`, the charge is billed in full.
5856
+ * - If not defined in the request, default value is `false`.
5857
+ * @example false
5858
+ */
5859
+ prorated: boolean;
5860
+ /** List of all thresholds utilized for calculating the fixed charge. */
5861
+ properties: FixedChargeProperties;
5862
+ /**
5863
+ * The number of units for the fixed charge.
5864
+ * @example 1
5865
+ */
5866
+ units: number;
5867
+ /**
5868
+ * Unique identifier of the parent fixed charge (for plan versions).
5869
+ * @format uuid
5870
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5871
+ */
5872
+ lago_parent_id?: string | null;
5873
+ /** List of taxes applied to the fixed charge. */
5874
+ taxes?: TaxObject[];
5875
+ }
5642
5876
  export type PlanEntitlementPrivilegeObject = FeaturePrivilegeObject & {
5643
5877
  /**
5644
5878
  * Value assigned to this privilege in the entitlement. Type depends on the privilege's value_type.
@@ -5734,18 +5968,33 @@ export interface PlanObject {
5734
5968
  * @example null
5735
5969
  */
5736
5970
  bill_charges_monthly?: boolean | null;
5971
+ /**
5972
+ * This field, when set to `true`, enables to invoice fixed charges on monthly basis, even if the cadence of the plan is yearly or semiannual. This allows customers to pay fixed charges on a monthly basis. This can be set to true only if the plan's interval is `yearly` or `semiannual`.
5973
+ * @example null
5974
+ */
5975
+ bill_fixed_charges_monthly?: boolean | null;
5737
5976
  minimum_commitment?: MinimumCommitmentObject;
5738
5977
  /**
5739
5978
  * Additional usage-based charges for this plan.
5740
5979
  * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":0,"properties":{},"filters":[{"invoice_display_name":"Europe","properties":{"amount":"10"},"values":{"region":["Europe"]}},{"invoice_display_name":"USA","properties":{"amount":"5"},"values":{"region":["USA"]}},{"invoice_display_name":"Africa","properties":{"amount":"8"},"values":{"region":["Africa"]}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"regroup_paid_fees":"invoice","prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"filters":[]}]
5741
5980
  */
5742
5981
  charges?: ChargeObject[];
5982
+ /**
5983
+ * List of fixed charges for this plan.
5984
+ * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","lago_add_on_id":"2b802b80-2b80-2b80-2b80-2b802b802b80","code":"setup_fee","invoice_display_name":"Setup Fee","add_on_code":"setup","created_at":"2026-01-15T10:30:00Z","charge_model":"standard","pay_in_advance":true,"prorated":false,"properties":{"amount":"500"},"units":1,"lago_parent_id":null,"taxes":[{"lago_id":"3c703c70-3c70-3c70-3c70-3c703c703c70","name":"VAT","code":"vat_20","rate":20,"description":"Standard VAT rate","applied_to_organization":true,"created_at":"2026-01-01T00:00:00Z"}]},{"lago_id":"4d604d60-4d60-4d60-4d60-4d604d604d60","lago_add_on_id":"5e505e50-5e50-5e50-5e50-5e505e505e50","code":"support_tier","invoice_display_name":"Support Tier","add_on_code":"premium_support","created_at":"2026-01-15T10:30:00Z","charge_model":"graduated","pay_in_advance":false,"prorated":true,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"per_unit_amount":"5","flat_amount":"200"},{"from_value":11,"to_value":null,"per_unit_amount":"1","flat_amount":"300"}]},"units":1,"lago_parent_id":null,"taxes":[]},{"lago_id":"6f406f40-6f40-6f40-6f40-6f406f406f40","lago_add_on_id":"7a307a30-7a30-7a30-7a30-7a307a307a30","code":"storage","invoice_display_name":"Storage Allocation","add_on_code":"cloud_storage","created_at":"2026-01-15T10:30:00Z","charge_model":"volume","pay_in_advance":false,"prorated":false,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"per_unit_amount":"2","flat_amount":"1"},{"from_value":101,"to_value":null,"per_unit_amount":"1","flat_amount":"0"}]},"units":50,"lago_parent_id":null,"taxes":[]}]
5985
+ */
5986
+ fixed_charges?: FixedChargeObject[];
5743
5987
  /** All taxes applied to the plan. */
5744
5988
  taxes?: TaxObject[];
5745
5989
  /** List of usage thresholds applied to the plan. */
5746
5990
  usage_thresholds?: UsageThresholdObject[];
5747
5991
  /** List of all feature entitlements and their privileges available for this plan. */
5748
5992
  entitlements?: PlanEntitlement[];
5993
+ /**
5994
+ * Custom metadata stored as key-value pairs.
5995
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
5996
+ */
5997
+ metadata?: MetadataObject;
5749
5998
  }
5750
5999
  export interface PlansPaginated {
5751
6000
  plans: PlanObject[];
@@ -5805,52 +6054,57 @@ export interface PlanCreateInput {
5805
6054
  * The name of the plan.
5806
6055
  * @example "Startup"
5807
6056
  */
5808
- name?: string;
6057
+ name: string;
5809
6058
  /**
5810
6059
  * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the plan will be used as the default display name.
5811
6060
  * @example "Startup plan"
5812
6061
  */
5813
- invoice_display_name?: string;
6062
+ invoice_display_name?: string | null;
5814
6063
  /**
5815
6064
  * The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
5816
6065
  * @example "startup"
5817
6066
  */
5818
- code?: string;
6067
+ code: string;
5819
6068
  /**
5820
6069
  * The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `semiannual`, `quarterly`, `monthly`, or `weekly`.
5821
6070
  * @example "monthly"
5822
6071
  */
5823
- interval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
6072
+ interval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
5824
6073
  /**
5825
6074
  * The description on the plan.
5826
6075
  * @example "Plan for early stage startups."
5827
6076
  */
5828
- description?: string;
6077
+ description?: string | null;
5829
6078
  /**
5830
6079
  * The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
5831
6080
  * @example 10000
5832
6081
  */
5833
- amount_cents?: number;
6082
+ amount_cents: number;
5834
6083
  /**
5835
6084
  * The currency of the plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed.
5836
6085
  * @example "USD"
5837
6086
  */
5838
- amount_currency?: Currency;
6087
+ amount_currency: Currency;
5839
6088
  /**
5840
6089
  * The duration in days during which the base cost of the plan is offered for free.
5841
6090
  * @example 5
5842
6091
  */
5843
- trial_period?: number;
6092
+ trial_period?: number | null;
5844
6093
  /**
5845
6094
  * This field determines the billing timing for the plan. When set to `true`, the base cost of the plan is due at the beginning of each billing period. Conversely, when set to `false`, the base cost of the plan is due at the end of each billing period.
5846
6095
  * @example true
5847
6096
  */
5848
- pay_in_advance?: boolean;
6097
+ pay_in_advance: boolean;
5849
6098
  /**
5850
6099
  * This field, when set to `true`, enables to invoice usage-based charges on monthly basis, even if the cadence of the plan is `yearly` or `semiannual`. 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` or `semiannual`.
5851
6100
  * @example null
5852
6101
  */
5853
6102
  bill_charges_monthly?: boolean | null;
6103
+ /**
6104
+ * This field, when set to `true`, enables to invoice fixed charges on monthly basis, even if the cadence of the plan is `yearly` or `semiannual`. This allows customers to pay fixed charges on a monthly basis. This can be set to true only if the plan's interval is `yearly` or `semiannual`.
6105
+ * @example null
6106
+ */
6107
+ bill_fixed_charges_monthly?: boolean | null;
5854
6108
  /** List of unique code used to identify the taxes. */
5855
6109
  tax_codes?: TaxCodes;
5856
6110
  /** Minimum commitment for this plan. */
@@ -5865,7 +6119,7 @@ export interface PlanCreateInput {
5865
6119
  * @format uuid
5866
6120
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5867
6121
  */
5868
- billable_metric_id?: string;
6122
+ billable_metric_id: string;
5869
6123
  /**
5870
6124
  * Specifies the pricing model used for the calculation of the final fee. It can be any of the following values:
5871
6125
  * - [`dynamic`](https://docs.getlago.com/guide/plans/charges/charge-models/dynamic)
@@ -5876,7 +6130,7 @@ export interface PlanCreateInput {
5876
6130
  * - [`standard`](https://docs.getlago.com/guide/plans/charges/charge-models/standard)
5877
6131
  * - [`volume`](https://docs.getlago.com/guide/plans/charges/charge-models/volume)
5878
6132
  */
5879
- charge_model?: ChargeModelEnum;
6133
+ charge_model: ChargeModelEnum;
5880
6134
  /**
5881
6135
  * This field determines the billing timing for this specific usage-based charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to false, the charge is due and invoiced at the end of each billing period.
5882
6136
  * @example false
@@ -5937,8 +6191,65 @@ export interface PlanCreateInput {
5937
6191
  conversion_rate?: string;
5938
6192
  };
5939
6193
  }[];
6194
+ /**
6195
+ * Additional fixed charges for this plan.
6196
+ * @example [{"add_on_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","code":"setup_fee","invoice_display_name":"Setup Fee","charge_model":"standard","pay_in_advance":true,"prorated":false,"properties":{"amount":"500"},"units":1,"tax_codes":["french_standard_vat"]},{"add_on_id":"4d604d60-4d60-4d60-4d60-4d604d604d60","invoice_display_name":"Support Tier","charge_model":"graduated","pay_in_advance":false,"prorated":true,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"per_unit_amount":"5","flat_amount":"200"},{"from_value":11,"to_value":null,"per_unit_amount":"1","flat_amount":"300"}]},"units":2},{"add_on_id":"6f406f40-6f40-6f40-6f40-6f406f406f40","charge_model":"volume","properties":{"volume_ranges":[{"from_value":0,"to_value":100,"per_unit_amount":"2","flat_amount":"1"},{"from_value":101,"to_value":null,"per_unit_amount":"1","flat_amount":"0"}]},"units":50}]
6197
+ */
6198
+ fixed_charges?: {
6199
+ /**
6200
+ * Unique identifier of the add-on associated with this fixed charge.
6201
+ * @format uuid
6202
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6203
+ */
6204
+ add_on_id: string;
6205
+ /**
6206
+ * Unique code for the fixed charge. If not provided, it will be automatically generated based on the add-on code.
6207
+ * @example "setup_fee"
6208
+ */
6209
+ code?: string;
6210
+ /**
6211
+ * 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.
6212
+ * @example "Setup fee"
6213
+ */
6214
+ invoice_display_name?: string;
6215
+ /**
6216
+ * The number of units for the fixed charge. Defaults to 0 if not provided.
6217
+ * @default 0
6218
+ * @example 1
6219
+ */
6220
+ units?: number;
6221
+ /**
6222
+ * The charge model for the fixed charge. Only `standard`, `graduated`, and `volume` models are supported for fixed charges.
6223
+ * @example "standard"
6224
+ */
6225
+ charge_model: "standard" | "graduated" | "volume";
6226
+ /**
6227
+ * This field determines the billing timing for this specific fixed charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to false, the charge is due and invoiced at the end of each billing period. Defaults to `false` if not provided.
6228
+ * @default false
6229
+ * @example false
6230
+ */
6231
+ pay_in_advance?: boolean;
6232
+ /**
6233
+ * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
6234
+ *
6235
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
6236
+ * - If set to `false`, the charge is billed in full.
6237
+ * - Defaults to `false` if not provided.
6238
+ *
6239
+ * Note: Prorated fixed charges with `graduated` model and `pay_in_advance` are not allowed.
6240
+ * @default false
6241
+ * @example false
6242
+ */
6243
+ prorated?: boolean;
6244
+ /** List of all thresholds utilized for calculating the fixed charge. */
6245
+ properties?: FixedChargeProperties;
6246
+ /** List of taxes applied to the fixed charge. */
6247
+ tax_codes?: TaxCodes;
6248
+ }[];
5940
6249
  /** List of usage thresholds to apply to the plan. */
5941
6250
  usage_thresholds?: UsageThresholdInput[];
6251
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
6252
+ metadata?: MetadataInput;
5942
6253
  };
5943
6254
  }
5944
6255
  export interface Plan {
@@ -5955,7 +6266,7 @@ export interface PlanUpdateInput {
5955
6266
  * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the plan will be used as the default display name.
5956
6267
  * @example "Startup plan"
5957
6268
  */
5958
- invoice_display_name?: string;
6269
+ invoice_display_name?: string | null;
5959
6270
  /**
5960
6271
  * The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
5961
6272
  * @example "startup"
@@ -5970,7 +6281,7 @@ export interface PlanUpdateInput {
5970
6281
  * The description on the plan.
5971
6282
  * @example "Plan for early stage startups."
5972
6283
  */
5973
- description?: string;
6284
+ description?: string | null;
5974
6285
  /**
5975
6286
  * The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
5976
6287
  * @example 10000
@@ -5985,7 +6296,7 @@ export interface PlanUpdateInput {
5985
6296
  * The duration in days during which the base cost of the plan is offered for free.
5986
6297
  * @example 5
5987
6298
  */
5988
- trial_period?: number;
6299
+ trial_period?: number | null;
5989
6300
  /**
5990
6301
  * This field determines the billing timing for the plan. When set to `true`, the base cost of the plan is due at the beginning of each billing period. Conversely, when set to `false`, the base cost of the plan is due at the end of each billing period.
5991
6302
  * @example true
@@ -5996,6 +6307,11 @@ export interface PlanUpdateInput {
5996
6307
  * @example null
5997
6308
  */
5998
6309
  bill_charges_monthly?: boolean | null;
6310
+ /**
6311
+ * This field, when set to `true`, enables to invoice fixed charges on monthly basis, even if the cadence of the plan is `yearly` or `semiannual`. This allows customers to pay fixed charges on a monthly basis. This can be set to true only if the plan's interval is `yearly` or `semiannual`.
6312
+ * @example null
6313
+ */
6314
+ bill_fixed_charges_monthly?: boolean | null;
5999
6315
  /** List of unique code used to identify the taxes. */
6000
6316
  tax_codes?: TaxCodes;
6001
6317
  /** Minimum commitment for this plan. */
@@ -6083,6 +6399,72 @@ export interface PlanUpdateInput {
6083
6399
  conversion_rate?: string;
6084
6400
  };
6085
6401
  }[];
6402
+ /**
6403
+ * Additional fixed charges for this plan.
6404
+ * @example [{"id":"1a901a90-1a90-1a90-1a90-1a901a901a90","invoice_display_name":"New Setup Fee","charge_model":"standard","apply_units_immediately":true,"units":5},{"add_on_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","code":"setup_fee","invoice_display_name":"Setup Fee","charge_model":"standard","pay_in_advance":true,"prorated":false,"properties":{"amount":"500"},"units":1,"apply_units_immediately":false,"tax_codes":["french_standard_vat"]},{"add_on_id":"4d604d60-4d60-4d60-4d60-4d604d604d60","invoice_display_name":"Support Tier","charge_model":"graduated","pay_in_advance":false,"prorated":true,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"per_unit_amount":"5","flat_amount":"200"},{"from_value":11,"to_value":null,"per_unit_amount":"1","flat_amount":"300"}]},"units":2},{"add_on_id":"6f406f40-6f40-6f40-6f40-6f406f406f40","charge_model":"volume","properties":{"volume_ranges":[{"from_value":0,"to_value":100,"per_unit_amount":"2","flat_amount":"1"},{"from_value":101,"to_value":null,"per_unit_amount":"1","flat_amount":"0"}]},"units":50}]
6405
+ */
6406
+ fixed_charges?: {
6407
+ /**
6408
+ * Unique identifier of the fixed charge created by Lago (required for updates).
6409
+ * @format uuid
6410
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6411
+ */
6412
+ id?: string;
6413
+ /**
6414
+ * Unique identifier of the add-on associated with this fixed charge.
6415
+ * @format uuid
6416
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6417
+ */
6418
+ add_on_id?: string;
6419
+ /**
6420
+ * Unique code for the fixed charge. If not provided, it will be automatically generated based on the add-on code.
6421
+ * @example "setup_fee"
6422
+ */
6423
+ code?: string;
6424
+ /**
6425
+ * 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.
6426
+ * @example "Setup fee"
6427
+ */
6428
+ invoice_display_name?: string;
6429
+ /**
6430
+ * The number of units for the fixed charge. Defaults to 0 if not provided.
6431
+ * @default 0
6432
+ * @example 1
6433
+ */
6434
+ units?: number;
6435
+ /**
6436
+ * The charge model for the fixed charge. Only `standard`, `graduated`, and `volume` models are supported for fixed charges.
6437
+ * @example "standard"
6438
+ */
6439
+ charge_model?: "standard" | "graduated" | "volume";
6440
+ /**
6441
+ * This field determines the billing timing for this specific fixed charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to false, the charge is due and invoiced at the end of each billing period. Defaults to `false` if not provided.
6442
+ * @default false
6443
+ * @example false
6444
+ */
6445
+ pay_in_advance?: boolean;
6446
+ /**
6447
+ * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
6448
+ *
6449
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
6450
+ * - If set to `false`, the charge is billed in full.
6451
+ * - Defaults to `false` if not provided.
6452
+ *
6453
+ * Note: Prorated fixed charges with `graduated` model and `pay_in_advance` are not allowed.
6454
+ * @default false
6455
+ * @example false
6456
+ */
6457
+ prorated?: boolean;
6458
+ /** List of all thresholds utilized for calculating the fixed charge. */
6459
+ properties?: FixedChargeProperties;
6460
+ /** List of taxes applied to the fixed charge. */
6461
+ tax_codes?: TaxCodes;
6462
+ /**
6463
+ * Determines if the units should be applied immediately upon assignment or deferred to the next billing cycle.
6464
+ * @example true
6465
+ */
6466
+ apply_units_immediately?: boolean;
6467
+ }[];
6086
6468
  /** List of usage thresholds to apply to the plan. */
6087
6469
  usage_thresholds?: UsageThresholdInput[];
6088
6470
  /**
@@ -6090,6 +6472,8 @@ export interface PlanUpdateInput {
6090
6472
  * @example true
6091
6473
  */
6092
6474
  cascade_updates?: boolean;
6475
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
6476
+ metadata?: MetadataInput;
6093
6477
  };
6094
6478
  }
6095
6479
  export interface PlanEntitlements {
@@ -6102,6 +6486,13 @@ export interface EntitlementUpdateInput {
6102
6486
  */
6103
6487
  entitlements: Record<string, Record<string, number | boolean | string>>;
6104
6488
  }
6489
+ export interface PlanMetadataResponse {
6490
+ /**
6491
+ * Custom metadata stored as key-value pairs.
6492
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
6493
+ */
6494
+ metadata: MetadataObject;
6495
+ }
6105
6496
  /** Based plan overrides. */
6106
6497
  export interface PlanOverridesObject {
6107
6498
  /**
@@ -6190,8 +6581,39 @@ export interface PlanOverridesObject {
6190
6581
  conversion_rate?: string;
6191
6582
  };
6192
6583
  }[];
6584
+ /** Additional fixed charges for this plan. */
6585
+ fixed_charges?: {
6586
+ /**
6587
+ * Unique identifier of the fixed charge created by Lago.
6588
+ * @format uuid
6589
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6590
+ */
6591
+ id: string;
6592
+ /**
6593
+ * 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.
6594
+ * @example "Setup fee"
6595
+ */
6596
+ invoice_display_name?: string;
6597
+ /**
6598
+ * The number of units for the fixed charge. Defaults to 0 if not provided.
6599
+ * @default 0
6600
+ * @example 1
6601
+ */
6602
+ units?: number;
6603
+ /**
6604
+ * Determines if the units should be applied immediately upon assignment or deferred to the next billing cycle.
6605
+ * @example true
6606
+ */
6607
+ apply_units_immediately?: boolean;
6608
+ /** List of all thresholds utilized for calculating the fixed charge. */
6609
+ properties?: FixedChargeProperties;
6610
+ /** List of taxes applied to the fixed charge. */
6611
+ tax_codes?: TaxCodes;
6612
+ }[];
6193
6613
  /** List of usage thresholds applied to the subscription. */
6194
6614
  usage_thresholds?: UsageThresholdInput[];
6615
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
6616
+ metadata?: MetadataInput;
6195
6617
  }
6196
6618
  export interface SubscriptionCreateInput {
6197
6619
  /**
@@ -6412,12 +6834,12 @@ export interface AlertObject {
6412
6834
  * The subscription external unique identifier (provided by your own application).
6413
6835
  * @example "sub_1234567890"
6414
6836
  */
6415
- subscription_external_id: string;
6837
+ external_subscription_id: string;
6416
6838
  /**
6417
6839
  * The customer external unique identifier (provided by your own application).
6418
6840
  * @example "cus_0987654321"
6419
6841
  */
6420
- customer_external_id: string;
6842
+ external_customer_id: string;
6421
6843
  /** The billable metric associated with the alert. Only for alerts based on a billable metric. */
6422
6844
  billable_metric: BillableMetricObject;
6423
6845
  /**
@@ -6552,6 +6974,9 @@ export interface SubscriptionEntitlements {
6552
6974
  export interface SubscriptionEntitlement {
6553
6975
  entitlement: SubscriptionEntitlementObject;
6554
6976
  }
6977
+ export interface FixedCharges {
6978
+ fixed_charges: FixedChargeObject[];
6979
+ }
6555
6980
  export interface TaxesPaginated {
6556
6981
  taxes: TaxObject[];
6557
6982
  meta: PaginationMeta;
@@ -6601,6 +7026,13 @@ export interface WalletCreateInput {
6601
7026
  * @example "Prepaid"
6602
7027
  */
6603
7028
  name?: string | null;
7029
+ /**
7030
+ * Wallet priority for ordering when a customer has multiple wallets. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
7031
+ * @min 1
7032
+ * @max 50
7033
+ * @example 50
7034
+ */
7035
+ priority?: number;
6604
7036
  /**
6605
7037
  * The rate of conversion between credits and the amount in the specified currency. It indicates the ratio or factor used to convert credits into the corresponding monetary value in the currency of the transaction.
6606
7038
  * @pattern ^[0-9]+.?[0-9]*$
@@ -6680,6 +7112,8 @@ export interface WalletCreateInput {
6680
7112
  ignore_paid_top_up_limits_on_creation?: boolean | null;
6681
7113
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
6682
7114
  recurring_transaction_rules?: any[] | null;
7115
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
7116
+ metadata?: MetadataInput;
6683
7117
  };
6684
7118
  }
6685
7119
  export interface Wallet {
@@ -6692,6 +7126,13 @@ export interface WalletUpdateInput {
6692
7126
  * @example "new_name"
6693
7127
  */
6694
7128
  name?: string | null;
7129
+ /**
7130
+ * Wallet priority for ordering when a customer has multiple wallets. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
7131
+ * @min 1
7132
+ * @max 50
7133
+ * @example 50
7134
+ */
7135
+ priority?: number;
6695
7136
  /**
6696
7137
  * 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).
6697
7138
  * @format date-time
@@ -6796,8 +7237,17 @@ export interface WalletUpdateInput {
6796
7237
  */
6797
7238
  billable_metric_codes?: any[] | null;
6798
7239
  };
7240
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
7241
+ metadata?: MetadataInput;
6799
7242
  };
6800
7243
  }
7244
+ export interface WalletMetadataResponse {
7245
+ /**
7246
+ * Custom metadata stored as key-value pairs.
7247
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
7248
+ */
7249
+ metadata: MetadataObject;
7250
+ }
6801
7251
  export interface WalletTransactionCreateInput {
6802
7252
  wallet_transaction: {
6803
7253
  /**
@@ -7062,7 +7512,7 @@ export interface TriggeredAlertObject {
7062
7512
  * The subscription external unique identifier (provided by your own application).
7063
7513
  * @example "sub_1234567890"
7064
7514
  */
7065
- subscription_external_id: string;
7515
+ external_subscription_id: string;
7066
7516
  /**
7067
7517
  * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
7068
7518
  * @example "storage_usage"
@@ -7226,7 +7676,7 @@ export interface DunningCampaignFinishedObject {
7226
7676
  * The customer external unique identifier (provided by your own application).
7227
7677
  * @example "cus_0987654321"
7228
7678
  */
7229
- customer_external_id: string;
7679
+ external_customer_id: string;
7230
7680
  /**
7231
7681
  * Identifier of the dunning campaign.
7232
7682
  * @example "dun_code_1234"
@@ -7526,7 +7976,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
7526
7976
  }
7527
7977
  /**
7528
7978
  * @title Lago API documentation
7529
- * @version 1.36.0
7979
+ * @version 1.40.0
7530
7980
  * @license AGPLv3
7531
7981
  * @baseUrl https://api.getlago.com/api/v1
7532
7982
  * @externalDocs https://github.com/getlago
@@ -8360,6 +8810,46 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8360
8810
  * @secure
8361
8811
  */
8362
8812
  voidCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
8813
+ /**
8814
+ * @description This endpoint replaces all existing metadata on a credit note with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
8815
+ *
8816
+ * @tags credit_notes
8817
+ * @name ReplaceCreditNoteMetadata
8818
+ * @summary Replace credit note metadata
8819
+ * @request POST:/credit_notes/{lago_id}/metadata
8820
+ * @secure
8821
+ */
8822
+ replaceCreditNoteMetadata: (lagoId: string, data: CreditNoteMetadataResponse, params?: RequestParams) => Promise<HttpResponse<CreditNoteMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
8823
+ /**
8824
+ * @description This endpoint merges the provided metadata with existing metadata on the credit note. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
8825
+ *
8826
+ * @tags credit_notes
8827
+ * @name MergeCreditNoteMetadata
8828
+ * @summary Merge credit note metadata
8829
+ * @request PATCH:/credit_notes/{lago_id}/metadata
8830
+ * @secure
8831
+ */
8832
+ mergeCreditNoteMetadata: (lagoId: string, data: CreditNoteMetadataResponse, params?: RequestParams) => Promise<HttpResponse<CreditNoteMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
8833
+ /**
8834
+ * @description This endpoint removes all metadata from a credit note.
8835
+ *
8836
+ * @tags credit_notes
8837
+ * @name DeleteAllCreditNoteMetadata
8838
+ * @summary Delete all credit note metadata
8839
+ * @request DELETE:/credit_notes/{lago_id}/metadata
8840
+ * @secure
8841
+ */
8842
+ deleteAllCreditNoteMetadata: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNoteMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
8843
+ /**
8844
+ * @description This endpoint removes a single metadata key from a credit note.
8845
+ *
8846
+ * @tags credit_notes
8847
+ * @name DeleteCreditNoteMetadataKey
8848
+ * @summary Delete a metadata key
8849
+ * @request DELETE:/credit_notes/{lago_id}/metadata/{key}
8850
+ * @secure
8851
+ */
8852
+ deleteCreditNoteMetadataKey: (lagoId: string, key: string, params?: RequestParams) => Promise<HttpResponse<CreditNoteMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
8363
8853
  };
8364
8854
  customers: {
8365
8855
  /**
@@ -8961,7 +9451,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8961
9451
  */
8962
9452
  eventBatchEstimateInstantFees: (data: EventBatchEstimateInstantFeesInput, params?: RequestParams) => Promise<HttpResponse<FeesEstimate, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
8963
9453
  /**
8964
- * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
9454
+ * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription. Note that transaction_id is unique per external_subscription_id so multiple subscriptions can share the same transaction_id. This endpoint will only return the first event found with the given transaction_id. WARNING: If your Lago organization is configured to use the Clickhouse-based event pipeline, multiple events can share the same `transaction_id` (with different timestamps). This endpoint will only return the first event found.
8965
9455
  *
8966
9456
  * @tags events
8967
9457
  * @name FindEvent
@@ -9594,6 +10084,46 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9594
10084
  * @secure
9595
10085
  */
9596
10086
  removeEntitlementPrivilege: (code: string, featureCode: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
10087
+ /**
10088
+ * @description This endpoint replaces all existing metadata on a plan with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
10089
+ *
10090
+ * @tags plans
10091
+ * @name ReplacePlanMetadata
10092
+ * @summary Replace plan metadata
10093
+ * @request POST:/plans/{code}/metadata
10094
+ * @secure
10095
+ */
10096
+ replacePlanMetadata: (code: string, data: PlanMetadataResponse, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10097
+ /**
10098
+ * @description This endpoint merges the provided metadata with existing metadata on the plan. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
10099
+ *
10100
+ * @tags plans
10101
+ * @name MergePlanMetadata
10102
+ * @summary Merge plan metadata
10103
+ * @request PATCH:/plans/{code}/metadata
10104
+ * @secure
10105
+ */
10106
+ mergePlanMetadata: (code: string, data: PlanMetadataResponse, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10107
+ /**
10108
+ * @description This endpoint removes all metadata from a plan.
10109
+ *
10110
+ * @tags plans
10111
+ * @name DeleteAllPlanMetadata
10112
+ * @summary Delete all plan metadata
10113
+ * @request DELETE:/plans/{code}/metadata
10114
+ * @secure
10115
+ */
10116
+ deleteAllPlanMetadata: (code: string, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
10117
+ /**
10118
+ * @description This endpoint removes a single metadata key from a plan.
10119
+ *
10120
+ * @tags plans
10121
+ * @name DeletePlanMetadataKey
10122
+ * @summary Delete a metadata key
10123
+ * @request DELETE:/plans/{code}/metadata/{key}
10124
+ * @secure
10125
+ */
10126
+ deletePlanMetadataKey: (code: string, key: string, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
9597
10127
  };
9598
10128
  subscriptions: {
9599
10129
  /**
@@ -9825,6 +10355,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9825
10355
  * @secure
9826
10356
  */
9827
10357
  destroySubscriptionEntitlementPrivilege: (externalId: string, featureCode: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorBadRequest | ApiErrorNotFound>>;
10358
+ /**
10359
+ * @description This endpoint retrieves all fixed charges for a specific subscription.
10360
+ *
10361
+ * @tags subscriptions
10362
+ * @name FindAllSubscriptionFixedCharges
10363
+ * @summary List subscription fixed charges
10364
+ * @request GET:/subscriptions/{external_id}/fixed_charges
10365
+ * @secure
10366
+ */
10367
+ findAllSubscriptionFixedCharges: (externalId: string, params?: RequestParams) => Promise<HttpResponse<FixedCharges, ApiErrorUnauthorized | ApiErrorNotFound>>;
9828
10368
  };
9829
10369
  taxes: {
9830
10370
  /**
@@ -9956,6 +10496,46 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9956
10496
  * @secure
9957
10497
  */
9958
10498
  destroyWallet: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
10499
+ /**
10500
+ * @description This endpoint replaces all existing metadata on a wallet with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
10501
+ *
10502
+ * @tags wallets
10503
+ * @name ReplaceWalletMetadata
10504
+ * @summary Replace wallet metadata
10505
+ * @request POST:/wallets/{lago_id}/metadata
10506
+ * @secure
10507
+ */
10508
+ replaceWalletMetadata: (lagoId: string, data: WalletMetadataResponse, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10509
+ /**
10510
+ * @description This endpoint merges the provided metadata with existing metadata on the wallet. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
10511
+ *
10512
+ * @tags wallets
10513
+ * @name MergeWalletMetadata
10514
+ * @summary Merge wallet metadata
10515
+ * @request PATCH:/wallets/{lago_id}/metadata
10516
+ * @secure
10517
+ */
10518
+ mergeWalletMetadata: (lagoId: string, data: WalletMetadataResponse, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10519
+ /**
10520
+ * @description This endpoint removes all metadata from a wallet.
10521
+ *
10522
+ * @tags wallets
10523
+ * @name DeleteAllWalletMetadata
10524
+ * @summary Delete all wallet metadata
10525
+ * @request DELETE:/wallets/{lago_id}/metadata
10526
+ * @secure
10527
+ */
10528
+ deleteAllWalletMetadata: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
10529
+ /**
10530
+ * @description This endpoint removes a single metadata key from a wallet.
10531
+ *
10532
+ * @tags wallets
10533
+ * @name DeleteWalletMetadataKey
10534
+ * @summary Delete a metadata key
10535
+ * @request DELETE:/wallets/{lago_id}/metadata/{key}
10536
+ * @secure
10537
+ */
10538
+ deleteWalletMetadataKey: (lagoId: string, key: string, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
9959
10539
  /**
9960
10540
  * @description This endpoint is used to list all wallet transactions.
9961
10541
  *