lago-javascript-client 1.52.1 → 1.54.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.
@@ -1,7 +1,7 @@
1
1
  /** @example "USD" */
2
- export type Currency = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SZL" | "THB" | "TJS" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW";
2
+ export type Currency = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SYP" | "SZL" | "THB" | "TJS" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW";
3
3
  /** @example "US" */
4
- export type Country = "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";
4
+ 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";
5
5
  /** @example "America/Los_Angeles" */
6
6
  export type Timezone = "UTC" | "Africa/Algiers" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Monrovia" | "Africa/Nairobi" | "America/Argentina/Buenos_Aires" | "America/Bogota" | "America/Caracas" | "America/Chicago" | "America/Chihuahua" | "America/Denver" | "America/Guatemala" | "America/Guyana" | "America/Halifax" | "America/Indiana/Indianapolis" | "America/Juneau" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Mazatlan" | "America/Mexico_City" | "America/Monterrey" | "America/Montevideo" | "America/New_York" | "America/Nuuk" | "America/Phoenix" | "America/Puerto_Rico" | "America/Regina" | "America/Santiago" | "America/Sao_Paulo" | "America/St_Johns" | "America/Tijuana" | "Asia/Almaty" | "Asia/Baghdad" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Dhaka" | "Asia/Hong_Kong" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kathmandu" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuwait" | "Asia/Magadan" | "Asia/Muscat" | "Asia/Novosibirsk" | "Asia/Riyadh" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tokyo" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yangon" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Cape_Verde" | "Atlantic/South_Georgia" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Darwin" | "Australia/Hobart" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "Europe/Amsterdam" | "Europe/Athens" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Helsinki" | "Europe/Istanbul" | "Europe/Kaliningrad" | "Europe/Kyiv" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Madrid" | "Europe/Minsk" | "Europe/Moscow" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zurich" | "GMT+12" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Chatham" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Majuro" | "Pacific/Midway" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Port_Moresby" | "Pacific/Tongatapu";
7
7
  /** Billing entity object */
@@ -70,7 +70,7 @@ export interface BillingEntityObject {
70
70
  */
71
71
  subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
72
72
  /**
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
73
+ * Whether this billing entity is the organization's default billing entity. The default billing entity is the oldest active one, and is used as a fallback whenever no billing entity is provided, for example when an invoice is created. This flag cannot be changed.
74
74
  * @example false
75
75
  */
76
76
  is_default?: boolean;
@@ -89,6 +89,11 @@ export interface BillingEntityObject {
89
89
  * @example "Suite 100"
90
90
  */
91
91
  address_line2?: string | null;
92
+ /**
93
+ * The phone number of the billing entity
94
+ * @example "1-171-883-3711 x245"
95
+ */
96
+ phone?: string | null;
92
97
  /**
93
98
  * The city of the billing address
94
99
  * @example "Woodland Hills"
@@ -100,7 +105,7 @@ export interface BillingEntityObject {
100
105
  */
101
106
  state?: string | null;
102
107
  /** The country code of the billing address */
103
- country?: Country | null;
108
+ country?: CountryOrNull;
104
109
  /**
105
110
  * The zipcode of the billing address
106
111
  * @example "91364"
@@ -139,6 +144,11 @@ export interface BillingEntityObject {
139
144
  * @example false
140
145
  */
141
146
  eu_tax_management?: boolean;
147
+ /**
148
+ * Whether e-invoicing is enabled for this billing entity
149
+ * @example false
150
+ */
151
+ einvoicing?: boolean;
142
152
  /**
143
153
  * The URL of the billing entity's logo
144
154
  * @format uri
@@ -255,6 +265,11 @@ export interface BillingEntityCreateInput {
255
265
  * @example "Suite 100"
256
266
  */
257
267
  address_line2?: string | null;
268
+ /**
269
+ * The phone number of the billing entity
270
+ * @example "1-171-883-3711 x245"
271
+ */
272
+ phone?: string | null;
258
273
  /**
259
274
  * The city of the billing address
260
275
  * @example "Woodland Hills"
@@ -266,7 +281,7 @@ export interface BillingEntityCreateInput {
266
281
  */
267
282
  state?: string | null;
268
283
  /** The country code of the billing address */
269
- country?: Country | null;
284
+ country?: CountryOrNull;
270
285
  /**
271
286
  * The zipcode of the billing address
272
287
  * @example "91364"
@@ -299,12 +314,17 @@ export interface BillingEntityCreateInput {
299
314
  */
300
315
  timezone?: Timezone;
301
316
  /** The email notification settings for this billing entity */
302
- email_settings?: ("invoice.finalized" | "credit_note.created")[];
317
+ email_settings?: ("invoice.finalized" | "credit_note.created" | "payment_receipt.created")[];
303
318
  /**
304
319
  * Whether EU tax management is enabled for this billing entity
305
320
  * @example false
306
321
  */
307
322
  eu_tax_management?: boolean;
323
+ /**
324
+ * Whether e-invoicing is enabled for this billing entity
325
+ * @example false
326
+ */
327
+ einvoicing?: boolean;
308
328
  /**
309
329
  * The base64 encoded logo image for the billing entity
310
330
  * @format uri
@@ -366,6 +386,11 @@ export interface TaxObject {
366
386
  * @example true
367
387
  */
368
388
  applied_to_organization: boolean;
389
+ /**
390
+ * The codes of the billing entities the tax is applied to, sorted alphabetically. It is empty when the tax is only attached to customers.
391
+ * @example ["acme_corp","foo_bar"]
392
+ */
393
+ applied_to_billing_entities_codes?: string[];
369
394
  /**
370
395
  * Creation date of the tax.
371
396
  * @format date-time
@@ -446,137 +471,149 @@ export interface ApiErrorNotFound {
446
471
  export type TaxCodes = string[];
447
472
  /** Billing entity update input */
448
473
  export interface BillingEntityUpdateInput {
449
- /**
450
- * The name of the billing entity
451
- * @example "Acme Corp"
452
- */
453
- name?: string;
454
- /**
455
- * The default currency of the billing entity
456
- * @example "USD"
457
- */
458
- default_currency?: Currency;
459
- /**
460
- * The type of document numbering for this billing entity:
461
- * - `per_customer`: document numbers are unique per customer
462
- * - `per_billing_entity`: document numbers are unique per billing entity
463
- */
464
- document_numbering?: "per_customer" | "per_billing_entity";
465
- /**
466
- * The prefix used in document numbers for this billing entity
467
- * @example "ABC-123"
468
- */
469
- document_number_prefix?: string | null;
470
- /**
471
- * Whether to finalize invoices with zero amount for this billing entity
472
- * @example true
473
- */
474
- finalize_zero_amount_invoice?: boolean;
475
- billing_configuration?: {
474
+ billing_entity: {
475
+ /**
476
+ * The name of the billing entity
477
+ * @example "Acme Corp"
478
+ */
479
+ name?: string;
480
+ /**
481
+ * The default currency of the billing entity
482
+ * @example "USD"
483
+ */
484
+ default_currency?: Currency;
476
485
  /**
477
- * The footer text to be displayed on invoices for this billing entity
478
- * @example "Thank you for your business"
486
+ * The type of document numbering for this billing entity:
487
+ * - `per_customer`: document numbers are unique per customer
488
+ * - `per_billing_entity`: document numbers are unique per billing entity
479
489
  */
480
- invoice_footer?: string;
490
+ document_numbering?: "per_customer" | "per_billing_entity";
481
491
  /**
482
- * The language of the documents generated for this billing entity
483
- * @example "en"
492
+ * The prefix used in document numbers for this billing entity
493
+ * @example "ABC-123"
484
494
  */
485
- document_locale?: string;
495
+ document_number_prefix?: string | null;
486
496
  /**
487
- * The grace period (in days) for invoice finalization
497
+ * Whether to finalize invoices with zero amount for this billing entity
498
+ * @example true
499
+ */
500
+ finalize_zero_amount_invoice?: boolean;
501
+ billing_configuration?: {
502
+ /**
503
+ * The footer text to be displayed on invoices for this billing entity
504
+ * @example "Thank you for your business"
505
+ */
506
+ invoice_footer?: string;
507
+ /**
508
+ * The language of the documents generated for this billing entity
509
+ * @example "en"
510
+ */
511
+ document_locale?: string;
512
+ /**
513
+ * The grace period (in days) for invoice finalization
514
+ * @example 0
515
+ */
516
+ invoice_grace_period?: number;
517
+ /**
518
+ * Defines whether the issuing date follows the current billing period's end date or the next period starting date.
519
+ * @default "next_period_start"
520
+ */
521
+ subscription_invoice_issuing_date_anchor?: "current_period_end" | "next_period_start";
522
+ /**
523
+ * 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.
524
+ * @default "align_with_finalization_date"
525
+ */
526
+ subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
527
+ };
528
+ /**
529
+ * The net payment term (in days) for this billing entity
488
530
  * @example 0
489
531
  */
490
- invoice_grace_period?: number;
532
+ net_payment_term?: number;
533
+ /**
534
+ * The first line of the billing address
535
+ * @example "5230 Penfield Ave"
536
+ */
537
+ address_line1?: string | null;
538
+ /**
539
+ * The second line of the billing address
540
+ * @example "Suite 100"
541
+ */
542
+ address_line2?: string | null;
543
+ /**
544
+ * The phone number of the billing entity
545
+ * @example "1-171-883-3711 x245"
546
+ */
547
+ phone?: string | null;
548
+ /**
549
+ * The city of the billing address
550
+ * @example "Woodland Hills"
551
+ */
552
+ city?: string | null;
553
+ /**
554
+ * The state of the billing address
555
+ * @example "CA"
556
+ */
557
+ state?: string | null;
558
+ /** The country code of the billing address */
559
+ country?: CountryOrNull;
491
560
  /**
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"
561
+ * The zipcode of the billing address
562
+ * @example "91364"
494
563
  */
495
- subscription_invoice_issuing_date_anchor?: "current_period_end" | "next_period_start";
564
+ zipcode?: string | null;
496
565
  /**
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"
566
+ * The email address of the billing entity
567
+ * @format email
568
+ * @example "billing@acme.com"
499
569
  */
500
- subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
570
+ email?: string | null;
571
+ /**
572
+ * The legal name of the billing entity
573
+ * @example "Acme Corporation"
574
+ */
575
+ legal_name?: string | null;
576
+ /**
577
+ * The legal registration number of the billing entity
578
+ * @example "US123456789"
579
+ */
580
+ legal_number?: string | null;
581
+ /**
582
+ * The tax identification number of the billing entity
583
+ * @example "EU123456789"
584
+ */
585
+ tax_identification_number?: string | null;
586
+ /**
587
+ * The timezone of the billing entity
588
+ * @example "UTC"
589
+ */
590
+ timezone?: Timezone;
591
+ /** The tax codes that should be associated with this billing entity */
592
+ tax_codes?: TaxCodes;
593
+ /** The email notification settings for this billing entity */
594
+ email_settings?: ("invoice.finalized" | "credit_note.created" | "payment_receipt.created")[];
595
+ /**
596
+ * Whether EU tax management is enabled for this billing entity
597
+ * @example false
598
+ */
599
+ eu_tax_management?: boolean;
600
+ /**
601
+ * Whether e-invoicing is enabled for this billing entity
602
+ * @example false
603
+ */
604
+ einvoicing?: boolean;
605
+ /**
606
+ * The base64 encoded logo image for the billing entity. Sending "null" will remove the logo, if any exist.
607
+ * @format uri
608
+ * @example "data:image/png;base64,..."
609
+ */
610
+ logo?: string | null;
611
+ /**
612
+ * The codes of the invoice custom section that should be associated with this billing entity
613
+ * @example ["custom_section_1","custom_section_2"]
614
+ */
615
+ invoice_custom_section_codes?: string[];
501
616
  };
502
- /**
503
- * The net payment term (in days) for this billing entity
504
- * @example 0
505
- */
506
- net_payment_term?: number;
507
- /**
508
- * The first line of the billing address
509
- * @example "5230 Penfield Ave"
510
- */
511
- address_line1?: string | null;
512
- /**
513
- * The second line of the billing address
514
- * @example "Suite 100"
515
- */
516
- address_line2?: string | null;
517
- /**
518
- * The city of the billing address
519
- * @example "Woodland Hills"
520
- */
521
- city?: string | null;
522
- /**
523
- * The state of the billing address
524
- * @example "CA"
525
- */
526
- state?: string | null;
527
- /** The country code of the billing address */
528
- country?: Country | null;
529
- /**
530
- * The zipcode of the billing address
531
- * @example "91364"
532
- */
533
- zipcode?: string | null;
534
- /**
535
- * The email address of the billing entity
536
- * @format email
537
- * @example "billing@acme.com"
538
- */
539
- email?: string | null;
540
- /**
541
- * The legal name of the billing entity
542
- * @example "Acme Corporation"
543
- */
544
- legal_name?: string | null;
545
- /**
546
- * The legal registration number of the billing entity
547
- * @example "US123456789"
548
- */
549
- legal_number?: string | null;
550
- /**
551
- * The tax identification number of the billing entity
552
- * @example "EU123456789"
553
- */
554
- tax_identification_number?: string | null;
555
- /**
556
- * The timezone of the billing entity
557
- * @example "UTC"
558
- */
559
- timezone?: Timezone;
560
- /** The tax codes that should be associated with this billing entity */
561
- tax_codes?: TaxCodes;
562
- /** The email notification settings for this billing entity */
563
- email_settings?: ("invoice.finalized" | "credit_note.created")[];
564
- /**
565
- * Whether EU tax management is enabled for this billing entity
566
- * @example false
567
- */
568
- eu_tax_management?: boolean;
569
- /**
570
- * The base64 encoded logo image for the billing entity. Sending "null" will remove the logo, if any exist.
571
- * @format uri
572
- * @example "data:image/png;base64,..."
573
- */
574
- logo?: string | null;
575
- /**
576
- * The codes of the invoice custom section that should be associated with this billing entity
577
- * @example ["custom_section_1","custom_section_2"]
578
- */
579
- invoice_custom_section_codes?: string[];
580
617
  }
581
618
  export interface ActivityLogObject {
582
619
  /**
@@ -867,6 +904,12 @@ export interface GrossRevenueObject {
867
904
  * @example 10
868
905
  */
869
906
  invoices_count: number;
907
+ /**
908
+ * Unique identifier assigned to the billing entity the revenue is attributed to, created by Lago.
909
+ * @format uuid
910
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
911
+ */
912
+ billing_entity_id: string;
870
913
  }
871
914
  export interface GrossRevenues {
872
915
  gross_revenues: GrossRevenueObject[];
@@ -967,10 +1010,18 @@ export interface OverdueBalanceObject {
967
1010
  * @example ["5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"]
968
1011
  */
969
1012
  lago_invoice_ids: string[];
1013
+ /**
1014
+ * Unique identifier assigned to the billing entity the overdue balance is attributed to, created by Lago.
1015
+ * @format uuid
1016
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1017
+ */
1018
+ billing_entity_id: string;
970
1019
  }
971
1020
  export interface OverdueBalances {
972
1021
  overdue_balances: OverdueBalanceObject[];
973
1022
  }
1023
+ /** @example "US" */
1024
+ export type Country = "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";
974
1025
  export interface UsageObject {
975
1026
  /**
976
1027
  * The unique identifier of the organization for which the usage analytics is calculated.
@@ -1021,7 +1072,7 @@ export interface Usages {
1021
1072
  usages: UsageObject[];
1022
1073
  }
1023
1074
  /** @example "USD" */
1024
- export type CurrencyOrNull = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SZL" | "THB" | "TJS" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW";
1075
+ export type CurrencyOrNull = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SYP" | "SZL" | "THB" | "TJS" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW";
1025
1076
  export interface AppliedCouponObject {
1026
1077
  /**
1027
1078
  * Unique identifier of the applied coupon, created by Lago.
@@ -1045,6 +1096,11 @@ export interface AppliedCouponObject {
1045
1096
  * @example "Startup Deal"
1046
1097
  */
1047
1098
  coupon_name: string;
1099
+ /**
1100
+ * The description of the parent coupon.
1101
+ * @example "I am a coupon description"
1102
+ */
1103
+ coupon_description?: string | null;
1048
1104
  /**
1049
1105
  * The status of the parent coupon. Can be either `active` or `terminated`.
1050
1106
  * @example "active"
@@ -2083,6 +2139,12 @@ export interface FeeObject {
2083
2139
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2084
2140
  */
2085
2141
  lago_true_up_parent_fee_id?: string | null;
2142
+ /**
2143
+ * Unique identifier assigned to the fee this fee was derived from. It is set on fees regenerated from an existing fee, and `null` otherwise.
2144
+ * @format uuid
2145
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2146
+ */
2147
+ lago_original_fee_id?: string | null;
2086
2148
  /**
2087
2149
  * Unique identifier assigned to the subscription, created by Lago. This field is specifically displayed when the fee type is charge or subscription.
2088
2150
  * @format uuid
@@ -2256,12 +2318,12 @@ export interface FeeObject {
2256
2318
  /** Item attached to the fee */
2257
2319
  item: {
2258
2320
  /**
2259
- * The fee type. Possible values are `add-on`, `charge`, `fixed_charge`, `credit`, `subscription` or `commitment`.
2321
+ * The fee type. Possible values are `add_on`, `charge`, `fixed_charge`, `credit`, `subscription` or `commitment`.
2260
2322
  * @example "subscription"
2261
2323
  */
2262
2324
  type: "charge" | "fixed_charge" | "add_on" | "subscription" | "credit" | "commitment";
2263
2325
  /**
2264
- * 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`.
2326
+ * 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`.
2265
2327
  * @example "startup"
2266
2328
  */
2267
2329
  code: string;
@@ -2269,7 +2331,7 @@ export interface FeeObject {
2269
2331
  * The name of the fee item. The value depends on the type of the fee item:
2270
2332
  *
2271
2333
  * - If the fee item is a `charge`, it is the billable metric name.
2272
- * - If the fee item is a `add-on`, it is the add-on name.
2334
+ * - If the fee item is an `add_on`, it is the add-on name.
2273
2335
  * - If the fee item is a `credit`, it is the wallet transaction name if set, or `"credit"` if not.
2274
2336
  * - If the fee item is a `fixed_charge`, it is the fixed charge add-on name.
2275
2337
  * - For all the other fee items, it is the subscription plan name.
@@ -2280,7 +2342,7 @@ export interface FeeObject {
2280
2342
  * The description of the fee item. The value depends on the type of the fee item:
2281
2343
  *
2282
2344
  * - If the fee item is a `charge`, it is the billable metric description.
2283
- * - If the fee item is a `add-on`, it is the add-on description.
2345
+ * - If the fee item is an `add_on`, it is the add-on description.
2284
2346
  * - If the fee item is a `credit`, it is always `"credit"`.
2285
2347
  * - If the fee item is a `fixed_charge`, it is the fixed charge add-on description.
2286
2348
  * - For all the other fee items, it is the subscription plan description.
@@ -2291,7 +2353,7 @@ export interface FeeObject {
2291
2353
  * Specifies the name that will be displayed on an invoice. If no value is set for this field, we'll fallback to a value that depends on the type of the fee items:
2292
2354
  *
2293
2355
  * - If the fee item is a `charge`, we'll fallback to the `invoice_display_name` of the `charge` or the billable metric name if no `invoice_display_name` is set.
2294
- * - If the fee item is a `add-on`, we'll fallback to the `invoice_name` of the `add-on` or the `name` of the `add-on`.
2356
+ * - If the fee item is an `add_on`, we'll fallback to the `invoice_name` of the `add_on` or the `name` of the `add_on`.
2295
2357
  * - If the fee item is a `credit`, we'll fallback to the wallet transaction name if set, or `credit` if not.
2296
2358
  * - If the fee item is a `fixed_charge`, we'll fallback to the `invoice_display_name` of the `fixed_charge` or the `invoice_name` of the `fixed_charge_add_on` if no `invoice_display_name` is set.
2297
2359
  * - For all the other fee items, we'll fallback to the `invoice_display_name` of the subscription plan.
@@ -2306,7 +2368,7 @@ export interface FeeObject {
2306
2368
  /** Key value list of event properties */
2307
2369
  filters?: object | null;
2308
2370
  /**
2309
- * Unique identifier of the fee item, created by Lago. It can be the identifier of the `add-on`, the `charge`, the `credit`, the `subscription` or the `commitment`.
2371
+ * Unique identifier of the fee item, created by Lago. It can be the identifier of the `add_on`, the `charge`, the `credit`, the `subscription` or the `commitment`.
2310
2372
  * @format uuid
2311
2373
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2312
2374
  */
@@ -2356,8 +2418,6 @@ export type CreditNoteAppliedTaxObject = BaseAppliedTax & {
2356
2418
  /** @example 100 */
2357
2419
  base_amount_cents?: number;
2358
2420
  };
2359
- /** @example "US" */
2360
- 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";
2361
2421
  /** @example "America/Los_Angeles" */
2362
2422
  export type TimezoneOrNull = "UTC" | "Africa/Algiers" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Monrovia" | "Africa/Nairobi" | "America/Argentina/Buenos_Aires" | "America/Bogota" | "America/Caracas" | "America/Chicago" | "America/Chihuahua" | "America/Denver" | "America/Godthab" | "America/Guatemala" | "America/Guyana" | "America/Halifax" | "America/Indiana/Indianapolis" | "America/Juneau" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Mazatlan" | "America/Mexico_City" | "America/Monterrey" | "America/Montevideo" | "America/New_York" | "America/Phoenix" | "America/Puerto_Rico" | "America/Regina" | "America/Santiago" | "America/Sao_Paulo" | "America/St_Johns" | "America/Tijuana" | "Asia/Almaty" | "Asia/Baghdad" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Dhaka" | "Asia/Hong_Kong" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kathmandu" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuwait" | "Asia/Magadan" | "Asia/Muscat" | "Asia/Novosibirsk" | "Asia/Rangoon" | "Asia/Riyadh" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tokyo" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Cape_Verde" | "Atlantic/South_Georgia" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Darwin" | "Australia/Hobart" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "Europe/Amsterdam" | "Europe/Athens" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Helsinki" | "Europe/Istanbul" | "Europe/Kaliningrad" | "Europe/Kiev" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Madrid" | "Europe/Minsk" | "Europe/Moscow" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zurich" | "GMT+12" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Chatham" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Majuro" | "Pacific/Midway" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Port_Moresby" | "Pacific/Tongatapu";
2363
2423
  /** 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. */
@@ -2381,10 +2441,10 @@ export interface CustomerBillingConfiguration {
2381
2441
  subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
2382
2442
  /**
2383
2443
  * The payment provider utilized to initiate payments for invoices issued by Lago.
2384
- * Accepted values: `stripe`, `adyen`, `gocardless` or null. This field is required if you intend to assign a `provider_customer_id`.
2444
+ * Accepted values: `stripe`, `adyen`, `cashfree`, `flutterwave`, `gocardless`, `moneyhash` or null. This field is required if you intend to assign a `provider_customer_id`.
2385
2445
  * @example "stripe"
2386
2446
  */
2387
- payment_provider?: "stripe" | "adyen" | "gocardless";
2447
+ payment_provider?: "stripe" | "adyen" | "cashfree" | "flutterwave" | "gocardless" | "moneyhash";
2388
2448
  /**
2389
2449
  * Unique code used to identify a payment provider connection.
2390
2450
  * @example "stripe-eu-1"
@@ -2487,7 +2547,7 @@ export interface CustomerBaseObject {
2487
2547
  */
2488
2548
  lago_id: string;
2489
2549
  /**
2490
- * The unique identifier assigned to the customer within the organization's scope. This identifier is used to track and reference the customer's order of creation within the organization's system. It ensures that each customer has a distinct `sequential_id`` associated with them, allowing for easy identification and sorting based on the order of creation
2550
+ * The unique identifier assigned to the customer within the organization's scope. This identifier is used to track and reference the customer's order of creation within the organization's system. It ensures that each customer has a distinct `sequential_id` associated with them, allowing for easy identification and sorting based on the order of creation
2491
2551
  * @example 1
2492
2552
  */
2493
2553
  sequential_id: number;
@@ -2614,6 +2674,11 @@ export interface CustomerBaseObject {
2614
2674
  * @example 30
2615
2675
  */
2616
2676
  net_payment_term?: number | null;
2677
+ /**
2678
+ * The customer ID within the Salesforce system
2679
+ * @example "0015p00001JQx1QAAT"
2680
+ */
2681
+ external_salesforce_id?: string | null;
2617
2682
  /**
2618
2683
  * The date of the customer creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the customer object was created
2619
2684
  * @format date-time
@@ -2654,8 +2719,8 @@ export interface IntegrationCustomer {
2654
2719
  */
2655
2720
  lago_id: string;
2656
2721
  /**
2657
- * The integration type used for accounting and tax syncs.
2658
- * Accepted values: `netsuite, anrok`.
2722
+ * The integration type used for accounting, tax and CRM syncs.
2723
+ * Accepted values: `netsuite`, `anrok`, `xero`, `hubspot`, `salesforce`.
2659
2724
  * @example "netsuite"
2660
2725
  */
2661
2726
  type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
@@ -2797,11 +2862,21 @@ export interface CreditNoteObject {
2797
2862
  * @example 120
2798
2863
  */
2799
2864
  total_amount_cents: number;
2865
+ /**
2866
+ * The total amount of the credit note, expressed in cents, with precision.
2867
+ * @example "120.0001"
2868
+ */
2869
+ precise_total_amount_cents?: string | null;
2800
2870
  /**
2801
2871
  * The tax amount of the credit note, expressed in cents.
2802
2872
  * @example 20
2803
2873
  */
2804
2874
  taxes_amount_cents: number;
2875
+ /**
2876
+ * The tax amount of the credit note, expressed in cents, with precision.
2877
+ * @example "20.0001"
2878
+ */
2879
+ precise_taxes_amount_cents?: string | null;
2805
2880
  /**
2806
2881
  * The tax rate associated with this specific credit note.
2807
2882
  * @example 20
@@ -2828,7 +2903,7 @@ export interface CreditNoteObject {
2828
2903
  */
2829
2904
  refund_amount_cents: number;
2830
2905
  /**
2831
- * The ofsetted amount (deducted from the invoice balance) of the credit note, expressed in cents.
2906
+ * The offset amount (deducted from the invoice balance) of the credit note, expressed in cents.
2832
2907
  * @example 0
2833
2908
  */
2834
2909
  offset_amount_cents: number;
@@ -2850,10 +2925,15 @@ export interface CreditNoteObject {
2850
2925
  */
2851
2926
  updated_at: string;
2852
2927
  /**
2853
- * The PDF file of the credit note.
2928
+ * The PDF file of the credit note. It is `null` while no PDF has been generated.
2854
2929
  * @example "https://getlago.com/credit_note/file"
2855
2930
  */
2856
2931
  file_url?: string | null;
2932
+ /**
2933
+ * The e-invoicing XML file of the credit note. It is `null` while no XML file has been generated.
2934
+ * @example "https://getlago.com/credit_note/xml"
2935
+ */
2936
+ xml_url?: string | null;
2857
2937
  /** Array of credit note's items. */
2858
2938
  items?: CreditNoteItemObject[];
2859
2939
  applied_taxes?: CreditNoteAppliedTaxObject[];
@@ -2899,17 +2979,17 @@ export interface CreditNoteCreateInput {
2899
2979
  */
2900
2980
  description?: string;
2901
2981
  /**
2902
- * 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.”
2982
+ * 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.
2903
2983
  * @example 100
2904
2984
  */
2905
2985
  credit_amount_cents?: number | null;
2906
2986
  /**
2907
- * 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.”
2987
+ * 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.
2908
2988
  * @example 500
2909
2989
  */
2910
2990
  refund_amount_cents?: number | null;
2911
2991
  /**
2912
- * 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.”
2992
+ * 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.
2913
2993
  * @example 200
2914
2994
  */
2915
2995
  offset_amount_cents?: number | null;
@@ -3144,9 +3224,9 @@ export type CustomerObjectExtended = CustomerObject & {
3144
3224
  metadata?: CustomerMetadata[];
3145
3225
  /** List of customer taxes */
3146
3226
  taxes?: TaxObject[];
3147
- /** The customer’s invoice custom section used for generating invoices. */
3227
+ /** The customer's invoice custom sections used for generating invoices. */
3148
3228
  applicable_invoice_custom_sections?: InvoiceCustomSectionObject[];
3149
- /** List of errors with details that might have been raised while processing backgroud actions for the customers */
3229
+ /** List of errors with details that might have been raised while processing background actions for the customer */
3150
3230
  error_details?: ErrorDetailObject[];
3151
3231
  };
3152
3232
  export interface CustomersPaginated {
@@ -3228,6 +3308,8 @@ export interface CustomerCreateInput {
3228
3308
  * The type of the account. It can have one of the following values:
3229
3309
  * - `customer`: the account is a customer, default value.
3230
3310
  * - `partner`: the account is a partner.
3311
+ *
3312
+ * This field is only applied when revenue share is enabled on your organization; otherwise it is ignored.
3231
3313
  * @example "customer"
3232
3314
  */
3233
3315
  account_type?: "customer" | "partner";
@@ -3271,6 +3353,11 @@ export interface CustomerCreateInput {
3271
3353
  * @example 30
3272
3354
  */
3273
3355
  net_payment_term?: number | null;
3356
+ /**
3357
+ * The customer ID within the Salesforce system
3358
+ * @example "0015p00001JQx1QAAT"
3359
+ */
3360
+ external_salesforce_id?: string | null;
3274
3361
  /**
3275
3362
  * Specifies how invoices with a zero total amount should be handled:
3276
3363
  * - `inherit`: (Default) Follows the organization-level configuration.
@@ -3291,11 +3378,11 @@ export interface CustomerCreateInput {
3291
3378
  */
3292
3379
  id?: string;
3293
3380
  /**
3294
- * The integration type used for accounting and tax syncs.
3295
- * Accepted values: `netsuite, anrok, xero`.
3381
+ * The integration type used for accounting, tax and CRM syncs.
3382
+ * Accepted values: `netsuite`, `anrok`, `avalara`, `xero`, `hubspot`, `salesforce`.
3296
3383
  * @example "netsuite"
3297
3384
  */
3298
- integration_type?: "netsuite" | "anrok" | "xero";
3385
+ integration_type?: "netsuite" | "anrok" | "avalara" | "xero" | "hubspot" | "salesforce";
3299
3386
  /**
3300
3387
  * Unique code used to identify an integration connection.
3301
3388
  * @example "netsuite-eu-1"
@@ -3315,7 +3402,12 @@ export interface CustomerCreateInput {
3315
3402
  * This optional field is needed only when working with `netsuite` connection.
3316
3403
  * @example "2"
3317
3404
  */
3318
- subsidiary_id?: string;
3405
+ subsidiary_id?: string;
3406
+ /**
3407
+ * This optional field is needed only when working with `hubspot` connection.
3408
+ * @example "contacts"
3409
+ */
3410
+ targeted_object?: string | null;
3319
3411
  }[];
3320
3412
  /** Set of key-value pairs that you can attach to a customer. This can be useful for storing additional information about the customer in a structured format */
3321
3413
  metadata?: {
@@ -3339,7 +3431,7 @@ export interface CustomerCreateInput {
3339
3431
  * Determines whether the item or information should be displayed in the invoice. If set to true, the item or information will be included and visible in the generated invoice. If set to false, the item or information will be excluded and not displayed in the invoice.
3340
3432
  * @example true
3341
3433
  */
3342
- display_in_invoice: boolean;
3434
+ display_in_invoice?: boolean;
3343
3435
  }[];
3344
3436
  /**
3345
3437
  * Set to `true` to exclude all invoice custom sections from PDF generation for this customer only. False by default
@@ -3390,17 +3482,17 @@ export interface InvoiceBaseObject {
3390
3482
  */
3391
3483
  issuing_date: string;
3392
3484
  /**
3393
- * The date when the payment dispute was lost. It is expressed in Coordinated Universal Time (UTC).
3485
+ * The date when the payment dispute was lost. It is expressed in Coordinated Universal Time (UTC). It is `null` until a dispute is lost on the invoice.
3394
3486
  * @format date-time
3395
3487
  * @example "2022-09-14T16:35:31Z"
3396
3488
  */
3397
- payment_dispute_lost_at?: string;
3489
+ payment_dispute_lost_at?: string | null;
3398
3490
  /**
3399
3491
  * The payment due date for the invoice, specified in the ISO 8601 date format.
3400
3492
  * @format date
3401
3493
  * @example "2022-04-30"
3402
3494
  */
3403
- payment_due_date?: string;
3495
+ payment_due_date?: string | null;
3404
3496
  /**
3405
3497
  * Specifies if the payment is considered as overdue.
3406
3498
  * @example true
@@ -3412,10 +3504,10 @@ export interface InvoiceBaseObject {
3412
3504
  */
3413
3505
  net_payment_term?: number;
3414
3506
  /**
3415
- * The type of invoice issued. Possible values are `subscription`, `one-off`, `credit` or `progressive_billing`.
3507
+ * The type of invoice issued. Possible values are `subscription`, `add_on`, `credit`, `one_off`, `advance_charges` or `progressive_billing`.
3416
3508
  * @example "subscription"
3417
3509
  */
3418
- invoice_type: "subscription" | "add_on" | "credit" | "one_off" | "progressive_billing";
3510
+ invoice_type: "subscription" | "add_on" | "credit" | "one_off" | "advance_charges" | "progressive_billing";
3419
3511
  /**
3420
3512
  * The status of the invoice. It indicates the current state of the invoice and can have following values:
3421
3513
  * - `draft`: the invoice is in the draft state, waiting for the end of the grace period to be finalized. During this period, events can still be ingested and added to the invoice.
@@ -3503,6 +3595,21 @@ export interface InvoiceBaseObject {
3503
3595
  * @example 100
3504
3596
  */
3505
3597
  total_amount_cents: number;
3598
+ /**
3599
+ * The amount already paid on the invoice, expressed in cents.
3600
+ * @example 40
3601
+ */
3602
+ total_paid_amount_cents?: number;
3603
+ /**
3604
+ * The amount of the invoice settled by finalized credit notes, expressed in cents.
3605
+ * @example 10
3606
+ */
3607
+ total_offsetted_credit_note_amount_cents?: number;
3608
+ /**
3609
+ * The amount still due on the invoice, expressed in cents. It is equal to `total_amount_cents` minus `total_paid_amount_cents` and `total_offsetted_credit_note_amount_cents`, and is `0` for voided invoices.
3610
+ * @example 50
3611
+ */
3612
+ total_due_amount_cents?: number;
3506
3613
  /** @example 3 */
3507
3614
  version_number: number;
3508
3615
  /**
@@ -3511,11 +3618,17 @@ export interface InvoiceBaseObject {
3511
3618
  */
3512
3619
  self_billed?: boolean;
3513
3620
  /**
3514
- * Contains the URL that provides direct access to the invoice PDF file. You can use this URL to download or view the PDF document of the invoice
3621
+ * Contains the URL that provides direct access to the invoice PDF file. You can use this URL to download or view the PDF document of the invoice. It is `null` while no PDF has been generated, which is the case for draft invoices.
3515
3622
  * @format uri
3516
3623
  * @example "https://getlago.com/invoice/file"
3517
3624
  */
3518
- file_url?: string;
3625
+ file_url?: string | null;
3626
+ /**
3627
+ * Contains the URL that provides direct access to the e-invoicing XML file. It is `null` while no XML file has been generated for the invoice.
3628
+ * @format uri
3629
+ * @example "https://getlago.com/invoice/xml"
3630
+ */
3631
+ xml_url?: string | null;
3519
3632
  /**
3520
3633
  * Contains the URL to the invoice page in the Lago dashboard. It is `null` for invoices that are not visible in the dashboard (for example while still generating). Use it to link users directly to the invoice overview page.
3521
3634
  * @format uri
@@ -3534,6 +3647,12 @@ export interface InvoiceBaseObject {
3534
3647
  * @example "2022-04-29T08:59:51Z"
3535
3648
  */
3536
3649
  updated_at: string;
3650
+ /**
3651
+ * The date when the invoice was voided, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). It is `null` for invoices that have not been voided.
3652
+ * @format date-time
3653
+ * @example "2022-04-29T08:59:51Z"
3654
+ */
3655
+ voided_at?: string | null;
3537
3656
  }
3538
3657
  export interface InvoiceMetadataObject {
3539
3658
  /**
@@ -3691,7 +3810,7 @@ export interface PaymentObject {
3691
3810
  /** List of invoice IDs associated with the payment. */
3692
3811
  invoice_ids: string[];
3693
3812
  /** List of invoice numbers associated with the payment. */
3694
- invoice_numbers?: string[];
3813
+ invoice_numbers: string[];
3695
3814
  /**
3696
3815
  * The unique identifier of the paid resource, created by Lago.
3697
3816
  * @format uuid
@@ -3729,15 +3848,15 @@ export interface PaymentObject {
3729
3848
  */
3730
3849
  type: "manual" | "provider";
3731
3850
  /**
3732
- * Reference for the payment.
3851
+ * Reference for the payment. Set on manual payments only; it is always `null` for payments collected through a payment provider.
3733
3852
  * @example "ref1"
3734
3853
  */
3735
- reference: string;
3854
+ reference: string | null;
3736
3855
  /**
3737
- * Code of the payment provider
3856
+ * Code of the payment provider. It is `null` for manual payments, which are not attached to a payment provider.
3738
3857
  * @example "stripe_prod"
3739
3858
  */
3740
- payment_provider_code: string;
3859
+ payment_provider_code: string | null;
3741
3860
  /**
3742
3861
  * The type of payment provider
3743
3862
  * @example "stripe"
@@ -3751,16 +3870,10 @@ export interface PaymentObject {
3751
3870
  */
3752
3871
  provider_payment_id: string | null;
3753
3872
  /**
3754
- * Unique identifier of the customer within the payment provider
3873
+ * Unique identifier of the customer within the payment provider. It is `null` for manual payments.
3755
3874
  * @example "cus_5eb0285bcf941bc6ba"
3756
3875
  */
3757
- provider_customer_id: string;
3758
- /**
3759
- * The unique identifier of the payment method used for this payment.
3760
- * @format uuid
3761
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3762
- */
3763
- payment_method_id?: string | null;
3876
+ provider_customer_id: string | null;
3764
3877
  /**
3765
3878
  * 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.
3766
3879
  * @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"}}
@@ -3785,11 +3898,11 @@ export interface PaymentRequestObject {
3785
3898
  */
3786
3899
  lago_id: string;
3787
3900
  /**
3788
- * The customer's email address used for sending dunning notifications
3901
+ * The email address used for sending dunning notifications. It defaults to the customer's own email address, and is `null` when the customer has none.
3789
3902
  * @format email
3790
3903
  * @example "dinesh@piedpiper.test"
3791
3904
  */
3792
- email: string;
3905
+ email: string | null;
3793
3906
  /**
3794
3907
  * The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
3795
3908
  * @example 100
@@ -4264,7 +4377,7 @@ export interface WalletObject {
4264
4377
  */
4265
4378
  code?: string | null;
4266
4379
  /**
4267
- * 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.
4380
+ * 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. Wallets with the same priority are applied by expiration date, soonest first, with wallets without an expiration date last, then by creation date, oldest first.
4268
4381
  * @min 1
4269
4382
  * @max 50
4270
4383
  * @example 50
@@ -4408,7 +4521,7 @@ export interface InvoiceCustomSectionInput {
4408
4521
  invoice_custom_section_codes?: string[];
4409
4522
  }
4410
4523
  export interface WalletCreateInput {
4411
- wallet?: {
4524
+ wallet: {
4412
4525
  /**
4413
4526
  * The name of the wallet.
4414
4527
  * @example "Prepaid"
@@ -4420,7 +4533,7 @@ export interface WalletCreateInput {
4420
4533
  */
4421
4534
  code?: string | null;
4422
4535
  /**
4423
- * 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.
4536
+ * 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. Wallets with the same priority are applied by expiration date, soonest first, with wallets without an expiration date last, then by creation date, oldest first.
4424
4537
  * @min 1
4425
4538
  * @max 50
4426
4539
  * @example 50
@@ -4480,6 +4593,13 @@ export interface WalletCreateInput {
4480
4593
  * @example "Tokens for models 'high-fidelity-boost'"
4481
4594
  */
4482
4595
  transaction_name?: string | null;
4596
+ /**
4597
+ * The priority of the wallet transactions triggered when creating the wallet. It drives the order in which credits are consumed. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
4598
+ * @min 1
4599
+ * @max 50
4600
+ * @example 50
4601
+ */
4602
+ transaction_priority?: number;
4483
4603
  /**
4484
4604
  * The purchase order number associated with the wallet. It will be added to invoices generated for wallet top-ups, unless a more specific purchase order number is set on the wallet transaction or recurring transaction rule that triggered the top-up.
4485
4605
  * @example "PO-123"
@@ -4539,7 +4659,7 @@ export interface WalletUpdateInput {
4539
4659
  */
4540
4660
  code?: string | null;
4541
4661
  /**
4542
- * 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.
4662
+ * 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. Wallets with the same priority are applied by expiration date, soonest first, with wallets without an expiration date last, then by creation date, oldest first.
4543
4663
  * @min 1
4544
4664
  * @max 50
4545
4665
  * @example 50
@@ -4556,6 +4676,16 @@ export interface WalletUpdateInput {
4556
4676
  * @example false
4557
4677
  */
4558
4678
  invoice_requires_successful_payment?: boolean;
4679
+ /**
4680
+ * Minimum amount of cents that can be top-up with a single paid transaction.
4681
+ * @example 100
4682
+ */
4683
+ paid_top_up_min_amount_cents?: number | null;
4684
+ /**
4685
+ * Maximum amount of cents that can be top-up with a single paid transaction.
4686
+ * @example 1000
4687
+ */
4688
+ paid_top_up_max_amount_cents?: number | null;
4559
4689
  /**
4560
4690
  * The code of the billing entity associated with the wallet.
4561
4691
  * @example "default"
@@ -4580,7 +4710,7 @@ export interface WalletUpdateInput {
4580
4710
  * The trigger. Possible values are `interval` or `threshold`.
4581
4711
  * @example "interval"
4582
4712
  */
4583
- trigger?: "interval" | "threshold";
4713
+ trigger: "interval" | "threshold";
4584
4714
  /**
4585
4715
  * The method used for recurring top-up. Possible values are `fixed` or `target`.
4586
4716
  * @example "target"
@@ -4704,6 +4834,8 @@ export interface AlertThresholdBaseObject {
4704
4834
  export type AlertThresholdObject = AlertThresholdBaseObject & {
4705
4835
  /**
4706
4836
  * A value that should trigger this alert, formatted as a BigDecimal.
4837
+ *
4838
+ * The unit depends on the alert type: `billable_metric_current_usage_units` and `billable_metric_lifetime_usage_units` are expressed in units, `wallet_credits_balance` and `wallet_credits_ongoing_balance` in credits, and all other types in cents.
4707
4839
  * @pattern ^[0-9]+.?[0-9]*$
4708
4840
  * @example "99.0"
4709
4841
  */
@@ -4781,6 +4913,8 @@ export interface WalletAlerts {
4781
4913
  export type AlertThresholdInput = AlertThresholdBaseObject & {
4782
4914
  /**
4783
4915
  * A value that should trigger this alert. This can be an integer or a string formatted as a BigDecimal.
4916
+ *
4917
+ * The unit depends on the alert type: `billable_metric_current_usage_units` and `billable_metric_lifetime_usage_units` are expressed in units, `wallet_credits_balance` and `wallet_credits_ongoing_balance` in credits, and all other types in cents.
4784
4918
  * @example 99
4785
4919
  */
4786
4920
  value: number | string;
@@ -4880,23 +5014,23 @@ export type CustomerChargeFiltersUsageObject = {
4880
5014
  * @pattern ^[0-9]+.?[0-9]*$
4881
5015
  * @example "0.9"
4882
5016
  */
4883
- units?: string;
5017
+ units: string;
4884
5018
  /**
4885
5019
  * The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
4886
5020
  * @pattern ^[0-9]+.?[0-9]*$
4887
5021
  * @example "1.0"
4888
5022
  */
4889
- total_aggregated_units?: string;
5023
+ total_aggregated_units: string;
4890
5024
  /**
4891
5025
  * The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
4892
5026
  * @example 1000
4893
5027
  */
4894
- amount_cents?: number;
5028
+ amount_cents: number;
4895
5029
  /**
4896
5030
  * The quantity of usage events that have been recorded for a particular charge filter during the specified time period. These events may also be referred to as the number of transactions in some contexts.
4897
5031
  * @example 10
4898
5032
  */
4899
- events_count?: number;
5033
+ events_count: number;
4900
5034
  /**
4901
5035
  * Specifies the name that will be displayed on an invoice.
4902
5036
  * @example "AWS eu-east-1"
@@ -4908,7 +5042,7 @@ export type CustomerChargeFiltersUsageObject = {
4908
5042
  * List of filter values applied to the usage.
4909
5043
  * @example {"region":["us-east-1"]}
4910
5044
  */
4911
- values?: Record<string, string[]>;
5045
+ values: Record<string, string[]>;
4912
5046
  /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
4913
5047
  presentation_breakdowns?: PresentationBreakdownsObject;
4914
5048
  }[];
@@ -4918,28 +5052,28 @@ export type CustomerChargeGroupedUsageObject = {
4918
5052
  * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
4919
5053
  * @example 1000
4920
5054
  */
4921
- amount_cents?: number;
5055
+ amount_cents: number;
4922
5056
  /**
4923
5057
  * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
4924
5058
  * @example 10
4925
5059
  */
4926
- events_count?: number;
5060
+ events_count: number;
4927
5061
  /**
4928
5062
  * The number of units consumed for a specific group related to a charge item.
4929
5063
  * @pattern ^[0-9]+.?[0-9]*$
4930
5064
  * @example "0.9"
4931
5065
  */
4932
- units?: string;
5066
+ units: string;
4933
5067
  /**
4934
5068
  * The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
4935
5069
  * @pattern ^[0-9]+.?[0-9]*$
4936
5070
  * @example "1.0"
4937
5071
  */
4938
- total_aggregated_units?: string;
5072
+ total_aggregated_units: string;
4939
5073
  /** Details about the pricing unit used for charge usage. */
4940
5074
  pricing_unit_details?: UsagePricingUnitDetailsObject;
4941
5075
  /** Key value list of event properties aggregated by the charge model */
4942
- grouped_by?: Record<string, string>;
5076
+ grouped_by: Record<string, string>;
4943
5077
  /** Array of filter object, representing multiple dimensions for a charge item. */
4944
5078
  filters?: CustomerChargeFiltersUsageObject;
4945
5079
  /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
@@ -5083,28 +5217,28 @@ export type CustomerProjectedChargeFiltersUsageObject = {
5083
5217
  * @pattern ^[0-9]+.?[0-9]*$
5084
5218
  * @example "0.9"
5085
5219
  */
5086
- units?: string;
5220
+ units: string;
5087
5221
  /**
5088
5222
  * The projected number of units that can be consumed for a specific charge filter related to a charge item.
5089
5223
  * @pattern ^[0-9]+.?[0-9]*$
5090
5224
  * @example "1.8"
5091
5225
  */
5092
- projected_units?: string;
5226
+ projected_units: string;
5093
5227
  /**
5094
5228
  * The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
5095
5229
  * @example 1000
5096
5230
  */
5097
- amount_cents?: number;
5231
+ amount_cents: number;
5098
5232
  /**
5099
5233
  * The projected amount in cents, tax excluded, that can be consumed for a specific charge filter related to a charge item.
5100
5234
  * @example 2000
5101
5235
  */
5102
- projected_amount_cents?: number;
5236
+ projected_amount_cents: number;
5103
5237
  /**
5104
5238
  * The quantity of usage events that have been recorded for a particular charge filter during the specified time period. These events may also be referred to as the number of transactions in some contexts.
5105
5239
  * @example 10
5106
5240
  */
5107
- events_count?: number;
5241
+ events_count: number;
5108
5242
  /**
5109
5243
  * Specifies the name that will be displayed on an invoice.
5110
5244
  * @example "AWS eu-east-1"
@@ -5116,7 +5250,7 @@ export type CustomerProjectedChargeFiltersUsageObject = {
5116
5250
  * List of filter values applied to the usage.
5117
5251
  * @example {"region":["us-east-1"]}
5118
5252
  */
5119
- values?: Record<string, string[]>;
5253
+ values: Record<string, string[]>;
5120
5254
  /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
5121
5255
  presentation_breakdowns?: PresentationBreakdownsObject;
5122
5256
  /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
@@ -5128,33 +5262,33 @@ export type CustomerProjectedChargeGroupedUsageObject = {
5128
5262
  * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
5129
5263
  * @example 1000
5130
5264
  */
5131
- amount_cents?: number;
5265
+ amount_cents: number;
5132
5266
  /**
5133
5267
  * The projected amount in cents, tax excluded, that can be consumed for a specific group related to a charge item.
5134
5268
  * @example 2000
5135
5269
  */
5136
- projected_amount_cents?: number;
5270
+ projected_amount_cents: number;
5137
5271
  /**
5138
5272
  * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
5139
5273
  * @example 10
5140
5274
  */
5141
- events_count?: number;
5275
+ events_count: number;
5142
5276
  /**
5143
5277
  * The number of units consumed for a specific group related to a charge item.
5144
5278
  * @pattern ^[0-9]+.?[0-9]*$
5145
5279
  * @example "0.9"
5146
5280
  */
5147
- units?: string;
5281
+ units: string;
5148
5282
  /**
5149
5283
  * The projected number of units that can be consumed for a specific group related to a charge item.
5150
5284
  * @pattern ^[0-9]+.?[0-9]*$
5151
5285
  * @example "1.8"
5152
5286
  */
5153
- projected_units?: string;
5287
+ projected_units: string;
5154
5288
  /** Details about the pricing unit used for charge usage. */
5155
5289
  pricing_unit_details?: UsagePricingUnitDetailsObject;
5156
5290
  /** Key value list of event properties aggregated by the charge model */
5157
- grouped_by?: Record<string, string>;
5291
+ grouped_by: Record<string, string>;
5158
5292
  /** Array of filter object, representing multiple dimensions for a charge item. */
5159
5293
  filters?: CustomerProjectedChargeFiltersUsageObject;
5160
5294
  /** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
@@ -5352,14 +5486,14 @@ export interface PaymentMethodObject {
5352
5486
  * Code of the payment provider associated with this payment method.
5353
5487
  * @example "stripe_prod"
5354
5488
  */
5355
- payment_provider_code?: string | null;
5489
+ payment_provider_code: string | null;
5356
5490
  /**
5357
5491
  * Human-readable name of the payment provider.
5358
5492
  * @example "Stripe"
5359
5493
  */
5360
- payment_provider_name?: string | null;
5494
+ payment_provider_name: string | null;
5361
5495
  /**
5362
- * The type of the payment provider.
5496
+ * The type of the payment provider. It is `null` when the payment method is no longer attached to a payment provider.
5363
5497
  * @example "stripe"
5364
5498
  */
5365
5499
  payment_provider_type: "adyen" | "cashfree" | "gocardless" | "stripe" | "flutterwave" | "moneyhash";
@@ -5483,7 +5617,18 @@ export interface EventInputObject {
5483
5617
  * This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required.
5484
5618
  * @example {"gb":10}
5485
5619
  */
5486
- properties?: object | null;
5620
+ properties?: {
5621
+ /**
5622
+ * The code of the wallet targeted by this event for prepaid credits deduction.
5623
+ * When provided, credits are drawn from this specific wallet instead of following the standard wallet selection logic.
5624
+ * If the code does not match an existing wallet, no credits will be applied for the event.
5625
+ * This field is only taken into account when the targeted charge has `accepts_target_wallet` set to `true`.
5626
+ * This field requires a premium integration.
5627
+ * @example "main_wallet"
5628
+ */
5629
+ target_wallet_code?: string | null;
5630
+ [key: string]: any;
5631
+ };
5487
5632
  }
5488
5633
  export interface EventInput {
5489
5634
  event: EventInputObject;
@@ -5521,8 +5666,19 @@ export interface EventEstimateFeesInput {
5521
5666
  * @example "sub_1234567890"
5522
5667
  */
5523
5668
  external_subscription_id: string;
5524
- /** This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. */
5525
- properties?: object;
5669
+ /** This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. Any property of the targeted billable metric can be sent here, in addition to the documented fields below. */
5670
+ properties?: {
5671
+ /**
5672
+ * The code of the wallet targeted by this event for prepaid credits deduction.
5673
+ * When provided, credits are drawn from this specific wallet instead of following the standard wallet selection logic.
5674
+ * If the code does not match an existing wallet, no credits will be applied for the event.
5675
+ * This field is only taken into account when the targeted charge has `accepts_target_wallet` set to `true`.
5676
+ * This field requires a premium integration.
5677
+ * @example "main_wallet"
5678
+ */
5679
+ target_wallet_code?: string | null;
5680
+ [key: string]: any;
5681
+ };
5526
5682
  };
5527
5683
  }
5528
5684
  export interface Fees {
@@ -5770,6 +5926,12 @@ export interface InvoiceOneOffCreateInput {
5770
5926
  * @example "EUR"
5771
5927
  */
5772
5928
  currency?: Currency;
5929
+ /**
5930
+ * If true, the invoice will be created but not sent to the payment provider.
5931
+ * @default false
5932
+ * @example true
5933
+ */
5934
+ skip_psp?: boolean | null;
5773
5935
  /**
5774
5936
  * The purchase order number to associate with the invoice.
5775
5937
  * @example "PO-123"
@@ -5792,14 +5954,14 @@ export interface InvoiceOneOffCreateInput {
5792
5954
  */
5793
5955
  unit_amount_cents?: number | null;
5794
5956
  /**
5795
- * The quantity of units associated with the fee. By default, only 1 unit is added to the invoice.
5957
+ * The quantity of units associated with the fee. Accepts a number or a string formatted as a BigDecimal. By default, only 1 unit is added to the invoice.
5796
5958
  * @pattern ^[0-9]+.?[0-9]*$
5797
5959
  * @example "2.5"
5798
5960
  */
5799
- units?: string | null;
5961
+ units?: string | number | null;
5800
5962
  /**
5801
- * This is a description
5802
- * @example "The description of the fee line item in the invoice. By default, the description of the add-on is used."
5963
+ * The description of the fee line item in the invoice. By default, the description of the add-on is used.
5964
+ * @example "Onboarding session, June 2024"
5803
5965
  */
5804
5966
  description?: string | null;
5805
5967
  /**
@@ -5816,12 +5978,6 @@ export interface InvoiceOneOffCreateInput {
5816
5978
  to_datetime?: string;
5817
5979
  /** List of unique code used to identify the taxes. */
5818
5980
  tax_codes?: TaxCodes;
5819
- /**
5820
- * If true, the invoice will be created but not sent to the payment provider.
5821
- * @default false
5822
- * @example true
5823
- */
5824
- skip_psp?: boolean | null;
5825
5981
  }[];
5826
5982
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
5827
5983
  invoice_custom_section?: InvoiceCustomSectionInput;
@@ -6720,174 +6876,72 @@ export interface QuoteBillingItemWalletCreditObject {
6720
6876
  /**
6721
6877
  * The codes of the billable metrics the credits can be spent on.
6722
6878
  * @example ["api_calls"]
6723
- */
6724
- billableMetricCodes?: any[] | null;
6725
- };
6726
- /** The rule automatically topping the wallet up. At most one rule is allowed, and its `trigger` is required, to approve the version. */
6727
- recurringTransactionRules?: any[] | null;
6728
- };
6729
- }
6730
- /**
6731
- * A snapshot of everything the quote bills. Unlike the rest of the Lago API, the keys nested in this object are camelCased: the object is stored and returned as it is authored in the Lago user interface.
6732
- *
6733
- * Which top-level keys are present depends on the `order_type` of the parent quote:
6734
- * - `one_off`: `addOns`.
6735
- * - `subscription_creation` and `subscription_amendment`: `plans`, plus the optional `coupons` and `walletCredits`.
6736
- *
6737
- * Every entry pins the catalog record it was built from through its `id` and its `payload`, so that an approved quote keeps billing what was approved even if the catalog changes afterwards. The optional `overrides` object carries the deviations from that record negotiated on the quote.
6738
- *
6739
- * This object is the single source of truth for the term of the deal. Three of its nested dates bound that term, because the execution flow refuses them once past: `plans[].payload.endDate`, `walletCredits[].payload.expirationAt` and the `expirationAt` of a wallet credit's recurring top-up rule. The earliest of them is the day the deal stops being executable, and both the signing window and the execution date must fall strictly before it. A `one_off` quote carries none of them and is never bounded.
6740
- *
6741
- * On a `draft` version this object may be incomplete: only the properties documented as required below are enforced on every save, the others are enforced when the version is approved.
6742
- */
6743
- export interface QuoteBillingItems {
6744
- /** The add-ons billed once by a `one_off` quote. At least one entry is required to approve the version. */
6745
- addOns?: QuoteBillingItemAddOnObject[];
6746
- /** The plans subscribed to, or amended, by a `subscription_creation` or `subscription_amendment` quote. At least one entry is required to approve the version. */
6747
- plans?: QuoteBillingItemPlanObject[];
6748
- /** The coupons applied to the customer when the quote is executed. */
6749
- coupons?: QuoteBillingItemCouponObject[];
6750
- /** The prepaid credit wallets created for the customer when the quote is executed. */
6751
- walletCredits?: QuoteBillingItemWalletCreditObject[];
6752
- }
6753
- export type OrderObjectExtended = OrderObject & {
6754
- /** The billing items of the quote version the order comes from, as they stood when it was approved. This is what the execution applies. It is omitted from the webhook payloads, being a heavy blob. */
6755
- billing_snapshot: QuoteBillingItems;
6756
- };
6757
- export interface OrdersPaginated {
6758
- orders: OrderObjectExtended[];
6759
- meta: PaginationMeta;
6760
- }
6761
- export interface Order {
6762
- order: OrderObjectExtended;
6763
- }
6764
- /** Parameters available when executing an order. The body is optional, as the execution mode is normally chosen when the order form is signed. */
6765
- export interface OrderExecuteInput {
6766
- order?: {
6767
- /** How the order is carried out. It is only persisted when it differs from the mode already stored on the order, so restating the current mode never fails. Changing the mode of an order that has already been executed is rejected. */
6768
- execution_mode?: OrderExecutionModeEnum;
6769
- };
6770
- }
6771
- /** The custom billing settings for your organization. */
6772
- export interface OrganizationBillingConfiguration {
6773
- /**
6774
- * The customer invoice message that appears at the bottom of each billing documents.
6775
- * @example "This is my customer footer"
6776
- */
6777
- invoice_footer?: string | null;
6778
- /**
6779
- * The grace period, expressed in days, for finalizing the invoice. This period refers to the additional time granted to your customers beyond the invoice due date to adjust usage and line items. Can be overwritten by the customer's grace period.
6780
- * @example 3
6781
- */
6782
- invoice_grace_period?: number;
6783
- /**
6784
- * The locale of the billing documents, expressed in the ISO 639-1 format. This field indicates the language or regional variant used for the documents content issued or the embeddable customer portal.
6785
- * @example "en"
6786
- */
6787
- document_locale?: string;
6788
- }
6789
- export interface OrganizationUpdateInput {
6790
- organization: {
6791
- /**
6792
- * The URL of your newest updated webhook endpoint. This URL allows your organization to receive important messages, notifications, or data from the Lago system. By configuring your webhook endpoint to this URL, you can ensure that your organization stays informed and receives relevant information in a timely manner.
6793
- * @example "https://webhook.brex.com"
6794
- */
6795
- webhook_url?: string | null;
6796
- /**
6797
- * The country of your organization.
6798
- * @example "US"
6799
- */
6800
- country?: CountryOrNull;
6801
- /**
6802
- * The default currency of an organization.
6803
- * @example "USD"
6804
- */
6805
- default_currency?: Currency;
6806
- /**
6807
- * The first line of your organization's billing address.
6808
- * @example "100 Brex Street"
6809
- */
6810
- address_line1?: string | null;
6811
- /**
6812
- * The second line of your organization's billing address.
6813
- * @example null
6814
- */
6815
- address_line2?: string | null;
6816
- /**
6817
- * The state of your organization's billing address.
6818
- * @example "NYC"
6819
- */
6820
- state?: string | null;
6821
- /**
6822
- * The zipcode of your organization's billing address.
6823
- * @example "10000"
6824
- */
6825
- zipcode?: string | null;
6826
- /**
6827
- * The email address of your organization used to bill your customers.
6828
- * @format email
6829
- * @example "brex@brex.com"
6830
- */
6831
- email?: string | null;
6832
- /**
6833
- * The city of your organization's billing address.
6834
- * @example "New York"
6835
- */
6836
- city?: string | null;
6837
- /**
6838
- * The legal name of your organization.
6839
- * @example null
6840
- */
6841
- legal_name?: string | null;
6842
- /**
6843
- * The legal number of your organization.
6844
- * @example null
6845
- */
6846
- legal_number?: string | null;
6847
- /**
6848
- * This parameter configures the method of incrementing invoice numbers for your customers.
6849
- *
6850
- * - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern.
6851
- * - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month.
6852
- *
6853
- * The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer.
6854
- * @example "per_customer"
6855
- */
6856
- document_numbering?: "per_customer" | "per_organization";
6857
- /**
6858
- * Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago.
6859
- * @example "ORG-1234"
6860
- */
6861
- document_number_prefix?: string;
6862
- /**
6863
- * The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
6864
- * @example 30
6865
- */
6866
- net_payment_term?: number;
6867
- /**
6868
- * The tax identification number of your organization.
6869
- * @example "US123456789"
6870
- */
6871
- tax_identification_number?: string | null;
6872
- /**
6873
- * Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone.
6874
- * @example "America/New_York"
6875
- */
6876
- timezone?: Timezone;
6877
- /**
6878
- * Represents the email settings of the organization. It allows you to define which documents are sent by email. The field value determines the types of documents that trigger email notifications. Possible values for are `invoice.finalized` and `credit_note.created`. By configuring this field, you can specify whether invoices, credit notes, or both should be sent to recipients via email.
6879
- * @example ["invoice.finalized","credit_note.created"]
6880
- */
6881
- email_settings?: ("invoice.finalized" | "credit_note.created")[];
6882
- /** The custom billing settings for your organization. */
6883
- billing_configuration?: OrganizationBillingConfiguration;
6884
- /**
6885
- * Determines whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
6886
- * @example false
6887
- */
6888
- finalize_zero_amount_invoice?: boolean;
6879
+ */
6880
+ billableMetricCodes?: any[] | null;
6881
+ };
6882
+ /** The rule automatically topping the wallet up. At most one rule is allowed, and its `trigger` is required, to approve the version. */
6883
+ recurringTransactionRules?: any[] | null;
6884
+ };
6885
+ }
6886
+ /**
6887
+ * A snapshot of everything the quote bills. Unlike the rest of the Lago API, the keys nested in this object are camelCased: the object is stored and returned as it is authored in the Lago user interface.
6888
+ *
6889
+ * Which top-level keys are present depends on the `order_type` of the parent quote:
6890
+ * - `one_off`: `addOns`.
6891
+ * - `subscription_creation` and `subscription_amendment`: `plans`, plus the optional `coupons` and `walletCredits`.
6892
+ *
6893
+ * Every entry pins the catalog record it was built from through its `id` and its `payload`, so that an approved quote keeps billing what was approved even if the catalog changes afterwards. The optional `overrides` object carries the deviations from that record negotiated on the quote.
6894
+ *
6895
+ * This object is the single source of truth for the term of the deal. Three of its nested dates bound that term, because the execution flow refuses them once past: `plans[].payload.endDate`, `walletCredits[].payload.expirationAt` and the `expirationAt` of a wallet credit's recurring top-up rule. The earliest of them is the day the deal stops being executable, and both the signing window and the execution date must fall strictly before it. A `one_off` quote carries none of them and is never bounded.
6896
+ *
6897
+ * On a `draft` version this object may be incomplete: only the properties documented as required below are enforced on every save, the others are enforced when the version is approved.
6898
+ */
6899
+ export interface QuoteBillingItems {
6900
+ /** The add-ons billed once by a `one_off` quote. At least one entry is required to approve the version. */
6901
+ addOns?: QuoteBillingItemAddOnObject[];
6902
+ /** The plans subscribed to, or amended, by a `subscription_creation` or `subscription_amendment` quote. At least one entry is required to approve the version. */
6903
+ plans?: QuoteBillingItemPlanObject[];
6904
+ /** The coupons applied to the customer when the quote is executed. */
6905
+ coupons?: QuoteBillingItemCouponObject[];
6906
+ /** The prepaid credit wallets created for the customer when the quote is executed. */
6907
+ walletCredits?: QuoteBillingItemWalletCreditObject[];
6908
+ }
6909
+ export type OrderObjectExtended = OrderObject & {
6910
+ /** The billing items of the quote version the order comes from, as they stood when it was approved. This is what the execution applies. It is omitted from the webhook payloads, being a heavy blob. */
6911
+ billing_snapshot: QuoteBillingItems;
6912
+ };
6913
+ export interface OrdersPaginated {
6914
+ orders: OrderObjectExtended[];
6915
+ meta: PaginationMeta;
6916
+ }
6917
+ export interface Order {
6918
+ order: OrderObjectExtended;
6919
+ }
6920
+ /** Parameters available when executing an order. The body is optional, as the execution mode is normally chosen when the order form is signed. */
6921
+ export interface OrderExecuteInput {
6922
+ order?: {
6923
+ /** How the order is carried out. It is only persisted when it differs from the mode already stored on the order, so restating the current mode never fails. Changing the mode of an order that has already been executed is rejected. */
6924
+ execution_mode?: OrderExecutionModeEnum;
6889
6925
  };
6890
6926
  }
6927
+ /** The custom billing settings for your organization. */
6928
+ export interface OrganizationBillingConfiguration {
6929
+ /**
6930
+ * The customer invoice message that appears at the bottom of each billing documents.
6931
+ * @example "This is my customer footer"
6932
+ */
6933
+ invoice_footer?: string | null;
6934
+ /**
6935
+ * The grace period, expressed in days, for finalizing the invoice. This period refers to the additional time granted to your customers beyond the invoice due date to adjust usage and line items. Can be overwritten by the customer's grace period.
6936
+ * @example 3
6937
+ */
6938
+ invoice_grace_period?: number;
6939
+ /**
6940
+ * The locale of the billing documents, expressed in the ISO 639-1 format. This field indicates the language or regional variant used for the documents content issued or the embeddable customer portal.
6941
+ * @example "en"
6942
+ */
6943
+ document_locale?: string;
6944
+ }
6891
6945
  export interface OrganizationObject {
6892
6946
  /**
6893
6947
  * Unique identifier assigned to the organization within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the organization's record within the Lago system
@@ -6900,6 +6954,11 @@ export interface OrganizationObject {
6900
6954
  * @example "Name1"
6901
6955
  */
6902
6956
  name: string;
6957
+ /**
6958
+ * A concise and unique identifier for your organization, formed by combining the organization's `name` and `id`.
6959
+ * @example "NAME1-1234"
6960
+ */
6961
+ slug?: string;
6903
6962
  /**
6904
6963
  * The date of creation of your organization, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
6905
6964
  * @format date-time
@@ -6997,6 +7056,11 @@ export interface OrganizationObject {
6997
7056
  * @example "America/New_York"
6998
7057
  */
6999
7058
  timezone?: Timezone;
7059
+ /**
7060
+ * Represents the email settings of the organization. It allows you to define which documents are sent by email. The field value determines the types of documents that trigger email notifications. Possible values are `invoice.finalized`, `credit_note.created` and `payment_receipt.created`.
7061
+ * @example ["invoice.finalized","credit_note.created"]
7062
+ */
7063
+ email_settings: ("invoice.finalized" | "credit_note.created" | "payment_receipt.created")[];
7000
7064
  /** The custom billing settings for your organization. */
7001
7065
  billing_configuration: OrganizationBillingConfiguration;
7002
7066
  /** List of default organization taxes */
@@ -7012,6 +7076,113 @@ export interface OrganizationObject {
7012
7076
  export interface Organization {
7013
7077
  organization: OrganizationObject;
7014
7078
  }
7079
+ export interface OrganizationUpdateInput {
7080
+ organization: {
7081
+ /**
7082
+ * The URL of your newest updated webhook endpoint. This URL allows your organization to receive important messages, notifications, or data from the Lago system. By configuring your webhook endpoint to this URL, you can ensure that your organization stays informed and receives relevant information in a timely manner.
7083
+ * @example "https://webhook.brex.com"
7084
+ */
7085
+ webhook_url?: string | null;
7086
+ /**
7087
+ * The country of your organization.
7088
+ * @example "US"
7089
+ */
7090
+ country?: CountryOrNull;
7091
+ /**
7092
+ * The default currency of an organization.
7093
+ * @example "USD"
7094
+ */
7095
+ default_currency?: Currency;
7096
+ /**
7097
+ * The first line of your organization's billing address.
7098
+ * @example "100 Brex Street"
7099
+ */
7100
+ address_line1?: string | null;
7101
+ /**
7102
+ * The second line of your organization's billing address.
7103
+ * @example null
7104
+ */
7105
+ address_line2?: string | null;
7106
+ /**
7107
+ * The state of your organization's billing address.
7108
+ * @example "NYC"
7109
+ */
7110
+ state?: string | null;
7111
+ /**
7112
+ * The zipcode of your organization's billing address.
7113
+ * @example "10000"
7114
+ */
7115
+ zipcode?: string | null;
7116
+ /**
7117
+ * The email address of your organization used to bill your customers.
7118
+ * @format email
7119
+ * @example "brex@brex.com"
7120
+ */
7121
+ email?: string | null;
7122
+ /**
7123
+ * The city of your organization's billing address.
7124
+ * @example "New York"
7125
+ */
7126
+ city?: string | null;
7127
+ /**
7128
+ * The legal name of your organization.
7129
+ * @example null
7130
+ */
7131
+ legal_name?: string | null;
7132
+ /**
7133
+ * The legal number of your organization.
7134
+ * @example null
7135
+ */
7136
+ legal_number?: string | null;
7137
+ /**
7138
+ * This parameter configures the method of incrementing invoice numbers for your customers.
7139
+ *
7140
+ * - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern.
7141
+ * - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month.
7142
+ *
7143
+ * The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer.
7144
+ * @example "per_customer"
7145
+ */
7146
+ document_numbering?: "per_customer" | "per_organization";
7147
+ /**
7148
+ * Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago.
7149
+ * @example "ORG-1234"
7150
+ */
7151
+ document_number_prefix?: string;
7152
+ /**
7153
+ * The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
7154
+ * @example 30
7155
+ */
7156
+ net_payment_term?: number;
7157
+ /**
7158
+ * The tax identification number of your organization.
7159
+ * @example "US123456789"
7160
+ */
7161
+ tax_identification_number?: string | null;
7162
+ /**
7163
+ * Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone.
7164
+ * @example "America/New_York"
7165
+ */
7166
+ timezone?: Timezone;
7167
+ /**
7168
+ * Represents the email settings of the organization. It allows you to define which documents are sent by email. The field value determines the types of documents that trigger email notifications. Possible values are `invoice.finalized`, `credit_note.created` and `payment_receipt.created`.
7169
+ * @example ["invoice.finalized","credit_note.created"]
7170
+ */
7171
+ email_settings?: ("invoice.finalized" | "credit_note.created" | "payment_receipt.created")[];
7172
+ /** The custom billing settings for your organization. */
7173
+ billing_configuration?: OrganizationBillingConfiguration;
7174
+ /**
7175
+ * Determines whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
7176
+ * @example false
7177
+ */
7178
+ finalize_zero_amount_invoice?: boolean;
7179
+ /**
7180
+ * A concise and unique identifier for your organization, used as a prefix in customer slugs.
7181
+ * @example "NAME1-1234"
7182
+ */
7183
+ slug?: string;
7184
+ };
7185
+ }
7015
7186
  export interface PaymentReceiptObject {
7016
7187
  /**
7017
7188
  * Unique identifier of the payment receipt, created by Lago.
@@ -7030,6 +7201,16 @@ export interface PaymentReceiptObject {
7030
7201
  * @example "LAG-1234-001-002"
7031
7202
  */
7032
7203
  number: string;
7204
+ /**
7205
+ * The PDF file of the payment receipt. It is `null` while no PDF has been generated.
7206
+ * @example "https://getlago.com/payment_receipt/file"
7207
+ */
7208
+ file_url?: string | null;
7209
+ /**
7210
+ * The e-invoicing XML file of the payment receipt. It is `null` while no XML file has been generated.
7211
+ * @example "https://getlago.com/payment_receipt/xml"
7212
+ */
7213
+ xml_url?: string | null;
7033
7214
  payment: PaymentObject;
7034
7215
  }
7035
7216
  export interface PaymentReceiptsPaginated {
@@ -7047,11 +7228,11 @@ export interface PaymentRequestCreateInput {
7047
7228
  */
7048
7229
  external_customer_id: string;
7049
7230
  /**
7050
- * The customer's email address used for sending dunning notifications
7231
+ * The email address used for sending dunning notifications. When omitted, the customer's own email address is used.
7051
7232
  * @format email
7052
7233
  * @example "dinesh@piedpiper.test"
7053
7234
  */
7054
- email: string;
7235
+ email?: string;
7055
7236
  /** A list of Lago IDs for the customer's overdue invoices to start the dunning process */
7056
7237
  lago_invoice_ids: string[];
7057
7238
  /** Optional payment method to use for processing the payment request. */
@@ -7075,6 +7256,7 @@ export interface PaymentCreateInput {
7075
7256
  amount_cents: number;
7076
7257
  /**
7077
7258
  * Reference for the payment
7259
+ * @maxLength 40
7078
7260
  * @example "ref1"
7079
7261
  */
7080
7262
  reference: string;
@@ -7420,6 +7602,8 @@ export interface ChargeObject {
7420
7602
  };
7421
7603
  /**
7422
7604
  * Specifies whether the charge accepts a target wallet for prepaid credits deduction.
7605
+ * When `true`, events may include a `target_wallet_code` in their `properties` to direct credit deduction to a specific wallet.
7606
+ * This field requires a premium integration.
7423
7607
  * @example false
7424
7608
  */
7425
7609
  accepts_target_wallet?: boolean | null;
@@ -8293,6 +8477,16 @@ export type ChargeInput = ChargeOverridableInput & {
8293
8477
  * @example false
8294
8478
  */
8295
8479
  prorated?: boolean;
8480
+ /**
8481
+ * Specifies whether the charge accepts a target wallet for prepaid credits deduction.
8482
+ * When set to `true`, events may include a `target_wallet_code` in their `properties` to direct credit deduction to a specific wallet.
8483
+ * If no `target_wallet_code` is provided on the event, the standard wallet selection logic is applied.
8484
+ * If the `target_wallet_code` does not match an existing wallet, no credits will be applied for that event.
8485
+ *
8486
+ * This field requires a premium integration.
8487
+ * @example false
8488
+ */
8489
+ accepts_target_wallet?: boolean | null;
8296
8490
  };
8297
8491
  export interface ChargeCreateInput {
8298
8492
  charge: ChargeInput & {
@@ -9161,7 +9355,7 @@ export interface AlertObject {
9161
9355
  * The type of alert.
9162
9356
  * @example "billable_metric_current_usage_amount"
9163
9357
  */
9164
- alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
9358
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount" | "billable_metric_lifetime_usage_units";
9165
9359
  /**
9166
9360
  * Unique code used to identify the alert.
9167
9361
  * @example "storage_threshold_alert"
@@ -9207,7 +9401,7 @@ export interface AlertCreateInput {
9207
9401
  * The type of alert.
9208
9402
  * @example "billable_metric_current_usage_amount"
9209
9403
  */
9210
- alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
9404
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount" | "billable_metric_lifetime_usage_units";
9211
9405
  /**
9212
9406
  * Unique code used to identify the alert.
9213
9407
  * @example "storage_threshold_alert"
@@ -9227,7 +9421,7 @@ export interface AlertBatchCreateInput {
9227
9421
  * The type of alert.
9228
9422
  * @example "billable_metric_current_usage_amount"
9229
9423
  */
9230
- alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
9424
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount" | "billable_metric_lifetime_usage_units";
9231
9425
  /**
9232
9426
  * Unique code used to identify the alert.
9233
9427
  * @example "storage_threshold_alert"
@@ -9329,7 +9523,7 @@ export interface TaxBaseInput {
9329
9523
  */
9330
9524
  rate?: string;
9331
9525
  /**
9332
- * Internal description of the taxe
9526
+ * Internal description of the tax
9333
9527
  * @example "French standard VAT"
9334
9528
  */
9335
9529
  description?: string | null;
@@ -9382,6 +9576,19 @@ export interface WalletTransactionCreateInput {
9382
9576
  * @example "5.0"
9383
9577
  */
9384
9578
  voided_credits?: string | null;
9579
+ /**
9580
+ * Unique identifier of the inbound wallet transaction to void. Only available on traceable wallets, and the target transaction must still have a remaining amount.
9581
+ * @format uuid
9582
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
9583
+ */
9584
+ voided_transaction_id?: string | null;
9585
+ /**
9586
+ * The priority of the wallet transaction. It drives the order in which credits are consumed. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
9587
+ * @min 1
9588
+ * @max 50
9589
+ * @example 50
9590
+ */
9591
+ priority?: number;
9385
9592
  /**
9386
9593
  * A boolean setting that, when set to true, delays issuing an invoice for a wallet top-up until a successful payment is made; if false, the invoice is issued immediately upon wallet top-up, regardless of the payment status. Default value of false.
9387
9594
  * @example false
@@ -9421,6 +9628,11 @@ export interface WalletTransactionObject {
9421
9628
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
9422
9629
  */
9423
9630
  lago_wallet_id: string;
9631
+ /**
9632
+ * The code of the billing entity associated with the wallet transaction. Falls back to the wallet's billing entity when the transaction does not carry one.
9633
+ * @example "default"
9634
+ */
9635
+ billing_entity_code?: string;
9424
9636
  /**
9425
9637
  * Unique identifier assigned to the invoice associated with this wallet transaction. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system.
9426
9638
  * @format uuid
@@ -9784,7 +9996,7 @@ export interface TriggeredAlertObject {
9784
9996
  * The type of alert triggered.
9785
9997
  * @example "billable_metric_current_usage_amount"
9786
9998
  */
9787
- alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
9999
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount" | "billable_metric_lifetime_usage_units" | "wallet_balance_amount" | "wallet_credits_balance" | "wallet_ongoing_balance_amount" | "wallet_credits_ongoing_balance";
9788
10000
  /**
9789
10001
  * Unique code used to identify the alert triggered.
9790
10002
  * @example "storage_threshold_alert"
@@ -9814,7 +10026,7 @@ export interface TriggeredAlertObject {
9814
10026
  /** Array of thresholds crossed. All the recurring threshold values are present. */
9815
10027
  crossed_thresholds: AlertThresholdObject[];
9816
10028
  }
9817
- export interface CustomerIntegratrionErrorObject {
10029
+ export interface CustomerIntegrationErrorObject {
9818
10030
  /**
9819
10031
  * 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.
9820
10032
  * @format uuid
@@ -10200,7 +10412,6 @@ export interface WalletTransactionPaymentFailureObject {
10200
10412
  payment_provider_code?: string;
10201
10413
  provider_error?: string | Record<string, any>;
10202
10414
  }
10203
- export type CustomerPaymentProvidernErrorObject = CustomerPaymentProviderErrorObject;
10204
10415
  export type QueryParamsType = Record<string | number, any>;
10205
10416
  export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
10206
10417
  export interface FullRequestParams extends Omit<RequestInit, "body"> {
@@ -10261,7 +10472,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
10261
10472
  }
10262
10473
  /**
10263
10474
  * @title Lago API documentation
10264
- * @version 1.52.0
10475
+ * @version 1.54.0
10265
10476
  * @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
10266
10477
  * @baseUrl https://api.getlago.com/api/v1
10267
10478
  * @externalDocs https://github.com/getlago
@@ -10292,7 +10503,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10292
10503
  * @request POST:/billing_entities
10293
10504
  * @secure
10294
10505
  */
10295
- createBillingEntity: (data: BillingEntityCreateInput, params?: RequestParams) => Promise<HttpResponse<BillingEntityObject, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
10506
+ createBillingEntity: (data: BillingEntityCreateInput, params?: RequestParams) => Promise<HttpResponse<{
10507
+ /** Billing entity object */
10508
+ billing_entity: BillingEntityObject;
10509
+ }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
10296
10510
  /**
10297
10511
  * @description This endpoint returns a specific billing entity by its code
10298
10512
  *
@@ -10314,7 +10528,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10314
10528
  * @request PUT:/billing_entities/{code}
10315
10529
  * @secure
10316
10530
  */
10317
- updateBillingEntity: (code: string, data: BillingEntityUpdateInput, params?: RequestParams) => Promise<HttpResponse<BillingEntityObjectExtended, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10531
+ updateBillingEntity: (code: string, data: BillingEntityUpdateInput, params?: RequestParams) => Promise<HttpResponse<{
10532
+ billing_entity: BillingEntityObjectExtended;
10533
+ }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10318
10534
  };
10319
10535
  activityLogs: {
10320
10536
  /**
@@ -11015,9 +11231,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11015
11231
  currency?: string;
11016
11232
  /** Filter credit notes by reasons. Possible values are `product_unsatisfactory`, `order_change`, `order_cancellation`, `fraudulent_charge`, `duplicated_charge` or `other`. */
11017
11233
  reason?: "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "duplicated_charge" | "other";
11018
- /** Filter credit notes by credit status. Possible values are `available`, `consumed` or `voided`. */
11234
+ /** Filter credit notes by credit status. Possible values are `available`, `consumed` or `voided`. */
11019
11235
  credit_status?: "available" | "consumed" | "voided";
11020
- /** Filter credit notes by refund status. Possible values are `pending`, `succeeded` or `failed`. */
11236
+ /** Filter credit notes by refund status. Possible values are `pending`, `succeeded` or `failed`. */
11021
11237
  refund_status?: "pending" | "succeeded" | "failed";
11022
11238
  /**
11023
11239
  * Filter credit notes by their related invoice number.
@@ -11039,6 +11255,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11039
11255
  * @example 100000
11040
11256
  */
11041
11257
  amount_to?: number;
11258
+ /**
11259
+ * Filter credit notes by the kind of amount they carry. `credit` matches credit notes with a credited amount, `refund` those with a refunded amount and `offset` those with an amount deducted from the invoice balance. A credit note can match several types.
11260
+ * @example ["credit","refund"]
11261
+ */
11262
+ "types[]"?: ("credit" | "refund" | "offset")[];
11042
11263
  /**
11043
11264
  * Filter credit notes belonging to a self billed invoice. Possible values are `true` or `false`.
11044
11265
  * @example true
@@ -11172,6 +11393,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11172
11393
  * @example 20
11173
11394
  */
11174
11395
  per_page?: number;
11396
+ /**
11397
+ * Filter customers by external ID.
11398
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
11399
+ */
11400
+ external_id?: string;
11175
11401
  /**
11176
11402
  * Filter customers by account type.
11177
11403
  * @example ["customer","partner"]
@@ -11484,6 +11710,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11484
11710
  * @example 20
11485
11711
  */
11486
11712
  per_page?: number;
11713
+ /**
11714
+ * Filter the results by currency, expressed as an ISO 4217 code.
11715
+ * @example "EUR"
11716
+ */
11717
+ currency?: string;
11487
11718
  /**
11488
11719
  * Filter by payment status. Possible values are `pending`, `failed` or `succeeded`.
11489
11720
  * @example "pending"
@@ -11533,6 +11764,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11533
11764
  * @example 20
11534
11765
  */
11535
11766
  per_page?: number;
11767
+ /**
11768
+ * The subscription external unique identifier (provided by your own application).
11769
+ * @example "subscription_premium"
11770
+ */
11771
+ external_id?: string;
11536
11772
  /**
11537
11773
  * The unique code representing the plan to be attached to the customer. This code must correspond to the code property of one of the active plans.
11538
11774
  * @example "premium"
@@ -11579,6 +11815,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11579
11815
  * @example 20
11580
11816
  */
11581
11817
  per_page?: number;
11818
+ /**
11819
+ * Filter the results by currency, expressed as an ISO 4217 code.
11820
+ * @example "EUR"
11821
+ */
11822
+ currency?: string;
11582
11823
  /**
11583
11824
  * Filter wallets by billing entity codes.
11584
11825
  * @example ["billing_entity_code_1","billing_entity_code_2"]
@@ -11586,7 +11827,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11586
11827
  "billing_entity_codes[]"?: string[];
11587
11828
  }, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
11588
11829
  /**
11589
- * @description This endpoint is used to update an existing wallet with prepaid credits.
11830
+ * @description This endpoint is used to update an existing wallet with prepaid credits. A terminated wallet cannot be updated and returns a `422` error.
11590
11831
  *
11591
11832
  * @tags wallets
11592
11833
  * @name UpdateCustomerWallet
@@ -11664,7 +11905,18 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11664
11905
  * @request GET:/customers/{external_customer_id}/wallets/{wallet_code}/alerts
11665
11906
  * @secure
11666
11907
  */
11667
- getCustomerWalletAlerts: (externalCustomerId: string, walletCode: string, params?: RequestParams) => Promise<HttpResponse<WalletAlerts, ApiErrorUnauthorized | ApiErrorNotFound>>;
11908
+ getCustomerWalletAlerts: (externalCustomerId: string, walletCode: string, query?: {
11909
+ /**
11910
+ * Page number.
11911
+ * @example 1
11912
+ */
11913
+ page?: number;
11914
+ /**
11915
+ * Number of records per page.
11916
+ * @example 20
11917
+ */
11918
+ per_page?: number;
11919
+ }, params?: RequestParams) => Promise<HttpResponse<WalletAlerts, ApiErrorUnauthorized | ApiErrorNotFound>>;
11668
11920
  /**
11669
11921
  * @description This endpoint allows you to create new alerts for a wallet. 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.
11670
11922
  *
@@ -11880,7 +12132,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11880
12132
  per_page?: number;
11881
12133
  }, params?: RequestParams) => Promise<HttpResponse<PaymentMethodsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
11882
12134
  /**
11883
- * @description Use the payment method as default when not selected a payment method
12135
+ * @description This endpoint sets a payment method as the customer's default one. It is the payment method Lago uses when a payment is triggered without an explicit one. Any other default payment method of the customer is unset.
11884
12136
  *
11885
12137
  * @tags payment_methods
11886
12138
  * @name PaymentMethodSetAsDefault
@@ -12012,7 +12264,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12012
12264
  };
12013
12265
  fees: {
12014
12266
  /**
12015
- * @description This endpoint is used for retrieving all fees that has been issued.
12267
+ * @description This endpoint is used for retrieving all fees that have been issued.
12016
12268
  *
12017
12269
  * @tags fees
12018
12270
  * @name FindAllFees
@@ -12046,67 +12298,67 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12046
12298
  * @example "et_12345678"
12047
12299
  */
12048
12300
  event_transaction_id?: string;
12049
- /** Filter results by fee"s currency. */
12301
+ /** Filter results by the fee's currency. */
12050
12302
  currency?: Currency;
12051
12303
  /**
12052
- * The fee type. Possible values are `add-on`, `charge`, `credit`, `subscription` or "commitment".
12304
+ * The fee type. Possible values are `add_on`, `charge`, `fixed_charge`, `credit`, `subscription` or `commitment`.
12053
12305
  * @example "charge"
12054
12306
  */
12055
- fee_type?: "charge" | "add_on" | "subscription" | "credit" | "commitment";
12307
+ fee_type?: "charge" | "fixed_charge" | "add_on" | "subscription" | "credit" | "commitment";
12056
12308
  /**
12057
12309
  * Filter results by the `code` of the billable metric attached to the fee. Only applies to `charge` types.
12058
12310
  * @example "bm_code"
12059
12311
  */
12060
12312
  billable_metric_code?: string;
12061
12313
  /**
12062
- * Indicates the payment status of the fee. It represents the current status of the payment associated with the fee. The possible values for this field are `pending`, `succeeded`, `failed` and refunded`.
12314
+ * Indicates the payment status of the fee. It represents the current status of the payment associated with the fee. The possible values for this field are `pending`, `succeeded`, `failed` and `refunded`.
12063
12315
  * @example "succeeded"
12064
12316
  */
12065
12317
  payment_status?: "pending" | "succeeded" | "failed" | "refunded";
12066
12318
  /**
12067
- * Filter results created after creation date and time in UTC.
12319
+ * Filter results created at or after this date and time in UTC.
12068
12320
  * @format date-time
12069
12321
  * @example "2023-03-28T12:21:51Z"
12070
12322
  */
12071
12323
  created_at_from?: string;
12072
12324
  /**
12073
- * Filter results created before creation date and time in UTC.
12325
+ * Filter results created at or before this date and time in UTC.
12074
12326
  * @format date-time
12075
12327
  * @example "2023-03-28T12:21:51Z"
12076
12328
  */
12077
12329
  created_at_to?: string;
12078
12330
  /**
12079
- * Filter results with payment success after creation date and time in UTC.
12331
+ * Filter results with a payment success at or after this date and time in UTC.
12080
12332
  * @format date-time
12081
12333
  * @example "2023-03-28T12:21:51Z"
12082
12334
  */
12083
12335
  succeeded_at_from?: string;
12084
12336
  /**
12085
- * Filter results with payment success after creation date and time in UTC.
12337
+ * Filter results with a payment success at or before this date and time in UTC.
12086
12338
  * @format date-time
12087
12339
  * @example "2023-03-28T12:21:51Z"
12088
12340
  */
12089
12341
  succeeded_at_to?: string;
12090
12342
  /**
12091
- * Filter results with payment failure after creation date and time in UTC.
12343
+ * Filter results with a payment failure at or after this date and time in UTC.
12092
12344
  * @format date-time
12093
12345
  * @example "2023-03-28T12:21:51Z"
12094
12346
  */
12095
12347
  failed_at_from?: string;
12096
12348
  /**
12097
- * Filter results with payment failure after creation date and time in UTC.
12349
+ * Filter results with a payment failure at or before this date and time in UTC.
12098
12350
  * @format date-time
12099
12351
  * @example "2023-03-28T12:21:51Z"
12100
12352
  */
12101
12353
  failed_at_to?: string;
12102
12354
  /**
12103
- * Filter results with payment refund after creation date and time in UTC.
12355
+ * Filter results with a payment refund at or after this date and time in UTC.
12104
12356
  * @format date-time
12105
12357
  * @example "2023-03-28T12:21:51Z"
12106
12358
  */
12107
12359
  refunded_at_from?: string;
12108
12360
  /**
12109
- * Filter results with payment refund after creation date and time in UTC.
12361
+ * Filter results with a payment refund at or before this date and time in UTC.
12110
12362
  * @format date-time
12111
12363
  * @example "2023-03-28T12:21:51Z"
12112
12364
  */
@@ -12225,6 +12477,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12225
12477
  * @example true
12226
12478
  */
12227
12479
  payment_dispute_lost?: boolean;
12480
+ /**
12481
+ * Filter invoices that are partially paid. When `true`, only invoices with a non-zero amount paid that is below the total due are returned. When `false`, those invoices are excluded.
12482
+ * @example true
12483
+ */
12484
+ partially_paid?: boolean;
12485
+ /**
12486
+ * Filter invoices settled by at least one of the given settlement types. `payment` matches invoices settled by a payment, `credit_note` matches invoices settled by a credit note.
12487
+ * @example ["payment","credit_note"]
12488
+ */
12489
+ "settlements[]"?: ("payment" | "credit_note")[];
12228
12490
  /** Filter invoices by invoice type. Possible values are `subscription`, `add_on`, `credit`, `one_off`, `advance_charges` or `progressive_billing`. */
12229
12491
  invoice_type?: "subscription" | "add_on" | "credit" | "one_off" | "advance_charges" | "progressive_billing";
12230
12492
  /**
@@ -12249,7 +12511,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12249
12511
  purchase_order_number?: string;
12250
12512
  }, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized>>;
12251
12513
  /**
12252
- * @description This endpoint is used for updating an existing invoice.
12514
+ * @description This endpoint is used for updating an existing invoice. A voided invoice cannot be updated and returns a `405` error.
12253
12515
  *
12254
12516
  * @tags invoices
12255
12517
  * @name UpdateInvoice
@@ -12257,7 +12519,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12257
12519
  * @request PUT:/invoices/{lago_id}
12258
12520
  * @secure
12259
12521
  */
12260
- updateInvoice: (lagoId: string, data: InvoiceUpdateInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
12522
+ updateInvoice: (lagoId: string, data: InvoiceUpdateInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound | ApiErrorNotAllowed>>;
12261
12523
  /**
12262
12524
  * @description This endpoint is used for retrieving a specific invoice that has been issued.
12263
12525
  *
@@ -12568,6 +12830,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12568
12830
  executeOrder: (lagoId: string, data?: OrderExecuteInput, params?: RequestParams) => Promise<HttpResponse<Order, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
12569
12831
  };
12570
12832
  organizations: {
12833
+ /**
12834
+ * @description This endpoint retrieves your own organization's settings.
12835
+ *
12836
+ * @tags organizations
12837
+ * @name FindOrganization
12838
+ * @summary Retrieve your organization
12839
+ * @request GET:/organizations
12840
+ * @secure
12841
+ */
12842
+ findOrganization: (params?: RequestParams) => Promise<HttpResponse<Organization, ApiErrorUnauthorized>>;
12571
12843
  /**
12572
12844
  * @description This endpoint is used to update your own organization's settings.
12573
12845
  *
@@ -13248,11 +13520,21 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13248
13520
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
13249
13521
  */
13250
13522
  external_customer_id?: string;
13523
+ /**
13524
+ * Filter subscriptions by their external unique identifier (provided by your own application).
13525
+ * @example "my_sub_1234567890"
13526
+ */
13527
+ external_id?: string;
13251
13528
  /**
13252
13529
  * The unique code representing the plan to be attached to the customer. This code must correspond to the code property of one of the active plans.
13253
13530
  * @example "premium"
13254
13531
  */
13255
13532
  plan_code?: string;
13533
+ /**
13534
+ * When set, filters subscriptions by whether their plan is an override of a parent plan. `true` returns only subscriptions on overridden plans; `false` returns only those on standard (non-overridden) plans.
13535
+ * @example true
13536
+ */
13537
+ overridden?: boolean;
13256
13538
  /**
13257
13539
  * If the field is not defined, Lago will return only `active` subscriptions. However, if you wish to fetch subscriptions by different status you can define them in a status[] query param. Available filter values: `pending`, `canceled`, `terminated`, `active`.
13258
13540
  * @example ["active","pending"]
@@ -13377,6 +13659,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13377
13659
  * @example "active"
13378
13660
  */
13379
13661
  subscription_status?: "pending" | "active" | "terminated" | "canceled";
13662
+ /**
13663
+ * Page number.
13664
+ * @example 1
13665
+ */
13666
+ page?: number;
13667
+ /**
13668
+ * Number of records per page.
13669
+ * @example 20
13670
+ */
13671
+ per_page?: number;
13380
13672
  }, params?: RequestParams) => Promise<HttpResponse<Alerts, ApiErrorUnauthorized | ApiErrorNotFound>>;
13381
13673
  /**
13382
13674
  * @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.
@@ -13832,7 +14124,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13832
14124
  * @request GET:/wallets
13833
14125
  * @secure
13834
14126
  */
13835
- findAllWallets: (query: {
14127
+ findAllWallets: (query?: {
13836
14128
  /**
13837
14129
  * Page number.
13838
14130
  * @example 1
@@ -13849,10 +14141,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13849
14141
  */
13850
14142
  currency?: string;
13851
14143
  /**
13852
- * The customer external unique identifier (provided by your own application).
14144
+ * Filter wallets by customer external unique identifier (provided by your own application). When omitted, all wallets for the organization are returned.
13853
14145
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
13854
14146
  */
13855
- external_customer_id: string;
14147
+ external_customer_id?: string;
13856
14148
  /**
13857
14149
  * Filter wallets by billing entity codes.
13858
14150
  * @example ["billing_entity_code_1","billing_entity_code_2"]
@@ -13860,7 +14152,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13860
14152
  "billing_entity_codes[]"?: string[];
13861
14153
  }, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden>>;
13862
14154
  /**
13863
- * @description This endpoint is used to update an existing wallet with prepaid credits.
14155
+ * @description This endpoint is used to update an existing wallet with prepaid credits. A terminated wallet cannot be updated and returns a `422` error.
13864
14156
  *
13865
14157
  * @tags wallets
13866
14158
  * @name UpdateWallet
@@ -13964,6 +14256,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13964
14256
  * @example "inbound"
13965
14257
  */
13966
14258
  transaction_type?: string;
14259
+ /**
14260
+ * Filter wallet transactions by metadata. Replace `key` with the actual metadata key you want to match, and provide the corresponding value. For example, `metadata[color]=blue`.
14261
+ * @example "someValue"
14262
+ */
14263
+ "metadata[key]"?: string;
13967
14264
  }, params?: RequestParams) => Promise<HttpResponse<WalletTransactionsPaginated, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
13968
14265
  };
13969
14266
  walletTransactions: {