lago-javascript-client 1.32.0 → 1.33.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.
@@ -3,7 +3,7 @@ export type Currency = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "
3
3
  /** @example "US" */
4
4
  export type Country = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";
5
5
  /** @example "America/Los_Angeles" */
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/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";
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 */
8
8
  export interface BillingEntityObject {
9
9
  /**
@@ -331,10 +331,10 @@ export interface TaxObject {
331
331
  */
332
332
  code: string;
333
333
  /**
334
- * Internal description of the taxe
334
+ * Internal description of the tax
335
335
  * @example "French standard VAT"
336
336
  */
337
- description?: string;
337
+ description?: string | null;
338
338
  /**
339
339
  * The percentage rate of the tax
340
340
  * @example 20
@@ -419,6 +419,11 @@ export interface ApiErrorNotFound {
419
419
  /** @example "object_not_found" */
420
420
  code: string;
421
421
  }
422
+ /**
423
+ * List of unique code used to identify the taxes.
424
+ * @example ["french_standard_vat"]
425
+ */
426
+ export type TaxCodes = string[];
422
427
  /** Billing entity update input */
423
428
  export interface BillingEntityUpdateInput {
424
429
  /**
@@ -522,11 +527,8 @@ export interface BillingEntityUpdateInput {
522
527
  * @example "UTC"
523
528
  */
524
529
  timezone?: Timezone;
525
- /**
526
- * The tax codes that should be associated with this billing entity
527
- * @example ["french_standard_vat"]
528
- */
529
- tax_codes?: string[];
530
+ /** The tax codes that should be associated with this billing entity */
531
+ tax_codes?: TaxCodes;
530
532
  /** The email notification settings for this billing entity */
531
533
  email_settings?: ("invoice.finalized" | "credit_note.created")[];
532
534
  /**
@@ -735,11 +737,8 @@ export interface AddOnBaseInput {
735
737
  * @example "Implementation fee for new customers."
736
738
  */
737
739
  description?: string | null;
738
- /**
739
- * List of unique code used to identify the taxes.
740
- * @example ["french_standard_vat"]
741
- */
742
- tax_codes?: string[];
740
+ /** List of unique code used to identify the taxes. */
741
+ tax_codes?: TaxCodes;
743
742
  }
744
743
  export interface AddOnCreateInput {
745
744
  add_on: AddOnBaseInput;
@@ -942,6 +941,55 @@ export interface OverdueBalanceObject {
942
941
  export interface OverdueBalances {
943
942
  overdue_balances: OverdueBalanceObject[];
944
943
  }
944
+ export interface UsageObject {
945
+ /**
946
+ * The unique identifier of the organization for which the usage analytics is calculated.
947
+ * @format uuid
948
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
949
+ */
950
+ organization_id: string;
951
+ /**
952
+ * The start date of the period for which the usage analytics is calculated.
953
+ * @format date
954
+ * @example "2023-11-01"
955
+ */
956
+ start_of_period_dt?: string;
957
+ /**
958
+ * The end date of the period for which the usage analytics is calculated.
959
+ * @format date
960
+ * @example "2023-11-30"
961
+ */
962
+ end_of_period_dt?: string;
963
+ /**
964
+ * The currency of usage analytics. Format must be ISO 4217.
965
+ * @example "USD"
966
+ */
967
+ amount_currency: Currency;
968
+ /**
969
+ * The total amount for usages for a period, expressed in cents.
970
+ * @example 50000
971
+ */
972
+ amount_cents: number;
973
+ /**
974
+ * The code of the usage-based billable metrics.
975
+ * @example "code1"
976
+ */
977
+ billable_metric_code?: string;
978
+ /**
979
+ * The total number of units for the usage-based billable metrics.
980
+ * @pattern ^[0-9]+.?[0-9]*$
981
+ * @example "1.0"
982
+ */
983
+ units?: string;
984
+ /**
985
+ * Indicates whether the billable metric associated with the usage is deleted.
986
+ * @example false
987
+ */
988
+ is_billable_metric_deleted?: boolean;
989
+ }
990
+ export interface Usages {
991
+ usages: UsageObject[];
992
+ }
945
993
  /** @example "USD" */
946
994
  export type CurrencyOrNull = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SZL" | "THB" | "TJS" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW";
947
995
  export interface AppliedCouponObject {
@@ -1349,6 +1397,150 @@ export interface BillableMetricEvaluateExpressionResult {
1349
1397
  export interface BillableMetricUpdateInput {
1350
1398
  billable_metric: BillableMetricBaseInput;
1351
1399
  }
1400
+ export interface FeaturePrivilegeObject {
1401
+ /**
1402
+ * Unique code for the privilege.
1403
+ * @example "max"
1404
+ */
1405
+ code: string;
1406
+ /**
1407
+ * Display name for the privilege.
1408
+ * @example "Maximum"
1409
+ */
1410
+ name?: string | null;
1411
+ /**
1412
+ * Data type of the privilege value. Default: string
1413
+ * @example "integer"
1414
+ */
1415
+ value_type?: "integer" | "boolean" | "string" | "select";
1416
+ config?: {
1417
+ /**
1418
+ * Array of string, required only when value_type is `select`.
1419
+ * @example ["google","okta"]
1420
+ */
1421
+ select_options?: string[];
1422
+ };
1423
+ }
1424
+ export interface FeatureObject {
1425
+ /**
1426
+ * Unique code used to identify the feature. Max 255 characters.
1427
+ * @example "seats"
1428
+ */
1429
+ code: string;
1430
+ /**
1431
+ * Name of the feature. Max 255 characters.
1432
+ * @example "Number of seats"
1433
+ */
1434
+ name?: string | null;
1435
+ /**
1436
+ * Description of the feature. Max 600 characters.
1437
+ * @example "Number of users of the account"
1438
+ */
1439
+ description?: string | null;
1440
+ /**
1441
+ * Privileges associated with this feature. Can be empty.
1442
+ * @example [{"code":"max","name":"Maximum","value_type":"integer"},{"code":"max_admins","name":"Max Admins","value_type":"integer"},{"code":"root","name":"Allow root user","value_type":"boolean"},{"code":"provider","name":"SSO Provider","value_type":"select","config":{"select_options":["google","okta"]}}]
1443
+ */
1444
+ privileges?: FeaturePrivilegeObject[];
1445
+ /**
1446
+ * Creation date of the feature.
1447
+ * @format date-time
1448
+ * @example "2025-07-17T12:34:35Z"
1449
+ */
1450
+ created_at: string;
1451
+ }
1452
+ export interface FeaturesPaginated {
1453
+ features: FeatureObject[];
1454
+ meta: PaginationMeta;
1455
+ }
1456
+ export interface FeatureCreateInput {
1457
+ /**
1458
+ * Unique code used to identify the feature.
1459
+ * @example "seats"
1460
+ */
1461
+ code: string;
1462
+ /**
1463
+ * Name of the feature.
1464
+ * @example "Number of seats"
1465
+ */
1466
+ name?: string | null;
1467
+ /**
1468
+ * Internal description of the feature.
1469
+ * @example "Number of users of the account"
1470
+ */
1471
+ description?: string | null;
1472
+ /**
1473
+ * Privileges associated with this feature. Can be empty.
1474
+ * @example [{"code":"max","name":"Maximum","value_type":"integer"},{"code":"max_admins","name":"Max Admins","value_type":"integer"},{"code":"root","name":"Allow root user","value_type":"boolean"},{"code":"provider","name":"SSO Provider","value_type":"select","config":{"select_options":["google","okta"]}}]
1475
+ */
1476
+ privileges?: {
1477
+ /**
1478
+ * Unique code for the privilege.
1479
+ * @example "max"
1480
+ */
1481
+ code: string;
1482
+ /**
1483
+ * Display name for the privilege.
1484
+ * @example "Maximum"
1485
+ */
1486
+ name?: string | null;
1487
+ /**
1488
+ * Data type of the privilege value. Default: string
1489
+ * @example "integer"
1490
+ */
1491
+ value_type?: "integer" | "boolean" | "string" | "select";
1492
+ config?: {
1493
+ /**
1494
+ * Array of string, required only when value_type is `select`.
1495
+ * @example ["google","okta"]
1496
+ */
1497
+ select_options?: string[];
1498
+ };
1499
+ }[];
1500
+ }
1501
+ export interface Feature {
1502
+ feature: FeatureObject;
1503
+ }
1504
+ export interface FeatureUpdateInput {
1505
+ /**
1506
+ * Name of the feature.
1507
+ * @example "Number of seats"
1508
+ */
1509
+ name?: string | null;
1510
+ /**
1511
+ * Description of the feature.
1512
+ * @example "Number of users of the account"
1513
+ */
1514
+ description?: string | null;
1515
+ /**
1516
+ * Existing privilege names can be updated or new privilege created.
1517
+ * @example [{"code":"max","name":"Maximum"},{"code":"new_extra","name":"Extra","value_type":"string"},{"code":"providers","value_type":"select","config":{"select_options":["ms"]}}]
1518
+ */
1519
+ privileges?: {
1520
+ /**
1521
+ * Code of the privilege to update or create.
1522
+ * @example "max"
1523
+ */
1524
+ code?: string;
1525
+ /**
1526
+ * Display name for the privilege.
1527
+ * @example "Maximum"
1528
+ */
1529
+ name?: string;
1530
+ /**
1531
+ * Data type of the privilege value. Value_type cannot be modified for existing privilege but can be set for new privileges.
1532
+ * @example "integer"
1533
+ */
1534
+ value_type?: "integer" | "boolean" | "string" | "select";
1535
+ config?: {
1536
+ /**
1537
+ * Array of new string to add to existing options. Options cannot be deleted. Only used only when value_type is `select`.
1538
+ * @example ["ms"]
1539
+ */
1540
+ select_options?: string[];
1541
+ };
1542
+ }[];
1543
+ }
1352
1544
  export interface CouponObject {
1353
1545
  /**
1354
1546
  * Unique identifier of the coupon, created by Lago.
@@ -1673,6 +1865,12 @@ export interface FeeAmountDetails {
1673
1865
  * @example "0.5"
1674
1866
  */
1675
1867
  per_package_unit_amount?: string;
1868
+ /**
1869
+ * Total amount of received units to be charged for the Volume or Percentage charge model.
1870
+ * @pattern ^[0-9]+.?[0-9]*$
1871
+ * @example "10.0"
1872
+ */
1873
+ per_unit_total_amount?: string;
1676
1874
  /**
1677
1875
  * The total units received in Lago for the Percentage charge model.
1678
1876
  * @pattern ^[0-9]+.?[0-9]*$
@@ -1690,11 +1888,6 @@ export interface FeeAmountDetails {
1690
1888
  * @example "1.0"
1691
1889
  */
1692
1890
  rate?: string;
1693
- /**
1694
- * Total amount of received units to be charged for the Percentage charge model.
1695
- * @example "10.0"
1696
- */
1697
- per_unit_total_amount?: string;
1698
1891
  /**
1699
1892
  * Total number of paid events for the Percentage charge model.
1700
1893
  * @example 20
@@ -1715,27 +1908,18 @@ export interface FeeAmountDetails {
1715
1908
  * @example "20.0"
1716
1909
  */
1717
1910
  min_max_adjustment_total_amount?: string;
1718
- /** Volume ranges, used for a `volume` charge model. */
1719
- volume_ranges?: {
1720
- /**
1721
- * The flat amount for a whole tier, excluding tax, for a `volume` charge model.
1722
- * @pattern ^[0-9]+.?[0-9]*$
1723
- * @example "0.5"
1724
- */
1725
- per_unit_amount: string;
1726
- /**
1727
- * The unit price, excluding tax, for a specific tier of a `volume` charge model.
1728
- * @pattern ^[0-9]+.?[0-9]*$
1729
- * @example "10.0"
1730
- */
1731
- flat_unit_amount: string;
1732
- /**
1733
- * Total amount of received units to be charged.
1734
- * @pattern ^[0-9]+.?[0-9]*$
1735
- * @example "10.0"
1736
- */
1737
- per_unit_total_amount: string;
1738
- }[];
1911
+ /**
1912
+ * The flat amount for a whole tier, excluding tax, for a `volume` charge model.
1913
+ * @pattern ^[0-9]+.?[0-9]*$
1914
+ * @example "0.5"
1915
+ */
1916
+ per_unit_amount?: string;
1917
+ /**
1918
+ * The unit price, excluding tax, for a specific tier of a `volume` charge model.
1919
+ * @pattern ^[0-9]+.?[0-9]*$
1920
+ * @example "10.0"
1921
+ */
1922
+ flat_unit_amount?: string;
1739
1923
  }
1740
1924
  export interface BaseAppliedTax {
1741
1925
  /**
@@ -1743,49 +1927,49 @@ export interface BaseAppliedTax {
1743
1927
  * @format uuid
1744
1928
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1745
1929
  */
1746
- lago_id?: string;
1930
+ lago_id: string;
1747
1931
  /**
1748
1932
  * Unique identifier of the tax, created by Lago.
1749
1933
  * @format uuid
1750
1934
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1751
1935
  */
1752
- lago_tax_id?: string;
1936
+ lago_tax_id: string | null;
1753
1937
  /**
1754
1938
  * Name of the tax.
1755
1939
  * @example "TVA"
1756
1940
  */
1757
- tax_name?: string;
1941
+ tax_name: string;
1758
1942
  /**
1759
1943
  * Unique code used to identify the tax associated with the API request.
1760
1944
  * @example "french_standard_vat"
1761
1945
  */
1762
- tax_code?: string;
1946
+ tax_code: string;
1763
1947
  /**
1764
1948
  * The percentage rate of the tax
1765
1949
  * @example 20
1766
1950
  */
1767
- tax_rate?: number;
1951
+ tax_rate: number;
1768
1952
  /**
1769
- * Internal description of the taxe
1953
+ * Internal description of the tax
1770
1954
  * @example "French standard VAT"
1771
1955
  */
1772
- tax_description?: string;
1956
+ tax_description: string | null;
1773
1957
  /**
1774
1958
  * Amount of the tax
1775
1959
  * @example 2000
1776
1960
  */
1777
- amount_cents?: number;
1961
+ amount_cents: number;
1778
1962
  /**
1779
1963
  * Currency of the tax
1780
1964
  * @example "USD"
1781
1965
  */
1782
- amount_currency?: Currency;
1966
+ amount_currency: Currency;
1783
1967
  /**
1784
1968
  * The date and time when the applied tax was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the applied tax was initially created.
1785
1969
  * @format date-time
1786
1970
  * @example "2022-09-14T16:35:31Z"
1787
1971
  */
1788
- created_at?: string;
1972
+ created_at: string;
1789
1973
  }
1790
1974
  export type FeeAppliedTaxObject = BaseAppliedTax & {
1791
1975
  /**
@@ -1897,11 +2081,6 @@ export interface FeeObject {
1897
2081
  * @example "external_id"
1898
2082
  */
1899
2083
  external_subscription_id?: string | null;
1900
- /**
1901
- * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
1902
- * @example "Setup Fee (SF1)"
1903
- */
1904
- invoice_display_name?: string;
1905
2084
  /**
1906
2085
  * The cost of this specific fee, excluding any applicable taxes.
1907
2086
  * @example 100
@@ -1961,7 +2140,7 @@ export interface FeeObject {
1961
2140
  * The number of events that have been sent and used to charge the customer. This field indicates the count or quantity of events that have been processed and considered in the charging process.
1962
2141
  * @example 23
1963
2142
  */
1964
- events_count?: number;
2143
+ events_count?: number | null;
1965
2144
  /**
1966
2145
  * Flag that indicates whether the fee was paid in advance. It serves as a boolean value, where `true` represents that the fee was paid in advance (straightaway), and `false` indicates that the fee was not paid in arrears (at the end of the period).
1967
2146
  * @example true
@@ -2018,6 +2197,16 @@ export interface FeeObject {
2018
2197
  * @example "transaction_1234567890"
2019
2198
  */
2020
2199
  event_transaction_id?: string | null;
2200
+ /**
2201
+ * The description of the fee.
2202
+ * @example "Fee description"
2203
+ */
2204
+ description?: string | null;
2205
+ /**
2206
+ * The coupon amount applied to the fee, with precision.
2207
+ * @example "0.0"
2208
+ */
2209
+ precise_coupons_amount_cents?: string;
2021
2210
  /** List of all unit amount details for calculating the fee. */
2022
2211
  amount_details?: FeeAmountDetails;
2023
2212
  /**
@@ -2031,7 +2220,7 @@ export interface FeeObject {
2031
2220
  * The fee type. Possible values are `add-on`, `charge`, `credit`, `subscription` or `commitment`.
2032
2221
  * @example "subscription"
2033
2222
  */
2034
- type: "charge" | "add_on" | "subscription" | "credit";
2223
+ type: "charge" | "add_on" | "subscription" | "credit" | "commitment";
2035
2224
  /**
2036
2225
  * The code of the fee item. It can be the code of the `add-on`, the code of the `charge`, the code of the `credit` or the code of the `subscription`.
2037
2226
  * @example "startup"
@@ -2042,6 +2231,11 @@ export interface FeeObject {
2042
2231
  * @example "Startup"
2043
2232
  */
2044
2233
  name: string;
2234
+ /**
2235
+ * The description of the fee item. It can be the description of the `add-on`, the `charge`, the `credit`, the `subscription` or the `commitment`.
2236
+ * @example "Startup"
2237
+ */
2238
+ description?: string | null;
2045
2239
  /**
2046
2240
  * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
2047
2241
  * @example "Setup Fee (SF1)"
@@ -2051,9 +2245,9 @@ export interface FeeObject {
2051
2245
  * Specifies the name that will be displayed on an invoice. If no value is set for this field, the actual charge filter values will be used as the default display name.
2052
2246
  * @example "AWS eu-east-1"
2053
2247
  */
2054
- filter_invoice_display_name?: string;
2248
+ filter_invoice_display_name?: string | null;
2055
2249
  /** Key value list of event properties */
2056
- filters?: Record<string, string[]>;
2250
+ filters?: object | null;
2057
2251
  /**
2058
2252
  * 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`.
2059
2253
  * @format uuid
@@ -2907,11 +3101,8 @@ export interface CustomerCreateInput {
2907
3101
  * @example "CA"
2908
3102
  */
2909
3103
  state?: string | null;
2910
- /**
2911
- * List of unique code used to identify the taxes.
2912
- * @example ["french_standard_vat"]
2913
- */
2914
- tax_codes?: string[];
3104
+ /** List of unique code used to identify the taxes. */
3105
+ tax_codes?: TaxCodes;
2915
3106
  /**
2916
3107
  * The tax identification number of the customer
2917
3108
  * @example "EU123456789"
@@ -3064,9 +3255,9 @@ export type CustomerChargeFiltersUsageObject = {
3064
3255
  pricing_unit_details?: UsagePricingUnitDetailsObject;
3065
3256
  /**
3066
3257
  * List of filter values applied to the usage.
3067
- * @example {"region":"us-east-1"}
3258
+ * @example {"region":["us-east-1"]}
3068
3259
  */
3069
- values?: Record<string, string>;
3260
+ values?: Record<string, string[]>;
3070
3261
  }[];
3071
3262
  /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
3072
3263
  export type CustomerChargeGroupedUsageObject = {
@@ -3216,6 +3407,62 @@ export interface CustomerUsageObject {
3216
3407
  export interface CustomerUsage {
3217
3408
  customer_usage: CustomerUsageObject;
3218
3409
  }
3410
+ export interface CustomerProjectedUsageObject {
3411
+ /**
3412
+ * The lower bound of the billing period, expressed in the ISO 8601 datetime format in Coordinated Universal Time (UTC).
3413
+ * @format date-time
3414
+ * @example "2022-07-01T00:00:00Z"
3415
+ */
3416
+ from_datetime: string;
3417
+ /**
3418
+ * The upper bound of the billing period, expressed in the ISO 8601 datetime format in Coordinated Universal Time (UTC).
3419
+ * @format date-time
3420
+ * @example "2022-07-31T23:59:59Z"
3421
+ */
3422
+ to_datetime: string;
3423
+ /**
3424
+ * The date of creation of the invoice.
3425
+ * @format date
3426
+ * @example "2022-08-01"
3427
+ */
3428
+ issuing_date: string;
3429
+ /**
3430
+ * A unique identifier associated with the invoice related to this particular usage record.
3431
+ * @format uuid
3432
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3433
+ */
3434
+ lago_invoice_id?: string | null;
3435
+ /**
3436
+ * The currency of the customer's current usage.
3437
+ * @example "EUR"
3438
+ */
3439
+ currency?: Currency;
3440
+ /**
3441
+ * The amount in cents, tax excluded.
3442
+ * @example 123
3443
+ */
3444
+ amount_cents: number;
3445
+ /**
3446
+ * The projected amount in cents, tax excluded.
3447
+ * @example 256
3448
+ */
3449
+ projected_amount_cents: number;
3450
+ /**
3451
+ * The tax amount in cents.
3452
+ * @example 200
3453
+ */
3454
+ taxes_amount_cents: number;
3455
+ /**
3456
+ * The total amount in cents, tax included.
3457
+ * @example 123
3458
+ */
3459
+ total_amount_cents: number;
3460
+ /** Array of charges that comprise the current usage. It contains detailed information about individual charge items associated with the usage. */
3461
+ charges_usage: CustomerChargeUsageObject[];
3462
+ }
3463
+ export interface CustomerProjectedUsage {
3464
+ customer_projected_usage: CustomerProjectedUsageObject;
3465
+ }
3219
3466
  export interface CustomerPastUsage {
3220
3467
  usage_periods: CustomerUsage[];
3221
3468
  meta: PaginationMeta;
@@ -3606,9 +3853,10 @@ export interface EventBatchEstimateInstantFeesInput {
3606
3853
  export interface Event {
3607
3854
  event: EventObject;
3608
3855
  }
3609
- export type FeesPaginated = Fees & {
3856
+ export interface FeesPaginated {
3857
+ fees: FeeObject[];
3610
3858
  meta: PaginationMeta;
3611
- };
3859
+ }
3612
3860
  export interface Fee {
3613
3861
  fee: FeeObject;
3614
3862
  }
@@ -3964,10 +4212,19 @@ export interface InvoiceOneOffCreateInput {
3964
4212
  */
3965
4213
  description?: string | null;
3966
4214
  /**
3967
- * List of unique code used to identify the taxes.
3968
- * @example ["french_standard_vat"]
4215
+ * The lower boundary of the invoice billing interval. The `from_datetime` should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4216
+ * @format date-time
4217
+ * @example "2022-08-08T00:00:00Z"
3969
4218
  */
3970
- tax_codes?: string[];
4219
+ from_datetime?: string;
4220
+ /**
4221
+ * The upper boundary of the invoice billing interval. The `to_datetime` should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4222
+ * @format date-time
4223
+ * @example "2022-08-08T00:00:00Z"
4224
+ */
4225
+ to_datetime?: string;
4226
+ /** List of unique code used to identify the taxes. */
4227
+ tax_codes?: TaxCodes;
3971
4228
  /**
3972
4229
  * If true, the invoice will be created but not sent to the payment provider.
3973
4230
  * @default false
@@ -4098,13 +4355,14 @@ export interface SubscriptionObject {
4098
4355
  * When a pay-in-advance subscription is terminated before the end of its billing period, we generate a credit note for the unused subscription time by default.
4099
4356
  * This field allows you to control the behavior of the credit note generation:
4100
4357
  *
4101
- * - `credit`: A credit note is generated for the unused subscription time. The unused amount is credited to the credit note wallet.
4358
+ * - `credit`: A credit note is generated for the unused subscription time. The unused amount is credited back to the customer.
4359
+ * - `refund`: A credit note is generated for the unused subscription time. If the invoice is paid or partially paid, the unused paid amount is refunded; any unpaid unused amount is credited back to the customer.
4102
4360
  * - `skip`: No credit note is generated for the unused subscription time.
4103
4361
  *
4104
4362
  * _Note: This field is only applicable to pay-in-advance plans and will be `null` for pay-in-arrears plans._
4105
4363
  * @example "credit"
4106
4364
  */
4107
- on_termination_credit_note: "credit" | "skip";
4365
+ on_termination_credit_note: "credit" | "refund" | "skip";
4108
4366
  /**
4109
4367
  * When a subscription is terminated before the end of its billing period, we generate an invoice for the unbilled usage.
4110
4368
  * This field allows you to control the behavior of the invoice generation:
@@ -5122,6 +5380,38 @@ export interface ChargeObject {
5122
5380
  conversion_rate: string;
5123
5381
  };
5124
5382
  }
5383
+ export type PlanEntitlementPrivilegeObject = FeaturePrivilegeObject & {
5384
+ /**
5385
+ * Value assigned to this privilege in the entitlement. Type depends on the privilege's value_type.
5386
+ * @example 10
5387
+ */
5388
+ value: number | boolean | string;
5389
+ };
5390
+ export interface PlanEntitlementObject {
5391
+ /**
5392
+ * Unique code used to identify the feature. Max 255 characters.
5393
+ * @example "seats"
5394
+ */
5395
+ code: string;
5396
+ /**
5397
+ * Name of the feature. Max 255 characters.
5398
+ * @example "Number of seats"
5399
+ */
5400
+ name: string | null;
5401
+ /**
5402
+ * Description of the feature. Max 600 characters.
5403
+ * @example "Number of users of the account"
5404
+ */
5405
+ description: string | null;
5406
+ /**
5407
+ * Privileges associated with this feature. Each privilege must have a value assigned.
5408
+ * @example [{"code":"max","name":"Maximum","value_type":"integer","value":10},{"code":"max_admins","name":"Max Admins","value_type":"integer","value":5},{"code":"root","name":"Allow root user","value_type":"boolean","value":true},{"code":"provider","name":"SSO Provider","value_type":"select","value":"google","config":{"select_options":["google","okta"]}}]
5409
+ */
5410
+ privileges: PlanEntitlementPrivilegeObject[];
5411
+ }
5412
+ export interface PlanEntitlement {
5413
+ entitlement: PlanEntitlementObject;
5414
+ }
5125
5415
  export interface PlanObject {
5126
5416
  /**
5127
5417
  * Unique identifier of the plan created by Lago.
@@ -5195,6 +5485,8 @@ export interface PlanObject {
5195
5485
  taxes?: TaxObject[];
5196
5486
  /** List of usage thresholds applied to the plan. */
5197
5487
  usage_thresholds?: UsageThresholdObject[];
5488
+ /** List of all feature entitlements and their privileges available for this plan. */
5489
+ entitlements?: PlanEntitlement[];
5198
5490
  }
5199
5491
  export interface PlansPaginated {
5200
5492
  plans: PlanObject[];
@@ -5212,11 +5504,8 @@ export interface MinimumCommitmentInput {
5212
5504
  * @example "Minimum Commitment (C1)"
5213
5505
  */
5214
5506
  invoice_display_name?: string;
5215
- /**
5216
- * List of unique code used to identify the taxes.
5217
- * @example ["french_standard_vat"]
5218
- */
5219
- tax_codes?: string[];
5507
+ /** List of unique code used to identify the taxes. */
5508
+ tax_codes?: TaxCodes;
5220
5509
  }
5221
5510
  /** Values used to apply differentiated pricing based on additional event properties. */
5222
5511
  export interface ChargeFilterInput {
@@ -5308,11 +5597,8 @@ export interface PlanCreateInput {
5308
5597
  * @example null
5309
5598
  */
5310
5599
  bill_charges_monthly?: boolean | null;
5311
- /**
5312
- * List of unique code used to identify the taxes.
5313
- * @example ["french_standard_vat"]
5314
- */
5315
- tax_codes?: string[];
5600
+ /** List of unique code used to identify the taxes. */
5601
+ tax_codes?: TaxCodes;
5316
5602
  /** Minimum commitment for this plan. */
5317
5603
  minimum_commitment?: MinimumCommitmentInput;
5318
5604
  /**
@@ -5373,11 +5659,8 @@ export interface PlanCreateInput {
5373
5659
  properties?: ChargeProperties;
5374
5660
  /** List of filters used to apply differentiated pricing based on additional event properties. */
5375
5661
  filters?: ChargeFilterInput[];
5376
- /**
5377
- * List of unique code used to identify the taxes.
5378
- * @example ["french_standard_vat"]
5379
- */
5380
- tax_codes?: string[];
5662
+ /** List of unique code used to identify the taxes. */
5663
+ tax_codes?: TaxCodes;
5381
5664
  /** The pricing unit to apply to the charge. */
5382
5665
  applied_pricing_unit?: {
5383
5666
  /**
@@ -5453,11 +5736,8 @@ export interface PlanUpdateInput {
5453
5736
  * @example null
5454
5737
  */
5455
5738
  bill_charges_monthly?: boolean | null;
5456
- /**
5457
- * List of unique code used to identify the taxes.
5458
- * @example ["french_standard_vat"]
5459
- */
5460
- tax_codes?: string[];
5739
+ /** List of unique code used to identify the taxes. */
5740
+ tax_codes?: TaxCodes;
5461
5741
  /** Minimum commitment for this plan. */
5462
5742
  minimum_commitment?: MinimumCommitmentInput;
5463
5743
  /**
@@ -5524,11 +5804,8 @@ export interface PlanUpdateInput {
5524
5804
  properties?: ChargeProperties;
5525
5805
  /** List of filters used to apply differentiated pricing based on additional event properties. */
5526
5806
  filters?: ChargeFilterInput[];
5527
- /**
5528
- * List of unique code used to identify the taxes.
5529
- * @example ["french_standard_vat"]
5530
- */
5531
- tax_codes?: string[];
5807
+ /** List of unique code used to identify the taxes. */
5808
+ tax_codes?: TaxCodes;
5532
5809
  /** Updates the pricing unit conversion rate for this charge. Only applies if the charge has applied pricing unit. */
5533
5810
  applied_pricing_unit?: {
5534
5811
  /**
@@ -5549,6 +5826,14 @@ export interface PlanUpdateInput {
5549
5826
  cascade_updates?: boolean;
5550
5827
  };
5551
5828
  }
5829
+ export interface PlanEntitlements {
5830
+ entitlements: PlanEntitlementObject[];
5831
+ }
5832
+ /**
5833
+ * Feature entitlements with their privilege values. Each key is a feature code, and the value is an object containing privilege codes with their associated values.
5834
+ * @example {"seats":{"max":20,"max_admins":10,"root":false},"sso":{"provider":"okta"}}
5835
+ */
5836
+ export type EntitlementUpdateInput = Record<string, Record<string, number | boolean | string>>;
5552
5837
  export interface SubscriptionsPaginated {
5553
5838
  subscriptions: SubscriptionObject[];
5554
5839
  meta: PaginationMeta;
@@ -5580,11 +5865,8 @@ export interface PlanOverridesObject {
5580
5865
  * @example "Startup"
5581
5866
  */
5582
5867
  name?: string;
5583
- /**
5584
- * List of unique code used to identify the taxes.
5585
- * @example ["french_standard_vat"]
5586
- */
5587
- tax_codes?: string[];
5868
+ /** List of unique code used to identify the taxes. */
5869
+ tax_codes?: TaxCodes;
5588
5870
  /**
5589
5871
  * The duration in days during which the base cost of the plan is offered for free.
5590
5872
  * @example 5
@@ -5619,11 +5901,8 @@ export interface PlanOverridesObject {
5619
5901
  properties?: ChargeProperties;
5620
5902
  /** List of filters used to apply differentiated pricing based on additional event properties. */
5621
5903
  filters?: ChargeFilterInput[];
5622
- /**
5623
- * List of unique code used to identify the taxes.
5624
- * @example ["french_standard_vat"]
5625
- */
5626
- tax_codes?: string[];
5904
+ /** List of unique code used to identify the taxes. */
5905
+ tax_codes?: TaxCodes;
5627
5906
  /** Updates the pricing unit conversion rate for this charge. Only applies if the charge has applied pricing unit. */
5628
5907
  applied_pricing_unit?: {
5629
5908
  /**
@@ -5924,6 +6203,51 @@ export interface Alert {
5924
6203
  export interface AlertUpdateInput {
5925
6204
  alert: AlertBaseInput;
5926
6205
  }
6206
+ export type SubscriptionEntitlementPrivilegeObject = FeaturePrivilegeObject & {
6207
+ /**
6208
+ * Applicable value this this subscription (override_value if set, plan_value otherwise). Type depends on the privilege's value_type.
6209
+ * @example 10
6210
+ */
6211
+ value: number | boolean | string;
6212
+ /**
6213
+ * Value assigned to this privilege in the plan. Type depends on the privilege's value_type.
6214
+ * @example 10
6215
+ */
6216
+ plan_value: number | boolean | string;
6217
+ /**
6218
+ * Value assigned to this subscription specifically. Type depends on the privilege's value_type. Null if no override is set.
6219
+ * @example 10
6220
+ */
6221
+ override_value: number | boolean | string | null;
6222
+ };
6223
+ export interface SubscriptionEntitlementObject {
6224
+ /**
6225
+ * Unique code used to identify the feature. Max 255 characters.
6226
+ * @example "seats"
6227
+ */
6228
+ code: string;
6229
+ /**
6230
+ * Name of the feature. Max 255 characters.
6231
+ * @example "Number of seats"
6232
+ */
6233
+ name: string | null;
6234
+ /**
6235
+ * Description of the feature. Max 600 characters.
6236
+ * @example "Number of users of the account"
6237
+ */
6238
+ description: string | null;
6239
+ /**
6240
+ * Privileges associated with this feature. Each privilege shows the plan value and any subscription override.
6241
+ * @example [{"code":"max","name":"Maximum","value_type":"integer","value":15,"plan_value":10,"override_value":15},{"code":"max_admins","name":"Max Admins","value_type":"integer","value":5,"plan_value":5,"override_value":null},{"code":"root","name":"Allow root user","value_type":"boolean","value":true,"plan_value":true,"override_value":null},{"code":"provider","name":"SSO Provider","value_type":"select","value":"okta","plan_value":"google","override_value":"okta","config":{"select_options":["google","okta"]}}]
6242
+ */
6243
+ privileges: SubscriptionEntitlementPrivilegeObject[];
6244
+ }
6245
+ export interface SubscriptionEntitlements {
6246
+ entitlements: SubscriptionEntitlementObject[];
6247
+ }
6248
+ export interface SubscriptionEntitlement {
6249
+ entitlement: SubscriptionEntitlementObject;
6250
+ }
5927
6251
  export interface TaxesPaginated {
5928
6252
  taxes: TaxObject[];
5929
6253
  meta: PaginationMeta;
@@ -6150,6 +6474,11 @@ export interface WalletObject {
6150
6474
  * @example ["charge"]
6151
6475
  */
6152
6476
  fee_types?: ("charge" | "subscription" | "commitment")[];
6477
+ /**
6478
+ * An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
6479
+ * @example ["bm1"]
6480
+ */
6481
+ billable_metric_codes?: string[];
6153
6482
  };
6154
6483
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
6155
6484
  recurring_transaction_rules?: WalletRecurringTransactionRule[];
@@ -6238,6 +6567,11 @@ export interface WalletCreateInput {
6238
6567
  * @example ["charge"]
6239
6568
  */
6240
6569
  fee_types?: any[] | null;
6570
+ /**
6571
+ * An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
6572
+ * @example []
6573
+ */
6574
+ billable_metric_codes?: any[] | null;
6241
6575
  };
6242
6576
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
6243
6577
  recurring_transaction_rules?: any[] | null;
@@ -6346,6 +6680,11 @@ export interface WalletUpdateInput {
6346
6680
  * @example ["charge"]
6347
6681
  */
6348
6682
  fee_types?: any[] | null;
6683
+ /**
6684
+ * An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
6685
+ * @example []
6686
+ */
6687
+ billable_metric_codes?: any[] | null;
6349
6688
  };
6350
6689
  };
6351
6690
  }
@@ -6755,6 +7094,28 @@ export interface CreditNotePaymentProviderRefundError {
6755
7094
  payment_provider_code?: string;
6756
7095
  provider_error?: string | Record<string, any>;
6757
7096
  }
7097
+ export interface DunningCampaignFinishedObject {
7098
+ /**
7099
+ * The customer external unique identifier (provided by your own application).
7100
+ * @example "cus_0987654321"
7101
+ */
7102
+ customer_external_id: string;
7103
+ /**
7104
+ * Identifier of the dunning campaign.
7105
+ * @example "dun_code_1234"
7106
+ */
7107
+ dunning_campaign_code: string;
7108
+ /**
7109
+ * The amount of the overdue balance, expressed in cents.
7110
+ * @example 120
7111
+ */
7112
+ overdue_balance_cents: number;
7113
+ /**
7114
+ * The currency of the balance.
7115
+ * @example "EUR"
7116
+ */
7117
+ overdue_balance_currency: Currency;
7118
+ }
6758
7119
  export interface EventErrorsObject {
6759
7120
  /**
6760
7121
  * HTTP status code. It will always be 422
@@ -6975,6 +7336,7 @@ export interface WalletTransactionPaymentFailureObject {
6975
7336
  provider_error?: string | Record<string, any>;
6976
7337
  }
6977
7338
  export type CustomerPaymentProvidernErrorObject = CustomerPaymentProviderErrorObject;
7339
+ export type PrivilegeObject = FeaturePrivilegeObject;
6978
7340
  export type QueryParamsType = Record<string | number, any>;
6979
7341
  export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
6980
7342
  export interface FullRequestParams extends Omit<RequestInit, "body"> {
@@ -7406,6 +7768,68 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7406
7768
  */
7407
7769
  months?: number;
7408
7770
  }, params?: RequestParams) => Promise<HttpResponse<OverdueBalances, ApiErrorUnauthorized | ApiErrorForbidden>>;
7771
+ /**
7772
+ * @description Returns usages.
7773
+ *
7774
+ * @tags analytics
7775
+ * @name FindAllUsages
7776
+ * @summary List usage
7777
+ * @request GET:/analytics/usage
7778
+ * @secure
7779
+ */
7780
+ findAllUsages: (query?: {
7781
+ /**
7782
+ * The time granularity of usage analytics. Possible values are 'daily', 'weekly', 'monthly', 'yearly'.
7783
+ * @example "monthly"
7784
+ */
7785
+ time_granularity?: "daily" | "weekly" | "monthly";
7786
+ /** The currency of usage analytics. Format must be ISO 4217. */
7787
+ currency?: Currency;
7788
+ /**
7789
+ * The start date of the period for which the usage analytics is calculated.
7790
+ * @format date
7791
+ * @example "2023-11-01"
7792
+ */
7793
+ from_date?: string;
7794
+ /**
7795
+ * The end date of the period for which the usage analytics is calculated.
7796
+ * @format date
7797
+ * @example "2023-11-30"
7798
+ */
7799
+ to_date?: string;
7800
+ /**
7801
+ * The type of customer for which the usage analytics is calculated. Possible values are 'individual', 'company'.
7802
+ * @example "individual"
7803
+ */
7804
+ customer_type?: "individual" | "company";
7805
+ /**
7806
+ * The external identifier of the customer for which the usage analytics is calculated.
7807
+ * @example "ext-customer-123"
7808
+ */
7809
+ external_customer_id?: string;
7810
+ /** The country of the customer for which the usage analytics is calculated. */
7811
+ customer_country?: Country;
7812
+ /**
7813
+ * The external identifier of the subscription for which the usage analytics is calculated.
7814
+ * @example "ext-subscription-123"
7815
+ */
7816
+ external_subscription_id?: string;
7817
+ /**
7818
+ * Indicates whether the billable metric associated with the usage is recurring.
7819
+ * @example true
7820
+ */
7821
+ is_billable_metric_recurring?: boolean;
7822
+ /**
7823
+ * The code of the plan for which the usage analytics is calculated.
7824
+ * @example "plan-code-123"
7825
+ */
7826
+ plan_code?: string;
7827
+ /**
7828
+ * The code of the usage-based billable metrics for which the usage analytics is calculated.
7829
+ * @example "code1"
7830
+ */
7831
+ billable_metric_code?: string;
7832
+ }, params?: RequestParams) => Promise<HttpResponse<Usages, ApiErrorUnauthorized>>;
7409
7833
  };
7410
7834
  appliedCoupons: {
7411
7835
  /**
@@ -7528,6 +7952,81 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7528
7952
  */
7529
7953
  findBillableMetric: (code: string, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiErrorUnauthorized | ApiErrorNotFound>>;
7530
7954
  };
7955
+ features: {
7956
+ /**
7957
+ * @description This endpoint creates a new feature representing an entitlement component of your application.
7958
+ *
7959
+ * @tags features
7960
+ * @name CreateFeature
7961
+ * @summary Create a feature
7962
+ * @request POST:/features
7963
+ * @secure
7964
+ */
7965
+ createFeature: (data: FeatureCreateInput, params?: RequestParams) => Promise<HttpResponse<Feature, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
7966
+ /**
7967
+ * @description This endpoint retrieves all existing features that represent entitlement components of your application.
7968
+ *
7969
+ * @tags features
7970
+ * @name FindAllFeatures
7971
+ * @summary List all features
7972
+ * @request GET:/features
7973
+ * @secure
7974
+ */
7975
+ findAllFeatures: (query?: {
7976
+ /**
7977
+ * Page number.
7978
+ * @example 1
7979
+ */
7980
+ page?: number;
7981
+ /**
7982
+ * Number of records per page.
7983
+ * @example 20
7984
+ */
7985
+ per_page?: number;
7986
+ /** Search in name, code and description. */
7987
+ search_term?: string;
7988
+ }, params?: RequestParams) => Promise<HttpResponse<FeaturesPaginated, ApiErrorUnauthorized>>;
7989
+ /**
7990
+ * @description This endpoint updates an existing feature representing an entitlement component of your application.
7991
+ *
7992
+ * @tags features
7993
+ * @name UpdateFeature
7994
+ * @summary Update a feature
7995
+ * @request PUT:/features/{code}
7996
+ * @secure
7997
+ */
7998
+ updateFeature: (code: string, data: FeatureUpdateInput, params?: RequestParams) => Promise<HttpResponse<Feature, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
7999
+ /**
8000
+ * @description This endpoint deletes an existing feature representing an entitlement component of your application. Deleting a feature will remove it from all plans and subscriptions.
8001
+ *
8002
+ * @tags features
8003
+ * @name DestroyFeature
8004
+ * @summary Delete a feature
8005
+ * @request DELETE:/features/{code}
8006
+ * @secure
8007
+ */
8008
+ destroyFeature: (code: string, params?: RequestParams) => Promise<HttpResponse<Feature, ApiErrorUnauthorized | ApiErrorNotFound>>;
8009
+ /**
8010
+ * @description This endpoint retrieves an existing feature that represents an entitlement component of your application. The feature is identified by its unique code.
8011
+ *
8012
+ * @tags features
8013
+ * @name FindFeature
8014
+ * @summary Retrieve a feature
8015
+ * @request GET:/features/{code}
8016
+ * @secure
8017
+ */
8018
+ findFeature: (code: string, params?: RequestParams) => Promise<HttpResponse<Feature, ApiErrorUnauthorized | ApiErrorNotFound>>;
8019
+ /**
8020
+ * @description Delete privilege from feature. Deleting a privilege removes it from all plans and subscriptions.
8021
+ *
8022
+ * @tags features
8023
+ * @name DeleteFeaturePrivilege
8024
+ * @summary Delete a privilege. Deleting a privilege removes it from all plans and subscriptions.
8025
+ * @request DELETE:/features/{code}/privileges/{privilege_code}
8026
+ * @secure
8027
+ */
8028
+ deleteFeaturePrivilege: (code: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<Feature, ApiErrorUnauthorized | ApiErrorNotFound>>;
8029
+ };
7531
8030
  coupons: {
7532
8031
  /**
7533
8032
  * @description This endpoint is used to create a coupon that can be then attached to a customer to create a discount.
@@ -7844,6 +8343,28 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7844
8343
  */
7845
8344
  apply_taxes?: boolean;
7846
8345
  }, params?: RequestParams) => Promise<HttpResponse<CustomerUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
8346
+ /**
8347
+ * @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period. It also returns the projected usage for the current period based on the current usage.
8348
+ *
8349
+ * @tags customers
8350
+ * @name FindCustomerProjectedUsage
8351
+ * @summary Retrieve customer current and projected usage
8352
+ * @request GET:/customers/{external_customer_id}/projected_usage
8353
+ * @secure
8354
+ */
8355
+ findCustomerProjectedUsage: (externalCustomerId: string, query: {
8356
+ /**
8357
+ * The unique identifier of the subscription within your application.
8358
+ * @example "sub_1234567890"
8359
+ */
8360
+ external_subscription_id: string;
8361
+ /**
8362
+ * Optional flag to determine if taxes should be applied. Defaults to `true` if not provided or if null.
8363
+ * @default true
8364
+ * @example true
8365
+ */
8366
+ apply_taxes?: boolean;
8367
+ }, params?: RequestParams) => Promise<HttpResponse<CustomerProjectedUsage, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
7847
8368
  /**
7848
8369
  * @description This endpoint enables the retrieval of the usage-based billing data for a customer within past periods.
7849
8370
  *
@@ -8032,13 +8553,13 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8032
8553
  * @example "et_12345678"
8033
8554
  */
8034
8555
  event_transaction_id?: string;
8035
- /** Filter results by fee's currency. */
8556
+ /** Filter results by fee"s currency. */
8036
8557
  currency?: Currency;
8037
8558
  /**
8038
- * The fee type. Possible values are `add-on`, `charge`, `credit` or `subscription`.
8559
+ * The fee type. Possible values are `add-on`, `charge`, `credit`, `subscription` or "commitment".
8039
8560
  * @example "charge"
8040
8561
  */
8041
- fee_type?: "charge" | "add_on" | "subscription" | "credit" | "instant_charge";
8562
+ fee_type?: "charge" | "add_on" | "subscription" | "credit" | "commitment";
8042
8563
  /**
8043
8564
  * Filter results by the `code` of the billable metric attached to the fee. Only applies to `charge` types.
8044
8565
  * @example "bm_code"
@@ -8432,6 +8953,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8432
8953
  */
8433
8954
  payment_status?: "pending" | "failed" | "succeeded";
8434
8955
  }, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized>>;
8956
+ /**
8957
+ * @description This endpoint retrieves a specific payment request by its ID.
8958
+ *
8959
+ * @tags payment_requests
8960
+ * @name FindPaymentRequest
8961
+ * @summary Retrieve a payment request
8962
+ * @request GET:/payment_requests/{lago_id}
8963
+ * @secure
8964
+ */
8965
+ findPaymentRequest: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<PaymentRequestObject, ApiErrorUnauthorized | ApiErrorNotFound>>;
8435
8966
  };
8436
8967
  payments: {
8437
8968
  /**
@@ -8549,6 +9080,66 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8549
9080
  * @secure
8550
9081
  */
8551
9082
  destroyPlan: (code: string, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorUnauthorized | ApiErrorNotFound>>;
9083
+ /**
9084
+ * @description This endpoint creates a new entitlement by adding a feature to a plan. The feature must exist and all privileges must be valid for the feature.
9085
+ *
9086
+ * @tags entitlements
9087
+ * @name CreateEntitlement
9088
+ * @summary Create an entitlement
9089
+ * @request POST:/plans/{code}/entitlements
9090
+ * @secure
9091
+ */
9092
+ createEntitlement: (code: string, data: EntitlementUpdateInput, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
9093
+ /**
9094
+ * @description This endpoint retrieves all entitlements for a specific plan.
9095
+ *
9096
+ * @tags entitlements
9097
+ * @name FindAllEntitlements
9098
+ * @summary List all entitlements
9099
+ * @request GET:/plans/{code}/entitlements
9100
+ * @secure
9101
+ */
9102
+ findAllEntitlements: (code: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlements, ApiErrorUnauthorized | ApiErrorNotFound>>;
9103
+ /**
9104
+ * @description This endpoint updates an existing entitlement by modifying privilege values. Notice that the update is partial. All new privileges or features are added. If there is already a value, it's overridden. All feature and privileges not part of the payload are ignored. To remove privileges or feature, use the delete endpoints. All privileges must be valid for the feature.
9105
+ *
9106
+ * @tags entitlements
9107
+ * @name UpdateEntitlement
9108
+ * @summary Partial update of an entitlement
9109
+ * @request PATCH:/plans/{code}/entitlements
9110
+ * @secure
9111
+ */
9112
+ updateEntitlement: (code: string, data: EntitlementUpdateInput, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
9113
+ /**
9114
+ * @description This endpoint retrieves a specific entitlement for a plan.
9115
+ *
9116
+ * @tags entitlements
9117
+ * @name FindEntitlement
9118
+ * @summary Retrieve an entitlement
9119
+ * @request GET:/plans/{code}/entitlements/{feature_code}
9120
+ * @secure
9121
+ */
9122
+ findEntitlement: (code: string, featureCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
9123
+ /**
9124
+ * @description This endpoint deletes an existing entitlement by removing the feature from the plan.
9125
+ *
9126
+ * @tags entitlements
9127
+ * @name DestroyEntitlement
9128
+ * @summary Delete an entitlement
9129
+ * @request DELETE:/plans/{code}/entitlements/{feature_code}
9130
+ * @secure
9131
+ */
9132
+ destroyEntitlement: (code: string, featureCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
9133
+ /**
9134
+ * @description This endpoint removes a specific privilege and its value from an entitlement. The privilege remains untouched on the original feature.
9135
+ *
9136
+ * @tags entitlements
9137
+ * @name RemoveEntitlementPrivilege
9138
+ * @summary Remove a privilege from an entitlement
9139
+ * @request DELETE:/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code}
9140
+ * @secure
9141
+ */
9142
+ removeEntitlementPrivilege: (code: string, featureCode: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
8552
9143
  };
8553
9144
  subscriptions: {
8554
9145
  /**
@@ -8644,13 +9235,14 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8644
9235
  * When a pay-in-advance subscription is terminated before the end of its billing period, we generate a credit note for the unused subscription time by default.
8645
9236
  * This field allows you to control the behavior of the credit note generation:
8646
9237
  *
8647
- * - `credit`: A credit note is generated for the unused subscription time.
9238
+ * - `credit`: A credit note is generated for the unused subscription time. The unused amount is credited back to the customer.
9239
+ * - `refund`: A credit note is generated for the unused subscription time. If the invoice is paid or partially paid, the unused paid amount is refunded; any unpaid unused amount is credited back to the customer.
8648
9240
  * - `skip`: No credit note is generated for the unused subscription time.
8649
9241
  *
8650
9242
  * _Note: This field is only applicable to pay-in-advance plans and is ignored for pay-in-arrears plans._
8651
9243
  * @example "credit"
8652
9244
  */
8653
- on_termination_credit_note?: "credit" | "skip";
9245
+ on_termination_credit_note?: "credit" | "refund" | "skip";
8654
9246
  /**
8655
9247
  * When a subscription is terminated before the end of its billing period, we generate an invoice for the unbilled usage.
8656
9248
  * This field allows you to control the behavior of the invoice generation:
@@ -8731,6 +9323,46 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8731
9323
  * @secure
8732
9324
  */
8733
9325
  deleteSubscriptionAlert: (externalId: string, code: string, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
9326
+ /**
9327
+ * @description This endpoint retrieves all entitlements for a specific subscription, including both plan entitlements and any subscription-specific overrides.
9328
+ *
9329
+ * @tags entitlements
9330
+ * @name FindAllSubscriptionEntitlements
9331
+ * @summary List all subscription entitlements
9332
+ * @request GET:/subscriptions/{external_id}/entitlements
9333
+ * @secure
9334
+ */
9335
+ findAllSubscriptionEntitlements: (externalId: string, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorNotFound>>;
9336
+ /**
9337
+ * @description This endpoint allows partial updates to subscription entitlements. New entitlements are added, provided values are overridden, but entitlements not included in the payload are ignored.
9338
+ *
9339
+ * @tags entitlements
9340
+ * @name UpdateSubscriptionEntitlements
9341
+ * @summary Update subscription entitlements
9342
+ * @request PATCH:/subscriptions/{external_id}/entitlements
9343
+ * @secure
9344
+ */
9345
+ updateSubscriptionEntitlements: (externalId: string, data: EntitlementUpdateInput, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
9346
+ /**
9347
+ * @description This endpoint removes a specific feature entitlement from a subscription. The entitlement remains available from the plan.
9348
+ *
9349
+ * @tags entitlements
9350
+ * @name DestroySubscriptionEntitlement
9351
+ * @summary Remove an entitlement from a subscription
9352
+ * @request DELETE:/subscriptions/{external_id}/entitlements/{feature_code}
9353
+ * @secure
9354
+ */
9355
+ destroySubscriptionEntitlement: (externalId: string, featureCode: string, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
9356
+ /**
9357
+ * @description This endpoint removes a specific privilege from a subscription entitlement. The privilege entitlement remains available from the plan.
9358
+ *
9359
+ * @tags entitlements
9360
+ * @name DestroySubscriptionEntitlementPrivilege
9361
+ * @summary Remove a privilege from a subscription entitlement override
9362
+ * @request DELETE:/subscriptions/{external_id}/entitlements/{feature_code}/privileges/{privilege_code}
9363
+ * @secure
9364
+ */
9365
+ destroySubscriptionEntitlementPrivilege: (externalId: string, featureCode: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorBadRequest | ApiErrorNotFound>>;
8734
9366
  };
8735
9367
  taxes: {
8736
9368
  /**