lago-javascript-client 1.36.0 → 1.43.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,61 +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;
2478
2535
  /**
2479
- * 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}]
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
2481
2538
  */
2482
- items: {
2483
- /**
2484
- * The fee unique identifier, created by Lago.
2485
- * @format uuid
2486
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2487
- */
2488
- fee_id: string;
2489
- /**
2490
- * This is the amount of the credit note item excluding taxes, expressed in cents.
2491
- * @example 100
2492
- */
2493
- amount_cents: number;
2494
- }[];
2495
- };
2496
- }
2497
- export interface CreditNote {
2498
- credit_note: CreditNoteObject;
2499
- }
2500
- export interface CreditNoteUpdateInput {
2501
- credit_note: {
2502
- /**
2503
- * The status of the refund portion of the credit note. It indicates the current state or condition of the refund associated with the credit note. The possible values for this field are:
2504
- *
2505
- * - `pending`: this status indicates that the refund is pending execution. The refund request has been initiated but has not been processed or completed yet.
2506
- * - `succeeded`: this status indicates that the refund has been successfully executed. The refund amount has been processed and returned to the customer or the designated recipient.
2507
- * - `failed`: this status indicates that the refund failed to execute. The refund request encountered an error or unsuccessful processing, and the refund amount could not be returned.
2508
- * @example "succeeded"
2509
- */
2510
- refund_status: "pending" | "succeeded" | "failed";
2511
- };
2512
- }
2513
- export interface CreditNoteEstimateInput {
2514
- credit_note: {
2515
- /**
2516
- * The invoice unique identifier, created by Lago.
2517
- * @format uuid
2518
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2519
- */
2520
- invoice_id: string;
2539
+ offset_amount_cents?: number | null;
2521
2540
  /**
2522
2541
  * The list of credit note's items.
2523
- * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":10},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":5}]
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}]
2524
2543
  */
2525
2544
  items: {
2526
2545
  /**
@@ -2530,138 +2549,15 @@ export interface CreditNoteEstimateInput {
2530
2549
  */
2531
2550
  fee_id: string;
2532
2551
  /**
2533
- * The amount of the credit note item, expressed in cents.
2534
- * @example 10
2535
- */
2536
- amount_cents: number;
2537
- }[];
2538
- };
2539
- }
2540
- export interface CreditNoteEstimated {
2541
- estimated_credit_note: {
2542
- /**
2543
- * Unique identifier assigned to the invoice that the credit note belongs to
2544
- * @format uuid
2545
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2546
- */
2547
- lago_invoice_id: string;
2548
- /**
2549
- * The invoice unique number, related to the credit note.
2550
- * @example "LAG-1234"
2551
- */
2552
- invoice_number: string;
2553
- /**
2554
- * The currency of the credit note.
2555
- * @example "EUR"
2556
- */
2557
- currency: Currency;
2558
- /**
2559
- * The tax amount of the credit note, expressed in cents.
2560
- * @example 20
2561
- */
2562
- taxes_amount_cents: number;
2563
- /**
2564
- * The precise tax amount of the credit note, expressed in cents with decimal precision.
2565
- * @example 20.1
2566
- */
2567
- precise_taxes_amount_cents: number;
2568
- /**
2569
- * The tax rate associated with this specific credit note.
2570
- * @example 20
2571
- */
2572
- taxes_rate: number;
2573
- /**
2574
- * The subtotal of the credit note excluding any applicable taxes, expressed in cents.
2575
- * @example 100
2576
- */
2577
- sub_total_excluding_taxes_amount_cents: number;
2578
- /**
2579
- * The credited amount of the credit note, expressed in cents.
2580
- * @example 100
2581
- */
2582
- max_creditable_amount_cents: number;
2583
- /**
2584
- * The refunded amount of the credit note, expressed in cents.
2585
- * @example 0
2586
- */
2587
- max_refundable_amount_cents: number;
2588
- /**
2589
- * The pro-rated amount of the coupons applied to the source invoice.
2590
- * @example 20
2591
- */
2592
- coupons_adjustment_amount_cents: number;
2593
- /**
2594
- * The precise pro-rated amount with decimal precision of the coupons applied to the source invoice.
2595
- * @example 20.1
2596
- */
2597
- precise_coupons_adjustment_amount_cents: number;
2598
- /** Array of credit note's items. */
2599
- items: {
2600
- /**
2601
- * The credit note's item amount, expressed in cents.
2552
+ * This is the amount of the credit note item excluding taxes, expressed in cents.
2602
2553
  * @example 100
2603
2554
  */
2604
2555
  amount_cents: number;
2605
- /**
2606
- * Unique identifier assigned to the fee within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the fee's record within the Lago system.
2607
- * @format uuid
2608
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2609
- */
2610
- lago_fee_id: string | null;
2611
- }[];
2612
- applied_taxes?: {
2613
- /**
2614
- * Unique identifier of the tax, created by Lago.
2615
- * @format uuid
2616
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2617
- */
2618
- lago_tax_id?: string;
2619
- /**
2620
- * Name of the tax.
2621
- * @example "TVA"
2622
- */
2623
- tax_name?: string;
2624
- /**
2625
- * Unique code used to identify the tax associated with the API request.
2626
- * @example "french_standard_vat"
2627
- */
2628
- tax_code?: string;
2629
- /**
2630
- * The percentage rate of the tax
2631
- * @example 20
2632
- */
2633
- tax_rate?: number;
2634
- /**
2635
- * Internal description of the taxe
2636
- * @example "French standard VAT"
2637
- */
2638
- tax_description?: string;
2639
- /** @example 100 */
2640
- base_amount_cents?: number;
2641
- /**
2642
- * Amount of the tax
2643
- * @example 2000
2644
- */
2645
- amount_cents?: number;
2646
- /**
2647
- * Currency of the tax
2648
- * @example "USD"
2649
- */
2650
- amount_currency?: Currency;
2651
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;
2652
2559
  };
2653
2560
  }
2654
- export interface ApiErrorNotAllowed {
2655
- /**
2656
- * @format int32
2657
- * @example 405
2658
- */
2659
- status: number;
2660
- /** @example "Method Not Allowed" */
2661
- error: string;
2662
- /** @example "not_allowed" */
2663
- code: string;
2664
- }
2665
2561
  /** @example "US" */
2666
2562
  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
2563
  /** @example "America/Los_Angeles" */
@@ -2673,6 +2569,18 @@ export interface CustomerBillingConfiguration {
2673
2569
  * @example 3
2674
2570
  */
2675
2571
  invoice_grace_period?: number;
2572
+ /**
2573
+ * Defines whether the issuing date follows the current billing period's end date or the next period starting date.
2574
+ * @default null
2575
+ * @example "next_period_start"
2576
+ */
2577
+ subscription_invoice_issuing_date_anchor?: "current_period_end" | "next_period_start";
2578
+ /**
2579
+ * 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.
2580
+ * @default null
2581
+ * @example "keep_anchor"
2582
+ */
2583
+ subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
2676
2584
  /**
2677
2585
  * The payment provider utilized to initiate payments for invoices issued by Lago.
2678
2586
  * Accepted values: `stripe`, `adyen`, `gocardless` or null. This field is required if you intend to assign a `provider_customer_id`.
@@ -2921,23 +2829,211 @@ export interface CustomerBaseObject {
2921
2829
  */
2922
2830
  updated_at?: string;
2923
2831
  /**
2924
- * Specifies how invoices with a zero total amount should be handled:
2925
- * - `inherit`: (Default) Follows the organization-level configuration.
2926
- * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
2927
- * - `skip`: Invoices with a total amount of zero are not finalized.
2928
- * @example "inherit"
2832
+ * Specifies how invoices with a zero total amount should be handled:
2833
+ * - `inherit`: (Default) Follows the organization-level configuration.
2834
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
2835
+ * - `skip`: Invoices with a total amount of zero are not finalized.
2836
+ * @example "inherit"
2837
+ */
2838
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
2839
+ /**
2840
+ * Set to true to exclude all invoice custom sections from PDF generation for this customer only.
2841
+ * @example false
2842
+ */
2843
+ skip_invoice_custom_sections?: boolean;
2844
+ /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2845
+ billing_configuration?: CustomerBillingConfiguration;
2846
+ /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2847
+ shipping_address?: Address;
2848
+ metadata?: CustomerMetadata[];
2849
+ }
2850
+ export type CreditNoteExtendedObject = CreditNoteObject & {
2851
+ customer?: CustomerBaseObject;
2852
+ };
2853
+ export interface CreditNoteExtended {
2854
+ credit_note: CreditNoteExtendedObject;
2855
+ }
2856
+ export interface CreditNoteUpdateInput {
2857
+ credit_note: {
2858
+ /**
2859
+ * The status of the refund portion of the credit note. It indicates the current state or condition of the refund associated with the credit note. The possible values for this field are:
2860
+ *
2861
+ * - `pending`: this status indicates that the refund is pending execution. The refund request has been initiated but has not been processed or completed yet.
2862
+ * - `succeeded`: this status indicates that the refund has been successfully executed. The refund amount has been processed and returned to the customer or the designated recipient.
2863
+ * - `failed`: this status indicates that the refund failed to execute. The refund request encountered an error or unsuccessful processing, and the refund amount could not be returned.
2864
+ * @example "succeeded"
2865
+ */
2866
+ refund_status: "pending" | "succeeded" | "failed";
2867
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
2868
+ metadata?: MetadataInput;
2869
+ };
2870
+ }
2871
+ export interface CreditNote {
2872
+ credit_note: CreditNoteObject;
2873
+ }
2874
+ export interface CreditNoteEstimateInput {
2875
+ credit_note: {
2876
+ /**
2877
+ * The invoice unique identifier, created by Lago.
2878
+ * @format uuid
2879
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2880
+ */
2881
+ invoice_id: string;
2882
+ /**
2883
+ * The list of credit note's items.
2884
+ * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":10},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":5}]
2885
+ */
2886
+ items: {
2887
+ /**
2888
+ * The fee unique identifier, created by Lago.
2889
+ * @format uuid
2890
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2891
+ */
2892
+ fee_id: string;
2893
+ /**
2894
+ * The amount of the credit note item, expressed in cents.
2895
+ * @example 10
2896
+ */
2897
+ amount_cents: number;
2898
+ }[];
2899
+ };
2900
+ }
2901
+ export interface CreditNoteEstimated {
2902
+ estimated_credit_note: {
2903
+ /**
2904
+ * Unique identifier assigned to the invoice that the credit note belongs to
2905
+ * @format uuid
2906
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2907
+ */
2908
+ lago_invoice_id: string;
2909
+ /**
2910
+ * The invoice unique number, related to the credit note.
2911
+ * @example "LAG-1234"
2912
+ */
2913
+ invoice_number: string;
2914
+ /**
2915
+ * The currency of the credit note.
2916
+ * @example "EUR"
2917
+ */
2918
+ currency: Currency;
2919
+ /**
2920
+ * The tax amount of the credit note, expressed in cents.
2921
+ * @example 20
2922
+ */
2923
+ taxes_amount_cents: number;
2924
+ /**
2925
+ * The precise tax amount of the credit note, expressed in cents with decimal precision.
2926
+ * @example 20.1
2927
+ */
2928
+ precise_taxes_amount_cents: number;
2929
+ /**
2930
+ * The tax rate associated with this specific credit note.
2931
+ * @example 20
2932
+ */
2933
+ taxes_rate: number;
2934
+ /**
2935
+ * The subtotal of the credit note excluding any applicable taxes, expressed in cents.
2936
+ * @example 100
2937
+ */
2938
+ sub_total_excluding_taxes_amount_cents: number;
2939
+ /**
2940
+ * The credited amount of the credit note, expressed in cents.
2941
+ * @example 100
2942
+ */
2943
+ max_creditable_amount_cents: number;
2944
+ /**
2945
+ * The refunded amount of the credit note, expressed in cents.
2946
+ * @example 0
2947
+ */
2948
+ max_refundable_amount_cents: number;
2949
+ /**
2950
+ * The ofsetted amount of the credit note, expressed in cents.
2951
+ * @example 0
2952
+ */
2953
+ max_offsettable_amount_cents: number;
2954
+ /**
2955
+ * The pro-rated amount of the coupons applied to the source invoice.
2956
+ * @example 20
2957
+ */
2958
+ coupons_adjustment_amount_cents: number;
2959
+ /**
2960
+ * The precise pro-rated amount with decimal precision of the coupons applied to the source invoice.
2961
+ * @example 20.1
2962
+ */
2963
+ precise_coupons_adjustment_amount_cents: number;
2964
+ /** Array of credit note's items. */
2965
+ items: {
2966
+ /**
2967
+ * The credit note's item amount, expressed in cents.
2968
+ * @example 100
2969
+ */
2970
+ amount_cents: number;
2971
+ /**
2972
+ * Unique identifier assigned to the fee within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the fee's record within the Lago system.
2973
+ * @format uuid
2974
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2975
+ */
2976
+ lago_fee_id: string | null;
2977
+ }[];
2978
+ applied_taxes?: {
2979
+ /**
2980
+ * Unique identifier of the tax, created by Lago.
2981
+ * @format uuid
2982
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2983
+ */
2984
+ lago_tax_id?: string;
2985
+ /**
2986
+ * Name of the tax.
2987
+ * @example "TVA"
2988
+ */
2989
+ tax_name?: string;
2990
+ /**
2991
+ * Unique code used to identify the tax associated with the API request.
2992
+ * @example "french_standard_vat"
2993
+ */
2994
+ tax_code?: string;
2995
+ /**
2996
+ * The percentage rate of the tax
2997
+ * @example 20
2998
+ */
2999
+ tax_rate?: number;
3000
+ /**
3001
+ * Internal description of the taxe
3002
+ * @example "French standard VAT"
3003
+ */
3004
+ tax_description?: string;
3005
+ /** @example 100 */
3006
+ base_amount_cents?: number;
3007
+ /**
3008
+ * Amount of the tax
3009
+ * @example 2000
3010
+ */
3011
+ amount_cents?: number;
3012
+ /**
3013
+ * Currency of the tax
3014
+ * @example "USD"
3015
+ */
3016
+ amount_currency?: Currency;
3017
+ }[];
3018
+ };
3019
+ }
3020
+ export interface ApiErrorNotAllowed {
3021
+ /**
3022
+ * @format int32
3023
+ * @example 405
2929
3024
  */
2930
- finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
3025
+ status: number;
3026
+ /** @example "Method Not Allowed" */
3027
+ error: string;
3028
+ /** @example "not_allowed" */
3029
+ code: string;
3030
+ }
3031
+ export interface CreditNoteMetadataResponse {
2931
3032
  /**
2932
- * Set to true to exclude all invoice custom sections from PDF generation for this customer only.
2933
- * @example false
3033
+ * Custom metadata stored as key-value pairs.
3034
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
2934
3035
  */
2935
- skip_invoice_custom_sections?: boolean;
2936
- /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2937
- billing_configuration?: CustomerBillingConfiguration;
2938
- /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2939
- shipping_address?: Address;
2940
- metadata?: CustomerMetadata[];
3036
+ metadata: MetadataObject;
2941
3037
  }
2942
3038
  /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
2943
3039
  export interface IntegrationCustomer {
@@ -3586,6 +3682,12 @@ export interface PaymentObject {
3586
3682
  * @example "cus_5eb0285bcf941bc6ba"
3587
3683
  */
3588
3684
  provider_customer_id: string;
3685
+ /**
3686
+ * The unique identifier of the payment method used for this payment.
3687
+ * @format uuid
3688
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3689
+ */
3690
+ payment_method_id?: string | null;
3589
3691
  /**
3590
3692
  * The next action to be taken by the customer to complete the payment. Should usually be empty, except when receiving the `payment.requires_action` webhook.
3591
3693
  * @example {"type":"redirect_to_url","redirect_to_url":{"url":"https://hooks.stripe.com/3d_secure_2/hosted?merchant=acct_AAA&payment_intent=pi_BBB&payment_intent_client_secret=pi_BBB&publishable_key=pk_test_CCC","return_url":"https://app.example.com"}}
@@ -3647,6 +3749,20 @@ export interface PaymentRequestsPaginated {
3647
3749
  payment_requests: PaymentRequestObject[];
3648
3750
  meta: PaginationMeta;
3649
3751
  }
3752
+ /** Reference to a specific payment method for processing the payment. */
3753
+ export interface PaymentMethodReference {
3754
+ /**
3755
+ * The type of payment method to use.
3756
+ * @example "provider"
3757
+ */
3758
+ payment_method_type?: "provider" | "manual";
3759
+ /**
3760
+ * The unique identifier of the payment method (required when using a specific provider payment method).
3761
+ * @format uuid
3762
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3763
+ */
3764
+ payment_method_id?: string;
3765
+ }
3650
3766
  export interface SubscriptionObject {
3651
3767
  /**
3652
3768
  * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription's record within the Lago system
@@ -3685,6 +3801,16 @@ export interface SubscriptionObject {
3685
3801
  * @example "premium"
3686
3802
  */
3687
3803
  plan_code: string;
3804
+ /**
3805
+ * The base cost of the related plan, excluding any applicable taxes, that is billed on a recurring basis.
3806
+ * @example 10000
3807
+ */
3808
+ plan_amount_cents?: number;
3809
+ /**
3810
+ * The currency of the related plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed.
3811
+ * @example "USD"
3812
+ */
3813
+ plan_amount_currency?: Currency;
3688
3814
  /**
3689
3815
  * The status of the subscription, which can have the following values:
3690
3816
  * - `active`: the subscription is currently active and applied to the customer.
@@ -3770,12 +3896,13 @@ export interface SubscriptionObject {
3770
3896
  *
3771
3897
  * - `credit`: A credit note is generated for the unused subscription time. The unused amount is credited back to the customer.
3772
3898
  * - `refund`: A credit note is generated for the unused subscription time. If the invoice is paid or partially paid, the unused paid amount is refunded; any unpaid unused amount is credited back to the customer.
3899
+ * - `offset`: A credit note is generated for the unused subscription time. If the invoice is paid or partially paid, the unused paid amount is refunded; any unpaid unused amount is applied to the invoice reducing its amount due.
3773
3900
  * - `skip`: No credit note is generated for the unused subscription time.
3774
3901
  *
3775
3902
  * _Note: This field is only applicable to pay-in-advance plans and will be `null` for pay-in-arrears plans._
3776
3903
  * @example "credit"
3777
3904
  */
3778
- on_termination_credit_note: "credit" | "refund" | "skip";
3905
+ on_termination_credit_note: "credit" | "refund" | "offset" | "skip";
3779
3906
  /**
3780
3907
  * When a subscription is terminated before the end of its billing period, we generate an invoice for the unbilled usage.
3781
3908
  * This field allows you to control the behavior of the invoice generation:
@@ -3786,6 +3913,8 @@ export interface SubscriptionObject {
3786
3913
  * @example "generate"
3787
3914
  */
3788
3915
  on_termination_invoice: "generate" | "skip";
3916
+ /** The payment method assigned to this subscription for processing payments. */
3917
+ payment_method?: PaymentMethodReference;
3789
3918
  }
3790
3919
  export interface SubscriptionsPaginated {
3791
3920
  subscriptions: SubscriptionObject[];
@@ -3886,6 +4015,8 @@ export interface WalletRecurringTransactionRule {
3886
4015
  * @example false
3887
4016
  */
3888
4017
  ignore_paid_top_up_limits: boolean;
4018
+ /** The payment method assigned to this recurring transaction rule for processing top-up payments. */
4019
+ payment_method?: PaymentMethodReference;
3889
4020
  }
3890
4021
  export interface WalletObject {
3891
4022
  /**
@@ -3920,6 +4051,18 @@ export interface WalletObject {
3920
4051
  * @example "Prepaid"
3921
4052
  */
3922
4053
  name?: string | null;
4054
+ /**
4055
+ * The code of the wallet.
4056
+ * @example "prepaid"
4057
+ */
4058
+ code?: string | null;
4059
+ /**
4060
+ * 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.
4061
+ * @min 1
4062
+ * @max 50
4063
+ * @example 50
4064
+ */
4065
+ priority?: number;
3923
4066
  /**
3924
4067
  * 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
4068
  * @pattern ^[0-9]+.?[0-9]*$
@@ -4025,6 +4168,13 @@ export interface WalletObject {
4025
4168
  * @example 1000
4026
4169
  */
4027
4170
  paid_top_up_max_amount_cents?: number | null;
4171
+ /** The payment method assigned to this wallet for processing top-up payments. */
4172
+ payment_method?: PaymentMethodReference;
4173
+ /**
4174
+ * Custom metadata stored as key-value pairs.
4175
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
4176
+ */
4177
+ metadata?: MetadataObject;
4028
4178
  }
4029
4179
  export interface WalletsPaginated {
4030
4180
  wallets: WalletObject[];
@@ -4305,35 +4455,78 @@ export interface CustomerPastUsage {
4305
4455
  usage_periods: CustomerUsage[];
4306
4456
  meta: PaginationMeta;
4307
4457
  }
4308
- /** . */
4309
4458
  export interface CustomerCheckoutUrl {
4310
- customer?: {
4311
- /**
4312
- * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
4313
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4314
- */
4315
- lago_customer_id: string;
4316
- /**
4317
- * The customer external unique identifier (provided by your own application)
4318
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4319
- */
4320
- external_customer_id: string;
4321
- /**
4322
- * The Payment Provider name linked to the Customer.
4323
- * @example "stripe"
4324
- */
4325
- payment_provider: string;
4326
- /**
4327
- * Code of the payment provider
4328
- * @example "Stripe Prod"
4329
- */
4330
- payment_provider_code?: string;
4331
- /**
4332
- * The new generated Payment Provider Checkout URL for the Customer.
4333
- * @example "https://foo.bar"
4334
- */
4335
- checkout_url?: string;
4336
- };
4459
+ /**
4460
+ * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
4461
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4462
+ */
4463
+ lago_customer_id: string;
4464
+ /**
4465
+ * The customer external unique identifier (provided by your own application)
4466
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4467
+ */
4468
+ external_customer_id: string;
4469
+ /**
4470
+ * The Payment Provider name linked to the Customer.
4471
+ * @example "stripe"
4472
+ */
4473
+ payment_provider: string;
4474
+ /**
4475
+ * Code of the payment provider
4476
+ * @example "Stripe Prod"
4477
+ */
4478
+ payment_provider_code?: string;
4479
+ /**
4480
+ * The new generated Payment Provider Checkout URL for the Customer.
4481
+ * @example "https://foo.bar"
4482
+ */
4483
+ checkout_url?: string;
4484
+ }
4485
+ export interface PaymentMethodObject {
4486
+ /**
4487
+ * The unique identifier of the payment method, created by Lago.
4488
+ * @format uuid
4489
+ * @example "4cf085a7-c196-4f07-a543-97c50ec6e8b2"
4490
+ */
4491
+ lago_id: string;
4492
+ /**
4493
+ * Indicates whether this payment method is the default one for the customer.
4494
+ * @example true
4495
+ */
4496
+ is_default: boolean;
4497
+ /**
4498
+ * Code of the payment provider associated with this payment method.
4499
+ * @example "stripe_prod"
4500
+ */
4501
+ payment_provider_code?: string | null;
4502
+ /**
4503
+ * Human-readable name of the payment provider.
4504
+ * @example "Stripe"
4505
+ */
4506
+ payment_provider_name?: string | null;
4507
+ /**
4508
+ * The type of the payment provider.
4509
+ * @example "stripe"
4510
+ */
4511
+ payment_provider_type: "adyen" | "cashfree" | "gocardless" | "stripe" | "flutterwave" | "moneyhash";
4512
+ /**
4513
+ * Unique identifier of the payment method within the payment provider.
4514
+ * @example "pm_1N8ZQX2eZvKYlo2CkL9Y8XYZ"
4515
+ */
4516
+ provider_method_id: string;
4517
+ /**
4518
+ * Timestamp when the payment method was created in Lago's database.
4519
+ * @format date-time
4520
+ * @example "2025-01-21T00:10:29Z"
4521
+ */
4522
+ created_at: string;
4523
+ }
4524
+ export interface PaymentMethodsPaginated {
4525
+ payment_methods: PaymentMethodObject[];
4526
+ meta: PaginationMeta;
4527
+ }
4528
+ export interface PaymentMethod {
4529
+ payment_method: PaymentMethodObject;
4337
4530
  }
4338
4531
  export interface EventObject {
4339
4532
  /**
@@ -4341,7 +4534,7 @@ export interface EventObject {
4341
4534
  * @format uuid
4342
4535
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4343
4536
  */
4344
- lago_id: string;
4537
+ lago_id?: string | null;
4345
4538
  /**
4346
4539
  * 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
4540
  * @example "transaction_1234567890"
@@ -4394,7 +4587,7 @@ export interface EventObject {
4394
4587
  * @format date-time
4395
4588
  * @example "2022-04-29T08:59:51Z"
4396
4589
  */
4397
- created_at: string;
4590
+ created_at?: string | null;
4398
4591
  }
4399
4592
  export interface EventsPaginated {
4400
4593
  events: EventObject[];
@@ -4767,6 +4960,8 @@ export interface InvoiceOneOffCreateInput {
4767
4960
  */
4768
4961
  skip_psp?: boolean | null;
4769
4962
  }[];
4963
+ /** Optional payment method to use for processing the invoice payment. */
4964
+ payment_method?: PaymentMethodReference;
4770
4965
  };
4771
4966
  }
4772
4967
  export interface ErrorDetailObject {
@@ -5298,6 +5493,8 @@ export interface PaymentRequestCreateInput {
5298
5493
  email: string;
5299
5494
  /** A list of Lago IDs for the customer's overdue invoices to start the dunning process */
5300
5495
  lago_invoice_ids: string[];
5496
+ /** Optional payment method to use for processing the payment request. */
5497
+ payment_method?: PaymentMethodReference;
5301
5498
  };
5302
5499
  }
5303
5500
  export interface PaymentRequest {
@@ -5638,6 +5835,143 @@ export interface ChargeObject {
5638
5835
  */
5639
5836
  conversion_rate: string;
5640
5837
  };
5838
+ /**
5839
+ * Specifies whether the charge accepts a target wallet for prepaid credits deduction.
5840
+ * @example false
5841
+ */
5842
+ accepts_target_wallet?: boolean | null;
5843
+ }
5844
+ export interface FixedChargeProperties {
5845
+ /**
5846
+ * - The unit price, excluding tax, for a `standard` charge model. It is expressed as a decimal value.
5847
+ * - The amount, excluding tax, for a complete set of units in a `package` charge model. It is expressed as a decimal value.
5848
+ * @pattern ^[0-9]+.?[0-9]*$
5849
+ * @example "30"
5850
+ */
5851
+ amount?: string;
5852
+ /** Graduated ranges, sorted from bottom to top tiers, used for a `graduated` charge model. */
5853
+ graduated_ranges?: {
5854
+ /**
5855
+ * 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.
5856
+ * @example 0
5857
+ */
5858
+ from_value: number;
5859
+ /**
5860
+ * Specifies the highest value of a tier for a `graduated` charge model.
5861
+ * - This value must be higher than the from_value of the same tier.
5862
+ * - This value must be null for the last tier.
5863
+ * @example 10
5864
+ */
5865
+ to_value: number | null;
5866
+ /**
5867
+ * The flat amount for a whole tier, excluding tax, for a `graduated` charge model. It is expressed as a decimal value.
5868
+ * @pattern ^[0-9]+.?[0-9]*$
5869
+ * @example "10"
5870
+ */
5871
+ flat_amount: string;
5872
+ /**
5873
+ * The unit price, excluding tax, for a specific tier of a `graduated` charge model. It is expressed as a decimal value.
5874
+ * @pattern ^[0-9]+.?[0-9]*$
5875
+ * @example "0.5"
5876
+ */
5877
+ per_unit_amount: string;
5878
+ }[];
5879
+ /** Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. */
5880
+ volume_ranges?: {
5881
+ /**
5882
+ * 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.
5883
+ * @example 0
5884
+ */
5885
+ from_value: number;
5886
+ /**
5887
+ * Specifies the highest value of a tier for a `volume` charge model.
5888
+ * - This value must be higher than the `from_value` of the same tier.
5889
+ * - This value must be `null` for the last tier.
5890
+ * @example 10
5891
+ */
5892
+ to_value: number | null;
5893
+ /**
5894
+ * The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
5895
+ * @pattern ^[0-9]+.?[0-9]*$
5896
+ * @example "10"
5897
+ */
5898
+ flat_amount: string;
5899
+ /**
5900
+ * The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
5901
+ * @pattern ^[0-9]+.?[0-9]*$
5902
+ * @example "0.5"
5903
+ */
5904
+ per_unit_amount: string;
5905
+ }[];
5906
+ }
5907
+ export interface FixedChargeObject {
5908
+ /**
5909
+ * Unique identifier of the fixed charge, created by Lago.
5910
+ * @format uuid
5911
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5912
+ */
5913
+ lago_id: string;
5914
+ /**
5915
+ * Unique identifier of the add-on associated with this fixed charge.
5916
+ * @format uuid
5917
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5918
+ */
5919
+ lago_add_on_id: string;
5920
+ /**
5921
+ * 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.
5922
+ * @example "Setup fee"
5923
+ */
5924
+ invoice_display_name: string;
5925
+ /**
5926
+ * Unique code used to identify the add-on.
5927
+ * @example "setup_fee"
5928
+ */
5929
+ add_on_code: string;
5930
+ /**
5931
+ * The date and time when the fixed charge was created. It is expressed in UTC format according to the ISO 8601 datetime standard.
5932
+ * @format date-time
5933
+ * @example "2023-06-27T19:43:42Z"
5934
+ */
5935
+ created_at: string;
5936
+ /**
5937
+ * Unique code for the fixed charge.
5938
+ * @example "setup_fee"
5939
+ */
5940
+ code?: string;
5941
+ /**
5942
+ * The charge model for the fixed charge. Only `standard`, `graduated`, and `volume` models are supported for fixed charges.
5943
+ * @example "standard"
5944
+ */
5945
+ charge_model: "standard" | "graduated" | "volume";
5946
+ /**
5947
+ * 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.
5948
+ * @example false
5949
+ */
5950
+ pay_in_advance: boolean;
5951
+ /**
5952
+ * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
5953
+ *
5954
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
5955
+ * - If set to `false`, the charge is billed in full.
5956
+ * - If not defined in the request, default value is `false`.
5957
+ * @example false
5958
+ */
5959
+ prorated: boolean;
5960
+ /** List of all thresholds utilized for calculating the fixed charge. */
5961
+ properties: FixedChargeProperties;
5962
+ /**
5963
+ * The number of units for the fixed charge.
5964
+ * @example 1
5965
+ */
5966
+ units: number;
5967
+ /**
5968
+ * Unique identifier of the parent fixed charge (for plan versions).
5969
+ * @format uuid
5970
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5971
+ */
5972
+ lago_parent_id?: string | null;
5973
+ /** List of taxes applied to the fixed charge. */
5974
+ taxes?: TaxObject[];
5641
5975
  }
5642
5976
  export type PlanEntitlementPrivilegeObject = FeaturePrivilegeObject & {
5643
5977
  /**
@@ -5733,19 +6067,34 @@ export interface PlanObject {
5733
6067
  * 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`.
5734
6068
  * @example null
5735
6069
  */
5736
- bill_charges_monthly?: boolean | null;
6070
+ bill_charges_monthly?: boolean | null;
6071
+ /**
6072
+ * 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`.
6073
+ * @example null
6074
+ */
6075
+ bill_fixed_charges_monthly?: boolean | null;
5737
6076
  minimum_commitment?: MinimumCommitmentObject;
5738
6077
  /**
5739
6078
  * Additional usage-based charges for this plan.
5740
6079
  * @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
6080
  */
5742
6081
  charges?: ChargeObject[];
6082
+ /**
6083
+ * List of fixed charges for this plan.
6084
+ * @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":[]}]
6085
+ */
6086
+ fixed_charges?: FixedChargeObject[];
5743
6087
  /** All taxes applied to the plan. */
5744
6088
  taxes?: TaxObject[];
5745
6089
  /** List of usage thresholds applied to the plan. */
5746
6090
  usage_thresholds?: UsageThresholdObject[];
5747
6091
  /** List of all feature entitlements and their privileges available for this plan. */
5748
6092
  entitlements?: PlanEntitlement[];
6093
+ /**
6094
+ * Custom metadata stored as key-value pairs.
6095
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
6096
+ */
6097
+ metadata?: MetadataObject;
5749
6098
  }
5750
6099
  export interface PlansPaginated {
5751
6100
  plans: PlanObject[];
@@ -5805,52 +6154,57 @@ export interface PlanCreateInput {
5805
6154
  * The name of the plan.
5806
6155
  * @example "Startup"
5807
6156
  */
5808
- name?: string;
6157
+ name: string;
5809
6158
  /**
5810
6159
  * 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
6160
  * @example "Startup plan"
5812
6161
  */
5813
- invoice_display_name?: string;
6162
+ invoice_display_name?: string | null;
5814
6163
  /**
5815
6164
  * 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
6165
  * @example "startup"
5817
6166
  */
5818
- code?: string;
6167
+ code: string;
5819
6168
  /**
5820
6169
  * 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
6170
  * @example "monthly"
5822
6171
  */
5823
- interval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
6172
+ interval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
5824
6173
  /**
5825
6174
  * The description on the plan.
5826
6175
  * @example "Plan for early stage startups."
5827
6176
  */
5828
- description?: string;
6177
+ description?: string | null;
5829
6178
  /**
5830
6179
  * 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
6180
  * @example 10000
5832
6181
  */
5833
- amount_cents?: number;
6182
+ amount_cents: number;
5834
6183
  /**
5835
6184
  * 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
6185
  * @example "USD"
5837
6186
  */
5838
- amount_currency?: Currency;
6187
+ amount_currency: Currency;
5839
6188
  /**
5840
6189
  * The duration in days during which the base cost of the plan is offered for free.
5841
6190
  * @example 5
5842
6191
  */
5843
- trial_period?: number;
6192
+ trial_period?: number | null;
5844
6193
  /**
5845
6194
  * 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
6195
  * @example true
5847
6196
  */
5848
- pay_in_advance?: boolean;
6197
+ pay_in_advance: boolean;
5849
6198
  /**
5850
6199
  * 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
6200
  * @example null
5852
6201
  */
5853
6202
  bill_charges_monthly?: boolean | null;
6203
+ /**
6204
+ * 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`.
6205
+ * @example null
6206
+ */
6207
+ bill_fixed_charges_monthly?: boolean | null;
5854
6208
  /** List of unique code used to identify the taxes. */
5855
6209
  tax_codes?: TaxCodes;
5856
6210
  /** Minimum commitment for this plan. */
@@ -5865,7 +6219,7 @@ export interface PlanCreateInput {
5865
6219
  * @format uuid
5866
6220
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5867
6221
  */
5868
- billable_metric_id?: string;
6222
+ billable_metric_id: string;
5869
6223
  /**
5870
6224
  * Specifies the pricing model used for the calculation of the final fee. It can be any of the following values:
5871
6225
  * - [`dynamic`](https://docs.getlago.com/guide/plans/charges/charge-models/dynamic)
@@ -5876,7 +6230,7 @@ export interface PlanCreateInput {
5876
6230
  * - [`standard`](https://docs.getlago.com/guide/plans/charges/charge-models/standard)
5877
6231
  * - [`volume`](https://docs.getlago.com/guide/plans/charges/charge-models/volume)
5878
6232
  */
5879
- charge_model?: ChargeModelEnum;
6233
+ charge_model: ChargeModelEnum;
5880
6234
  /**
5881
6235
  * 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
6236
  * @example false
@@ -5936,9 +6290,71 @@ export interface PlanCreateInput {
5936
6290
  */
5937
6291
  conversion_rate?: string;
5938
6292
  };
6293
+ /**
6294
+ * Specifies whether the charge accepts a target wallet for prepaid credits deduction.
6295
+ * @example false
6296
+ */
6297
+ accepts_target_wallet?: boolean | null;
6298
+ }[];
6299
+ /**
6300
+ * Additional fixed charges for this plan.
6301
+ * @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}]
6302
+ */
6303
+ fixed_charges?: {
6304
+ /**
6305
+ * Unique identifier of the add-on associated with this fixed charge.
6306
+ * @format uuid
6307
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6308
+ */
6309
+ add_on_id: string;
6310
+ /**
6311
+ * Unique code for the fixed charge. If not provided, it will be automatically generated based on the add-on code.
6312
+ * @example "setup_fee"
6313
+ */
6314
+ code?: string;
6315
+ /**
6316
+ * 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.
6317
+ * @example "Setup fee"
6318
+ */
6319
+ invoice_display_name?: string;
6320
+ /**
6321
+ * The number of units for the fixed charge. Defaults to 0 if not provided.
6322
+ * @default 0
6323
+ * @example 1
6324
+ */
6325
+ units?: number;
6326
+ /**
6327
+ * The charge model for the fixed charge. Only `standard`, `graduated`, and `volume` models are supported for fixed charges.
6328
+ * @example "standard"
6329
+ */
6330
+ charge_model: "standard" | "graduated" | "volume";
6331
+ /**
6332
+ * 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.
6333
+ * @default false
6334
+ * @example false
6335
+ */
6336
+ pay_in_advance?: boolean;
6337
+ /**
6338
+ * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
6339
+ *
6340
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
6341
+ * - If set to `false`, the charge is billed in full.
6342
+ * - Defaults to `false` if not provided.
6343
+ *
6344
+ * Note: Prorated fixed charges with `graduated` model and `pay_in_advance` are not allowed.
6345
+ * @default false
6346
+ * @example false
6347
+ */
6348
+ prorated?: boolean;
6349
+ /** List of all thresholds utilized for calculating the fixed charge. */
6350
+ properties?: FixedChargeProperties;
6351
+ /** List of taxes applied to the fixed charge. */
6352
+ tax_codes?: TaxCodes;
5939
6353
  }[];
5940
6354
  /** List of usage thresholds to apply to the plan. */
5941
6355
  usage_thresholds?: UsageThresholdInput[];
6356
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
6357
+ metadata?: MetadataInput;
5942
6358
  };
5943
6359
  }
5944
6360
  export interface Plan {
@@ -5955,7 +6371,7 @@ export interface PlanUpdateInput {
5955
6371
  * 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
6372
  * @example "Startup plan"
5957
6373
  */
5958
- invoice_display_name?: string;
6374
+ invoice_display_name?: string | null;
5959
6375
  /**
5960
6376
  * 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
6377
  * @example "startup"
@@ -5970,7 +6386,7 @@ export interface PlanUpdateInput {
5970
6386
  * The description on the plan.
5971
6387
  * @example "Plan for early stage startups."
5972
6388
  */
5973
- description?: string;
6389
+ description?: string | null;
5974
6390
  /**
5975
6391
  * 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
6392
  * @example 10000
@@ -5985,7 +6401,7 @@ export interface PlanUpdateInput {
5985
6401
  * The duration in days during which the base cost of the plan is offered for free.
5986
6402
  * @example 5
5987
6403
  */
5988
- trial_period?: number;
6404
+ trial_period?: number | null;
5989
6405
  /**
5990
6406
  * 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
6407
  * @example true
@@ -5996,6 +6412,11 @@ export interface PlanUpdateInput {
5996
6412
  * @example null
5997
6413
  */
5998
6414
  bill_charges_monthly?: boolean | null;
6415
+ /**
6416
+ * 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`.
6417
+ * @example null
6418
+ */
6419
+ bill_fixed_charges_monthly?: boolean | null;
5999
6420
  /** List of unique code used to identify the taxes. */
6000
6421
  tax_codes?: TaxCodes;
6001
6422
  /** Minimum commitment for this plan. */
@@ -6082,6 +6503,77 @@ export interface PlanUpdateInput {
6082
6503
  */
6083
6504
  conversion_rate?: string;
6084
6505
  };
6506
+ /**
6507
+ * Specifies whether the charge accepts a target wallet for prepaid credits deduction.
6508
+ * @example false
6509
+ */
6510
+ accepts_target_wallet?: boolean | null;
6511
+ }[];
6512
+ /**
6513
+ * Additional fixed charges for this plan.
6514
+ * @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}]
6515
+ */
6516
+ fixed_charges?: {
6517
+ /**
6518
+ * Unique identifier of the fixed charge created by Lago (required for updates).
6519
+ * @format uuid
6520
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6521
+ */
6522
+ id?: string;
6523
+ /**
6524
+ * Unique identifier of the add-on associated with this fixed charge.
6525
+ * @format uuid
6526
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6527
+ */
6528
+ add_on_id?: string;
6529
+ /**
6530
+ * Unique code for the fixed charge. If not provided, it will be automatically generated based on the add-on code.
6531
+ * @example "setup_fee"
6532
+ */
6533
+ code?: string;
6534
+ /**
6535
+ * 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.
6536
+ * @example "Setup fee"
6537
+ */
6538
+ invoice_display_name?: string;
6539
+ /**
6540
+ * The number of units for the fixed charge. Defaults to 0 if not provided.
6541
+ * @default 0
6542
+ * @example 1
6543
+ */
6544
+ units?: number;
6545
+ /**
6546
+ * The charge model for the fixed charge. Only `standard`, `graduated`, and `volume` models are supported for fixed charges.
6547
+ * @example "standard"
6548
+ */
6549
+ charge_model?: "standard" | "graduated" | "volume";
6550
+ /**
6551
+ * 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.
6552
+ * @default false
6553
+ * @example false
6554
+ */
6555
+ pay_in_advance?: boolean;
6556
+ /**
6557
+ * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
6558
+ *
6559
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
6560
+ * - If set to `false`, the charge is billed in full.
6561
+ * - Defaults to `false` if not provided.
6562
+ *
6563
+ * Note: Prorated fixed charges with `graduated` model and `pay_in_advance` are not allowed.
6564
+ * @default false
6565
+ * @example false
6566
+ */
6567
+ prorated?: boolean;
6568
+ /** List of all thresholds utilized for calculating the fixed charge. */
6569
+ properties?: FixedChargeProperties;
6570
+ /** List of taxes applied to the fixed charge. */
6571
+ tax_codes?: TaxCodes;
6572
+ /**
6573
+ * Determines if the units should be applied immediately upon assignment or deferred to the next billing cycle.
6574
+ * @example true
6575
+ */
6576
+ apply_units_immediately?: boolean;
6085
6577
  }[];
6086
6578
  /** List of usage thresholds to apply to the plan. */
6087
6579
  usage_thresholds?: UsageThresholdInput[];
@@ -6090,6 +6582,8 @@ export interface PlanUpdateInput {
6090
6582
  * @example true
6091
6583
  */
6092
6584
  cascade_updates?: boolean;
6585
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
6586
+ metadata?: MetadataInput;
6093
6587
  };
6094
6588
  }
6095
6589
  export interface PlanEntitlements {
@@ -6102,6 +6596,13 @@ export interface EntitlementUpdateInput {
6102
6596
  */
6103
6597
  entitlements: Record<string, Record<string, number | boolean | string>>;
6104
6598
  }
6599
+ export interface PlanMetadataResponse {
6600
+ /**
6601
+ * Custom metadata stored as key-value pairs.
6602
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
6603
+ */
6604
+ metadata: MetadataObject;
6605
+ }
6105
6606
  /** Based plan overrides. */
6106
6607
  export interface PlanOverridesObject {
6107
6608
  /**
@@ -6190,8 +6691,39 @@ export interface PlanOverridesObject {
6190
6691
  conversion_rate?: string;
6191
6692
  };
6192
6693
  }[];
6694
+ /** Additional fixed charges for this plan. */
6695
+ fixed_charges?: {
6696
+ /**
6697
+ * Unique identifier of the fixed charge created by Lago.
6698
+ * @format uuid
6699
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6700
+ */
6701
+ id: string;
6702
+ /**
6703
+ * 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.
6704
+ * @example "Setup fee"
6705
+ */
6706
+ invoice_display_name?: string;
6707
+ /**
6708
+ * The number of units for the fixed charge. Defaults to 0 if not provided.
6709
+ * @default 0
6710
+ * @example 1
6711
+ */
6712
+ units?: number;
6713
+ /**
6714
+ * Determines if the units should be applied immediately upon assignment or deferred to the next billing cycle.
6715
+ * @example true
6716
+ */
6717
+ apply_units_immediately?: boolean;
6718
+ /** List of all thresholds utilized for calculating the fixed charge. */
6719
+ properties?: FixedChargeProperties;
6720
+ /** List of taxes applied to the fixed charge. */
6721
+ tax_codes?: TaxCodes;
6722
+ }[];
6193
6723
  /** List of usage thresholds applied to the subscription. */
6194
6724
  usage_thresholds?: UsageThresholdInput[];
6725
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
6726
+ metadata?: MetadataInput;
6195
6727
  }
6196
6728
  export interface SubscriptionCreateInput {
6197
6729
  /**
@@ -6260,6 +6792,8 @@ export interface SubscriptionCreateInput {
6260
6792
  subscription_at?: string;
6261
6793
  /** Based plan overrides. */
6262
6794
  plan_overrides?: PlanOverridesObject;
6795
+ /** Optional payment method to use for processing subscription payments. */
6796
+ payment_method?: PaymentMethodReference;
6263
6797
  };
6264
6798
  }
6265
6799
  export type SubscriptionObjectExtended = SubscriptionObject & {
@@ -6294,6 +6828,8 @@ export interface SubscriptionUpdateInput {
6294
6828
  subscription_at?: string;
6295
6829
  /** Based plan overrides. */
6296
6830
  plan_overrides?: PlanOverridesObject;
6831
+ /** Optional payment method to use for processing subscription payments. */
6832
+ payment_method?: PaymentMethodReference;
6297
6833
  };
6298
6834
  }
6299
6835
  export interface LifetimeUsageThresholdObject {
@@ -6412,12 +6948,12 @@ export interface AlertObject {
6412
6948
  * The subscription external unique identifier (provided by your own application).
6413
6949
  * @example "sub_1234567890"
6414
6950
  */
6415
- subscription_external_id: string;
6951
+ external_subscription_id: string;
6416
6952
  /**
6417
6953
  * The customer external unique identifier (provided by your own application).
6418
6954
  * @example "cus_0987654321"
6419
6955
  */
6420
- customer_external_id: string;
6956
+ external_customer_id: string;
6421
6957
  /** The billable metric associated with the alert. Only for alerts based on a billable metric. */
6422
6958
  billable_metric: BillableMetricObject;
6423
6959
  /**
@@ -6499,6 +7035,21 @@ export interface AlertCreateInput {
6499
7035
  code: string;
6500
7036
  };
6501
7037
  }
7038
+ export interface AlertBatchCreateInput {
7039
+ /** Array of alerts to create. All alerts are created atomically - if any fail validation, none are created. */
7040
+ alerts: (AlertBaseInput & {
7041
+ /**
7042
+ * The type of alert.
7043
+ * @example "billable_metric_current_usage_amount"
7044
+ */
7045
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
7046
+ /**
7047
+ * Unique code used to identify the alert.
7048
+ * @example "storage_threshold_alert"
7049
+ */
7050
+ code: string;
7051
+ })[];
7052
+ }
6502
7053
  export interface Alert {
6503
7054
  alert: AlertObject;
6504
7055
  }
@@ -6552,6 +7103,9 @@ export interface SubscriptionEntitlements {
6552
7103
  export interface SubscriptionEntitlement {
6553
7104
  entitlement: SubscriptionEntitlementObject;
6554
7105
  }
7106
+ export interface FixedCharges {
7107
+ fixed_charges: FixedChargeObject[];
7108
+ }
6555
7109
  export interface TaxesPaginated {
6556
7110
  taxes: TaxObject[];
6557
7111
  meta: PaginationMeta;
@@ -6601,6 +7155,18 @@ export interface WalletCreateInput {
6601
7155
  * @example "Prepaid"
6602
7156
  */
6603
7157
  name?: string | null;
7158
+ /**
7159
+ * The code of the wallet.
7160
+ * @example "prepaid"
7161
+ */
7162
+ code?: string | null;
7163
+ /**
7164
+ * 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.
7165
+ * @min 1
7166
+ * @max 50
7167
+ * @example 50
7168
+ */
7169
+ priority?: number;
6604
7170
  /**
6605
7171
  * 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
7172
  * @pattern ^[0-9]+.?[0-9]*$
@@ -6680,6 +7246,10 @@ export interface WalletCreateInput {
6680
7246
  ignore_paid_top_up_limits_on_creation?: boolean | null;
6681
7247
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
6682
7248
  recurring_transaction_rules?: any[] | null;
7249
+ /** Optional payment method to use for processing wallet top-up payments. */
7250
+ payment_method?: PaymentMethodReference;
7251
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
7252
+ metadata?: MetadataInput;
6683
7253
  };
6684
7254
  }
6685
7255
  export interface Wallet {
@@ -6692,6 +7262,18 @@ export interface WalletUpdateInput {
6692
7262
  * @example "new_name"
6693
7263
  */
6694
7264
  name?: string | null;
7265
+ /**
7266
+ * The code of the wallet.
7267
+ * @example "prepaid"
7268
+ */
7269
+ code?: string | null;
7270
+ /**
7271
+ * 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.
7272
+ * @min 1
7273
+ * @max 50
7274
+ * @example 50
7275
+ */
7276
+ priority?: number;
6695
7277
  /**
6696
7278
  * 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
7279
  * @format date-time
@@ -6782,7 +7364,11 @@ export interface WalletUpdateInput {
6782
7364
  * @example "Tokens for models 'high-fidelity-boost'"
6783
7365
  */
6784
7366
  transaction_name?: string | null;
7367
+ /** Optional payment method to use for processing recurring top-up payments. */
7368
+ payment_method?: PaymentMethodReference;
6785
7369
  }[];
7370
+ /** Optional payment method to use for processing wallet top-up payments. */
7371
+ payment_method?: PaymentMethodReference;
6786
7372
  /** Set wallet limitations to fee types. */
6787
7373
  applies_to?: {
6788
7374
  /**
@@ -6796,8 +7382,17 @@ export interface WalletUpdateInput {
6796
7382
  */
6797
7383
  billable_metric_codes?: any[] | null;
6798
7384
  };
7385
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
7386
+ metadata?: MetadataInput;
6799
7387
  };
6800
7388
  }
7389
+ export interface WalletMetadataResponse {
7390
+ /**
7391
+ * Custom metadata stored as key-value pairs.
7392
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
7393
+ */
7394
+ metadata: MetadataObject;
7395
+ }
6801
7396
  export interface WalletTransactionCreateInput {
6802
7397
  wallet_transaction: {
6803
7398
  /**
@@ -6841,6 +7436,8 @@ export interface WalletTransactionCreateInput {
6841
7436
  * @example false
6842
7437
  */
6843
7438
  ignore_paid_top_up_limits?: boolean;
7439
+ /** Optional payment method to use for processing the wallet transaction payment. */
7440
+ payment_method?: PaymentMethodReference;
6844
7441
  /**
6845
7442
  * This optional field allows you to store a list of key-value pairs that hold additional information or custom attributes related to the data.
6846
7443
  * @example [{"key":"example key","value":"example value"},{"key":"another key","value":"another value"}]
@@ -6931,6 +7528,8 @@ export interface WalletTransactionObject {
6931
7528
  * @example "Tokens for models 'high-fidelity-boost'"
6932
7529
  */
6933
7530
  name: string | null;
7531
+ /** The payment method assigned to this wallet transaction for processing the payment. */
7532
+ payment_method?: PaymentMethodReference;
6934
7533
  }
6935
7534
  export interface WalletTransactions {
6936
7535
  wallet_transactions: WalletTransactionObject[];
@@ -7062,7 +7661,7 @@ export interface TriggeredAlertObject {
7062
7661
  * The subscription external unique identifier (provided by your own application).
7063
7662
  * @example "sub_1234567890"
7064
7663
  */
7065
- subscription_external_id: string;
7664
+ external_subscription_id: string;
7066
7665
  /**
7067
7666
  * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
7068
7667
  * @example "storage_usage"
@@ -7183,9 +7782,6 @@ export type CustomerViesCheckObject = CustomerBaseObject & {
7183
7782
  valid?: boolean;
7184
7783
  };
7185
7784
  };
7186
- export type CreditNoteExtendedObject = CreditNoteObject & {
7187
- customer?: CustomerBaseObject;
7188
- };
7189
7785
  export interface CreditNotePaymentProviderRefundError {
7190
7786
  /**
7191
7787
  * Unique identifier assigned to the credit note within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit note record within the Lago system.
@@ -7226,7 +7822,7 @@ export interface DunningCampaignFinishedObject {
7226
7822
  * The customer external unique identifier (provided by your own application).
7227
7823
  * @example "cus_0987654321"
7228
7824
  */
7229
- customer_external_id: string;
7825
+ external_customer_id: string;
7230
7826
  /**
7231
7827
  * Identifier of the dunning campaign.
7232
7828
  * @example "dun_code_1234"
@@ -7295,6 +7891,9 @@ export interface FeeTaxProviderErrorObject {
7295
7891
  event_transaction_id: string | null;
7296
7892
  provider_error: string | Record<string, any>;
7297
7893
  }
7894
+ export type InvoicePaymentDisputeLostObject = InvoiceObjectExtended & {
7895
+ provider_error?: string | Record<string, any>;
7896
+ };
7298
7897
  export interface InvoicePaymentFailureObject {
7299
7898
  /**
7300
7899
  * Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system.
@@ -7526,7 +8125,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
7526
8125
  }
7527
8126
  /**
7528
8127
  * @title Lago API documentation
7529
- * @version 1.36.0
8128
+ * @version 1.42.0
7530
8129
  * @license AGPLv3
7531
8130
  * @baseUrl https://api.getlago.com/api/v1
7532
8131
  * @externalDocs https://github.com/getlago
@@ -8230,7 +8829,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8230
8829
  * @request POST:/credit_notes
8231
8830
  * @secure
8232
8831
  */
8233
- createCreditNote: (data: CreditNoteCreateInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
8832
+ createCreditNote: (data: CreditNoteCreateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteExtended, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
8234
8833
  /**
8235
8834
  * @description This endpoint list all existing credit notes.
8236
8835
  *
@@ -8319,7 +8918,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8319
8918
  * @request PUT:/credit_notes/{lago_id}
8320
8919
  * @secure
8321
8920
  */
8322
- updateCreditNote: (lagoId: string, data: CreditNoteUpdateInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8921
+ updateCreditNote: (lagoId: string, data: CreditNoteUpdateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteExtended, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8323
8922
  /**
8324
8923
  * @description This endpoint retrieves an existing credit note.
8325
8924
  *
@@ -8329,7 +8928,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8329
8928
  * @request GET:/credit_notes/{lago_id}
8330
8929
  * @secure
8331
8930
  */
8332
- findCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotFound>>;
8931
+ findCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNoteExtended, ApiErrorUnauthorized | ApiErrorNotFound>>;
8333
8932
  /**
8334
8933
  * @description This endpoint downloads the PDF of an existing credit note.
8335
8934
  *
@@ -8359,7 +8958,47 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8359
8958
  * @request PUT:/credit_notes/{lago_id}/void
8360
8959
  * @secure
8361
8960
  */
8362
- voidCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
8961
+ voidCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNoteExtended, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
8962
+ /**
8963
+ * @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.
8964
+ *
8965
+ * @tags credit_notes
8966
+ * @name ReplaceCreditNoteMetadata
8967
+ * @summary Replace credit note metadata
8968
+ * @request POST:/credit_notes/{lago_id}/metadata
8969
+ * @secure
8970
+ */
8971
+ replaceCreditNoteMetadata: (lagoId: string, data: CreditNoteMetadataResponse, params?: RequestParams) => Promise<HttpResponse<CreditNoteMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
8972
+ /**
8973
+ * @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.
8974
+ *
8975
+ * @tags credit_notes
8976
+ * @name MergeCreditNoteMetadata
8977
+ * @summary Merge credit note metadata
8978
+ * @request PATCH:/credit_notes/{lago_id}/metadata
8979
+ * @secure
8980
+ */
8981
+ mergeCreditNoteMetadata: (lagoId: string, data: CreditNoteMetadataResponse, params?: RequestParams) => Promise<HttpResponse<CreditNoteMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
8982
+ /**
8983
+ * @description This endpoint removes all metadata from a credit note.
8984
+ *
8985
+ * @tags credit_notes
8986
+ * @name DeleteAllCreditNoteMetadata
8987
+ * @summary Delete all credit note metadata
8988
+ * @request DELETE:/credit_notes/{lago_id}/metadata
8989
+ * @secure
8990
+ */
8991
+ deleteAllCreditNoteMetadata: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNoteMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
8992
+ /**
8993
+ * @description This endpoint removes a single metadata key from a credit note.
8994
+ *
8995
+ * @tags credit_notes
8996
+ * @name DeleteCreditNoteMetadataKey
8997
+ * @summary Delete a metadata key
8998
+ * @request DELETE:/credit_notes/{lago_id}/metadata/{key}
8999
+ * @secure
9000
+ */
9001
+ deleteCreditNoteMetadataKey: (lagoId: string, key: string, params?: RequestParams) => Promise<HttpResponse<CreditNoteMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
8363
9002
  };
8364
9003
  customers: {
8365
9004
  /**
@@ -8860,6 +9499,47 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8860
9499
  * @secure
8861
9500
  */
8862
9501
  generateCustomerCheckoutUrl: (externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<CustomerCheckoutUrl, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
9502
+ /**
9503
+ * @description This endpoint retrieves all payment methods of a Customer.
9504
+ *
9505
+ * @tags payment_methods
9506
+ * @name FindAllCustomersPaymentMethods
9507
+ * @summary List all customer payment methods
9508
+ * @request GET:/customers/{external_customer_id}/payment_methods
9509
+ * @secure
9510
+ */
9511
+ findAllCustomersPaymentMethods: (externalCustomerId: string, query?: {
9512
+ /**
9513
+ * Page number.
9514
+ * @example 1
9515
+ */
9516
+ page?: number;
9517
+ /**
9518
+ * Number of records per page.
9519
+ * @example 20
9520
+ */
9521
+ per_page?: number;
9522
+ }, params?: RequestParams) => Promise<HttpResponse<PaymentMethodsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
9523
+ /**
9524
+ * @description Use the payment method as default when not selected a payment method
9525
+ *
9526
+ * @tags payment_methods
9527
+ * @name PaymentMethodSetAsDefault
9528
+ * @summary Set the payment method as default
9529
+ * @request PUT:/customers/{external_customer_id}/payment_methods/{lago_id}/set_as_default
9530
+ * @secure
9531
+ */
9532
+ paymentMethodSetAsDefault: (lagoId: string, externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<PaymentMethod, ApiErrorUnauthorized | ApiErrorNotFound>>;
9533
+ /**
9534
+ * @description This endpoint deletes a specific payment method for a customer.
9535
+ *
9536
+ * @tags payment_methods
9537
+ * @name DestroyPaymentMethod
9538
+ * @summary Delete a payment method
9539
+ * @request DELETE:/customers/{external_customer_id}/payment_methods/{lago_id}
9540
+ * @secure
9541
+ */
9542
+ destroyPaymentMethod: (lagoId: string, externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<PaymentMethod, ApiErrorUnauthorized | ApiErrorNotFound>>;
8863
9543
  };
8864
9544
  events: {
8865
9545
  /**
@@ -8961,7 +9641,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8961
9641
  */
8962
9642
  eventBatchEstimateInstantFees: (data: EventBatchEstimateInstantFeesInput, params?: RequestParams) => Promise<HttpResponse<FeesEstimate, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
8963
9643
  /**
8964
- * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
9644
+ * @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
9645
  *
8966
9646
  * @tags events
8967
9647
  * @name FindEvent
@@ -9303,7 +9983,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9303
9983
  * @request POST:/invoices/{lago_id}/retry_payment
9304
9984
  * @secure
9305
9985
  */
9306
- retryPayment: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
9986
+ retryPayment: (lagoId: string, data?: {
9987
+ /** Reference to a specific payment method for processing the payment. */
9988
+ payment_method?: PaymentMethodReference;
9989
+ }, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
9307
9990
  /**
9308
9991
  * @description This endpoint is used for voiding an invoice. • When no body parameters are provided, the invoice can be voided only if it is in a `finalized` status and its payment status is NOT `succeeded`. • When `generate_credit_note` is provided (optionally with `refund_amount` and/or `credit_amount`), this validation is bypassed: the invoice is forcibly voided and a credit note is generated. If the specified refund/credit amounts do not cover the full invoice total, the remainder is issued on a second credit note that is created and immediately voided.
9309
9992
  *
@@ -9594,6 +10277,46 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9594
10277
  * @secure
9595
10278
  */
9596
10279
  removeEntitlementPrivilege: (code: string, featureCode: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
10280
+ /**
10281
+ * @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.
10282
+ *
10283
+ * @tags plans
10284
+ * @name ReplacePlanMetadata
10285
+ * @summary Replace plan metadata
10286
+ * @request POST:/plans/{code}/metadata
10287
+ * @secure
10288
+ */
10289
+ replacePlanMetadata: (code: string, data: PlanMetadataResponse, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10290
+ /**
10291
+ * @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.
10292
+ *
10293
+ * @tags plans
10294
+ * @name MergePlanMetadata
10295
+ * @summary Merge plan metadata
10296
+ * @request PATCH:/plans/{code}/metadata
10297
+ * @secure
10298
+ */
10299
+ mergePlanMetadata: (code: string, data: PlanMetadataResponse, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10300
+ /**
10301
+ * @description This endpoint removes all metadata from a plan.
10302
+ *
10303
+ * @tags plans
10304
+ * @name DeleteAllPlanMetadata
10305
+ * @summary Delete all plan metadata
10306
+ * @request DELETE:/plans/{code}/metadata
10307
+ * @secure
10308
+ */
10309
+ deleteAllPlanMetadata: (code: string, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
10310
+ /**
10311
+ * @description This endpoint removes a single metadata key from a plan.
10312
+ *
10313
+ * @tags plans
10314
+ * @name DeletePlanMetadataKey
10315
+ * @summary Delete a metadata key
10316
+ * @request DELETE:/plans/{code}/metadata/{key}
10317
+ * @secure
10318
+ */
10319
+ deletePlanMetadataKey: (code: string, key: string, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
9597
10320
  };
9598
10321
  subscriptions: {
9599
10322
  /**
@@ -9746,15 +10469,25 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9746
10469
  */
9747
10470
  getSubscriptionAlerts: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Alerts, ApiErrorUnauthorized | ApiErrorNotFound>>;
9748
10471
  /**
9749
- * @description This endpoint allows you to create a new alert for a subscription.
10472
+ * @description This endpoint allows you to create alerts for a subscription. Send a single alert object wrapped in `alert` key to create one alert, or an array of alert objects wrapped in `alerts` key to create multiple alerts atomically.
9750
10473
  *
9751
10474
  * @tags subscriptions
9752
10475
  * @name CreateSubscriptionAlert
9753
- * @summary Create a subscription alert
10476
+ * @summary Create subscription alert(s)
9754
10477
  * @request POST:/subscriptions/{external_id}/alerts
9755
10478
  * @secure
9756
10479
  */
9757
- createSubscriptionAlert: (externalId: string, data: AlertCreateInput, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10480
+ createSubscriptionAlert: (externalId: string, data: AlertCreateInput | AlertBatchCreateInput, params?: RequestParams) => Promise<HttpResponse<Alerts | Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10481
+ /**
10482
+ * @description This endpoint allows you to delete all alerts for a subscription.
10483
+ *
10484
+ * @tags subscriptions
10485
+ * @name DeleteAllSubscriptionAlerts
10486
+ * @summary Delete all subscription alerts
10487
+ * @request DELETE:/subscriptions/{external_id}/alerts
10488
+ * @secure
10489
+ */
10490
+ deleteAllSubscriptionAlerts: (externalId: string, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotFound>>;
9758
10491
  /**
9759
10492
  * @description This endpoint enables the retrieval of a specific alert for a subscription.
9760
10493
  *
@@ -9825,6 +10558,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9825
10558
  * @secure
9826
10559
  */
9827
10560
  destroySubscriptionEntitlementPrivilege: (externalId: string, featureCode: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorBadRequest | ApiErrorNotFound>>;
10561
+ /**
10562
+ * @description This endpoint retrieves all fixed charges for a specific subscription.
10563
+ *
10564
+ * @tags subscriptions
10565
+ * @name FindAllSubscriptionFixedCharges
10566
+ * @summary List subscription fixed charges
10567
+ * @request GET:/subscriptions/{external_id}/fixed_charges
10568
+ * @secure
10569
+ */
10570
+ findAllSubscriptionFixedCharges: (externalId: string, params?: RequestParams) => Promise<HttpResponse<FixedCharges, ApiErrorUnauthorized | ApiErrorNotFound>>;
9828
10571
  };
9829
10572
  taxes: {
9830
10573
  /**
@@ -9956,6 +10699,46 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9956
10699
  * @secure
9957
10700
  */
9958
10701
  destroyWallet: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
10702
+ /**
10703
+ * @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.
10704
+ *
10705
+ * @tags wallets
10706
+ * @name ReplaceWalletMetadata
10707
+ * @summary Replace wallet metadata
10708
+ * @request POST:/wallets/{lago_id}/metadata
10709
+ * @secure
10710
+ */
10711
+ replaceWalletMetadata: (lagoId: string, data: WalletMetadataResponse, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10712
+ /**
10713
+ * @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.
10714
+ *
10715
+ * @tags wallets
10716
+ * @name MergeWalletMetadata
10717
+ * @summary Merge wallet metadata
10718
+ * @request PATCH:/wallets/{lago_id}/metadata
10719
+ * @secure
10720
+ */
10721
+ mergeWalletMetadata: (lagoId: string, data: WalletMetadataResponse, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10722
+ /**
10723
+ * @description This endpoint removes all metadata from a wallet.
10724
+ *
10725
+ * @tags wallets
10726
+ * @name DeleteAllWalletMetadata
10727
+ * @summary Delete all wallet metadata
10728
+ * @request DELETE:/wallets/{lago_id}/metadata
10729
+ * @secure
10730
+ */
10731
+ deleteAllWalletMetadata: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
10732
+ /**
10733
+ * @description This endpoint removes a single metadata key from a wallet.
10734
+ *
10735
+ * @tags wallets
10736
+ * @name DeleteWalletMetadataKey
10737
+ * @summary Delete a metadata key
10738
+ * @request DELETE:/wallets/{lago_id}/metadata/{key}
10739
+ * @secure
10740
+ */
10741
+ deleteWalletMetadataKey: (lagoId: string, key: string, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
9959
10742
  /**
9960
10743
  * @description This endpoint is used to list all wallet transactions.
9961
10744
  *