lago-javascript-client 1.1.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;
@@ -2557,7 +2668,7 @@ export interface InvoiceObject {
2557
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.
2558
2669
  * @example 2
2559
2670
  */
2560
- sequential_id: number;
2671
+ sequential_id?: number;
2561
2672
  /**
2562
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.
2563
2674
  * @example "LAG-1234-001-002"
@@ -2569,6 +2680,12 @@ export interface InvoiceObject {
2569
2680
  * @example "2022-04-30"
2570
2681
  */
2571
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;
2572
2689
  /**
2573
2690
  * The payment due date for the invoice, specified in the ISO 8601 date format.
2574
2691
  * @format date
@@ -3091,7 +3208,10 @@ export interface PlanCreateInput {
3091
3208
  min_amount_cents?: number;
3092
3209
  /** List of all thresholds utilized for calculating the charge. */
3093
3210
  properties?: ChargeProperties;
3094
- /** All charge information, sorted by groups. */
3211
+ /**
3212
+ * All charge information, sorted by groups.
3213
+ * @deprecated
3214
+ */
3095
3215
  group_properties?: {
3096
3216
  /**
3097
3217
  * Unique identifier of a billable metric group, created by Lago.
@@ -3101,6 +3221,8 @@ export interface PlanCreateInput {
3101
3221
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3102
3222
  values: ChargeProperties;
3103
3223
  }[];
3224
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3225
+ filters?: ChargeFilterInput[];
3104
3226
  /**
3105
3227
  * List of unique code used to identify the taxes.
3106
3228
  * @example ["french_standard_vat"]
@@ -3170,7 +3292,10 @@ export interface PlanOverridesObject {
3170
3292
  min_amount_cents?: number;
3171
3293
  /** List of all thresholds utilized for calculating the charge. */
3172
3294
  properties?: ChargeProperties;
3173
- /** All charge information, sorted by groups. */
3295
+ /**
3296
+ * All charge information, sorted by groups.
3297
+ * @deprecated
3298
+ */
3174
3299
  group_properties?: {
3175
3300
  /**
3176
3301
  * Unique identifier of a billable metric group, created by Lago.
@@ -3180,6 +3305,8 @@ export interface PlanOverridesObject {
3180
3305
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3181
3306
  values: ChargeProperties;
3182
3307
  }[];
3308
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3309
+ filters?: ChargeFilterInput[];
3183
3310
  /**
3184
3311
  * List of unique code used to identify the taxes.
3185
3312
  * @example ["french_standard_vat"]
@@ -3296,7 +3423,10 @@ export interface PlanUpdateInput {
3296
3423
  min_amount_cents?: number;
3297
3424
  /** List of all thresholds utilized for calculating the charge. */
3298
3425
  properties?: ChargeProperties;
3299
- /** All charge information, sorted by groups. */
3426
+ /**
3427
+ * All charge information, sorted by groups.
3428
+ * @deprecated
3429
+ */
3300
3430
  group_properties?: {
3301
3431
  /**
3302
3432
  * Unique identifier of a billable metric group, created by Lago.
@@ -3306,6 +3436,8 @@ export interface PlanUpdateInput {
3306
3436
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3307
3437
  values: ChargeProperties;
3308
3438
  }[];
3439
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3440
+ filters?: ChargeFilterInput[];
3309
3441
  /**
3310
3442
  * List of unique code used to identify the taxes.
3311
3443
  * @example ["french_standard_vat"]
@@ -3387,7 +3519,7 @@ export interface PlanObject {
3387
3519
  minimum_commitment?: MinimumCommitmentObject;
3388
3520
  /**
3389
3521
  * Additional usage-based charges for this plan.
3390
- * @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":[]}]
3391
3523
  */
3392
3524
  charges?: ChargeObject[];
3393
3525
  /** All taxes applied to the plan. */
@@ -3570,6 +3702,12 @@ export interface SubscriptionObject {
3570
3702
  * @example "2022-04-30"
3571
3703
  */
3572
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;
3573
3711
  }
3574
3712
  export type SubscriptionObjectExtended = SubscriptionObject & {
3575
3713
  plan?: PlanObject;
@@ -4403,6 +4541,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4403
4541
  * @name FindAllBillableMetricGroups
4404
4542
  * @summary Find a billable metric's groups
4405
4543
  * @request GET:/billable_metrics/{code}/groups
4544
+ * @deprecated
4406
4545
  * @secure
4407
4546
  */
4408
4547
  findAllBillableMetricGroups: (code: string, query?: {
@@ -4988,6 +5127,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4988
5127
  * @secure
4989
5128
  */
4990
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>>;
4991
5140
  /**
4992
5141
  * @description This endpoint is used for refreshing a draft invoice.
4993
5142
  *
@@ -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.1.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;
@@ -2557,7 +2668,7 @@ export interface InvoiceObject {
2557
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.
2558
2669
  * @example 2
2559
2670
  */
2560
- sequential_id: number;
2671
+ sequential_id?: number;
2561
2672
  /**
2562
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.
2563
2674
  * @example "LAG-1234-001-002"
@@ -2569,6 +2680,12 @@ export interface InvoiceObject {
2569
2680
  * @example "2022-04-30"
2570
2681
  */
2571
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;
2572
2689
  /**
2573
2690
  * The payment due date for the invoice, specified in the ISO 8601 date format.
2574
2691
  * @format date
@@ -3091,7 +3208,10 @@ export interface PlanCreateInput {
3091
3208
  min_amount_cents?: number;
3092
3209
  /** List of all thresholds utilized for calculating the charge. */
3093
3210
  properties?: ChargeProperties;
3094
- /** All charge information, sorted by groups. */
3211
+ /**
3212
+ * All charge information, sorted by groups.
3213
+ * @deprecated
3214
+ */
3095
3215
  group_properties?: {
3096
3216
  /**
3097
3217
  * Unique identifier of a billable metric group, created by Lago.
@@ -3101,6 +3221,8 @@ export interface PlanCreateInput {
3101
3221
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3102
3222
  values: ChargeProperties;
3103
3223
  }[];
3224
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3225
+ filters?: ChargeFilterInput[];
3104
3226
  /**
3105
3227
  * List of unique code used to identify the taxes.
3106
3228
  * @example ["french_standard_vat"]
@@ -3170,7 +3292,10 @@ export interface PlanOverridesObject {
3170
3292
  min_amount_cents?: number;
3171
3293
  /** List of all thresholds utilized for calculating the charge. */
3172
3294
  properties?: ChargeProperties;
3173
- /** All charge information, sorted by groups. */
3295
+ /**
3296
+ * All charge information, sorted by groups.
3297
+ * @deprecated
3298
+ */
3174
3299
  group_properties?: {
3175
3300
  /**
3176
3301
  * Unique identifier of a billable metric group, created by Lago.
@@ -3180,6 +3305,8 @@ export interface PlanOverridesObject {
3180
3305
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3181
3306
  values: ChargeProperties;
3182
3307
  }[];
3308
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3309
+ filters?: ChargeFilterInput[];
3183
3310
  /**
3184
3311
  * List of unique code used to identify the taxes.
3185
3312
  * @example ["french_standard_vat"]
@@ -3296,7 +3423,10 @@ export interface PlanUpdateInput {
3296
3423
  min_amount_cents?: number;
3297
3424
  /** List of all thresholds utilized for calculating the charge. */
3298
3425
  properties?: ChargeProperties;
3299
- /** All charge information, sorted by groups. */
3426
+ /**
3427
+ * All charge information, sorted by groups.
3428
+ * @deprecated
3429
+ */
3300
3430
  group_properties?: {
3301
3431
  /**
3302
3432
  * Unique identifier of a billable metric group, created by Lago.
@@ -3306,6 +3436,8 @@ export interface PlanUpdateInput {
3306
3436
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
3307
3437
  values: ChargeProperties;
3308
3438
  }[];
3439
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
3440
+ filters?: ChargeFilterInput[];
3309
3441
  /**
3310
3442
  * List of unique code used to identify the taxes.
3311
3443
  * @example ["french_standard_vat"]
@@ -3387,7 +3519,7 @@ export interface PlanObject {
3387
3519
  minimum_commitment?: MinimumCommitmentObject;
3388
3520
  /**
3389
3521
  * Additional usage-based charges for this plan.
3390
- * @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":[]}]
3391
3523
  */
3392
3524
  charges?: ChargeObject[];
3393
3525
  /** All taxes applied to the plan. */
@@ -3570,6 +3702,12 @@ export interface SubscriptionObject {
3570
3702
  * @example "2022-04-30"
3571
3703
  */
3572
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;
3573
3711
  }
3574
3712
  export type SubscriptionObjectExtended = SubscriptionObject & {
3575
3713
  plan?: PlanObject;
@@ -4403,6 +4541,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4403
4541
  * @name FindAllBillableMetricGroups
4404
4542
  * @summary Find a billable metric's groups
4405
4543
  * @request GET:/billable_metrics/{code}/groups
4544
+ * @deprecated
4406
4545
  * @secure
4407
4546
  */
4408
4547
  findAllBillableMetricGroups: (code: string, query?: {
@@ -4988,6 +5127,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4988
5127
  * @secure
4989
5128
  */
4990
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>>;
4991
5140
  /**
4992
5141
  * @description This endpoint is used for refreshing a draft invoice.
4993
5142
  *
@@ -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
  *