lago-javascript-client 1.52.0 → 1.53.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.
- package/esm/openapi/client.d.ts +1834 -422
- package/esm/openapi/client.js +263 -5
- package/esm/openapi/webhooks.d.ts +9554 -6334
- package/package.json +1 -1
- package/script/openapi/client.d.ts +1834 -422
- package/script/openapi/client.js +263 -5
- package/script/openapi/webhooks.d.ts +9554 -6334
package/esm/openapi/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @example "USD" */
|
|
2
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";
|
|
3
3
|
/** @example "US" */
|
|
4
|
-
export type
|
|
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
|
|
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?:
|
|
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?:
|
|
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
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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
|
|
478
|
-
*
|
|
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
|
|
489
|
+
*/
|
|
490
|
+
document_numbering?: "per_customer" | "per_billing_entity";
|
|
491
|
+
/**
|
|
492
|
+
* The prefix used in document numbers for this billing entity
|
|
493
|
+
* @example "ABC-123"
|
|
479
494
|
*/
|
|
480
|
-
|
|
495
|
+
document_number_prefix?: string | null;
|
|
481
496
|
/**
|
|
482
|
-
*
|
|
483
|
-
* @example
|
|
497
|
+
* Whether to finalize invoices with zero amount for this billing entity
|
|
498
|
+
* @example true
|
|
484
499
|
*/
|
|
485
|
-
|
|
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
|
+
};
|
|
486
528
|
/**
|
|
487
|
-
* The
|
|
529
|
+
* The net payment term (in days) for this billing entity
|
|
488
530
|
* @example 0
|
|
489
531
|
*/
|
|
490
|
-
|
|
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;
|
|
560
|
+
/**
|
|
561
|
+
* The zipcode of the billing address
|
|
562
|
+
* @example "91364"
|
|
563
|
+
*/
|
|
564
|
+
zipcode?: string | null;
|
|
565
|
+
/**
|
|
566
|
+
* The email address of the billing entity
|
|
567
|
+
* @format email
|
|
568
|
+
* @example "billing@acme.com"
|
|
569
|
+
*/
|
|
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;
|
|
491
605
|
/**
|
|
492
|
-
*
|
|
493
|
-
* @
|
|
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,..."
|
|
494
609
|
*/
|
|
495
|
-
|
|
610
|
+
logo?: string | null;
|
|
496
611
|
/**
|
|
497
|
-
* The
|
|
498
|
-
* @
|
|
612
|
+
* The codes of the invoice custom section that should be associated with this billing entity
|
|
613
|
+
* @example ["custom_section_1","custom_section_2"]
|
|
499
614
|
*/
|
|
500
|
-
|
|
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.
|
|
@@ -2083,6 +2134,12 @@ export interface FeeObject {
|
|
|
2083
2134
|
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2084
2135
|
*/
|
|
2085
2136
|
lago_true_up_parent_fee_id?: string | null;
|
|
2137
|
+
/**
|
|
2138
|
+
* Unique identifier assigned to the fee this fee was derived from. It is set on fees regenerated from an existing fee, and `null` otherwise.
|
|
2139
|
+
* @format uuid
|
|
2140
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2141
|
+
*/
|
|
2142
|
+
lago_original_fee_id?: string | null;
|
|
2086
2143
|
/**
|
|
2087
2144
|
* Unique identifier assigned to the subscription, created by Lago. This field is specifically displayed when the fee type is charge or subscription.
|
|
2088
2145
|
* @format uuid
|
|
@@ -2256,12 +2313,12 @@ export interface FeeObject {
|
|
|
2256
2313
|
/** Item attached to the fee */
|
|
2257
2314
|
item: {
|
|
2258
2315
|
/**
|
|
2259
|
-
* The fee type. Possible values are `
|
|
2316
|
+
* The fee type. Possible values are `add_on`, `charge`, `fixed_charge`, `credit`, `subscription` or `commitment`.
|
|
2260
2317
|
* @example "subscription"
|
|
2261
2318
|
*/
|
|
2262
2319
|
type: "charge" | "fixed_charge" | "add_on" | "subscription" | "credit" | "commitment";
|
|
2263
2320
|
/**
|
|
2264
|
-
* The code of the fee item. It can be the code of the `
|
|
2321
|
+
* 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
2322
|
* @example "startup"
|
|
2266
2323
|
*/
|
|
2267
2324
|
code: string;
|
|
@@ -2269,7 +2326,7 @@ export interface FeeObject {
|
|
|
2269
2326
|
* The name of the fee item. The value depends on the type of the fee item:
|
|
2270
2327
|
*
|
|
2271
2328
|
* - If the fee item is a `charge`, it is the billable metric name.
|
|
2272
|
-
* - If the fee item is
|
|
2329
|
+
* - If the fee item is an `add_on`, it is the add-on name.
|
|
2273
2330
|
* - If the fee item is a `credit`, it is the wallet transaction name if set, or `"credit"` if not.
|
|
2274
2331
|
* - If the fee item is a `fixed_charge`, it is the fixed charge add-on name.
|
|
2275
2332
|
* - For all the other fee items, it is the subscription plan name.
|
|
@@ -2280,7 +2337,7 @@ export interface FeeObject {
|
|
|
2280
2337
|
* The description of the fee item. The value depends on the type of the fee item:
|
|
2281
2338
|
*
|
|
2282
2339
|
* - If the fee item is a `charge`, it is the billable metric description.
|
|
2283
|
-
* - If the fee item is
|
|
2340
|
+
* - If the fee item is an `add_on`, it is the add-on description.
|
|
2284
2341
|
* - If the fee item is a `credit`, it is always `"credit"`.
|
|
2285
2342
|
* - If the fee item is a `fixed_charge`, it is the fixed charge add-on description.
|
|
2286
2343
|
* - For all the other fee items, it is the subscription plan description.
|
|
@@ -2291,7 +2348,7 @@ export interface FeeObject {
|
|
|
2291
2348
|
* 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
2349
|
*
|
|
2293
2350
|
* - 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
|
|
2351
|
+
* - 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
2352
|
* - If the fee item is a `credit`, we'll fallback to the wallet transaction name if set, or `credit` if not.
|
|
2296
2353
|
* - 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
2354
|
* - For all the other fee items, we'll fallback to the `invoice_display_name` of the subscription plan.
|
|
@@ -2306,7 +2363,7 @@ export interface FeeObject {
|
|
|
2306
2363
|
/** Key value list of event properties */
|
|
2307
2364
|
filters?: object | null;
|
|
2308
2365
|
/**
|
|
2309
|
-
* Unique identifier of the fee item, created by Lago. It can be the identifier of the `
|
|
2366
|
+
* 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
2367
|
* @format uuid
|
|
2311
2368
|
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2312
2369
|
*/
|
|
@@ -2356,8 +2413,6 @@ export type CreditNoteAppliedTaxObject = BaseAppliedTax & {
|
|
|
2356
2413
|
/** @example 100 */
|
|
2357
2414
|
base_amount_cents?: number;
|
|
2358
2415
|
};
|
|
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
2416
|
/** @example "America/Los_Angeles" */
|
|
2362
2417
|
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
2418
|
/** 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 +2436,10 @@ export interface CustomerBillingConfiguration {
|
|
|
2381
2436
|
subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
|
|
2382
2437
|
/**
|
|
2383
2438
|
* 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`.
|
|
2439
|
+
* Accepted values: `stripe`, `adyen`, `cashfree`, `flutterwave`, `gocardless`, `moneyhash` or null. This field is required if you intend to assign a `provider_customer_id`.
|
|
2385
2440
|
* @example "stripe"
|
|
2386
2441
|
*/
|
|
2387
|
-
payment_provider?: "stripe" | "adyen" | "gocardless";
|
|
2442
|
+
payment_provider?: "stripe" | "adyen" | "cashfree" | "flutterwave" | "gocardless" | "moneyhash";
|
|
2388
2443
|
/**
|
|
2389
2444
|
* Unique code used to identify a payment provider connection.
|
|
2390
2445
|
* @example "stripe-eu-1"
|
|
@@ -2487,7 +2542,7 @@ export interface CustomerBaseObject {
|
|
|
2487
2542
|
*/
|
|
2488
2543
|
lago_id: string;
|
|
2489
2544
|
/**
|
|
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
|
|
2545
|
+
* 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
2546
|
* @example 1
|
|
2492
2547
|
*/
|
|
2493
2548
|
sequential_id: number;
|
|
@@ -2614,6 +2669,11 @@ export interface CustomerBaseObject {
|
|
|
2614
2669
|
* @example 30
|
|
2615
2670
|
*/
|
|
2616
2671
|
net_payment_term?: number | null;
|
|
2672
|
+
/**
|
|
2673
|
+
* The customer ID within the Salesforce system
|
|
2674
|
+
* @example "0015p00001JQx1QAAT"
|
|
2675
|
+
*/
|
|
2676
|
+
external_salesforce_id?: string | null;
|
|
2617
2677
|
/**
|
|
2618
2678
|
* 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
2679
|
* @format date-time
|
|
@@ -2654,8 +2714,8 @@ export interface IntegrationCustomer {
|
|
|
2654
2714
|
*/
|
|
2655
2715
|
lago_id: string;
|
|
2656
2716
|
/**
|
|
2657
|
-
* The integration type used for accounting and
|
|
2658
|
-
* Accepted values: `netsuite
|
|
2717
|
+
* The integration type used for accounting, tax and CRM syncs.
|
|
2718
|
+
* Accepted values: `netsuite`, `anrok`, `xero`, `hubspot`, `salesforce`.
|
|
2659
2719
|
* @example "netsuite"
|
|
2660
2720
|
*/
|
|
2661
2721
|
type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
|
|
@@ -2797,11 +2857,21 @@ export interface CreditNoteObject {
|
|
|
2797
2857
|
* @example 120
|
|
2798
2858
|
*/
|
|
2799
2859
|
total_amount_cents: number;
|
|
2860
|
+
/**
|
|
2861
|
+
* The total amount of the credit note, expressed in cents, with precision.
|
|
2862
|
+
* @example "120.0001"
|
|
2863
|
+
*/
|
|
2864
|
+
precise_total_amount_cents?: string | null;
|
|
2800
2865
|
/**
|
|
2801
2866
|
* The tax amount of the credit note, expressed in cents.
|
|
2802
2867
|
* @example 20
|
|
2803
2868
|
*/
|
|
2804
2869
|
taxes_amount_cents: number;
|
|
2870
|
+
/**
|
|
2871
|
+
* The tax amount of the credit note, expressed in cents, with precision.
|
|
2872
|
+
* @example "20.0001"
|
|
2873
|
+
*/
|
|
2874
|
+
precise_taxes_amount_cents?: string | null;
|
|
2805
2875
|
/**
|
|
2806
2876
|
* The tax rate associated with this specific credit note.
|
|
2807
2877
|
* @example 20
|
|
@@ -2828,7 +2898,7 @@ export interface CreditNoteObject {
|
|
|
2828
2898
|
*/
|
|
2829
2899
|
refund_amount_cents: number;
|
|
2830
2900
|
/**
|
|
2831
|
-
* The
|
|
2901
|
+
* The offset amount (deducted from the invoice balance) of the credit note, expressed in cents.
|
|
2832
2902
|
* @example 0
|
|
2833
2903
|
*/
|
|
2834
2904
|
offset_amount_cents: number;
|
|
@@ -2850,10 +2920,15 @@ export interface CreditNoteObject {
|
|
|
2850
2920
|
*/
|
|
2851
2921
|
updated_at: string;
|
|
2852
2922
|
/**
|
|
2853
|
-
* The PDF file of the credit note.
|
|
2923
|
+
* The PDF file of the credit note. It is `null` while no PDF has been generated.
|
|
2854
2924
|
* @example "https://getlago.com/credit_note/file"
|
|
2855
2925
|
*/
|
|
2856
2926
|
file_url?: string | null;
|
|
2927
|
+
/**
|
|
2928
|
+
* The e-invoicing XML file of the credit note. It is `null` while no XML file has been generated.
|
|
2929
|
+
* @example "https://getlago.com/credit_note/xml"
|
|
2930
|
+
*/
|
|
2931
|
+
xml_url?: string | null;
|
|
2857
2932
|
/** Array of credit note's items. */
|
|
2858
2933
|
items?: CreditNoteItemObject[];
|
|
2859
2934
|
applied_taxes?: CreditNoteAppliedTaxObject[];
|
|
@@ -2899,17 +2974,17 @@ export interface CreditNoteCreateInput {
|
|
|
2899
2974
|
*/
|
|
2900
2975
|
description?: string;
|
|
2901
2976
|
/**
|
|
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
|
|
2977
|
+
* 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
2978
|
* @example 100
|
|
2904
2979
|
*/
|
|
2905
2980
|
credit_amount_cents?: number | null;
|
|
2906
2981
|
/**
|
|
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
|
|
2982
|
+
* 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
2983
|
* @example 500
|
|
2909
2984
|
*/
|
|
2910
2985
|
refund_amount_cents?: number | null;
|
|
2911
2986
|
/**
|
|
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
|
|
2987
|
+
* 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
2988
|
* @example 200
|
|
2914
2989
|
*/
|
|
2915
2990
|
offset_amount_cents?: number | null;
|
|
@@ -3144,9 +3219,9 @@ export type CustomerObjectExtended = CustomerObject & {
|
|
|
3144
3219
|
metadata?: CustomerMetadata[];
|
|
3145
3220
|
/** List of customer taxes */
|
|
3146
3221
|
taxes?: TaxObject[];
|
|
3147
|
-
/** The customer
|
|
3222
|
+
/** The customer's invoice custom sections used for generating invoices. */
|
|
3148
3223
|
applicable_invoice_custom_sections?: InvoiceCustomSectionObject[];
|
|
3149
|
-
/** List of errors with details that might have been raised while processing
|
|
3224
|
+
/** List of errors with details that might have been raised while processing background actions for the customer */
|
|
3150
3225
|
error_details?: ErrorDetailObject[];
|
|
3151
3226
|
};
|
|
3152
3227
|
export interface CustomersPaginated {
|
|
@@ -3228,6 +3303,8 @@ export interface CustomerCreateInput {
|
|
|
3228
3303
|
* The type of the account. It can have one of the following values:
|
|
3229
3304
|
* - `customer`: the account is a customer, default value.
|
|
3230
3305
|
* - `partner`: the account is a partner.
|
|
3306
|
+
*
|
|
3307
|
+
* This field is only applied when revenue share is enabled on your organization; otherwise it is ignored.
|
|
3231
3308
|
* @example "customer"
|
|
3232
3309
|
*/
|
|
3233
3310
|
account_type?: "customer" | "partner";
|
|
@@ -3271,6 +3348,11 @@ export interface CustomerCreateInput {
|
|
|
3271
3348
|
* @example 30
|
|
3272
3349
|
*/
|
|
3273
3350
|
net_payment_term?: number | null;
|
|
3351
|
+
/**
|
|
3352
|
+
* The customer ID within the Salesforce system
|
|
3353
|
+
* @example "0015p00001JQx1QAAT"
|
|
3354
|
+
*/
|
|
3355
|
+
external_salesforce_id?: string | null;
|
|
3274
3356
|
/**
|
|
3275
3357
|
* Specifies how invoices with a zero total amount should be handled:
|
|
3276
3358
|
* - `inherit`: (Default) Follows the organization-level configuration.
|
|
@@ -3291,11 +3373,11 @@ export interface CustomerCreateInput {
|
|
|
3291
3373
|
*/
|
|
3292
3374
|
id?: string;
|
|
3293
3375
|
/**
|
|
3294
|
-
* The integration type used for accounting and
|
|
3295
|
-
* Accepted values: `netsuite
|
|
3376
|
+
* The integration type used for accounting, tax and CRM syncs.
|
|
3377
|
+
* Accepted values: `netsuite`, `anrok`, `avalara`, `xero`, `hubspot`, `salesforce`.
|
|
3296
3378
|
* @example "netsuite"
|
|
3297
3379
|
*/
|
|
3298
|
-
integration_type?: "netsuite" | "anrok" | "xero";
|
|
3380
|
+
integration_type?: "netsuite" | "anrok" | "avalara" | "xero" | "hubspot" | "salesforce";
|
|
3299
3381
|
/**
|
|
3300
3382
|
* Unique code used to identify an integration connection.
|
|
3301
3383
|
* @example "netsuite-eu-1"
|
|
@@ -3316,6 +3398,11 @@ export interface CustomerCreateInput {
|
|
|
3316
3398
|
* @example "2"
|
|
3317
3399
|
*/
|
|
3318
3400
|
subsidiary_id?: string;
|
|
3401
|
+
/**
|
|
3402
|
+
* This optional field is needed only when working with `hubspot` connection.
|
|
3403
|
+
* @example "contacts"
|
|
3404
|
+
*/
|
|
3405
|
+
targeted_object?: string | null;
|
|
3319
3406
|
}[];
|
|
3320
3407
|
/** 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
3408
|
metadata?: {
|
|
@@ -3339,7 +3426,7 @@ export interface CustomerCreateInput {
|
|
|
3339
3426
|
* 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
3427
|
* @example true
|
|
3341
3428
|
*/
|
|
3342
|
-
display_in_invoice
|
|
3429
|
+
display_in_invoice?: boolean;
|
|
3343
3430
|
}[];
|
|
3344
3431
|
/**
|
|
3345
3432
|
* Set to `true` to exclude all invoice custom sections from PDF generation for this customer only. False by default
|
|
@@ -3390,17 +3477,17 @@ export interface InvoiceBaseObject {
|
|
|
3390
3477
|
*/
|
|
3391
3478
|
issuing_date: string;
|
|
3392
3479
|
/**
|
|
3393
|
-
* The date when the payment dispute was lost. It is expressed in Coordinated Universal Time (UTC).
|
|
3480
|
+
* 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
3481
|
* @format date-time
|
|
3395
3482
|
* @example "2022-09-14T16:35:31Z"
|
|
3396
3483
|
*/
|
|
3397
|
-
payment_dispute_lost_at?: string;
|
|
3484
|
+
payment_dispute_lost_at?: string | null;
|
|
3398
3485
|
/**
|
|
3399
3486
|
* The payment due date for the invoice, specified in the ISO 8601 date format.
|
|
3400
3487
|
* @format date
|
|
3401
3488
|
* @example "2022-04-30"
|
|
3402
3489
|
*/
|
|
3403
|
-
payment_due_date?: string;
|
|
3490
|
+
payment_due_date?: string | null;
|
|
3404
3491
|
/**
|
|
3405
3492
|
* Specifies if the payment is considered as overdue.
|
|
3406
3493
|
* @example true
|
|
@@ -3412,10 +3499,10 @@ export interface InvoiceBaseObject {
|
|
|
3412
3499
|
*/
|
|
3413
3500
|
net_payment_term?: number;
|
|
3414
3501
|
/**
|
|
3415
|
-
* The type of invoice issued. Possible values are `subscription`, `
|
|
3502
|
+
* The type of invoice issued. Possible values are `subscription`, `add_on`, `credit`, `one_off`, `advance_charges` or `progressive_billing`.
|
|
3416
3503
|
* @example "subscription"
|
|
3417
3504
|
*/
|
|
3418
|
-
invoice_type: "subscription" | "add_on" | "credit" | "one_off" | "progressive_billing";
|
|
3505
|
+
invoice_type: "subscription" | "add_on" | "credit" | "one_off" | "advance_charges" | "progressive_billing";
|
|
3419
3506
|
/**
|
|
3420
3507
|
* The status of the invoice. It indicates the current state of the invoice and can have following values:
|
|
3421
3508
|
* - `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 +3590,21 @@ export interface InvoiceBaseObject {
|
|
|
3503
3590
|
* @example 100
|
|
3504
3591
|
*/
|
|
3505
3592
|
total_amount_cents: number;
|
|
3593
|
+
/**
|
|
3594
|
+
* The amount already paid on the invoice, expressed in cents.
|
|
3595
|
+
* @example 40
|
|
3596
|
+
*/
|
|
3597
|
+
total_paid_amount_cents?: number;
|
|
3598
|
+
/**
|
|
3599
|
+
* The amount of the invoice settled by finalized credit notes, expressed in cents.
|
|
3600
|
+
* @example 10
|
|
3601
|
+
*/
|
|
3602
|
+
total_offsetted_credit_note_amount_cents?: number;
|
|
3603
|
+
/**
|
|
3604
|
+
* 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.
|
|
3605
|
+
* @example 50
|
|
3606
|
+
*/
|
|
3607
|
+
total_due_amount_cents?: number;
|
|
3506
3608
|
/** @example 3 */
|
|
3507
3609
|
version_number: number;
|
|
3508
3610
|
/**
|
|
@@ -3511,11 +3613,17 @@ export interface InvoiceBaseObject {
|
|
|
3511
3613
|
*/
|
|
3512
3614
|
self_billed?: boolean;
|
|
3513
3615
|
/**
|
|
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
|
|
3616
|
+
* 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
3617
|
* @format uri
|
|
3516
3618
|
* @example "https://getlago.com/invoice/file"
|
|
3517
3619
|
*/
|
|
3518
|
-
file_url?: string;
|
|
3620
|
+
file_url?: string | null;
|
|
3621
|
+
/**
|
|
3622
|
+
* 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.
|
|
3623
|
+
* @format uri
|
|
3624
|
+
* @example "https://getlago.com/invoice/xml"
|
|
3625
|
+
*/
|
|
3626
|
+
xml_url?: string | null;
|
|
3519
3627
|
/**
|
|
3520
3628
|
* 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
3629
|
* @format uri
|
|
@@ -3534,6 +3642,12 @@ export interface InvoiceBaseObject {
|
|
|
3534
3642
|
* @example "2022-04-29T08:59:51Z"
|
|
3535
3643
|
*/
|
|
3536
3644
|
updated_at: string;
|
|
3645
|
+
/**
|
|
3646
|
+
* 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.
|
|
3647
|
+
* @format date-time
|
|
3648
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3649
|
+
*/
|
|
3650
|
+
voided_at?: string | null;
|
|
3537
3651
|
}
|
|
3538
3652
|
export interface InvoiceMetadataObject {
|
|
3539
3653
|
/**
|
|
@@ -4580,7 +4694,7 @@ export interface WalletUpdateInput {
|
|
|
4580
4694
|
* The trigger. Possible values are `interval` or `threshold`.
|
|
4581
4695
|
* @example "interval"
|
|
4582
4696
|
*/
|
|
4583
|
-
trigger
|
|
4697
|
+
trigger: "interval" | "threshold";
|
|
4584
4698
|
/**
|
|
4585
4699
|
* The method used for recurring top-up. Possible values are `fixed` or `target`.
|
|
4586
4700
|
* @example "target"
|
|
@@ -4704,6 +4818,8 @@ export interface AlertThresholdBaseObject {
|
|
|
4704
4818
|
export type AlertThresholdObject = AlertThresholdBaseObject & {
|
|
4705
4819
|
/**
|
|
4706
4820
|
* A value that should trigger this alert, formatted as a BigDecimal.
|
|
4821
|
+
*
|
|
4822
|
+
* 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
4823
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4708
4824
|
* @example "99.0"
|
|
4709
4825
|
*/
|
|
@@ -4781,6 +4897,8 @@ export interface WalletAlerts {
|
|
|
4781
4897
|
export type AlertThresholdInput = AlertThresholdBaseObject & {
|
|
4782
4898
|
/**
|
|
4783
4899
|
* A value that should trigger this alert. This can be an integer or a string formatted as a BigDecimal.
|
|
4900
|
+
*
|
|
4901
|
+
* 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
4902
|
* @example 99
|
|
4785
4903
|
*/
|
|
4786
4904
|
value: number | string;
|
|
@@ -4880,23 +4998,23 @@ export type CustomerChargeFiltersUsageObject = {
|
|
|
4880
4998
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4881
4999
|
* @example "0.9"
|
|
4882
5000
|
*/
|
|
4883
|
-
units
|
|
5001
|
+
units: string;
|
|
4884
5002
|
/**
|
|
4885
5003
|
* The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
|
|
4886
5004
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4887
5005
|
* @example "1.0"
|
|
4888
5006
|
*/
|
|
4889
|
-
total_aggregated_units
|
|
5007
|
+
total_aggregated_units: string;
|
|
4890
5008
|
/**
|
|
4891
5009
|
* The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
|
|
4892
5010
|
* @example 1000
|
|
4893
5011
|
*/
|
|
4894
|
-
amount_cents
|
|
5012
|
+
amount_cents: number;
|
|
4895
5013
|
/**
|
|
4896
5014
|
* 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
5015
|
* @example 10
|
|
4898
5016
|
*/
|
|
4899
|
-
events_count
|
|
5017
|
+
events_count: number;
|
|
4900
5018
|
/**
|
|
4901
5019
|
* Specifies the name that will be displayed on an invoice.
|
|
4902
5020
|
* @example "AWS eu-east-1"
|
|
@@ -4908,7 +5026,7 @@ export type CustomerChargeFiltersUsageObject = {
|
|
|
4908
5026
|
* List of filter values applied to the usage.
|
|
4909
5027
|
* @example {"region":["us-east-1"]}
|
|
4910
5028
|
*/
|
|
4911
|
-
values
|
|
5029
|
+
values: Record<string, string[]>;
|
|
4912
5030
|
/** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
|
|
4913
5031
|
presentation_breakdowns?: PresentationBreakdownsObject;
|
|
4914
5032
|
}[];
|
|
@@ -4918,28 +5036,28 @@ export type CustomerChargeGroupedUsageObject = {
|
|
|
4918
5036
|
* The amount in cents, tax excluded, consumed for a specific group related to a charge item.
|
|
4919
5037
|
* @example 1000
|
|
4920
5038
|
*/
|
|
4921
|
-
amount_cents
|
|
5039
|
+
amount_cents: number;
|
|
4922
5040
|
/**
|
|
4923
5041
|
* 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
5042
|
* @example 10
|
|
4925
5043
|
*/
|
|
4926
|
-
events_count
|
|
5044
|
+
events_count: number;
|
|
4927
5045
|
/**
|
|
4928
5046
|
* The number of units consumed for a specific group related to a charge item.
|
|
4929
5047
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4930
5048
|
* @example "0.9"
|
|
4931
5049
|
*/
|
|
4932
|
-
units
|
|
5050
|
+
units: string;
|
|
4933
5051
|
/**
|
|
4934
5052
|
* The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
|
|
4935
5053
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4936
5054
|
* @example "1.0"
|
|
4937
5055
|
*/
|
|
4938
|
-
total_aggregated_units
|
|
5056
|
+
total_aggregated_units: string;
|
|
4939
5057
|
/** Details about the pricing unit used for charge usage. */
|
|
4940
5058
|
pricing_unit_details?: UsagePricingUnitDetailsObject;
|
|
4941
5059
|
/** Key value list of event properties aggregated by the charge model */
|
|
4942
|
-
grouped_by
|
|
5060
|
+
grouped_by: Record<string, string>;
|
|
4943
5061
|
/** Array of filter object, representing multiple dimensions for a charge item. */
|
|
4944
5062
|
filters?: CustomerChargeFiltersUsageObject;
|
|
4945
5063
|
/** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
|
|
@@ -5083,28 +5201,28 @@ export type CustomerProjectedChargeFiltersUsageObject = {
|
|
|
5083
5201
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
5084
5202
|
* @example "0.9"
|
|
5085
5203
|
*/
|
|
5086
|
-
units
|
|
5204
|
+
units: string;
|
|
5087
5205
|
/**
|
|
5088
5206
|
* The projected number of units that can be consumed for a specific charge filter related to a charge item.
|
|
5089
5207
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
5090
5208
|
* @example "1.8"
|
|
5091
5209
|
*/
|
|
5092
|
-
projected_units
|
|
5210
|
+
projected_units: string;
|
|
5093
5211
|
/**
|
|
5094
5212
|
* The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
|
|
5095
5213
|
* @example 1000
|
|
5096
5214
|
*/
|
|
5097
|
-
amount_cents
|
|
5215
|
+
amount_cents: number;
|
|
5098
5216
|
/**
|
|
5099
5217
|
* The projected amount in cents, tax excluded, that can be consumed for a specific charge filter related to a charge item.
|
|
5100
5218
|
* @example 2000
|
|
5101
5219
|
*/
|
|
5102
|
-
projected_amount_cents
|
|
5220
|
+
projected_amount_cents: number;
|
|
5103
5221
|
/**
|
|
5104
5222
|
* 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
5223
|
* @example 10
|
|
5106
5224
|
*/
|
|
5107
|
-
events_count
|
|
5225
|
+
events_count: number;
|
|
5108
5226
|
/**
|
|
5109
5227
|
* Specifies the name that will be displayed on an invoice.
|
|
5110
5228
|
* @example "AWS eu-east-1"
|
|
@@ -5116,7 +5234,7 @@ export type CustomerProjectedChargeFiltersUsageObject = {
|
|
|
5116
5234
|
* List of filter values applied to the usage.
|
|
5117
5235
|
* @example {"region":["us-east-1"]}
|
|
5118
5236
|
*/
|
|
5119
|
-
values
|
|
5237
|
+
values: Record<string, string[]>;
|
|
5120
5238
|
/** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
|
|
5121
5239
|
presentation_breakdowns?: PresentationBreakdownsObject;
|
|
5122
5240
|
/** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
|
|
@@ -5128,33 +5246,33 @@ export type CustomerProjectedChargeGroupedUsageObject = {
|
|
|
5128
5246
|
* The amount in cents, tax excluded, consumed for a specific group related to a charge item.
|
|
5129
5247
|
* @example 1000
|
|
5130
5248
|
*/
|
|
5131
|
-
amount_cents
|
|
5249
|
+
amount_cents: number;
|
|
5132
5250
|
/**
|
|
5133
5251
|
* The projected amount in cents, tax excluded, that can be consumed for a specific group related to a charge item.
|
|
5134
5252
|
* @example 2000
|
|
5135
5253
|
*/
|
|
5136
|
-
projected_amount_cents
|
|
5254
|
+
projected_amount_cents: number;
|
|
5137
5255
|
/**
|
|
5138
5256
|
* 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
5257
|
* @example 10
|
|
5140
5258
|
*/
|
|
5141
|
-
events_count
|
|
5259
|
+
events_count: number;
|
|
5142
5260
|
/**
|
|
5143
5261
|
* The number of units consumed for a specific group related to a charge item.
|
|
5144
5262
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
5145
5263
|
* @example "0.9"
|
|
5146
5264
|
*/
|
|
5147
|
-
units
|
|
5265
|
+
units: string;
|
|
5148
5266
|
/**
|
|
5149
5267
|
* The projected number of units that can be consumed for a specific group related to a charge item.
|
|
5150
5268
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
5151
5269
|
* @example "1.8"
|
|
5152
5270
|
*/
|
|
5153
|
-
projected_units
|
|
5271
|
+
projected_units: string;
|
|
5154
5272
|
/** Details about the pricing unit used for charge usage. */
|
|
5155
5273
|
pricing_unit_details?: UsagePricingUnitDetailsObject;
|
|
5156
5274
|
/** Key value list of event properties aggregated by the charge model */
|
|
5157
|
-
grouped_by
|
|
5275
|
+
grouped_by: Record<string, string>;
|
|
5158
5276
|
/** Array of filter object, representing multiple dimensions for a charge item. */
|
|
5159
5277
|
filters?: CustomerProjectedChargeFiltersUsageObject;
|
|
5160
5278
|
/** Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation. */
|
|
@@ -5483,7 +5601,18 @@ export interface EventInputObject {
|
|
|
5483
5601
|
* 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
5602
|
* @example {"gb":10}
|
|
5485
5603
|
*/
|
|
5486
|
-
properties?:
|
|
5604
|
+
properties?: {
|
|
5605
|
+
/**
|
|
5606
|
+
* The code of the wallet targeted by this event for prepaid credits deduction.
|
|
5607
|
+
* When provided, credits are drawn from this specific wallet instead of following the standard wallet selection logic.
|
|
5608
|
+
* If the code does not match an existing wallet, no credits will be applied for the event.
|
|
5609
|
+
* This field is only taken into account when the targeted charge has `accepts_target_wallet` set to `true`.
|
|
5610
|
+
* This field requires a premium integration.
|
|
5611
|
+
* @example "main_wallet"
|
|
5612
|
+
*/
|
|
5613
|
+
target_wallet_code?: string | null;
|
|
5614
|
+
[key: string]: any;
|
|
5615
|
+
};
|
|
5487
5616
|
}
|
|
5488
5617
|
export interface EventInput {
|
|
5489
5618
|
event: EventInputObject;
|
|
@@ -5521,8 +5650,19 @@ export interface EventEstimateFeesInput {
|
|
|
5521
5650
|
* @example "sub_1234567890"
|
|
5522
5651
|
*/
|
|
5523
5652
|
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?:
|
|
5653
|
+
/** 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. */
|
|
5654
|
+
properties?: {
|
|
5655
|
+
/**
|
|
5656
|
+
* The code of the wallet targeted by this event for prepaid credits deduction.
|
|
5657
|
+
* When provided, credits are drawn from this specific wallet instead of following the standard wallet selection logic.
|
|
5658
|
+
* If the code does not match an existing wallet, no credits will be applied for the event.
|
|
5659
|
+
* This field is only taken into account when the targeted charge has `accepts_target_wallet` set to `true`.
|
|
5660
|
+
* This field requires a premium integration.
|
|
5661
|
+
* @example "main_wallet"
|
|
5662
|
+
*/
|
|
5663
|
+
target_wallet_code?: string | null;
|
|
5664
|
+
[key: string]: any;
|
|
5665
|
+
};
|
|
5526
5666
|
};
|
|
5527
5667
|
}
|
|
5528
5668
|
export interface Fees {
|
|
@@ -5770,6 +5910,12 @@ export interface InvoiceOneOffCreateInput {
|
|
|
5770
5910
|
* @example "EUR"
|
|
5771
5911
|
*/
|
|
5772
5912
|
currency?: Currency;
|
|
5913
|
+
/**
|
|
5914
|
+
* If true, the invoice will be created but not sent to the payment provider.
|
|
5915
|
+
* @default false
|
|
5916
|
+
* @example true
|
|
5917
|
+
*/
|
|
5918
|
+
skip_psp?: boolean | null;
|
|
5773
5919
|
/**
|
|
5774
5920
|
* The purchase order number to associate with the invoice.
|
|
5775
5921
|
* @example "PO-123"
|
|
@@ -5792,14 +5938,14 @@ export interface InvoiceOneOffCreateInput {
|
|
|
5792
5938
|
*/
|
|
5793
5939
|
unit_amount_cents?: number | null;
|
|
5794
5940
|
/**
|
|
5795
|
-
* The quantity of units associated with the fee. By default, only 1 unit is added to the invoice.
|
|
5941
|
+
* 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
5942
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
5797
5943
|
* @example "2.5"
|
|
5798
5944
|
*/
|
|
5799
|
-
units?: string | null;
|
|
5945
|
+
units?: string | number | null;
|
|
5800
5946
|
/**
|
|
5801
|
-
*
|
|
5802
|
-
* @example "
|
|
5947
|
+
* The description of the fee line item in the invoice. By default, the description of the add-on is used.
|
|
5948
|
+
* @example "Onboarding session, June 2024"
|
|
5803
5949
|
*/
|
|
5804
5950
|
description?: string | null;
|
|
5805
5951
|
/**
|
|
@@ -5816,12 +5962,6 @@ export interface InvoiceOneOffCreateInput {
|
|
|
5816
5962
|
to_datetime?: string;
|
|
5817
5963
|
/** List of unique code used to identify the taxes. */
|
|
5818
5964
|
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
5965
|
}[];
|
|
5826
5966
|
/** Configuration for invoice custom sections to apply to invoices generated by this resource. */
|
|
5827
5967
|
invoice_custom_section?: InvoiceCustomSectionInput;
|
|
@@ -6106,186 +6246,751 @@ export interface InvoiceVoidInput {
|
|
|
6106
6246
|
*/
|
|
6107
6247
|
credit_amount?: number;
|
|
6108
6248
|
}
|
|
6109
|
-
/**
|
|
6110
|
-
|
|
6249
|
+
/**
|
|
6250
|
+
* The status of the order form. It can be any of the following values:
|
|
6251
|
+
* - `generated`: the order form is waiting for the customer's signature.
|
|
6252
|
+
* - `signed`: the customer has signed, and an order has been created from the order form.
|
|
6253
|
+
* - `expired`: the order form reached its `expires_at` without being signed.
|
|
6254
|
+
* - `voided`: the order form has been voided before being signed.
|
|
6255
|
+
*
|
|
6256
|
+
* Only a `generated` order form is actionable. Reaching `expired` or `voided` also voids the quote version the order form was generated from; signing does not, since the deal it quotes goes on to be executed.
|
|
6257
|
+
* @example "generated"
|
|
6258
|
+
*/
|
|
6259
|
+
export type OrderFormStatusEnum = "generated" | "signed" | "expired" | "voided";
|
|
6260
|
+
/**
|
|
6261
|
+
* The reason why the order form is no longer actionable. It is `null` unless the `status` is `voided` or `expired`. It can be any of the following values:
|
|
6262
|
+
* - `manual`: the order form has been voided explicitly, through the API or the Lago user interface.
|
|
6263
|
+
* - `expired`: the order form reached its `expires_at` without being signed.
|
|
6264
|
+
* - `invalid`: reserved for an order form Lago voids because it can no longer be executed. No flow writes it yet.
|
|
6265
|
+
* @example "manual"
|
|
6266
|
+
*/
|
|
6267
|
+
export type OrderFormVoidReasonEnum = "manual" | "expired" | "invalid";
|
|
6268
|
+
export interface OrderFormObject {
|
|
6111
6269
|
/**
|
|
6112
|
-
*
|
|
6113
|
-
* @
|
|
6270
|
+
* Unique identifier of the order form, created by Lago.
|
|
6271
|
+
* @format uuid
|
|
6272
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6114
6273
|
*/
|
|
6115
|
-
|
|
6274
|
+
lago_id: string;
|
|
6116
6275
|
/**
|
|
6117
|
-
* The
|
|
6118
|
-
* @example
|
|
6276
|
+
* The unique number assigned to the order form by Lago.
|
|
6277
|
+
* @example "OF-2026-0001"
|
|
6119
6278
|
*/
|
|
6120
|
-
|
|
6279
|
+
number: string;
|
|
6121
6280
|
/**
|
|
6122
|
-
* The
|
|
6123
|
-
*
|
|
6281
|
+
* The status of the order form. It can be any of the following values:
|
|
6282
|
+
* - `generated`: the order form is waiting for the customer's signature.
|
|
6283
|
+
* - `signed`: the customer has signed, and an order has been created from the order form.
|
|
6284
|
+
* - `expired`: the order form reached its `expires_at` without being signed.
|
|
6285
|
+
* - `voided`: the order form has been voided before being signed.
|
|
6286
|
+
*
|
|
6287
|
+
* Only a `generated` order form is actionable. Reaching `expired` or `voided` also voids the quote version the order form was generated from; signing does not, since the deal it quotes goes on to be executed.
|
|
6124
6288
|
*/
|
|
6125
|
-
|
|
6126
|
-
}
|
|
6127
|
-
export interface OrganizationUpdateInput {
|
|
6128
|
-
organization: {
|
|
6129
|
-
/**
|
|
6130
|
-
* 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.
|
|
6131
|
-
* @example "https://webhook.brex.com"
|
|
6132
|
-
*/
|
|
6133
|
-
webhook_url?: string | null;
|
|
6134
|
-
/**
|
|
6135
|
-
* The country of your organization.
|
|
6136
|
-
* @example "US"
|
|
6137
|
-
*/
|
|
6138
|
-
country?: CountryOrNull;
|
|
6139
|
-
/**
|
|
6140
|
-
* The default currency of an organization.
|
|
6141
|
-
* @example "USD"
|
|
6142
|
-
*/
|
|
6143
|
-
default_currency?: Currency;
|
|
6144
|
-
/**
|
|
6145
|
-
* The first line of your organization's billing address.
|
|
6146
|
-
* @example "100 Brex Street"
|
|
6147
|
-
*/
|
|
6148
|
-
address_line1?: string | null;
|
|
6149
|
-
/**
|
|
6150
|
-
* The second line of your organization's billing address.
|
|
6151
|
-
* @example null
|
|
6152
|
-
*/
|
|
6153
|
-
address_line2?: string | null;
|
|
6154
|
-
/**
|
|
6155
|
-
* The state of your organization's billing address.
|
|
6156
|
-
* @example "NYC"
|
|
6157
|
-
*/
|
|
6158
|
-
state?: string | null;
|
|
6159
|
-
/**
|
|
6160
|
-
* The zipcode of your organization's billing address.
|
|
6161
|
-
* @example "10000"
|
|
6162
|
-
*/
|
|
6163
|
-
zipcode?: string | null;
|
|
6164
|
-
/**
|
|
6165
|
-
* The email address of your organization used to bill your customers.
|
|
6166
|
-
* @format email
|
|
6167
|
-
* @example "brex@brex.com"
|
|
6168
|
-
*/
|
|
6169
|
-
email?: string | null;
|
|
6170
|
-
/**
|
|
6171
|
-
* The city of your organization's billing address.
|
|
6172
|
-
* @example "New York"
|
|
6173
|
-
*/
|
|
6174
|
-
city?: string | null;
|
|
6175
|
-
/**
|
|
6176
|
-
* The legal name of your organization.
|
|
6177
|
-
* @example null
|
|
6178
|
-
*/
|
|
6179
|
-
legal_name?: string | null;
|
|
6180
|
-
/**
|
|
6181
|
-
* The legal number of your organization.
|
|
6182
|
-
* @example null
|
|
6183
|
-
*/
|
|
6184
|
-
legal_number?: string | null;
|
|
6185
|
-
/**
|
|
6186
|
-
* This parameter configures the method of incrementing invoice numbers for your customers.
|
|
6187
|
-
*
|
|
6188
|
-
* - `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.
|
|
6189
|
-
* - `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.
|
|
6190
|
-
*
|
|
6191
|
-
* The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer.
|
|
6192
|
-
* @example "per_customer"
|
|
6193
|
-
*/
|
|
6194
|
-
document_numbering?: "per_customer" | "per_organization";
|
|
6195
|
-
/**
|
|
6196
|
-
* 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.
|
|
6197
|
-
* @example "ORG-1234"
|
|
6198
|
-
*/
|
|
6199
|
-
document_number_prefix?: string;
|
|
6200
|
-
/**
|
|
6201
|
-
* The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
|
|
6202
|
-
* @example 30
|
|
6203
|
-
*/
|
|
6204
|
-
net_payment_term?: number;
|
|
6205
|
-
/**
|
|
6206
|
-
* The tax identification number of your organization.
|
|
6207
|
-
* @example "US123456789"
|
|
6208
|
-
*/
|
|
6209
|
-
tax_identification_number?: string | null;
|
|
6210
|
-
/**
|
|
6211
|
-
* Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone.
|
|
6212
|
-
* @example "America/New_York"
|
|
6213
|
-
*/
|
|
6214
|
-
timezone?: Timezone;
|
|
6215
|
-
/**
|
|
6216
|
-
* 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.
|
|
6217
|
-
* @example ["invoice.finalized","credit_note.created"]
|
|
6218
|
-
*/
|
|
6219
|
-
email_settings?: ("invoice.finalized" | "credit_note.created")[];
|
|
6220
|
-
/** The custom billing settings for your organization. */
|
|
6221
|
-
billing_configuration?: OrganizationBillingConfiguration;
|
|
6222
|
-
/**
|
|
6223
|
-
* 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.
|
|
6224
|
-
* @example false
|
|
6225
|
-
*/
|
|
6226
|
-
finalize_zero_amount_invoice?: boolean;
|
|
6227
|
-
};
|
|
6228
|
-
}
|
|
6229
|
-
export interface OrganizationObject {
|
|
6289
|
+
status: OrderFormStatusEnum;
|
|
6230
6290
|
/**
|
|
6231
|
-
*
|
|
6232
|
-
*
|
|
6233
|
-
*
|
|
6291
|
+
* The reason why the order form is no longer actionable. It is `null` unless the `status` is `voided` or `expired`. It can be any of the following values:
|
|
6292
|
+
* - `manual`: the order form has been voided explicitly, through the API or the Lago user interface.
|
|
6293
|
+
* - `expired`: the order form reached its `expires_at` without being signed.
|
|
6294
|
+
* - `invalid`: reserved for an order form Lago voids because it can no longer be executed. No flow writes it yet.
|
|
6234
6295
|
*/
|
|
6235
|
-
|
|
6296
|
+
void_reason: OrderFormVoidReasonEnum;
|
|
6236
6297
|
/**
|
|
6237
|
-
* The
|
|
6238
|
-
* @
|
|
6298
|
+
* The date and time in UTC (ISO 8601) after which the order form is meant to expire. It is `null` when the order form never expires. It is validated when the quote is approved, where a value on or after the day the quoted deal stops being executable is rejected rather than clamped. Expiry is then swept hourly and compared by calendar date, so signing keeps succeeding until the sweep moves the order form to `expired`.
|
|
6299
|
+
* @format date-time
|
|
6300
|
+
* @example "2026-06-30T23:59:59Z"
|
|
6239
6301
|
*/
|
|
6240
|
-
|
|
6302
|
+
expires_at: string | null;
|
|
6241
6303
|
/**
|
|
6242
|
-
* The date
|
|
6304
|
+
* The date and time in UTC (ISO 8601) when the order form was marked as signed. It is `null` unless the `status` is `signed`.
|
|
6243
6305
|
* @format date-time
|
|
6244
|
-
* @example "
|
|
6306
|
+
* @example "2026-04-29T08:59:51Z"
|
|
6245
6307
|
*/
|
|
6246
|
-
|
|
6308
|
+
signed_at: string | null;
|
|
6247
6309
|
/**
|
|
6248
|
-
* The
|
|
6249
|
-
* @
|
|
6310
|
+
* The date and time in UTC (ISO 8601) when the order form stopped being actionable. It is set both when the order form is voided and when it expires, and is `null` otherwise.
|
|
6311
|
+
* @format date-time
|
|
6312
|
+
* @example "2026-04-29T08:59:51Z"
|
|
6250
6313
|
*/
|
|
6251
|
-
|
|
6314
|
+
voided_at: string | null;
|
|
6252
6315
|
/**
|
|
6253
|
-
* The
|
|
6254
|
-
* @
|
|
6316
|
+
* The URL of the signed document attached to the order form. It is `null` when no document was uploaded.
|
|
6317
|
+
* @format uri
|
|
6318
|
+
* @example "https://api.getlago.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/OF-2026-0001"
|
|
6255
6319
|
*/
|
|
6256
|
-
|
|
6320
|
+
signed_document_url: string | null;
|
|
6257
6321
|
/**
|
|
6258
|
-
*
|
|
6259
|
-
* @
|
|
6322
|
+
* Unique identifier of the organization, created by Lago.
|
|
6323
|
+
* @format uuid
|
|
6324
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6260
6325
|
*/
|
|
6261
|
-
|
|
6326
|
+
lago_organization_id: string;
|
|
6262
6327
|
/**
|
|
6263
|
-
*
|
|
6264
|
-
* @
|
|
6328
|
+
* Unique identifier of the customer the order form is addressed to, created by Lago.
|
|
6329
|
+
* @format uuid
|
|
6330
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6265
6331
|
*/
|
|
6266
|
-
|
|
6332
|
+
lago_customer_id: string;
|
|
6267
6333
|
/**
|
|
6268
|
-
*
|
|
6269
|
-
* @
|
|
6334
|
+
* Unique identifier of the quote the order form comes from, created by Lago.
|
|
6335
|
+
* @format uuid
|
|
6336
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6270
6337
|
*/
|
|
6271
|
-
|
|
6338
|
+
lago_quote_id: string;
|
|
6272
6339
|
/**
|
|
6273
|
-
*
|
|
6274
|
-
* @
|
|
6340
|
+
* Unique identifier of the approved quote version the order form was generated from, created by Lago. A quote version carries at most one order form.
|
|
6341
|
+
* @format uuid
|
|
6342
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6275
6343
|
*/
|
|
6276
|
-
|
|
6344
|
+
lago_quote_version_id: string;
|
|
6277
6345
|
/**
|
|
6278
|
-
* The
|
|
6279
|
-
* @
|
|
6346
|
+
* The date and time in UTC (ISO 8601) when the order form was created.
|
|
6347
|
+
* @format date-time
|
|
6348
|
+
* @example "2026-04-29T08:59:51Z"
|
|
6280
6349
|
*/
|
|
6281
|
-
|
|
6350
|
+
created_at: string;
|
|
6282
6351
|
/**
|
|
6283
|
-
* The
|
|
6284
|
-
* @
|
|
6352
|
+
* The date and time in UTC (ISO 8601) when the order form was last updated.
|
|
6353
|
+
* @format date-time
|
|
6354
|
+
* @example "2026-04-29T08:59:51Z"
|
|
6285
6355
|
*/
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6356
|
+
updated_at: string;
|
|
6357
|
+
}
|
|
6358
|
+
export interface OrderFormsPaginated {
|
|
6359
|
+
order_forms: OrderFormObject[];
|
|
6360
|
+
meta: PaginationMeta;
|
|
6361
|
+
}
|
|
6362
|
+
export interface OrderForm {
|
|
6363
|
+
order_form: OrderFormObject;
|
|
6364
|
+
}
|
|
6365
|
+
/**
|
|
6366
|
+
* How the order created from the order form is carried out. It can be any of the following values:
|
|
6367
|
+
* - `execute_in_lago`: Lago applies the quoted deal itself, creating the subscriptions, coupons, wallets or one-off invoice it describes.
|
|
6368
|
+
* - `order_only`: Lago records the order without applying it, leaving the execution to your own systems.
|
|
6369
|
+
* @example "execute_in_lago"
|
|
6370
|
+
*/
|
|
6371
|
+
export type OrderExecutionModeEnum = "execute_in_lago" | "order_only";
|
|
6372
|
+
/** Parameters available when marking an order form as signed. Every parameter is optional, so an empty body records the signature without attaching a document, and creates an order that is not scheduled for execution. */
|
|
6373
|
+
export interface OrderFormMarkAsSignedInput {
|
|
6374
|
+
order_form?: {
|
|
6375
|
+
/**
|
|
6376
|
+
* The document signed by the customer, as a base64 data URI (`data:<content_type>;base64,<data>`). Accepted content types are `application/pdf`, `image/jpeg` and `image/png`, for a maximum of 10 MB. Once attached, it is exposed as `signed_document_url` on the order form.
|
|
6377
|
+
* @example "data:application/pdf;base64,JVBERi0xLjQKJcfs..."
|
|
6378
|
+
*/
|
|
6379
|
+
signed_document?: string;
|
|
6380
|
+
/** How the order created from the order form is carried out. It becomes mandatory as soon as `execute_at` is provided. */
|
|
6381
|
+
execution_mode?: OrderExecutionModeEnum;
|
|
6382
|
+
/**
|
|
6383
|
+
* The date and time in UTC (ISO 8601) when Lago executes the order created from the order form. It must be in the future, requires `execution_mode` to be set, and must fall strictly before the day the quoted deal stops being executable, otherwise signing is rejected with a `422`. When it is omitted, the order is created but not scheduled, and waits to be executed on demand.
|
|
6384
|
+
* @format date-time
|
|
6385
|
+
* @example "2026-07-01T00:00:00Z"
|
|
6386
|
+
*/
|
|
6387
|
+
execute_at?: string;
|
|
6388
|
+
};
|
|
6389
|
+
}
|
|
6390
|
+
/**
|
|
6391
|
+
* The status of the order. It can be any of the following values:
|
|
6392
|
+
* - `created`: the order has been created from a signed order form and is waiting to be executed.
|
|
6393
|
+
* - `executed`: the order has been carried out. What it produced is listed in `execution_record`.
|
|
6394
|
+
* - `failed`: the execution was attempted and rolled back. The reasons are listed in `execution_record.errors`. Lago does not retry on its own, so a new attempt has to be triggered through the execute endpoint.
|
|
6395
|
+
* @example "created"
|
|
6396
|
+
*/
|
|
6397
|
+
export type OrderStatusEnum = "created" | "executed" | "failed";
|
|
6398
|
+
/**
|
|
6399
|
+
* The commercial motion the quote describes. It can be any of the following values:
|
|
6400
|
+
* - `subscription_creation`: the quote creates one or more subscriptions.
|
|
6401
|
+
* - `subscription_amendment`: the quote amends an existing subscription, named by the quote's own `lago_subscription_id`.
|
|
6402
|
+
* - `one_off`: the quote bills add-ons once, without any subscription.
|
|
6403
|
+
* @example "subscription_creation"
|
|
6404
|
+
*/
|
|
6405
|
+
export type QuoteOrderTypeEnum = "subscription_creation" | "subscription_amendment" | "one_off";
|
|
6406
|
+
/**
|
|
6407
|
+
* How the order is carried out. It is `null` while the order has neither been scheduled nor executed. It can be any of the following values:
|
|
6408
|
+
* - `execute_in_lago`: Lago applies the quoted deal itself, creating the subscriptions, coupons, wallets or one-off invoice it describes.
|
|
6409
|
+
* - `order_only`: Lago records the order without applying it, leaving the execution to your own systems.
|
|
6410
|
+
* @example "execute_in_lago"
|
|
6411
|
+
*/
|
|
6412
|
+
export type OrderExecutionModeEnumOrNull = "execute_in_lago" | "order_only";
|
|
6413
|
+
/**
|
|
6414
|
+
* A trace of what the execution produced. Every key is always present, whichever the order type, so a reader never has to tell a missing key from an empty one; the keys that do not apply keep their empty value.
|
|
6415
|
+
*
|
|
6416
|
+
* Which ones are filled depends on the `order_type` of the quote, and only for an `execute_in_lago` order: `invoice_id` for `one_off`, `subscription_ids` with `applied_coupon_ids` and `wallet_ids` for `subscription_creation`, and the same plus `terminated_subscription_ids` for `subscription_amendment`. An `order_only` order records the mode and the timestamp alone.
|
|
6417
|
+
*/
|
|
6418
|
+
export interface OrderExecutionRecordObject {
|
|
6419
|
+
/**
|
|
6420
|
+
* The date and time in UTC (ISO 8601) when the execution succeeded. It is `null` until then, and stays `null` on a failed attempt.
|
|
6421
|
+
* @format date-time
|
|
6422
|
+
* @example "2026-07-01T00:00:00Z"
|
|
6423
|
+
*/
|
|
6424
|
+
executed_at: string | null;
|
|
6425
|
+
/** The mode the execution ran in. */
|
|
6426
|
+
execution_mode: OrderExecutionModeEnumOrNull;
|
|
6427
|
+
/**
|
|
6428
|
+
* Unique identifier of the one-off invoice created by the execution, created by Lago. Only for a `one_off` order.
|
|
6429
|
+
* @format uuid
|
|
6430
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6431
|
+
*/
|
|
6432
|
+
invoice_id: string | null;
|
|
6433
|
+
/**
|
|
6434
|
+
* Unique identifiers of the subscriptions created by the execution, created by Lago.
|
|
6435
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
6436
|
+
*/
|
|
6437
|
+
subscription_ids: string[];
|
|
6438
|
+
/**
|
|
6439
|
+
* Unique identifiers of the subscriptions terminated by the execution, created by Lago. Only for a `subscription_amendment` order, and only when the amendment took effect immediately and terminated the subscription it replaced. It stays empty for an amendment scheduled for the next billing period.
|
|
6440
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
6441
|
+
*/
|
|
6442
|
+
terminated_subscription_ids: string[];
|
|
6443
|
+
/**
|
|
6444
|
+
* Unique identifiers of the coupons applied to the customer by the execution, created by Lago.
|
|
6445
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
6446
|
+
*/
|
|
6447
|
+
applied_coupon_ids: string[];
|
|
6448
|
+
/**
|
|
6449
|
+
* Unique identifiers of the prepaid credit wallets created by the execution, created by Lago.
|
|
6450
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
6451
|
+
*/
|
|
6452
|
+
wallet_ids: string[];
|
|
6453
|
+
/**
|
|
6454
|
+
* The reasons why the execution failed. It is empty unless the `status` is `failed`.
|
|
6455
|
+
* @example ["plan_not_found"]
|
|
6456
|
+
*/
|
|
6457
|
+
errors: string[];
|
|
6458
|
+
}
|
|
6459
|
+
export interface OrderObject {
|
|
6460
|
+
/**
|
|
6461
|
+
* Unique identifier of the order, created by Lago.
|
|
6462
|
+
* @format uuid
|
|
6463
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6464
|
+
*/
|
|
6465
|
+
lago_id: string;
|
|
6466
|
+
/**
|
|
6467
|
+
* The unique number assigned to the order by Lago.
|
|
6468
|
+
* @example "OR-2026-0001"
|
|
6469
|
+
*/
|
|
6470
|
+
number: string;
|
|
6471
|
+
/**
|
|
6472
|
+
* The status of the order. It can be any of the following values:
|
|
6473
|
+
* - `created`: the order has been created from a signed order form and is waiting to be executed.
|
|
6474
|
+
* - `executed`: the order has been carried out. What it produced is listed in `execution_record`.
|
|
6475
|
+
* - `failed`: the execution was attempted and rolled back. The reasons are listed in `execution_record.errors`. Lago does not retry on its own, so a new attempt has to be triggered through the execute endpoint.
|
|
6476
|
+
*/
|
|
6477
|
+
status: OrderStatusEnum;
|
|
6478
|
+
/**
|
|
6479
|
+
* The commercial motion the quote describes. It can be any of the following values:
|
|
6480
|
+
* - `subscription_creation`: the quote creates one or more subscriptions.
|
|
6481
|
+
* - `subscription_amendment`: the quote amends an existing subscription, named by the quote's own `lago_subscription_id`.
|
|
6482
|
+
* - `one_off`: the quote bills add-ons once, without any subscription.
|
|
6483
|
+
*/
|
|
6484
|
+
order_type: QuoteOrderTypeEnum;
|
|
6485
|
+
/**
|
|
6486
|
+
* How the order is carried out. It is `null` while the order has neither been scheduled nor executed. It can be any of the following values:
|
|
6487
|
+
* - `execute_in_lago`: Lago applies the quoted deal itself, creating the subscriptions, coupons, wallets or one-off invoice it describes.
|
|
6488
|
+
* - `order_only`: Lago records the order without applying it, leaving the execution to your own systems.
|
|
6489
|
+
*/
|
|
6490
|
+
execution_mode: OrderExecutionModeEnumOrNull;
|
|
6491
|
+
/** The currency the order is denominated in, inherited from the quote version it comes from. */
|
|
6492
|
+
currency: CurrencyOrNull;
|
|
6493
|
+
/**
|
|
6494
|
+
* The date and time in UTC (ISO 8601) when the order was executed. It is `null` unless the `status` is `executed`.
|
|
6495
|
+
* @format date-time
|
|
6496
|
+
* @example "2026-07-01T00:00:00Z"
|
|
6497
|
+
*/
|
|
6498
|
+
executed_at: string | null;
|
|
6499
|
+
/**
|
|
6500
|
+
* A trace of what the execution produced. Every key is always present, whichever the order type, so a reader never has to tell a missing key from an empty one; the keys that do not apply keep their empty value.
|
|
6501
|
+
*
|
|
6502
|
+
* Which ones are filled depends on the `order_type` of the quote, and only for an `execute_in_lago` order: `invoice_id` for `one_off`, `subscription_ids` with `applied_coupon_ids` and `wallet_ids` for `subscription_creation`, and the same plus `terminated_subscription_ids` for `subscription_amendment`. An `order_only` order records the mode and the timestamp alone.
|
|
6503
|
+
*/
|
|
6504
|
+
execution_record: OrderExecutionRecordObject;
|
|
6505
|
+
/**
|
|
6506
|
+
* Unique identifier of the organization, created by Lago.
|
|
6507
|
+
* @format uuid
|
|
6508
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6509
|
+
*/
|
|
6510
|
+
lago_organization_id: string;
|
|
6511
|
+
/**
|
|
6512
|
+
* Unique identifier of the customer the order was placed for, created by Lago.
|
|
6513
|
+
* @format uuid
|
|
6514
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6515
|
+
*/
|
|
6516
|
+
lago_customer_id: string;
|
|
6517
|
+
/**
|
|
6518
|
+
* Unique identifier of the signed order form the order comes from, created by Lago. An order form carries at most one order.
|
|
6519
|
+
* @format uuid
|
|
6520
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6521
|
+
*/
|
|
6522
|
+
lago_order_form_id: string;
|
|
6523
|
+
/**
|
|
6524
|
+
* The date and time in UTC (ISO 8601) when the order was created.
|
|
6525
|
+
* @format date-time
|
|
6526
|
+
* @example "2026-04-29T08:59:51Z"
|
|
6527
|
+
*/
|
|
6528
|
+
created_at: string;
|
|
6529
|
+
/**
|
|
6530
|
+
* The date and time in UTC (ISO 8601) when the order was last updated.
|
|
6531
|
+
* @format date-time
|
|
6532
|
+
* @example "2026-04-29T08:59:51Z"
|
|
6533
|
+
*/
|
|
6534
|
+
updated_at: string;
|
|
6535
|
+
}
|
|
6536
|
+
export interface QuoteBillingItemAddOnObject {
|
|
6537
|
+
/**
|
|
6538
|
+
* Unique identifier of the add-on in Lago, pinned when the entry was added to the quote.
|
|
6539
|
+
* @format uuid
|
|
6540
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6541
|
+
*/
|
|
6542
|
+
id: string;
|
|
6543
|
+
/**
|
|
6544
|
+
* Identifier of the entry within the quote version, assigned by the Lago user interface. It allows the quote document to reference the entry.
|
|
6545
|
+
* @example "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b"
|
|
6546
|
+
*/
|
|
6547
|
+
localId: string;
|
|
6548
|
+
/**
|
|
6549
|
+
* The kind of billing item.
|
|
6550
|
+
* @example "add_on"
|
|
6551
|
+
*/
|
|
6552
|
+
type: "add_on";
|
|
6553
|
+
/** A snapshot of the add-on as it was added to the quote. `code`, `units`, `unitAmountCents` and `totalAmountCents` are required to approve the version. */
|
|
6554
|
+
payload: {
|
|
6555
|
+
/**
|
|
6556
|
+
* Unique code identifying the add-on.
|
|
6557
|
+
* @example "setup_fee"
|
|
6558
|
+
*/
|
|
6559
|
+
code?: string;
|
|
6560
|
+
/**
|
|
6561
|
+
* The number of units billed. It must be greater than 0.
|
|
6562
|
+
* @example 1
|
|
6563
|
+
*/
|
|
6564
|
+
units?: number;
|
|
6565
|
+
/**
|
|
6566
|
+
* The amount of one unit, in cents, in the currency of the quote version.
|
|
6567
|
+
* @example 10000
|
|
6568
|
+
*/
|
|
6569
|
+
unitAmountCents?: number;
|
|
6570
|
+
/**
|
|
6571
|
+
* The total amount billed for the entry, in cents, in the currency of the quote version.
|
|
6572
|
+
* @example 10000
|
|
6573
|
+
*/
|
|
6574
|
+
totalAmountCents?: number;
|
|
6575
|
+
/**
|
|
6576
|
+
* The beginning of the period covered by the entry, in UTC (ISO 8601).
|
|
6577
|
+
* @format date-time
|
|
6578
|
+
* @example "2026-01-01T00:00:00Z"
|
|
6579
|
+
*/
|
|
6580
|
+
fromDatetime?: string | null;
|
|
6581
|
+
/**
|
|
6582
|
+
* The end of the period covered by the entry, in UTC (ISO 8601).
|
|
6583
|
+
* @format date-time
|
|
6584
|
+
* @example "2026-12-31T23:59:59Z"
|
|
6585
|
+
*/
|
|
6586
|
+
toDatetime?: string | null;
|
|
6587
|
+
};
|
|
6588
|
+
/** The deviations from the add-on snapshot negotiated on the quote. Only the properties set here are overridden. */
|
|
6589
|
+
overrides?: {
|
|
6590
|
+
/**
|
|
6591
|
+
* Overrides the description of the add-on.
|
|
6592
|
+
* @example "Onboarding package, discounted for the first year"
|
|
6593
|
+
*/
|
|
6594
|
+
description?: string;
|
|
6595
|
+
/**
|
|
6596
|
+
* Overrides the number of units billed. It must be greater than 0.
|
|
6597
|
+
* @example 2
|
|
6598
|
+
*/
|
|
6599
|
+
units?: number;
|
|
6600
|
+
/**
|
|
6601
|
+
* Overrides the amount of one unit, in cents.
|
|
6602
|
+
* @example 8000
|
|
6603
|
+
*/
|
|
6604
|
+
unitAmountCents?: number;
|
|
6605
|
+
/**
|
|
6606
|
+
* Overrides the total amount billed for the entry, in cents.
|
|
6607
|
+
* @example 16000
|
|
6608
|
+
*/
|
|
6609
|
+
totalAmountCents?: number;
|
|
6610
|
+
/**
|
|
6611
|
+
* Overrides the name of the add-on as it appears on the invoice.
|
|
6612
|
+
* @example "Onboarding"
|
|
6613
|
+
*/
|
|
6614
|
+
invoiceDisplayName?: string;
|
|
6615
|
+
/**
|
|
6616
|
+
* Overrides the beginning of the period covered by the entry, in UTC (ISO 8601).
|
|
6617
|
+
* @format date-time
|
|
6618
|
+
* @example "2026-01-01T00:00:00Z"
|
|
6619
|
+
*/
|
|
6620
|
+
fromDatetime?: string | null;
|
|
6621
|
+
/**
|
|
6622
|
+
* Overrides the end of the period covered by the entry, in UTC (ISO 8601).
|
|
6623
|
+
* @format date-time
|
|
6624
|
+
* @example "2026-12-31T23:59:59Z"
|
|
6625
|
+
*/
|
|
6626
|
+
toDatetime?: string | null;
|
|
6627
|
+
};
|
|
6628
|
+
}
|
|
6629
|
+
export interface QuoteBillingItemPlanObject {
|
|
6630
|
+
/**
|
|
6631
|
+
* Unique identifier of the plan in Lago, pinned when the entry was added to the quote.
|
|
6632
|
+
* @format uuid
|
|
6633
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6634
|
+
*/
|
|
6635
|
+
id: string;
|
|
6636
|
+
/**
|
|
6637
|
+
* Identifier of the entry within the quote version, assigned by the Lago user interface. It allows the quote document to reference the entry.
|
|
6638
|
+
* @example "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b"
|
|
6639
|
+
*/
|
|
6640
|
+
localId?: string | null;
|
|
6641
|
+
/**
|
|
6642
|
+
* The kind of billing item.
|
|
6643
|
+
* @example "plan"
|
|
6644
|
+
*/
|
|
6645
|
+
type: "plan";
|
|
6646
|
+
/** A snapshot of the plan as it was added to the quote, and of the subscription to create from it. Additional catalog properties may be present, as only the ones Lago reads when the quote is executed are documented here. `code` is required to approve the version. */
|
|
6647
|
+
payload: {
|
|
6648
|
+
/**
|
|
6649
|
+
* Unique code identifying the plan.
|
|
6650
|
+
* @example "premium_plan"
|
|
6651
|
+
*/
|
|
6652
|
+
code?: string;
|
|
6653
|
+
/**
|
|
6654
|
+
* The external unique identifier to assign to the subscription created from the entry. For a `subscription_amendment` quote, it identifies the subscription being amended.
|
|
6655
|
+
* @example "sub_1234567890"
|
|
6656
|
+
*/
|
|
6657
|
+
subscriptionExternalId?: string | null;
|
|
6658
|
+
/**
|
|
6659
|
+
* The name to assign to the subscription created from the entry.
|
|
6660
|
+
* @example "Premium plan - Acme Corp"
|
|
6661
|
+
*/
|
|
6662
|
+
subscriptionName?: string | null;
|
|
6663
|
+
/**
|
|
6664
|
+
* The billing time of the subscription created from the entry.
|
|
6665
|
+
* @example "calendar"
|
|
6666
|
+
*/
|
|
6667
|
+
billingTime?: "calendar" | "anniversary";
|
|
6668
|
+
/**
|
|
6669
|
+
* The date and time in UTC (ISO 8601) when the subscription starts. It is optional, and a plan naming none starts the moment the order is executed.
|
|
6670
|
+
* @example "2026-01-01T00:00:00Z"
|
|
6671
|
+
*/
|
|
6672
|
+
startDate?: string | null;
|
|
6673
|
+
/**
|
|
6674
|
+
* The date and time in UTC (ISO 8601) when the subscription ends. Leaving it unset makes the deal open-ended, and on a `subscription_amendment` quote it leaves the amended subscription's own ending date in place. It bounds the deal, so the signing window and the execution date must both fall strictly before it.
|
|
6675
|
+
* @example "2027-01-01T00:00:00Z"
|
|
6676
|
+
*/
|
|
6677
|
+
endDate?: string | null;
|
|
6678
|
+
/**
|
|
6679
|
+
* Unique identifier of the payment method to charge for the subscription, created by Lago.
|
|
6680
|
+
* @format uuid
|
|
6681
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6682
|
+
*/
|
|
6683
|
+
paymentMethodId?: string | null;
|
|
6684
|
+
/** A snapshot of the usage-based charges of the plan. It pins the charge each entry of `overrides.charges` applies to. */
|
|
6685
|
+
charges?: any[] | null;
|
|
6686
|
+
/** A snapshot of the fixed charges of the plan. It pins the fixed charge each entry of `overrides.fixedCharges` applies to. */
|
|
6687
|
+
fixedCharges?: any[] | null;
|
|
6688
|
+
};
|
|
6689
|
+
/** The deviations from the plan snapshot negotiated on the quote. Only the properties set here are overridden. */
|
|
6690
|
+
overrides?: {
|
|
6691
|
+
/**
|
|
6692
|
+
* Overrides the base amount of the plan, in cents.
|
|
6693
|
+
* @example 50000
|
|
6694
|
+
*/
|
|
6695
|
+
amountCents?: number | null;
|
|
6696
|
+
/** Overrides the currency the plan is priced in, which is how a catalog plan is quoted in the currency of the deal. The figure in `amountCents` is not converted, it is restated in this currency. It is set only while it differs from the catalog record, and removed once they agree. */
|
|
6697
|
+
amountCurrency?: CurrencyOrNull;
|
|
6698
|
+
/**
|
|
6699
|
+
* Overrides the name of the plan as it appears on the invoice.
|
|
6700
|
+
* @example "Premium"
|
|
6701
|
+
*/
|
|
6702
|
+
invoiceDisplayName?: string | null;
|
|
6703
|
+
/**
|
|
6704
|
+
* Overrides the name of the plan.
|
|
6705
|
+
* @example "Premium plan - Acme Corp"
|
|
6706
|
+
*/
|
|
6707
|
+
name?: string | null;
|
|
6708
|
+
/**
|
|
6709
|
+
* Overrides the description of the plan.
|
|
6710
|
+
* @example "Negotiated premium plan"
|
|
6711
|
+
*/
|
|
6712
|
+
description?: string | null;
|
|
6713
|
+
/**
|
|
6714
|
+
* Overrides the trial period of the plan, in days.
|
|
6715
|
+
* @example 30
|
|
6716
|
+
*/
|
|
6717
|
+
trialPeriod?: number | null;
|
|
6718
|
+
/** Overrides the minimum commitment of the plan. */
|
|
6719
|
+
minimumCommitment?: {
|
|
6720
|
+
/**
|
|
6721
|
+
* The amount of the minimum commitment, in cents. It must be greater than 0.
|
|
6722
|
+
* @example 100000
|
|
6723
|
+
*/
|
|
6724
|
+
amountCents?: number | null;
|
|
6725
|
+
/**
|
|
6726
|
+
* The name of the minimum commitment as it appears on the invoice.
|
|
6727
|
+
* @example "Annual commitment"
|
|
6728
|
+
*/
|
|
6729
|
+
invoiceDisplayName?: string | null;
|
|
6730
|
+
};
|
|
6731
|
+
/** Overrides the progressive billing thresholds of the plan. */
|
|
6732
|
+
usageThresholds?: any[] | null;
|
|
6733
|
+
/** Overrides the usage-based charges of the plan. Each entry applies to the charge of the same billable metric in `payload.charges`. */
|
|
6734
|
+
charges?: any[] | null;
|
|
6735
|
+
/** Overrides the fixed charges of the plan. Each entry applies to the fixed charge of the same add-on in `payload.fixedCharges`. */
|
|
6736
|
+
fixedCharges?: any[] | null;
|
|
6737
|
+
};
|
|
6738
|
+
}
|
|
6739
|
+
export interface QuoteBillingItemCouponObject {
|
|
6740
|
+
/**
|
|
6741
|
+
* Unique identifier of the coupon in Lago, pinned when the entry was added to the quote.
|
|
6742
|
+
* @format uuid
|
|
6743
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6744
|
+
*/
|
|
6745
|
+
id: string;
|
|
6746
|
+
/**
|
|
6747
|
+
* Identifier of the entry within the quote version, assigned by the Lago user interface. It allows the quote document to reference the entry.
|
|
6748
|
+
* @example "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b"
|
|
6749
|
+
*/
|
|
6750
|
+
localId: string;
|
|
6751
|
+
/**
|
|
6752
|
+
* The kind of billing item.
|
|
6753
|
+
* @example "coupon"
|
|
6754
|
+
*/
|
|
6755
|
+
type: "coupon";
|
|
6756
|
+
/** A snapshot of the coupon as it was added to the quote. `code` and `type` are required to approve the version. */
|
|
6757
|
+
payload: {
|
|
6758
|
+
/**
|
|
6759
|
+
* Unique code identifying the coupon.
|
|
6760
|
+
* @example "welcome_offer"
|
|
6761
|
+
*/
|
|
6762
|
+
code?: string;
|
|
6763
|
+
/**
|
|
6764
|
+
* Whether the coupon deducts a fixed amount or a percentage.
|
|
6765
|
+
* @example "fixed_amount"
|
|
6766
|
+
*/
|
|
6767
|
+
type?: "fixed_amount" | "percentage";
|
|
6768
|
+
/**
|
|
6769
|
+
* The amount deducted by the coupon, in cents. Only for a `fixed_amount` coupon.
|
|
6770
|
+
* @example 10000
|
|
6771
|
+
*/
|
|
6772
|
+
amountCents?: number | null;
|
|
6773
|
+
/** The currency of `amountCents`. Only for a `fixed_amount` coupon. */
|
|
6774
|
+
currency?: CurrencyOrNull;
|
|
6775
|
+
/**
|
|
6776
|
+
* The percentage deducted by the coupon. Only for a `percentage` coupon. It must be greater than 0.
|
|
6777
|
+
* @example 10.5
|
|
6778
|
+
*/
|
|
6779
|
+
percentageRate?: number | null;
|
|
6780
|
+
/**
|
|
6781
|
+
* How often the coupon is deducted.
|
|
6782
|
+
* @example "once"
|
|
6783
|
+
*/
|
|
6784
|
+
frequency?: "once" | "recurring" | "forever";
|
|
6785
|
+
/**
|
|
6786
|
+
* The number of billing periods the coupon is deducted over. Only for a `recurring` coupon. It must be greater than 0.
|
|
6787
|
+
* @example 3
|
|
6788
|
+
*/
|
|
6789
|
+
frequencyDuration?: number | null;
|
|
6790
|
+
};
|
|
6791
|
+
/** The deviations from the coupon snapshot negotiated on the quote. Only the properties set here are overridden. */
|
|
6792
|
+
overrides?: {
|
|
6793
|
+
/**
|
|
6794
|
+
* Overrides the amount deducted by the coupon, in cents.
|
|
6795
|
+
* @example 15000
|
|
6796
|
+
*/
|
|
6797
|
+
amountCents?: number | null;
|
|
6798
|
+
/** Overrides the currency the coupon is priced in, which is how a catalog coupon is quoted in the currency of the deal. The figure in `amountCents` is not converted, it is restated in this currency. It is set only while it differs from the catalog record, and removed once they agree. */
|
|
6799
|
+
amountCurrency?: CurrencyOrNull;
|
|
6800
|
+
/**
|
|
6801
|
+
* Overrides the percentage deducted by the coupon. It must be greater than 0.
|
|
6802
|
+
* @example 15
|
|
6803
|
+
*/
|
|
6804
|
+
percentageRate?: number | null;
|
|
6805
|
+
/**
|
|
6806
|
+
* Overrides how often the coupon is deducted.
|
|
6807
|
+
* @example "recurring"
|
|
6808
|
+
*/
|
|
6809
|
+
frequency?: "once" | "recurring" | "forever";
|
|
6810
|
+
/**
|
|
6811
|
+
* Overrides the number of billing periods the coupon is deducted over. It must be greater than 0.
|
|
6812
|
+
* @example 6
|
|
6813
|
+
*/
|
|
6814
|
+
frequencyDuration?: number | null;
|
|
6815
|
+
};
|
|
6816
|
+
}
|
|
6817
|
+
export interface QuoteBillingItemWalletCreditObject {
|
|
6818
|
+
/**
|
|
6819
|
+
* Identifier of the entry within the quote version, assigned by the Lago user interface. It allows the quote document to reference the entry.
|
|
6820
|
+
* @example "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b"
|
|
6821
|
+
*/
|
|
6822
|
+
localId: string;
|
|
6823
|
+
/**
|
|
6824
|
+
* The kind of billing item.
|
|
6825
|
+
* @example "wallet_credit"
|
|
6826
|
+
*/
|
|
6827
|
+
type: "wallet_credit";
|
|
6828
|
+
/** The prepaid credit wallet to create for the customer. Unlike the other billing items, a wallet credit is not built from an existing record, so it carries no `id` and no `overrides`. `paidCredits`, `grantedCredits` and `rateAmount` are required to approve the version. */
|
|
6829
|
+
payload: {
|
|
6830
|
+
/**
|
|
6831
|
+
* The number of credits the customer pays for.
|
|
6832
|
+
* @example "100.0"
|
|
6833
|
+
*/
|
|
6834
|
+
paidCredits?: string | null;
|
|
6835
|
+
/**
|
|
6836
|
+
* The number of credits granted for free.
|
|
6837
|
+
* @example "20.0"
|
|
6838
|
+
*/
|
|
6839
|
+
grantedCredits?: string | null;
|
|
6840
|
+
/**
|
|
6841
|
+
* The value of one credit, in the currency of the wallet.
|
|
6842
|
+
* @example "1.0"
|
|
6843
|
+
*/
|
|
6844
|
+
rateAmount?: string | null;
|
|
6845
|
+
/** The currency of the wallet. */
|
|
6846
|
+
currency?: CurrencyOrNull;
|
|
6847
|
+
/**
|
|
6848
|
+
* The date and time in UTC (ISO 8601) when the credits expire.
|
|
6849
|
+
* @format date-time
|
|
6850
|
+
* @example "2027-01-01T00:00:00Z"
|
|
6851
|
+
*/
|
|
6852
|
+
expirationAt?: string | null;
|
|
6853
|
+
/** The limitations restricting what the credits can be spent on. */
|
|
6854
|
+
appliesTo?: {
|
|
6855
|
+
/**
|
|
6856
|
+
* The fee types the credits can be spent on.
|
|
6857
|
+
* @example ["charge"]
|
|
6858
|
+
*/
|
|
6859
|
+
feeTypes?: any[] | null;
|
|
6860
|
+
/**
|
|
6861
|
+
* The codes of the billable metrics the credits can be spent on.
|
|
6862
|
+
* @example ["api_calls"]
|
|
6863
|
+
*/
|
|
6864
|
+
billableMetricCodes?: any[] | null;
|
|
6865
|
+
};
|
|
6866
|
+
/** The rule automatically topping the wallet up. At most one rule is allowed, and its `trigger` is required, to approve the version. */
|
|
6867
|
+
recurringTransactionRules?: any[] | null;
|
|
6868
|
+
};
|
|
6869
|
+
}
|
|
6870
|
+
/**
|
|
6871
|
+
* 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.
|
|
6872
|
+
*
|
|
6873
|
+
* Which top-level keys are present depends on the `order_type` of the parent quote:
|
|
6874
|
+
* - `one_off`: `addOns`.
|
|
6875
|
+
* - `subscription_creation` and `subscription_amendment`: `plans`, plus the optional `coupons` and `walletCredits`.
|
|
6876
|
+
*
|
|
6877
|
+
* 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.
|
|
6878
|
+
*
|
|
6879
|
+
* 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.
|
|
6880
|
+
*
|
|
6881
|
+
* 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.
|
|
6882
|
+
*/
|
|
6883
|
+
export interface QuoteBillingItems {
|
|
6884
|
+
/** The add-ons billed once by a `one_off` quote. At least one entry is required to approve the version. */
|
|
6885
|
+
addOns?: QuoteBillingItemAddOnObject[];
|
|
6886
|
+
/** The plans subscribed to, or amended, by a `subscription_creation` or `subscription_amendment` quote. At least one entry is required to approve the version. */
|
|
6887
|
+
plans?: QuoteBillingItemPlanObject[];
|
|
6888
|
+
/** The coupons applied to the customer when the quote is executed. */
|
|
6889
|
+
coupons?: QuoteBillingItemCouponObject[];
|
|
6890
|
+
/** The prepaid credit wallets created for the customer when the quote is executed. */
|
|
6891
|
+
walletCredits?: QuoteBillingItemWalletCreditObject[];
|
|
6892
|
+
}
|
|
6893
|
+
export type OrderObjectExtended = OrderObject & {
|
|
6894
|
+
/** 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. */
|
|
6895
|
+
billing_snapshot: QuoteBillingItems;
|
|
6896
|
+
};
|
|
6897
|
+
export interface OrdersPaginated {
|
|
6898
|
+
orders: OrderObjectExtended[];
|
|
6899
|
+
meta: PaginationMeta;
|
|
6900
|
+
}
|
|
6901
|
+
export interface Order {
|
|
6902
|
+
order: OrderObjectExtended;
|
|
6903
|
+
}
|
|
6904
|
+
/** Parameters available when executing an order. The body is optional, as the execution mode is normally chosen when the order form is signed. */
|
|
6905
|
+
export interface OrderExecuteInput {
|
|
6906
|
+
order?: {
|
|
6907
|
+
/** 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. */
|
|
6908
|
+
execution_mode?: OrderExecutionModeEnum;
|
|
6909
|
+
};
|
|
6910
|
+
}
|
|
6911
|
+
/** The custom billing settings for your organization. */
|
|
6912
|
+
export interface OrganizationBillingConfiguration {
|
|
6913
|
+
/**
|
|
6914
|
+
* The customer invoice message that appears at the bottom of each billing documents.
|
|
6915
|
+
* @example "This is my customer footer"
|
|
6916
|
+
*/
|
|
6917
|
+
invoice_footer?: string | null;
|
|
6918
|
+
/**
|
|
6919
|
+
* 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.
|
|
6920
|
+
* @example 3
|
|
6921
|
+
*/
|
|
6922
|
+
invoice_grace_period?: number;
|
|
6923
|
+
/**
|
|
6924
|
+
* 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.
|
|
6925
|
+
* @example "en"
|
|
6926
|
+
*/
|
|
6927
|
+
document_locale?: string;
|
|
6928
|
+
}
|
|
6929
|
+
export interface OrganizationObject {
|
|
6930
|
+
/**
|
|
6931
|
+
* 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
|
|
6932
|
+
* @format uuid
|
|
6933
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6934
|
+
*/
|
|
6935
|
+
lago_id: string;
|
|
6936
|
+
/**
|
|
6937
|
+
* The name of your organization.
|
|
6938
|
+
* @example "Name1"
|
|
6939
|
+
*/
|
|
6940
|
+
name: string;
|
|
6941
|
+
/**
|
|
6942
|
+
* A concise and unique identifier for your organization, formed by combining the organization's `name` and `id`.
|
|
6943
|
+
* @example "NAME1-1234"
|
|
6944
|
+
*/
|
|
6945
|
+
slug?: string;
|
|
6946
|
+
/**
|
|
6947
|
+
* The date of creation of your organization, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
6948
|
+
* @format date-time
|
|
6949
|
+
* @example "2022-05-02T13:04:09Z"
|
|
6950
|
+
*/
|
|
6951
|
+
created_at: string | null;
|
|
6952
|
+
/**
|
|
6953
|
+
* 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.
|
|
6954
|
+
* @example "https://webhook.brex.com"
|
|
6955
|
+
*/
|
|
6956
|
+
webhook_url?: string | null;
|
|
6957
|
+
/**
|
|
6958
|
+
* The array containing your webhooks URLs.
|
|
6959
|
+
* @example ["https://webhook.brex.com","https://webhook2.brex.com"]
|
|
6960
|
+
*/
|
|
6961
|
+
webhook_urls?: any[] | null;
|
|
6962
|
+
/**
|
|
6963
|
+
* The country of your organization.
|
|
6964
|
+
* @example "US"
|
|
6965
|
+
*/
|
|
6966
|
+
country?: CountryOrNull;
|
|
6967
|
+
/**
|
|
6968
|
+
* The default currency of an organization.
|
|
6969
|
+
* @example "USD"
|
|
6970
|
+
*/
|
|
6971
|
+
default_currency?: Currency;
|
|
6972
|
+
/**
|
|
6973
|
+
* The first line of your organization's billing address.
|
|
6974
|
+
* @example "100 Brex Street"
|
|
6975
|
+
*/
|
|
6976
|
+
address_line1?: string | null;
|
|
6977
|
+
/**
|
|
6978
|
+
* The second line of your organization's billing address.
|
|
6979
|
+
* @example null
|
|
6980
|
+
*/
|
|
6981
|
+
address_line2?: string | null;
|
|
6982
|
+
/**
|
|
6983
|
+
* The state of your organization's billing address.
|
|
6984
|
+
* @example "NYC"
|
|
6985
|
+
*/
|
|
6986
|
+
state?: string | null;
|
|
6987
|
+
/**
|
|
6988
|
+
* The zipcode of your organization's billing address.
|
|
6989
|
+
* @example "10000"
|
|
6990
|
+
*/
|
|
6991
|
+
zipcode?: string | null;
|
|
6992
|
+
/**
|
|
6993
|
+
* The email address of your organization used to bill your customers.
|
|
6289
6994
|
* @format email
|
|
6290
6995
|
* @example "brex@brex.com"
|
|
6291
6996
|
*/
|
|
@@ -6335,6 +7040,11 @@ export interface OrganizationObject {
|
|
|
6335
7040
|
* @example "America/New_York"
|
|
6336
7041
|
*/
|
|
6337
7042
|
timezone?: Timezone;
|
|
7043
|
+
/**
|
|
7044
|
+
* 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`.
|
|
7045
|
+
* @example ["invoice.finalized","credit_note.created"]
|
|
7046
|
+
*/
|
|
7047
|
+
email_settings: ("invoice.finalized" | "credit_note.created" | "payment_receipt.created")[];
|
|
6338
7048
|
/** The custom billing settings for your organization. */
|
|
6339
7049
|
billing_configuration: OrganizationBillingConfiguration;
|
|
6340
7050
|
/** List of default organization taxes */
|
|
@@ -6350,6 +7060,113 @@ export interface OrganizationObject {
|
|
|
6350
7060
|
export interface Organization {
|
|
6351
7061
|
organization: OrganizationObject;
|
|
6352
7062
|
}
|
|
7063
|
+
export interface OrganizationUpdateInput {
|
|
7064
|
+
organization: {
|
|
7065
|
+
/**
|
|
7066
|
+
* 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.
|
|
7067
|
+
* @example "https://webhook.brex.com"
|
|
7068
|
+
*/
|
|
7069
|
+
webhook_url?: string | null;
|
|
7070
|
+
/**
|
|
7071
|
+
* The country of your organization.
|
|
7072
|
+
* @example "US"
|
|
7073
|
+
*/
|
|
7074
|
+
country?: CountryOrNull;
|
|
7075
|
+
/**
|
|
7076
|
+
* The default currency of an organization.
|
|
7077
|
+
* @example "USD"
|
|
7078
|
+
*/
|
|
7079
|
+
default_currency?: Currency;
|
|
7080
|
+
/**
|
|
7081
|
+
* The first line of your organization's billing address.
|
|
7082
|
+
* @example "100 Brex Street"
|
|
7083
|
+
*/
|
|
7084
|
+
address_line1?: string | null;
|
|
7085
|
+
/**
|
|
7086
|
+
* The second line of your organization's billing address.
|
|
7087
|
+
* @example null
|
|
7088
|
+
*/
|
|
7089
|
+
address_line2?: string | null;
|
|
7090
|
+
/**
|
|
7091
|
+
* The state of your organization's billing address.
|
|
7092
|
+
* @example "NYC"
|
|
7093
|
+
*/
|
|
7094
|
+
state?: string | null;
|
|
7095
|
+
/**
|
|
7096
|
+
* The zipcode of your organization's billing address.
|
|
7097
|
+
* @example "10000"
|
|
7098
|
+
*/
|
|
7099
|
+
zipcode?: string | null;
|
|
7100
|
+
/**
|
|
7101
|
+
* The email address of your organization used to bill your customers.
|
|
7102
|
+
* @format email
|
|
7103
|
+
* @example "brex@brex.com"
|
|
7104
|
+
*/
|
|
7105
|
+
email?: string | null;
|
|
7106
|
+
/**
|
|
7107
|
+
* The city of your organization's billing address.
|
|
7108
|
+
* @example "New York"
|
|
7109
|
+
*/
|
|
7110
|
+
city?: string | null;
|
|
7111
|
+
/**
|
|
7112
|
+
* The legal name of your organization.
|
|
7113
|
+
* @example null
|
|
7114
|
+
*/
|
|
7115
|
+
legal_name?: string | null;
|
|
7116
|
+
/**
|
|
7117
|
+
* The legal number of your organization.
|
|
7118
|
+
* @example null
|
|
7119
|
+
*/
|
|
7120
|
+
legal_number?: string | null;
|
|
7121
|
+
/**
|
|
7122
|
+
* This parameter configures the method of incrementing invoice numbers for your customers.
|
|
7123
|
+
*
|
|
7124
|
+
* - `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.
|
|
7125
|
+
* - `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.
|
|
7126
|
+
*
|
|
7127
|
+
* The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer.
|
|
7128
|
+
* @example "per_customer"
|
|
7129
|
+
*/
|
|
7130
|
+
document_numbering?: "per_customer" | "per_organization";
|
|
7131
|
+
/**
|
|
7132
|
+
* 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.
|
|
7133
|
+
* @example "ORG-1234"
|
|
7134
|
+
*/
|
|
7135
|
+
document_number_prefix?: string;
|
|
7136
|
+
/**
|
|
7137
|
+
* The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
|
|
7138
|
+
* @example 30
|
|
7139
|
+
*/
|
|
7140
|
+
net_payment_term?: number;
|
|
7141
|
+
/**
|
|
7142
|
+
* The tax identification number of your organization.
|
|
7143
|
+
* @example "US123456789"
|
|
7144
|
+
*/
|
|
7145
|
+
tax_identification_number?: string | null;
|
|
7146
|
+
/**
|
|
7147
|
+
* Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone.
|
|
7148
|
+
* @example "America/New_York"
|
|
7149
|
+
*/
|
|
7150
|
+
timezone?: Timezone;
|
|
7151
|
+
/**
|
|
7152
|
+
* 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`.
|
|
7153
|
+
* @example ["invoice.finalized","credit_note.created"]
|
|
7154
|
+
*/
|
|
7155
|
+
email_settings?: ("invoice.finalized" | "credit_note.created" | "payment_receipt.created")[];
|
|
7156
|
+
/** The custom billing settings for your organization. */
|
|
7157
|
+
billing_configuration?: OrganizationBillingConfiguration;
|
|
7158
|
+
/**
|
|
7159
|
+
* 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.
|
|
7160
|
+
* @example false
|
|
7161
|
+
*/
|
|
7162
|
+
finalize_zero_amount_invoice?: boolean;
|
|
7163
|
+
/**
|
|
7164
|
+
* A concise and unique identifier for your organization, used as a prefix in customer slugs.
|
|
7165
|
+
* @example "NAME1-1234"
|
|
7166
|
+
*/
|
|
7167
|
+
slug?: string;
|
|
7168
|
+
};
|
|
7169
|
+
}
|
|
6353
7170
|
export interface PaymentReceiptObject {
|
|
6354
7171
|
/**
|
|
6355
7172
|
* Unique identifier of the payment receipt, created by Lago.
|
|
@@ -6758,6 +7575,8 @@ export interface ChargeObject {
|
|
|
6758
7575
|
};
|
|
6759
7576
|
/**
|
|
6760
7577
|
* Specifies whether the charge accepts a target wallet for prepaid credits deduction.
|
|
7578
|
+
* When `true`, events may include a `target_wallet_code` in their `properties` to direct credit deduction to a specific wallet.
|
|
7579
|
+
* This field requires a premium integration.
|
|
6761
7580
|
* @example false
|
|
6762
7581
|
*/
|
|
6763
7582
|
accepts_target_wallet?: boolean | null;
|
|
@@ -7631,6 +8450,16 @@ export type ChargeInput = ChargeOverridableInput & {
|
|
|
7631
8450
|
* @example false
|
|
7632
8451
|
*/
|
|
7633
8452
|
prorated?: boolean;
|
|
8453
|
+
/**
|
|
8454
|
+
* Specifies whether the charge accepts a target wallet for prepaid credits deduction.
|
|
8455
|
+
* When set to `true`, events may include a `target_wallet_code` in their `properties` to direct credit deduction to a specific wallet.
|
|
8456
|
+
* If no `target_wallet_code` is provided on the event, the standard wallet selection logic is applied.
|
|
8457
|
+
* If the `target_wallet_code` does not match an existing wallet, no credits will be applied for that event.
|
|
8458
|
+
*
|
|
8459
|
+
* This field requires a premium integration.
|
|
8460
|
+
* @example false
|
|
8461
|
+
*/
|
|
8462
|
+
accepts_target_wallet?: boolean | null;
|
|
7634
8463
|
};
|
|
7635
8464
|
export interface ChargeCreateInput {
|
|
7636
8465
|
charge: ChargeInput & {
|
|
@@ -7786,67 +8615,275 @@ export type FixedChargeInput = FixedChargeOverridableInput & {
|
|
|
7786
8615
|
* @format uuid
|
|
7787
8616
|
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
7788
8617
|
*/
|
|
7789
|
-
add_on_id?: string;
|
|
8618
|
+
add_on_id?: string;
|
|
8619
|
+
/**
|
|
8620
|
+
* Unique code identifying an add-on. Either add_on_id or add_on_code is required.
|
|
8621
|
+
* @example "setup_fee"
|
|
8622
|
+
*/
|
|
8623
|
+
add_on_code?: string;
|
|
8624
|
+
/**
|
|
8625
|
+
* Unique code identifying the fixed charge within the plan.
|
|
8626
|
+
* @example "setup_fee_charge"
|
|
8627
|
+
*/
|
|
8628
|
+
code?: string;
|
|
8629
|
+
/**
|
|
8630
|
+
* Specifies the pricing model used for the calculation of the fixed charge fee. It can be any of the following values:
|
|
8631
|
+
* - `standard`
|
|
8632
|
+
* - `graduated`
|
|
8633
|
+
* - `volume`
|
|
8634
|
+
*/
|
|
8635
|
+
charge_model?: FixedChargeModelEnum;
|
|
8636
|
+
/**
|
|
8637
|
+
* This field determines the billing timing for this fixed charge. When set to `true`, the charge is due and invoiced immediately at the beginning of the billing period. When set to `false`, the charge is due and invoiced at the end of the billing period.
|
|
8638
|
+
* @example true
|
|
8639
|
+
*/
|
|
8640
|
+
pay_in_advance?: boolean;
|
|
8641
|
+
/**
|
|
8642
|
+
* Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
|
|
8643
|
+
*
|
|
8644
|
+
* - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
|
|
8645
|
+
* - If set to `false`, the charge is billed in full.
|
|
8646
|
+
* @example false
|
|
8647
|
+
*/
|
|
8648
|
+
prorated?: boolean;
|
|
8649
|
+
};
|
|
8650
|
+
export interface FixedChargeCreateInput {
|
|
8651
|
+
fixed_charge: FixedChargeInput & {
|
|
8652
|
+
/**
|
|
8653
|
+
* This field determines whether the creation of the fixed charge should be cascaded to the children plans. When set to `true`, the fixed charge will be created in children plans. Conversely, when set to `false`, the fixed charge will only be created in the plan itself. If not defined in the request, default value is `false`.
|
|
8654
|
+
* @example true
|
|
8655
|
+
*/
|
|
8656
|
+
cascade_updates?: boolean;
|
|
8657
|
+
};
|
|
8658
|
+
}
|
|
8659
|
+
export interface FixedCharge {
|
|
8660
|
+
fixed_charge: FixedChargeObject;
|
|
8661
|
+
}
|
|
8662
|
+
export interface FixedChargeUpdateInput {
|
|
8663
|
+
fixed_charge: FixedChargeInput & {
|
|
8664
|
+
/**
|
|
8665
|
+
* This field determines whether the changes made to the fixed charge should be cascaded to the children plans. When set to `true`, the changes will be cascaded into children. Conversely, when set to `false`, the changes will only be applied to the plan itself. If not defined in the request, default value is `false`.
|
|
8666
|
+
* @example true
|
|
8667
|
+
*/
|
|
8668
|
+
cascade_updates?: boolean;
|
|
8669
|
+
};
|
|
8670
|
+
}
|
|
8671
|
+
export interface FixedChargeDeleteInput {
|
|
8672
|
+
fixed_charge?: {
|
|
8673
|
+
/**
|
|
8674
|
+
* When set to `true`, the deletion will be cascaded to the children plans.
|
|
8675
|
+
* @example true
|
|
8676
|
+
*/
|
|
8677
|
+
cascade_updates?: boolean;
|
|
8678
|
+
};
|
|
8679
|
+
}
|
|
8680
|
+
export interface QuoteBaseObject {
|
|
8681
|
+
/**
|
|
8682
|
+
* Unique identifier of the quote, created by Lago.
|
|
8683
|
+
* @format uuid
|
|
8684
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
8685
|
+
*/
|
|
8686
|
+
lago_id: string;
|
|
8687
|
+
/**
|
|
8688
|
+
* The unique number assigned to the quote by Lago.
|
|
8689
|
+
* @example "QT-2026-0001"
|
|
8690
|
+
*/
|
|
8691
|
+
number: string;
|
|
8692
|
+
/**
|
|
8693
|
+
* The commercial motion the quote describes. It can be any of the following values:
|
|
8694
|
+
* - `subscription_creation`: the quote creates one or more subscriptions.
|
|
8695
|
+
* - `subscription_amendment`: the quote amends an existing subscription, named by the quote's own `lago_subscription_id`.
|
|
8696
|
+
* - `one_off`: the quote bills add-ons once, without any subscription.
|
|
8697
|
+
*/
|
|
8698
|
+
order_type: QuoteOrderTypeEnum;
|
|
8699
|
+
/**
|
|
8700
|
+
* Unique identifier of the customer the quote is addressed to, created by Lago.
|
|
8701
|
+
* @format uuid
|
|
8702
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
8703
|
+
*/
|
|
8704
|
+
lago_customer_id: string;
|
|
8705
|
+
/**
|
|
8706
|
+
* Unique identifier of the subscription the quote amends, created by Lago. It is set only when the `order_type` is `subscription_amendment`.
|
|
8707
|
+
* @format uuid
|
|
8708
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
8709
|
+
*/
|
|
8710
|
+
lago_subscription_id: string | null;
|
|
8711
|
+
/**
|
|
8712
|
+
* Unique identifier of the organization, created by Lago.
|
|
8713
|
+
* @format uuid
|
|
8714
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
8715
|
+
*/
|
|
8716
|
+
lago_organization_id: string;
|
|
8717
|
+
/**
|
|
8718
|
+
* The date and time in UTC (ISO 8601) when the quote was created.
|
|
8719
|
+
* @format date-time
|
|
8720
|
+
* @example "2026-04-29T08:59:51Z"
|
|
8721
|
+
*/
|
|
8722
|
+
created_at: string;
|
|
8723
|
+
/**
|
|
8724
|
+
* The date and time in UTC (ISO 8601) when the quote was last updated.
|
|
8725
|
+
* @format date-time
|
|
8726
|
+
* @example "2026-04-29T08:59:51Z"
|
|
8727
|
+
*/
|
|
8728
|
+
updated_at: string;
|
|
8729
|
+
}
|
|
8730
|
+
/**
|
|
8731
|
+
* The status of the quote version. It can be any of the following values:
|
|
8732
|
+
* - `draft`: the version is still editable.
|
|
8733
|
+
* - `approved`: the version has been approved and an order form has been generated from it.
|
|
8734
|
+
* - `voided`: the version is no longer actionable.
|
|
8735
|
+
*
|
|
8736
|
+
* A quote has at most one version in `draft` or `approved` status at any time; all the other versions are `voided`.
|
|
8737
|
+
* @example "draft"
|
|
8738
|
+
*/
|
|
8739
|
+
export type QuoteVersionStatusEnum = "draft" | "approved" | "voided";
|
|
8740
|
+
/**
|
|
8741
|
+
* The reason why the quote version was voided. It is `null` unless the `status` is `voided`. It can be any of the following values:
|
|
8742
|
+
* - `manual`: voided explicitly, through the API or the Lago user interface.
|
|
8743
|
+
* - `superseded`: voided because the version was cloned into a new draft.
|
|
8744
|
+
* - `cascade_of_expired`: voided because the order form generated from the version expired.
|
|
8745
|
+
* - `cascade_of_voided`: voided because the order form generated from the version was voided.
|
|
8746
|
+
* @example "manual"
|
|
8747
|
+
*/
|
|
8748
|
+
export type QuoteVersionVoidReasonEnum = "manual" | "superseded" | "cascade_of_expired" | "cascade_of_voided";
|
|
8749
|
+
export interface QuoteVersionObject {
|
|
8750
|
+
/**
|
|
8751
|
+
* Unique identifier of the quote version, created by Lago.
|
|
8752
|
+
* @format uuid
|
|
8753
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
8754
|
+
*/
|
|
8755
|
+
lago_id: string;
|
|
8756
|
+
/**
|
|
8757
|
+
* Unique identifier of the quote the version belongs to, created by Lago.
|
|
8758
|
+
* @format uuid
|
|
8759
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
8760
|
+
*/
|
|
8761
|
+
lago_quote_id: string;
|
|
8762
|
+
/**
|
|
8763
|
+
* Unique identifier of the organization, created by Lago.
|
|
8764
|
+
* @format uuid
|
|
8765
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
8766
|
+
*/
|
|
8767
|
+
lago_organization_id: string;
|
|
8768
|
+
/**
|
|
8769
|
+
* The number of the version within the quote. It starts at 1 and increases by 1 for every new version created by cloning.
|
|
8770
|
+
* @example 1
|
|
8771
|
+
*/
|
|
8772
|
+
version: number;
|
|
8773
|
+
/**
|
|
8774
|
+
* The status of the quote version. It can be any of the following values:
|
|
8775
|
+
* - `draft`: the version is still editable.
|
|
8776
|
+
* - `approved`: the version has been approved and an order form has been generated from it.
|
|
8777
|
+
* - `voided`: the version is no longer actionable.
|
|
8778
|
+
*
|
|
8779
|
+
* A quote has at most one version in `draft` or `approved` status at any time; all the other versions are `voided`.
|
|
8780
|
+
*/
|
|
8781
|
+
status: QuoteVersionStatusEnum;
|
|
8782
|
+
/** The currency the version is quoted in. */
|
|
8783
|
+
currency: CurrencyOrNull;
|
|
8784
|
+
/**
|
|
8785
|
+
* Unique code identifying the billing entity that issues the deal. It is resolved rather than stored: the version's own entity when it names one, then the entity of the subscription being amended for a `subscription_amendment` quote, then the customer's own. It is `null` when none of them resolves. An amendment cannot name an entity itself, since the subscription it restates is already bound to one, and naming one on an amendment is rejected.
|
|
8786
|
+
* @example "acme_corp"
|
|
8787
|
+
*/
|
|
8788
|
+
billing_entity_code: string | null;
|
|
8789
|
+
/**
|
|
8790
|
+
* The reason why the quote version was voided. It is `null` unless the `status` is `voided`. It can be any of the following values:
|
|
8791
|
+
* - `manual`: voided explicitly, through the API or the Lago user interface.
|
|
8792
|
+
* - `superseded`: voided because the version was cloned into a new draft.
|
|
8793
|
+
* - `cascade_of_expired`: voided because the order form generated from the version expired.
|
|
8794
|
+
* - `cascade_of_voided`: voided because the order form generated from the version was voided.
|
|
8795
|
+
*/
|
|
8796
|
+
void_reason: QuoteVersionVoidReasonEnum;
|
|
8797
|
+
/**
|
|
8798
|
+
* The date and time in UTC (ISO 8601) when the version was approved. It is `null` unless the `status` is `approved`.
|
|
8799
|
+
* @format date-time
|
|
8800
|
+
* @example "2026-04-29T08:59:51Z"
|
|
8801
|
+
*/
|
|
8802
|
+
approved_at: string | null;
|
|
8803
|
+
/**
|
|
8804
|
+
* The date and time in UTC (ISO 8601) when the version was voided. It is `null` unless the `status` is `voided`.
|
|
8805
|
+
* @format date-time
|
|
8806
|
+
* @example "2026-04-29T08:59:51Z"
|
|
8807
|
+
*/
|
|
8808
|
+
voided_at: string | null;
|
|
8809
|
+
/**
|
|
8810
|
+
* The date and time in UTC (ISO 8601) when the version was created.
|
|
8811
|
+
* @format date-time
|
|
8812
|
+
* @example "2026-04-29T08:59:51Z"
|
|
8813
|
+
*/
|
|
8814
|
+
created_at: string;
|
|
7790
8815
|
/**
|
|
7791
|
-
*
|
|
7792
|
-
* @
|
|
8816
|
+
* The date and time in UTC (ISO 8601) when the version was last updated.
|
|
8817
|
+
* @format date-time
|
|
8818
|
+
* @example "2026-04-29T08:59:51Z"
|
|
7793
8819
|
*/
|
|
7794
|
-
|
|
8820
|
+
updated_at: string;
|
|
8821
|
+
}
|
|
8822
|
+
export type QuoteObject = QuoteBaseObject & {
|
|
8823
|
+
/** The latest version of the quote. Its `content` and `billing_items` are omitted here; retrieve the version to get them. */
|
|
8824
|
+
current_version: QuoteVersionObject | null;
|
|
8825
|
+
};
|
|
8826
|
+
export interface QuotesPaginated {
|
|
8827
|
+
quotes: QuoteObject[];
|
|
8828
|
+
meta: PaginationMeta;
|
|
8829
|
+
}
|
|
8830
|
+
export interface QuoteOwnerObject {
|
|
7795
8831
|
/**
|
|
7796
|
-
* Unique
|
|
7797
|
-
* @
|
|
8832
|
+
* Unique identifier of the user owning the quote, created by Lago.
|
|
8833
|
+
* @format uuid
|
|
8834
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
7798
8835
|
*/
|
|
7799
|
-
|
|
8836
|
+
lago_id: string;
|
|
7800
8837
|
/**
|
|
7801
|
-
*
|
|
7802
|
-
*
|
|
7803
|
-
*
|
|
7804
|
-
* - `volume`
|
|
8838
|
+
* The email address of the user owning the quote.
|
|
8839
|
+
* @format email
|
|
8840
|
+
* @example "sales@getlago.com"
|
|
7805
8841
|
*/
|
|
7806
|
-
|
|
8842
|
+
email: string | null;
|
|
8843
|
+
}
|
|
8844
|
+
export type QuoteObjectExtended = QuoteObject & {
|
|
8845
|
+
/** The users of the organization responsible for the quote. */
|
|
8846
|
+
owners: QuoteOwnerObject[];
|
|
8847
|
+
};
|
|
8848
|
+
export interface Quote {
|
|
8849
|
+
quote: QuoteObjectExtended;
|
|
8850
|
+
}
|
|
8851
|
+
export interface QuoteVersionsPaginated {
|
|
8852
|
+
quote_versions: QuoteVersionObject[];
|
|
8853
|
+
meta: PaginationMeta;
|
|
8854
|
+
}
|
|
8855
|
+
export type QuoteVersionObjectExtended = QuoteVersionObject & {
|
|
7807
8856
|
/**
|
|
7808
|
-
*
|
|
7809
|
-
* @example
|
|
8857
|
+
* The HTML body of the quote document, as authored in the Lago user interface. It may reference the entries of `billing_items` through their `localId`.
|
|
8858
|
+
* @example "<h1>Quote QT-2026-0001</h1><p>Prepared for Acme Corp.</p>"
|
|
7810
8859
|
*/
|
|
7811
|
-
|
|
8860
|
+
content: string | null;
|
|
7812
8861
|
/**
|
|
7813
|
-
*
|
|
8862
|
+
* 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.
|
|
7814
8863
|
*
|
|
7815
|
-
* -
|
|
7816
|
-
*
|
|
7817
|
-
*
|
|
8864
|
+
* Which top-level keys are present depends on the `order_type` of the parent quote:
|
|
8865
|
+
* - `one_off`: `addOns`.
|
|
8866
|
+
* - `subscription_creation` and `subscription_amendment`: `plans`, plus the optional `coupons` and `walletCredits`.
|
|
8867
|
+
*
|
|
8868
|
+
* 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.
|
|
8869
|
+
*
|
|
8870
|
+
* 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.
|
|
8871
|
+
*
|
|
8872
|
+
* 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.
|
|
7818
8873
|
*/
|
|
7819
|
-
|
|
8874
|
+
billing_items: QuoteBillingItems;
|
|
7820
8875
|
};
|
|
7821
|
-
export interface
|
|
7822
|
-
|
|
7823
|
-
/**
|
|
7824
|
-
* This field determines whether the creation of the fixed charge should be cascaded to the children plans. When set to `true`, the fixed charge will be created in children plans. Conversely, when set to `false`, the fixed charge will only be created in the plan itself. If not defined in the request, default value is `false`.
|
|
7825
|
-
* @example true
|
|
7826
|
-
*/
|
|
7827
|
-
cascade_updates?: boolean;
|
|
7828
|
-
};
|
|
7829
|
-
}
|
|
7830
|
-
export interface FixedCharge {
|
|
7831
|
-
fixed_charge: FixedChargeObject;
|
|
7832
|
-
}
|
|
7833
|
-
export interface FixedChargeUpdateInput {
|
|
7834
|
-
fixed_charge: FixedChargeInput & {
|
|
7835
|
-
/**
|
|
7836
|
-
* This field determines whether the changes made to the fixed charge should be cascaded to the children plans. When set to `true`, the changes will be cascaded into children. Conversely, when set to `false`, the changes will only be applied to the plan itself. If not defined in the request, default value is `false`.
|
|
7837
|
-
* @example true
|
|
7838
|
-
*/
|
|
7839
|
-
cascade_updates?: boolean;
|
|
7840
|
-
};
|
|
8876
|
+
export interface QuoteVersion {
|
|
8877
|
+
quote_version: QuoteVersionObjectExtended;
|
|
7841
8878
|
}
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
8879
|
+
/** Parameters available when approving a quote version. */
|
|
8880
|
+
export interface QuoteVersionApproveInput {
|
|
8881
|
+
/**
|
|
8882
|
+
* The date and time in UTC (ISO 8601) when the order form generated by the approval expires. It must be in the future, and must fall strictly before the day the quoted deal stops being executable, otherwise the approval is rejected with a `422`. That boundary is the earliest of the `endDate` of any quoted plan and the `expirationAt` of any quoted wallet credit or recurring top-up rule. A `one_off` quote carries none of them, so its signing window is never bounded. When `expires_at` is omitted, the order form never expires.
|
|
8883
|
+
* @format date-time
|
|
8884
|
+
* @example "2026-06-30T23:59:59Z"
|
|
8885
|
+
*/
|
|
8886
|
+
expires_at?: string;
|
|
7850
8887
|
}
|
|
7851
8888
|
/** Based plan overrides. */
|
|
7852
8889
|
export interface PlanOverridesObject {
|
|
@@ -8291,7 +9328,7 @@ export interface AlertObject {
|
|
|
8291
9328
|
* The type of alert.
|
|
8292
9329
|
* @example "billable_metric_current_usage_amount"
|
|
8293
9330
|
*/
|
|
8294
|
-
alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
|
|
9331
|
+
alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount" | "billable_metric_lifetime_usage_units";
|
|
8295
9332
|
/**
|
|
8296
9333
|
* Unique code used to identify the alert.
|
|
8297
9334
|
* @example "storage_threshold_alert"
|
|
@@ -8337,7 +9374,7 @@ export interface AlertCreateInput {
|
|
|
8337
9374
|
* The type of alert.
|
|
8338
9375
|
* @example "billable_metric_current_usage_amount"
|
|
8339
9376
|
*/
|
|
8340
|
-
alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
|
|
9377
|
+
alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount" | "billable_metric_lifetime_usage_units";
|
|
8341
9378
|
/**
|
|
8342
9379
|
* Unique code used to identify the alert.
|
|
8343
9380
|
* @example "storage_threshold_alert"
|
|
@@ -8357,7 +9394,7 @@ export interface AlertBatchCreateInput {
|
|
|
8357
9394
|
* The type of alert.
|
|
8358
9395
|
* @example "billable_metric_current_usage_amount"
|
|
8359
9396
|
*/
|
|
8360
|
-
alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
|
|
9397
|
+
alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount" | "billable_metric_lifetime_usage_units";
|
|
8361
9398
|
/**
|
|
8362
9399
|
* Unique code used to identify the alert.
|
|
8363
9400
|
* @example "storage_threshold_alert"
|
|
@@ -8459,7 +9496,7 @@ export interface TaxBaseInput {
|
|
|
8459
9496
|
*/
|
|
8460
9497
|
rate?: string;
|
|
8461
9498
|
/**
|
|
8462
|
-
* Internal description of the
|
|
9499
|
+
* Internal description of the tax
|
|
8463
9500
|
* @example "French standard VAT"
|
|
8464
9501
|
*/
|
|
8465
9502
|
description?: string | null;
|
|
@@ -8914,7 +9951,7 @@ export interface TriggeredAlertObject {
|
|
|
8914
9951
|
* The type of alert triggered.
|
|
8915
9952
|
* @example "billable_metric_current_usage_amount"
|
|
8916
9953
|
*/
|
|
8917
|
-
alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
|
|
9954
|
+
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";
|
|
8918
9955
|
/**
|
|
8919
9956
|
* Unique code used to identify the alert triggered.
|
|
8920
9957
|
* @example "storage_threshold_alert"
|
|
@@ -8944,7 +9981,7 @@ export interface TriggeredAlertObject {
|
|
|
8944
9981
|
/** Array of thresholds crossed. All the recurring threshold values are present. */
|
|
8945
9982
|
crossed_thresholds: AlertThresholdObject[];
|
|
8946
9983
|
}
|
|
8947
|
-
export interface
|
|
9984
|
+
export interface CustomerIntegrationErrorObject {
|
|
8948
9985
|
/**
|
|
8949
9986
|
* 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.
|
|
8950
9987
|
* @format uuid
|
|
@@ -9277,6 +10314,10 @@ export interface PaymentRequestPaymentFailureObject {
|
|
|
9277
10314
|
payment_provider_code?: string;
|
|
9278
10315
|
provider_error?: string | Record<string, any>;
|
|
9279
10316
|
}
|
|
10317
|
+
export type QuoteWithVersionObject = QuoteBaseObject & {
|
|
10318
|
+
/** The version of the quote the event happened to. It is not necessarily the current version of the quote, as a `quote.voided` event triggered by a clone names the version that was voided while the quote already carries its replacement. Its `content` and `billing_items` are omitted here; retrieve the version to get them. */
|
|
10319
|
+
version: QuoteVersionObject;
|
|
10320
|
+
};
|
|
9280
10321
|
export type SubscriptionWithCustomerObject = SubscriptionObject & {
|
|
9281
10322
|
plan: PlanObject;
|
|
9282
10323
|
customer: CustomerObject;
|
|
@@ -9326,7 +10367,6 @@ export interface WalletTransactionPaymentFailureObject {
|
|
|
9326
10367
|
payment_provider_code?: string;
|
|
9327
10368
|
provider_error?: string | Record<string, any>;
|
|
9328
10369
|
}
|
|
9329
|
-
export type CustomerPaymentProvidernErrorObject = CustomerPaymentProviderErrorObject;
|
|
9330
10370
|
export type QueryParamsType = Record<string | number, any>;
|
|
9331
10371
|
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
|
|
9332
10372
|
export interface FullRequestParams extends Omit<RequestInit, "body"> {
|
|
@@ -9387,7 +10427,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
9387
10427
|
}
|
|
9388
10428
|
/**
|
|
9389
10429
|
* @title Lago API documentation
|
|
9390
|
-
* @version 1.
|
|
10430
|
+
* @version 1.53.0
|
|
9391
10431
|
* @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
|
|
9392
10432
|
* @baseUrl https://api.getlago.com/api/v1
|
|
9393
10433
|
* @externalDocs https://github.com/getlago
|
|
@@ -9418,7 +10458,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
9418
10458
|
* @request POST:/billing_entities
|
|
9419
10459
|
* @secure
|
|
9420
10460
|
*/
|
|
9421
|
-
createBillingEntity: (data: BillingEntityCreateInput, params?: RequestParams) => Promise<HttpResponse<
|
|
10461
|
+
createBillingEntity: (data: BillingEntityCreateInput, params?: RequestParams) => Promise<HttpResponse<{
|
|
10462
|
+
/** Billing entity object */
|
|
10463
|
+
billing_entity: BillingEntityObject;
|
|
10464
|
+
}, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
|
|
9422
10465
|
/**
|
|
9423
10466
|
* @description This endpoint returns a specific billing entity by its code
|
|
9424
10467
|
*
|
|
@@ -9440,7 +10483,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
9440
10483
|
* @request PUT:/billing_entities/{code}
|
|
9441
10484
|
* @secure
|
|
9442
10485
|
*/
|
|
9443
|
-
updateBillingEntity: (code: string, data: BillingEntityUpdateInput, params?: RequestParams) => Promise<HttpResponse<
|
|
10486
|
+
updateBillingEntity: (code: string, data: BillingEntityUpdateInput, params?: RequestParams) => Promise<HttpResponse<{
|
|
10487
|
+
billing_entity: BillingEntityObjectExtended;
|
|
10488
|
+
}, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
|
|
9444
10489
|
};
|
|
9445
10490
|
activityLogs: {
|
|
9446
10491
|
/**
|
|
@@ -10141,9 +11186,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10141
11186
|
currency?: string;
|
|
10142
11187
|
/** Filter credit notes by reasons. Possible values are `product_unsatisfactory`, `order_change`, `order_cancellation`, `fraudulent_charge`, `duplicated_charge` or `other`. */
|
|
10143
11188
|
reason?: "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "duplicated_charge" | "other";
|
|
10144
|
-
/** Filter credit notes by credit status. Possible values are `available`, `consumed`
|
|
11189
|
+
/** Filter credit notes by credit status. Possible values are `available`, `consumed` or `voided`. */
|
|
10145
11190
|
credit_status?: "available" | "consumed" | "voided";
|
|
10146
|
-
/** Filter credit notes by refund status. Possible values are `pending`, `succeeded`
|
|
11191
|
+
/** Filter credit notes by refund status. Possible values are `pending`, `succeeded` or `failed`. */
|
|
10147
11192
|
refund_status?: "pending" | "succeeded" | "failed";
|
|
10148
11193
|
/**
|
|
10149
11194
|
* Filter credit notes by their related invoice number.
|
|
@@ -10165,6 +11210,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10165
11210
|
* @example 100000
|
|
10166
11211
|
*/
|
|
10167
11212
|
amount_to?: number;
|
|
11213
|
+
/**
|
|
11214
|
+
* 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.
|
|
11215
|
+
* @example ["credit","refund"]
|
|
11216
|
+
*/
|
|
11217
|
+
"types[]"?: ("credit" | "refund" | "offset")[];
|
|
10168
11218
|
/**
|
|
10169
11219
|
* Filter credit notes belonging to a self billed invoice. Possible values are `true` or `false`.
|
|
10170
11220
|
* @example true
|
|
@@ -10298,6 +11348,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10298
11348
|
* @example 20
|
|
10299
11349
|
*/
|
|
10300
11350
|
per_page?: number;
|
|
11351
|
+
/**
|
|
11352
|
+
* Filter customers by external ID.
|
|
11353
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
11354
|
+
*/
|
|
11355
|
+
external_id?: string;
|
|
10301
11356
|
/**
|
|
10302
11357
|
* Filter customers by account type.
|
|
10303
11358
|
* @example ["customer","partner"]
|
|
@@ -10659,6 +11714,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10659
11714
|
* @example 20
|
|
10660
11715
|
*/
|
|
10661
11716
|
per_page?: number;
|
|
11717
|
+
/**
|
|
11718
|
+
* The subscription external unique identifier (provided by your own application).
|
|
11719
|
+
* @example "subscription_premium"
|
|
11720
|
+
*/
|
|
11721
|
+
external_id?: string;
|
|
10662
11722
|
/**
|
|
10663
11723
|
* 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.
|
|
10664
11724
|
* @example "premium"
|
|
@@ -10712,7 +11772,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10712
11772
|
"billing_entity_codes[]"?: string[];
|
|
10713
11773
|
}, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
10714
11774
|
/**
|
|
10715
|
-
* @description This endpoint is used to update an existing wallet with prepaid credits.
|
|
11775
|
+
* @description This endpoint is used to update an existing wallet with prepaid credits. A terminated wallet cannot be updated and returns a `422` error.
|
|
10716
11776
|
*
|
|
10717
11777
|
* @tags wallets
|
|
10718
11778
|
* @name UpdateCustomerWallet
|
|
@@ -11138,7 +12198,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11138
12198
|
};
|
|
11139
12199
|
fees: {
|
|
11140
12200
|
/**
|
|
11141
|
-
* @description This endpoint is used for retrieving all fees that
|
|
12201
|
+
* @description This endpoint is used for retrieving all fees that have been issued.
|
|
11142
12202
|
*
|
|
11143
12203
|
* @tags fees
|
|
11144
12204
|
* @name FindAllFees
|
|
@@ -11172,67 +12232,67 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11172
12232
|
* @example "et_12345678"
|
|
11173
12233
|
*/
|
|
11174
12234
|
event_transaction_id?: string;
|
|
11175
|
-
/** Filter results by fee
|
|
12235
|
+
/** Filter results by the fee's currency. */
|
|
11176
12236
|
currency?: Currency;
|
|
11177
12237
|
/**
|
|
11178
|
-
* The fee type. Possible values are `
|
|
12238
|
+
* The fee type. Possible values are `add_on`, `charge`, `fixed_charge`, `credit`, `subscription` or `commitment`.
|
|
11179
12239
|
* @example "charge"
|
|
11180
12240
|
*/
|
|
11181
|
-
fee_type?: "charge" | "add_on" | "subscription" | "credit" | "commitment";
|
|
12241
|
+
fee_type?: "charge" | "fixed_charge" | "add_on" | "subscription" | "credit" | "commitment";
|
|
11182
12242
|
/**
|
|
11183
12243
|
* Filter results by the `code` of the billable metric attached to the fee. Only applies to `charge` types.
|
|
11184
12244
|
* @example "bm_code"
|
|
11185
12245
|
*/
|
|
11186
12246
|
billable_metric_code?: string;
|
|
11187
12247
|
/**
|
|
11188
|
-
* 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`.
|
|
12248
|
+
* 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`.
|
|
11189
12249
|
* @example "succeeded"
|
|
11190
12250
|
*/
|
|
11191
12251
|
payment_status?: "pending" | "succeeded" | "failed" | "refunded";
|
|
11192
12252
|
/**
|
|
11193
|
-
* Filter results created after
|
|
12253
|
+
* Filter results created at or after this date and time in UTC.
|
|
11194
12254
|
* @format date-time
|
|
11195
12255
|
* @example "2023-03-28T12:21:51Z"
|
|
11196
12256
|
*/
|
|
11197
12257
|
created_at_from?: string;
|
|
11198
12258
|
/**
|
|
11199
|
-
* Filter results created before
|
|
12259
|
+
* Filter results created at or before this date and time in UTC.
|
|
11200
12260
|
* @format date-time
|
|
11201
12261
|
* @example "2023-03-28T12:21:51Z"
|
|
11202
12262
|
*/
|
|
11203
12263
|
created_at_to?: string;
|
|
11204
12264
|
/**
|
|
11205
|
-
* Filter results with payment success after
|
|
12265
|
+
* Filter results with a payment success at or after this date and time in UTC.
|
|
11206
12266
|
* @format date-time
|
|
11207
12267
|
* @example "2023-03-28T12:21:51Z"
|
|
11208
12268
|
*/
|
|
11209
12269
|
succeeded_at_from?: string;
|
|
11210
12270
|
/**
|
|
11211
|
-
* Filter results with payment success
|
|
12271
|
+
* Filter results with a payment success at or before this date and time in UTC.
|
|
11212
12272
|
* @format date-time
|
|
11213
12273
|
* @example "2023-03-28T12:21:51Z"
|
|
11214
12274
|
*/
|
|
11215
12275
|
succeeded_at_to?: string;
|
|
11216
12276
|
/**
|
|
11217
|
-
* Filter results with payment failure after
|
|
12277
|
+
* Filter results with a payment failure at or after this date and time in UTC.
|
|
11218
12278
|
* @format date-time
|
|
11219
12279
|
* @example "2023-03-28T12:21:51Z"
|
|
11220
12280
|
*/
|
|
11221
12281
|
failed_at_from?: string;
|
|
11222
12282
|
/**
|
|
11223
|
-
* Filter results with payment failure
|
|
12283
|
+
* Filter results with a payment failure at or before this date and time in UTC.
|
|
11224
12284
|
* @format date-time
|
|
11225
12285
|
* @example "2023-03-28T12:21:51Z"
|
|
11226
12286
|
*/
|
|
11227
12287
|
failed_at_to?: string;
|
|
11228
12288
|
/**
|
|
11229
|
-
* Filter results with payment refund after
|
|
12289
|
+
* Filter results with a payment refund at or after this date and time in UTC.
|
|
11230
12290
|
* @format date-time
|
|
11231
12291
|
* @example "2023-03-28T12:21:51Z"
|
|
11232
12292
|
*/
|
|
11233
12293
|
refunded_at_from?: string;
|
|
11234
12294
|
/**
|
|
11235
|
-
* Filter results with payment refund
|
|
12295
|
+
* Filter results with a payment refund at or before this date and time in UTC.
|
|
11236
12296
|
* @format date-time
|
|
11237
12297
|
* @example "2023-03-28T12:21:51Z"
|
|
11238
12298
|
*/
|
|
@@ -11351,6 +12411,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11351
12411
|
* @example true
|
|
11352
12412
|
*/
|
|
11353
12413
|
payment_dispute_lost?: boolean;
|
|
12414
|
+
/**
|
|
12415
|
+
* 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.
|
|
12416
|
+
* @example true
|
|
12417
|
+
*/
|
|
12418
|
+
partially_paid?: boolean;
|
|
12419
|
+
/**
|
|
12420
|
+
* 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.
|
|
12421
|
+
* @example ["payment","credit_note"]
|
|
12422
|
+
*/
|
|
12423
|
+
"settlements[]"?: ("payment" | "credit_note")[];
|
|
11354
12424
|
/** Filter invoices by invoice type. Possible values are `subscription`, `add_on`, `credit`, `one_off`, `advance_charges` or `progressive_billing`. */
|
|
11355
12425
|
invoice_type?: "subscription" | "add_on" | "credit" | "one_off" | "advance_charges" | "progressive_billing";
|
|
11356
12426
|
/**
|
|
@@ -11375,7 +12445,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11375
12445
|
purchase_order_number?: string;
|
|
11376
12446
|
}, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized>>;
|
|
11377
12447
|
/**
|
|
11378
|
-
* @description This endpoint is used for updating an existing invoice.
|
|
12448
|
+
* @description This endpoint is used for updating an existing invoice. A voided invoice cannot be updated and returns a `405` error.
|
|
11379
12449
|
*
|
|
11380
12450
|
* @tags invoices
|
|
11381
12451
|
* @name UpdateInvoice
|
|
@@ -11383,7 +12453,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11383
12453
|
* @request PUT:/invoices/{lago_id}
|
|
11384
12454
|
* @secure
|
|
11385
12455
|
*/
|
|
11386
|
-
updateInvoice: (lagoId: string, data: InvoiceUpdateInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
|
|
12456
|
+
updateInvoice: (lagoId: string, data: InvoiceUpdateInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound | ApiErrorNotAllowed>>;
|
|
11387
12457
|
/**
|
|
11388
12458
|
* @description This endpoint is used for retrieving a specific invoice that has been issued.
|
|
11389
12459
|
*
|
|
@@ -11498,7 +12568,212 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11498
12568
|
*/
|
|
11499
12569
|
voidInvoice: (lagoId: string, data?: InvoiceVoidInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
11500
12570
|
};
|
|
12571
|
+
orderForms: {
|
|
12572
|
+
/**
|
|
12573
|
+
* @description This endpoint is used to list all existing order forms. This is a premium feature.
|
|
12574
|
+
*
|
|
12575
|
+
* @tags order_forms
|
|
12576
|
+
* @name FindAllOrderForms
|
|
12577
|
+
* @summary List all order forms
|
|
12578
|
+
* @request GET:/order_forms
|
|
12579
|
+
* @secure
|
|
12580
|
+
*/
|
|
12581
|
+
findAllOrderForms: (query?: {
|
|
12582
|
+
/**
|
|
12583
|
+
* Page number.
|
|
12584
|
+
* @example 1
|
|
12585
|
+
*/
|
|
12586
|
+
page?: number;
|
|
12587
|
+
/**
|
|
12588
|
+
* Number of records per page.
|
|
12589
|
+
* @example 20
|
|
12590
|
+
*/
|
|
12591
|
+
per_page?: number;
|
|
12592
|
+
/** Filter order forms by status. Possible values are `generated`, `signed`, `expired` and `voided`. */
|
|
12593
|
+
"status[]"?: ("generated" | "signed" | "expired" | "voided")[];
|
|
12594
|
+
/**
|
|
12595
|
+
* Filter order forms by the Lago identifiers of their customers.
|
|
12596
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
12597
|
+
*/
|
|
12598
|
+
"customer_id[]"?: string[];
|
|
12599
|
+
/**
|
|
12600
|
+
* Filter order forms by their number, as assigned by Lago.
|
|
12601
|
+
* @example ["OF-2026-0001","OF-2026-0002"]
|
|
12602
|
+
*/
|
|
12603
|
+
"number[]"?: string[];
|
|
12604
|
+
/**
|
|
12605
|
+
* Filter order forms by the number of the quote they come from.
|
|
12606
|
+
* @example ["QT-2026-0001"]
|
|
12607
|
+
*/
|
|
12608
|
+
"quote_number[]"?: string[];
|
|
12609
|
+
/**
|
|
12610
|
+
* Filter order forms by the Lago identifiers of the users owning the quote they come from.
|
|
12611
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
12612
|
+
*/
|
|
12613
|
+
"owner_id[]"?: string[];
|
|
12614
|
+
/**
|
|
12615
|
+
* Search order forms by number.
|
|
12616
|
+
* @example "OF-2026"
|
|
12617
|
+
*/
|
|
12618
|
+
search_term?: string;
|
|
12619
|
+
/**
|
|
12620
|
+
* Filter order forms created from a specific date and time, in UTC (ISO 8601).
|
|
12621
|
+
* @format date-time
|
|
12622
|
+
* @example "2026-01-01T00:00:00Z"
|
|
12623
|
+
*/
|
|
12624
|
+
created_at_from?: string;
|
|
12625
|
+
/**
|
|
12626
|
+
* Filter order forms created up to a specific date and time, in UTC (ISO 8601).
|
|
12627
|
+
* @format date-time
|
|
12628
|
+
* @example "2026-12-31T23:59:59Z"
|
|
12629
|
+
*/
|
|
12630
|
+
created_at_to?: string;
|
|
12631
|
+
/**
|
|
12632
|
+
* Filter order forms expiring from a specific date and time, in UTC (ISO 8601). Order forms that never expire are excluded.
|
|
12633
|
+
* @format date-time
|
|
12634
|
+
* @example "2026-01-01T00:00:00Z"
|
|
12635
|
+
*/
|
|
12636
|
+
expires_at_from?: string;
|
|
12637
|
+
/**
|
|
12638
|
+
* Filter order forms expiring up to a specific date and time, in UTC (ISO 8601). Order forms that never expire are excluded.
|
|
12639
|
+
* @format date-time
|
|
12640
|
+
* @example "2026-12-31T23:59:59Z"
|
|
12641
|
+
*/
|
|
12642
|
+
expires_at_to?: string;
|
|
12643
|
+
}, params?: RequestParams) => Promise<HttpResponse<OrderFormsPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden>>;
|
|
12644
|
+
/**
|
|
12645
|
+
* @description This endpoint retrieves a specific order form. This is a premium feature.
|
|
12646
|
+
*
|
|
12647
|
+
* @tags order_forms
|
|
12648
|
+
* @name FindOrderForm
|
|
12649
|
+
* @summary Retrieve an order form
|
|
12650
|
+
* @request GET:/order_forms/{lago_id}
|
|
12651
|
+
* @secure
|
|
12652
|
+
*/
|
|
12653
|
+
findOrderForm: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<OrderForm, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
12654
|
+
/**
|
|
12655
|
+
* @description This endpoint records the customer's signature on an order form, and creates the order that carries the quoted deal out. Only a `generated` order form can be signed, so a `422` is returned once the order form has been signed, has expired or has been voided. An `execute_at` landing on or after the day the quoted deal stops being executable is rejected as well, so the order can never be scheduled past the term it bills. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
|
|
12656
|
+
*
|
|
12657
|
+
* @tags order_forms
|
|
12658
|
+
* @name MarkOrderFormAsSigned
|
|
12659
|
+
* @summary Mark an order form as signed
|
|
12660
|
+
* @request POST:/order_forms/{lago_id}/mark_as_signed
|
|
12661
|
+
* @secure
|
|
12662
|
+
*/
|
|
12663
|
+
markOrderFormAsSigned: (lagoId: string, data?: OrderFormMarkAsSignedInput, params?: RequestParams) => Promise<HttpResponse<OrderForm, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
12664
|
+
/**
|
|
12665
|
+
* @description This endpoint voids an order form, with the `manual` reason, and cascades to the quote version it was generated from, which is voided with the `cascade_of_voided` reason. Only a `generated` order form can be voided, so a `422` is returned once the order form has been signed, has expired or has already been voided. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
|
|
12666
|
+
*
|
|
12667
|
+
* @tags order_forms
|
|
12668
|
+
* @name VoidOrderForm
|
|
12669
|
+
* @summary Void an order form
|
|
12670
|
+
* @request POST:/order_forms/{lago_id}/void
|
|
12671
|
+
* @secure
|
|
12672
|
+
*/
|
|
12673
|
+
voidOrderForm: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<OrderForm, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
12674
|
+
};
|
|
12675
|
+
orders: {
|
|
12676
|
+
/**
|
|
12677
|
+
* @description This endpoint is used to list all existing orders. This is a premium feature.
|
|
12678
|
+
*
|
|
12679
|
+
* @tags orders
|
|
12680
|
+
* @name FindAllOrders
|
|
12681
|
+
* @summary List all orders
|
|
12682
|
+
* @request GET:/orders
|
|
12683
|
+
* @secure
|
|
12684
|
+
*/
|
|
12685
|
+
findAllOrders: (query?: {
|
|
12686
|
+
/**
|
|
12687
|
+
* Page number.
|
|
12688
|
+
* @example 1
|
|
12689
|
+
*/
|
|
12690
|
+
page?: number;
|
|
12691
|
+
/**
|
|
12692
|
+
* Number of records per page.
|
|
12693
|
+
* @example 20
|
|
12694
|
+
*/
|
|
12695
|
+
per_page?: number;
|
|
12696
|
+
/** Filter orders by status. Possible values are `created`, `executed` and `failed`. */
|
|
12697
|
+
"status[]"?: ("created" | "executed" | "failed")[];
|
|
12698
|
+
/** Filter orders by the order type of the quote they come from. Possible values are `subscription_creation`, `subscription_amendment` and `one_off`. */
|
|
12699
|
+
"order_type[]"?: ("subscription_creation" | "subscription_amendment" | "one_off")[];
|
|
12700
|
+
/** Filter orders by execution mode. Possible values are `execute_in_lago` and `order_only`. */
|
|
12701
|
+
"execution_mode[]"?: ("execute_in_lago" | "order_only")[];
|
|
12702
|
+
/**
|
|
12703
|
+
* Filter orders by the Lago identifiers of their customers.
|
|
12704
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
12705
|
+
*/
|
|
12706
|
+
"customer_id[]"?: string[];
|
|
12707
|
+
/**
|
|
12708
|
+
* Filter orders by their number, as assigned by Lago.
|
|
12709
|
+
* @example ["OR-2026-0001","OR-2026-0002"]
|
|
12710
|
+
*/
|
|
12711
|
+
"number[]"?: string[];
|
|
12712
|
+
/**
|
|
12713
|
+
* Filter orders by the number of the order form they come from.
|
|
12714
|
+
* @example ["OF-2026-0001"]
|
|
12715
|
+
*/
|
|
12716
|
+
"order_form_number[]"?: string[];
|
|
12717
|
+
/**
|
|
12718
|
+
* Filter orders by the number of the quote they come from.
|
|
12719
|
+
* @example ["QT-2026-0001"]
|
|
12720
|
+
*/
|
|
12721
|
+
"quote_number[]"?: string[];
|
|
12722
|
+
/**
|
|
12723
|
+
* Filter orders by the Lago identifiers of the users owning the quote they come from.
|
|
12724
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
12725
|
+
*/
|
|
12726
|
+
"owner_id[]"?: string[];
|
|
12727
|
+
/**
|
|
12728
|
+
* Search orders by number.
|
|
12729
|
+
* @example "OR-2026"
|
|
12730
|
+
*/
|
|
12731
|
+
search_term?: string;
|
|
12732
|
+
/**
|
|
12733
|
+
* Filter orders executed from a specific date and time, in UTC (ISO 8601). Orders that have not been executed are excluded.
|
|
12734
|
+
* @format date-time
|
|
12735
|
+
* @example "2026-01-01T00:00:00Z"
|
|
12736
|
+
*/
|
|
12737
|
+
executed_at_from?: string;
|
|
12738
|
+
/**
|
|
12739
|
+
* Filter orders executed up to a specific date and time, in UTC (ISO 8601). Orders that have not been executed are excluded.
|
|
12740
|
+
* @format date-time
|
|
12741
|
+
* @example "2026-12-31T23:59:59Z"
|
|
12742
|
+
*/
|
|
12743
|
+
executed_at_to?: string;
|
|
12744
|
+
}, params?: RequestParams) => Promise<HttpResponse<OrdersPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden>>;
|
|
12745
|
+
/**
|
|
12746
|
+
* @description This endpoint retrieves a specific order, along with the `billing_snapshot` its execution applies and the `execution_record` of what it produced. This is a premium feature.
|
|
12747
|
+
*
|
|
12748
|
+
* @tags orders
|
|
12749
|
+
* @name FindOrder
|
|
12750
|
+
* @summary Retrieve an order
|
|
12751
|
+
* @request GET:/orders/{lago_id}
|
|
12752
|
+
* @secure
|
|
12753
|
+
*/
|
|
12754
|
+
findOrder: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Order, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
12755
|
+
/**
|
|
12756
|
+
* @description This endpoint carries out an order on demand, without waiting for its `execute_at` schedule. It runs synchronously, so the response carries the resulting status and, when the execution fails, the reason it failed. An `execute_in_lago` order applies the quoted deal, creating the subscriptions, coupons, wallets or one-off invoice it describes; an `order_only` order is simply marked as executed. What the execution produced is listed in `execution_record`. Executing is idempotent: an order that has already been executed is returned untouched. An order whose previous execution failed is executed again, and a `422` is returned when the order carries no execution mode and none is provided in the body. Restating an `execution_mode` that differs from the one stored on the order updates it first, which only succeeds while the order is still `created`: a `failed` order can be retried, but not switched to another mode. That update also re-validates the order's own `execute_at` against the day the quoted deal stops being executable, so a `422` is possible even though no date was sent. An order carrying no `execute_at` is not bounded that way, and a deal whose term has passed then only fails when the execution runs. A `404` is not limited to an unknown order: when the execution cannot find a catalog record the quote pinned, such as a deleted plan, charge, coupon or the subscription being amended, the missing resource is reported as a `404` and the order is left `failed`. Concurrency is reported two ways. A mode change losing the race on the quote comes back as a `422` validation error, while the execution itself losing it comes back as a `422` carrying a lock code, because a scheduled execution relies on that error to be retried. This is a premium feature.
|
|
12757
|
+
*
|
|
12758
|
+
* @tags orders
|
|
12759
|
+
* @name ExecuteOrder
|
|
12760
|
+
* @summary Execute an order
|
|
12761
|
+
* @request POST:/orders/{lago_id}/execute
|
|
12762
|
+
* @secure
|
|
12763
|
+
*/
|
|
12764
|
+
executeOrder: (lagoId: string, data?: OrderExecuteInput, params?: RequestParams) => Promise<HttpResponse<Order, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
12765
|
+
};
|
|
11501
12766
|
organizations: {
|
|
12767
|
+
/**
|
|
12768
|
+
* @description This endpoint retrieves your own organization's settings.
|
|
12769
|
+
*
|
|
12770
|
+
* @tags organizations
|
|
12771
|
+
* @name FindOrganization
|
|
12772
|
+
* @summary Retrieve your organization
|
|
12773
|
+
* @request GET:/organizations
|
|
12774
|
+
* @secure
|
|
12775
|
+
*/
|
|
12776
|
+
findOrganization: (params?: RequestParams) => Promise<HttpResponse<Organization, ApiErrorUnauthorized>>;
|
|
11502
12777
|
/**
|
|
11503
12778
|
* @description This endpoint is used to update your own organization's settings.
|
|
11504
12779
|
*
|
|
@@ -12011,6 +13286,133 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
12011
13286
|
*/
|
|
12012
13287
|
destroyPlanFixedCharge: (code: string, fixedChargeCode: string, data: FixedChargeDeleteInput, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
12013
13288
|
};
|
|
13289
|
+
quotes: {
|
|
13290
|
+
/**
|
|
13291
|
+
* @description This endpoint is used to list all existing quotes. Quotes are ordered by creation date, from the most recent to the oldest. This is a premium feature.
|
|
13292
|
+
*
|
|
13293
|
+
* @tags quotes
|
|
13294
|
+
* @name FindAllQuotes
|
|
13295
|
+
* @summary List all quotes
|
|
13296
|
+
* @request GET:/quotes
|
|
13297
|
+
* @secure
|
|
13298
|
+
*/
|
|
13299
|
+
findAllQuotes: (query?: {
|
|
13300
|
+
/**
|
|
13301
|
+
* Page number.
|
|
13302
|
+
* @example 1
|
|
13303
|
+
*/
|
|
13304
|
+
page?: number;
|
|
13305
|
+
/**
|
|
13306
|
+
* Number of records per page.
|
|
13307
|
+
* @example 20
|
|
13308
|
+
*/
|
|
13309
|
+
per_page?: number;
|
|
13310
|
+
/** Filter quotes by the status of their current version. Possible values are `draft`, `approved` and `voided`. */
|
|
13311
|
+
"status[]"?: ("draft" | "approved" | "voided")[];
|
|
13312
|
+
/** Filter quotes by order type. Possible values are `subscription_creation`, `subscription_amendment` and `one_off`. */
|
|
13313
|
+
"order_type[]"?: ("subscription_creation" | "subscription_amendment" | "one_off")[];
|
|
13314
|
+
/**
|
|
13315
|
+
* Filter quotes by their number, as assigned by Lago.
|
|
13316
|
+
* @example ["QT-2026-0001","QT-2026-0002"]
|
|
13317
|
+
*/
|
|
13318
|
+
"number[]"?: string[];
|
|
13319
|
+
/**
|
|
13320
|
+
* Filter quotes by the Lago identifiers of the users owning them.
|
|
13321
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
13322
|
+
*/
|
|
13323
|
+
"owner_id[]"?: string[];
|
|
13324
|
+
/**
|
|
13325
|
+
* Filter quotes by the external unique identifiers of their customers (provided by your own application).
|
|
13326
|
+
* @example ["external_id_1234"]
|
|
13327
|
+
*/
|
|
13328
|
+
"external_customer_id[]"?: string[];
|
|
13329
|
+
/**
|
|
13330
|
+
* Filter quotes created from a specific date.
|
|
13331
|
+
* @format date
|
|
13332
|
+
* @example "2026-01-01"
|
|
13333
|
+
*/
|
|
13334
|
+
from_date?: string;
|
|
13335
|
+
/**
|
|
13336
|
+
* Filter quotes created up to a specific date.
|
|
13337
|
+
* @format date
|
|
13338
|
+
* @example "2026-12-31"
|
|
13339
|
+
*/
|
|
13340
|
+
to_date?: string;
|
|
13341
|
+
}, params?: RequestParams) => Promise<HttpResponse<QuotesPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden>>;
|
|
13342
|
+
/**
|
|
13343
|
+
* @description This endpoint retrieves a specific quote, along with its owners and its current version. This is a premium feature.
|
|
13344
|
+
*
|
|
13345
|
+
* @tags quotes
|
|
13346
|
+
* @name FindQuote
|
|
13347
|
+
* @summary Retrieve a quote
|
|
13348
|
+
* @request GET:/quotes/{lago_id}
|
|
13349
|
+
* @secure
|
|
13350
|
+
*/
|
|
13351
|
+
findQuote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Quote, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
13352
|
+
/**
|
|
13353
|
+
* @description This endpoint is used to list all the versions of a specific quote, from the most recent to the oldest. The `content` and `billing_items` of each version are omitted; retrieve a version to get them. This is a premium feature.
|
|
13354
|
+
*
|
|
13355
|
+
* @tags quotes
|
|
13356
|
+
* @name FindAllQuoteVersions
|
|
13357
|
+
* @summary List all versions of a quote
|
|
13358
|
+
* @request GET:/quotes/{lago_id}/versions
|
|
13359
|
+
* @secure
|
|
13360
|
+
*/
|
|
13361
|
+
findAllQuoteVersions: (lagoId: string, query?: {
|
|
13362
|
+
/**
|
|
13363
|
+
* Page number.
|
|
13364
|
+
* @example 1
|
|
13365
|
+
*/
|
|
13366
|
+
page?: number;
|
|
13367
|
+
/**
|
|
13368
|
+
* Number of records per page.
|
|
13369
|
+
* @example 20
|
|
13370
|
+
*/
|
|
13371
|
+
per_page?: number;
|
|
13372
|
+
}, params?: RequestParams) => Promise<HttpResponse<QuoteVersionsPaginated, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
13373
|
+
};
|
|
13374
|
+
quoteVersions: {
|
|
13375
|
+
/**
|
|
13376
|
+
* @description This endpoint retrieves a specific quote version, along with its document `content` and its `billing_items`. This is a premium feature.
|
|
13377
|
+
*
|
|
13378
|
+
* @tags quotes
|
|
13379
|
+
* @name FindQuoteVersion
|
|
13380
|
+
* @summary Retrieve a quote version
|
|
13381
|
+
* @request GET:/quote_versions/{lago_id}
|
|
13382
|
+
* @secure
|
|
13383
|
+
*/
|
|
13384
|
+
findQuoteVersion: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<QuoteVersion, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
13385
|
+
/**
|
|
13386
|
+
* @description This endpoint approves a quote version and generates the order form to send to the customer for signature. Only a `draft` version can be approved, and its `billing_items` must be complete: approval validates them against the catalog and against the customer, and returns a `422` when the deal cannot be executed as quoted. The `expires_at` of the generated order form is bounded by the deal's own term, so a signing window reaching beyond the day the deal stops being executable is rejected. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
|
|
13387
|
+
*
|
|
13388
|
+
* @tags quotes
|
|
13389
|
+
* @name ApproveQuoteVersion
|
|
13390
|
+
* @summary Approve a quote version
|
|
13391
|
+
* @request POST:/quote_versions/{lago_id}/approve
|
|
13392
|
+
* @secure
|
|
13393
|
+
*/
|
|
13394
|
+
approveQuoteVersion: (lagoId: string, data?: QuoteVersionApproveInput, params?: RequestParams) => Promise<HttpResponse<QuoteVersion, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
13395
|
+
/**
|
|
13396
|
+
* @description This endpoint voids a quote version, which makes it definitive: a voided version can neither be edited nor approved again. Only a `draft` version can be voided through this endpoint, and the resulting `void_reason` is `manual`. An `approved` version is voided by Lago itself, through the order form generated from it. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
|
|
13397
|
+
*
|
|
13398
|
+
* @tags quotes
|
|
13399
|
+
* @name VoidQuoteVersion
|
|
13400
|
+
* @summary Void a quote version
|
|
13401
|
+
* @request POST:/quote_versions/{lago_id}/void
|
|
13402
|
+
* @secure
|
|
13403
|
+
*/
|
|
13404
|
+
voidQuoteVersion: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<QuoteVersion, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
13405
|
+
/**
|
|
13406
|
+
* @description This endpoint copies a quote version into a new `draft` version of the same quote, so that the deal can be renegotiated. Any version of the quote can be cloned, but a quote can only carry one active version: the draft the quote currently holds, if any, is voided with the `superseded` reason. Cloning is therefore rejected with a `422` once a version of the quote has been approved. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
|
|
13407
|
+
*
|
|
13408
|
+
* @tags quotes
|
|
13409
|
+
* @name CloneQuoteVersion
|
|
13410
|
+
* @summary Clone a quote version
|
|
13411
|
+
* @request POST:/quote_versions/{lago_id}/clone
|
|
13412
|
+
* @secure
|
|
13413
|
+
*/
|
|
13414
|
+
cloneQuoteVersion: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<QuoteVersion, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
|
|
13415
|
+
};
|
|
12014
13416
|
subscriptions: {
|
|
12015
13417
|
/**
|
|
12016
13418
|
* @description This endpoint assigns a plan to a customer, creating or modifying a subscription. Ideal for initial subscriptions or plan changes (upgrades/downgrades).
|
|
@@ -12052,11 +13454,21 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
12052
13454
|
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
12053
13455
|
*/
|
|
12054
13456
|
external_customer_id?: string;
|
|
13457
|
+
/**
|
|
13458
|
+
* Filter subscriptions by their external unique identifier (provided by your own application).
|
|
13459
|
+
* @example "my_sub_1234567890"
|
|
13460
|
+
*/
|
|
13461
|
+
external_id?: string;
|
|
12055
13462
|
/**
|
|
12056
13463
|
* 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.
|
|
12057
13464
|
* @example "premium"
|
|
12058
13465
|
*/
|
|
12059
13466
|
plan_code?: string;
|
|
13467
|
+
/**
|
|
13468
|
+
* 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.
|
|
13469
|
+
* @example true
|
|
13470
|
+
*/
|
|
13471
|
+
overridden?: boolean;
|
|
12060
13472
|
/**
|
|
12061
13473
|
* 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`.
|
|
12062
13474
|
* @example ["active","pending"]
|
|
@@ -12636,7 +14048,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
12636
14048
|
* @request GET:/wallets
|
|
12637
14049
|
* @secure
|
|
12638
14050
|
*/
|
|
12639
|
-
findAllWallets: (query
|
|
14051
|
+
findAllWallets: (query?: {
|
|
12640
14052
|
/**
|
|
12641
14053
|
* Page number.
|
|
12642
14054
|
* @example 1
|
|
@@ -12653,10 +14065,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
12653
14065
|
*/
|
|
12654
14066
|
currency?: string;
|
|
12655
14067
|
/**
|
|
12656
|
-
*
|
|
14068
|
+
* Filter wallets by customer external unique identifier (provided by your own application). When omitted, all wallets for the organization are returned.
|
|
12657
14069
|
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
12658
14070
|
*/
|
|
12659
|
-
external_customer_id
|
|
14071
|
+
external_customer_id?: string;
|
|
12660
14072
|
/**
|
|
12661
14073
|
* Filter wallets by billing entity codes.
|
|
12662
14074
|
* @example ["billing_entity_code_1","billing_entity_code_2"]
|
|
@@ -12664,7 +14076,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
12664
14076
|
"billing_entity_codes[]"?: string[];
|
|
12665
14077
|
}, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden>>;
|
|
12666
14078
|
/**
|
|
12667
|
-
* @description This endpoint is used to update an existing wallet with prepaid credits.
|
|
14079
|
+
* @description This endpoint is used to update an existing wallet with prepaid credits. A terminated wallet cannot be updated and returns a `422` error.
|
|
12668
14080
|
*
|
|
12669
14081
|
* @tags wallets
|
|
12670
14082
|
* @name UpdateWallet
|