lago-javascript-client 1.49.0 → 1.52.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.
@@ -1488,7 +1488,11 @@ export interface paths {
1488
1488
  */
1489
1489
  put: operations["updateInvoice"];
1490
1490
  post?: never;
1491
- delete?: never;
1491
+ /**
1492
+ * Delete a draft invoice
1493
+ * @description This endpoint is used for permanently deleting a `draft` invoice. Deleting a draft invoice removes it entirely: it never becomes accounts receivable, consumes no invoice number, and disappears from every list, export, and analytics surface. Only invoices in the `draft` status can be deleted; for a `finalized` invoice, void it instead.
1494
+ */
1495
+ delete: operations["deleteInvoice"];
1492
1496
  options?: never;
1493
1497
  head?: never;
1494
1498
  patch?: never;
@@ -2904,6 +2908,7 @@ export interface paths {
2904
2908
  };
2905
2909
  /**
2906
2910
  * Retrieve webhook public key
2911
+ * @deprecated
2907
2912
  * @description This endpoint is used to retrieve the public key used to verify the webhooks signature
2908
2913
  */
2909
2914
  get: operations["fetchPublicKey"];
@@ -2915,6 +2920,26 @@ export interface paths {
2915
2920
  patch?: never;
2916
2921
  trace?: never;
2917
2922
  };
2923
+ "/webhooks/json_public_key": {
2924
+ parameters: {
2925
+ query?: never;
2926
+ header?: never;
2927
+ path?: never;
2928
+ cookie?: never;
2929
+ };
2930
+ /**
2931
+ * Retrieve webhook public key (JSON)
2932
+ * @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.
2933
+ */
2934
+ get: operations["fetchJsonPublicKey"];
2935
+ put?: never;
2936
+ post?: never;
2937
+ delete?: never;
2938
+ options?: never;
2939
+ head?: never;
2940
+ patch?: never;
2941
+ trace?: never;
2942
+ };
2918
2943
  "/webhook_endpoints": {
2919
2944
  parameters: {
2920
2945
  query?: never;
@@ -3613,6 +3638,26 @@ export interface webhooks {
3613
3638
  patch?: never;
3614
3639
  trace?: never;
3615
3640
  };
3641
+ invoice_ready_to_finalize: {
3642
+ parameters: {
3643
+ query?: never;
3644
+ header?: never;
3645
+ path?: never;
3646
+ cookie?: never;
3647
+ };
3648
+ get?: never;
3649
+ put?: never;
3650
+ /**
3651
+ * A draft invoice is ready to be finalized
3652
+ * @description A draft invoice is ready to be finalized (taxes are resolved). Sent when the draft invoice is created if no tax provider call is pending, or once the tax provider has returned taxes for the draft invoice.
3653
+ */
3654
+ post: operations["invoiceReadyToFinalize"];
3655
+ delete?: never;
3656
+ options?: never;
3657
+ head?: never;
3658
+ patch?: never;
3659
+ trace?: never;
3660
+ };
3616
3661
  invoice_voided: {
3617
3662
  parameters: {
3618
3663
  query?: never;
@@ -3633,6 +3678,26 @@ export interface webhooks {
3633
3678
  patch?: never;
3634
3679
  trace?: never;
3635
3680
  };
3681
+ invoice_deleted: {
3682
+ parameters: {
3683
+ query?: never;
3684
+ header?: never;
3685
+ path?: never;
3686
+ cookie?: never;
3687
+ };
3688
+ get?: never;
3689
+ put?: never;
3690
+ /**
3691
+ * A draft invoice has been deleted
3692
+ * @description A draft invoice has been deleted
3693
+ */
3694
+ post: operations["invoiceDeleted"];
3695
+ delete?: never;
3696
+ options?: never;
3697
+ head?: never;
3698
+ patch?: never;
3699
+ trace?: never;
3700
+ };
3636
3701
  invoice_payment_dispute_lost: {
3637
3702
  parameters: {
3638
3703
  query?: never;
@@ -3953,6 +4018,46 @@ export interface webhooks {
3953
4018
  patch?: never;
3954
4019
  trace?: never;
3955
4020
  };
4021
+ subscription_incomplete: {
4022
+ parameters: {
4023
+ query?: never;
4024
+ header?: never;
4025
+ path?: never;
4026
+ cookie?: never;
4027
+ };
4028
+ get?: never;
4029
+ put?: never;
4030
+ /**
4031
+ * A subscription is incomplete and waiting for payment
4032
+ * @description A payment-gated subscription has been created in the `incomplete` state and is waiting for the gating payment to succeed before it is activated.
4033
+ */
4034
+ post: operations["subscriptionIncomplete"];
4035
+ delete?: never;
4036
+ options?: never;
4037
+ head?: never;
4038
+ patch?: never;
4039
+ trace?: never;
4040
+ };
4041
+ subscription_canceled: {
4042
+ parameters: {
4043
+ query?: never;
4044
+ header?: never;
4045
+ path?: never;
4046
+ cookie?: never;
4047
+ };
4048
+ get?: never;
4049
+ put?: never;
4050
+ /**
4051
+ * A subscription has been canceled
4052
+ * @description A subscription has been canceled before its activation. For payment-gated subscriptions this happens when the gating payment fails or the activation rule expires, in which case the `cancellation_reason` field is set.
4053
+ */
4054
+ post: operations["subscriptionCanceled"];
4055
+ delete?: never;
4056
+ options?: never;
4057
+ head?: never;
4058
+ patch?: never;
4059
+ trace?: never;
4060
+ };
3956
4061
  subscription_started: {
3957
4062
  parameters: {
3958
4063
  query?: never;
@@ -4515,7 +4620,7 @@ export interface components {
4515
4620
  rate: number;
4516
4621
  /**
4517
4622
  * @deprecated
4518
- * @description 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.
4623
+ * @description **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.
4519
4624
  * @example true
4520
4625
  */
4521
4626
  applied_to_organization: boolean;
@@ -4560,7 +4665,7 @@ export interface components {
4560
4665
  display_name?: string;
4561
4666
  /**
4562
4667
  * @deprecated
4563
- * @description 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.
4668
+ * @description **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.
4564
4669
  * @example true
4565
4670
  */
4566
4671
  applied_to_organization?: boolean;
@@ -6927,6 +7032,55 @@ export interface components {
6927
7032
  shipping_address?: components["schemas"]["Address"];
6928
7033
  metadata?: components["schemas"]["CustomerMetadata"][];
6929
7034
  };
7035
+ /** @description Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
7036
+ IntegrationCustomer: {
7037
+ /**
7038
+ * Format: uuid
7039
+ * @description A unique identifier for the integration customer object in the Lago application.
7040
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
7041
+ */
7042
+ lago_id: string;
7043
+ /**
7044
+ * @description The integration type used for accounting and tax syncs.
7045
+ * Accepted values: `netsuite, anrok`.
7046
+ * @example netsuite
7047
+ * @enum {string}
7048
+ */
7049
+ type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
7050
+ /**
7051
+ * @description Unique code used to identify an integration connection.
7052
+ * @example netsuite-eu-1
7053
+ */
7054
+ integration_code: string;
7055
+ /**
7056
+ * @description The customer ID within the integration's system. If this field is not provided, Lago has the option to create a new customer record within the integration's system on behalf of the customer.
7057
+ * @example cus_12345
7058
+ */
7059
+ external_customer_id: string;
7060
+ /**
7061
+ * @description Set this field to `true` if you want to create a customer record in the integration's system. This option is applicable only when the `external_customer_id` is null and the `sync_with_provider` field is set to `true`. By default, the value is set to `false`
7062
+ * @example true
7063
+ */
7064
+ sync_with_provider?: boolean | null;
7065
+ /**
7066
+ * @description This optional field is needed only when working with `netsuite` connection.
7067
+ * @example 2
7068
+ */
7069
+ subsidiary_id?: string;
7070
+ /**
7071
+ * @description This optional field is present only when working with `hubspot` connection.
7072
+ * @example contacts
7073
+ */
7074
+ targeted_object?: string | null;
7075
+ /**
7076
+ * @description This optional field is present only when working with `hubspot` connection.
7077
+ * @example dinesh@piedpiper.test
7078
+ */
7079
+ email?: string | null;
7080
+ };
7081
+ CustomerObject: components["schemas"]["CustomerBaseObject"] & {
7082
+ integration_customers?: components["schemas"]["IntegrationCustomer"][];
7083
+ };
6930
7084
  /**
6931
7085
  * @description Custom metadata stored as key-value pairs.
6932
7086
  * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
@@ -6988,6 +7142,11 @@ export interface components {
6988
7142
  * @example LAG-1234
6989
7143
  */
6990
7144
  invoice_number: string;
7145
+ /**
7146
+ * @description The purchase order number of the invoice the credit note belongs to.
7147
+ * @example PO-123
7148
+ */
7149
+ purchase_order_number?: string | null;
6991
7150
  /**
6992
7151
  * Format: date
6993
7152
  * @description The date of creation of the credit note. It follows the ISO 8601 date format and provides the specific date when the credit note was created.
@@ -7101,7 +7260,7 @@ export interface components {
7101
7260
  * @example false
7102
7261
  */
7103
7262
  self_billed?: boolean;
7104
- customer?: components["schemas"]["CustomerBaseObject"];
7263
+ customer?: components["schemas"]["CustomerObject"];
7105
7264
  metadata?: components["schemas"]["MetadataObject"];
7106
7265
  error_details?: components["schemas"]["CreditNoteErrorDetailsObject"][] | null;
7107
7266
  };
@@ -7188,7 +7347,7 @@ export interface components {
7188
7347
  };
7189
7348
  };
7190
7349
  CreditNoteExtendedObject: components["schemas"]["CreditNoteObject"] & {
7191
- customer?: components["schemas"]["CustomerBaseObject"];
7350
+ customer?: components["schemas"]["CustomerObject"];
7192
7351
  };
7193
7352
  CreditNoteExtended: {
7194
7353
  credit_note: components["schemas"]["CreditNoteExtendedObject"];
@@ -7380,55 +7539,6 @@ export interface components {
7380
7539
  CreditNoteMetadataResponse: {
7381
7540
  metadata: components["schemas"]["MetadataObject"];
7382
7541
  };
7383
- /** @description Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
7384
- IntegrationCustomer: {
7385
- /**
7386
- * Format: uuid
7387
- * @description A unique identifier for the integration customer object in the Lago application.
7388
- * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
7389
- */
7390
- lago_id: string;
7391
- /**
7392
- * @description The integration type used for accounting and tax syncs.
7393
- * Accepted values: `netsuite, anrok`.
7394
- * @example netsuite
7395
- * @enum {string}
7396
- */
7397
- type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
7398
- /**
7399
- * @description Unique code used to identify an integration connection.
7400
- * @example netsuite-eu-1
7401
- */
7402
- integration_code: string;
7403
- /**
7404
- * @description The customer ID within the integration's system. If this field is not provided, Lago has the option to create a new customer record within the integration's system on behalf of the customer.
7405
- * @example cus_12345
7406
- */
7407
- external_customer_id: string;
7408
- /**
7409
- * @description Set this field to `true` if you want to create a customer record in the integration's system. This option is applicable only when the `external_customer_id` is null and the `sync_with_provider` field is set to `true`. By default, the value is set to `false`
7410
- * @example true
7411
- */
7412
- sync_with_provider?: boolean | null;
7413
- /**
7414
- * @description This optional field is needed only when working with `netsuite` connection.
7415
- * @example 2
7416
- */
7417
- subsidiary_id?: string;
7418
- /**
7419
- * @description This optional field is present only when working with `hubspot` connection.
7420
- * @example contacts
7421
- */
7422
- targeted_object?: string | null;
7423
- /**
7424
- * @description This optional field is present only when working with `hubspot` connection.
7425
- * @example dinesh@piedpiper.test
7426
- */
7427
- email?: string | null;
7428
- };
7429
- CustomerObject: components["schemas"]["CustomerBaseObject"] & {
7430
- integration_customers?: components["schemas"]["IntegrationCustomer"][];
7431
- };
7432
7542
  ErrorDetailObject: {
7433
7543
  /**
7434
7544
  * Format: uuid
@@ -7520,7 +7630,7 @@ export interface components {
7520
7630
  */
7521
7631
  logo_url?: string | null;
7522
7632
  /**
7523
- * @description The full name of the customer
7633
+ * @description The full name of the customer (255 characters max).
7524
7634
  * @example Gavin Belson
7525
7635
  */
7526
7636
  name?: string | null;
@@ -7691,6 +7801,11 @@ export interface components {
7691
7801
  * @example LAG-1234-001-002
7692
7802
  */
7693
7803
  number: string;
7804
+ /**
7805
+ * @description The purchase order number associated with the invoice. It is inherited from the subscription, wallet or wallet transaction the invoice was generated for.
7806
+ * @example PO-123
7807
+ */
7808
+ purchase_order_number?: string | null;
7694
7809
  /**
7695
7810
  * Format: date
7696
7811
  * @description The date when the invoice was issued. It is provided in the ISO 8601 date format.
@@ -7732,10 +7847,11 @@ export interface components {
7732
7847
  * - `voided`: the invoice has been issued and subsequently voided. In this state, events cannot be ingested or added to the invoice anymore.
7733
7848
  * - `pending`: the invoice remains pending until the taxes are fetched from the external provider.
7734
7849
  * - `failed`: during an attempt of finalization of the invoice, an error happened. This invoice will have an array of error_details, explaining, in which part of the system an error happened and how it's possible to fix it. This invoice can't be edited or updated, only retried. This action will discard current error_details and will create new ones if the finalization failed again.
7850
+ * - `deleted`: the draft invoice has been permanently deleted. This status is only returned by the delete endpoint and its webhook; a deleted invoice is no longer retrievable afterwards.
7735
7851
  * @example finalized
7736
7852
  * @enum {string}
7737
7853
  */
7738
- status: "draft" | "finalized" | "voided" | "failed" | "pending";
7854
+ status: "draft" | "finalized" | "voided" | "failed" | "pending" | "deleted";
7739
7855
  /**
7740
7856
  * @description The status of the payment associated with the invoice. It can have one of the following values:
7741
7857
  * - `pending`: the payment is pending, waiting for payment processing in Stripe or when the invoice is emitted but users have not updated the payment status through the endpoint.
@@ -7826,6 +7942,12 @@ export interface components {
7826
7942
  * @example https://getlago.com/invoice/file
7827
7943
  */
7828
7944
  file_url?: string;
7945
+ /**
7946
+ * Format: uri
7947
+ * @description Contains the URL to the invoice page in the Lago dashboard. It is `null` for invoices that are not visible in the dashboard (for example while still generating). Use it to link users directly to the invoice overview page.
7948
+ * @example https://app.getlago.com/acme/customer/1a901a90-1a90-1a90-1a90-1a901a901a90/invoice/2b012b01-2b01-2b01-2b01-2b012b012b01/overview
7949
+ */
7950
+ web_url?: string | null;
7829
7951
  /**
7830
7952
  * Format: date-time
7831
7953
  * @description The date of the invoice creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the invoice object was created
@@ -7852,7 +7974,7 @@ export interface components {
7852
7974
  */
7853
7975
  key?: string;
7854
7976
  /**
7855
- * @description Represents the value of the metadata's key-value pair.
7977
+ * @description Represents the value of the metadata's key-value pair (140 characters max).
7856
7978
  * @example INV-0123456-98765
7857
7979
  */
7858
7980
  value?: string;
@@ -8154,7 +8276,7 @@ export interface components {
8154
8276
  /**
8155
8277
  * Format: uuid
8156
8278
  * @deprecated
8157
- * @description Unique identifier of the invoice custom section that was applied.
8279
+ * @description **Deprecated.** Unique identifier of the invoice custom section that was applied.
8158
8280
  * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
8159
8281
  */
8160
8282
  invoice_custom_section_id?: string;
@@ -8175,6 +8297,56 @@ export interface components {
8175
8297
  */
8176
8298
  payment_method_id?: string;
8177
8299
  };
8300
+ SubscriptionActivationRuleObject: {
8301
+ /**
8302
+ * Format: uuid
8303
+ * @description Unique identifier assigned to the activation rule within the Lago application. This ID is exclusively created by Lago.
8304
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
8305
+ */
8306
+ lago_id: string;
8307
+ /**
8308
+ * @description 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.
8309
+ * @example payment
8310
+ * @enum {string}
8311
+ */
8312
+ type: "payment";
8313
+ /**
8314
+ * @description The number of hours the subscription stays in the `incomplete` state waiting for the payment to succeed before it is automatically canceled.
8315
+ * @example 48
8316
+ */
8317
+ timeout_hours: number;
8318
+ /**
8319
+ * @description The evaluation status of the activation rule:
8320
+ * - `inactive`: the rule has not been evaluated yet.
8321
+ * - `pending`: the rule is applicable and is waiting to be satisfied (e.g. waiting for the payment).
8322
+ * - `satisfied`: the rule has been satisfied and no longer blocks activation.
8323
+ * - `declined`: the rule was applicable but was declined.
8324
+ * - `failed`: the rule could not be satisfied (e.g. the payment failed).
8325
+ * - `expired`: the rule was not satisfied before its timeout elapsed.
8326
+ * - `not_applicable`: the rule did not apply to this subscription.
8327
+ * @example pending
8328
+ * @enum {string}
8329
+ */
8330
+ status: "inactive" | "pending" | "satisfied" | "declined" | "failed" | "expired" | "not_applicable";
8331
+ /**
8332
+ * Format: date-time
8333
+ * @description 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.
8334
+ * @example 2022-08-10T00:00:00Z
8335
+ */
8336
+ expires_at?: string | null;
8337
+ /**
8338
+ * Format: date-time
8339
+ * @description The creation date of the activation rule, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
8340
+ * @example 2022-08-08T00:00:00Z
8341
+ */
8342
+ created_at: string;
8343
+ /**
8344
+ * Format: date-time
8345
+ * @description The last update date of the activation rule, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
8346
+ * @example 2022-08-08T00:00:00Z
8347
+ */
8348
+ updated_at: string;
8349
+ };
8178
8350
  SubscriptionObject: {
8179
8351
  /**
8180
8352
  * Format: uuid
@@ -8232,13 +8404,14 @@ export interface components {
8232
8404
  /**
8233
8405
  * @description The status of the subscription, which can have the following values:
8234
8406
  * - `active`: the subscription is currently active and applied to the customer.
8235
- * - `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.
8407
+ * - `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.
8408
+ * - `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.
8236
8409
  * - `pending`: a previous subscription has been downgraded, and the current one is awaiting automatic activation at the end of the billing period.
8237
8410
  * - `terminated`: the subscription is no longer active.
8238
8411
  * @example active
8239
8412
  * @enum {string}
8240
8413
  */
8241
- status: "active" | "canceled" | "pending" | "terminated";
8414
+ status: "active" | "canceled" | "incomplete" | "pending" | "terminated";
8242
8415
  /**
8243
8416
  * Format: date-time
8244
8417
  * @description 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.
@@ -8347,11 +8520,43 @@ export interface components {
8347
8520
  * @example true
8348
8521
  */
8349
8522
  consolidate_invoice: boolean;
8523
+ /**
8524
+ * @description The reason a payment-gated subscription was canceled while still `incomplete`. Null unless the subscription was canceled before activation.
8525
+ *
8526
+ * - `payment_failed`: the gating payment failed.
8527
+ * - `timeout`: the activation rule expired before the payment succeeded.
8528
+ * - `manual`: the incomplete subscription was canceled on demand, via a terminate request with `status=incomplete`.
8529
+ * @example payment_failed
8530
+ * @enum {string|null}
8531
+ */
8532
+ cancellation_reason?: "payment_failed" | "timeout" | "manual" | null;
8533
+ /**
8534
+ * Format: date-time
8535
+ * @description 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`.
8536
+ * @example 2022-08-08T00:00:00Z
8537
+ */
8538
+ activated_at?: string | null;
8539
+ /** @description 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. */
8540
+ activation_rules?: components["schemas"]["SubscriptionActivationRuleObject"][];
8541
+ /**
8542
+ * @description The purchase order number associated with the subscription. It will be added to invoices generated for this subscription.
8543
+ * @example PO-123
8544
+ */
8545
+ purchase_order_number?: string | null;
8350
8546
  };
8351
8547
  SubscriptionsPaginated: {
8352
8548
  subscriptions: components["schemas"]["SubscriptionObject"][];
8353
8549
  meta: components["schemas"]["PaginationMeta"];
8354
8550
  };
8551
+ /**
8552
+ * @description Fee type to which a wallet can be restricted. It can be any of the following values:
8553
+ * - `charge`
8554
+ * - `subscription`
8555
+ * - `commitment`
8556
+ * - `fixed_charge`
8557
+ * @enum {string}
8558
+ */
8559
+ WalletFeeTypeEnum: "charge" | "subscription" | "commitment" | "fixed_charge";
8355
8560
  /** @description Object that represents rule for wallet recurring transactions. */
8356
8561
  WalletRecurringTransactionRule: {
8357
8562
  /**
@@ -8465,6 +8670,11 @@ export interface components {
8465
8670
  applied_invoice_custom_sections?: components["schemas"]["AppliedInvoiceCustomSectionObject"][];
8466
8671
  /** @description The payment method assigned to this recurring transaction rule for processing top-up payments. */
8467
8672
  payment_method?: components["schemas"]["PaymentMethodReference"];
8673
+ /**
8674
+ * @description The purchase order number associated with this recurring transaction rule. It will be added to invoices generated for the resulting wallet top-ups. If not set, falls back to the wallet's `purchase_order_number`.
8675
+ * @example PO-123
8676
+ */
8677
+ purchase_order_number?: string | null;
8468
8678
  };
8469
8679
  WalletObject: {
8470
8680
  /**
@@ -8578,7 +8788,7 @@ export interface components {
8578
8788
  * "charge"
8579
8789
  * ]
8580
8790
  */
8581
- fee_types?: ("charge" | "subscription" | "commitment")[];
8791
+ fee_types?: components["schemas"]["WalletFeeTypeEnum"][];
8582
8792
  /**
8583
8793
  * @description An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
8584
8794
  * @example [
@@ -8623,6 +8833,11 @@ export interface components {
8623
8833
  applied_invoice_custom_sections?: components["schemas"]["AppliedInvoiceCustomSectionObject"][];
8624
8834
  /** @description The payment method assigned to this wallet for processing top-up payments. */
8625
8835
  payment_method?: components["schemas"]["PaymentMethodReference"];
8836
+ /**
8837
+ * @description The purchase order number associated with the wallet. It will be added to invoices generated for wallet top-ups, unless a more specific purchase order number is set on the wallet transaction or recurring transaction rule that triggered the top-up.
8838
+ * @example PO-123
8839
+ */
8840
+ purchase_order_number?: string | null;
8626
8841
  metadata?: components["schemas"]["MetadataObject"];
8627
8842
  };
8628
8843
  WalletsPaginated: {
@@ -8726,6 +8941,11 @@ export interface components {
8726
8941
  * @example Tokens for models 'high-fidelity-boost'
8727
8942
  */
8728
8943
  transaction_name?: string | null;
8944
+ /**
8945
+ * @description The purchase order number associated with the wallet. It will be added to invoices generated for wallet top-ups, unless a more specific purchase order number is set on the wallet transaction or recurring transaction rule that triggered the top-up.
8946
+ * @example PO-123
8947
+ */
8948
+ purchase_order_number?: string | null;
8729
8949
  /** @description Set wallet limitations to fee types. */
8730
8950
  applies_to?: {
8731
8951
  /**
@@ -8734,7 +8954,7 @@ export interface components {
8734
8954
  * "charge"
8735
8955
  * ]
8736
8956
  */
8737
- fee_types?: ("charge" | "subscription" | "commitment")[] | null;
8957
+ fee_types?: components["schemas"]["WalletFeeTypeEnum"][] | null;
8738
8958
  /**
8739
8959
  * @description An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
8740
8960
  * @example []
@@ -8843,6 +9063,11 @@ export interface components {
8843
9063
  * @example Tokens for models 'high-fidelity-boost'
8844
9064
  */
8845
9065
  transaction_name?: string | null;
9066
+ /**
9067
+ * @description The purchase order number associated with this recurring transaction rule. It will be added to invoices generated for the resulting wallet top-ups. If not set, falls back to the wallet's `purchase_order_number`.
9068
+ * @example PO-123
9069
+ */
9070
+ purchase_order_number?: string | null;
8846
9071
  /**
8847
9072
  * @description When true, allows rule to topped up wallet with transactions that exceed the paid top-up limits. Defaults to false.
8848
9073
  * @example false
@@ -8893,6 +9118,11 @@ export interface components {
8893
9118
  * @example default
8894
9119
  */
8895
9120
  billing_entity_code?: string;
9121
+ /**
9122
+ * @description The purchase order number associated with the wallet. It will be added to invoices generated for wallet top-ups, unless a more specific purchase order number is set on the wallet transaction or recurring transaction rule that triggered the top-up.
9123
+ * @example PO-123
9124
+ */
9125
+ purchase_order_number?: string | null;
8896
9126
  invoice_custom_section?: components["schemas"]["InvoiceCustomSectionInput"];
8897
9127
  /** @description List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
8898
9128
  recurring_transaction_rules?: {
@@ -8986,6 +9216,11 @@ export interface components {
8986
9216
  * @example Tokens for models 'high-fidelity-boost'
8987
9217
  */
8988
9218
  transaction_name?: string | null;
9219
+ /**
9220
+ * @description The purchase order number associated with this recurring transaction rule. It will be added to invoices generated for the resulting wallet top-ups. If not set, falls back to the wallet's `purchase_order_number`.
9221
+ * @example PO-123
9222
+ */
9223
+ purchase_order_number?: string | null;
8989
9224
  invoice_custom_section?: components["schemas"]["InvoiceCustomSectionInput"];
8990
9225
  /** @description Optional payment method to use for processing recurring top-up payments. */
8991
9226
  payment_method?: components["schemas"]["PaymentMethodReference"];
@@ -9000,7 +9235,7 @@ export interface components {
9000
9235
  * "charge"
9001
9236
  * ]
9002
9237
  */
9003
- fee_types?: ("charge" | "subscription" | "commitment")[] | null;
9238
+ fee_types?: components["schemas"]["WalletFeeTypeEnum"][] | null;
9004
9239
  /**
9005
9240
  * @description An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
9006
9241
  * @example []
@@ -9700,8 +9935,7 @@ export interface components {
9700
9935
  };
9701
9936
  EventObject: {
9702
9937
  /**
9703
- * Format: uuid
9704
- * @description 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
9938
+ * @description 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.
9705
9939
  * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
9706
9940
  */
9707
9941
  lago_id?: string | null;
@@ -10105,6 +10339,11 @@ export interface components {
10105
10339
  * @example EUR
10106
10340
  */
10107
10341
  currency?: components["schemas"]["Currency"];
10342
+ /**
10343
+ * @description The purchase order number to associate with the invoice.
10344
+ * @example PO-123
10345
+ */
10346
+ purchase_order_number?: string | null;
10108
10347
  fees: {
10109
10348
  /**
10110
10349
  * @description The code of the add-on used as invoice item.
@@ -10236,7 +10475,7 @@ export interface components {
10236
10475
  */
10237
10476
  key?: string;
10238
10477
  /**
10239
- * @description The value in the key-value pair of the metadata.
10478
+ * @description The value in the key-value pair of the metadata (140 characters max).
10240
10479
  * @example INV-0123456-98765
10241
10480
  */
10242
10481
  value?: string;
@@ -10819,8 +11058,8 @@ export interface components {
10819
11058
  ChargeProperties: {
10820
11059
  /**
10821
11060
  * @deprecated
10822
- * @description The list of event properties that are used to group the events on the invoice for a `standard` charge model.
10823
- * **DEPRECATED** Replaced by `pricing_group_keys`.
11061
+ * @description **Deprecated.** Replaced by `pricing_group_keys`.
11062
+ * The list of event properties that are used to group the events on the invoice for a `standard` charge model.
10824
11063
  * @example [
10825
11064
  * "agent_name"
10826
11065
  * ]
@@ -12870,16 +13109,32 @@ export interface components {
12870
13109
  /** @description List of taxes applied to the fixed charge. */
12871
13110
  tax_codes?: components["schemas"]["TaxCodes"];
12872
13111
  }[];
12873
- /** @description List of usage thresholds applied to the subscription. */
13112
+ /**
13113
+ * @deprecated
13114
+ * @description **Deprecated.** Managing usage thresholds through `plan_overrides` is deprecated and its behavior is inconsistent: an empty array does not reliably clear thresholds (it is ignored the first time a subscription is overridden), and it never affects thresholds inherited from a parent plan. Use the top-level `usage_thresholds` array on the subscription instead, or `progressive_billing_disabled` to switch progressive billing off.
13115
+ */
12874
13116
  usage_thresholds?: components["schemas"]["UsageThresholdInput"][];
12875
13117
  metadata?: components["schemas"]["MetadataInput"];
12876
13118
  };
12877
- SubscriptionCreateInput: {
13119
+ SubscriptionActivationRuleInput: {
12878
13120
  /**
12879
- * @description 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.
12880
- *
12881
- * Important notes:
12882
- * - The final amount due for the subscription is not known at the time of creation; it is determined only after the invoice is finalized.
13121
+ * @description 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.
13122
+ * @example payment
13123
+ * @enum {string}
13124
+ */
13125
+ type: "payment";
13126
+ /**
13127
+ * @description 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.
13128
+ * @example 48
13129
+ */
13130
+ timeout_hours?: number;
13131
+ };
13132
+ SubscriptionCreateInput: {
13133
+ /**
13134
+ * @description 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.
13135
+ *
13136
+ * Important notes:
13137
+ * - The final amount due for the subscription is not known at the time of creation; it is determined only after the invoice is finalized.
12883
13138
  * - The payment intent generated for pre-authorization cannot be reused, as the final invoice amount may exceed the authorized amount.
12884
13139
  * - The payment intent is canceled immediately after creation, but this cancellation occurs asynchronously.
12885
13140
  * - For these reasons, it is recommended to use a small amount (such as $1) for pre-authorization. While this does not guarantee sufficient funds for the final payment, it helps reduce the likelihood of payment errors.
@@ -12954,6 +13209,27 @@ export interface components {
12954
13209
  * @example true
12955
13210
  */
12956
13211
  consolidate_invoice: boolean;
13212
+ /**
13213
+ * @description The purchase order number associated with the subscription. It will be added to invoices generated for this subscription.
13214
+ * @example PO-123
13215
+ */
13216
+ purchase_order_number?: string | null;
13217
+ /**
13218
+ * @description Disables progressive billing for this subscription, regardless of any usage thresholds defined on the plan (including thresholds inherited from a parent plan when the subscription runs on a plan override).
13219
+ *
13220
+ * Set to `true` to switch progressive billing off for this subscription specifically, without changing the plan's thresholds.
13221
+ * @default false
13222
+ * @example true
13223
+ */
13224
+ progressive_billing_disabled: boolean;
13225
+ /**
13226
+ * @description Usage thresholds managed directly on the subscription. This is the recommended way to set progressive billing thresholds per subscription; when present, they take precedence over the thresholds defined on the plan.
13227
+ *
13228
+ * This field cannot be combined with `plan_overrides.usage_thresholds` in the same request.
13229
+ */
13230
+ usage_thresholds?: components["schemas"]["UsageThresholdInput"][];
13231
+ /** @description 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. */
13232
+ activation_rules?: components["schemas"]["SubscriptionActivationRuleInput"][];
12957
13233
  };
12958
13234
  };
12959
13235
  ApplicableUsageThreshold: {
@@ -13024,6 +13300,27 @@ export interface components {
13024
13300
  * @example default
13025
13301
  */
13026
13302
  billing_entity_code?: string;
13303
+ /**
13304
+ * @description The purchase order number associated with the subscription. It will be added to invoices generated for this subscription.
13305
+ * @example PO-123
13306
+ */
13307
+ purchase_order_number?: string | null;
13308
+ /**
13309
+ * @description Disables progressive billing for this subscription, regardless of any usage thresholds defined on the plan (including thresholds inherited from a parent plan when the subscription runs on a plan override).
13310
+ *
13311
+ * Set to `true` to switch progressive billing off for this subscription specifically. This is the recommended way to stop progressive billing on a subscription that inherits thresholds from its plan, since clearing `usage_thresholds` only removes subscription-level thresholds and does not remove those defined on (or inherited from) the plan.
13312
+ * @default false
13313
+ * @example true
13314
+ */
13315
+ progressive_billing_disabled: boolean;
13316
+ /**
13317
+ * @description Usage thresholds managed directly on the subscription. This is the recommended way to set progressive billing thresholds per subscription; when present, they take precedence over the thresholds defined on the plan.
13318
+ *
13319
+ * Sending an empty array removes all subscription-level thresholds. This field cannot be combined with `plan_overrides.usage_thresholds` in the same request. To fully disable progressive billing on a subscription that inherits thresholds from its plan, use `progressive_billing_disabled` instead.
13320
+ */
13321
+ usage_thresholds?: components["schemas"]["UsageThresholdInput"][];
13322
+ /** @description 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. */
13323
+ activation_rules?: components["schemas"]["SubscriptionActivationRuleInput"][];
13027
13324
  };
13028
13325
  };
13029
13326
  Subscription: {
@@ -13357,7 +13654,7 @@ export interface components {
13357
13654
  description?: string | null;
13358
13655
  /**
13359
13656
  * @deprecated
13360
- * @description 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.
13657
+ * @description **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.
13361
13658
  * @example true
13362
13659
  */
13363
13660
  applied_to_organization?: boolean;
@@ -13411,6 +13708,11 @@ export interface components {
13411
13708
  * @example false
13412
13709
  */
13413
13710
  ignore_paid_top_up_limits?: boolean;
13711
+ /**
13712
+ * @description The purchase order number associated with this wallet transaction. It will be added to invoices generated for the resulting wallet top-up. If not set, falls back to the wallet's `purchase_order_number`.
13713
+ * @example PO-123
13714
+ */
13715
+ purchase_order_number?: string | null;
13414
13716
  invoice_custom_section?: components["schemas"]["InvoiceCustomSectionInput"];
13415
13717
  /** @description Optional payment method to use for processing the wallet transaction payment. */
13416
13718
  payment_method?: components["schemas"]["PaymentMethodReference"];
@@ -13566,6 +13868,11 @@ export interface components {
13566
13868
  applied_invoice_custom_sections?: components["schemas"]["AppliedInvoiceCustomSectionObject"][];
13567
13869
  /** @description The payment method assigned to this wallet transaction for processing the payment. */
13568
13870
  payment_method: components["schemas"]["PaymentMethodReference"];
13871
+ /**
13872
+ * @description The purchase order number associated with this wallet transaction. It will be added to invoices generated for the resulting wallet top-up. If not set, falls back to the wallet's `purchase_order_number`.
13873
+ * @example PO-123
13874
+ */
13875
+ purchase_order_number?: string | null;
13569
13876
  };
13570
13877
  WalletTransactions: {
13571
13878
  wallet_transactions: components["schemas"]["WalletTransactionObject"][];
@@ -13665,6 +13972,16 @@ export interface components {
13665
13972
  WalletTransactionsPaginated: components["schemas"]["WalletTransactions"] & {
13666
13973
  meta: components["schemas"]["PaginationMeta"];
13667
13974
  };
13975
+ WebhookPublicKeyObject: {
13976
+ /**
13977
+ * @description Base64-encoded public key used to verify webhook signatures.
13978
+ * @example MEgCQQCo9+BpMRYQ/dL3DS2CyJxRF+j6ctbT3/Qp84+KeFhnii7NT7fELilKUSnxS30WAvQCCo2yU1orfgqr41mM70MBAgMBAAE=
13979
+ */
13980
+ public_key: string;
13981
+ };
13982
+ WebhookPublicKey: {
13983
+ webhook: components["schemas"]["WebhookPublicKeyObject"];
13984
+ };
13668
13985
  WebhookEndpointObject: {
13669
13986
  /**
13670
13987
  * Format: uuid
@@ -13679,8 +13996,8 @@ export interface components {
13679
13996
  */
13680
13997
  lago_organization_id: string;
13681
13998
  /**
13682
- * @description The name of the wallet.
13683
- * @example Prepaid
13999
+ * @description The URL of the webhook endpoint.
14000
+ * @example https://foo.bar
13684
14001
  */
13685
14002
  webhook_url: string;
13686
14003
  /**
@@ -13689,6 +14006,19 @@ export interface components {
13689
14006
  * @enum {string}
13690
14007
  */
13691
14008
  signature_algo?: "jwt" | "hmac";
14009
+ /**
14010
+ * @description The name of the webhook.
14011
+ * @example EC2-production
14012
+ */
14013
+ name?: string | null;
14014
+ /**
14015
+ * @description A list of event types that will trigger the webhook. Passing null means that all event types will be sent.
14016
+ * @example [
14017
+ * "invoice.voided",
14018
+ * "customer.created"
14019
+ * ]
14020
+ */
14021
+ event_types?: string[] | null;
13692
14022
  /**
13693
14023
  * Format: date-time
13694
14024
  * @description The date of the webhook endpoint creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
@@ -13713,6 +14043,19 @@ export interface components {
13713
14043
  * @enum {string|null}
13714
14044
  */
13715
14045
  signature_algo?: "jwt" | "hmac" | null;
14046
+ /**
14047
+ * @description The name of the webhook.
14048
+ * @example EC2-production
14049
+ */
14050
+ name?: string | null;
14051
+ /**
14052
+ * @description A list of event types that will trigger the webhook. Passing null means that all event types will be sent.
14053
+ * @example [
14054
+ * "invoice.voided",
14055
+ * "customer.created"
14056
+ * ]
14057
+ */
14058
+ event_types?: string[] | null;
13716
14059
  };
13717
14060
  };
13718
14061
  WebhookEndpoint: {
@@ -13731,6 +14074,19 @@ export interface components {
13731
14074
  * @enum {string|null}
13732
14075
  */
13733
14076
  signature_algo?: "jwt" | "hmac" | null;
14077
+ /**
14078
+ * @description The name of the webhook.
14079
+ * @example EC2-production
14080
+ */
14081
+ name?: string | null;
14082
+ /**
14083
+ * @description A list of event types that will trigger the webhook. Passing null means that all event types will be sent.
14084
+ * @example [
14085
+ * "invoice.voided",
14086
+ * "customer.created"
14087
+ * ]
14088
+ */
14089
+ event_types?: string[] | null;
13734
14090
  };
13735
14091
  };
13736
14092
  TriggeredAlertObject: {
@@ -13936,6 +14292,18 @@ export interface components {
13936
14292
  [key: string]: unknown;
13937
14293
  };
13938
14294
  };
14295
+ OverdueBalancePerCurrencyObject: {
14296
+ /**
14297
+ * @description The amount of the overdue balance for this currency, expressed in cents.
14298
+ * @example 120
14299
+ */
14300
+ amount_cents: number;
14301
+ /**
14302
+ * @description The currency of the overdue balance.
14303
+ * @example EUR
14304
+ */
14305
+ currency: components["schemas"]["Currency"];
14306
+ };
13939
14307
  DunningCampaignFinishedObject: {
13940
14308
  /**
13941
14309
  * @description The customer external unique identifier (provided by your own application).
@@ -13957,6 +14325,8 @@ export interface components {
13957
14325
  * @example EUR
13958
14326
  */
13959
14327
  overdue_balance_currency: components["schemas"]["Currency"];
14328
+ /** @description Overdue balance broken down per currency. */
14329
+ overdue_balances?: components["schemas"]["OverdueBalancePerCurrencyObject"][];
13960
14330
  };
13961
14331
  EventErrorsObject: {
13962
14332
  /**
@@ -13996,7 +14366,10 @@ export interface components {
13996
14366
  * ]
13997
14367
  */
13998
14368
  invalid_filter_values: string[];
13999
- /** @deprecated */
14369
+ /**
14370
+ * @deprecated
14371
+ * @description **Deprecated.** List of event transaction_id with a missing group key.
14372
+ */
14000
14373
  missing_group_key: string[];
14001
14374
  };
14002
14375
  FeeTaxProviderErrorObject: {
@@ -14283,6 +14656,8 @@ export interface components {
14283
14656
  external_subscription_id: string;
14284
14657
  /** @description Show data only for given number of months. */
14285
14658
  months: number;
14659
+ /** @description Filter by the invoice purchase order number. The match is exact but case-insensitive. */
14660
+ purchase_order_number: string;
14286
14661
  /** @description The customer external unique identifier (provided by your own application) */
14287
14662
  external_customer_id_path: string;
14288
14663
  /** @description Filter by payment status. Possible values are `pending`, `failed` or `succeeded`. */
@@ -14291,6 +14666,8 @@ export interface components {
14291
14666
  wallet_code: string;
14292
14667
  /** @description Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system. */
14293
14668
  lago_invoice_id: string;
14669
+ /** @description Filter the results by currency, expressed as an ISO 4217 code. */
14670
+ currency: string;
14294
14671
  /** @description Code of the existing plan. */
14295
14672
  plan_code: string;
14296
14673
  /** @description Code of the existing charge. */
@@ -15443,6 +15820,8 @@ export interface operations {
15443
15820
  refund_status?: "pending" | "succeeded" | "failed";
15444
15821
  /** @description Filter credit notes by their related invoice number. */
15445
15822
  invoice_number?: string;
15823
+ /** @description Filter by the invoice purchase order number. The match is exact but case-insensitive. */
15824
+ purchase_order_number?: components["parameters"]["purchase_order_number"];
15446
15825
  /** @description Filter credit notes of at least a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types. */
15447
15826
  amount_from?: number;
15448
15827
  /** @description Filter credit notes up to a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types. */
@@ -15954,6 +16333,8 @@ export interface operations {
15954
16333
  refund_status?: "pending" | "succeeded" | "failed";
15955
16334
  /** @description Filter credit notes by their related invoice number. */
15956
16335
  invoice_number?: string;
16336
+ /** @description Filter by the invoice purchase order number. The match is exact but case-insensitive. */
16337
+ purchase_order_number?: components["parameters"]["purchase_order_number"];
15957
16338
  /** @description Filter credit notes of at least a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types. */
15958
16339
  amount_from?: number;
15959
16340
  /** @description Filter credit notes up to a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types. */
@@ -16014,6 +16395,8 @@ export interface operations {
16014
16395
  self_billed?: boolean;
16015
16396
  /** @description 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`. */
16016
16397
  "metadata[key]"?: string;
16398
+ /** @description Filter by the invoice purchase order number. The match is exact but case-insensitive. */
16399
+ purchase_order_number?: components["parameters"]["purchase_order_number"];
16017
16400
  };
16018
16401
  header?: never;
16019
16402
  path: {
@@ -16649,17 +17032,17 @@ export interface operations {
16649
17032
  };
16650
17033
  /**
16651
17034
  * @deprecated
16652
- * @description Filter usage to a specific charge by its Lago ID (UUID).
17035
+ * @description **Deprecated.** Filter usage to a specific charge by its Lago ID (UUID).
16653
17036
  */
16654
17037
  filter_by_charge_id?: string;
16655
17038
  /**
16656
17039
  * @deprecated
16657
- * @description Filter usage to a specific charge by its code.
17040
+ * @description **Deprecated.** Filter usage to a specific charge by its code.
16658
17041
  */
16659
17042
  filter_by_charge_code?: string;
16660
17043
  /**
16661
17044
  * @deprecated
16662
- * @description Filter usage by pricing group. Pass key/value pairs as query parameters, e.g. `filter_by_group[cloud]=aws`.
17045
+ * @description **Deprecated.** Filter usage by pricing group. Pass key/value pairs as query parameters, e.g. `filter_by_group[cloud]=aws`.
16663
17046
  */
16664
17047
  filter_by_group?: {
16665
17048
  [key: string]: string;
@@ -17261,6 +17644,8 @@ export interface operations {
17261
17644
  "billing_entity_codes[]"?: string[];
17262
17645
  /** @description 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`. */
17263
17646
  "metadata[key]"?: string;
17647
+ /** @description Filter by the invoice purchase order number. The match is exact but case-insensitive. */
17648
+ purchase_order_number?: components["parameters"]["purchase_order_number"];
17264
17649
  };
17265
17650
  header?: never;
17266
17651
  path?: never;
@@ -17365,6 +17750,32 @@ export interface operations {
17365
17750
  422: components["responses"]["UnprocessableEntity"];
17366
17751
  };
17367
17752
  };
17753
+ deleteInvoice: {
17754
+ parameters: {
17755
+ query?: never;
17756
+ header?: never;
17757
+ path: {
17758
+ /** @description Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system. */
17759
+ lago_id: components["parameters"]["lago_invoice_id"];
17760
+ };
17761
+ cookie?: never;
17762
+ };
17763
+ requestBody?: never;
17764
+ responses: {
17765
+ /** @description Invoice deleted */
17766
+ 200: {
17767
+ headers: {
17768
+ [name: string]: unknown;
17769
+ };
17770
+ content: {
17771
+ "application/json": components["schemas"]["Invoice"];
17772
+ };
17773
+ };
17774
+ 401: components["responses"]["Unauthorized"];
17775
+ 404: components["responses"]["NotFound"];
17776
+ 405: components["responses"]["NotAllowed"];
17777
+ };
17778
+ };
17368
17779
  downloadInvoice: {
17369
17780
  parameters: {
17370
17781
  query?: never;
@@ -17693,6 +18104,8 @@ export interface operations {
17693
18104
  page?: components["parameters"]["page"];
17694
18105
  /** @description Number of records per page. */
17695
18106
  per_page?: components["parameters"]["per_page"];
18107
+ /** @description Filter the results by currency, expressed as an ISO 4217 code. */
18108
+ currency?: components["parameters"]["currency"];
17696
18109
  /** @description Unique identifier assigned to the customer in your application. */
17697
18110
  external_customer_id?: components["parameters"]["external_customer_id"];
17698
18111
  /** @description Filter by payment status. Possible values are `pending`, `failed` or `succeeded`. */
@@ -18757,6 +19170,8 @@ export interface operations {
18757
19170
  page?: components["parameters"]["page"];
18758
19171
  /** @description Number of records per page. */
18759
19172
  per_page?: components["parameters"]["per_page"];
19173
+ /** @description Filter the results by currency, expressed as an ISO 4217 code. */
19174
+ currency?: components["parameters"]["currency"];
18760
19175
  /** @description The customer external unique identifier (provided by your own application) */
18761
19176
  external_customer_id?: string;
18762
19177
  /** @description The unique code representing the plan to be attached to the customer. This code must correspond to the code property of one of the active plans. */
@@ -18883,7 +19298,12 @@ export interface operations {
18883
19298
  destroySubscription: {
18884
19299
  parameters: {
18885
19300
  query?: {
18886
- /** @description If the field is not defined, Lago will terminate only `active` subscriptions. However, if you wish to cancel a `pending` subscription, please ensure that you include `status=pending` in your request. */
19301
+ /**
19302
+ * @description Selects which subscription to terminate for the given `external_id`, based on its status. If the field is not defined, Lago targets only `active` subscriptions.
19303
+ *
19304
+ * - `pending`: cancel a subscription scheduled for a future activation (include `status=pending`).
19305
+ * - `incomplete`: cancel a payment-gated subscription that is still awaiting its activation payment (include `status=incomplete`). The subscription is canceled with `cancellation_reason: manual`, its invoice is closed and nothing is billed, and any pending payment is canceled on a best-effort basis with the payment provider (some provider statuses cannot be canceled). Applied coupons, credit notes and wallet credits are recredited. Termination behaviours (`on_termination_credit_note`, `on_termination_invoice`) are ignored, as an incomplete subscription has never been billed.
19306
+ */
18887
19307
  status?: string;
18888
19308
  /**
18889
19309
  * @description When a pay-in-advance subscription is terminated before the end of its billing period, we generate a credit note for the unused subscription time by default.
@@ -19845,6 +20265,8 @@ export interface operations {
19845
20265
  page?: components["parameters"]["page"];
19846
20266
  /** @description Number of records per page. */
19847
20267
  per_page?: components["parameters"]["per_page"];
20268
+ /** @description Filter the results by currency, expressed as an ISO 4217 code. */
20269
+ currency?: components["parameters"]["currency"];
19848
20270
  /** @description The customer external unique identifier (provided by your own application). */
19849
20271
  external_customer_id: string;
19850
20272
  /** @description Filter wallets by billing entity codes. */
@@ -20300,6 +20722,27 @@ export interface operations {
20300
20722
  401: components["responses"]["Unauthorized"];
20301
20723
  };
20302
20724
  };
20725
+ fetchJsonPublicKey: {
20726
+ parameters: {
20727
+ query?: never;
20728
+ header?: never;
20729
+ path?: never;
20730
+ cookie?: never;
20731
+ };
20732
+ requestBody?: never;
20733
+ responses: {
20734
+ /** @description Public key */
20735
+ 200: {
20736
+ headers: {
20737
+ [name: string]: unknown;
20738
+ };
20739
+ content: {
20740
+ "application/json": components["schemas"]["WebhookPublicKey"];
20741
+ };
20742
+ };
20743
+ 401: components["responses"]["Unauthorized"];
20744
+ };
20745
+ };
20303
20746
  findAllWebhookEndpoints: {
20304
20747
  parameters: {
20305
20748
  query?: {
@@ -21775,6 +22218,48 @@ export interface operations {
21775
22218
  };
21776
22219
  };
21777
22220
  };
22221
+ invoiceReadyToFinalize: {
22222
+ parameters: {
22223
+ query?: never;
22224
+ header: {
22225
+ /** @description Signature of the webhook payload */
22226
+ "X-Lago-Signature": components["parameters"]["webhook_signature"];
22227
+ /** @description Algorithm used to generate the signature */
22228
+ "X-Lago-Signature-Algorithm": components["parameters"]["webhook_signature_algorithm"];
22229
+ /** @description Unique id of the webhook. It can be used for idempotency */
22230
+ "X-Lago-Unique-Key": components["parameters"]["webhook_unique_key"];
22231
+ };
22232
+ path?: never;
22233
+ cookie?: never;
22234
+ };
22235
+ /** @description Details of the draft invoice ready to be finalized */
22236
+ requestBody?: {
22237
+ content: {
22238
+ "application/json": {
22239
+ /** @enum {string} */
22240
+ webhook_type: "invoice.ready_to_finalize";
22241
+ /** @enum {string} */
22242
+ object_type: "invoice";
22243
+ /**
22244
+ * Format: uuid
22245
+ * @description Unique identifier of the organization, created by Lago.
22246
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
22247
+ */
22248
+ organization_id: string;
22249
+ invoice: components["schemas"]["InvoiceObjectExtended"];
22250
+ };
22251
+ };
22252
+ };
22253
+ responses: {
22254
+ /** @description Return a 200 status to indicate that the data was received successfully */
22255
+ 200: {
22256
+ headers: {
22257
+ [name: string]: unknown;
22258
+ };
22259
+ content?: never;
22260
+ };
22261
+ };
22262
+ };
21778
22263
  invoiceVoided: {
21779
22264
  parameters: {
21780
22265
  query?: never;
@@ -21817,6 +22302,48 @@ export interface operations {
21817
22302
  };
21818
22303
  };
21819
22304
  };
22305
+ invoiceDeleted: {
22306
+ parameters: {
22307
+ query?: never;
22308
+ header: {
22309
+ /** @description Signature of the webhook payload */
22310
+ "X-Lago-Signature": components["parameters"]["webhook_signature"];
22311
+ /** @description Algorithm used to generate the signature */
22312
+ "X-Lago-Signature-Algorithm": components["parameters"]["webhook_signature_algorithm"];
22313
+ /** @description Unique id of the webhook. It can be used for idempotency */
22314
+ "X-Lago-Unique-Key": components["parameters"]["webhook_unique_key"];
22315
+ };
22316
+ path?: never;
22317
+ cookie?: never;
22318
+ };
22319
+ /** @description Details of the invoice */
22320
+ requestBody?: {
22321
+ content: {
22322
+ "application/json": {
22323
+ /** @enum {string} */
22324
+ webhook_type: "invoice.deleted";
22325
+ /** @enum {string} */
22326
+ object_type: "invoice";
22327
+ /**
22328
+ * Format: uuid
22329
+ * @description Unique identifier of the organization, created by Lago.
22330
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
22331
+ */
22332
+ organization_id: string;
22333
+ invoice: components["schemas"]["InvoiceObjectExtended"];
22334
+ };
22335
+ };
22336
+ };
22337
+ responses: {
22338
+ /** @description Return a 200 status to indicate that the data was received successfully */
22339
+ 200: {
22340
+ headers: {
22341
+ [name: string]: unknown;
22342
+ };
22343
+ content?: never;
22344
+ };
22345
+ };
22346
+ };
21820
22347
  invoicePaymentDisputeLost: {
21821
22348
  parameters: {
21822
22349
  query?: never;
@@ -22489,6 +23016,90 @@ export interface operations {
22489
23016
  };
22490
23017
  };
22491
23018
  };
23019
+ subscriptionIncomplete: {
23020
+ parameters: {
23021
+ query?: never;
23022
+ header: {
23023
+ /** @description Signature of the webhook payload */
23024
+ "X-Lago-Signature": components["parameters"]["webhook_signature"];
23025
+ /** @description Algorithm used to generate the signature */
23026
+ "X-Lago-Signature-Algorithm": components["parameters"]["webhook_signature_algorithm"];
23027
+ /** @description Unique id of the webhook. It can be used for idempotency */
23028
+ "X-Lago-Unique-Key": components["parameters"]["webhook_unique_key"];
23029
+ };
23030
+ path?: never;
23031
+ cookie?: never;
23032
+ };
23033
+ /** @description Details of the subscription */
23034
+ requestBody?: {
23035
+ content: {
23036
+ "application/json": {
23037
+ /** @enum {string} */
23038
+ webhook_type: "subscription.incomplete";
23039
+ /** @enum {string} */
23040
+ object_type: "subscription";
23041
+ /**
23042
+ * Format: uuid
23043
+ * @description Unique identifier of the organization, created by Lago.
23044
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
23045
+ */
23046
+ organization_id: string;
23047
+ subscription: components["schemas"]["SubscriptionWithCustomerObject"];
23048
+ };
23049
+ };
23050
+ };
23051
+ responses: {
23052
+ /** @description Return a 200 status to indicate that the data was received successfully */
23053
+ 200: {
23054
+ headers: {
23055
+ [name: string]: unknown;
23056
+ };
23057
+ content?: never;
23058
+ };
23059
+ };
23060
+ };
23061
+ subscriptionCanceled: {
23062
+ parameters: {
23063
+ query?: never;
23064
+ header: {
23065
+ /** @description Signature of the webhook payload */
23066
+ "X-Lago-Signature": components["parameters"]["webhook_signature"];
23067
+ /** @description Algorithm used to generate the signature */
23068
+ "X-Lago-Signature-Algorithm": components["parameters"]["webhook_signature_algorithm"];
23069
+ /** @description Unique id of the webhook. It can be used for idempotency */
23070
+ "X-Lago-Unique-Key": components["parameters"]["webhook_unique_key"];
23071
+ };
23072
+ path?: never;
23073
+ cookie?: never;
23074
+ };
23075
+ /** @description Details of the subscription */
23076
+ requestBody?: {
23077
+ content: {
23078
+ "application/json": {
23079
+ /** @enum {string} */
23080
+ webhook_type: "subscription.canceled";
23081
+ /** @enum {string} */
23082
+ object_type: "subscription";
23083
+ /**
23084
+ * Format: uuid
23085
+ * @description Unique identifier of the organization, created by Lago.
23086
+ * @example 1a901a90-1a90-1a90-1a90-1a901a901a90
23087
+ */
23088
+ organization_id: string;
23089
+ subscription: components["schemas"]["SubscriptionWithCustomerObject"];
23090
+ };
23091
+ };
23092
+ };
23093
+ responses: {
23094
+ /** @description Return a 200 status to indicate that the data was received successfully */
23095
+ 200: {
23096
+ headers: {
23097
+ [name: string]: unknown;
23098
+ };
23099
+ content?: never;
23100
+ };
23101
+ };
23102
+ };
22492
23103
  subscriptionStarted: {
22493
23104
  parameters: {
22494
23105
  query?: never;