lago-javascript-client 1.28.1 → 1.30.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.
@@ -341,7 +341,7 @@ export interface TaxObject {
341
341
  */
342
342
  rate: number;
343
343
  /**
344
- * This field is deprecated and will be removed in a future version. When set to true, it applies the tax to the organization's default billing entity. To apply or remove a tax from any billing entity (including the default one), please use the `PUT /billing_entity/:code` endpoint instead.
344
+ * This field is deprecated and will be removed in a future version. When set to true, it applies the tax to the organization's default billing entity. To apply or remove a tax from any billing entity (including the default one), please use the `PUT /billing_entities/:code` endpoint instead.
345
345
  * @deprecated
346
346
  * @example true
347
347
  */
@@ -353,8 +353,60 @@ export interface TaxObject {
353
353
  */
354
354
  created_at: string;
355
355
  }
356
+ export interface InvoiceCustomSectionObject {
357
+ /**
358
+ * Unique identifier for the invoice custom section in the Lago application, generated by Lago to ensure record uniqueness within the system.
359
+ * @format uuid
360
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
361
+ */
362
+ lago_id: string;
363
+ /**
364
+ * Name of the invoice custom section.
365
+ * @example "EU Bank Details"
366
+ */
367
+ name: string;
368
+ /**
369
+ * Unique code identifying the invoice custom section for the API request.
370
+ * @example "eu_bank_details"
371
+ */
372
+ code: string;
373
+ /**
374
+ * Internal description of the invoice custom section.
375
+ * @example "This section contains the bank details for EU customers."
376
+ */
377
+ description?: string;
378
+ /**
379
+ * The value shown on the invoice PDF.
380
+ * @example "Bank Name: Lago Bank, IBAN: FR7630004000031234567890143"
381
+ */
382
+ details?: string;
383
+ /**
384
+ * The name of the invoice custom section displayed on the invoice.
385
+ * @example "Bank Details:"
386
+ */
387
+ display_name?: string;
388
+ /**
389
+ * This field is deprecated and will be removed in a future version. When set to true, it applies the invoice custom section to the organization's default billing entity. To apply or remove an invoice custom section from any billing entity (including the default one), please use the `PUT /billing_entities/:code` endpoint instead.
390
+ * @deprecated
391
+ * @example true
392
+ */
393
+ applied_to_organization?: boolean;
394
+ /**
395
+ * Unique identifier for the organization associated with the invoice custom section.
396
+ * @format uuid
397
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
398
+ */
399
+ organization_id?: string;
400
+ /**
401
+ * Creation date of the tax.
402
+ * @format date-time
403
+ * @example "2023-07-06T14:35:58Z"
404
+ */
405
+ created_at?: string;
406
+ }
356
407
  export type BillingEntityObjectExtended = BillingEntityObject & {
357
408
  taxes?: TaxObject[];
409
+ selected_invoice_custom_sections?: InvoiceCustomSectionObject[];
358
410
  };
359
411
  export interface ApiErrorNotFound {
360
412
  /**
@@ -488,52 +540,85 @@ export interface BillingEntityUpdateInput {
488
540
  * @example "data:image/png;base64,..."
489
541
  */
490
542
  logo?: string | null;
543
+ /**
544
+ * The codes of the invoice custom section that should be associated with this billing entity
545
+ * @example ["custom_section_1","custom_section_2"]
546
+ */
547
+ invoice_custom_section_codes?: string[];
491
548
  }
492
- export interface AddOnObject {
549
+ export interface ActivityLogObject {
493
550
  /**
494
- * Unique identifier of the add-on, created by Lago.
551
+ * Unique identifier assigned to the activity log within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the activity log record within the Lago system
495
552
  * @format uuid
496
553
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
497
554
  */
498
- lago_id: string;
555
+ activity_id: string;
499
556
  /**
500
- * The name of the add-on.
501
- * @example "Setup Fee"
557
+ * The email of the user who performed the activity
558
+ * @format email
559
+ * @example "dinesh@piedpiper.test"
502
560
  */
503
- name: string;
561
+ user_email?: string | null;
504
562
  /**
505
- * 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.
506
- * @example "Setup Fee (SF1)"
563
+ * This field stores the actitivy action that was performed to the activity_object.
564
+ * @example "billing_metric.created"
507
565
  */
508
- invoice_display_name?: string;
566
+ activity_type: string;
509
567
  /**
510
- * Unique code used to identify the add-on.
511
- * @example "setup_fee"
568
+ * This field represents the source of the activity log, the interaction source that triggered the action.
569
+ * @example "api"
512
570
  */
513
- code: string;
571
+ activity_source: "api" | "front" | "system";
514
572
  /**
515
- * The cost of the add-on in cents, excluding any applicable taxes, that is billed to a customer. By creating a one-off invoice, you will be able to override this value.
516
- * @example 50000
573
+ * This field represents the final state of the object that the action was applied.
574
+ * @format object
575
+ * @example "{ "id": "dad68bc7-c01a-4ad8-a87b-13e78693a5bc", "plan_id": "b9155544-e261-4e92-b54e-f65d7609294c", ... }"
517
576
  */
518
- amount_cents: number;
577
+ activity_object?: string | null;
519
578
  /**
520
- * The currency of the add-on.
521
- * @example "USD"
579
+ * @format object
580
+ * @example "{ "plan_id": [null, "b9155544-e261-4e92-b54e-f65d7609294c"], ... }"
522
581
  */
523
- amount_currency: Currency;
582
+ activity_object_changes?: string | null;
524
583
  /**
525
- * The description of the add-on.
526
- * @example "Implementation fee for new customers."
584
+ * The customer external unique identifier (provided by your own application)
585
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
527
586
  */
528
- description?: string | null;
587
+ external_customer_id?: string | null;
529
588
  /**
530
- * The date and time when the add-on 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 add-on was initially created.
589
+ * Unique identifier assigned to the subscription in your application.
590
+ * @example "external_id"
591
+ */
592
+ external_subscription_id?: string | null;
593
+ /**
594
+ * The resource id of the object that the action was applied.
595
+ * @format uuid
596
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
597
+ */
598
+ resource_id: string;
599
+ /**
600
+ * The resource type of the resource_id record.
601
+ * @example "BillableMetric"
602
+ */
603
+ resource_type: string;
604
+ /**
605
+ * Unique identifier for the organization associated with the activity log.
606
+ * @format uuid
607
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
608
+ */
609
+ organization_id: string;
610
+ /**
611
+ * The logged date of the activity, presented in the ISO 8601 datetime format, specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record was created within the Lago application
612
+ * @format date-time
613
+ * @example "2025-03-31T12:31:44Z"
614
+ */
615
+ logged_at: string;
616
+ /**
617
+ * The creation date of the activity record in the Lago application, presented in the ISO 8601 datetime format, specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record was created within the Lago application
531
618
  * @format date-time
532
619
  * @example "2022-04-29T08:59:51Z"
533
620
  */
534
621
  created_at: string;
535
- /** All taxes applied to the add-on. */
536
- taxes?: TaxObject[];
537
622
  }
538
623
  export interface PaginationMeta {
539
624
  /**
@@ -562,6 +647,59 @@ export interface PaginationMeta {
562
647
  */
563
648
  total_count: number;
564
649
  }
650
+ export interface ActivityLogsPaginated {
651
+ activity_logs: ActivityLogObject[];
652
+ meta: PaginationMeta;
653
+ }
654
+ export interface ActivityLog {
655
+ activity_log: ActivityLogObject;
656
+ }
657
+ export interface AddOnObject {
658
+ /**
659
+ * Unique identifier of the add-on, created by Lago.
660
+ * @format uuid
661
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
662
+ */
663
+ lago_id: string;
664
+ /**
665
+ * The name of the add-on.
666
+ * @example "Setup Fee"
667
+ */
668
+ name: string;
669
+ /**
670
+ * 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.
671
+ * @example "Setup Fee (SF1)"
672
+ */
673
+ invoice_display_name?: string;
674
+ /**
675
+ * Unique code used to identify the add-on.
676
+ * @example "setup_fee"
677
+ */
678
+ code: string;
679
+ /**
680
+ * The cost of the add-on in cents, excluding any applicable taxes, that is billed to a customer. By creating a one-off invoice, you will be able to override this value.
681
+ * @example 50000
682
+ */
683
+ amount_cents: number;
684
+ /**
685
+ * The currency of the add-on.
686
+ * @example "USD"
687
+ */
688
+ amount_currency: Currency;
689
+ /**
690
+ * The description of the add-on.
691
+ * @example "Implementation fee for new customers."
692
+ */
693
+ description?: string | null;
694
+ /**
695
+ * The date and time when the add-on 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 add-on was initially created.
696
+ * @format date-time
697
+ * @example "2022-04-29T08:59:51Z"
698
+ */
699
+ created_at: string;
700
+ /** All taxes applied to the add-on. */
701
+ taxes?: TaxObject[];
702
+ }
565
703
  export interface AddOnsPaginated {
566
704
  add_ons: AddOnObject[];
567
705
  meta: PaginationMeta;
@@ -1987,8 +2125,9 @@ export interface CreditNoteObject {
1987
2125
  */
1988
2126
  self_billed?: boolean;
1989
2127
  }
1990
- export interface CreditNotes {
2128
+ export interface CreditNotesPaginated {
1991
2129
  credit_notes: CreditNoteObject[];
2130
+ meta: PaginationMeta;
1992
2131
  }
1993
2132
  export interface CreditNoteCreateInput {
1994
2133
  credit_note: {
@@ -2511,56 +2650,6 @@ export interface IntegrationCustomer {
2511
2650
  export type CustomerObject = CustomerBaseObject & {
2512
2651
  integration_customers?: IntegrationCustomer[];
2513
2652
  };
2514
- export interface InvoiceCustomSectionObject {
2515
- /**
2516
- * Unique identifier for the invoice custom section in the Lago application, generated by Lago to ensure record uniqueness within the system.
2517
- * @format uuid
2518
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2519
- */
2520
- lago_id: string;
2521
- /**
2522
- * Name of the invoice custom section.
2523
- * @example "EU Bank Details"
2524
- */
2525
- name: string;
2526
- /**
2527
- * Unique code identifying the invoice custom section for the API request.
2528
- * @example "eu_bank_details"
2529
- */
2530
- code: string;
2531
- /**
2532
- * Internal description of the invoice custom section.
2533
- * @example "This section contains the bank details for EU customers."
2534
- */
2535
- description?: string;
2536
- /**
2537
- * The value shown on the invoice PDF.
2538
- * @example "Bank Name: Lago Bank, IBAN: FR7630004000031234567890143"
2539
- */
2540
- details?: string;
2541
- /**
2542
- * The name of the invoice custom section displayed on the invoice.
2543
- * @example "Bank Details:"
2544
- */
2545
- display_name?: string;
2546
- /**
2547
- * Set to true if the invoice custom section is a default for the organization.
2548
- * @example true
2549
- */
2550
- applied_to_organization?: boolean;
2551
- /**
2552
- * Unique identifier for the organization associated with the invoice custom section.
2553
- * @format uuid
2554
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2555
- */
2556
- organization_id?: string;
2557
- /**
2558
- * Creation date of the tax.
2559
- * @format date-time
2560
- * @example "2023-07-06T14:35:58Z"
2561
- */
2562
- created_at?: string;
2563
- }
2564
2653
  export type CustomerObjectExtended = CustomerObject & {
2565
2654
  metadata?: CustomerMetadata[];
2566
2655
  /** List of customer taxes */
@@ -3424,7 +3513,7 @@ export interface AppliedUsageThresholdObject {
3424
3513
  export type InvoiceObject = InvoiceBaseObject & {
3425
3514
  /** The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
3426
3515
  customer?: CustomerObject;
3427
- billing_period?: BillingPeriodObject[];
3516
+ billing_periods?: BillingPeriodObject[];
3428
3517
  metadata?: InvoiceMetadataObject[];
3429
3518
  applied_taxes?: InvoiceAppliedTaxObject[];
3430
3519
  applied_usage_thresholds?: any[] | null;
@@ -4345,6 +4434,18 @@ export interface MinimumCommitmentObject {
4345
4434
  taxes?: TaxObject[];
4346
4435
  }
4347
4436
  export interface ChargeProperties {
4437
+ /**
4438
+ * The list of event properties that are used to group the events on the invoice for a `standard` charge model.
4439
+ * **DEPRECATED** Replaced by pricing_group_keys
4440
+ * @deprecated
4441
+ * @example ["agent_name"]
4442
+ */
4443
+ grouped_by?: string[];
4444
+ /**
4445
+ * The list of event properties that are used to group the events on the invoice.
4446
+ * @example ["agent_name"]
4447
+ */
4448
+ pricing_group_keys?: string[];
4348
4449
  /** Graduated ranges, sorted from bottom to top tiers, used for a `graduated` charge model. */
4349
4450
  graduated_ranges?: {
4350
4451
  /**
@@ -4451,11 +4552,6 @@ export interface ChargeProperties {
4451
4552
  * @example "1.75"
4452
4553
  */
4453
4554
  per_transaction_min_amount?: string | null;
4454
- /**
4455
- * The list of event properties that are used to group the events on the invoice for a `standard` charge model.
4456
- * @example ["agent_name"]
4457
- */
4458
- grouped_by?: string[];
4459
4555
  /** Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. */
4460
4556
  volume_ranges?: {
4461
4557
  /**
@@ -4471,13 +4567,13 @@ export interface ChargeProperties {
4471
4567
  */
4472
4568
  to_value: number | null;
4473
4569
  /**
4474
- * The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
4570
+ * The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
4475
4571
  * @pattern ^[0-9]+.?[0-9]*$
4476
4572
  * @example "10"
4477
4573
  */
4478
4574
  flat_amount: string;
4479
4575
  /**
4480
- * The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
4576
+ * The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
4481
4577
  * @pattern ^[0-9]+.?[0-9]*$
4482
4578
  * @example "0.5"
4483
4579
  */
@@ -5206,6 +5302,137 @@ export interface LifetimeUsageInput {
5206
5302
  external_historical_usage_amount_cents: number;
5207
5303
  };
5208
5304
  }
5305
+ export interface AlertThresholdBaseObject {
5306
+ /**
5307
+ * Unique identifier of the usage threshold created by Lago.
5308
+ * @example "warn"
5309
+ */
5310
+ code?: string | null;
5311
+ /**
5312
+ * This field when set to `true` indicates that the alert will be retrigger when this threshold is reached after the last non-recurring threshold. Only one recurring threshold per alert allowed.
5313
+ * @default false
5314
+ * @example false
5315
+ */
5316
+ recurring?: boolean;
5317
+ }
5318
+ export type AlertThresholdObject = AlertThresholdBaseObject & {
5319
+ /**
5320
+ * A value that should trigger this alert, formatted as a BigDecimal.
5321
+ * @pattern ^[0-9]+.?[0-9]*$
5322
+ * @example "99.0"
5323
+ */
5324
+ value: string;
5325
+ };
5326
+ export interface AlertObject {
5327
+ /**
5328
+ * Unique identifier of the alert, created by Lago.
5329
+ * @format uuid
5330
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5331
+ */
5332
+ lago_id: string;
5333
+ /**
5334
+ * Unique identifier of the organization, created by Lago.
5335
+ * @format uuid
5336
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5337
+ */
5338
+ lago_organization_id: string;
5339
+ /**
5340
+ * The subscription external unique identifier (provided by your own application).
5341
+ * @example "sub_1234567890"
5342
+ */
5343
+ subscription_external_id: string;
5344
+ /**
5345
+ * The customer external unique identifier (provided by your own application).
5346
+ * @example "cus_0987654321"
5347
+ */
5348
+ customer_external_id: string;
5349
+ /** The billable metric associated with the alert. Only for alerts based on a billable metric. */
5350
+ billable_metric: BillableMetricObject;
5351
+ /**
5352
+ * The type of alert.
5353
+ * @example "billable_metric_current_usage_amount"
5354
+ */
5355
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
5356
+ /**
5357
+ * Unique code used to identify the alert.
5358
+ * @example "storage_threshold_alert"
5359
+ */
5360
+ code: string;
5361
+ /**
5362
+ * The name of the alert.
5363
+ * @example "Storage Usage Alert"
5364
+ */
5365
+ name: string | null;
5366
+ /**
5367
+ * When the system checked if this alert should be triggered, this value was retrieved and checked against the thresholds.
5368
+ * @example 1000
5369
+ */
5370
+ previous_value: number;
5371
+ /**
5372
+ * The date and time in UTC (ISO 8601) when the system checked if this alert should be triggered. Null until it's processed for the first time.
5373
+ * @format date-time
5374
+ * @example "2025-05-19T10:04:21Z"
5375
+ */
5376
+ last_processed_at: string | null;
5377
+ /** Array of thresholds associated with the alert. */
5378
+ thresholds: AlertThresholdObject[];
5379
+ /**
5380
+ * The date and time in UTC (ISO 8601) when the alert was created.
5381
+ * @format date-time
5382
+ * @example "2025-03-20T10:00:00Z"
5383
+ */
5384
+ created_at: string;
5385
+ }
5386
+ export interface Alerts {
5387
+ alerts: AlertObject[];
5388
+ meta?: PaginationMeta;
5389
+ }
5390
+ export type AlertThresholdInput = AlertThresholdBaseObject & {
5391
+ /**
5392
+ * A value that should trigger this alert. This can be an integer or a string formatted as a BigDecimal.
5393
+ * @example 99
5394
+ */
5395
+ value: number | string;
5396
+ };
5397
+ export interface AlertBaseInput {
5398
+ /**
5399
+ * Unique code used to identify the alert.
5400
+ * @example "storage_threshold_alert"
5401
+ */
5402
+ code?: string;
5403
+ /**
5404
+ * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
5405
+ * @example "storage_usage"
5406
+ */
5407
+ billable_metric_code?: string | null;
5408
+ /**
5409
+ * The name of the alert.
5410
+ * @example "Storage Usage Alert"
5411
+ */
5412
+ name?: string | null;
5413
+ /** Array of thresholds associated with the alert. */
5414
+ thresholds?: AlertThresholdInput[];
5415
+ }
5416
+ export interface AlertCreateInput {
5417
+ alert: AlertBaseInput & {
5418
+ /**
5419
+ * The type of alert.
5420
+ * @example "billable_metric_current_usage_amount"
5421
+ */
5422
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
5423
+ /**
5424
+ * Unique code used to identify the alert.
5425
+ * @example "storage_threshold_alert"
5426
+ */
5427
+ code: string;
5428
+ };
5429
+ }
5430
+ export interface Alert {
5431
+ alert: AlertObject;
5432
+ }
5433
+ export interface AlertUpdateInput {
5434
+ alert: AlertBaseInput;
5435
+ }
5209
5436
  export interface TaxesPaginated {
5210
5437
  taxes: TaxObject[];
5211
5438
  meta: PaginationMeta;
@@ -5233,7 +5460,7 @@ export interface TaxBaseInput {
5233
5460
  */
5234
5461
  description?: string | null;
5235
5462
  /**
5236
- * This field is deprecated and will be removed in a future version. When set to true, it applies the tax to the organization's default billing entity. To apply or remove a tax from any billing entity (including the default one), please use the `PUT /billing_entity/:code` endpoint instead.
5463
+ * This field is deprecated and will be removed in a future version. When set to true, it applies the tax to the organization's default billing entity. To apply or remove a tax from any billing entity (including the default one), please use the `PUT /billing_entities/:code` endpoint instead.
5237
5464
  * @deprecated
5238
5465
  * @example true
5239
5466
  */
@@ -5902,6 +6129,75 @@ export interface WebhookEndpointUpdateInput {
5902
6129
  signature_algo?: "jwt" | "hmac";
5903
6130
  };
5904
6131
  }
6132
+ export interface TriggeredAlertObject {
6133
+ /**
6134
+ * Unique identifier of the alert, created by Lago.
6135
+ * @format uuid
6136
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6137
+ */
6138
+ lago_id: string;
6139
+ /**
6140
+ * Unique identifier of the organization, created by Lago.
6141
+ * @format uuid
6142
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6143
+ */
6144
+ lago_organization_id: string;
6145
+ /**
6146
+ * Unique identifier of the alert, created by Lago.
6147
+ * @format uuid
6148
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6149
+ */
6150
+ lago_alert_id: string;
6151
+ /**
6152
+ * Unique identifier of the subscription, created by Lago.
6153
+ * @format uuid
6154
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6155
+ */
6156
+ lago_subscription_id: string;
6157
+ /**
6158
+ * The subscription external unique identifier (provided by your own application).
6159
+ * @example "sub_1234567890"
6160
+ */
6161
+ subscription_external_id: string;
6162
+ /**
6163
+ * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
6164
+ * @example "storage_usage"
6165
+ */
6166
+ billable_metric_code: string | null;
6167
+ /**
6168
+ * The type of alert triggered.
6169
+ * @example "billable_metric_current_usage_amount"
6170
+ */
6171
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
6172
+ /**
6173
+ * Unique code used to identify the alert triggered.
6174
+ * @example "storage_threshold_alert"
6175
+ */
6176
+ alert_code: string;
6177
+ /**
6178
+ * The name of the alert triggered.
6179
+ * @example "Storage Usage Alert"
6180
+ */
6181
+ alert_name: string | null;
6182
+ /**
6183
+ * When the system checked if this alert should be triggered, this value was retrieved and checked if any threshold were crossed between this value and previous value.
6184
+ * @example 1200
6185
+ */
6186
+ current_value: number;
6187
+ /**
6188
+ * During the previous run, this value was retrieved.
6189
+ * @example 900
6190
+ */
6191
+ previous_value: number;
6192
+ /**
6193
+ * The date and time in UTC (ISO 8601) when the system triggered the alert.
6194
+ * @format date-time
6195
+ * @example "2025-05-19T10:04:21Z"
6196
+ */
6197
+ triggered_at: string | null;
6198
+ /** Array of thresholds crossed. All the recurring threshold values are present. */
6199
+ crossed_thresholds: AlertThresholdObject[];
6200
+ }
5905
6201
  export interface CustomerIntegratrionErrorObject {
5906
6202
  /**
5907
6203
  * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system.
@@ -6238,6 +6534,9 @@ export interface WalletTransactionPaymentFailureObject {
6238
6534
  payment_provider_code?: string;
6239
6535
  provider_error?: string | Record<string, any>;
6240
6536
  }
6537
+ export interface CreditNotes {
6538
+ credit_notes: CreditNoteObject[];
6539
+ }
6241
6540
  export type CustomerPaymentProvidernErrorObject = CustomerPaymentProviderErrorObject;
6242
6541
  export type QueryParamsType = Record<string | number, any>;
6243
6542
  export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
@@ -6354,6 +6653,86 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6354
6653
  */
6355
6654
  updateBillingEntity: (code: string, data: BillingEntityUpdateInput, params?: RequestParams) => Promise<HttpResponse<BillingEntityObjectExtended, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
6356
6655
  };
6656
+ activityLogs: {
6657
+ /**
6658
+ * @description This endpoint retrieves all existing activity logs that represent actions performed on application resources.
6659
+ *
6660
+ * @tags activity_logs
6661
+ * @name FindAllActivityLogs
6662
+ * @summary List all activity logs
6663
+ * @request GET:/activity_logs
6664
+ * @secure
6665
+ */
6666
+ findAllActivityLogs: (query?: {
6667
+ /**
6668
+ * Page number.
6669
+ * @example 1
6670
+ */
6671
+ page?: number;
6672
+ /**
6673
+ * Number of records per page.
6674
+ * @example 20
6675
+ */
6676
+ per_page?: number;
6677
+ /**
6678
+ * Filter activity logs from a specific date.
6679
+ * @format date
6680
+ * @example "2022-08-09"
6681
+ */
6682
+ from_date?: string;
6683
+ /**
6684
+ * Filter activity logs up to a specific date.
6685
+ * @format date
6686
+ * @example "2022-08-09"
6687
+ */
6688
+ to_date?: string;
6689
+ /**
6690
+ * Filter results by activity types
6691
+ * @example ["billing_metric.created","billing_metric.updated"]
6692
+ */
6693
+ activity_types?: string[];
6694
+ /**
6695
+ * Filter results by activity sources
6696
+ * @example ["api","front"]
6697
+ */
6698
+ activity_sources?: ("api" | "front" | "system")[];
6699
+ /**
6700
+ * Filter results by user emails
6701
+ * @example ["dinesh@piedpiper.test"]
6702
+ */
6703
+ user_emails?: string[];
6704
+ /**
6705
+ * Unique identifier assigned to the customer in your application.
6706
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6707
+ */
6708
+ external_customer_id?: string;
6709
+ /**
6710
+ * External subscription ID
6711
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6712
+ */
6713
+ external_subscription_id?: string;
6714
+ /**
6715
+ * Filter results by resources unique identifiers
6716
+ * @example ["5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba","1a901a90-1a90-1a90-1a90-1a901a901a90"]
6717
+ */
6718
+ resource_ids?: string[];
6719
+ /**
6720
+ * Filter results by resource class types
6721
+ * @example ["BillableMetric","Invoice"]
6722
+ */
6723
+ resource_types?: string[];
6724
+ }, params?: RequestParams) => Promise<HttpResponse<ActivityLogsPaginated, ApiErrorUnauthorized>>;
6725
+ /**
6726
+ * @description This endpoint retrieves an existing activity log that represents an action performed on some resource. The activity log is identified by its unique activity_id.
6727
+ *
6728
+ * @tags activity_logs
6729
+ * @name FindActivityLog
6730
+ * @summary Retrieve an activity log
6731
+ * @request GET:/activity_logs/{activity_id}
6732
+ * @secure
6733
+ */
6734
+ findActivityLog: (activityId: string, params?: RequestParams) => Promise<HttpResponse<ActivityLog, ApiErrorUnauthorized | ApiErrorNotFound>>;
6735
+ };
6357
6736
  addOns: {
6358
6737
  /**
6359
6738
  * @description This endpoint is used to create an add-on that can be then attached to a one-off invoice.
@@ -6567,6 +6946,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6567
6946
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6568
6947
  */
6569
6948
  external_customer_id?: string;
6949
+ /**
6950
+ * The code of the coupon applied to the customer. Use it to filter applied coupons by their code.
6951
+ * @example ["BLACK_FRIDAY_2024","CHRISTMAS_2024"]
6952
+ */
6953
+ "coupon_code[]"?: string[];
6570
6954
  }, params?: RequestParams) => Promise<HttpResponse<AppliedCouponsPaginated, ApiErrorUnauthorized>>;
6571
6955
  };
6572
6956
  billableMetrics: {
@@ -6794,7 +7178,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6794
7178
  * @example ["billing_entity_code_1","billing_entity_code_2"]
6795
7179
  */
6796
7180
  billing_entity_codes?: string[];
6797
- }, params?: RequestParams) => Promise<HttpResponse<CreditNotes, ApiErrorUnauthorized>>;
7181
+ }, params?: RequestParams) => Promise<HttpResponse<CreditNotesPaginated, ApiErrorUnauthorized>>;
6798
7182
  /**
6799
7183
  * @description This endpoint updates an existing credit note.
6800
7184
  *
@@ -7563,7 +7947,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7563
7947
  * @format uuid
7564
7948
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
7565
7949
  */
7566
- lago_invoice_id?: string;
7950
+ invoice_id?: string;
7567
7951
  }, params?: RequestParams) => Promise<HttpResponse<PaymentsPaginated, ApiErrorUnauthorized>>;
7568
7952
  /**
7569
7953
  * @description This endpoint retrieves a specific payment by its ID.
@@ -7695,7 +8079,15 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7695
8079
  * @request GET:/subscriptions/{external_id}
7696
8080
  * @secure
7697
8081
  */
7698
- findSubscription: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotFound>>;
8082
+ findSubscription: (externalId: string, query?: {
8083
+ /**
8084
+ * By default, this endpoint only return `active` subscriptions. If you want to retrieve a subscription with a different `status`, you can specify it here.
8085
+ *
8086
+ * _Note: As there may exists multiple `canceled` or `terminated` subscribtions for the same `external_id`, it is recommended to use the "List all subscriptions" endpoint to retrieve those subscriptions._
8087
+ * @example "active"
8088
+ */
8089
+ status?: "active" | "terminated" | "pending" | "canceled";
8090
+ }, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotFound>>;
7699
8091
  /**
7700
8092
  * @description This endpoint allows you to update a subscription.
7701
8093
  *
@@ -7727,7 +8119,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7727
8119
  *
7728
8120
  * @tags subscriptions
7729
8121
  * @name GetSubscriptionLifetimeUsage
7730
- * @summary Retrive subscription lifetime usage
8122
+ * @summary Retrieve subscription lifetime usage
7731
8123
  * @request GET:/subscriptions/{external_id}/lifetime_usage
7732
8124
  * @secure
7733
8125
  */
@@ -7742,6 +8134,56 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7742
8134
  * @secure
7743
8135
  */
7744
8136
  updateSubscriptionLifetimeUsage: (externalId: string, data: LifetimeUsageInput, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8137
+ /**
8138
+ * @description This endpoint enables the retrieval of all alerts for a subscription.
8139
+ *
8140
+ * @tags subscriptions
8141
+ * @name GetSubscriptionAlerts
8142
+ * @summary List subscription alerts
8143
+ * @request GET:/subscriptions/{external_id}/alerts
8144
+ * @secure
8145
+ */
8146
+ getSubscriptionAlerts: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Alerts, ApiErrorUnauthorized | ApiErrorNotFound>>;
8147
+ /**
8148
+ * @description This endpoint allows you to create a new alert for a subscription.
8149
+ *
8150
+ * @tags subscriptions
8151
+ * @name CreateSubscriptionAlert
8152
+ * @summary Create a subscription alert
8153
+ * @request POST:/subscriptions/{external_id}/alerts
8154
+ * @secure
8155
+ */
8156
+ createSubscriptionAlert: (externalId: string, data: AlertCreateInput, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8157
+ /**
8158
+ * @description This endpoint enables the retrieval of a specific alert for a subscription.
8159
+ *
8160
+ * @tags subscriptions
8161
+ * @name GetSubscriptionAlert
8162
+ * @summary Retrieve a subscription alert
8163
+ * @request GET:/subscriptions/{external_id}/alerts/{code}
8164
+ * @secure
8165
+ */
8166
+ getSubscriptionAlert: (externalId: string, code: string, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
8167
+ /**
8168
+ * @description This endpoint allows you to update an existing alert for a subscription.
8169
+ *
8170
+ * @tags subscriptions
8171
+ * @name UpdateSubscriptionAlert
8172
+ * @summary Update a subscription alert
8173
+ * @request PUT:/subscriptions/{external_id}/alerts/{code}
8174
+ * @secure
8175
+ */
8176
+ updateSubscriptionAlert: (externalId: string, code: string, data: AlertUpdateInput, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8177
+ /**
8178
+ * @description This endpoint allows you to delete an existing alert for a subscription.
8179
+ *
8180
+ * @tags subscriptions
8181
+ * @name DeleteSubscriptionAlert
8182
+ * @summary Delete a subscription alert
8183
+ * @request DELETE:/subscriptions/{external_id}/alerts/{code}
8184
+ * @secure
8185
+ */
8186
+ deleteSubscriptionAlert: (externalId: string, code: string, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
7745
8187
  };
7746
8188
  taxes: {
7747
8189
  /**