lago-javascript-client 1.52.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.
@@ -6106,6 +6106,668 @@ export interface InvoiceVoidInput {
6106
6106
  */
6107
6107
  credit_amount?: number;
6108
6108
  }
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 {
6129
+ /**
6130
+ * Unique identifier of the order form, created by Lago.
6131
+ * @format uuid
6132
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6133
+ */
6134
+ lago_id: string;
6135
+ /**
6136
+ * The unique number assigned to the order form by Lago.
6137
+ * @example "OF-2026-0001"
6138
+ */
6139
+ number: string;
6140
+ /**
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.
6148
+ */
6149
+ status: OrderFormStatusEnum;
6150
+ /**
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.
6155
+ */
6156
+ void_reason: OrderFormVoidReasonEnum;
6157
+ /**
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"
6161
+ */
6162
+ expires_at: string | null;
6163
+ /**
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
+ }
6109
6771
  /** The custom billing settings for your organization. */
6110
6772
  export interface OrganizationBillingConfiguration {
6111
6773
  /**
@@ -7757,96 +8419,304 @@ export interface FixedChargeOverridableInput {
7757
8419
  * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the add-on will be used as the default display name.
7758
8420
  * @example "Setup Fee"
7759
8421
  */
7760
- invoice_display_name?: string | null;
8422
+ invoice_display_name?: string | null;
8423
+ /**
8424
+ * The quantity of units for the fixed charge.
8425
+ * @example "1.0"
8426
+ */
8427
+ units?: string;
8428
+ /**
8429
+ * When set to `true`, the fixed charge units are applied immediately for active subscriptions. When set to `false`, the units are applied at the next billing period.
8430
+ * @example false
8431
+ */
8432
+ apply_units_immediately?: boolean;
8433
+ /** List of all thresholds utilized for calculating the fixed charge. */
8434
+ properties?: ChargeProperties;
8435
+ /** List of unique code used to identify the taxes. */
8436
+ tax_codes?: TaxCodes;
8437
+ }
8438
+ /**
8439
+ * Specifies the pricing model used for the calculation of the fixed charge fee. It can be any of the following values:
8440
+ * - `standard`
8441
+ * - `graduated`
8442
+ * - `volume`
8443
+ */
8444
+ export type FixedChargeModelEnum = "standard" | "graduated" | "volume";
8445
+ export type FixedChargeInput = FixedChargeOverridableInput & {
8446
+ /**
8447
+ * Unique identifier of the add-on. Either add_on_id or add_on_code is required.
8448
+ * @format uuid
8449
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8450
+ */
8451
+ add_on_id?: string;
8452
+ /**
8453
+ * Unique code identifying an add-on. Either add_on_id or add_on_code is required.
8454
+ * @example "setup_fee"
8455
+ */
8456
+ add_on_code?: string;
8457
+ /**
8458
+ * Unique code identifying the fixed charge within the plan.
8459
+ * @example "setup_fee_charge"
8460
+ */
8461
+ code?: string;
8462
+ /**
8463
+ * Specifies the pricing model used for the calculation of the fixed charge fee. It can be any of the following values:
8464
+ * - `standard`
8465
+ * - `graduated`
8466
+ * - `volume`
8467
+ */
8468
+ charge_model?: FixedChargeModelEnum;
8469
+ /**
8470
+ * This field determines the billing timing for this fixed charge. When set to `true`, the charge is due and invoiced immediately at the beginning of the billing period. When set to `false`, the charge is due and invoiced at the end of the billing period.
8471
+ * @example true
8472
+ */
8473
+ pay_in_advance?: boolean;
8474
+ /**
8475
+ * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
8476
+ *
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;
7761
8630
  /**
7762
- * The quantity of units for the fixed charge.
7763
- * @example "1.0"
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"
7764
8634
  */
7765
- units?: string;
8635
+ approved_at: string | null;
7766
8636
  /**
7767
- * When set to `true`, the fixed charge units are applied immediately for active subscriptions. When set to `false`, the units are applied at the next billing period.
7768
- * @example false
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"
7769
8640
  */
7770
- apply_units_immediately?: boolean;
7771
- /** List of all thresholds utilized for calculating the fixed charge. */
7772
- properties?: ChargeProperties;
7773
- /** List of unique code used to identify the taxes. */
7774
- tax_codes?: TaxCodes;
7775
- }
7776
- /**
7777
- * Specifies the pricing model used for the calculation of the fixed charge fee. It can be any of the following values:
7778
- * - `standard`
7779
- * - `graduated`
7780
- * - `volume`
7781
- */
7782
- export type FixedChargeModelEnum = "standard" | "graduated" | "volume";
7783
- export type FixedChargeInput = FixedChargeOverridableInput & {
8641
+ voided_at: string | null;
7784
8642
  /**
7785
- * Unique identifier of the add-on. Either add_on_id or add_on_code is required.
7786
- * @format uuid
7787
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
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"
7788
8646
  */
7789
- add_on_id?: string;
8647
+ created_at: string;
7790
8648
  /**
7791
- * Unique code identifying an add-on. Either add_on_id or add_on_code is required.
7792
- * @example "setup_fee"
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"
7793
8652
  */
7794
- add_on_code?: string;
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 {
7795
8664
  /**
7796
- * Unique code identifying the fixed charge within the plan.
7797
- * @example "setup_fee_charge"
8665
+ * Unique identifier of the user owning the quote, created by Lago.
8666
+ * @format uuid
8667
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
7798
8668
  */
7799
- code?: string;
8669
+ lago_id: string;
7800
8670
  /**
7801
- * Specifies the pricing model used for the calculation of the fixed charge fee. It can be any of the following values:
7802
- * - `standard`
7803
- * - `graduated`
7804
- * - `volume`
8671
+ * The email address of the user owning the quote.
8672
+ * @format email
8673
+ * @example "sales@getlago.com"
7805
8674
  */
7806
- charge_model?: FixedChargeModelEnum;
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 & {
7807
8689
  /**
7808
- * This field determines the billing timing for this fixed charge. When set to `true`, the charge is due and invoiced immediately at the beginning of the billing period. When set to `false`, the charge is due and invoiced at the end of the billing period.
7809
- * @example true
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>"
7810
8692
  */
7811
- pay_in_advance?: boolean;
8693
+ content: string | null;
7812
8694
  /**
7813
- * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
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.
7814
8696
  *
7815
- * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
7816
- * - If set to `false`, the charge is billed in full.
7817
- * @example false
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.
7818
8706
  */
7819
- prorated?: boolean;
8707
+ billing_items: QuoteBillingItems;
7820
8708
  };
7821
- export interface FixedChargeCreateInput {
7822
- fixed_charge: FixedChargeInput & {
7823
- /**
7824
- * 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`.
7825
- * @example true
7826
- */
7827
- cascade_updates?: boolean;
7828
- };
7829
- }
7830
- export interface FixedCharge {
7831
- fixed_charge: FixedChargeObject;
7832
- }
7833
- export interface FixedChargeUpdateInput {
7834
- fixed_charge: FixedChargeInput & {
7835
- /**
7836
- * 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`.
7837
- * @example true
7838
- */
7839
- cascade_updates?: boolean;
7840
- };
8709
+ export interface QuoteVersion {
8710
+ quote_version: QuoteVersionObjectExtended;
7841
8711
  }
7842
- export interface FixedChargeDeleteInput {
7843
- fixed_charge?: {
7844
- /**
7845
- * When set to `true`, the deletion will be cascaded to the children plans.
7846
- * @example true
7847
- */
7848
- cascade_updates?: boolean;
7849
- };
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;
7850
8720
  }
7851
8721
  /** Based plan overrides. */
7852
8722
  export interface PlanOverridesObject {
@@ -9277,6 +10147,10 @@ export interface PaymentRequestPaymentFailureObject {
9277
10147
  payment_provider_code?: string;
9278
10148
  provider_error?: string | Record<string, any>;
9279
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
+ };
9280
10154
  export type SubscriptionWithCustomerObject = SubscriptionObject & {
9281
10155
  plan: PlanObject;
9282
10156
  customer: CustomerObject;
@@ -11498,6 +12372,201 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11498
12372
  */
11499
12373
  voidInvoice: (lagoId: string, data?: InvoiceVoidInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
11500
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
+ };
11501
12570
  organizations: {
11502
12571
  /**
11503
12572
  * @description This endpoint is used to update your own organization's settings.
@@ -12011,6 +13080,133 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12011
13080
  */
12012
13081
  destroyPlanFixedCharge: (code: string, fixedChargeCode: string, data: FixedChargeDeleteInput, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorNotFound>>;
12013
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
+ };
12014
13210
  subscriptions: {
12015
13211
  /**
12016
13212
  * @description This endpoint assigns a plan to a customer, creating or modifying a subscription. Ideal for initial subscriptions or plan changes (upgrades/downgrades).