lago-javascript-client 1.30.0 → 1.31.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.
@@ -572,14 +572,14 @@ export interface ActivityLogObject {
572
572
  /**
573
573
  * This field represents the final state of the object that the action was applied.
574
574
  * @format object
575
- * @example "{ "id": "dad68bc7-c01a-4ad8-a87b-13e78693a5bc", "plan_id": "b9155544-e261-4e92-b54e-f65d7609294c", ... }"
575
+ * @example {"lago_id":"dad68bc7-c01a-4ad8-a87b-13e78693a5bc","plan_id":"b9155544-e261-4e92-b54e-f65d7609294c"}
576
576
  */
577
- activity_object?: string | null;
577
+ activity_object?: object | null;
578
578
  /**
579
579
  * @format object
580
- * @example "{ "plan_id": [null, "b9155544-e261-4e92-b54e-f65d7609294c"], ... }"
580
+ * @example {"plan_id":[null,"b9155544-e261-4e92-b54e-f65d7609294c"]}
581
581
  */
582
- activity_object_changes?: string | null;
582
+ activity_object_changes?: object | null;
583
583
  /**
584
584
  * The customer external unique identifier (provided by your own application)
585
585
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
@@ -750,6 +750,73 @@ export interface AddOn {
750
750
  export interface AddOnUpdateInput {
751
751
  add_on: AddOnBaseInput;
752
752
  }
753
+ export interface ApiLogObject {
754
+ /**
755
+ * Lago API version used in the request.
756
+ * @example "v1"
757
+ */
758
+ api_version: string;
759
+ /**
760
+ * The client used to make the request to the API.
761
+ * @example "Lago Ruby v1.26.0"
762
+ */
763
+ client: string;
764
+ /**
765
+ * This field represents the HTTP method of the request.
766
+ * @example "post"
767
+ */
768
+ http_method: "post" | "put" | "delete";
769
+ /**
770
+ * This field represents the HTTP status of the requests.
771
+ * @example 200
772
+ */
773
+ http_status: number;
774
+ /**
775
+ * The logged date of the api log, 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
776
+ * @format date-time
777
+ * @example "2025-03-31T12:31:44Z"
778
+ */
779
+ logged_at: string;
780
+ /**
781
+ * @format object
782
+ * @example "{ "billable_metric": { "name": "Storage", "code": "storage" } }"
783
+ */
784
+ request_body: string;
785
+ /**
786
+ * This field represents the API origin of the requested URL
787
+ * @example "https://app.lago.dev/"
788
+ */
789
+ request_origin: string;
790
+ /**
791
+ * This field represents the API path of the requested URL
792
+ * @example "/billable_metrics"
793
+ */
794
+ request_path: string;
795
+ /**
796
+ * The creation date of the api log 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
797
+ * @format date-time
798
+ * @example "2022-04-29T08:59:51Z"
799
+ */
800
+ created_at: string;
801
+ /**
802
+ * Unique identifier for the api log.
803
+ * @format uuid
804
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
805
+ */
806
+ request_id: string;
807
+ /**
808
+ * @format object
809
+ * @example "{ "lago_id": "b9155544-e261-4e92-b54e-f65d7609294c", ... }"
810
+ */
811
+ request_response?: string;
812
+ }
813
+ export interface ApiLogsPaginated {
814
+ api_logs: ApiLogObject[];
815
+ meta: PaginationMeta;
816
+ }
817
+ export interface ApiLog {
818
+ api_log: ApiLogObject;
819
+ }
753
820
  export interface GrossRevenueObject {
754
821
  /**
755
822
  * Identifies the month to analyze revenue.
@@ -3918,6 +3985,26 @@ export interface InvoicePreviewInput {
3918
3985
  */
3919
3986
  billing_entity_code?: string;
3920
3987
  }
3988
+ /** Parameters available when voiding an invoice that optionally generate credit notes. */
3989
+ export interface InvoiceVoidInput {
3990
+ /**
3991
+ * Set to `true` to force voiding the invoice and generate a credit note.
3992
+ * @example true
3993
+ */
3994
+ generate_credit_note?: boolean;
3995
+ /**
3996
+ * Portion of the invoice amount (in cents) to be refunded to the customer in the generated credit note.
3997
+ * @min 0
3998
+ * @example 2000
3999
+ */
4000
+ refund_amount?: number;
4001
+ /**
4002
+ * Portion of the invoice amount (in cents) to be credited to the customer's balance in the generated credit note.
4003
+ * @min 0
4004
+ * @example 1150
4005
+ */
4006
+ credit_amount?: number;
4007
+ }
3921
4008
  /** The custom billing settings for your organization. */
3922
4009
  export interface OrganizationBillingConfiguration {
3923
4010
  /**
@@ -4436,7 +4523,7 @@ export interface MinimumCommitmentObject {
4436
4523
  export interface ChargeProperties {
4437
4524
  /**
4438
4525
  * 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
4526
+ * **DEPRECATED** Replaced by `pricing_group_keys`.
4440
4527
  * @deprecated
4441
4528
  * @example ["agent_name"]
4442
4529
  */
@@ -5652,6 +5739,14 @@ export interface WalletObject {
5652
5739
  * @example false
5653
5740
  */
5654
5741
  invoice_requires_successful_payment?: boolean;
5742
+ /** Set wallet limitations to fee types. */
5743
+ applies_to?: {
5744
+ /**
5745
+ * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
5746
+ * @example ["charge"]
5747
+ */
5748
+ fee_types?: any[] | null;
5749
+ };
5655
5750
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
5656
5751
  recurring_transaction_rules?: WalletRecurringTransactionRule[];
5657
5752
  /**
@@ -5737,6 +5832,14 @@ export interface WalletCreateInput {
5737
5832
  /** The corresponding value for the key. */
5738
5833
  value?: string;
5739
5834
  }[];
5835
+ /** Set wallet limitations to fee types. */
5836
+ applies_to?: {
5837
+ /**
5838
+ * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
5839
+ * @example ["charge"]
5840
+ */
5841
+ fee_types?: any[] | null;
5842
+ };
5740
5843
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
5741
5844
  recurring_transaction_rules?: {
5742
5845
  /**
@@ -5904,6 +6007,14 @@ export interface WalletUpdateInput {
5904
6007
  value?: string;
5905
6008
  }[];
5906
6009
  }[];
6010
+ /** Set wallet limitations to fee types. */
6011
+ applies_to?: {
6012
+ /**
6013
+ * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
6014
+ * @example ["charge"]
6015
+ */
6016
+ fee_types?: any[] | null;
6017
+ };
5907
6018
  };
5908
6019
  }
5909
6020
  export interface WalletTransactionCreateInput {
@@ -6598,7 +6709,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
6598
6709
  }
6599
6710
  /**
6600
6711
  * @title Lago API documentation
6601
- * @version 1.28.1
6712
+ * @version 1.31.0
6602
6713
  * @license AGPLv3
6603
6714
  * @baseUrl https://api.getlago.com/api/v1
6604
6715
  * @externalDocs https://github.com/getlago
@@ -6690,17 +6801,17 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6690
6801
  * Filter results by activity types
6691
6802
  * @example ["billing_metric.created","billing_metric.updated"]
6692
6803
  */
6693
- activity_types?: string[];
6804
+ "activity_types[]"?: string[];
6694
6805
  /**
6695
6806
  * Filter results by activity sources
6696
6807
  * @example ["api","front"]
6697
6808
  */
6698
- activity_sources?: ("api" | "front" | "system")[];
6809
+ "activity_sources[]"?: ("api" | "front" | "system")[];
6699
6810
  /**
6700
6811
  * Filter results by user emails
6701
6812
  * @example ["dinesh@piedpiper.test"]
6702
6813
  */
6703
- user_emails?: string[];
6814
+ "user_emails[]"?: string[];
6704
6815
  /**
6705
6816
  * Unique identifier assigned to the customer in your application.
6706
6817
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
@@ -6715,12 +6826,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6715
6826
  * Filter results by resources unique identifiers
6716
6827
  * @example ["5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba","1a901a90-1a90-1a90-1a90-1a901a901a90"]
6717
6828
  */
6718
- resource_ids?: string[];
6829
+ "resource_ids[]"?: string[];
6719
6830
  /**
6720
6831
  * Filter results by resource class types
6721
6832
  * @example ["BillableMetric","Invoice"]
6722
6833
  */
6723
- resource_types?: string[];
6834
+ "resource_types[]"?: string[];
6724
6835
  }, params?: RequestParams) => Promise<HttpResponse<ActivityLogsPaginated, ApiErrorUnauthorized>>;
6725
6836
  /**
6726
6837
  * @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.
@@ -6796,6 +6907,71 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6796
6907
  */
6797
6908
  destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorNotFound>>;
6798
6909
  };
6910
+ apiLogs: {
6911
+ /**
6912
+ * @description This endpoint retrieves all existing api logs that represent requests performed to Lago's API.
6913
+ *
6914
+ * @tags api_logs
6915
+ * @name FindAllApiLogs
6916
+ * @summary List all api logs
6917
+ * @request GET:/api_logs
6918
+ * @secure
6919
+ */
6920
+ findAllApiLogs: (query?: {
6921
+ /**
6922
+ * Page number.
6923
+ * @example 1
6924
+ */
6925
+ page?: number;
6926
+ /**
6927
+ * Number of records per page.
6928
+ * @example 20
6929
+ */
6930
+ per_page?: number;
6931
+ /**
6932
+ * Filter api logs from a specific date.
6933
+ * @format date
6934
+ * @example "2022-08-09"
6935
+ */
6936
+ from_date?: string;
6937
+ /**
6938
+ * Filter api logs up to a specific date.
6939
+ * @format date
6940
+ * @example "2022-08-09"
6941
+ */
6942
+ to_date?: string;
6943
+ /**
6944
+ * Filter results by HTTP methods
6945
+ * @example ["post","put"]
6946
+ */
6947
+ "http_methods[]"?: ("post" | "put" | "delete")[];
6948
+ /**
6949
+ * Filter results by HTTP status or by generic request status
6950
+ * @example ["failed","succeeded",404]
6951
+ */
6952
+ "http_statuses[]"?: ("succeeded" | "failed" | number)[];
6953
+ /**
6954
+ * Filter results by API version
6955
+ * @example ["v1"]
6956
+ */
6957
+ "api_version[]"?: string[];
6958
+ /**
6959
+ * Filter results by the path of the request
6960
+ * @example "/billable_metrics/"
6961
+ */
6962
+ request_paths?: string;
6963
+ }, params?: RequestParams) => Promise<HttpResponse<ApiLogsPaginated, ApiErrorUnauthorized>>;
6964
+ /**
6965
+ * @description This endpoint retrieves an existing api log that represents a request made to the API. The api log is identified by its unique request_id.
6966
+ *
6967
+ * @tags api_logs
6968
+ * @name FindApiLog
6969
+ * @summary Retrieve an api log
6970
+ * @request GET:/api_logs/{request_id}
6971
+ * @secure
6972
+ */
6973
+ findApiLog: (requestId: string, params?: RequestParams) => Promise<HttpResponse<ApiLog, ApiErrorUnauthorized | ApiErrorNotFound>>;
6974
+ };
6799
6975
  analytics: {
6800
6976
  /**
6801
6977
  * @description Gross revenue is the sum of monthly `finalized` invoice payments and fees paid in advance that are not invoiceable. This total is calculated after deducting taxes and discounts.
@@ -7177,7 +7353,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7177
7353
  * Filter credit notes by billing entity codes.
7178
7354
  * @example ["billing_entity_code_1","billing_entity_code_2"]
7179
7355
  */
7180
- billing_entity_codes?: string[];
7356
+ "billing_entity_codes[]"?: string[];
7181
7357
  }, params?: RequestParams) => Promise<HttpResponse<CreditNotesPaginated, ApiErrorUnauthorized>>;
7182
7358
  /**
7183
7359
  * @description This endpoint updates an existing credit note.
@@ -7265,12 +7441,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7265
7441
  * Filter customers by account type.
7266
7442
  * @example ["customer","partner"]
7267
7443
  */
7268
- account_type?: ("customer" | "partner")[];
7444
+ "account_type[]"?: ("customer" | "partner")[];
7269
7445
  /**
7270
7446
  * Filter customers by billing entity codes.
7271
7447
  * @example ["billing_entity_code_1","billing_entity_code_2"]
7272
7448
  */
7273
- billing_entity_codes?: string[];
7449
+ "billing_entity_codes[]"?: string[];
7274
7450
  }, params?: RequestParams) => Promise<HttpResponse<CustomersPaginated, ApiErrorUnauthorized>>;
7275
7451
  /**
7276
7452
  * @description This endpoint retrieves an existing customer.
@@ -7700,7 +7876,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7700
7876
  * Filter invoices by billing entity codes. Possible values are the billing entity codes you have created.
7701
7877
  * @example ["acme_corp","foo_bar"]
7702
7878
  */
7703
- billing_entity_codes?: string[];
7879
+ "billing_entity_codes[]"?: string[];
7704
7880
  /**
7705
7881
  * Filter invoices by metadata. Replace `key` with the actual metadata key you want to match, and provide the corresponding value. Providing empty value will search for invoice without given metadata key. For example, `metadata[color]=blue`.
7706
7882
  * @example "someValue"
@@ -7808,7 +7984,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7808
7984
  */
7809
7985
  retryPayment: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
7810
7986
  /**
7811
- * @description This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`.
7987
+ * @description This endpoint is used for voiding an invoice. • When no body parameters are provided, the invoice can be voided only if it is in a `finalized` status and its payment status is NOT `succeeded`. • When `generate_credit_note` is provided (optionally with `refund_amount` and/or `credit_amount`), this validation is bypassed: the invoice is forcibly voided and a credit note is generated. If the specified refund/credit amounts do not cover the full invoice total, the remainder is issued on a second credit note that is created and immediately voided.
7812
7988
  *
7813
7989
  * @tags invoices
7814
7990
  * @name VoidInvoice
@@ -7816,7 +7992,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7816
7992
  * @request POST:/invoices/{lago_id}/void
7817
7993
  * @secure
7818
7994
  */
7819
- voidInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
7995
+ voidInvoice: (lagoId: string, data?: InvoiceVoidInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
7820
7996
  };
7821
7997
  organizations: {
7822
7998
  /**
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 1.28.1
151
+ * @version 1.31.0
152
152
  * @license AGPLv3
153
153
  * @baseUrl https://api.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
@@ -349,6 +349,41 @@ export class Api extends HttpClient {
349
349
  ...params,
350
350
  }),
351
351
  };
352
+ apiLogs = {
353
+ /**
354
+ * @description This endpoint retrieves all existing api logs that represent requests performed to Lago's API.
355
+ *
356
+ * @tags api_logs
357
+ * @name FindAllApiLogs
358
+ * @summary List all api logs
359
+ * @request GET:/api_logs
360
+ * @secure
361
+ */
362
+ findAllApiLogs: (query, params = {}) => this.request({
363
+ path: `/api_logs`,
364
+ method: "GET",
365
+ query: query,
366
+ secure: true,
367
+ format: "json",
368
+ ...params,
369
+ }),
370
+ /**
371
+ * @description This endpoint retrieves an existing api log that represents a request made to the API. The api log is identified by its unique request_id.
372
+ *
373
+ * @tags api_logs
374
+ * @name FindApiLog
375
+ * @summary Retrieve an api log
376
+ * @request GET:/api_logs/{request_id}
377
+ * @secure
378
+ */
379
+ findApiLog: (requestId, params = {}) => this.request({
380
+ path: `/api_logs/${requestId}`,
381
+ method: "GET",
382
+ secure: true,
383
+ format: "json",
384
+ ...params,
385
+ }),
386
+ };
352
387
  analytics = {
353
388
  /**
354
389
  * @description Gross revenue is the sum of monthly `finalized` invoice payments and fees paid in advance that are not invoiceable. This total is calculated after deducting taxes and discounts.
@@ -1294,7 +1329,7 @@ export class Api extends HttpClient {
1294
1329
  ...params,
1295
1330
  }),
1296
1331
  /**
1297
- * @description This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`.
1332
+ * @description This endpoint is used for voiding an invoice. • When no body parameters are provided, the invoice can be voided only if it is in a `finalized` status and its payment status is NOT `succeeded`. • When `generate_credit_note` is provided (optionally with `refund_amount` and/or `credit_amount`), this validation is bypassed: the invoice is forcibly voided and a credit note is generated. If the specified refund/credit amounts do not cover the full invoice total, the remainder is issued on a second credit note that is created and immediately voided.
1298
1333
  *
1299
1334
  * @tags invoices
1300
1335
  * @name VoidInvoice
@@ -1302,10 +1337,12 @@ export class Api extends HttpClient {
1302
1337
  * @request POST:/invoices/{lago_id}/void
1303
1338
  * @secure
1304
1339
  */
1305
- voidInvoice: (lagoId, params = {}) => this.request({
1340
+ voidInvoice: (lagoId, data, params = {}) => this.request({
1306
1341
  path: `/invoices/${lagoId}/void`,
1307
1342
  method: "POST",
1343
+ body: data,
1308
1344
  secure: true,
1345
+ type: ContentType.Json,
1309
1346
  format: "json",
1310
1347
  ...params,
1311
1348
  }),
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.30.0",
6
+ "version": "v1.31.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",
@@ -572,14 +572,14 @@ export interface ActivityLogObject {
572
572
  /**
573
573
  * This field represents the final state of the object that the action was applied.
574
574
  * @format object
575
- * @example "{ "id": "dad68bc7-c01a-4ad8-a87b-13e78693a5bc", "plan_id": "b9155544-e261-4e92-b54e-f65d7609294c", ... }"
575
+ * @example {"lago_id":"dad68bc7-c01a-4ad8-a87b-13e78693a5bc","plan_id":"b9155544-e261-4e92-b54e-f65d7609294c"}
576
576
  */
577
- activity_object?: string | null;
577
+ activity_object?: object | null;
578
578
  /**
579
579
  * @format object
580
- * @example "{ "plan_id": [null, "b9155544-e261-4e92-b54e-f65d7609294c"], ... }"
580
+ * @example {"plan_id":[null,"b9155544-e261-4e92-b54e-f65d7609294c"]}
581
581
  */
582
- activity_object_changes?: string | null;
582
+ activity_object_changes?: object | null;
583
583
  /**
584
584
  * The customer external unique identifier (provided by your own application)
585
585
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
@@ -750,6 +750,73 @@ export interface AddOn {
750
750
  export interface AddOnUpdateInput {
751
751
  add_on: AddOnBaseInput;
752
752
  }
753
+ export interface ApiLogObject {
754
+ /**
755
+ * Lago API version used in the request.
756
+ * @example "v1"
757
+ */
758
+ api_version: string;
759
+ /**
760
+ * The client used to make the request to the API.
761
+ * @example "Lago Ruby v1.26.0"
762
+ */
763
+ client: string;
764
+ /**
765
+ * This field represents the HTTP method of the request.
766
+ * @example "post"
767
+ */
768
+ http_method: "post" | "put" | "delete";
769
+ /**
770
+ * This field represents the HTTP status of the requests.
771
+ * @example 200
772
+ */
773
+ http_status: number;
774
+ /**
775
+ * The logged date of the api log, 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
776
+ * @format date-time
777
+ * @example "2025-03-31T12:31:44Z"
778
+ */
779
+ logged_at: string;
780
+ /**
781
+ * @format object
782
+ * @example "{ "billable_metric": { "name": "Storage", "code": "storage" } }"
783
+ */
784
+ request_body: string;
785
+ /**
786
+ * This field represents the API origin of the requested URL
787
+ * @example "https://app.lago.dev/"
788
+ */
789
+ request_origin: string;
790
+ /**
791
+ * This field represents the API path of the requested URL
792
+ * @example "/billable_metrics"
793
+ */
794
+ request_path: string;
795
+ /**
796
+ * The creation date of the api log 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
797
+ * @format date-time
798
+ * @example "2022-04-29T08:59:51Z"
799
+ */
800
+ created_at: string;
801
+ /**
802
+ * Unique identifier for the api log.
803
+ * @format uuid
804
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
805
+ */
806
+ request_id: string;
807
+ /**
808
+ * @format object
809
+ * @example "{ "lago_id": "b9155544-e261-4e92-b54e-f65d7609294c", ... }"
810
+ */
811
+ request_response?: string;
812
+ }
813
+ export interface ApiLogsPaginated {
814
+ api_logs: ApiLogObject[];
815
+ meta: PaginationMeta;
816
+ }
817
+ export interface ApiLog {
818
+ api_log: ApiLogObject;
819
+ }
753
820
  export interface GrossRevenueObject {
754
821
  /**
755
822
  * Identifies the month to analyze revenue.
@@ -3918,6 +3985,26 @@ export interface InvoicePreviewInput {
3918
3985
  */
3919
3986
  billing_entity_code?: string;
3920
3987
  }
3988
+ /** Parameters available when voiding an invoice that optionally generate credit notes. */
3989
+ export interface InvoiceVoidInput {
3990
+ /**
3991
+ * Set to `true` to force voiding the invoice and generate a credit note.
3992
+ * @example true
3993
+ */
3994
+ generate_credit_note?: boolean;
3995
+ /**
3996
+ * Portion of the invoice amount (in cents) to be refunded to the customer in the generated credit note.
3997
+ * @min 0
3998
+ * @example 2000
3999
+ */
4000
+ refund_amount?: number;
4001
+ /**
4002
+ * Portion of the invoice amount (in cents) to be credited to the customer's balance in the generated credit note.
4003
+ * @min 0
4004
+ * @example 1150
4005
+ */
4006
+ credit_amount?: number;
4007
+ }
3921
4008
  /** The custom billing settings for your organization. */
3922
4009
  export interface OrganizationBillingConfiguration {
3923
4010
  /**
@@ -4436,7 +4523,7 @@ export interface MinimumCommitmentObject {
4436
4523
  export interface ChargeProperties {
4437
4524
  /**
4438
4525
  * 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
4526
+ * **DEPRECATED** Replaced by `pricing_group_keys`.
4440
4527
  * @deprecated
4441
4528
  * @example ["agent_name"]
4442
4529
  */
@@ -5652,6 +5739,14 @@ export interface WalletObject {
5652
5739
  * @example false
5653
5740
  */
5654
5741
  invoice_requires_successful_payment?: boolean;
5742
+ /** Set wallet limitations to fee types. */
5743
+ applies_to?: {
5744
+ /**
5745
+ * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
5746
+ * @example ["charge"]
5747
+ */
5748
+ fee_types?: any[] | null;
5749
+ };
5655
5750
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
5656
5751
  recurring_transaction_rules?: WalletRecurringTransactionRule[];
5657
5752
  /**
@@ -5737,6 +5832,14 @@ export interface WalletCreateInput {
5737
5832
  /** The corresponding value for the key. */
5738
5833
  value?: string;
5739
5834
  }[];
5835
+ /** Set wallet limitations to fee types. */
5836
+ applies_to?: {
5837
+ /**
5838
+ * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
5839
+ * @example ["charge"]
5840
+ */
5841
+ fee_types?: any[] | null;
5842
+ };
5740
5843
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
5741
5844
  recurring_transaction_rules?: {
5742
5845
  /**
@@ -5904,6 +6007,14 @@ export interface WalletUpdateInput {
5904
6007
  value?: string;
5905
6008
  }[];
5906
6009
  }[];
6010
+ /** Set wallet limitations to fee types. */
6011
+ applies_to?: {
6012
+ /**
6013
+ * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
6014
+ * @example ["charge"]
6015
+ */
6016
+ fee_types?: any[] | null;
6017
+ };
5907
6018
  };
5908
6019
  }
5909
6020
  export interface WalletTransactionCreateInput {
@@ -6598,7 +6709,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
6598
6709
  }
6599
6710
  /**
6600
6711
  * @title Lago API documentation
6601
- * @version 1.28.1
6712
+ * @version 1.31.0
6602
6713
  * @license AGPLv3
6603
6714
  * @baseUrl https://api.getlago.com/api/v1
6604
6715
  * @externalDocs https://github.com/getlago
@@ -6690,17 +6801,17 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6690
6801
  * Filter results by activity types
6691
6802
  * @example ["billing_metric.created","billing_metric.updated"]
6692
6803
  */
6693
- activity_types?: string[];
6804
+ "activity_types[]"?: string[];
6694
6805
  /**
6695
6806
  * Filter results by activity sources
6696
6807
  * @example ["api","front"]
6697
6808
  */
6698
- activity_sources?: ("api" | "front" | "system")[];
6809
+ "activity_sources[]"?: ("api" | "front" | "system")[];
6699
6810
  /**
6700
6811
  * Filter results by user emails
6701
6812
  * @example ["dinesh@piedpiper.test"]
6702
6813
  */
6703
- user_emails?: string[];
6814
+ "user_emails[]"?: string[];
6704
6815
  /**
6705
6816
  * Unique identifier assigned to the customer in your application.
6706
6817
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
@@ -6715,12 +6826,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6715
6826
  * Filter results by resources unique identifiers
6716
6827
  * @example ["5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba","1a901a90-1a90-1a90-1a90-1a901a901a90"]
6717
6828
  */
6718
- resource_ids?: string[];
6829
+ "resource_ids[]"?: string[];
6719
6830
  /**
6720
6831
  * Filter results by resource class types
6721
6832
  * @example ["BillableMetric","Invoice"]
6722
6833
  */
6723
- resource_types?: string[];
6834
+ "resource_types[]"?: string[];
6724
6835
  }, params?: RequestParams) => Promise<HttpResponse<ActivityLogsPaginated, ApiErrorUnauthorized>>;
6725
6836
  /**
6726
6837
  * @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.
@@ -6796,6 +6907,71 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6796
6907
  */
6797
6908
  destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorNotFound>>;
6798
6909
  };
6910
+ apiLogs: {
6911
+ /**
6912
+ * @description This endpoint retrieves all existing api logs that represent requests performed to Lago's API.
6913
+ *
6914
+ * @tags api_logs
6915
+ * @name FindAllApiLogs
6916
+ * @summary List all api logs
6917
+ * @request GET:/api_logs
6918
+ * @secure
6919
+ */
6920
+ findAllApiLogs: (query?: {
6921
+ /**
6922
+ * Page number.
6923
+ * @example 1
6924
+ */
6925
+ page?: number;
6926
+ /**
6927
+ * Number of records per page.
6928
+ * @example 20
6929
+ */
6930
+ per_page?: number;
6931
+ /**
6932
+ * Filter api logs from a specific date.
6933
+ * @format date
6934
+ * @example "2022-08-09"
6935
+ */
6936
+ from_date?: string;
6937
+ /**
6938
+ * Filter api logs up to a specific date.
6939
+ * @format date
6940
+ * @example "2022-08-09"
6941
+ */
6942
+ to_date?: string;
6943
+ /**
6944
+ * Filter results by HTTP methods
6945
+ * @example ["post","put"]
6946
+ */
6947
+ "http_methods[]"?: ("post" | "put" | "delete")[];
6948
+ /**
6949
+ * Filter results by HTTP status or by generic request status
6950
+ * @example ["failed","succeeded",404]
6951
+ */
6952
+ "http_statuses[]"?: ("succeeded" | "failed" | number)[];
6953
+ /**
6954
+ * Filter results by API version
6955
+ * @example ["v1"]
6956
+ */
6957
+ "api_version[]"?: string[];
6958
+ /**
6959
+ * Filter results by the path of the request
6960
+ * @example "/billable_metrics/"
6961
+ */
6962
+ request_paths?: string;
6963
+ }, params?: RequestParams) => Promise<HttpResponse<ApiLogsPaginated, ApiErrorUnauthorized>>;
6964
+ /**
6965
+ * @description This endpoint retrieves an existing api log that represents a request made to the API. The api log is identified by its unique request_id.
6966
+ *
6967
+ * @tags api_logs
6968
+ * @name FindApiLog
6969
+ * @summary Retrieve an api log
6970
+ * @request GET:/api_logs/{request_id}
6971
+ * @secure
6972
+ */
6973
+ findApiLog: (requestId: string, params?: RequestParams) => Promise<HttpResponse<ApiLog, ApiErrorUnauthorized | ApiErrorNotFound>>;
6974
+ };
6799
6975
  analytics: {
6800
6976
  /**
6801
6977
  * @description Gross revenue is the sum of monthly `finalized` invoice payments and fees paid in advance that are not invoiceable. This total is calculated after deducting taxes and discounts.
@@ -7177,7 +7353,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7177
7353
  * Filter credit notes by billing entity codes.
7178
7354
  * @example ["billing_entity_code_1","billing_entity_code_2"]
7179
7355
  */
7180
- billing_entity_codes?: string[];
7356
+ "billing_entity_codes[]"?: string[];
7181
7357
  }, params?: RequestParams) => Promise<HttpResponse<CreditNotesPaginated, ApiErrorUnauthorized>>;
7182
7358
  /**
7183
7359
  * @description This endpoint updates an existing credit note.
@@ -7265,12 +7441,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7265
7441
  * Filter customers by account type.
7266
7442
  * @example ["customer","partner"]
7267
7443
  */
7268
- account_type?: ("customer" | "partner")[];
7444
+ "account_type[]"?: ("customer" | "partner")[];
7269
7445
  /**
7270
7446
  * Filter customers by billing entity codes.
7271
7447
  * @example ["billing_entity_code_1","billing_entity_code_2"]
7272
7448
  */
7273
- billing_entity_codes?: string[];
7449
+ "billing_entity_codes[]"?: string[];
7274
7450
  }, params?: RequestParams) => Promise<HttpResponse<CustomersPaginated, ApiErrorUnauthorized>>;
7275
7451
  /**
7276
7452
  * @description This endpoint retrieves an existing customer.
@@ -7700,7 +7876,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7700
7876
  * Filter invoices by billing entity codes. Possible values are the billing entity codes you have created.
7701
7877
  * @example ["acme_corp","foo_bar"]
7702
7878
  */
7703
- billing_entity_codes?: string[];
7879
+ "billing_entity_codes[]"?: string[];
7704
7880
  /**
7705
7881
  * Filter invoices by metadata. Replace `key` with the actual metadata key you want to match, and provide the corresponding value. Providing empty value will search for invoice without given metadata key. For example, `metadata[color]=blue`.
7706
7882
  * @example "someValue"
@@ -7808,7 +7984,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7808
7984
  */
7809
7985
  retryPayment: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
7810
7986
  /**
7811
- * @description This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`.
7987
+ * @description This endpoint is used for voiding an invoice. • When no body parameters are provided, the invoice can be voided only if it is in a `finalized` status and its payment status is NOT `succeeded`. • When `generate_credit_note` is provided (optionally with `refund_amount` and/or `credit_amount`), this validation is bypassed: the invoice is forcibly voided and a credit note is generated. If the specified refund/credit amounts do not cover the full invoice total, the remainder is issued on a second credit note that is created and immediately voided.
7812
7988
  *
7813
7989
  * @tags invoices
7814
7990
  * @name VoidInvoice
@@ -7816,7 +7992,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7816
7992
  * @request POST:/invoices/{lago_id}/void
7817
7993
  * @secure
7818
7994
  */
7819
- voidInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
7995
+ voidInvoice: (lagoId: string, data?: InvoiceVoidInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
7820
7996
  };
7821
7997
  organizations: {
7822
7998
  /**
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 1.28.1
155
+ * @version 1.31.0
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://api.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -353,6 +353,41 @@ class Api extends HttpClient {
353
353
  ...params,
354
354
  }),
355
355
  };
356
+ apiLogs = {
357
+ /**
358
+ * @description This endpoint retrieves all existing api logs that represent requests performed to Lago's API.
359
+ *
360
+ * @tags api_logs
361
+ * @name FindAllApiLogs
362
+ * @summary List all api logs
363
+ * @request GET:/api_logs
364
+ * @secure
365
+ */
366
+ findAllApiLogs: (query, params = {}) => this.request({
367
+ path: `/api_logs`,
368
+ method: "GET",
369
+ query: query,
370
+ secure: true,
371
+ format: "json",
372
+ ...params,
373
+ }),
374
+ /**
375
+ * @description This endpoint retrieves an existing api log that represents a request made to the API. The api log is identified by its unique request_id.
376
+ *
377
+ * @tags api_logs
378
+ * @name FindApiLog
379
+ * @summary Retrieve an api log
380
+ * @request GET:/api_logs/{request_id}
381
+ * @secure
382
+ */
383
+ findApiLog: (requestId, params = {}) => this.request({
384
+ path: `/api_logs/${requestId}`,
385
+ method: "GET",
386
+ secure: true,
387
+ format: "json",
388
+ ...params,
389
+ }),
390
+ };
356
391
  analytics = {
357
392
  /**
358
393
  * @description Gross revenue is the sum of monthly `finalized` invoice payments and fees paid in advance that are not invoiceable. This total is calculated after deducting taxes and discounts.
@@ -1298,7 +1333,7 @@ class Api extends HttpClient {
1298
1333
  ...params,
1299
1334
  }),
1300
1335
  /**
1301
- * @description This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`.
1336
+ * @description This endpoint is used for voiding an invoice. • When no body parameters are provided, the invoice can be voided only if it is in a `finalized` status and its payment status is NOT `succeeded`. • When `generate_credit_note` is provided (optionally with `refund_amount` and/or `credit_amount`), this validation is bypassed: the invoice is forcibly voided and a credit note is generated. If the specified refund/credit amounts do not cover the full invoice total, the remainder is issued on a second credit note that is created and immediately voided.
1302
1337
  *
1303
1338
  * @tags invoices
1304
1339
  * @name VoidInvoice
@@ -1306,10 +1341,12 @@ class Api extends HttpClient {
1306
1341
  * @request POST:/invoices/{lago_id}/void
1307
1342
  * @secure
1308
1343
  */
1309
- voidInvoice: (lagoId, params = {}) => this.request({
1344
+ voidInvoice: (lagoId, data, params = {}) => this.request({
1310
1345
  path: `/invoices/${lagoId}/void`,
1311
1346
  method: "POST",
1347
+ body: data,
1312
1348
  secure: true,
1349
+ type: ContentType.Json,
1313
1350
  format: "json",
1314
1351
  ...params,
1315
1352
  }),