lago-javascript-client 1.50.0 → 1.52.1

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.
@@ -2645,6 +2645,54 @@ export interface CustomerBaseObject {
2645
2645
  shipping_address?: Address;
2646
2646
  metadata?: CustomerMetadata[];
2647
2647
  }
2648
+ /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
2649
+ export interface IntegrationCustomer {
2650
+ /**
2651
+ * A unique identifier for the integration customer object in the Lago application.
2652
+ * @format uuid
2653
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2654
+ */
2655
+ lago_id: string;
2656
+ /**
2657
+ * The integration type used for accounting and tax syncs.
2658
+ * Accepted values: `netsuite, anrok`.
2659
+ * @example "netsuite"
2660
+ */
2661
+ type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
2662
+ /**
2663
+ * Unique code used to identify an integration connection.
2664
+ * @example "netsuite-eu-1"
2665
+ */
2666
+ integration_code: string;
2667
+ /**
2668
+ * 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.
2669
+ * @example "cus_12345"
2670
+ */
2671
+ external_customer_id: string;
2672
+ /**
2673
+ * 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`
2674
+ * @example true
2675
+ */
2676
+ sync_with_provider?: boolean | null;
2677
+ /**
2678
+ * This optional field is needed only when working with `netsuite` connection.
2679
+ * @example "2"
2680
+ */
2681
+ subsidiary_id?: string;
2682
+ /**
2683
+ * This optional field is present only when working with `hubspot` connection.
2684
+ * @example "contacts"
2685
+ */
2686
+ targeted_object?: string | null;
2687
+ /**
2688
+ * This optional field is present only when working with `hubspot` connection.
2689
+ * @example "dinesh@piedpiper.test"
2690
+ */
2691
+ email?: string | null;
2692
+ }
2693
+ export type CustomerObject = CustomerBaseObject & {
2694
+ integration_customers?: IntegrationCustomer[];
2695
+ };
2648
2696
  /**
2649
2697
  * Custom metadata stored as key-value pairs.
2650
2698
  * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
@@ -2699,6 +2747,11 @@ export interface CreditNoteObject {
2699
2747
  * @example "LAG-1234"
2700
2748
  */
2701
2749
  invoice_number: string;
2750
+ /**
2751
+ * The purchase order number of the invoice the credit note belongs to.
2752
+ * @example "PO-123"
2753
+ */
2754
+ purchase_order_number?: string | null;
2702
2755
  /**
2703
2756
  * 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.
2704
2757
  * @format date
@@ -2809,7 +2862,7 @@ export interface CreditNoteObject {
2809
2862
  * @example false
2810
2863
  */
2811
2864
  self_billed?: boolean;
2812
- customer?: CustomerBaseObject;
2865
+ customer?: CustomerObject;
2813
2866
  /**
2814
2867
  * Custom metadata stored as key-value pairs.
2815
2868
  * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
@@ -2882,7 +2935,7 @@ export interface CreditNoteCreateInput {
2882
2935
  };
2883
2936
  }
2884
2937
  export type CreditNoteExtendedObject = CreditNoteObject & {
2885
- customer?: CustomerBaseObject;
2938
+ customer?: CustomerObject;
2886
2939
  };
2887
2940
  export interface CreditNoteExtended {
2888
2941
  credit_note: CreditNoteExtendedObject;
@@ -3069,54 +3122,6 @@ export interface CreditNoteMetadataResponse {
3069
3122
  */
3070
3123
  metadata: MetadataObject;
3071
3124
  }
3072
- /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
3073
- export interface IntegrationCustomer {
3074
- /**
3075
- * A unique identifier for the integration customer object in the Lago application.
3076
- * @format uuid
3077
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3078
- */
3079
- lago_id: string;
3080
- /**
3081
- * The integration type used for accounting and tax syncs.
3082
- * Accepted values: `netsuite, anrok`.
3083
- * @example "netsuite"
3084
- */
3085
- type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
3086
- /**
3087
- * Unique code used to identify an integration connection.
3088
- * @example "netsuite-eu-1"
3089
- */
3090
- integration_code: string;
3091
- /**
3092
- * 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.
3093
- * @example "cus_12345"
3094
- */
3095
- external_customer_id: string;
3096
- /**
3097
- * 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`
3098
- * @example true
3099
- */
3100
- sync_with_provider?: boolean | null;
3101
- /**
3102
- * This optional field is needed only when working with `netsuite` connection.
3103
- * @example "2"
3104
- */
3105
- subsidiary_id?: string;
3106
- /**
3107
- * This optional field is present only when working with `hubspot` connection.
3108
- * @example "contacts"
3109
- */
3110
- targeted_object?: string | null;
3111
- /**
3112
- * This optional field is present only when working with `hubspot` connection.
3113
- * @example "dinesh@piedpiper.test"
3114
- */
3115
- email?: string | null;
3116
- }
3117
- export type CustomerObject = CustomerBaseObject & {
3118
- integration_customers?: IntegrationCustomer[];
3119
- };
3120
3125
  export interface ErrorDetailObject {
3121
3126
  /**
3122
3127
  * Unique identifier assigned to the error_detail within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the error's record within the Lago system.
@@ -3204,7 +3209,8 @@ export interface CustomerCreateInput {
3204
3209
  */
3205
3210
  logo_url?: string | null;
3206
3211
  /**
3207
- * The full name of the customer
3212
+ * The full name of the customer (255 characters max).
3213
+ * @maxLength 255
3208
3214
  * @example "Gavin Belson"
3209
3215
  */
3210
3216
  name?: string | null;
@@ -3372,6 +3378,11 @@ export interface InvoiceBaseObject {
3372
3378
  * @example "LAG-1234-001-002"
3373
3379
  */
3374
3380
  number: string;
3381
+ /**
3382
+ * The purchase order number associated with the invoice. It is inherited from the subscription, wallet or wallet transaction the invoice was generated for.
3383
+ * @example "PO-123"
3384
+ */
3385
+ purchase_order_number?: string | null;
3375
3386
  /**
3376
3387
  * The date when the invoice was issued. It is provided in the ISO 8601 date format.
3377
3388
  * @format date
@@ -3412,9 +3423,10 @@ export interface InvoiceBaseObject {
3412
3423
  * - `voided`: the invoice has been issued and subsequently voided. In this state, events cannot be ingested or added to the invoice anymore.
3413
3424
  * - `pending`: the invoice remains pending until the taxes are fetched from the external provider.
3414
3425
  * - `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.
3426
+ * - `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.
3415
3427
  * @example "finalized"
3416
3428
  */
3417
- status: "draft" | "finalized" | "voided" | "failed" | "pending";
3429
+ status: "draft" | "finalized" | "voided" | "failed" | "pending" | "deleted";
3418
3430
  /**
3419
3431
  * The status of the payment associated with the invoice. It can have one of the following values:
3420
3432
  * - `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.
@@ -3504,6 +3516,12 @@ export interface InvoiceBaseObject {
3504
3516
  * @example "https://getlago.com/invoice/file"
3505
3517
  */
3506
3518
  file_url?: string;
3519
+ /**
3520
+ * 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.
3521
+ * @format uri
3522
+ * @example "https://app.getlago.com/acme/customer/1a901a90-1a90-1a90-1a90-1a901a901a90/invoice/2b012b01-2b01-2b01-2b01-2b012b012b01/overview"
3523
+ */
3524
+ web_url?: string | null;
3507
3525
  /**
3508
3526
  * 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
3509
3527
  * @format date-time
@@ -3530,7 +3548,8 @@ export interface InvoiceMetadataObject {
3530
3548
  */
3531
3549
  key?: string;
3532
3550
  /**
3533
- * Represents the value of the metadata's key-value pair.
3551
+ * Represents the value of the metadata's key-value pair (140 characters max).
3552
+ * @maxLength 140
3534
3553
  * @example "INV-0123456-98765"
3535
3554
  */
3536
3555
  value?: string;
@@ -4057,13 +4076,14 @@ export interface SubscriptionObject {
4057
4076
  */
4058
4077
  consolidate_invoice?: boolean;
4059
4078
  /**
4060
- * The reason a payment-gated subscription was canceled before activation. Null unless the subscription was canceled by payment gating.
4079
+ * The reason a payment-gated subscription was canceled while still `incomplete`. Null unless the subscription was canceled before activation.
4061
4080
  *
4062
4081
  * - `payment_failed`: the gating payment failed.
4063
4082
  * - `timeout`: the activation rule expired before the payment succeeded.
4083
+ * - `manual`: the incomplete subscription was canceled on demand, via a terminate request with `status=incomplete`.
4064
4084
  * @example "payment_failed"
4065
4085
  */
4066
- cancellation_reason?: "payment_failed" | "timeout";
4086
+ cancellation_reason?: "payment_failed" | "timeout" | "manual";
4067
4087
  /**
4068
4088
  * 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
4089
  * @format date-time
@@ -4072,11 +4092,24 @@ export interface SubscriptionObject {
4072
4092
  activated_at?: string | null;
4073
4093
  /** 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
4094
  activation_rules?: SubscriptionActivationRuleObject[];
4095
+ /**
4096
+ * The purchase order number associated with the subscription. It will be added to invoices generated for this subscription.
4097
+ * @example "PO-123"
4098
+ */
4099
+ purchase_order_number?: string | null;
4075
4100
  }
4076
4101
  export interface SubscriptionsPaginated {
4077
4102
  subscriptions: SubscriptionObject[];
4078
4103
  meta: PaginationMeta;
4079
4104
  }
4105
+ /**
4106
+ * Fee type to which a wallet can be restricted. It can be any of the following values:
4107
+ * - `charge`
4108
+ * - `subscription`
4109
+ * - `commitment`
4110
+ * - `fixed_charge`
4111
+ */
4112
+ export type WalletFeeTypeEnum = "charge" | "subscription" | "commitment" | "fixed_charge";
4080
4113
  /** Object that represents rule for wallet recurring transactions. */
4081
4114
  export interface WalletRecurringTransactionRule {
4082
4115
  /**
@@ -4181,6 +4214,11 @@ export interface WalletRecurringTransactionRule {
4181
4214
  applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
4182
4215
  /** The payment method assigned to this recurring transaction rule for processing top-up payments. */
4183
4216
  payment_method?: PaymentMethodReference;
4217
+ /**
4218
+ * 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`.
4219
+ * @example "PO-123"
4220
+ */
4221
+ purchase_order_number?: string | null;
4184
4222
  }
4185
4223
  export interface WalletObject {
4186
4224
  /**
@@ -4296,7 +4334,7 @@ export interface WalletObject {
4296
4334
  * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
4297
4335
  * @example ["charge"]
4298
4336
  */
4299
- fee_types?: ("charge" | "subscription" | "commitment")[];
4337
+ fee_types?: WalletFeeTypeEnum[];
4300
4338
  /**
4301
4339
  * 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.
4302
4340
  * @example ["bm1"]
@@ -4341,6 +4379,11 @@ export interface WalletObject {
4341
4379
  applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
4342
4380
  /** The payment method assigned to this wallet for processing top-up payments. */
4343
4381
  payment_method?: PaymentMethodReference;
4382
+ /**
4383
+ * 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.
4384
+ * @example "PO-123"
4385
+ */
4386
+ purchase_order_number?: string | null;
4344
4387
  /**
4345
4388
  * Custom metadata stored as key-value pairs.
4346
4389
  * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
@@ -4437,6 +4480,11 @@ export interface WalletCreateInput {
4437
4480
  * @example "Tokens for models 'high-fidelity-boost'"
4438
4481
  */
4439
4482
  transaction_name?: string | null;
4483
+ /**
4484
+ * 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.
4485
+ * @example "PO-123"
4486
+ */
4487
+ purchase_order_number?: string | null;
4440
4488
  /** Set wallet limitations to fee types. */
4441
4489
  applies_to?: {
4442
4490
  /**
@@ -4513,6 +4561,11 @@ export interface WalletUpdateInput {
4513
4561
  * @example "default"
4514
4562
  */
4515
4563
  billing_entity_code?: string;
4564
+ /**
4565
+ * 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.
4566
+ * @example "PO-123"
4567
+ */
4568
+ purchase_order_number?: string | null;
4516
4569
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
4517
4570
  invoice_custom_section?: InvoiceCustomSectionInput;
4518
4571
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
@@ -4599,6 +4652,11 @@ export interface WalletUpdateInput {
4599
4652
  * @example "Tokens for models 'high-fidelity-boost'"
4600
4653
  */
4601
4654
  transaction_name?: string | null;
4655
+ /**
4656
+ * 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`.
4657
+ * @example "PO-123"
4658
+ */
4659
+ purchase_order_number?: string | null;
4602
4660
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
4603
4661
  invoice_custom_section?: InvoiceCustomSectionInput;
4604
4662
  /** Optional payment method to use for processing recurring top-up payments. */
@@ -5712,6 +5770,11 @@ export interface InvoiceOneOffCreateInput {
5712
5770
  * @example "EUR"
5713
5771
  */
5714
5772
  currency?: Currency;
5773
+ /**
5774
+ * The purchase order number to associate with the invoice.
5775
+ * @example "PO-123"
5776
+ */
5777
+ purchase_order_number?: string | null;
5715
5778
  fees: {
5716
5779
  /**
5717
5780
  * The code of the add-on used as invoice item.
@@ -5844,7 +5907,8 @@ export interface InvoiceUpdateInput {
5844
5907
  */
5845
5908
  key?: string;
5846
5909
  /**
5847
- * The value in the key-value pair of the metadata.
5910
+ * The value in the key-value pair of the metadata (140 characters max).
5911
+ * @maxLength 140
5848
5912
  * @example "INV-0123456-98765"
5849
5913
  */
5850
5914
  value?: string;
@@ -6042,140 +6106,802 @@ export interface InvoiceVoidInput {
6042
6106
  */
6043
6107
  credit_amount?: number;
6044
6108
  }
6045
- /** The custom billing settings for your organization. */
6046
- export interface OrganizationBillingConfiguration {
6109
+ /**
6110
+ * The status of the order form. It can be any of the following values:
6111
+ * - `generated`: the order form is waiting for the customer's signature.
6112
+ * - `signed`: the customer has signed, and an order has been created from the order form.
6113
+ * - `expired`: the order form reached its `expires_at` without being signed.
6114
+ * - `voided`: the order form has been voided before being signed.
6115
+ *
6116
+ * Only a `generated` order form is actionable. Reaching `expired` or `voided` also voids the quote version the order form was generated from; signing does not, since the deal it quotes goes on to be executed.
6117
+ * @example "generated"
6118
+ */
6119
+ export type OrderFormStatusEnum = "generated" | "signed" | "expired" | "voided";
6120
+ /**
6121
+ * The reason why the order form is no longer actionable. It is `null` unless the `status` is `voided` or `expired`. It can be any of the following values:
6122
+ * - `manual`: the order form has been voided explicitly, through the API or the Lago user interface.
6123
+ * - `expired`: the order form reached its `expires_at` without being signed.
6124
+ * - `invalid`: reserved for an order form Lago voids because it can no longer be executed. No flow writes it yet.
6125
+ * @example "manual"
6126
+ */
6127
+ export type OrderFormVoidReasonEnum = "manual" | "expired" | "invalid";
6128
+ export interface OrderFormObject {
6047
6129
  /**
6048
- * The customer invoice message that appears at the bottom of each billing documents.
6049
- * @example "This is my customer footer"
6130
+ * Unique identifier of the order form, created by Lago.
6131
+ * @format uuid
6132
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6050
6133
  */
6051
- invoice_footer?: string | null;
6134
+ lago_id: string;
6052
6135
  /**
6053
- * The grace period, expressed in days, for finalizing the invoice. This period refers to the additional time granted to your customers beyond the invoice due date to adjust usage and line items. Can be overwritten by the customer's grace period.
6054
- * @example 3
6136
+ * The unique number assigned to the order form by Lago.
6137
+ * @example "OF-2026-0001"
6055
6138
  */
6056
- invoice_grace_period?: number;
6139
+ number: string;
6057
6140
  /**
6058
- * The locale of the billing documents, expressed in the ISO 639-1 format. This field indicates the language or regional variant used for the documents content issued or the embeddable customer portal.
6059
- * @example "en"
6141
+ * The status of the order form. It can be any of the following values:
6142
+ * - `generated`: the order form is waiting for the customer's signature.
6143
+ * - `signed`: the customer has signed, and an order has been created from the order form.
6144
+ * - `expired`: the order form reached its `expires_at` without being signed.
6145
+ * - `voided`: the order form has been voided before being signed.
6146
+ *
6147
+ * Only a `generated` order form is actionable. Reaching `expired` or `voided` also voids the quote version the order form was generated from; signing does not, since the deal it quotes goes on to be executed.
6060
6148
  */
6061
- document_locale?: string;
6062
- }
6063
- export interface OrganizationUpdateInput {
6064
- organization: {
6065
- /**
6066
- * The URL of your newest updated webhook endpoint. This URL allows your organization to receive important messages, notifications, or data from the Lago system. By configuring your webhook endpoint to this URL, you can ensure that your organization stays informed and receives relevant information in a timely manner.
6067
- * @example "https://webhook.brex.com"
6068
- */
6069
- webhook_url?: string | null;
6070
- /**
6071
- * The country of your organization.
6072
- * @example "US"
6073
- */
6074
- country?: CountryOrNull;
6075
- /**
6076
- * The default currency of an organization.
6077
- * @example "USD"
6078
- */
6079
- default_currency?: Currency;
6080
- /**
6081
- * The first line of your organization's billing address.
6082
- * @example "100 Brex Street"
6083
- */
6084
- address_line1?: string | null;
6085
- /**
6086
- * The second line of your organization's billing address.
6087
- * @example null
6088
- */
6089
- address_line2?: string | null;
6090
- /**
6091
- * The state of your organization's billing address.
6092
- * @example "NYC"
6093
- */
6094
- state?: string | null;
6095
- /**
6096
- * The zipcode of your organization's billing address.
6097
- * @example "10000"
6098
- */
6099
- zipcode?: string | null;
6100
- /**
6101
- * The email address of your organization used to bill your customers.
6102
- * @format email
6103
- * @example "brex@brex.com"
6104
- */
6105
- email?: string | null;
6106
- /**
6107
- * The city of your organization's billing address.
6108
- * @example "New York"
6109
- */
6110
- city?: string | null;
6111
- /**
6112
- * The legal name of your organization.
6113
- * @example null
6114
- */
6115
- legal_name?: string | null;
6116
- /**
6117
- * The legal number of your organization.
6118
- * @example null
6119
- */
6120
- legal_number?: string | null;
6121
- /**
6122
- * This parameter configures the method of incrementing invoice numbers for your customers.
6123
- *
6124
- * - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern.
6125
- * - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month.
6126
- *
6127
- * The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer.
6128
- * @example "per_customer"
6129
- */
6130
- document_numbering?: "per_customer" | "per_organization";
6131
- /**
6132
- * Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago.
6133
- * @example "ORG-1234"
6134
- */
6135
- document_number_prefix?: string;
6136
- /**
6137
- * The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
6138
- * @example 30
6139
- */
6140
- net_payment_term?: number;
6141
- /**
6142
- * The tax identification number of your organization.
6143
- * @example "US123456789"
6144
- */
6145
- tax_identification_number?: string | null;
6146
- /**
6147
- * Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone.
6148
- * @example "America/New_York"
6149
- */
6150
- timezone?: Timezone;
6151
- /**
6152
- * Represents the email settings of the organization. It allows you to define which documents are sent by email. The field value determines the types of documents that trigger email notifications. Possible values for are `invoice.finalized` and `credit_note.created`. By configuring this field, you can specify whether invoices, credit notes, or both should be sent to recipients via email.
6153
- * @example ["invoice.finalized","credit_note.created"]
6154
- */
6155
- email_settings?: ("invoice.finalized" | "credit_note.created")[];
6156
- /** The custom billing settings for your organization. */
6157
- billing_configuration?: OrganizationBillingConfiguration;
6158
- /**
6159
- * Determines whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
6160
- * @example false
6161
- */
6162
- finalize_zero_amount_invoice?: boolean;
6163
- };
6164
- }
6165
- export interface OrganizationObject {
6149
+ status: OrderFormStatusEnum;
6166
6150
  /**
6167
- * Unique identifier assigned to the organization within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the organization's record within the Lago system
6168
- * @format uuid
6169
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6151
+ * The reason why the order form is no longer actionable. It is `null` unless the `status` is `voided` or `expired`. It can be any of the following values:
6152
+ * - `manual`: the order form has been voided explicitly, through the API or the Lago user interface.
6153
+ * - `expired`: the order form reached its `expires_at` without being signed.
6154
+ * - `invalid`: reserved for an order form Lago voids because it can no longer be executed. No flow writes it yet.
6170
6155
  */
6171
- lago_id: string;
6156
+ void_reason: OrderFormVoidReasonEnum;
6172
6157
  /**
6173
- * The name of your organization.
6174
- * @example "Name1"
6158
+ * The date and time in UTC (ISO 8601) after which the order form is meant to expire. It is `null` when the order form never expires. It is validated when the quote is approved, where a value on or after the day the quoted deal stops being executable is rejected rather than clamped. Expiry is then swept hourly and compared by calendar date, so signing keeps succeeding until the sweep moves the order form to `expired`.
6159
+ * @format date-time
6160
+ * @example "2026-06-30T23:59:59Z"
6175
6161
  */
6176
- name: string;
6162
+ expires_at: string | null;
6177
6163
  /**
6178
- * The date of creation of your organization, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
6164
+ * The date and time in UTC (ISO 8601) when the order form was marked as signed. It is `null` unless the `status` is `signed`.
6165
+ * @format date-time
6166
+ * @example "2026-04-29T08:59:51Z"
6167
+ */
6168
+ signed_at: string | null;
6169
+ /**
6170
+ * The date and time in UTC (ISO 8601) when the order form stopped being actionable. It is set both when the order form is voided and when it expires, and is `null` otherwise.
6171
+ * @format date-time
6172
+ * @example "2026-04-29T08:59:51Z"
6173
+ */
6174
+ voided_at: string | null;
6175
+ /**
6176
+ * The URL of the signed document attached to the order form. It is `null` when no document was uploaded.
6177
+ * @format uri
6178
+ * @example "https://api.getlago.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/OF-2026-0001"
6179
+ */
6180
+ signed_document_url: string | null;
6181
+ /**
6182
+ * Unique identifier of the organization, created by Lago.
6183
+ * @format uuid
6184
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6185
+ */
6186
+ lago_organization_id: string;
6187
+ /**
6188
+ * Unique identifier of the customer the order form is addressed to, created by Lago.
6189
+ * @format uuid
6190
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6191
+ */
6192
+ lago_customer_id: string;
6193
+ /**
6194
+ * Unique identifier of the quote the order form comes from, created by Lago.
6195
+ * @format uuid
6196
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6197
+ */
6198
+ lago_quote_id: string;
6199
+ /**
6200
+ * Unique identifier of the approved quote version the order form was generated from, created by Lago. A quote version carries at most one order form.
6201
+ * @format uuid
6202
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6203
+ */
6204
+ lago_quote_version_id: string;
6205
+ /**
6206
+ * The date and time in UTC (ISO 8601) when the order form was created.
6207
+ * @format date-time
6208
+ * @example "2026-04-29T08:59:51Z"
6209
+ */
6210
+ created_at: string;
6211
+ /**
6212
+ * The date and time in UTC (ISO 8601) when the order form was last updated.
6213
+ * @format date-time
6214
+ * @example "2026-04-29T08:59:51Z"
6215
+ */
6216
+ updated_at: string;
6217
+ }
6218
+ export interface OrderFormsPaginated {
6219
+ order_forms: OrderFormObject[];
6220
+ meta: PaginationMeta;
6221
+ }
6222
+ export interface OrderForm {
6223
+ order_form: OrderFormObject;
6224
+ }
6225
+ /**
6226
+ * How the order created from the order form is carried out. It can be any of the following values:
6227
+ * - `execute_in_lago`: Lago applies the quoted deal itself, creating the subscriptions, coupons, wallets or one-off invoice it describes.
6228
+ * - `order_only`: Lago records the order without applying it, leaving the execution to your own systems.
6229
+ * @example "execute_in_lago"
6230
+ */
6231
+ export type OrderExecutionModeEnum = "execute_in_lago" | "order_only";
6232
+ /** Parameters available when marking an order form as signed. Every parameter is optional, so an empty body records the signature without attaching a document, and creates an order that is not scheduled for execution. */
6233
+ export interface OrderFormMarkAsSignedInput {
6234
+ order_form?: {
6235
+ /**
6236
+ * The document signed by the customer, as a base64 data URI (`data:<content_type>;base64,<data>`). Accepted content types are `application/pdf`, `image/jpeg` and `image/png`, for a maximum of 10 MB. Once attached, it is exposed as `signed_document_url` on the order form.
6237
+ * @example "data:application/pdf;base64,JVBERi0xLjQKJcfs..."
6238
+ */
6239
+ signed_document?: string;
6240
+ /** How the order created from the order form is carried out. It becomes mandatory as soon as `execute_at` is provided. */
6241
+ execution_mode?: OrderExecutionModeEnum;
6242
+ /**
6243
+ * The date and time in UTC (ISO 8601) when Lago executes the order created from the order form. It must be in the future, requires `execution_mode` to be set, and must fall strictly before the day the quoted deal stops being executable, otherwise signing is rejected with a `422`. When it is omitted, the order is created but not scheduled, and waits to be executed on demand.
6244
+ * @format date-time
6245
+ * @example "2026-07-01T00:00:00Z"
6246
+ */
6247
+ execute_at?: string;
6248
+ };
6249
+ }
6250
+ /**
6251
+ * The status of the order. It can be any of the following values:
6252
+ * - `created`: the order has been created from a signed order form and is waiting to be executed.
6253
+ * - `executed`: the order has been carried out. What it produced is listed in `execution_record`.
6254
+ * - `failed`: the execution was attempted and rolled back. The reasons are listed in `execution_record.errors`. Lago does not retry on its own, so a new attempt has to be triggered through the execute endpoint.
6255
+ * @example "created"
6256
+ */
6257
+ export type OrderStatusEnum = "created" | "executed" | "failed";
6258
+ /**
6259
+ * The commercial motion the quote describes. It can be any of the following values:
6260
+ * - `subscription_creation`: the quote creates one or more subscriptions.
6261
+ * - `subscription_amendment`: the quote amends an existing subscription, named by the quote's own `lago_subscription_id`.
6262
+ * - `one_off`: the quote bills add-ons once, without any subscription.
6263
+ * @example "subscription_creation"
6264
+ */
6265
+ export type QuoteOrderTypeEnum = "subscription_creation" | "subscription_amendment" | "one_off";
6266
+ /**
6267
+ * How the order is carried out. It is `null` while the order has neither been scheduled nor executed. It can be any of the following values:
6268
+ * - `execute_in_lago`: Lago applies the quoted deal itself, creating the subscriptions, coupons, wallets or one-off invoice it describes.
6269
+ * - `order_only`: Lago records the order without applying it, leaving the execution to your own systems.
6270
+ * @example "execute_in_lago"
6271
+ */
6272
+ export type OrderExecutionModeEnumOrNull = "execute_in_lago" | "order_only";
6273
+ /**
6274
+ * A trace of what the execution produced. Every key is always present, whichever the order type, so a reader never has to tell a missing key from an empty one; the keys that do not apply keep their empty value.
6275
+ *
6276
+ * Which ones are filled depends on the `order_type` of the quote, and only for an `execute_in_lago` order: `invoice_id` for `one_off`, `subscription_ids` with `applied_coupon_ids` and `wallet_ids` for `subscription_creation`, and the same plus `terminated_subscription_ids` for `subscription_amendment`. An `order_only` order records the mode and the timestamp alone.
6277
+ */
6278
+ export interface OrderExecutionRecordObject {
6279
+ /**
6280
+ * The date and time in UTC (ISO 8601) when the execution succeeded. It is `null` until then, and stays `null` on a failed attempt.
6281
+ * @format date-time
6282
+ * @example "2026-07-01T00:00:00Z"
6283
+ */
6284
+ executed_at: string | null;
6285
+ /** The mode the execution ran in. */
6286
+ execution_mode: OrderExecutionModeEnumOrNull;
6287
+ /**
6288
+ * Unique identifier of the one-off invoice created by the execution, created by Lago. Only for a `one_off` order.
6289
+ * @format uuid
6290
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6291
+ */
6292
+ invoice_id: string | null;
6293
+ /**
6294
+ * Unique identifiers of the subscriptions created by the execution, created by Lago.
6295
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
6296
+ */
6297
+ subscription_ids: string[];
6298
+ /**
6299
+ * Unique identifiers of the subscriptions terminated by the execution, created by Lago. Only for a `subscription_amendment` order, and only when the amendment took effect immediately and terminated the subscription it replaced. It stays empty for an amendment scheduled for the next billing period.
6300
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
6301
+ */
6302
+ terminated_subscription_ids: string[];
6303
+ /**
6304
+ * Unique identifiers of the coupons applied to the customer by the execution, created by Lago.
6305
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
6306
+ */
6307
+ applied_coupon_ids: string[];
6308
+ /**
6309
+ * Unique identifiers of the prepaid credit wallets created by the execution, created by Lago.
6310
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
6311
+ */
6312
+ wallet_ids: string[];
6313
+ /**
6314
+ * The reasons why the execution failed. It is empty unless the `status` is `failed`.
6315
+ * @example ["plan_not_found"]
6316
+ */
6317
+ errors: string[];
6318
+ }
6319
+ export interface OrderObject {
6320
+ /**
6321
+ * Unique identifier of the order, created by Lago.
6322
+ * @format uuid
6323
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6324
+ */
6325
+ lago_id: string;
6326
+ /**
6327
+ * The unique number assigned to the order by Lago.
6328
+ * @example "OR-2026-0001"
6329
+ */
6330
+ number: string;
6331
+ /**
6332
+ * The status of the order. It can be any of the following values:
6333
+ * - `created`: the order has been created from a signed order form and is waiting to be executed.
6334
+ * - `executed`: the order has been carried out. What it produced is listed in `execution_record`.
6335
+ * - `failed`: the execution was attempted and rolled back. The reasons are listed in `execution_record.errors`. Lago does not retry on its own, so a new attempt has to be triggered through the execute endpoint.
6336
+ */
6337
+ status: OrderStatusEnum;
6338
+ /**
6339
+ * The commercial motion the quote describes. It can be any of the following values:
6340
+ * - `subscription_creation`: the quote creates one or more subscriptions.
6341
+ * - `subscription_amendment`: the quote amends an existing subscription, named by the quote's own `lago_subscription_id`.
6342
+ * - `one_off`: the quote bills add-ons once, without any subscription.
6343
+ */
6344
+ order_type: QuoteOrderTypeEnum;
6345
+ /**
6346
+ * How the order is carried out. It is `null` while the order has neither been scheduled nor executed. It can be any of the following values:
6347
+ * - `execute_in_lago`: Lago applies the quoted deal itself, creating the subscriptions, coupons, wallets or one-off invoice it describes.
6348
+ * - `order_only`: Lago records the order without applying it, leaving the execution to your own systems.
6349
+ */
6350
+ execution_mode: OrderExecutionModeEnumOrNull;
6351
+ /** The currency the order is denominated in, inherited from the quote version it comes from. */
6352
+ currency: CurrencyOrNull;
6353
+ /**
6354
+ * The date and time in UTC (ISO 8601) when the order was executed. It is `null` unless the `status` is `executed`.
6355
+ * @format date-time
6356
+ * @example "2026-07-01T00:00:00Z"
6357
+ */
6358
+ executed_at: string | null;
6359
+ /**
6360
+ * A trace of what the execution produced. Every key is always present, whichever the order type, so a reader never has to tell a missing key from an empty one; the keys that do not apply keep their empty value.
6361
+ *
6362
+ * Which ones are filled depends on the `order_type` of the quote, and only for an `execute_in_lago` order: `invoice_id` for `one_off`, `subscription_ids` with `applied_coupon_ids` and `wallet_ids` for `subscription_creation`, and the same plus `terminated_subscription_ids` for `subscription_amendment`. An `order_only` order records the mode and the timestamp alone.
6363
+ */
6364
+ execution_record: OrderExecutionRecordObject;
6365
+ /**
6366
+ * Unique identifier of the organization, created by Lago.
6367
+ * @format uuid
6368
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6369
+ */
6370
+ lago_organization_id: string;
6371
+ /**
6372
+ * Unique identifier of the customer the order was placed for, created by Lago.
6373
+ * @format uuid
6374
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6375
+ */
6376
+ lago_customer_id: string;
6377
+ /**
6378
+ * Unique identifier of the signed order form the order comes from, created by Lago. An order form carries at most one order.
6379
+ * @format uuid
6380
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6381
+ */
6382
+ lago_order_form_id: string;
6383
+ /**
6384
+ * The date and time in UTC (ISO 8601) when the order was created.
6385
+ * @format date-time
6386
+ * @example "2026-04-29T08:59:51Z"
6387
+ */
6388
+ created_at: string;
6389
+ /**
6390
+ * The date and time in UTC (ISO 8601) when the order was last updated.
6391
+ * @format date-time
6392
+ * @example "2026-04-29T08:59:51Z"
6393
+ */
6394
+ updated_at: string;
6395
+ }
6396
+ export interface QuoteBillingItemAddOnObject {
6397
+ /**
6398
+ * Unique identifier of the add-on in Lago, pinned when the entry was added to the quote.
6399
+ * @format uuid
6400
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6401
+ */
6402
+ id: string;
6403
+ /**
6404
+ * Identifier of the entry within the quote version, assigned by the Lago user interface. It allows the quote document to reference the entry.
6405
+ * @example "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b"
6406
+ */
6407
+ localId: string;
6408
+ /**
6409
+ * The kind of billing item.
6410
+ * @example "add_on"
6411
+ */
6412
+ type: "add_on";
6413
+ /** A snapshot of the add-on as it was added to the quote. `code`, `units`, `unitAmountCents` and `totalAmountCents` are required to approve the version. */
6414
+ payload: {
6415
+ /**
6416
+ * Unique code identifying the add-on.
6417
+ * @example "setup_fee"
6418
+ */
6419
+ code?: string;
6420
+ /**
6421
+ * The number of units billed. It must be greater than 0.
6422
+ * @example 1
6423
+ */
6424
+ units?: number;
6425
+ /**
6426
+ * The amount of one unit, in cents, in the currency of the quote version.
6427
+ * @example 10000
6428
+ */
6429
+ unitAmountCents?: number;
6430
+ /**
6431
+ * The total amount billed for the entry, in cents, in the currency of the quote version.
6432
+ * @example 10000
6433
+ */
6434
+ totalAmountCents?: number;
6435
+ /**
6436
+ * The beginning of the period covered by the entry, in UTC (ISO 8601).
6437
+ * @format date-time
6438
+ * @example "2026-01-01T00:00:00Z"
6439
+ */
6440
+ fromDatetime?: string | null;
6441
+ /**
6442
+ * The end of the period covered by the entry, in UTC (ISO 8601).
6443
+ * @format date-time
6444
+ * @example "2026-12-31T23:59:59Z"
6445
+ */
6446
+ toDatetime?: string | null;
6447
+ };
6448
+ /** The deviations from the add-on snapshot negotiated on the quote. Only the properties set here are overridden. */
6449
+ overrides?: {
6450
+ /**
6451
+ * Overrides the description of the add-on.
6452
+ * @example "Onboarding package, discounted for the first year"
6453
+ */
6454
+ description?: string;
6455
+ /**
6456
+ * Overrides the number of units billed. It must be greater than 0.
6457
+ * @example 2
6458
+ */
6459
+ units?: number;
6460
+ /**
6461
+ * Overrides the amount of one unit, in cents.
6462
+ * @example 8000
6463
+ */
6464
+ unitAmountCents?: number;
6465
+ /**
6466
+ * Overrides the total amount billed for the entry, in cents.
6467
+ * @example 16000
6468
+ */
6469
+ totalAmountCents?: number;
6470
+ /**
6471
+ * Overrides the name of the add-on as it appears on the invoice.
6472
+ * @example "Onboarding"
6473
+ */
6474
+ invoiceDisplayName?: string;
6475
+ /**
6476
+ * Overrides the beginning of the period covered by the entry, in UTC (ISO 8601).
6477
+ * @format date-time
6478
+ * @example "2026-01-01T00:00:00Z"
6479
+ */
6480
+ fromDatetime?: string | null;
6481
+ /**
6482
+ * Overrides the end of the period covered by the entry, in UTC (ISO 8601).
6483
+ * @format date-time
6484
+ * @example "2026-12-31T23:59:59Z"
6485
+ */
6486
+ toDatetime?: string | null;
6487
+ };
6488
+ }
6489
+ export interface QuoteBillingItemPlanObject {
6490
+ /**
6491
+ * Unique identifier of the plan in Lago, pinned when the entry was added to the quote.
6492
+ * @format uuid
6493
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6494
+ */
6495
+ id: string;
6496
+ /**
6497
+ * Identifier of the entry within the quote version, assigned by the Lago user interface. It allows the quote document to reference the entry.
6498
+ * @example "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b"
6499
+ */
6500
+ localId?: string | null;
6501
+ /**
6502
+ * The kind of billing item.
6503
+ * @example "plan"
6504
+ */
6505
+ type: "plan";
6506
+ /** A snapshot of the plan as it was added to the quote, and of the subscription to create from it. Additional catalog properties may be present, as only the ones Lago reads when the quote is executed are documented here. `code` is required to approve the version. */
6507
+ payload: {
6508
+ /**
6509
+ * Unique code identifying the plan.
6510
+ * @example "premium_plan"
6511
+ */
6512
+ code?: string;
6513
+ /**
6514
+ * The external unique identifier to assign to the subscription created from the entry. For a `subscription_amendment` quote, it identifies the subscription being amended.
6515
+ * @example "sub_1234567890"
6516
+ */
6517
+ subscriptionExternalId?: string | null;
6518
+ /**
6519
+ * The name to assign to the subscription created from the entry.
6520
+ * @example "Premium plan - Acme Corp"
6521
+ */
6522
+ subscriptionName?: string | null;
6523
+ /**
6524
+ * The billing time of the subscription created from the entry.
6525
+ * @example "calendar"
6526
+ */
6527
+ billingTime?: "calendar" | "anniversary";
6528
+ /**
6529
+ * The date and time in UTC (ISO 8601) when the subscription starts. It is optional, and a plan naming none starts the moment the order is executed.
6530
+ * @example "2026-01-01T00:00:00Z"
6531
+ */
6532
+ startDate?: string | null;
6533
+ /**
6534
+ * The date and time in UTC (ISO 8601) when the subscription ends. Leaving it unset makes the deal open-ended, and on a `subscription_amendment` quote it leaves the amended subscription's own ending date in place. It bounds the deal, so the signing window and the execution date must both fall strictly before it.
6535
+ * @example "2027-01-01T00:00:00Z"
6536
+ */
6537
+ endDate?: string | null;
6538
+ /**
6539
+ * Unique identifier of the payment method to charge for the subscription, created by Lago.
6540
+ * @format uuid
6541
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6542
+ */
6543
+ paymentMethodId?: string | null;
6544
+ /** A snapshot of the usage-based charges of the plan. It pins the charge each entry of `overrides.charges` applies to. */
6545
+ charges?: any[] | null;
6546
+ /** A snapshot of the fixed charges of the plan. It pins the fixed charge each entry of `overrides.fixedCharges` applies to. */
6547
+ fixedCharges?: any[] | null;
6548
+ };
6549
+ /** The deviations from the plan snapshot negotiated on the quote. Only the properties set here are overridden. */
6550
+ overrides?: {
6551
+ /**
6552
+ * Overrides the base amount of the plan, in cents.
6553
+ * @example 50000
6554
+ */
6555
+ amountCents?: number | null;
6556
+ /** Overrides the currency the plan is priced in, which is how a catalog plan is quoted in the currency of the deal. The figure in `amountCents` is not converted, it is restated in this currency. It is set only while it differs from the catalog record, and removed once they agree. */
6557
+ amountCurrency?: CurrencyOrNull;
6558
+ /**
6559
+ * Overrides the name of the plan as it appears on the invoice.
6560
+ * @example "Premium"
6561
+ */
6562
+ invoiceDisplayName?: string | null;
6563
+ /**
6564
+ * Overrides the name of the plan.
6565
+ * @example "Premium plan - Acme Corp"
6566
+ */
6567
+ name?: string | null;
6568
+ /**
6569
+ * Overrides the description of the plan.
6570
+ * @example "Negotiated premium plan"
6571
+ */
6572
+ description?: string | null;
6573
+ /**
6574
+ * Overrides the trial period of the plan, in days.
6575
+ * @example 30
6576
+ */
6577
+ trialPeriod?: number | null;
6578
+ /** Overrides the minimum commitment of the plan. */
6579
+ minimumCommitment?: {
6580
+ /**
6581
+ * The amount of the minimum commitment, in cents. It must be greater than 0.
6582
+ * @example 100000
6583
+ */
6584
+ amountCents?: number | null;
6585
+ /**
6586
+ * The name of the minimum commitment as it appears on the invoice.
6587
+ * @example "Annual commitment"
6588
+ */
6589
+ invoiceDisplayName?: string | null;
6590
+ };
6591
+ /** Overrides the progressive billing thresholds of the plan. */
6592
+ usageThresholds?: any[] | null;
6593
+ /** Overrides the usage-based charges of the plan. Each entry applies to the charge of the same billable metric in `payload.charges`. */
6594
+ charges?: any[] | null;
6595
+ /** Overrides the fixed charges of the plan. Each entry applies to the fixed charge of the same add-on in `payload.fixedCharges`. */
6596
+ fixedCharges?: any[] | null;
6597
+ };
6598
+ }
6599
+ export interface QuoteBillingItemCouponObject {
6600
+ /**
6601
+ * Unique identifier of the coupon in Lago, pinned when the entry was added to the quote.
6602
+ * @format uuid
6603
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6604
+ */
6605
+ id: string;
6606
+ /**
6607
+ * Identifier of the entry within the quote version, assigned by the Lago user interface. It allows the quote document to reference the entry.
6608
+ * @example "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b"
6609
+ */
6610
+ localId: string;
6611
+ /**
6612
+ * The kind of billing item.
6613
+ * @example "coupon"
6614
+ */
6615
+ type: "coupon";
6616
+ /** A snapshot of the coupon as it was added to the quote. `code` and `type` are required to approve the version. */
6617
+ payload: {
6618
+ /**
6619
+ * Unique code identifying the coupon.
6620
+ * @example "welcome_offer"
6621
+ */
6622
+ code?: string;
6623
+ /**
6624
+ * Whether the coupon deducts a fixed amount or a percentage.
6625
+ * @example "fixed_amount"
6626
+ */
6627
+ type?: "fixed_amount" | "percentage";
6628
+ /**
6629
+ * The amount deducted by the coupon, in cents. Only for a `fixed_amount` coupon.
6630
+ * @example 10000
6631
+ */
6632
+ amountCents?: number | null;
6633
+ /** The currency of `amountCents`. Only for a `fixed_amount` coupon. */
6634
+ currency?: CurrencyOrNull;
6635
+ /**
6636
+ * The percentage deducted by the coupon. Only for a `percentage` coupon. It must be greater than 0.
6637
+ * @example 10.5
6638
+ */
6639
+ percentageRate?: number | null;
6640
+ /**
6641
+ * How often the coupon is deducted.
6642
+ * @example "once"
6643
+ */
6644
+ frequency?: "once" | "recurring" | "forever";
6645
+ /**
6646
+ * The number of billing periods the coupon is deducted over. Only for a `recurring` coupon. It must be greater than 0.
6647
+ * @example 3
6648
+ */
6649
+ frequencyDuration?: number | null;
6650
+ };
6651
+ /** The deviations from the coupon snapshot negotiated on the quote. Only the properties set here are overridden. */
6652
+ overrides?: {
6653
+ /**
6654
+ * Overrides the amount deducted by the coupon, in cents.
6655
+ * @example 15000
6656
+ */
6657
+ amountCents?: number | null;
6658
+ /** Overrides the currency the coupon is priced in, which is how a catalog coupon is quoted in the currency of the deal. The figure in `amountCents` is not converted, it is restated in this currency. It is set only while it differs from the catalog record, and removed once they agree. */
6659
+ amountCurrency?: CurrencyOrNull;
6660
+ /**
6661
+ * Overrides the percentage deducted by the coupon. It must be greater than 0.
6662
+ * @example 15
6663
+ */
6664
+ percentageRate?: number | null;
6665
+ /**
6666
+ * Overrides how often the coupon is deducted.
6667
+ * @example "recurring"
6668
+ */
6669
+ frequency?: "once" | "recurring" | "forever";
6670
+ /**
6671
+ * Overrides the number of billing periods the coupon is deducted over. It must be greater than 0.
6672
+ * @example 6
6673
+ */
6674
+ frequencyDuration?: number | null;
6675
+ };
6676
+ }
6677
+ export interface QuoteBillingItemWalletCreditObject {
6678
+ /**
6679
+ * Identifier of the entry within the quote version, assigned by the Lago user interface. It allows the quote document to reference the entry.
6680
+ * @example "b5c1e2a4-4e1e-4a7f-9f0e-9c1a0c7e1f2b"
6681
+ */
6682
+ localId: string;
6683
+ /**
6684
+ * The kind of billing item.
6685
+ * @example "wallet_credit"
6686
+ */
6687
+ type: "wallet_credit";
6688
+ /** The prepaid credit wallet to create for the customer. Unlike the other billing items, a wallet credit is not built from an existing record, so it carries no `id` and no `overrides`. `paidCredits`, `grantedCredits` and `rateAmount` are required to approve the version. */
6689
+ payload: {
6690
+ /**
6691
+ * The number of credits the customer pays for.
6692
+ * @example "100.0"
6693
+ */
6694
+ paidCredits?: string | null;
6695
+ /**
6696
+ * The number of credits granted for free.
6697
+ * @example "20.0"
6698
+ */
6699
+ grantedCredits?: string | null;
6700
+ /**
6701
+ * The value of one credit, in the currency of the wallet.
6702
+ * @example "1.0"
6703
+ */
6704
+ rateAmount?: string | null;
6705
+ /** The currency of the wallet. */
6706
+ currency?: CurrencyOrNull;
6707
+ /**
6708
+ * The date and time in UTC (ISO 8601) when the credits expire.
6709
+ * @format date-time
6710
+ * @example "2027-01-01T00:00:00Z"
6711
+ */
6712
+ expirationAt?: string | null;
6713
+ /** The limitations restricting what the credits can be spent on. */
6714
+ appliesTo?: {
6715
+ /**
6716
+ * The fee types the credits can be spent on.
6717
+ * @example ["charge"]
6718
+ */
6719
+ feeTypes?: any[] | null;
6720
+ /**
6721
+ * The codes of the billable metrics the credits can be spent on.
6722
+ * @example ["api_calls"]
6723
+ */
6724
+ billableMetricCodes?: any[] | null;
6725
+ };
6726
+ /** The rule automatically topping the wallet up. At most one rule is allowed, and its `trigger` is required, to approve the version. */
6727
+ recurringTransactionRules?: any[] | null;
6728
+ };
6729
+ }
6730
+ /**
6731
+ * A snapshot of everything the quote bills. Unlike the rest of the Lago API, the keys nested in this object are camelCased: the object is stored and returned as it is authored in the Lago user interface.
6732
+ *
6733
+ * Which top-level keys are present depends on the `order_type` of the parent quote:
6734
+ * - `one_off`: `addOns`.
6735
+ * - `subscription_creation` and `subscription_amendment`: `plans`, plus the optional `coupons` and `walletCredits`.
6736
+ *
6737
+ * Every entry pins the catalog record it was built from through its `id` and its `payload`, so that an approved quote keeps billing what was approved even if the catalog changes afterwards. The optional `overrides` object carries the deviations from that record negotiated on the quote.
6738
+ *
6739
+ * This object is the single source of truth for the term of the deal. Three of its nested dates bound that term, because the execution flow refuses them once past: `plans[].payload.endDate`, `walletCredits[].payload.expirationAt` and the `expirationAt` of a wallet credit's recurring top-up rule. The earliest of them is the day the deal stops being executable, and both the signing window and the execution date must fall strictly before it. A `one_off` quote carries none of them and is never bounded.
6740
+ *
6741
+ * On a `draft` version this object may be incomplete: only the properties documented as required below are enforced on every save, the others are enforced when the version is approved.
6742
+ */
6743
+ export interface QuoteBillingItems {
6744
+ /** The add-ons billed once by a `one_off` quote. At least one entry is required to approve the version. */
6745
+ addOns?: QuoteBillingItemAddOnObject[];
6746
+ /** The plans subscribed to, or amended, by a `subscription_creation` or `subscription_amendment` quote. At least one entry is required to approve the version. */
6747
+ plans?: QuoteBillingItemPlanObject[];
6748
+ /** The coupons applied to the customer when the quote is executed. */
6749
+ coupons?: QuoteBillingItemCouponObject[];
6750
+ /** The prepaid credit wallets created for the customer when the quote is executed. */
6751
+ walletCredits?: QuoteBillingItemWalletCreditObject[];
6752
+ }
6753
+ export type OrderObjectExtended = OrderObject & {
6754
+ /** The billing items of the quote version the order comes from, as they stood when it was approved. This is what the execution applies. It is omitted from the webhook payloads, being a heavy blob. */
6755
+ billing_snapshot: QuoteBillingItems;
6756
+ };
6757
+ export interface OrdersPaginated {
6758
+ orders: OrderObjectExtended[];
6759
+ meta: PaginationMeta;
6760
+ }
6761
+ export interface Order {
6762
+ order: OrderObjectExtended;
6763
+ }
6764
+ /** Parameters available when executing an order. The body is optional, as the execution mode is normally chosen when the order form is signed. */
6765
+ export interface OrderExecuteInput {
6766
+ order?: {
6767
+ /** How the order is carried out. It is only persisted when it differs from the mode already stored on the order, so restating the current mode never fails. Changing the mode of an order that has already been executed is rejected. */
6768
+ execution_mode?: OrderExecutionModeEnum;
6769
+ };
6770
+ }
6771
+ /** The custom billing settings for your organization. */
6772
+ export interface OrganizationBillingConfiguration {
6773
+ /**
6774
+ * The customer invoice message that appears at the bottom of each billing documents.
6775
+ * @example "This is my customer footer"
6776
+ */
6777
+ invoice_footer?: string | null;
6778
+ /**
6779
+ * The grace period, expressed in days, for finalizing the invoice. This period refers to the additional time granted to your customers beyond the invoice due date to adjust usage and line items. Can be overwritten by the customer's grace period.
6780
+ * @example 3
6781
+ */
6782
+ invoice_grace_period?: number;
6783
+ /**
6784
+ * The locale of the billing documents, expressed in the ISO 639-1 format. This field indicates the language or regional variant used for the documents content issued or the embeddable customer portal.
6785
+ * @example "en"
6786
+ */
6787
+ document_locale?: string;
6788
+ }
6789
+ export interface OrganizationUpdateInput {
6790
+ organization: {
6791
+ /**
6792
+ * The URL of your newest updated webhook endpoint. This URL allows your organization to receive important messages, notifications, or data from the Lago system. By configuring your webhook endpoint to this URL, you can ensure that your organization stays informed and receives relevant information in a timely manner.
6793
+ * @example "https://webhook.brex.com"
6794
+ */
6795
+ webhook_url?: string | null;
6796
+ /**
6797
+ * The country of your organization.
6798
+ * @example "US"
6799
+ */
6800
+ country?: CountryOrNull;
6801
+ /**
6802
+ * The default currency of an organization.
6803
+ * @example "USD"
6804
+ */
6805
+ default_currency?: Currency;
6806
+ /**
6807
+ * The first line of your organization's billing address.
6808
+ * @example "100 Brex Street"
6809
+ */
6810
+ address_line1?: string | null;
6811
+ /**
6812
+ * The second line of your organization's billing address.
6813
+ * @example null
6814
+ */
6815
+ address_line2?: string | null;
6816
+ /**
6817
+ * The state of your organization's billing address.
6818
+ * @example "NYC"
6819
+ */
6820
+ state?: string | null;
6821
+ /**
6822
+ * The zipcode of your organization's billing address.
6823
+ * @example "10000"
6824
+ */
6825
+ zipcode?: string | null;
6826
+ /**
6827
+ * The email address of your organization used to bill your customers.
6828
+ * @format email
6829
+ * @example "brex@brex.com"
6830
+ */
6831
+ email?: string | null;
6832
+ /**
6833
+ * The city of your organization's billing address.
6834
+ * @example "New York"
6835
+ */
6836
+ city?: string | null;
6837
+ /**
6838
+ * The legal name of your organization.
6839
+ * @example null
6840
+ */
6841
+ legal_name?: string | null;
6842
+ /**
6843
+ * The legal number of your organization.
6844
+ * @example null
6845
+ */
6846
+ legal_number?: string | null;
6847
+ /**
6848
+ * This parameter configures the method of incrementing invoice numbers for your customers.
6849
+ *
6850
+ * - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern.
6851
+ * - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month.
6852
+ *
6853
+ * The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer.
6854
+ * @example "per_customer"
6855
+ */
6856
+ document_numbering?: "per_customer" | "per_organization";
6857
+ /**
6858
+ * Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago.
6859
+ * @example "ORG-1234"
6860
+ */
6861
+ document_number_prefix?: string;
6862
+ /**
6863
+ * The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
6864
+ * @example 30
6865
+ */
6866
+ net_payment_term?: number;
6867
+ /**
6868
+ * The tax identification number of your organization.
6869
+ * @example "US123456789"
6870
+ */
6871
+ tax_identification_number?: string | null;
6872
+ /**
6873
+ * Your organization's timezone, used for billing purposes in your own local time. Can be overwritten by the customer's timezone.
6874
+ * @example "America/New_York"
6875
+ */
6876
+ timezone?: Timezone;
6877
+ /**
6878
+ * Represents the email settings of the organization. It allows you to define which documents are sent by email. The field value determines the types of documents that trigger email notifications. Possible values for are `invoice.finalized` and `credit_note.created`. By configuring this field, you can specify whether invoices, credit notes, or both should be sent to recipients via email.
6879
+ * @example ["invoice.finalized","credit_note.created"]
6880
+ */
6881
+ email_settings?: ("invoice.finalized" | "credit_note.created")[];
6882
+ /** The custom billing settings for your organization. */
6883
+ billing_configuration?: OrganizationBillingConfiguration;
6884
+ /**
6885
+ * Determines whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
6886
+ * @example false
6887
+ */
6888
+ finalize_zero_amount_invoice?: boolean;
6889
+ };
6890
+ }
6891
+ export interface OrganizationObject {
6892
+ /**
6893
+ * Unique identifier assigned to the organization within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the organization's record within the Lago system
6894
+ * @format uuid
6895
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6896
+ */
6897
+ lago_id: string;
6898
+ /**
6899
+ * The name of your organization.
6900
+ * @example "Name1"
6901
+ */
6902
+ name: string;
6903
+ /**
6904
+ * The date of creation of your organization, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
6179
6905
  * @format date-time
6180
6906
  * @example "2022-05-02T13:04:09Z"
6181
6907
  */
@@ -7748,41 +8474,249 @@ export type FixedChargeInput = FixedChargeOverridableInput & {
7748
8474
  /**
7749
8475
  * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
7750
8476
  *
7751
- * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
7752
- * - If set to `false`, the charge is billed in full.
7753
- * @example false
8477
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
8478
+ * - If set to `false`, the charge is billed in full.
8479
+ * @example false
8480
+ */
8481
+ prorated?: boolean;
8482
+ };
8483
+ export interface FixedChargeCreateInput {
8484
+ fixed_charge: FixedChargeInput & {
8485
+ /**
8486
+ * This field determines whether the creation of the fixed charge should be cascaded to the children plans. When set to `true`, the fixed charge will be created in children plans. Conversely, when set to `false`, the fixed charge will only be created in the plan itself. If not defined in the request, default value is `false`.
8487
+ * @example true
8488
+ */
8489
+ cascade_updates?: boolean;
8490
+ };
8491
+ }
8492
+ export interface FixedCharge {
8493
+ fixed_charge: FixedChargeObject;
8494
+ }
8495
+ export interface FixedChargeUpdateInput {
8496
+ fixed_charge: FixedChargeInput & {
8497
+ /**
8498
+ * This field determines whether the changes made to the fixed charge should be cascaded to the children plans. When set to `true`, the changes will be cascaded into children. Conversely, when set to `false`, the changes will only be applied to the plan itself. If not defined in the request, default value is `false`.
8499
+ * @example true
8500
+ */
8501
+ cascade_updates?: boolean;
8502
+ };
8503
+ }
8504
+ export interface FixedChargeDeleteInput {
8505
+ fixed_charge?: {
8506
+ /**
8507
+ * When set to `true`, the deletion will be cascaded to the children plans.
8508
+ * @example true
8509
+ */
8510
+ cascade_updates?: boolean;
8511
+ };
8512
+ }
8513
+ export interface QuoteBaseObject {
8514
+ /**
8515
+ * Unique identifier of the quote, created by Lago.
8516
+ * @format uuid
8517
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8518
+ */
8519
+ lago_id: string;
8520
+ /**
8521
+ * The unique number assigned to the quote by Lago.
8522
+ * @example "QT-2026-0001"
8523
+ */
8524
+ number: string;
8525
+ /**
8526
+ * The commercial motion the quote describes. It can be any of the following values:
8527
+ * - `subscription_creation`: the quote creates one or more subscriptions.
8528
+ * - `subscription_amendment`: the quote amends an existing subscription, named by the quote's own `lago_subscription_id`.
8529
+ * - `one_off`: the quote bills add-ons once, without any subscription.
8530
+ */
8531
+ order_type: QuoteOrderTypeEnum;
8532
+ /**
8533
+ * Unique identifier of the customer the quote is addressed to, created by Lago.
8534
+ * @format uuid
8535
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8536
+ */
8537
+ lago_customer_id: string;
8538
+ /**
8539
+ * Unique identifier of the subscription the quote amends, created by Lago. It is set only when the `order_type` is `subscription_amendment`.
8540
+ * @format uuid
8541
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8542
+ */
8543
+ lago_subscription_id: string | null;
8544
+ /**
8545
+ * Unique identifier of the organization, created by Lago.
8546
+ * @format uuid
8547
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8548
+ */
8549
+ lago_organization_id: string;
8550
+ /**
8551
+ * The date and time in UTC (ISO 8601) when the quote was created.
8552
+ * @format date-time
8553
+ * @example "2026-04-29T08:59:51Z"
8554
+ */
8555
+ created_at: string;
8556
+ /**
8557
+ * The date and time in UTC (ISO 8601) when the quote was last updated.
8558
+ * @format date-time
8559
+ * @example "2026-04-29T08:59:51Z"
8560
+ */
8561
+ updated_at: string;
8562
+ }
8563
+ /**
8564
+ * The status of the quote version. It can be any of the following values:
8565
+ * - `draft`: the version is still editable.
8566
+ * - `approved`: the version has been approved and an order form has been generated from it.
8567
+ * - `voided`: the version is no longer actionable.
8568
+ *
8569
+ * A quote has at most one version in `draft` or `approved` status at any time; all the other versions are `voided`.
8570
+ * @example "draft"
8571
+ */
8572
+ export type QuoteVersionStatusEnum = "draft" | "approved" | "voided";
8573
+ /**
8574
+ * The reason why the quote version was voided. It is `null` unless the `status` is `voided`. It can be any of the following values:
8575
+ * - `manual`: voided explicitly, through the API or the Lago user interface.
8576
+ * - `superseded`: voided because the version was cloned into a new draft.
8577
+ * - `cascade_of_expired`: voided because the order form generated from the version expired.
8578
+ * - `cascade_of_voided`: voided because the order form generated from the version was voided.
8579
+ * @example "manual"
8580
+ */
8581
+ export type QuoteVersionVoidReasonEnum = "manual" | "superseded" | "cascade_of_expired" | "cascade_of_voided";
8582
+ export interface QuoteVersionObject {
8583
+ /**
8584
+ * Unique identifier of the quote version, created by Lago.
8585
+ * @format uuid
8586
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8587
+ */
8588
+ lago_id: string;
8589
+ /**
8590
+ * Unique identifier of the quote the version belongs to, created by Lago.
8591
+ * @format uuid
8592
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8593
+ */
8594
+ lago_quote_id: string;
8595
+ /**
8596
+ * Unique identifier of the organization, created by Lago.
8597
+ * @format uuid
8598
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8599
+ */
8600
+ lago_organization_id: string;
8601
+ /**
8602
+ * The number of the version within the quote. It starts at 1 and increases by 1 for every new version created by cloning.
8603
+ * @example 1
8604
+ */
8605
+ version: number;
8606
+ /**
8607
+ * The status of the quote version. It can be any of the following values:
8608
+ * - `draft`: the version is still editable.
8609
+ * - `approved`: the version has been approved and an order form has been generated from it.
8610
+ * - `voided`: the version is no longer actionable.
8611
+ *
8612
+ * A quote has at most one version in `draft` or `approved` status at any time; all the other versions are `voided`.
8613
+ */
8614
+ status: QuoteVersionStatusEnum;
8615
+ /** The currency the version is quoted in. */
8616
+ currency: CurrencyOrNull;
8617
+ /**
8618
+ * Unique code identifying the billing entity that issues the deal. It is resolved rather than stored: the version's own entity when it names one, then the entity of the subscription being amended for a `subscription_amendment` quote, then the customer's own. It is `null` when none of them resolves. An amendment cannot name an entity itself, since the subscription it restates is already bound to one, and naming one on an amendment is rejected.
8619
+ * @example "acme_corp"
8620
+ */
8621
+ billing_entity_code: string | null;
8622
+ /**
8623
+ * The reason why the quote version was voided. It is `null` unless the `status` is `voided`. It can be any of the following values:
8624
+ * - `manual`: voided explicitly, through the API or the Lago user interface.
8625
+ * - `superseded`: voided because the version was cloned into a new draft.
8626
+ * - `cascade_of_expired`: voided because the order form generated from the version expired.
8627
+ * - `cascade_of_voided`: voided because the order form generated from the version was voided.
8628
+ */
8629
+ void_reason: QuoteVersionVoidReasonEnum;
8630
+ /**
8631
+ * The date and time in UTC (ISO 8601) when the version was approved. It is `null` unless the `status` is `approved`.
8632
+ * @format date-time
8633
+ * @example "2026-04-29T08:59:51Z"
8634
+ */
8635
+ approved_at: string | null;
8636
+ /**
8637
+ * The date and time in UTC (ISO 8601) when the version was voided. It is `null` unless the `status` is `voided`.
8638
+ * @format date-time
8639
+ * @example "2026-04-29T08:59:51Z"
8640
+ */
8641
+ voided_at: string | null;
8642
+ /**
8643
+ * The date and time in UTC (ISO 8601) when the version was created.
8644
+ * @format date-time
8645
+ * @example "2026-04-29T08:59:51Z"
8646
+ */
8647
+ created_at: string;
8648
+ /**
8649
+ * The date and time in UTC (ISO 8601) when the version was last updated.
8650
+ * @format date-time
8651
+ * @example "2026-04-29T08:59:51Z"
8652
+ */
8653
+ updated_at: string;
8654
+ }
8655
+ export type QuoteObject = QuoteBaseObject & {
8656
+ /** The latest version of the quote. Its `content` and `billing_items` are omitted here; retrieve the version to get them. */
8657
+ current_version: QuoteVersionObject | null;
8658
+ };
8659
+ export interface QuotesPaginated {
8660
+ quotes: QuoteObject[];
8661
+ meta: PaginationMeta;
8662
+ }
8663
+ export interface QuoteOwnerObject {
8664
+ /**
8665
+ * Unique identifier of the user owning the quote, created by Lago.
8666
+ * @format uuid
8667
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8668
+ */
8669
+ lago_id: string;
8670
+ /**
8671
+ * The email address of the user owning the quote.
8672
+ * @format email
8673
+ * @example "sales@getlago.com"
8674
+ */
8675
+ email: string | null;
8676
+ }
8677
+ export type QuoteObjectExtended = QuoteObject & {
8678
+ /** The users of the organization responsible for the quote. */
8679
+ owners: QuoteOwnerObject[];
8680
+ };
8681
+ export interface Quote {
8682
+ quote: QuoteObjectExtended;
8683
+ }
8684
+ export interface QuoteVersionsPaginated {
8685
+ quote_versions: QuoteVersionObject[];
8686
+ meta: PaginationMeta;
8687
+ }
8688
+ export type QuoteVersionObjectExtended = QuoteVersionObject & {
8689
+ /**
8690
+ * The HTML body of the quote document, as authored in the Lago user interface. It may reference the entries of `billing_items` through their `localId`.
8691
+ * @example "<h1>Quote QT-2026-0001</h1><p>Prepared for Acme Corp.</p>"
8692
+ */
8693
+ content: string | null;
8694
+ /**
8695
+ * A snapshot of everything the quote bills. Unlike the rest of the Lago API, the keys nested in this object are camelCased: the object is stored and returned as it is authored in the Lago user interface.
8696
+ *
8697
+ * Which top-level keys are present depends on the `order_type` of the parent quote:
8698
+ * - `one_off`: `addOns`.
8699
+ * - `subscription_creation` and `subscription_amendment`: `plans`, plus the optional `coupons` and `walletCredits`.
8700
+ *
8701
+ * Every entry pins the catalog record it was built from through its `id` and its `payload`, so that an approved quote keeps billing what was approved even if the catalog changes afterwards. The optional `overrides` object carries the deviations from that record negotiated on the quote.
8702
+ *
8703
+ * This object is the single source of truth for the term of the deal. Three of its nested dates bound that term, because the execution flow refuses them once past: `plans[].payload.endDate`, `walletCredits[].payload.expirationAt` and the `expirationAt` of a wallet credit's recurring top-up rule. The earliest of them is the day the deal stops being executable, and both the signing window and the execution date must fall strictly before it. A `one_off` quote carries none of them and is never bounded.
8704
+ *
8705
+ * On a `draft` version this object may be incomplete: only the properties documented as required below are enforced on every save, the others are enforced when the version is approved.
7754
8706
  */
7755
- prorated?: boolean;
8707
+ billing_items: QuoteBillingItems;
7756
8708
  };
7757
- export interface FixedChargeCreateInput {
7758
- fixed_charge: FixedChargeInput & {
7759
- /**
7760
- * This field determines whether the creation of the fixed charge should be cascaded to the children plans. When set to `true`, the fixed charge will be created in children plans. Conversely, when set to `false`, the fixed charge will only be created in the plan itself. If not defined in the request, default value is `false`.
7761
- * @example true
7762
- */
7763
- cascade_updates?: boolean;
7764
- };
7765
- }
7766
- export interface FixedCharge {
7767
- fixed_charge: FixedChargeObject;
8709
+ export interface QuoteVersion {
8710
+ quote_version: QuoteVersionObjectExtended;
7768
8711
  }
7769
- export interface FixedChargeUpdateInput {
7770
- fixed_charge: FixedChargeInput & {
7771
- /**
7772
- * This field determines whether the changes made to the fixed charge should be cascaded to the children plans. When set to `true`, the changes will be cascaded into children. Conversely, when set to `false`, the changes will only be applied to the plan itself. If not defined in the request, default value is `false`.
7773
- * @example true
7774
- */
7775
- cascade_updates?: boolean;
7776
- };
7777
- }
7778
- export interface FixedChargeDeleteInput {
7779
- fixed_charge?: {
7780
- /**
7781
- * When set to `true`, the deletion will be cascaded to the children plans.
7782
- * @example true
7783
- */
7784
- cascade_updates?: boolean;
7785
- };
8712
+ /** Parameters available when approving a quote version. */
8713
+ export interface QuoteVersionApproveInput {
8714
+ /**
8715
+ * The date and time in UTC (ISO 8601) when the order form generated by the approval expires. It must be in the future, and must fall strictly before the day the quoted deal stops being executable, otherwise the approval is rejected with a `422`. That boundary is the earliest of the `endDate` of any quoted plan and the `expirationAt` of any quoted wallet credit or recurring top-up rule. A `one_off` quote carries none of them, so its signing window is never bounded. When `expires_at` is omitted, the order form never expires.
8716
+ * @format date-time
8717
+ * @example "2026-06-30T23:59:59Z"
8718
+ */
8719
+ expires_at?: string;
7786
8720
  }
7787
8721
  /** Based plan overrides. */
7788
8722
  export interface PlanOverridesObject {
@@ -7906,7 +8840,10 @@ export interface PlanOverridesObject {
7906
8840
  /** List of taxes applied to the fixed charge. */
7907
8841
  tax_codes?: TaxCodes;
7908
8842
  }[];
7909
- /** List of usage thresholds applied to the subscription. */
8843
+ /**
8844
+ * **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.
8845
+ * @deprecated
8846
+ */
7910
8847
  usage_thresholds?: UsageThresholdInput[];
7911
8848
  /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
7912
8849
  metadata?: MetadataInput;
@@ -8003,6 +8940,25 @@ export interface SubscriptionCreateInput {
8003
8940
  * @example true
8004
8941
  */
8005
8942
  consolidate_invoice?: boolean;
8943
+ /**
8944
+ * The purchase order number associated with the subscription. It will be added to invoices generated for this subscription.
8945
+ * @example "PO-123"
8946
+ */
8947
+ purchase_order_number?: string | null;
8948
+ /**
8949
+ * 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).
8950
+ *
8951
+ * Set to `true` to switch progressive billing off for this subscription specifically, without changing the plan's thresholds.
8952
+ * @default false
8953
+ * @example true
8954
+ */
8955
+ progressive_billing_disabled?: boolean;
8956
+ /**
8957
+ * 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.
8958
+ *
8959
+ * This field cannot be combined with `plan_overrides.usage_thresholds` in the same request.
8960
+ */
8961
+ usage_thresholds?: UsageThresholdInput[];
8006
8962
  /** 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
8963
  activation_rules?: SubscriptionActivationRuleInput[];
8008
8964
  };
@@ -8075,6 +9031,25 @@ export interface SubscriptionUpdateInput {
8075
9031
  * @example "default"
8076
9032
  */
8077
9033
  billing_entity_code?: string;
9034
+ /**
9035
+ * The purchase order number associated with the subscription. It will be added to invoices generated for this subscription.
9036
+ * @example "PO-123"
9037
+ */
9038
+ purchase_order_number?: string | null;
9039
+ /**
9040
+ * 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).
9041
+ *
9042
+ * 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.
9043
+ * @default false
9044
+ * @example true
9045
+ */
9046
+ progressive_billing_disabled?: boolean;
9047
+ /**
9048
+ * 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.
9049
+ *
9050
+ * 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.
9051
+ */
9052
+ usage_thresholds?: UsageThresholdInput[];
8078
9053
  /** 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
9054
  activation_rules?: SubscriptionActivationRuleInput[];
8080
9055
  };
@@ -8417,6 +9392,11 @@ export interface WalletTransactionCreateInput {
8417
9392
  * @example false
8418
9393
  */
8419
9394
  ignore_paid_top_up_limits?: boolean;
9395
+ /**
9396
+ * 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`.
9397
+ * @example "PO-123"
9398
+ */
9399
+ purchase_order_number?: string | null;
8420
9400
  /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
8421
9401
  invoice_custom_section?: InvoiceCustomSectionInput;
8422
9402
  /** Optional payment method to use for processing the wallet transaction payment. */
@@ -8549,6 +9529,11 @@ export interface WalletTransactionObject {
8549
9529
  applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
8550
9530
  /** The payment method assigned to this wallet transaction for processing the payment. */
8551
9531
  payment_method: PaymentMethodReference;
9532
+ /**
9533
+ * 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`.
9534
+ * @example "PO-123"
9535
+ */
9536
+ purchase_order_number?: string | null;
8552
9537
  }
8553
9538
  export interface WalletTransactions {
8554
9539
  wallet_transactions: WalletTransactionObject[];
@@ -8674,8 +9659,8 @@ export interface WebhookEndpointObject {
8674
9659
  */
8675
9660
  lago_organization_id: string;
8676
9661
  /**
8677
- * The name of the wallet.
8678
- * @example "Prepaid"
9662
+ * The URL of the webhook endpoint.
9663
+ * @example "https://foo.bar"
8679
9664
  */
8680
9665
  webhook_url: string;
8681
9666
  /**
@@ -8683,6 +9668,16 @@ export interface WebhookEndpointObject {
8683
9668
  * @example "hmac"
8684
9669
  */
8685
9670
  signature_algo?: "jwt" | "hmac";
9671
+ /**
9672
+ * The name of the webhook.
9673
+ * @example "EC2-production"
9674
+ */
9675
+ name?: string | null;
9676
+ /**
9677
+ * A list of event types that will trigger the webhook. Passing null means that all event types will be sent.
9678
+ * @example ["invoice.voided","customer.created"]
9679
+ */
9680
+ event_types?: any[] | null;
8686
9681
  /**
8687
9682
  * The date of the webhook endpoint creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
8688
9683
  * @format date-time
@@ -8706,6 +9701,16 @@ export interface WebhookEndpointCreateInput {
8706
9701
  * @example "hmac"
8707
9702
  */
8708
9703
  signature_algo?: "jwt" | "hmac";
9704
+ /**
9705
+ * The name of the webhook.
9706
+ * @example "EC2-production"
9707
+ */
9708
+ name?: string | null;
9709
+ /**
9710
+ * A list of event types that will trigger the webhook. Passing null means that all event types will be sent.
9711
+ * @example ["invoice.voided","customer.created"]
9712
+ */
9713
+ event_types?: any[] | null;
8709
9714
  };
8710
9715
  }
8711
9716
  export interface WebhookEndpoint {
@@ -8723,6 +9728,16 @@ export interface WebhookEndpointUpdateInput {
8723
9728
  * @example "hmac"
8724
9729
  */
8725
9730
  signature_algo?: "jwt" | "hmac";
9731
+ /**
9732
+ * The name of the webhook.
9733
+ * @example "EC2-production"
9734
+ */
9735
+ name?: string | null;
9736
+ /**
9737
+ * A list of event types that will trigger the webhook. Passing null means that all event types will be sent.
9738
+ * @example ["invoice.voided","customer.created"]
9739
+ */
9740
+ event_types?: any[] | null;
8726
9741
  };
8727
9742
  }
8728
9743
  export interface TriggeredAlertObject {
@@ -9132,6 +10147,10 @@ export interface PaymentRequestPaymentFailureObject {
9132
10147
  payment_provider_code?: string;
9133
10148
  provider_error?: string | Record<string, any>;
9134
10149
  }
10150
+ export type QuoteWithVersionObject = QuoteBaseObject & {
10151
+ /** The version of the quote the event happened to. It is not necessarily the current version of the quote, as a `quote.voided` event triggered by a clone names the version that was voided while the quote already carries its replacement. Its `content` and `billing_items` are omitted here; retrieve the version to get them. */
10152
+ version: QuoteVersionObject;
10153
+ };
9135
10154
  export type SubscriptionWithCustomerObject = SubscriptionObject & {
9136
10155
  plan: PlanObject;
9137
10156
  customer: CustomerObject;
@@ -9242,7 +10261,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
9242
10261
  }
9243
10262
  /**
9244
10263
  * @title Lago API documentation
9245
- * @version 1.50.0
10264
+ * @version 1.52.0
9246
10265
  * @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
9247
10266
  * @baseUrl https://api.getlago.com/api/v1
9248
10267
  * @externalDocs https://github.com/getlago
@@ -10005,6 +11024,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10005
11024
  * @example "INV-001-002"
10006
11025
  */
10007
11026
  invoice_number?: string;
11027
+ /**
11028
+ * Filter by the invoice purchase order number. The match is exact but case-insensitive.
11029
+ * @example "PO-123"
11030
+ */
11031
+ purchase_order_number?: string;
10008
11032
  /**
10009
11033
  * Filter credit notes of at least a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types.
10010
11034
  * @example 9000
@@ -10313,6 +11337,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10313
11337
  * @example "INV-001-002"
10314
11338
  */
10315
11339
  invoice_number?: string;
11340
+ /**
11341
+ * Filter by the invoice purchase order number. The match is exact but case-insensitive.
11342
+ * @example "PO-123"
11343
+ */
11344
+ purchase_order_number?: string;
10316
11345
  /**
10317
11346
  * Filter credit notes of at least a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types.
10318
11347
  * @example 9000
@@ -10402,6 +11431,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10402
11431
  * @example "someValue"
10403
11432
  */
10404
11433
  "metadata[key]"?: string;
11434
+ /**
11435
+ * Filter by the invoice purchase order number. The match is exact but case-insensitive.
11436
+ * @example "PO-123"
11437
+ */
11438
+ purchase_order_number?: string;
10405
11439
  }, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10406
11440
  /**
10407
11441
  * @description This endpoint is used to list all payments of a customer
@@ -11208,6 +12242,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11208
12242
  * @example "someValue"
11209
12243
  */
11210
12244
  "metadata[key]"?: string;
12245
+ /**
12246
+ * Filter by the invoice purchase order number. The match is exact but case-insensitive.
12247
+ * @example "PO-123"
12248
+ */
12249
+ purchase_order_number?: string;
11211
12250
  }, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized>>;
11212
12251
  /**
11213
12252
  * @description This endpoint is used for updating an existing invoice.
@@ -11229,6 +12268,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11229
12268
  * @secure
11230
12269
  */
11231
12270
  findInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
12271
+ /**
12272
+ * @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.
12273
+ *
12274
+ * @tags invoices
12275
+ * @name DeleteInvoice
12276
+ * @summary Delete a draft invoice
12277
+ * @request DELETE:/invoices/{lago_id}
12278
+ * @secure
12279
+ */
12280
+ deleteInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
11232
12281
  /**
11233
12282
  * @description This endpoint is used for downloading a specific invoice PDF document.
11234
12283
  *
@@ -11323,6 +12372,201 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11323
12372
  */
11324
12373
  voidInvoice: (lagoId: string, data?: InvoiceVoidInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
11325
12374
  };
12375
+ orderForms: {
12376
+ /**
12377
+ * @description This endpoint is used to list all existing order forms. This is a premium feature.
12378
+ *
12379
+ * @tags order_forms
12380
+ * @name FindAllOrderForms
12381
+ * @summary List all order forms
12382
+ * @request GET:/order_forms
12383
+ * @secure
12384
+ */
12385
+ findAllOrderForms: (query?: {
12386
+ /**
12387
+ * Page number.
12388
+ * @example 1
12389
+ */
12390
+ page?: number;
12391
+ /**
12392
+ * Number of records per page.
12393
+ * @example 20
12394
+ */
12395
+ per_page?: number;
12396
+ /** Filter order forms by status. Possible values are `generated`, `signed`, `expired` and `voided`. */
12397
+ "status[]"?: ("generated" | "signed" | "expired" | "voided")[];
12398
+ /**
12399
+ * Filter order forms by the Lago identifiers of their customers.
12400
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
12401
+ */
12402
+ "customer_id[]"?: string[];
12403
+ /**
12404
+ * Filter order forms by their number, as assigned by Lago.
12405
+ * @example ["OF-2026-0001","OF-2026-0002"]
12406
+ */
12407
+ "number[]"?: string[];
12408
+ /**
12409
+ * Filter order forms by the number of the quote they come from.
12410
+ * @example ["QT-2026-0001"]
12411
+ */
12412
+ "quote_number[]"?: string[];
12413
+ /**
12414
+ * Filter order forms by the Lago identifiers of the users owning the quote they come from.
12415
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
12416
+ */
12417
+ "owner_id[]"?: string[];
12418
+ /**
12419
+ * Search order forms by number.
12420
+ * @example "OF-2026"
12421
+ */
12422
+ search_term?: string;
12423
+ /**
12424
+ * Filter order forms created from a specific date and time, in UTC (ISO 8601).
12425
+ * @format date-time
12426
+ * @example "2026-01-01T00:00:00Z"
12427
+ */
12428
+ created_at_from?: string;
12429
+ /**
12430
+ * Filter order forms created up to a specific date and time, in UTC (ISO 8601).
12431
+ * @format date-time
12432
+ * @example "2026-12-31T23:59:59Z"
12433
+ */
12434
+ created_at_to?: string;
12435
+ /**
12436
+ * Filter order forms expiring from a specific date and time, in UTC (ISO 8601). Order forms that never expire are excluded.
12437
+ * @format date-time
12438
+ * @example "2026-01-01T00:00:00Z"
12439
+ */
12440
+ expires_at_from?: string;
12441
+ /**
12442
+ * Filter order forms expiring up to a specific date and time, in UTC (ISO 8601). Order forms that never expire are excluded.
12443
+ * @format date-time
12444
+ * @example "2026-12-31T23:59:59Z"
12445
+ */
12446
+ expires_at_to?: string;
12447
+ }, params?: RequestParams) => Promise<HttpResponse<OrderFormsPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden>>;
12448
+ /**
12449
+ * @description This endpoint retrieves a specific order form. This is a premium feature.
12450
+ *
12451
+ * @tags order_forms
12452
+ * @name FindOrderForm
12453
+ * @summary Retrieve an order form
12454
+ * @request GET:/order_forms/{lago_id}
12455
+ * @secure
12456
+ */
12457
+ findOrderForm: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<OrderForm, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
12458
+ /**
12459
+ * @description This endpoint records the customer's signature on an order form, and creates the order that carries the quoted deal out. Only a `generated` order form can be signed, so a `422` is returned once the order form has been signed, has expired or has been voided. An `execute_at` landing on or after the day the quoted deal stops being executable is rejected as well, so the order can never be scheduled past the term it bills. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
12460
+ *
12461
+ * @tags order_forms
12462
+ * @name MarkOrderFormAsSigned
12463
+ * @summary Mark an order form as signed
12464
+ * @request POST:/order_forms/{lago_id}/mark_as_signed
12465
+ * @secure
12466
+ */
12467
+ markOrderFormAsSigned: (lagoId: string, data?: OrderFormMarkAsSignedInput, params?: RequestParams) => Promise<HttpResponse<OrderForm, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
12468
+ /**
12469
+ * @description This endpoint voids an order form, with the `manual` reason, and cascades to the quote version it was generated from, which is voided with the `cascade_of_voided` reason. Only a `generated` order form can be voided, so a `422` is returned once the order form has been signed, has expired or has already been voided. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
12470
+ *
12471
+ * @tags order_forms
12472
+ * @name VoidOrderForm
12473
+ * @summary Void an order form
12474
+ * @request POST:/order_forms/{lago_id}/void
12475
+ * @secure
12476
+ */
12477
+ voidOrderForm: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<OrderForm, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
12478
+ };
12479
+ orders: {
12480
+ /**
12481
+ * @description This endpoint is used to list all existing orders. This is a premium feature.
12482
+ *
12483
+ * @tags orders
12484
+ * @name FindAllOrders
12485
+ * @summary List all orders
12486
+ * @request GET:/orders
12487
+ * @secure
12488
+ */
12489
+ findAllOrders: (query?: {
12490
+ /**
12491
+ * Page number.
12492
+ * @example 1
12493
+ */
12494
+ page?: number;
12495
+ /**
12496
+ * Number of records per page.
12497
+ * @example 20
12498
+ */
12499
+ per_page?: number;
12500
+ /** Filter orders by status. Possible values are `created`, `executed` and `failed`. */
12501
+ "status[]"?: ("created" | "executed" | "failed")[];
12502
+ /** Filter orders by the order type of the quote they come from. Possible values are `subscription_creation`, `subscription_amendment` and `one_off`. */
12503
+ "order_type[]"?: ("subscription_creation" | "subscription_amendment" | "one_off")[];
12504
+ /** Filter orders by execution mode. Possible values are `execute_in_lago` and `order_only`. */
12505
+ "execution_mode[]"?: ("execute_in_lago" | "order_only")[];
12506
+ /**
12507
+ * Filter orders by the Lago identifiers of their customers.
12508
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
12509
+ */
12510
+ "customer_id[]"?: string[];
12511
+ /**
12512
+ * Filter orders by their number, as assigned by Lago.
12513
+ * @example ["OR-2026-0001","OR-2026-0002"]
12514
+ */
12515
+ "number[]"?: string[];
12516
+ /**
12517
+ * Filter orders by the number of the order form they come from.
12518
+ * @example ["OF-2026-0001"]
12519
+ */
12520
+ "order_form_number[]"?: string[];
12521
+ /**
12522
+ * Filter orders by the number of the quote they come from.
12523
+ * @example ["QT-2026-0001"]
12524
+ */
12525
+ "quote_number[]"?: string[];
12526
+ /**
12527
+ * Filter orders by the Lago identifiers of the users owning the quote they come from.
12528
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
12529
+ */
12530
+ "owner_id[]"?: string[];
12531
+ /**
12532
+ * Search orders by number.
12533
+ * @example "OR-2026"
12534
+ */
12535
+ search_term?: string;
12536
+ /**
12537
+ * Filter orders executed from a specific date and time, in UTC (ISO 8601). Orders that have not been executed are excluded.
12538
+ * @format date-time
12539
+ * @example "2026-01-01T00:00:00Z"
12540
+ */
12541
+ executed_at_from?: string;
12542
+ /**
12543
+ * Filter orders executed up to a specific date and time, in UTC (ISO 8601). Orders that have not been executed are excluded.
12544
+ * @format date-time
12545
+ * @example "2026-12-31T23:59:59Z"
12546
+ */
12547
+ executed_at_to?: string;
12548
+ }, params?: RequestParams) => Promise<HttpResponse<OrdersPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden>>;
12549
+ /**
12550
+ * @description This endpoint retrieves a specific order, along with the `billing_snapshot` its execution applies and the `execution_record` of what it produced. This is a premium feature.
12551
+ *
12552
+ * @tags orders
12553
+ * @name FindOrder
12554
+ * @summary Retrieve an order
12555
+ * @request GET:/orders/{lago_id}
12556
+ * @secure
12557
+ */
12558
+ findOrder: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Order, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
12559
+ /**
12560
+ * @description This endpoint carries out an order on demand, without waiting for its `execute_at` schedule. It runs synchronously, so the response carries the resulting status and, when the execution fails, the reason it failed. An `execute_in_lago` order applies the quoted deal, creating the subscriptions, coupons, wallets or one-off invoice it describes; an `order_only` order is simply marked as executed. What the execution produced is listed in `execution_record`. Executing is idempotent: an order that has already been executed is returned untouched. An order whose previous execution failed is executed again, and a `422` is returned when the order carries no execution mode and none is provided in the body. Restating an `execution_mode` that differs from the one stored on the order updates it first, which only succeeds while the order is still `created`: a `failed` order can be retried, but not switched to another mode. That update also re-validates the order's own `execute_at` against the day the quoted deal stops being executable, so a `422` is possible even though no date was sent. An order carrying no `execute_at` is not bounded that way, and a deal whose term has passed then only fails when the execution runs. A `404` is not limited to an unknown order: when the execution cannot find a catalog record the quote pinned, such as a deleted plan, charge, coupon or the subscription being amended, the missing resource is reported as a `404` and the order is left `failed`. Concurrency is reported two ways. A mode change losing the race on the quote comes back as a `422` validation error, while the execution itself losing it comes back as a `422` carrying a lock code, because a scheduled execution relies on that error to be retried. This is a premium feature.
12561
+ *
12562
+ * @tags orders
12563
+ * @name ExecuteOrder
12564
+ * @summary Execute an order
12565
+ * @request POST:/orders/{lago_id}/execute
12566
+ * @secure
12567
+ */
12568
+ executeOrder: (lagoId: string, data?: OrderExecuteInput, params?: RequestParams) => Promise<HttpResponse<Order, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
12569
+ };
11326
12570
  organizations: {
11327
12571
  /**
11328
12572
  * @description This endpoint is used to update your own organization's settings.
@@ -11836,6 +13080,133 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11836
13080
  */
11837
13081
  destroyPlanFixedCharge: (code: string, fixedChargeCode: string, data: FixedChargeDeleteInput, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorNotFound>>;
11838
13082
  };
13083
+ quotes: {
13084
+ /**
13085
+ * @description This endpoint is used to list all existing quotes. Quotes are ordered by creation date, from the most recent to the oldest. This is a premium feature.
13086
+ *
13087
+ * @tags quotes
13088
+ * @name FindAllQuotes
13089
+ * @summary List all quotes
13090
+ * @request GET:/quotes
13091
+ * @secure
13092
+ */
13093
+ findAllQuotes: (query?: {
13094
+ /**
13095
+ * Page number.
13096
+ * @example 1
13097
+ */
13098
+ page?: number;
13099
+ /**
13100
+ * Number of records per page.
13101
+ * @example 20
13102
+ */
13103
+ per_page?: number;
13104
+ /** Filter quotes by the status of their current version. Possible values are `draft`, `approved` and `voided`. */
13105
+ "status[]"?: ("draft" | "approved" | "voided")[];
13106
+ /** Filter quotes by order type. Possible values are `subscription_creation`, `subscription_amendment` and `one_off`. */
13107
+ "order_type[]"?: ("subscription_creation" | "subscription_amendment" | "one_off")[];
13108
+ /**
13109
+ * Filter quotes by their number, as assigned by Lago.
13110
+ * @example ["QT-2026-0001","QT-2026-0002"]
13111
+ */
13112
+ "number[]"?: string[];
13113
+ /**
13114
+ * Filter quotes by the Lago identifiers of the users owning them.
13115
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
13116
+ */
13117
+ "owner_id[]"?: string[];
13118
+ /**
13119
+ * Filter quotes by the external unique identifiers of their customers (provided by your own application).
13120
+ * @example ["external_id_1234"]
13121
+ */
13122
+ "external_customer_id[]"?: string[];
13123
+ /**
13124
+ * Filter quotes created from a specific date.
13125
+ * @format date
13126
+ * @example "2026-01-01"
13127
+ */
13128
+ from_date?: string;
13129
+ /**
13130
+ * Filter quotes created up to a specific date.
13131
+ * @format date
13132
+ * @example "2026-12-31"
13133
+ */
13134
+ to_date?: string;
13135
+ }, params?: RequestParams) => Promise<HttpResponse<QuotesPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden>>;
13136
+ /**
13137
+ * @description This endpoint retrieves a specific quote, along with its owners and its current version. This is a premium feature.
13138
+ *
13139
+ * @tags quotes
13140
+ * @name FindQuote
13141
+ * @summary Retrieve a quote
13142
+ * @request GET:/quotes/{lago_id}
13143
+ * @secure
13144
+ */
13145
+ findQuote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Quote, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
13146
+ /**
13147
+ * @description This endpoint is used to list all the versions of a specific quote, from the most recent to the oldest. The `content` and `billing_items` of each version are omitted; retrieve a version to get them. This is a premium feature.
13148
+ *
13149
+ * @tags quotes
13150
+ * @name FindAllQuoteVersions
13151
+ * @summary List all versions of a quote
13152
+ * @request GET:/quotes/{lago_id}/versions
13153
+ * @secure
13154
+ */
13155
+ findAllQuoteVersions: (lagoId: string, query?: {
13156
+ /**
13157
+ * Page number.
13158
+ * @example 1
13159
+ */
13160
+ page?: number;
13161
+ /**
13162
+ * Number of records per page.
13163
+ * @example 20
13164
+ */
13165
+ per_page?: number;
13166
+ }, params?: RequestParams) => Promise<HttpResponse<QuoteVersionsPaginated, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
13167
+ };
13168
+ quoteVersions: {
13169
+ /**
13170
+ * @description This endpoint retrieves a specific quote version, along with its document `content` and its `billing_items`. This is a premium feature.
13171
+ *
13172
+ * @tags quotes
13173
+ * @name FindQuoteVersion
13174
+ * @summary Retrieve a quote version
13175
+ * @request GET:/quote_versions/{lago_id}
13176
+ * @secure
13177
+ */
13178
+ findQuoteVersion: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<QuoteVersion, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
13179
+ /**
13180
+ * @description This endpoint approves a quote version and generates the order form to send to the customer for signature. Only a `draft` version can be approved, and its `billing_items` must be complete: approval validates them against the catalog and against the customer, and returns a `422` when the deal cannot be executed as quoted. The `expires_at` of the generated order form is bounded by the deal's own term, so a signing window reaching beyond the day the deal stops being executable is rejected. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
13181
+ *
13182
+ * @tags quotes
13183
+ * @name ApproveQuoteVersion
13184
+ * @summary Approve a quote version
13185
+ * @request POST:/quote_versions/{lago_id}/approve
13186
+ * @secure
13187
+ */
13188
+ approveQuoteVersion: (lagoId: string, data?: QuoteVersionApproveInput, params?: RequestParams) => Promise<HttpResponse<QuoteVersion, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
13189
+ /**
13190
+ * @description This endpoint voids a quote version, which makes it definitive: a voided version can neither be edited nor approved again. Only a `draft` version can be voided through this endpoint, and the resulting `void_reason` is `manual`. An `approved` version is voided by Lago itself, through the order form generated from it. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
13191
+ *
13192
+ * @tags quotes
13193
+ * @name VoidQuoteVersion
13194
+ * @summary Void a quote version
13195
+ * @request POST:/quote_versions/{lago_id}/void
13196
+ * @secure
13197
+ */
13198
+ voidQuoteVersion: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<QuoteVersion, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
13199
+ /**
13200
+ * @description This endpoint copies a quote version into a new `draft` version of the same quote, so that the deal can be renegotiated. Any version of the quote can be cloned, but a quote can only carry one active version: the draft the quote currently holds, if any, is voided with the `superseded` reason. Cloning is therefore rejected with a `422` once a version of the quote has been approved. A concurrent write on the same quote is reported as a `422` rather than retried, so a duplicated call can fail while the first one is still in flight. This is a premium feature.
13201
+ *
13202
+ * @tags quotes
13203
+ * @name CloneQuoteVersion
13204
+ * @summary Clone a quote version
13205
+ * @request POST:/quote_versions/{lago_id}/clone
13206
+ * @secure
13207
+ */
13208
+ cloneQuoteVersion: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<QuoteVersion, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
13209
+ };
11839
13210
  subscriptions: {
11840
13211
  /**
11841
13212
  * @description This endpoint assigns a plan to a customer, creating or modifying a subscription. Ideal for initial subscriptions or plan changes (upgrades/downgrades).
@@ -11940,8 +13311,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11940
13311
  */
11941
13312
  destroySubscription: (externalId: string, query?: {
11942
13313
  /**
11943
- * 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.
11944
- * @example "pending"
13314
+ * 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.
13315
+ *
13316
+ * - `pending`: cancel a subscription scheduled for a future activation (include `status=pending`).
13317
+ * - `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.
13318
+ * @default "active"
13319
+ * @example "incomplete"
11945
13320
  */
11946
13321
  status?: string;
11947
13322
  /**