lago-javascript-client 1.48.0 → 1.50.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.
@@ -361,7 +361,7 @@ export interface TaxObject {
361
361
  */
362
362
  rate: number;
363
363
  /**
364
- * 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.
364
+ * **Deprecated.** This field 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.
365
365
  * @deprecated
366
366
  * @example true
367
367
  */
@@ -406,7 +406,7 @@ export interface InvoiceCustomSectionObject {
406
406
  */
407
407
  display_name?: string;
408
408
  /**
409
- * 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.
409
+ * **Deprecated.** This field 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.
410
410
  * @deprecated
411
411
  * @example true
412
412
  */
@@ -3817,7 +3817,7 @@ export interface AppliedInvoiceCustomSectionObject {
3817
3817
  */
3818
3818
  created_at: string;
3819
3819
  /**
3820
- * Unique identifier of the invoice custom section that was applied.
3820
+ * **Deprecated.** Unique identifier of the invoice custom section that was applied.
3821
3821
  * @deprecated
3822
3822
  * @format uuid
3823
3823
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
@@ -3839,6 +3839,54 @@ export interface PaymentMethodReference {
3839
3839
  */
3840
3840
  payment_method_id?: string;
3841
3841
  }
3842
+ export interface SubscriptionActivationRuleObject {
3843
+ /**
3844
+ * Unique identifier assigned to the activation rule within the Lago application. This ID is exclusively created by Lago.
3845
+ * @format uuid
3846
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3847
+ */
3848
+ lago_id: string;
3849
+ /**
3850
+ * The type of the activation rule. Only `payment` is currently supported. A `payment` rule gates the subscription activation on a successful payment of the first invoice.
3851
+ * @example "payment"
3852
+ */
3853
+ type: "payment";
3854
+ /**
3855
+ * The number of hours the subscription stays in the `incomplete` state waiting for the payment to succeed before it is automatically canceled.
3856
+ * @example 48
3857
+ */
3858
+ timeout_hours: number;
3859
+ /**
3860
+ * The evaluation status of the activation rule:
3861
+ * - `inactive`: the rule has not been evaluated yet.
3862
+ * - `pending`: the rule is applicable and is waiting to be satisfied (e.g. waiting for the payment).
3863
+ * - `satisfied`: the rule has been satisfied and no longer blocks activation.
3864
+ * - `declined`: the rule was applicable but was declined.
3865
+ * - `failed`: the rule could not be satisfied (e.g. the payment failed).
3866
+ * - `expired`: the rule was not satisfied before its timeout elapsed.
3867
+ * - `not_applicable`: the rule did not apply to this subscription.
3868
+ * @example "pending"
3869
+ */
3870
+ status: "inactive" | "pending" | "satisfied" | "declined" | "failed" | "expired" | "not_applicable";
3871
+ /**
3872
+ * The date and time when the rule expires, after which an unsatisfied rule causes the subscription to be canceled. Represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). Null until the rule starts being evaluated.
3873
+ * @format date-time
3874
+ * @example "2022-08-10T00:00:00Z"
3875
+ */
3876
+ expires_at?: string | null;
3877
+ /**
3878
+ * The creation date of the activation rule, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3879
+ * @format date-time
3880
+ * @example "2022-08-08T00:00:00Z"
3881
+ */
3882
+ created_at: string;
3883
+ /**
3884
+ * The last update date of the activation rule, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3885
+ * @format date-time
3886
+ * @example "2022-08-08T00:00:00Z"
3887
+ */
3888
+ updated_at: string;
3889
+ }
3842
3890
  export interface SubscriptionObject {
3843
3891
  /**
3844
3892
  * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription's record within the Lago system
@@ -3862,6 +3910,11 @@ export interface SubscriptionObject {
3862
3910
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
3863
3911
  */
3864
3912
  external_customer_id: string;
3913
+ /**
3914
+ * The code of the billing entity associated with the subscription.
3915
+ * @example "default"
3916
+ */
3917
+ billing_entity_code?: string;
3865
3918
  /**
3866
3919
  * The billing time for the subscription, which can be set as either `anniversary` or `calendar`. If not explicitly provided, it will default to `calendar`. The billing time determines the timing of recurring billing cycles for the subscription. By specifying `anniversary`, the billing cycle will be based on the specific date the subscription started (billed fully), while `calendar` sets the billing cycle at the first day of the week/month/year (billed with proration).
3867
3920
  * @example "anniversary"
@@ -3890,12 +3943,13 @@ export interface SubscriptionObject {
3890
3943
  /**
3891
3944
  * The status of the subscription, which can have the following values:
3892
3945
  * - `active`: the subscription is currently active and applied to the customer.
3893
- * - `canceled`: the subscription has been stopped before its activation. This can occur when two consecutive downgrades have been applied to a customer or when a subscription with a pending status is terminated.
3946
+ * - `canceled`: the subscription has been stopped before its activation. This can occur when two consecutive downgrades have been applied to a customer, when a subscription with a pending status is terminated, or when a payment-gated subscription fails to be paid (or its activation rule expires) before activation. When caused by payment gating, the `cancellation_reason` field is set.
3947
+ * - `incomplete`: the subscription was created with a payment activation rule and is waiting for the gating payment to succeed before it becomes `active`. It is automatically `canceled` if the payment fails or the activation rule expires.
3894
3948
  * - `pending`: a previous subscription has been downgraded, and the current one is awaiting automatic activation at the end of the billing period.
3895
3949
  * - `terminated`: the subscription is no longer active.
3896
3950
  * @example "active"
3897
3951
  */
3898
- status: "active" | "canceled" | "pending" | "terminated";
3952
+ status: "active" | "canceled" | "incomplete" | "pending" | "terminated";
3899
3953
  /**
3900
3954
  * The creation date of the subscription, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). This date provides a timestamp indicating when the subscription was initially created.
3901
3955
  * @format date-time
@@ -4002,6 +4056,22 @@ export interface SubscriptionObject {
4002
4056
  * @example true
4003
4057
  */
4004
4058
  consolidate_invoice?: boolean;
4059
+ /**
4060
+ * The reason a payment-gated subscription was canceled before activation. Null unless the subscription was canceled by payment gating.
4061
+ *
4062
+ * - `payment_failed`: the gating payment failed.
4063
+ * - `timeout`: the activation rule expired before the payment succeeded.
4064
+ * @example "payment_failed"
4065
+ */
4066
+ cancellation_reason?: "payment_failed" | "timeout";
4067
+ /**
4068
+ * The date and time when a payment-gated subscription was activated (i.e. moved from `incomplete` to `active` once the gating payment succeeded), represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). Null while the subscription is still `incomplete`.
4069
+ * @format date-time
4070
+ * @example "2022-08-08T00:00:00Z"
4071
+ */
4072
+ activated_at?: string | null;
4073
+ /** The activation rules attached to the subscription. A payment activation rule gates activation on a successful first payment, keeping the subscription in the `incomplete` state until the payment succeeds or the rule expires. */
4074
+ activation_rules?: SubscriptionActivationRuleObject[];
4005
4075
  }
4006
4076
  export interface SubscriptionsPaginated {
4007
4077
  subscriptions: SubscriptionObject[];
@@ -4053,6 +4123,11 @@ export interface WalletRecurringTransactionRule {
4053
4123
  * @example "10.0"
4054
4124
  */
4055
4125
  granted_credits: string;
4126
+ /**
4127
+ * Applies only to `target` rules. When `true`, the recurring top-up grants free credits to reach the target ongoing balance instead of creating a paid top-up (and bypasses the paid top-up minimum). When `false`, the gap is filled with a paid top-up. `null` for `fixed` rules. Defaults to `false` for target rules when omitted.
4128
+ * @example false
4129
+ */
4130
+ grants_target_top_up: boolean | null;
4056
4131
  /**
4057
4132
  * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4058
4133
  * @format date-time
@@ -4125,6 +4200,11 @@ export interface WalletObject {
4125
4200
  * @example "hooli_1234"
4126
4201
  */
4127
4202
  external_customer_id: string;
4203
+ /**
4204
+ * The code of the billing entity associated with the wallet.
4205
+ * @example "default"
4206
+ */
4207
+ billing_entity_code?: string;
4128
4208
  /**
4129
4209
  * The status of the wallet. Possible values are `active` or `terminated`.
4130
4210
  * @example "active"
@@ -4331,6 +4411,11 @@ export interface WalletCreateInput {
4331
4411
  * @example "hooli_1234"
4332
4412
  */
4333
4413
  external_customer_id: string;
4414
+ /**
4415
+ * The code of the billing entity associated with the wallet. If not provided, the customer's billing entity is used.
4416
+ * @example "default"
4417
+ */
4418
+ billing_entity_code?: string;
4334
4419
  /**
4335
4420
  * The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
4336
4421
  * @format date-time
@@ -4423,6 +4508,11 @@ export interface WalletUpdateInput {
4423
4508
  * @example false
4424
4509
  */
4425
4510
  invoice_requires_successful_payment?: boolean;
4511
+ /**
4512
+ * The code of the billing entity associated with the wallet.
4513
+ * @example "default"
4514
+ */
4515
+ billing_entity_code?: string;
4426
4516
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
4427
4517
  invoice_custom_section?: InvoiceCustomSectionInput;
4428
4518
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
@@ -4466,6 +4556,11 @@ export interface WalletUpdateInput {
4466
4556
  * @example "10.0"
4467
4557
  */
4468
4558
  granted_credits?: string | null;
4559
+ /**
4560
+ * Applies only to `target` rules. When `true`, the recurring top-up grants free credits to reach the target ongoing balance instead of creating a paid top-up (and bypasses the paid top-up minimum). When `false`, the gap is filled with a paid top-up. `null` for `fixed` rules. Defaults to `false` for target rules when omitted.
4561
+ * @example false
4562
+ */
4563
+ grants_target_top_up?: boolean | null;
4469
4564
  /**
4470
4565
  * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4471
4566
  * @format date-time
@@ -5231,8 +5326,7 @@ export interface PaymentMethod {
5231
5326
  }
5232
5327
  export interface EventObject {
5233
5328
  /**
5234
- * Unique identifier assigned to the event within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the event's record within the Lago system
5235
- * @format uuid
5329
+ * Unique identifier assigned to the event within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the event's record within the Lago system. It is an opaque identifier and is not guaranteed to be a UUID; on organizations using the ClickHouse events store it is a composite string.
5236
5330
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5237
5331
  */
5238
5332
  lago_id?: string | null;
@@ -5608,6 +5702,11 @@ export interface InvoiceOneOffCreateInput {
5608
5702
  * @example "hooli_1234"
5609
5703
  */
5610
5704
  external_customer_id: string;
5705
+ /**
5706
+ * The code of the billing entity to issue the invoice from. If not provided, the customer's billing entity is used.
5707
+ * @example "default"
5708
+ */
5709
+ billing_entity_code?: string;
5611
5710
  /**
5612
5711
  * The currency of the invoice.
5613
5712
  * @example "EUR"
@@ -6319,8 +6418,8 @@ export interface MinimumCommitmentObject {
6319
6418
  export type ChargeModelEnum = "dynamic" | "graduated" | "graduated_percentage" | "package" | "percentage" | "standard" | "volume";
6320
6419
  export interface ChargeProperties {
6321
6420
  /**
6421
+ * **Deprecated.** Replaced by `pricing_group_keys`.
6322
6422
  * The list of event properties that are used to group the events on the invoice for a `standard` charge model.
6323
- * **DEPRECATED** Replaced by `pricing_group_keys`.
6324
6423
  * @deprecated
6325
6424
  * @example ["agent_name"]
6326
6425
  */
@@ -6725,6 +6824,8 @@ export interface FixedChargeObject {
6725
6824
  properties: FixedChargeProperties;
6726
6825
  /**
6727
6826
  * The number of units for the fixed charge.
6827
+ *
6828
+ * When retrieved through a subscription-scoped endpoint (e.g. `GET /subscriptions/{external_id}/fixed_charges`), this reflects the per-subscription unit override when one exists, and falls back to the plan-level units otherwise. Plan-scoped endpoints always return the plan-level units.
6728
6829
  * @example 1
6729
6830
  */
6730
6831
  units: number;
@@ -7776,7 +7877,7 @@ export interface PlanOverridesObject {
7776
7877
  conversion_rate?: string;
7777
7878
  };
7778
7879
  }[];
7779
- /** Additional fixed charges for this plan. */
7880
+ /** Fixed charge overrides for the subscription. When `plan_overrides` contains only `fixed_charges` and every entry contains only `id`, `units`, and optionally `apply_units_immediately`, the units are recorded as a per-subscription override without creating a plan override, and subscription-scoped reads return these units. If any entry carries other fields, or `plan_overrides` contains any other key, the request is applied as a full plan override for the subscription instead. */
7780
7881
  fixed_charges?: {
7781
7882
  /**
7782
7883
  * Unique identifier of the fixed charge created by Lago.
@@ -7810,6 +7911,18 @@ export interface PlanOverridesObject {
7810
7911
  /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
7811
7912
  metadata?: MetadataInput;
7812
7913
  }
7914
+ export interface SubscriptionActivationRuleInput {
7915
+ /**
7916
+ * The type of the activation rule. Only `payment` is currently supported. A `payment` rule gates the subscription activation on a successful payment of the first invoice.
7917
+ * @example "payment"
7918
+ */
7919
+ type: "payment";
7920
+ /**
7921
+ * The number of hours the subscription stays in the `incomplete` state waiting for the payment to succeed before it is automatically canceled. Must be a positive integer or zero.
7922
+ * @example 48
7923
+ */
7924
+ timeout_hours?: number;
7925
+ }
7813
7926
  export interface SubscriptionCreateInput {
7814
7927
  /**
7815
7928
  * Optionally, you can create a pre-authorization on the customer's card before creating a subscription. This process places a temporary hold (capture) for a specified amount on the customer's account, but does not actually withdraw the funds.
@@ -7875,7 +7988,7 @@ export interface SubscriptionCreateInput {
7875
7988
  * @example "2022-08-08T00:00:00Z"
7876
7989
  */
7877
7990
  subscription_at?: string;
7878
- /** Based plan overrides. */
7991
+ /** Overrides applied to the plan for this subscription. A units-only `fixed_charges` override is recorded as a per-subscription unit override without creating a plan override; any other override creates a plan override for the subscription. See `fixed_charges` for the exact rule. */
7879
7992
  plan_overrides?: PlanOverridesObject;
7880
7993
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
7881
7994
  invoice_custom_section?: InvoiceCustomSectionInput;
@@ -7890,6 +8003,8 @@ export interface SubscriptionCreateInput {
7890
8003
  * @example true
7891
8004
  */
7892
8005
  consolidate_invoice?: boolean;
8006
+ /** Optional list of activation rules that gate the subscription activation. When a `payment` rule is provided and the plan is paid in advance (and the subscription is not in a trial), the subscription is created in the `incomplete` state and is only activated once the gating payment succeeds. If the payment fails or the rule's `timeout_hours` elapses, the subscription is canceled. */
8007
+ activation_rules?: SubscriptionActivationRuleInput[];
7893
8008
  };
7894
8009
  }
7895
8010
  export interface ApplicableUsageThreshold {
@@ -7941,7 +8056,7 @@ export interface SubscriptionUpdateInput {
7941
8056
  * @example "2022-08-08T00:00:00Z"
7942
8057
  */
7943
8058
  subscription_at?: string;
7944
- /** Based plan overrides. */
8059
+ /** Overrides applied to the plan for this subscription. A units-only `fixed_charges` override is recorded as a per-subscription unit override without creating a plan override; any other override creates a plan override for the subscription. See `fixed_charges` for the exact rule. */
7945
8060
  plan_overrides?: PlanOverridesObject;
7946
8061
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
7947
8062
  invoice_custom_section?: InvoiceCustomSectionInput;
@@ -7955,6 +8070,13 @@ export interface SubscriptionUpdateInput {
7955
8070
  * @example false
7956
8071
  */
7957
8072
  consolidate_invoice?: boolean;
8073
+ /**
8074
+ * The code of the billing entity associated with the subscription. Updates take effect on future invoices only.
8075
+ * @example "default"
8076
+ */
8077
+ billing_entity_code?: string;
8078
+ /** Optional list of activation rules that gate the subscription activation. Activation rules can only be set or modified while the subscription is `pending` (future-dated and not yet activated); the request is rejected for `incomplete`, `active`, or `terminated` subscriptions. */
8079
+ activation_rules?: SubscriptionActivationRuleInput[];
7958
8080
  };
7959
8081
  }
7960
8082
  export interface Subscription {
@@ -8237,7 +8359,7 @@ export interface TaxBaseInput {
8237
8359
  */
8238
8360
  description?: string | null;
8239
8361
  /**
8240
- * 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.
8362
+ * **Deprecated.** This field 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.
8241
8363
  * @deprecated
8242
8364
  * @example true
8243
8365
  */
@@ -8528,6 +8650,16 @@ export type WalletTransactionFundingsPaginated = WalletTransactionFundings & {
8528
8650
  export type WalletTransactionsPaginated = WalletTransactions & {
8529
8651
  meta: PaginationMeta;
8530
8652
  };
8653
+ export interface WebhookPublicKeyObject {
8654
+ /**
8655
+ * Base64-encoded public key used to verify webhook signatures.
8656
+ * @example "MEgCQQCo9+BpMRYQ/dL3DS2CyJxRF+j6ctbT3/Qp84+KeFhnii7NT7fELilKUSnxS30WAvQCCo2yU1orfgqr41mM70MBAgMBAAE="
8657
+ */
8658
+ public_key: string;
8659
+ }
8660
+ export interface WebhookPublicKey {
8661
+ webhook: WebhookPublicKeyObject;
8662
+ }
8531
8663
  export interface WebhookEndpointObject {
8532
8664
  /**
8533
8665
  * Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the webhook endpoint's record within the Lago system.
@@ -8783,6 +8915,18 @@ export interface CreditNotePaymentProviderRefundError {
8783
8915
  payment_provider_code?: string;
8784
8916
  provider_error?: string | Record<string, any>;
8785
8917
  }
8918
+ export interface OverdueBalancePerCurrencyObject {
8919
+ /**
8920
+ * The amount of the overdue balance for this currency, expressed in cents.
8921
+ * @example 120
8922
+ */
8923
+ amount_cents: number;
8924
+ /**
8925
+ * The currency of the overdue balance.
8926
+ * @example "EUR"
8927
+ */
8928
+ currency: Currency;
8929
+ }
8786
8930
  export interface DunningCampaignFinishedObject {
8787
8931
  /**
8788
8932
  * The customer external unique identifier (provided by your own application).
@@ -8804,6 +8948,8 @@ export interface DunningCampaignFinishedObject {
8804
8948
  * @example "EUR"
8805
8949
  */
8806
8950
  overdue_balance_currency: Currency;
8951
+ /** Overdue balance broken down per currency. */
8952
+ overdue_balances?: OverdueBalancePerCurrencyObject[];
8807
8953
  }
8808
8954
  export interface EventErrorsObject {
8809
8955
  /**
@@ -8835,7 +8981,10 @@ export interface EventsErrorsObject {
8835
8981
  * @example ["transaction_1234567890"]
8836
8982
  */
8837
8983
  invalid_filter_values: string[];
8838
- /** @deprecated */
8984
+ /**
8985
+ * **Deprecated.** List of event transaction_id with a missing group key.
8986
+ * @deprecated
8987
+ */
8839
8988
  missing_group_key: string[];
8840
8989
  }
8841
8990
  export interface FeeTaxProviderErrorObject {
@@ -9093,7 +9242,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
9093
9242
  }
9094
9243
  /**
9095
9244
  * @title Lago API documentation
9096
- * @version 1.48.0
9245
+ * @version 1.50.0
9097
9246
  * @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
9098
9247
  * @baseUrl https://api.getlago.com/api/v1
9099
9248
  * @externalDocs https://github.com/getlago
@@ -10306,6 +10455,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10306
10455
  * @example "pending"
10307
10456
  */
10308
10457
  payment_status?: "pending" | "failed" | "succeeded";
10458
+ /**
10459
+ * Filter payment requests by billing entity codes.
10460
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
10461
+ */
10462
+ "billing_entity_codes[]"?: string[];
10309
10463
  }, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
10310
10464
  /**
10311
10465
  * @description Retrieves an embeddable link for displaying a customer portal. This endpoint allows you to fetch the URL that can be embedded to provide customers access to a dedicated portal
@@ -10355,6 +10509,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10355
10509
  * @example ["active","pending"]
10356
10510
  */
10357
10511
  "status[]"?: ("pending" | "canceled" | "terminated" | "active")[];
10512
+ /**
10513
+ * Filter subscriptions by billing entity codes.
10514
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
10515
+ */
10516
+ "billing_entity_codes[]"?: string[];
10358
10517
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
10359
10518
  /**
10360
10519
  * @description This endpoint is used to create a wallet with prepaid credits.
@@ -10386,6 +10545,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10386
10545
  * @example 20
10387
10546
  */
10388
10547
  per_page?: number;
10548
+ /**
10549
+ * Filter wallets by billing entity codes.
10550
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
10551
+ */
10552
+ "billing_entity_codes[]"?: string[];
10389
10553
  }, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
10390
10554
  /**
10391
10555
  * @description This endpoint is used to update an existing wallet with prepaid credits.
@@ -10560,20 +10724,20 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10560
10724
  */
10561
10725
  group?: Record<string, string>;
10562
10726
  /**
10563
- * Filter usage to a specific charge by its Lago ID (UUID).
10727
+ * **Deprecated.** Filter usage to a specific charge by its Lago ID (UUID).
10564
10728
  * @deprecated
10565
10729
  * @format uuid
10566
10730
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
10567
10731
  */
10568
10732
  filter_by_charge_id?: string;
10569
10733
  /**
10570
- * Filter usage to a specific charge by its code.
10734
+ * **Deprecated.** Filter usage to a specific charge by its code.
10571
10735
  * @deprecated
10572
10736
  * @example "storage"
10573
10737
  */
10574
10738
  filter_by_charge_code?: string;
10575
10739
  /**
10576
- * Filter usage by pricing group. Pass key/value pairs as query parameters, e.g. `filter_by_group[cloud]=aws`.
10740
+ * **Deprecated.** Filter usage by pricing group. Pass key/value pairs as query parameters, e.g. `filter_by_group[cloud]=aws`.
10577
10741
  * @deprecated
10578
10742
  * @example {"cloud":"aws"}
10579
10743
  */
@@ -11240,6 +11404,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11240
11404
  * @example 20
11241
11405
  */
11242
11406
  per_page?: number;
11407
+ /**
11408
+ * Filter the results by currency, expressed as an ISO 4217 code.
11409
+ * @example "EUR"
11410
+ */
11411
+ currency?: string;
11243
11412
  /**
11244
11413
  * Unique identifier assigned to the customer in your application.
11245
11414
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
@@ -11250,6 +11419,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11250
11419
  * @example "pending"
11251
11420
  */
11252
11421
  payment_status?: "pending" | "failed" | "succeeded";
11422
+ /**
11423
+ * Filter payment requests by billing entity codes.
11424
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
11425
+ */
11426
+ "billing_entity_codes[]"?: string[];
11253
11427
  }, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized>>;
11254
11428
  /**
11255
11429
  * @description This endpoint retrieves a specific payment request by its ID.
@@ -11693,6 +11867,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11693
11867
  * @example 20
11694
11868
  */
11695
11869
  per_page?: number;
11870
+ /**
11871
+ * Filter the results by currency, expressed as an ISO 4217 code.
11872
+ * @example "EUR"
11873
+ */
11874
+ currency?: string;
11696
11875
  /**
11697
11876
  * The customer external unique identifier (provided by your own application)
11698
11877
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
@@ -11708,6 +11887,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11708
11887
  * @example ["active","pending"]
11709
11888
  */
11710
11889
  "status[]"?: ("active" | "canceled" | "pending" | "terminated")[];
11890
+ /**
11891
+ * Filter subscriptions by billing entity codes.
11892
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
11893
+ */
11894
+ "billing_entity_codes[]"?: string[];
11711
11895
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized>>;
11712
11896
  /**
11713
11897
  * @description This endpoint retrieves a specific subscription.
@@ -11973,7 +12157,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11973
12157
  subscription_status?: "pending" | "active" | "terminated" | "canceled";
11974
12158
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorBadRequest | ApiErrorNotFound>>;
11975
12159
  /**
11976
- * @description This endpoint retrieves all effective fixed charges for a specific subscription. If the subscription has plan overrides with fixed charge overrides, the overridden fixed charges are returned.
12160
+ * @description This endpoint retrieves all effective fixed charges for a specific subscription. The `units` of each fixed charge reflect any per-subscription unit override applied to the subscription; when no override exists, the plan-level units are returned.
11977
12161
  *
11978
12162
  * @tags subscriptions
11979
12163
  * @name FindAllSubscriptionFixedCharges
@@ -12156,7 +12340,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12156
12340
  subscription_status?: "pending" | "active" | "terminated" | "canceled";
12157
12341
  }, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
12158
12342
  /**
12159
- * @description This endpoint retrieves a specific effective fixed charge for a subscription. If the subscription has a plan override with a fixed charge override, the overridden fixed charge is returned.
12343
+ * @description This endpoint retrieves a specific effective fixed charge for a subscription. The `units` reflect any per-subscription unit override applied to the subscription; when no override exists, the plan-level units are returned.
12160
12344
  *
12161
12345
  * @tags subscriptions
12162
12346
  * @name FindSubscriptionFixedCharge
@@ -12173,7 +12357,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12173
12357
  subscription_status?: "pending" | "active" | "terminated" | "canceled";
12174
12358
  }, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorNotFound>>;
12175
12359
  /**
12176
- * @description This endpoint creates or updates a fixed charge override for a specific subscription. If the subscription does not have a plan override yet, one will be created automatically. The fixed charge override allows customizing specific fixed charge properties (invoice_display_name, units, properties, taxes) without affecting the original plan fixed charge. This is a premium feature.
12360
+ * @description This endpoint creates or updates a fixed charge override for a subscription, without affecting the original plan fixed charge. When the body contains only `units` (and optionally `apply_units_immediately`), the change is recorded as a per-subscription unit override. When the body also sets `invoice_display_name`, `properties`, or `tax_codes`, it is applied as a full plan override for the subscription instead. With `apply_units_immediately: true` on a pay-in-advance fixed charge the change is billed mid-period; otherwise it takes effect at the next billing period. This is a premium feature.
12177
12361
  *
12178
12362
  * @tags subscriptions
12179
12363
  * @name OverrideSubscriptionFixedCharge
@@ -12284,11 +12468,21 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12284
12468
  * @example 20
12285
12469
  */
12286
12470
  per_page?: number;
12471
+ /**
12472
+ * Filter the results by currency, expressed as an ISO 4217 code.
12473
+ * @example "EUR"
12474
+ */
12475
+ currency?: string;
12287
12476
  /**
12288
12477
  * The customer external unique identifier (provided by your own application).
12289
12478
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
12290
12479
  */
12291
12480
  external_customer_id: string;
12481
+ /**
12482
+ * Filter wallets by billing entity codes.
12483
+ * @example ["billing_entity_code_1","billing_entity_code_2"]
12484
+ */
12485
+ "billing_entity_codes[]"?: string[];
12292
12486
  }, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden>>;
12293
12487
  /**
12294
12488
  * @description This endpoint is used to update an existing wallet with prepaid credits.
@@ -12479,9 +12673,20 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12479
12673
  * @name FetchPublicKey
12480
12674
  * @summary Retrieve webhook public key
12481
12675
  * @request GET:/webhooks/public_key
12676
+ * @deprecated
12482
12677
  * @secure
12483
12678
  */
12484
12679
  fetchPublicKey: (params?: RequestParams) => Promise<HttpResponse<string, ApiErrorUnauthorized>>;
12680
+ /**
12681
+ * @description This endpoint is used to retrieve the public key used to verify the webhooks signature, wrapped in a JSON object. Prefer this endpoint over the deprecated GET /webhooks/public_key.
12682
+ *
12683
+ * @tags webhooks
12684
+ * @name FetchJsonPublicKey
12685
+ * @summary Retrieve webhook public key (JSON)
12686
+ * @request GET:/webhooks/json_public_key
12687
+ * @secure
12688
+ */
12689
+ fetchJsonPublicKey: (params?: RequestParams) => Promise<HttpResponse<WebhookPublicKey, ApiErrorUnauthorized>>;
12485
12690
  };
12486
12691
  webhookEndpoints: {
12487
12692
  /**
@@ -128,6 +128,14 @@ export class HttpClient {
128
128
  if (r.ok) {
129
129
  r.data = data;
130
130
  }
131
+ else if (responseFormat === "text") {
132
+ try {
133
+ r.error = JSON.parse(data);
134
+ }
135
+ catch {
136
+ r.error = data;
137
+ }
138
+ }
131
139
  else {
132
140
  r.error = data;
133
141
  }
@@ -148,7 +156,7 @@ export class HttpClient {
148
156
  }
149
157
  /**
150
158
  * @title Lago API documentation
151
- * @version 1.48.0
159
+ * @version 1.50.0
152
160
  * @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
153
161
  * @baseUrl https://api.getlago.com/api/v1
154
162
  * @externalDocs https://github.com/getlago
@@ -2970,7 +2978,7 @@ export class Api extends HttpClient {
2970
2978
  ...params,
2971
2979
  }),
2972
2980
  /**
2973
- * @description This endpoint retrieves all effective fixed charges for a specific subscription. If the subscription has plan overrides with fixed charge overrides, the overridden fixed charges are returned.
2981
+ * @description This endpoint retrieves all effective fixed charges for a specific subscription. The `units` of each fixed charge reflect any per-subscription unit override applied to the subscription; when no override exists, the plan-level units are returned.
2974
2982
  *
2975
2983
  * @tags subscriptions
2976
2984
  * @name FindAllSubscriptionFixedCharges
@@ -3129,7 +3137,7 @@ export class Api extends HttpClient {
3129
3137
  ...params,
3130
3138
  }),
3131
3139
  /**
3132
- * @description This endpoint retrieves a specific effective fixed charge for a subscription. If the subscription has a plan override with a fixed charge override, the overridden fixed charge is returned.
3140
+ * @description This endpoint retrieves a specific effective fixed charge for a subscription. The `units` reflect any per-subscription unit override applied to the subscription; when no override exists, the plan-level units are returned.
3133
3141
  *
3134
3142
  * @tags subscriptions
3135
3143
  * @name FindSubscriptionFixedCharge
@@ -3146,7 +3154,7 @@ export class Api extends HttpClient {
3146
3154
  ...params,
3147
3155
  }),
3148
3156
  /**
3149
- * @description This endpoint creates or updates a fixed charge override for a specific subscription. If the subscription does not have a plan override yet, one will be created automatically. The fixed charge override allows customizing specific fixed charge properties (invoice_display_name, units, properties, taxes) without affecting the original plan fixed charge. This is a premium feature.
3157
+ * @description This endpoint creates or updates a fixed charge override for a subscription, without affecting the original plan fixed charge. When the body contains only `units` (and optionally `apply_units_immediately`), the change is recorded as a per-subscription unit override. When the body also sets `invoice_display_name`, `properties`, or `tax_codes`, it is applied as a full plan override for the subscription instead. With `apply_units_immediately: true` on a pay-in-advance fixed charge the change is billed mid-period; otherwise it takes effect at the next billing period. This is a premium feature.
3150
3158
  *
3151
3159
  * @tags subscriptions
3152
3160
  * @name OverrideSubscriptionFixedCharge
@@ -3518,12 +3526,30 @@ export class Api extends HttpClient {
3518
3526
  * @name FetchPublicKey
3519
3527
  * @summary Retrieve webhook public key
3520
3528
  * @request GET:/webhooks/public_key
3529
+ * @deprecated
3521
3530
  * @secure
3522
3531
  */
3523
3532
  fetchPublicKey: (params = {}) => this.request({
3524
3533
  path: `/webhooks/public_key`,
3525
3534
  method: "GET",
3526
3535
  secure: true,
3536
+ format: "text",
3537
+ ...params,
3538
+ }),
3539
+ /**
3540
+ * @description This endpoint is used to retrieve the public key used to verify the webhooks signature, wrapped in a JSON object. Prefer this endpoint over the deprecated GET /webhooks/public_key.
3541
+ *
3542
+ * @tags webhooks
3543
+ * @name FetchJsonPublicKey
3544
+ * @summary Retrieve webhook public key (JSON)
3545
+ * @request GET:/webhooks/json_public_key
3546
+ * @secure
3547
+ */
3548
+ fetchJsonPublicKey: (params = {}) => this.request({
3549
+ path: `/webhooks/json_public_key`,
3550
+ method: "GET",
3551
+ secure: true,
3552
+ format: "json",
3527
3553
  ...params,
3528
3554
  }),
3529
3555
  };