lago-javascript-client 1.0.0 → 1.2.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.
@@ -401,6 +401,7 @@ export interface BillableMetricObject {
401
401
  weighted_interval?: "seconds" | null;
402
402
  /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
403
403
  group?: BillableMetricGroup;
404
+ filters?: BillableMetricFilterObject[];
404
405
  /**
405
406
  * Number of active subscriptions using this billable metric.
406
407
  * @example 4
@@ -459,14 +460,38 @@ export interface BillableMetricBaseInput {
459
460
  weighted_interval?: "seconds" | null;
460
461
  /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
461
462
  group?: BillableMetricGroup;
463
+ filters?: BillableMetricFilterInput[];
462
464
  }
463
465
  export interface BillableMetricCreateInput {
464
466
  billable_metric: BillableMetricBaseInput;
465
467
  }
468
+ /** Values used to apply differentiated pricing based on additional event properties. */
469
+ export interface BillableMetricFilterInput {
470
+ /**
471
+ * Filter key to add to the event properties payload
472
+ * @example "region"
473
+ */
474
+ key: string;
475
+ /** List of possible filter values */
476
+ values: string[];
477
+ }
478
+ /** Values used to apply differentiated pricing based on additional event properties. */
479
+ export interface BillableMetricFilterObject {
480
+ /**
481
+ * Filter key to add to the event properties payload
482
+ * @example "region"
483
+ */
484
+ key: string;
485
+ /** List of possible filter values */
486
+ values: string[];
487
+ }
466
488
  export interface BillableMetricUpdateInput {
467
489
  billable_metric: BillableMetricBaseInput;
468
490
  }
469
- /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
491
+ /**
492
+ * Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric.
493
+ * @deprecated
494
+ */
470
495
  export interface BillableMetricGroup {
471
496
  /**
472
497
  * Name of the event property used to group values.
@@ -494,6 +519,36 @@ export interface BillableMetricsPaginated {
494
519
  billable_metrics: BillableMetricObject[];
495
520
  meta: PaginationMeta;
496
521
  }
522
+ /** Values used to apply differentiated pricing based on additional event properties. */
523
+ export interface ChargeFilterInput {
524
+ /**
525
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the values of the filter will be used as the default display name.
526
+ * @example "AWS"
527
+ */
528
+ invoice_display_name?: string | null;
529
+ /** List of all thresholds utilized for calculating the charge. */
530
+ properties?: ChargeProperties;
531
+ /**
532
+ * List of possible filter values. The key and values must match one of the billable metric filters.
533
+ * @example {"region":["us-east-1"]}
534
+ */
535
+ values?: Record<string, string[]>;
536
+ }
537
+ /** Values used to apply differentiated pricing based on additional event properties. */
538
+ export interface ChargeFilterObject {
539
+ /**
540
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the values of the filter will be used as the default display name.
541
+ * @example "AWS"
542
+ */
543
+ invoice_display_name: string | null;
544
+ /** List of all thresholds utilized for calculating the charge. */
545
+ properties: ChargeProperties;
546
+ /**
547
+ * List of possible filter values. The key and values must match one of the billable metric filters.
548
+ * @example {"region":["us-east-1"]}
549
+ */
550
+ values: Record<string, string[]>;
551
+ }
497
552
  export interface ChargeObject {
498
553
  /**
499
554
  * Unique identifier of charge, created by Lago.
@@ -551,7 +606,12 @@ export interface ChargeObject {
551
606
  min_amount_cents?: number;
552
607
  /** List of all thresholds utilized for calculating the charge. */
553
608
  properties?: ChargeProperties;
554
- /** All charge information, sorted by groups. */
609
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
610
+ filters?: ChargeFilterObject[];
611
+ /**
612
+ * All charge information, sorted by groups.
613
+ * @deprecated
614
+ */
555
615
  group_properties?: GroupPropertiesObject[];
556
616
  /** All taxes applied to the charge. */
557
617
  taxes?: TaxObject[];
@@ -1351,6 +1411,35 @@ export interface CustomerBillingConfiguration {
1351
1411
  */
1352
1412
  provider_payment_methods?: string[] | null;
1353
1413
  }
1414
+ /** Array of filter object, representing multiple dimensions for a charge item. */
1415
+ export type CustomerChargeFiltersUsageObject = {
1416
+ /**
1417
+ * The number of units consumed for a specific charge filter related to a charge item.
1418
+ * @pattern ^[0-9]+.?[0-9]*$
1419
+ * @example "0.9"
1420
+ */
1421
+ units?: string;
1422
+ /**
1423
+ * The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
1424
+ * @example 1000
1425
+ */
1426
+ amount_cents?: number;
1427
+ /**
1428
+ * 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.
1429
+ * @example 10
1430
+ */
1431
+ events_count?: number;
1432
+ /**
1433
+ * Specifies the name that will be displayed on an invoice.
1434
+ * @example "AWS eu-east-1"
1435
+ */
1436
+ invoice_display_name?: string;
1437
+ /**
1438
+ * List of filter values applied to the usage.
1439
+ * @example {"region":"us-east-1"}
1440
+ */
1441
+ values?: Record<string, string>;
1442
+ }[];
1354
1443
  /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
1355
1444
  export type CustomerChargeGroupedUsageObject = {
1356
1445
  /**
@@ -1371,10 +1460,15 @@ export type CustomerChargeGroupedUsageObject = {
1371
1460
  units?: string;
1372
1461
  /** Key value list of event properties aggregated by the charge model */
1373
1462
  grouped_by?: Record<string, string>;
1463
+ /** Array of filter object, representing multiple dimensions for a charge item. */
1464
+ filters?: CustomerChargeFiltersUsageObject;
1374
1465
  /** Array of group object, representing multiple dimensions for a charge item. */
1375
1466
  groups?: CustomerChargeGroupsUsageObject;
1376
1467
  }[];
1377
- /** Array of group object, representing multiple dimensions for a charge item. */
1468
+ /**
1469
+ * Array of group object, representing multiple dimensions for a charge item.
1470
+ * @deprecated
1471
+ */
1378
1472
  export type CustomerChargeGroupsUsageObject = {
1379
1473
  /**
1380
1474
  * Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system.
@@ -1471,6 +1565,8 @@ export interface CustomerChargeUsageObject {
1471
1565
  */
1472
1566
  aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg";
1473
1567
  };
1568
+ /** Array of filter object, representing multiple dimensions for a charge item. */
1569
+ filters?: CustomerChargeFiltersUsageObject;
1474
1570
  /** Array of group object, representing multiple dimensions for a charge item. */
1475
1571
  groups: CustomerChargeGroupsUsageObject;
1476
1572
  /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
@@ -1951,10 +2047,17 @@ export interface FeeObject {
1951
2047
  lago_id?: string | null;
1952
2048
  /**
1953
2049
  * Unique identifier assigned to the group that the fee belongs to
2050
+ * @deprecated
1954
2051
  * @format uuid
1955
2052
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1956
2053
  */
1957
2054
  lago_group_id?: string | null;
2055
+ /**
2056
+ * Unique identifier assigned to the charge filter that the fee belongs to
2057
+ * @format uuid
2058
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2059
+ */
2060
+ lago_charge_filter_id?: string | null;
1958
2061
  /**
1959
2062
  * Unique identifier assigned to the invoice that the fee belongs to
1960
2063
  * @format uuid
@@ -2289,8 +2392,16 @@ export interface FeeObject {
2289
2392
  * @example "Setup Fee (SF1)"
2290
2393
  */
2291
2394
  invoice_display_name?: string;
2395
+ /**
2396
+ * 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.
2397
+ * @example "AWS eu-east-1"
2398
+ */
2399
+ filter_invoice_display_name?: string;
2400
+ /** Key value list of event properties */
2401
+ filters?: Record<string, string[]>;
2292
2402
  /**
2293
2403
  * 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.
2404
+ * @deprecated
2294
2405
  * @example "Transactions - ACH"
2295
2406
  */
2296
2407
  group_invoice_display_name?: string;
@@ -2380,6 +2491,66 @@ export interface GroupsPaginated {
2380
2491
  groups: GroupObject[];
2381
2492
  meta: PaginationMeta;
2382
2493
  }
2494
+ /** Minimum commitment for this plan. */
2495
+ export type MinimumCommitmentInput = {
2496
+ /**
2497
+ * The amount of the minimum commitment in cents.
2498
+ * @example 100000
2499
+ */
2500
+ amount_cents: number;
2501
+ /**
2502
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
2503
+ * @example "Minimum Commitment (C1)"
2504
+ */
2505
+ invoice_display_name?: string;
2506
+ /**
2507
+ * List of unique code used to identify the taxes.
2508
+ * @example ["french_standard_vat"]
2509
+ */
2510
+ tax_codes?: string[];
2511
+ } | null;
2512
+ export type MinimumCommitmentObject = {
2513
+ /**
2514
+ * Unique identifier of the minimum commitment, created by Lago.
2515
+ * @format uuid
2516
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2517
+ */
2518
+ lago_id: string;
2519
+ /**
2520
+ * The unique code representing the plan to be attached to the customer.
2521
+ * @example "premium"
2522
+ */
2523
+ plan_code?: string;
2524
+ /**
2525
+ * The amount of the minimum commitment in cents.
2526
+ * @example 100000
2527
+ */
2528
+ amount_cents: number;
2529
+ /**
2530
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
2531
+ * @example "Minimum Commitment (C1)"
2532
+ */
2533
+ invoice_display_name?: string;
2534
+ /**
2535
+ * The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `quarterly`, `monthly` or `weekly`.
2536
+ * @example "monthly"
2537
+ */
2538
+ interval?: "weekly" | "monthly" | "quarterly" | "yearly";
2539
+ /**
2540
+ * The date and time when the minimum commitment 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 minimum commitment was initially created.
2541
+ * @format date-time
2542
+ * @example "2022-04-29T08:59:51Z"
2543
+ */
2544
+ created_at: string;
2545
+ /**
2546
+ * The date and time when the minimum commitment was updated. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the minimum commitment was initially created.
2547
+ * @format date-time
2548
+ * @example "2022-04-29T08:59:51Z"
2549
+ */
2550
+ updated_at?: string;
2551
+ /** All taxes applied to the minimum commitment. */
2552
+ taxes?: TaxObject[];
2553
+ } | null;
2383
2554
  export interface MrrObject {
2384
2555
  /**
2385
2556
  * Identifies the month to analyze MRR.
@@ -2497,7 +2668,7 @@ export interface InvoiceObject {
2497
2668
  * This ID helps in uniquely identifying and organizing the invoices associated with a specific customer. It provides a sequential numbering system specific to the customer, allowing for easy tracking and management of invoices within the customer's context.
2498
2669
  * @example 2
2499
2670
  */
2500
- sequential_id: number;
2671
+ sequential_id?: number;
2501
2672
  /**
2502
2673
  * The unique number assigned to the invoice. This number serves as a distinct identifier for the invoice and helps in differentiating it from other invoices in the system.
2503
2674
  * @example "LAG-1234-001-002"
@@ -2509,6 +2680,12 @@ export interface InvoiceObject {
2509
2680
  * @example "2022-04-30"
2510
2681
  */
2511
2682
  issuing_date: string;
2683
+ /**
2684
+ * The date when the payment dispute was lost. It is expressed in Coordinated Universal Time (UTC).
2685
+ * @format date-time
2686
+ * @example "2022-09-14T16:35:31Z"
2687
+ */
2688
+ payment_dispute_lost_at?: string;
2512
2689
  /**
2513
2690
  * The payment due date for the invoice, specified in the ISO 8601 date format.
2514
2691
  * @format date
@@ -2982,6 +3159,8 @@ export interface PlanCreateInput {
2982
3159
  * @example ["french_standard_vat"]
2983
3160
  */
2984
3161
  tax_codes?: string[];
3162
+ /** Minimum commitment for this plan. */
3163
+ minimum_commitment?: MinimumCommitmentInput;
2985
3164
  /**
2986
3165
  * Additional usage-based charges for this plan.
2987
3166
  * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
@@ -3029,7 +3208,10 @@ export interface PlanCreateInput {
3029
3208
  min_amount_cents?: number;
3030
3209
  /** List of all thresholds utilized for calculating the charge. */
3031
3210
  properties?: ChargeProperties;
3032
- /** All charge information, sorted by groups. */
3211
+ /**
3212
+ * All charge information, sorted by groups.
3213
+ * @deprecated
3214
+ */
3033
3215
  group_properties?: {
3034
3216
  /**
3035
3217
  * Unique identifier of a billable metric group, created by Lago.
@@ -3039,6 +3221,8 @@ export interface PlanCreateInput {
3039
3221
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3040
3222
  values: ChargeProperties;
3041
3223
  }[];
3224
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3225
+ filters?: ChargeFilterInput[];
3042
3226
  /**
3043
3227
  * List of unique code used to identify the taxes.
3044
3228
  * @example ["french_standard_vat"]
@@ -3081,6 +3265,7 @@ export interface PlanOverridesObject {
3081
3265
  * @example 5
3082
3266
  */
3083
3267
  trial_period?: number;
3268
+ minimum_commitment?: MinimumCommitmentObject;
3084
3269
  /** Additional usage-based charges for this plan. */
3085
3270
  charges?: {
3086
3271
  /**
@@ -3107,7 +3292,10 @@ export interface PlanOverridesObject {
3107
3292
  min_amount_cents?: number;
3108
3293
  /** List of all thresholds utilized for calculating the charge. */
3109
3294
  properties?: ChargeProperties;
3110
- /** All charge information, sorted by groups. */
3295
+ /**
3296
+ * All charge information, sorted by groups.
3297
+ * @deprecated
3298
+ */
3111
3299
  group_properties?: {
3112
3300
  /**
3113
3301
  * Unique identifier of a billable metric group, created by Lago.
@@ -3117,6 +3305,8 @@ export interface PlanOverridesObject {
3117
3305
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3118
3306
  values: ChargeProperties;
3119
3307
  }[];
3308
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3309
+ filters?: ChargeFilterInput[];
3120
3310
  /**
3121
3311
  * List of unique code used to identify the taxes.
3122
3312
  * @example ["french_standard_vat"]
@@ -3178,6 +3368,8 @@ export interface PlanUpdateInput {
3178
3368
  * @example ["french_standard_vat"]
3179
3369
  */
3180
3370
  tax_codes?: string[];
3371
+ /** Minimum commitment for this plan. */
3372
+ minimum_commitment?: MinimumCommitmentInput;
3181
3373
  /**
3182
3374
  * Additional usage-based charges for this plan.
3183
3375
  * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
@@ -3231,7 +3423,10 @@ export interface PlanUpdateInput {
3231
3423
  min_amount_cents?: number;
3232
3424
  /** List of all thresholds utilized for calculating the charge. */
3233
3425
  properties?: ChargeProperties;
3234
- /** All charge information, sorted by groups. */
3426
+ /**
3427
+ * All charge information, sorted by groups.
3428
+ * @deprecated
3429
+ */
3235
3430
  group_properties?: {
3236
3431
  /**
3237
3432
  * Unique identifier of a billable metric group, created by Lago.
@@ -3241,6 +3436,8 @@ export interface PlanUpdateInput {
3241
3436
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3242
3437
  values: ChargeProperties;
3243
3438
  }[];
3439
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3440
+ filters?: ChargeFilterInput[];
3244
3441
  /**
3245
3442
  * List of unique code used to identify the taxes.
3246
3443
  * @example ["french_standard_vat"]
@@ -3319,9 +3516,10 @@ export interface PlanObject {
3319
3516
  * @example 0
3320
3517
  */
3321
3518
  draft_invoices_count: number;
3519
+ minimum_commitment?: MinimumCommitmentObject;
3322
3520
  /**
3323
3521
  * Additional usage-based charges for this plan.
3324
- * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
3522
+ * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"filters":[{"invoice_display_name":"Europe","properties":{"amount":"10"},"values":{"region":["Europe"]}},{"invoice_display_name":"USA","properties":{"amount":"5"},"values":{"region":["USA"]}},{"invoice_display_name":"Africa","properties":{"amount":"8"},"values":{"region":["Africa"]}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"filters":[]}]
3325
3523
  */
3326
3524
  charges?: ChargeObject[];
3327
3525
  /** All taxes applied to the plan. */
@@ -3394,7 +3592,7 @@ export interface SubscriptionUpdateInput {
3394
3592
  * @format date-time
3395
3593
  * @example "2022-10-08T00:00:00Z"
3396
3594
  */
3397
- ending_at?: string;
3595
+ ending_at: string | null;
3398
3596
  /**
3399
3597
  * The start date and time of the subscription. This field can only be modified for pending subscriptions that have not yet started. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3400
3598
  * @format date-time
@@ -3504,6 +3702,12 @@ export interface SubscriptionObject {
3504
3702
  * @example "2022-04-30"
3505
3703
  */
3506
3704
  downgrade_plan_date?: string | null;
3705
+ /**
3706
+ * The date when the free trial is ended, represented in ISO 8601 date format.
3707
+ * @format date-time
3708
+ * @example "2022-08-08T00:00:00Z"
3709
+ */
3710
+ trial_ended_at?: string | null;
3507
3711
  }
3508
3712
  export type SubscriptionObjectExtended = SubscriptionObject & {
3509
3713
  plan?: PlanObject;
@@ -4082,7 +4286,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4082
4286
  }
4083
4287
  /**
4084
4288
  * @title Lago API documentation
4085
- * @version 0.57.0-beta
4289
+ * @version 1.1.0
4086
4290
  * @license AGPLv3
4087
4291
  * @baseUrl https://api.getlago.com/api/v1
4088
4292
  * @externalDocs https://github.com/getlago
@@ -4337,6 +4541,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4337
4541
  * @name FindAllBillableMetricGroups
4338
4542
  * @summary Find a billable metric's groups
4339
4543
  * @request GET:/billable_metrics/{code}/groups
4544
+ * @deprecated
4340
4545
  * @secure
4341
4546
  */
4342
4547
  findAllBillableMetricGroups: (code: string, query?: {
@@ -4922,6 +5127,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4922
5127
  * @secure
4923
5128
  */
4924
5129
  finalizeInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
5130
+ /**
5131
+ * @description This endpoint is used for setting invoice's payment dispute as lost.
5132
+ *
5133
+ * @tags invoices
5134
+ * @name LoseDisputeInvoice
5135
+ * @summary Mark an invoice payment dispute as lost
5136
+ * @request POST:/invoices/{lago_id}/lose_dispute
5137
+ * @secure
5138
+ */
5139
+ loseDisputeInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
4925
5140
  /**
4926
5141
  * @description This endpoint is used for refreshing a draft invoice.
4927
5142
  *
@@ -5111,7 +5326,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5111
5326
  * 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`.
5112
5327
  * @example ["active","pending"]
5113
5328
  */
5114
- status?: ("pending" | "canceled" | "terminated" | "active")[];
5329
+ "status[]"?: ("pending" | "canceled" | "terminated" | "active")[];
5115
5330
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
5116
5331
  /**
5117
5332
  * @description This endpoint retrieves a specific subscription.
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 0.57.0-beta
151
+ * @version 1.1.0
152
152
  * @license AGPLv3
153
153
  * @baseUrl https://api.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
@@ -444,6 +444,7 @@ export class Api extends HttpClient {
444
444
  * @name FindAllBillableMetricGroups
445
445
  * @summary Find a billable metric's groups
446
446
  * @request GET:/billable_metrics/{code}/groups
447
+ * @deprecated
447
448
  * @secure
448
449
  */
449
450
  findAllBillableMetricGroups: (code, query, params = {}) => this.request({
@@ -1040,6 +1041,22 @@ export class Api extends HttpClient {
1040
1041
  format: "json",
1041
1042
  ...params,
1042
1043
  }),
1044
+ /**
1045
+ * @description This endpoint is used for setting invoice's payment dispute as lost.
1046
+ *
1047
+ * @tags invoices
1048
+ * @name LoseDisputeInvoice
1049
+ * @summary Mark an invoice payment dispute as lost
1050
+ * @request POST:/invoices/{lago_id}/lose_dispute
1051
+ * @secure
1052
+ */
1053
+ loseDisputeInvoice: (lagoId, params = {}) => this.request({
1054
+ path: `/invoices/${lagoId}/lose_dispute`,
1055
+ method: "POST",
1056
+ secure: true,
1057
+ format: "json",
1058
+ ...params,
1059
+ }),
1043
1060
  /**
1044
1061
  * @description This endpoint is used for refreshing a draft invoice.
1045
1062
  *
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./script/mod.js",
4
4
  "name": "lago-javascript-client",
5
5
  "sideEffects": false,
6
- "version": "v1.0.0",
6
+ "version": "v1.2.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",
@@ -401,6 +401,7 @@ export interface BillableMetricObject {
401
401
  weighted_interval?: "seconds" | null;
402
402
  /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
403
403
  group?: BillableMetricGroup;
404
+ filters?: BillableMetricFilterObject[];
404
405
  /**
405
406
  * Number of active subscriptions using this billable metric.
406
407
  * @example 4
@@ -459,14 +460,38 @@ export interface BillableMetricBaseInput {
459
460
  weighted_interval?: "seconds" | null;
460
461
  /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
461
462
  group?: BillableMetricGroup;
463
+ filters?: BillableMetricFilterInput[];
462
464
  }
463
465
  export interface BillableMetricCreateInput {
464
466
  billable_metric: BillableMetricBaseInput;
465
467
  }
468
+ /** Values used to apply differentiated pricing based on additional event properties. */
469
+ export interface BillableMetricFilterInput {
470
+ /**
471
+ * Filter key to add to the event properties payload
472
+ * @example "region"
473
+ */
474
+ key: string;
475
+ /** List of possible filter values */
476
+ values: string[];
477
+ }
478
+ /** Values used to apply differentiated pricing based on additional event properties. */
479
+ export interface BillableMetricFilterObject {
480
+ /**
481
+ * Filter key to add to the event properties payload
482
+ * @example "region"
483
+ */
484
+ key: string;
485
+ /** List of possible filter values */
486
+ values: string[];
487
+ }
466
488
  export interface BillableMetricUpdateInput {
467
489
  billable_metric: BillableMetricBaseInput;
468
490
  }
469
- /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
491
+ /**
492
+ * Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric.
493
+ * @deprecated
494
+ */
470
495
  export interface BillableMetricGroup {
471
496
  /**
472
497
  * Name of the event property used to group values.
@@ -494,6 +519,36 @@ export interface BillableMetricsPaginated {
494
519
  billable_metrics: BillableMetricObject[];
495
520
  meta: PaginationMeta;
496
521
  }
522
+ /** Values used to apply differentiated pricing based on additional event properties. */
523
+ export interface ChargeFilterInput {
524
+ /**
525
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the values of the filter will be used as the default display name.
526
+ * @example "AWS"
527
+ */
528
+ invoice_display_name?: string | null;
529
+ /** List of all thresholds utilized for calculating the charge. */
530
+ properties?: ChargeProperties;
531
+ /**
532
+ * List of possible filter values. The key and values must match one of the billable metric filters.
533
+ * @example {"region":["us-east-1"]}
534
+ */
535
+ values?: Record<string, string[]>;
536
+ }
537
+ /** Values used to apply differentiated pricing based on additional event properties. */
538
+ export interface ChargeFilterObject {
539
+ /**
540
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the values of the filter will be used as the default display name.
541
+ * @example "AWS"
542
+ */
543
+ invoice_display_name: string | null;
544
+ /** List of all thresholds utilized for calculating the charge. */
545
+ properties: ChargeProperties;
546
+ /**
547
+ * List of possible filter values. The key and values must match one of the billable metric filters.
548
+ * @example {"region":["us-east-1"]}
549
+ */
550
+ values: Record<string, string[]>;
551
+ }
497
552
  export interface ChargeObject {
498
553
  /**
499
554
  * Unique identifier of charge, created by Lago.
@@ -551,7 +606,12 @@ export interface ChargeObject {
551
606
  min_amount_cents?: number;
552
607
  /** List of all thresholds utilized for calculating the charge. */
553
608
  properties?: ChargeProperties;
554
- /** All charge information, sorted by groups. */
609
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
610
+ filters?: ChargeFilterObject[];
611
+ /**
612
+ * All charge information, sorted by groups.
613
+ * @deprecated
614
+ */
555
615
  group_properties?: GroupPropertiesObject[];
556
616
  /** All taxes applied to the charge. */
557
617
  taxes?: TaxObject[];
@@ -1351,6 +1411,35 @@ export interface CustomerBillingConfiguration {
1351
1411
  */
1352
1412
  provider_payment_methods?: string[] | null;
1353
1413
  }
1414
+ /** Array of filter object, representing multiple dimensions for a charge item. */
1415
+ export type CustomerChargeFiltersUsageObject = {
1416
+ /**
1417
+ * The number of units consumed for a specific charge filter related to a charge item.
1418
+ * @pattern ^[0-9]+.?[0-9]*$
1419
+ * @example "0.9"
1420
+ */
1421
+ units?: string;
1422
+ /**
1423
+ * The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
1424
+ * @example 1000
1425
+ */
1426
+ amount_cents?: number;
1427
+ /**
1428
+ * 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.
1429
+ * @example 10
1430
+ */
1431
+ events_count?: number;
1432
+ /**
1433
+ * Specifies the name that will be displayed on an invoice.
1434
+ * @example "AWS eu-east-1"
1435
+ */
1436
+ invoice_display_name?: string;
1437
+ /**
1438
+ * List of filter values applied to the usage.
1439
+ * @example {"region":"us-east-1"}
1440
+ */
1441
+ values?: Record<string, string>;
1442
+ }[];
1354
1443
  /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
1355
1444
  export type CustomerChargeGroupedUsageObject = {
1356
1445
  /**
@@ -1371,10 +1460,15 @@ export type CustomerChargeGroupedUsageObject = {
1371
1460
  units?: string;
1372
1461
  /** Key value list of event properties aggregated by the charge model */
1373
1462
  grouped_by?: Record<string, string>;
1463
+ /** Array of filter object, representing multiple dimensions for a charge item. */
1464
+ filters?: CustomerChargeFiltersUsageObject;
1374
1465
  /** Array of group object, representing multiple dimensions for a charge item. */
1375
1466
  groups?: CustomerChargeGroupsUsageObject;
1376
1467
  }[];
1377
- /** Array of group object, representing multiple dimensions for a charge item. */
1468
+ /**
1469
+ * Array of group object, representing multiple dimensions for a charge item.
1470
+ * @deprecated
1471
+ */
1378
1472
  export type CustomerChargeGroupsUsageObject = {
1379
1473
  /**
1380
1474
  * Unique identifier assigned to the group within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the group record within the Lago system.
@@ -1471,6 +1565,8 @@ export interface CustomerChargeUsageObject {
1471
1565
  */
1472
1566
  aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg";
1473
1567
  };
1568
+ /** Array of filter object, representing multiple dimensions for a charge item. */
1569
+ filters?: CustomerChargeFiltersUsageObject;
1474
1570
  /** Array of group object, representing multiple dimensions for a charge item. */
1475
1571
  groups: CustomerChargeGroupsUsageObject;
1476
1572
  /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
@@ -1951,10 +2047,17 @@ export interface FeeObject {
1951
2047
  lago_id?: string | null;
1952
2048
  /**
1953
2049
  * Unique identifier assigned to the group that the fee belongs to
2050
+ * @deprecated
1954
2051
  * @format uuid
1955
2052
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1956
2053
  */
1957
2054
  lago_group_id?: string | null;
2055
+ /**
2056
+ * Unique identifier assigned to the charge filter that the fee belongs to
2057
+ * @format uuid
2058
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2059
+ */
2060
+ lago_charge_filter_id?: string | null;
1958
2061
  /**
1959
2062
  * Unique identifier assigned to the invoice that the fee belongs to
1960
2063
  * @format uuid
@@ -2289,8 +2392,16 @@ export interface FeeObject {
2289
2392
  * @example "Setup Fee (SF1)"
2290
2393
  */
2291
2394
  invoice_display_name?: string;
2395
+ /**
2396
+ * 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.
2397
+ * @example "AWS eu-east-1"
2398
+ */
2399
+ filter_invoice_display_name?: string;
2400
+ /** Key value list of event properties */
2401
+ filters?: Record<string, string[]>;
2292
2402
  /**
2293
2403
  * 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.
2404
+ * @deprecated
2294
2405
  * @example "Transactions - ACH"
2295
2406
  */
2296
2407
  group_invoice_display_name?: string;
@@ -2380,6 +2491,66 @@ export interface GroupsPaginated {
2380
2491
  groups: GroupObject[];
2381
2492
  meta: PaginationMeta;
2382
2493
  }
2494
+ /** Minimum commitment for this plan. */
2495
+ export type MinimumCommitmentInput = {
2496
+ /**
2497
+ * The amount of the minimum commitment in cents.
2498
+ * @example 100000
2499
+ */
2500
+ amount_cents: number;
2501
+ /**
2502
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
2503
+ * @example "Minimum Commitment (C1)"
2504
+ */
2505
+ invoice_display_name?: string;
2506
+ /**
2507
+ * List of unique code used to identify the taxes.
2508
+ * @example ["french_standard_vat"]
2509
+ */
2510
+ tax_codes?: string[];
2511
+ } | null;
2512
+ export type MinimumCommitmentObject = {
2513
+ /**
2514
+ * Unique identifier of the minimum commitment, created by Lago.
2515
+ * @format uuid
2516
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2517
+ */
2518
+ lago_id: string;
2519
+ /**
2520
+ * The unique code representing the plan to be attached to the customer.
2521
+ * @example "premium"
2522
+ */
2523
+ plan_code?: string;
2524
+ /**
2525
+ * The amount of the minimum commitment in cents.
2526
+ * @example 100000
2527
+ */
2528
+ amount_cents: number;
2529
+ /**
2530
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
2531
+ * @example "Minimum Commitment (C1)"
2532
+ */
2533
+ invoice_display_name?: string;
2534
+ /**
2535
+ * The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `quarterly`, `monthly` or `weekly`.
2536
+ * @example "monthly"
2537
+ */
2538
+ interval?: "weekly" | "monthly" | "quarterly" | "yearly";
2539
+ /**
2540
+ * The date and time when the minimum commitment 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 minimum commitment was initially created.
2541
+ * @format date-time
2542
+ * @example "2022-04-29T08:59:51Z"
2543
+ */
2544
+ created_at: string;
2545
+ /**
2546
+ * The date and time when the minimum commitment was updated. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the minimum commitment was initially created.
2547
+ * @format date-time
2548
+ * @example "2022-04-29T08:59:51Z"
2549
+ */
2550
+ updated_at?: string;
2551
+ /** All taxes applied to the minimum commitment. */
2552
+ taxes?: TaxObject[];
2553
+ } | null;
2383
2554
  export interface MrrObject {
2384
2555
  /**
2385
2556
  * Identifies the month to analyze MRR.
@@ -2497,7 +2668,7 @@ export interface InvoiceObject {
2497
2668
  * This ID helps in uniquely identifying and organizing the invoices associated with a specific customer. It provides a sequential numbering system specific to the customer, allowing for easy tracking and management of invoices within the customer's context.
2498
2669
  * @example 2
2499
2670
  */
2500
- sequential_id: number;
2671
+ sequential_id?: number;
2501
2672
  /**
2502
2673
  * The unique number assigned to the invoice. This number serves as a distinct identifier for the invoice and helps in differentiating it from other invoices in the system.
2503
2674
  * @example "LAG-1234-001-002"
@@ -2509,6 +2680,12 @@ export interface InvoiceObject {
2509
2680
  * @example "2022-04-30"
2510
2681
  */
2511
2682
  issuing_date: string;
2683
+ /**
2684
+ * The date when the payment dispute was lost. It is expressed in Coordinated Universal Time (UTC).
2685
+ * @format date-time
2686
+ * @example "2022-09-14T16:35:31Z"
2687
+ */
2688
+ payment_dispute_lost_at?: string;
2512
2689
  /**
2513
2690
  * The payment due date for the invoice, specified in the ISO 8601 date format.
2514
2691
  * @format date
@@ -2982,6 +3159,8 @@ export interface PlanCreateInput {
2982
3159
  * @example ["french_standard_vat"]
2983
3160
  */
2984
3161
  tax_codes?: string[];
3162
+ /** Minimum commitment for this plan. */
3163
+ minimum_commitment?: MinimumCommitmentInput;
2985
3164
  /**
2986
3165
  * Additional usage-based charges for this plan.
2987
3166
  * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
@@ -3029,7 +3208,10 @@ export interface PlanCreateInput {
3029
3208
  min_amount_cents?: number;
3030
3209
  /** List of all thresholds utilized for calculating the charge. */
3031
3210
  properties?: ChargeProperties;
3032
- /** All charge information, sorted by groups. */
3211
+ /**
3212
+ * All charge information, sorted by groups.
3213
+ * @deprecated
3214
+ */
3033
3215
  group_properties?: {
3034
3216
  /**
3035
3217
  * Unique identifier of a billable metric group, created by Lago.
@@ -3039,6 +3221,8 @@ export interface PlanCreateInput {
3039
3221
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3040
3222
  values: ChargeProperties;
3041
3223
  }[];
3224
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3225
+ filters?: ChargeFilterInput[];
3042
3226
  /**
3043
3227
  * List of unique code used to identify the taxes.
3044
3228
  * @example ["french_standard_vat"]
@@ -3081,6 +3265,7 @@ export interface PlanOverridesObject {
3081
3265
  * @example 5
3082
3266
  */
3083
3267
  trial_period?: number;
3268
+ minimum_commitment?: MinimumCommitmentObject;
3084
3269
  /** Additional usage-based charges for this plan. */
3085
3270
  charges?: {
3086
3271
  /**
@@ -3107,7 +3292,10 @@ export interface PlanOverridesObject {
3107
3292
  min_amount_cents?: number;
3108
3293
  /** List of all thresholds utilized for calculating the charge. */
3109
3294
  properties?: ChargeProperties;
3110
- /** All charge information, sorted by groups. */
3295
+ /**
3296
+ * All charge information, sorted by groups.
3297
+ * @deprecated
3298
+ */
3111
3299
  group_properties?: {
3112
3300
  /**
3113
3301
  * Unique identifier of a billable metric group, created by Lago.
@@ -3117,6 +3305,8 @@ export interface PlanOverridesObject {
3117
3305
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3118
3306
  values: ChargeProperties;
3119
3307
  }[];
3308
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3309
+ filters?: ChargeFilterInput[];
3120
3310
  /**
3121
3311
  * List of unique code used to identify the taxes.
3122
3312
  * @example ["french_standard_vat"]
@@ -3178,6 +3368,8 @@ export interface PlanUpdateInput {
3178
3368
  * @example ["french_standard_vat"]
3179
3369
  */
3180
3370
  tax_codes?: string[];
3371
+ /** Minimum commitment for this plan. */
3372
+ minimum_commitment?: MinimumCommitmentInput;
3181
3373
  /**
3182
3374
  * Additional usage-based charges for this plan.
3183
3375
  * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
@@ -3231,7 +3423,10 @@ export interface PlanUpdateInput {
3231
3423
  min_amount_cents?: number;
3232
3424
  /** List of all thresholds utilized for calculating the charge. */
3233
3425
  properties?: ChargeProperties;
3234
- /** All charge information, sorted by groups. */
3426
+ /**
3427
+ * All charge information, sorted by groups.
3428
+ * @deprecated
3429
+ */
3235
3430
  group_properties?: {
3236
3431
  /**
3237
3432
  * Unique identifier of a billable metric group, created by Lago.
@@ -3241,6 +3436,8 @@ export interface PlanUpdateInput {
3241
3436
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3242
3437
  values: ChargeProperties;
3243
3438
  }[];
3439
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3440
+ filters?: ChargeFilterInput[];
3244
3441
  /**
3245
3442
  * List of unique code used to identify the taxes.
3246
3443
  * @example ["french_standard_vat"]
@@ -3319,9 +3516,10 @@ export interface PlanObject {
3319
3516
  * @example 0
3320
3517
  */
3321
3518
  draft_invoices_count: number;
3519
+ minimum_commitment?: MinimumCommitmentObject;
3322
3520
  /**
3323
3521
  * Additional usage-based charges for this plan.
3324
- * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
3522
+ * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"filters":[{"invoice_display_name":"Europe","properties":{"amount":"10"},"values":{"region":["Europe"]}},{"invoice_display_name":"USA","properties":{"amount":"5"},"values":{"region":["USA"]}},{"invoice_display_name":"Africa","properties":{"amount":"8"},"values":{"region":["Africa"]}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"filters":[]}]
3325
3523
  */
3326
3524
  charges?: ChargeObject[];
3327
3525
  /** All taxes applied to the plan. */
@@ -3394,7 +3592,7 @@ export interface SubscriptionUpdateInput {
3394
3592
  * @format date-time
3395
3593
  * @example "2022-10-08T00:00:00Z"
3396
3594
  */
3397
- ending_at?: string;
3595
+ ending_at: string | null;
3398
3596
  /**
3399
3597
  * The start date and time of the subscription. This field can only be modified for pending subscriptions that have not yet started. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3400
3598
  * @format date-time
@@ -3504,6 +3702,12 @@ export interface SubscriptionObject {
3504
3702
  * @example "2022-04-30"
3505
3703
  */
3506
3704
  downgrade_plan_date?: string | null;
3705
+ /**
3706
+ * The date when the free trial is ended, represented in ISO 8601 date format.
3707
+ * @format date-time
3708
+ * @example "2022-08-08T00:00:00Z"
3709
+ */
3710
+ trial_ended_at?: string | null;
3507
3711
  }
3508
3712
  export type SubscriptionObjectExtended = SubscriptionObject & {
3509
3713
  plan?: PlanObject;
@@ -4082,7 +4286,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4082
4286
  }
4083
4287
  /**
4084
4288
  * @title Lago API documentation
4085
- * @version 0.57.0-beta
4289
+ * @version 1.1.0
4086
4290
  * @license AGPLv3
4087
4291
  * @baseUrl https://api.getlago.com/api/v1
4088
4292
  * @externalDocs https://github.com/getlago
@@ -4337,6 +4541,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4337
4541
  * @name FindAllBillableMetricGroups
4338
4542
  * @summary Find a billable metric's groups
4339
4543
  * @request GET:/billable_metrics/{code}/groups
4544
+ * @deprecated
4340
4545
  * @secure
4341
4546
  */
4342
4547
  findAllBillableMetricGroups: (code: string, query?: {
@@ -4922,6 +5127,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4922
5127
  * @secure
4923
5128
  */
4924
5129
  finalizeInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
5130
+ /**
5131
+ * @description This endpoint is used for setting invoice's payment dispute as lost.
5132
+ *
5133
+ * @tags invoices
5134
+ * @name LoseDisputeInvoice
5135
+ * @summary Mark an invoice payment dispute as lost
5136
+ * @request POST:/invoices/{lago_id}/lose_dispute
5137
+ * @secure
5138
+ */
5139
+ loseDisputeInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
4925
5140
  /**
4926
5141
  * @description This endpoint is used for refreshing a draft invoice.
4927
5142
  *
@@ -5111,7 +5326,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5111
5326
  * 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`.
5112
5327
  * @example ["active","pending"]
5113
5328
  */
5114
- status?: ("pending" | "canceled" | "terminated" | "active")[];
5329
+ "status[]"?: ("pending" | "canceled" | "terminated" | "active")[];
5115
5330
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
5116
5331
  /**
5117
5332
  * @description This endpoint retrieves a specific subscription.
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 0.57.0-beta
155
+ * @version 1.1.0
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://api.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -448,6 +448,7 @@ class Api extends HttpClient {
448
448
  * @name FindAllBillableMetricGroups
449
449
  * @summary Find a billable metric's groups
450
450
  * @request GET:/billable_metrics/{code}/groups
451
+ * @deprecated
451
452
  * @secure
452
453
  */
453
454
  findAllBillableMetricGroups: (code, query, params = {}) => this.request({
@@ -1044,6 +1045,22 @@ class Api extends HttpClient {
1044
1045
  format: "json",
1045
1046
  ...params,
1046
1047
  }),
1048
+ /**
1049
+ * @description This endpoint is used for setting invoice's payment dispute as lost.
1050
+ *
1051
+ * @tags invoices
1052
+ * @name LoseDisputeInvoice
1053
+ * @summary Mark an invoice payment dispute as lost
1054
+ * @request POST:/invoices/{lago_id}/lose_dispute
1055
+ * @secure
1056
+ */
1057
+ loseDisputeInvoice: (lagoId, params = {}) => this.request({
1058
+ path: `/invoices/${lagoId}/lose_dispute`,
1059
+ method: "POST",
1060
+ secure: true,
1061
+ format: "json",
1062
+ ...params,
1063
+ }),
1047
1064
  /**
1048
1065
  * @description This endpoint is used for refreshing a draft invoice.
1049
1066
  *