lago-javascript-client 1.27.1 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -169,6 +169,150 @@ export interface ApiErrorUnprocessableEntity {
169
169
  code: string;
170
170
  error_details: object;
171
171
  }
172
+ /** Billing entity create input */
173
+ export interface BillingEntityCreateInput {
174
+ billing_entity: {
175
+ /**
176
+ * The unique code of the billing entity
177
+ * @example "acme_corp"
178
+ */
179
+ code: string;
180
+ /**
181
+ * The name of the billing entity
182
+ * @example "Acme Corp"
183
+ */
184
+ name: string;
185
+ /**
186
+ * The default currency of the billing entity
187
+ * @example "USD"
188
+ */
189
+ default_currency?: Currency;
190
+ /**
191
+ * The type of document numbering for this billing entity:
192
+ * - `per_customer`: document numbers are unique per customer
193
+ * - `per_billing_entity`: document numbers are unique per billing entity
194
+ */
195
+ document_numbering?: "per_customer" | "per_billing_entity";
196
+ /**
197
+ * The prefix used in document numbers for this billing entity
198
+ * @example "ABC-123"
199
+ */
200
+ document_number_prefix?: string | null;
201
+ /**
202
+ * Whether to finalize invoices with zero amount for this billing entity
203
+ * @example true
204
+ */
205
+ finalize_zero_amount_invoice?: boolean;
206
+ billing_configuration?: {
207
+ /**
208
+ * The footer text to be displayed on invoices for this billing entity
209
+ * @example "Thank you for your business"
210
+ */
211
+ invoice_footer?: string;
212
+ /**
213
+ * The language of the documents generated for this billing entity
214
+ * @example "en"
215
+ */
216
+ document_locale?: string;
217
+ /**
218
+ * The grace period (in days) for invoice finalization
219
+ * @example 0
220
+ */
221
+ invoice_grace_period?: number;
222
+ };
223
+ /**
224
+ * The net payment term (in days) for this billing entity
225
+ * @example 0
226
+ */
227
+ net_payment_term?: number;
228
+ /**
229
+ * The first line of the billing address
230
+ * @example "5230 Penfield Ave"
231
+ */
232
+ address_line1?: string | null;
233
+ /**
234
+ * The second line of the billing address
235
+ * @example "Suite 100"
236
+ */
237
+ address_line2?: string | null;
238
+ /**
239
+ * The city of the billing address
240
+ * @example "Woodland Hills"
241
+ */
242
+ city?: string | null;
243
+ /**
244
+ * The state of the billing address
245
+ * @example "CA"
246
+ */
247
+ state?: string | null;
248
+ /** The country code of the billing address */
249
+ country?: Country | null;
250
+ /**
251
+ * The zipcode of the billing address
252
+ * @example "91364"
253
+ */
254
+ zipcode?: string | null;
255
+ /**
256
+ * The email address of the billing entity
257
+ * @format email
258
+ * @example "billing@acme.com"
259
+ */
260
+ email?: string | null;
261
+ /**
262
+ * The legal name of the billing entity
263
+ * @example "Acme Corporation"
264
+ */
265
+ legal_name?: string | null;
266
+ /**
267
+ * The legal registration number of the billing entity
268
+ * @example "US123456789"
269
+ */
270
+ legal_number?: string | null;
271
+ /**
272
+ * The tax identification number of the billing entity
273
+ * @example "EU123456789"
274
+ */
275
+ tax_identification_number?: string | null;
276
+ /**
277
+ * The timezone of the billing entity
278
+ * @example "UTC"
279
+ */
280
+ timezone?: Timezone;
281
+ /** The email notification settings for this billing entity */
282
+ email_settings?: ("invoice.finalized" | "credit_note.created")[];
283
+ /**
284
+ * Whether EU tax management is enabled for this billing entity
285
+ * @example false
286
+ */
287
+ eu_tax_management?: boolean;
288
+ /**
289
+ * The base64 encoded logo image for the billing entity
290
+ * @format uri
291
+ * @example "data:image/png;base64,..."
292
+ */
293
+ logo?: string | null;
294
+ };
295
+ }
296
+ export interface ApiErrorBadRequest {
297
+ /**
298
+ * @format int32
299
+ * @example 400
300
+ */
301
+ status: number;
302
+ /** @example "Bad request" */
303
+ error: string;
304
+ }
305
+ export interface ApiErrorForbidden {
306
+ /**
307
+ * @format int32
308
+ * @example 403
309
+ */
310
+ status: number;
311
+ /** @example "Forbidden" */
312
+ error: string;
313
+ /** @example "feature_unavailable" */
314
+ code: string;
315
+ }
172
316
  export interface TaxObject {
173
317
  /**
174
318
  * Unique identifier of the tax, created by Lago.
@@ -197,7 +341,8 @@ export interface TaxObject {
197
341
  */
198
342
  rate: number;
199
343
  /**
200
- * Set to `true` if the tax is used as one of the organization's default
344
+ * This field is deprecated and will be removed in a future version. When set to true, it applies the tax to the organization's default billing entity. To apply or remove a tax from any billing entity (including the default one), please use the `PUT /billing_entities/:code` endpoint instead.
345
+ * @deprecated
201
346
  * @example true
202
347
  */
203
348
  applied_to_organization: boolean;
@@ -208,8 +353,60 @@ export interface TaxObject {
208
353
  */
209
354
  created_at: string;
210
355
  }
356
+ export interface InvoiceCustomSectionObject {
357
+ /**
358
+ * Unique identifier for the invoice custom section in the Lago application, generated by Lago to ensure record uniqueness within the system.
359
+ * @format uuid
360
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
361
+ */
362
+ lago_id: string;
363
+ /**
364
+ * Name of the invoice custom section.
365
+ * @example "EU Bank Details"
366
+ */
367
+ name: string;
368
+ /**
369
+ * Unique code identifying the invoice custom section for the API request.
370
+ * @example "eu_bank_details"
371
+ */
372
+ code: string;
373
+ /**
374
+ * Internal description of the invoice custom section.
375
+ * @example "This section contains the bank details for EU customers."
376
+ */
377
+ description?: string;
378
+ /**
379
+ * The value shown on the invoice PDF.
380
+ * @example "Bank Name: Lago Bank, IBAN: FR7630004000031234567890143"
381
+ */
382
+ details?: string;
383
+ /**
384
+ * The name of the invoice custom section displayed on the invoice.
385
+ * @example "Bank Details:"
386
+ */
387
+ display_name?: string;
388
+ /**
389
+ * This field is deprecated and will be removed in a future version. When set to true, it applies the invoice custom section to the organization's default billing entity. To apply or remove an invoice custom section from any billing entity (including the default one), please use the `PUT /billing_entities/:code` endpoint instead.
390
+ * @deprecated
391
+ * @example true
392
+ */
393
+ applied_to_organization?: boolean;
394
+ /**
395
+ * Unique identifier for the organization associated with the invoice custom section.
396
+ * @format uuid
397
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
398
+ */
399
+ organization_id?: string;
400
+ /**
401
+ * Creation date of the tax.
402
+ * @format date-time
403
+ * @example "2023-07-06T14:35:58Z"
404
+ */
405
+ created_at?: string;
406
+ }
211
407
  export type BillingEntityObjectExtended = BillingEntityObject & {
212
408
  taxes?: TaxObject[];
409
+ selected_invoice_custom_sections?: InvoiceCustomSectionObject[];
213
410
  };
214
411
  export interface ApiErrorNotFound {
215
412
  /**
@@ -222,51 +419,206 @@ export interface ApiErrorNotFound {
222
419
  /** @example "object_not_found" */
223
420
  code: string;
224
421
  }
225
- export interface AddOnObject {
422
+ /** Billing entity update input */
423
+ export interface BillingEntityUpdateInput {
226
424
  /**
227
- * Unique identifier of the add-on, created by Lago.
425
+ * The name of the billing entity
426
+ * @example "Acme Corp"
427
+ */
428
+ name?: string;
429
+ /**
430
+ * The default currency of the billing entity
431
+ * @example "USD"
432
+ */
433
+ default_currency?: Currency;
434
+ /**
435
+ * The type of document numbering for this billing entity:
436
+ * - `per_customer`: document numbers are unique per customer
437
+ * - `per_billing_entity`: document numbers are unique per billing entity
438
+ */
439
+ document_numbering?: "per_customer" | "per_billing_entity";
440
+ /**
441
+ * The prefix used in document numbers for this billing entity
442
+ * @example "ABC-123"
443
+ */
444
+ document_number_prefix?: string | null;
445
+ /**
446
+ * Whether to finalize invoices with zero amount for this billing entity
447
+ * @example true
448
+ */
449
+ finalize_zero_amount_invoice?: boolean;
450
+ billing_configuration?: {
451
+ /**
452
+ * The footer text to be displayed on invoices for this billing entity
453
+ * @example "Thank you for your business"
454
+ */
455
+ invoice_footer?: string;
456
+ /**
457
+ * The language of the documents generated for this billing entity
458
+ * @example "en"
459
+ */
460
+ document_locale?: string;
461
+ /**
462
+ * The grace period (in days) for invoice finalization
463
+ * @example 0
464
+ */
465
+ invoice_grace_period?: number;
466
+ };
467
+ /**
468
+ * The net payment term (in days) for this billing entity
469
+ * @example 0
470
+ */
471
+ net_payment_term?: number;
472
+ /**
473
+ * The first line of the billing address
474
+ * @example "5230 Penfield Ave"
475
+ */
476
+ address_line1?: string | null;
477
+ /**
478
+ * The second line of the billing address
479
+ * @example "Suite 100"
480
+ */
481
+ address_line2?: string | null;
482
+ /**
483
+ * The city of the billing address
484
+ * @example "Woodland Hills"
485
+ */
486
+ city?: string | null;
487
+ /**
488
+ * The state of the billing address
489
+ * @example "CA"
490
+ */
491
+ state?: string | null;
492
+ /** The country code of the billing address */
493
+ country?: Country | null;
494
+ /**
495
+ * The zipcode of the billing address
496
+ * @example "91364"
497
+ */
498
+ zipcode?: string | null;
499
+ /**
500
+ * The email address of the billing entity
501
+ * @format email
502
+ * @example "billing@acme.com"
503
+ */
504
+ email?: string | null;
505
+ /**
506
+ * The legal name of the billing entity
507
+ * @example "Acme Corporation"
508
+ */
509
+ legal_name?: string | null;
510
+ /**
511
+ * The legal registration number of the billing entity
512
+ * @example "US123456789"
513
+ */
514
+ legal_number?: string | null;
515
+ /**
516
+ * The tax identification number of the billing entity
517
+ * @example "EU123456789"
518
+ */
519
+ tax_identification_number?: string | null;
520
+ /**
521
+ * The timezone of the billing entity
522
+ * @example "UTC"
523
+ */
524
+ timezone?: Timezone;
525
+ /**
526
+ * The tax codes that should be associated with this billing entity
527
+ * @example ["french_standard_vat"]
528
+ */
529
+ tax_codes?: string[];
530
+ /** The email notification settings for this billing entity */
531
+ email_settings?: ("invoice.finalized" | "credit_note.created")[];
532
+ /**
533
+ * Whether EU tax management is enabled for this billing entity
534
+ * @example false
535
+ */
536
+ eu_tax_management?: boolean;
537
+ /**
538
+ * The base64 encoded logo image for the billing entity
539
+ * @format uri
540
+ * @example "data:image/png;base64,..."
541
+ */
542
+ logo?: string | null;
543
+ /**
544
+ * The codes of the invoice custom section that should be associated with this billing entity
545
+ * @example ["custom_section_1","custom_section_2"]
546
+ */
547
+ invoice_custom_section_codes?: string[];
548
+ }
549
+ export interface ActivityLogObject {
550
+ /**
551
+ * Unique identifier assigned to the activity log within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the activity log record within the Lago system
228
552
  * @format uuid
229
553
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
230
554
  */
231
- lago_id: string;
555
+ activity_id: string;
232
556
  /**
233
- * The name of the add-on.
234
- * @example "Setup Fee"
557
+ * The email of the user who performed the activity
558
+ * @format email
559
+ * @example "dinesh@piedpiper.test"
235
560
  */
236
- name: string;
561
+ user_email?: string | null;
237
562
  /**
238
- * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
239
- * @example "Setup Fee (SF1)"
563
+ * This field stores the actitivy action that was performed to the activity_object.
564
+ * @example "billing_metric.created"
240
565
  */
241
- invoice_display_name?: string;
566
+ activity_type: string;
242
567
  /**
243
- * Unique code used to identify the add-on.
244
- * @example "setup_fee"
568
+ * This field represents the source of the activity log, the interaction source that triggered the action.
569
+ * @example "api"
245
570
  */
246
- code: string;
571
+ activity_source: "api" | "front" | "system";
247
572
  /**
248
- * The cost of the add-on in cents, excluding any applicable taxes, that is billed to a customer. By creating a one-off invoice, you will be able to override this value.
249
- * @example 50000
573
+ * This field represents the final state of the object that the action was applied.
574
+ * @format object
575
+ * @example "{ "id": "dad68bc7-c01a-4ad8-a87b-13e78693a5bc", "plan_id": "b9155544-e261-4e92-b54e-f65d7609294c", ... }"
250
576
  */
251
- amount_cents: number;
577
+ activity_object?: string | null;
252
578
  /**
253
- * The currency of the add-on.
254
- * @example "USD"
579
+ * @format object
580
+ * @example "{ "plan_id": [null, "b9155544-e261-4e92-b54e-f65d7609294c"], ... }"
255
581
  */
256
- amount_currency: Currency;
582
+ activity_object_changes?: string | null;
257
583
  /**
258
- * The description of the add-on.
259
- * @example "Implementation fee for new customers."
584
+ * The customer external unique identifier (provided by your own application)
585
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
260
586
  */
261
- description?: string | null;
587
+ external_customer_id?: string | null;
262
588
  /**
263
- * The date and time when the add-on was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the add-on was initially created.
589
+ * Unique identifier assigned to the subscription in your application.
590
+ * @example "external_id"
591
+ */
592
+ external_subscription_id?: string | null;
593
+ /**
594
+ * The resource id of the object that the action was applied.
595
+ * @format uuid
596
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
597
+ */
598
+ resource_id: string;
599
+ /**
600
+ * The resource type of the resource_id record.
601
+ * @example "BillableMetric"
602
+ */
603
+ resource_type: string;
604
+ /**
605
+ * Unique identifier for the organization associated with the activity log.
606
+ * @format uuid
607
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
608
+ */
609
+ organization_id: string;
610
+ /**
611
+ * The logged date of the activity, presented in the ISO 8601 datetime format, specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record was created within the Lago application
612
+ * @format date-time
613
+ * @example "2025-03-31T12:31:44Z"
614
+ */
615
+ logged_at: string;
616
+ /**
617
+ * The creation date of the activity record in the Lago application, presented in the ISO 8601 datetime format, specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record was created within the Lago application
264
618
  * @format date-time
265
619
  * @example "2022-04-29T08:59:51Z"
266
620
  */
267
621
  created_at: string;
268
- /** All taxes applied to the add-on. */
269
- taxes?: TaxObject[];
270
622
  }
271
623
  export interface PaginationMeta {
272
624
  /**
@@ -295,6 +647,59 @@ export interface PaginationMeta {
295
647
  */
296
648
  total_count: number;
297
649
  }
650
+ export interface ActivityLogsPaginated {
651
+ activity_logs: ActivityLogObject[];
652
+ meta: PaginationMeta;
653
+ }
654
+ export interface ActivityLog {
655
+ activity_log: ActivityLogObject;
656
+ }
657
+ export interface AddOnObject {
658
+ /**
659
+ * Unique identifier of the add-on, created by Lago.
660
+ * @format uuid
661
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
662
+ */
663
+ lago_id: string;
664
+ /**
665
+ * The name of the add-on.
666
+ * @example "Setup Fee"
667
+ */
668
+ name: string;
669
+ /**
670
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
671
+ * @example "Setup Fee (SF1)"
672
+ */
673
+ invoice_display_name?: string;
674
+ /**
675
+ * Unique code used to identify the add-on.
676
+ * @example "setup_fee"
677
+ */
678
+ code: string;
679
+ /**
680
+ * The cost of the add-on in cents, excluding any applicable taxes, that is billed to a customer. By creating a one-off invoice, you will be able to override this value.
681
+ * @example 50000
682
+ */
683
+ amount_cents: number;
684
+ /**
685
+ * The currency of the add-on.
686
+ * @example "USD"
687
+ */
688
+ amount_currency: Currency;
689
+ /**
690
+ * The description of the add-on.
691
+ * @example "Implementation fee for new customers."
692
+ */
693
+ description?: string | null;
694
+ /**
695
+ * The date and time when the add-on was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the add-on was initially created.
696
+ * @format date-time
697
+ * @example "2022-04-29T08:59:51Z"
698
+ */
699
+ created_at: string;
700
+ /** All taxes applied to the add-on. */
701
+ taxes?: TaxObject[];
702
+ }
298
703
  export interface AddOnsPaginated {
299
704
  add_ons: AddOnObject[];
300
705
  meta: PaginationMeta;
@@ -342,15 +747,6 @@ export interface AddOnCreateInput {
342
747
  export interface AddOn {
343
748
  add_on: AddOnObject;
344
749
  }
345
- export interface ApiErrorBadRequest {
346
- /**
347
- * @format int32
348
- * @example 400
349
- */
350
- status: number;
351
- /** @example "Bad request" */
352
- error: string;
353
- }
354
750
  export interface AddOnUpdateInput {
355
751
  add_on: AddOnBaseInput;
356
752
  }
@@ -1729,8 +2125,9 @@ export interface CreditNoteObject {
1729
2125
  */
1730
2126
  self_billed?: boolean;
1731
2127
  }
1732
- export interface CreditNotes {
2128
+ export interface CreditNotesPaginated {
1733
2129
  credit_notes: CreditNoteObject[];
2130
+ meta: PaginationMeta;
1734
2131
  }
1735
2132
  export interface CreditNoteCreateInput {
1736
2133
  credit_note: {
@@ -2228,81 +2625,31 @@ export interface IntegrationCustomer {
2228
2625
  * Accepted values: `netsuite, anrok`.
2229
2626
  * @example "netsuite"
2230
2627
  */
2231
- type?: "netsuite" | "anrok";
2232
- /**
2233
- * Unique code used to identify an integration connection.
2234
- * @example "netsuite-eu-1"
2235
- */
2236
- integration_code?: string;
2237
- /**
2238
- * 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.
2239
- * @example "cus_12345"
2240
- */
2241
- external_customer_id?: string;
2242
- /**
2243
- * 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`
2244
- * @example true
2245
- */
2246
- sync_with_provider?: boolean;
2247
- /**
2248
- * This optional field is needed only when working with `netsuite` connection.
2249
- * @example "2"
2250
- */
2251
- subsidiary_id?: string;
2252
- }
2253
- export type CustomerObject = CustomerBaseObject & {
2254
- integration_customers?: IntegrationCustomer[];
2255
- };
2256
- export interface InvoiceCustomSectionObject {
2257
- /**
2258
- * Unique identifier for the invoice custom section in the Lago application, generated by Lago to ensure record uniqueness within the system.
2259
- * @format uuid
2260
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2261
- */
2262
- lago_id: string;
2263
- /**
2264
- * Name of the invoice custom section.
2265
- * @example "EU Bank Details"
2266
- */
2267
- name: string;
2268
- /**
2269
- * Unique code identifying the invoice custom section for the API request.
2270
- * @example "eu_bank_details"
2271
- */
2272
- code: string;
2273
- /**
2274
- * Internal description of the invoice custom section.
2275
- * @example "This section contains the bank details for EU customers."
2276
- */
2277
- description?: string;
2278
- /**
2279
- * The value shown on the invoice PDF.
2280
- * @example "Bank Name: Lago Bank, IBAN: FR7630004000031234567890143"
2281
- */
2282
- details?: string;
2628
+ type?: "netsuite" | "anrok";
2283
2629
  /**
2284
- * The name of the invoice custom section displayed on the invoice.
2285
- * @example "Bank Details:"
2630
+ * Unique code used to identify an integration connection.
2631
+ * @example "netsuite-eu-1"
2286
2632
  */
2287
- display_name?: string;
2633
+ integration_code?: string;
2288
2634
  /**
2289
- * Set to true if the invoice custom section is a default for the organization.
2290
- * @example true
2635
+ * 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.
2636
+ * @example "cus_12345"
2291
2637
  */
2292
- applied_to_organization?: boolean;
2638
+ external_customer_id?: string;
2293
2639
  /**
2294
- * Unique identifier for the organization associated with the invoice custom section.
2295
- * @format uuid
2296
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2640
+ * 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`
2641
+ * @example true
2297
2642
  */
2298
- organization_id?: string;
2643
+ sync_with_provider?: boolean;
2299
2644
  /**
2300
- * Creation date of the tax.
2301
- * @format date-time
2302
- * @example "2023-07-06T14:35:58Z"
2645
+ * This optional field is needed only when working with `netsuite` connection.
2646
+ * @example "2"
2303
2647
  */
2304
- created_at?: string;
2648
+ subsidiary_id?: string;
2305
2649
  }
2650
+ export type CustomerObject = CustomerBaseObject & {
2651
+ integration_customers?: IntegrationCustomer[];
2652
+ };
2306
2653
  export type CustomerObjectExtended = CustomerObject & {
2307
2654
  metadata?: CustomerMetadata[];
2308
2655
  /** List of customer taxes */
@@ -3166,7 +3513,7 @@ export interface AppliedUsageThresholdObject {
3166
3513
  export type InvoiceObject = InvoiceBaseObject & {
3167
3514
  /** The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
3168
3515
  customer?: CustomerObject;
3169
- billing_period?: BillingPeriodObject[];
3516
+ billing_periods?: BillingPeriodObject[];
3170
3517
  metadata?: InvoiceMetadataObject[];
3171
3518
  applied_taxes?: InvoiceAppliedTaxObject[];
3172
3519
  applied_usage_thresholds?: any[] | null;
@@ -3814,6 +4161,12 @@ export interface Organization {
3814
4161
  organization: OrganizationObject;
3815
4162
  }
3816
4163
  export interface PaymentObject {
4164
+ /**
4165
+ * Unique identifier of the payment, created by Lago.
4166
+ * @format uuid
4167
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4168
+ */
4169
+ lago_id: string;
3817
4170
  /**
3818
4171
  * The unique identifier of the paid resource, created by Lago.
3819
4172
  * @format uuid
@@ -3835,7 +4188,7 @@ export interface PaymentObject {
3835
4188
  * The customer external unique identifier (provided by your own application)
3836
4189
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
3837
4190
  */
3838
- external_id: string;
4191
+ external_id?: string;
3839
4192
  /**
3840
4193
  * Unique identifier of the customer within the payment provider
3841
4194
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
@@ -3857,6 +4210,16 @@ export interface PaymentObject {
3857
4210
  */
3858
4211
  provider_payment_id: string;
3859
4212
  next_action: Record<string, any>;
4213
+ /**
4214
+ * The amount of the payment in cents
4215
+ * @example 1000
4216
+ */
4217
+ amount_cents?: number;
4218
+ /**
4219
+ * The currency of the payment
4220
+ * @example "EUR"
4221
+ */
4222
+ amount_currency?: string;
3860
4223
  }
3861
4224
  export interface PaymentReceiptObject {
3862
4225
  /**
@@ -4071,6 +4434,18 @@ export interface MinimumCommitmentObject {
4071
4434
  taxes?: TaxObject[];
4072
4435
  }
4073
4436
  export interface ChargeProperties {
4437
+ /**
4438
+ * The list of event properties that are used to group the events on the invoice for a `standard` charge model.
4439
+ * **DEPRECATED** Replaced by pricing_group_keys
4440
+ * @deprecated
4441
+ * @example ["agent_name"]
4442
+ */
4443
+ grouped_by?: string[];
4444
+ /**
4445
+ * The list of event properties that are used to group the events on the invoice.
4446
+ * @example ["agent_name"]
4447
+ */
4448
+ pricing_group_keys?: string[];
4074
4449
  /** Graduated ranges, sorted from bottom to top tiers, used for a `graduated` charge model. */
4075
4450
  graduated_ranges?: {
4076
4451
  /**
@@ -4177,11 +4552,6 @@ export interface ChargeProperties {
4177
4552
  * @example "1.75"
4178
4553
  */
4179
4554
  per_transaction_min_amount?: string | null;
4180
- /**
4181
- * The list of event properties that are used to group the events on the invoice for a `standard` charge model.
4182
- * @example ["agent_name"]
4183
- */
4184
- grouped_by?: string[];
4185
4555
  /** Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. */
4186
4556
  volume_ranges?: {
4187
4557
  /**
@@ -4197,13 +4567,13 @@ export interface ChargeProperties {
4197
4567
  */
4198
4568
  to_value: number | null;
4199
4569
  /**
4200
- * The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
4570
+ * The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
4201
4571
  * @pattern ^[0-9]+.?[0-9]*$
4202
4572
  * @example "10"
4203
4573
  */
4204
4574
  flat_amount: string;
4205
4575
  /**
4206
- * The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
4576
+ * The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
4207
4577
  * @pattern ^[0-9]+.?[0-9]*$
4208
4578
  * @example "0.5"
4209
4579
  */
@@ -4932,6 +5302,137 @@ export interface LifetimeUsageInput {
4932
5302
  external_historical_usage_amount_cents: number;
4933
5303
  };
4934
5304
  }
5305
+ export interface AlertThresholdBaseObject {
5306
+ /**
5307
+ * Unique identifier of the usage threshold created by Lago.
5308
+ * @example "warn"
5309
+ */
5310
+ code?: string | null;
5311
+ /**
5312
+ * This field when set to `true` indicates that the alert will be retrigger when this threshold is reached after the last non-recurring threshold. Only one recurring threshold per alert allowed.
5313
+ * @default false
5314
+ * @example false
5315
+ */
5316
+ recurring?: boolean;
5317
+ }
5318
+ export type AlertThresholdObject = AlertThresholdBaseObject & {
5319
+ /**
5320
+ * A value that should trigger this alert, formatted as a BigDecimal.
5321
+ * @pattern ^[0-9]+.?[0-9]*$
5322
+ * @example "99.0"
5323
+ */
5324
+ value: string;
5325
+ };
5326
+ export interface AlertObject {
5327
+ /**
5328
+ * Unique identifier of the alert, created by Lago.
5329
+ * @format uuid
5330
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5331
+ */
5332
+ lago_id: string;
5333
+ /**
5334
+ * Unique identifier of the organization, created by Lago.
5335
+ * @format uuid
5336
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5337
+ */
5338
+ lago_organization_id: string;
5339
+ /**
5340
+ * The subscription external unique identifier (provided by your own application).
5341
+ * @example "sub_1234567890"
5342
+ */
5343
+ subscription_external_id: string;
5344
+ /**
5345
+ * The customer external unique identifier (provided by your own application).
5346
+ * @example "cus_0987654321"
5347
+ */
5348
+ customer_external_id: string;
5349
+ /** The billable metric associated with the alert. Only for alerts based on a billable metric. */
5350
+ billable_metric: BillableMetricObject;
5351
+ /**
5352
+ * The type of alert.
5353
+ * @example "billable_metric_current_usage_amount"
5354
+ */
5355
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
5356
+ /**
5357
+ * Unique code used to identify the alert.
5358
+ * @example "storage_threshold_alert"
5359
+ */
5360
+ code: string;
5361
+ /**
5362
+ * The name of the alert.
5363
+ * @example "Storage Usage Alert"
5364
+ */
5365
+ name: string | null;
5366
+ /**
5367
+ * When the system checked if this alert should be triggered, this value was retrieved and checked against the thresholds.
5368
+ * @example 1000
5369
+ */
5370
+ previous_value: number;
5371
+ /**
5372
+ * The date and time in UTC (ISO 8601) when the system checked if this alert should be triggered. Null until it's processed for the first time.
5373
+ * @format date-time
5374
+ * @example "2025-05-19T10:04:21Z"
5375
+ */
5376
+ last_processed_at: string | null;
5377
+ /** Array of thresholds associated with the alert. */
5378
+ thresholds: AlertThresholdObject[];
5379
+ /**
5380
+ * The date and time in UTC (ISO 8601) when the alert was created.
5381
+ * @format date-time
5382
+ * @example "2025-03-20T10:00:00Z"
5383
+ */
5384
+ created_at: string;
5385
+ }
5386
+ export interface Alerts {
5387
+ alerts: AlertObject[];
5388
+ meta?: PaginationMeta;
5389
+ }
5390
+ export type AlertThresholdInput = AlertThresholdBaseObject & {
5391
+ /**
5392
+ * A value that should trigger this alert. This can be an integer or a string formatted as a BigDecimal.
5393
+ * @example 99
5394
+ */
5395
+ value: number | string;
5396
+ };
5397
+ export interface AlertBaseInput {
5398
+ /**
5399
+ * Unique code used to identify the alert.
5400
+ * @example "storage_threshold_alert"
5401
+ */
5402
+ code?: string;
5403
+ /**
5404
+ * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
5405
+ * @example "storage_usage"
5406
+ */
5407
+ billable_metric_code?: string | null;
5408
+ /**
5409
+ * The name of the alert.
5410
+ * @example "Storage Usage Alert"
5411
+ */
5412
+ name?: string | null;
5413
+ /** Array of thresholds associated with the alert. */
5414
+ thresholds?: AlertThresholdInput[];
5415
+ }
5416
+ export interface AlertCreateInput {
5417
+ alert: AlertBaseInput & {
5418
+ /**
5419
+ * The type of alert.
5420
+ * @example "billable_metric_current_usage_amount"
5421
+ */
5422
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
5423
+ /**
5424
+ * Unique code used to identify the alert.
5425
+ * @example "storage_threshold_alert"
5426
+ */
5427
+ code: string;
5428
+ };
5429
+ }
5430
+ export interface Alert {
5431
+ alert: AlertObject;
5432
+ }
5433
+ export interface AlertUpdateInput {
5434
+ alert: AlertBaseInput;
5435
+ }
4935
5436
  export interface TaxesPaginated {
4936
5437
  taxes: TaxObject[];
4937
5438
  meta: PaginationMeta;
@@ -4959,7 +5460,8 @@ export interface TaxBaseInput {
4959
5460
  */
4960
5461
  description?: string | null;
4961
5462
  /**
4962
- * Set to `true` if the tax is used as one of the organization's default
5463
+ * This field is deprecated and will be removed in a future version. When set to true, it applies the tax to the organization's default billing entity. To apply or remove a tax from any billing entity (including the default one), please use the `PUT /billing_entities/:code` endpoint instead.
5464
+ * @deprecated
4963
5465
  * @example true
4964
5466
  */
4965
5467
  applied_to_organization?: boolean;
@@ -5627,6 +6129,75 @@ export interface WebhookEndpointUpdateInput {
5627
6129
  signature_algo?: "jwt" | "hmac";
5628
6130
  };
5629
6131
  }
6132
+ export interface TriggeredAlertObject {
6133
+ /**
6134
+ * Unique identifier of the alert, created by Lago.
6135
+ * @format uuid
6136
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6137
+ */
6138
+ lago_id: string;
6139
+ /**
6140
+ * Unique identifier of the organization, created by Lago.
6141
+ * @format uuid
6142
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6143
+ */
6144
+ lago_organization_id: string;
6145
+ /**
6146
+ * Unique identifier of the alert, created by Lago.
6147
+ * @format uuid
6148
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6149
+ */
6150
+ lago_alert_id: string;
6151
+ /**
6152
+ * Unique identifier of the subscription, created by Lago.
6153
+ * @format uuid
6154
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6155
+ */
6156
+ lago_subscription_id: string;
6157
+ /**
6158
+ * The subscription external unique identifier (provided by your own application).
6159
+ * @example "sub_1234567890"
6160
+ */
6161
+ subscription_external_id: string;
6162
+ /**
6163
+ * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
6164
+ * @example "storage_usage"
6165
+ */
6166
+ billable_metric_code: string | null;
6167
+ /**
6168
+ * The type of alert triggered.
6169
+ * @example "billable_metric_current_usage_amount"
6170
+ */
6171
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
6172
+ /**
6173
+ * Unique code used to identify the alert triggered.
6174
+ * @example "storage_threshold_alert"
6175
+ */
6176
+ alert_code: string;
6177
+ /**
6178
+ * The name of the alert triggered.
6179
+ * @example "Storage Usage Alert"
6180
+ */
6181
+ alert_name: string | null;
6182
+ /**
6183
+ * When the system checked if this alert should be triggered, this value was retrieved and checked if any threshold were crossed between this value and previous value.
6184
+ * @example 1200
6185
+ */
6186
+ current_value: number;
6187
+ /**
6188
+ * During the previous run, this value was retrieved.
6189
+ * @example 900
6190
+ */
6191
+ previous_value: number;
6192
+ /**
6193
+ * The date and time in UTC (ISO 8601) when the system triggered the alert.
6194
+ * @format date-time
6195
+ * @example "2025-05-19T10:04:21Z"
6196
+ */
6197
+ triggered_at: string | null;
6198
+ /** Array of thresholds crossed. All the recurring threshold values are present. */
6199
+ crossed_thresholds: AlertThresholdObject[];
6200
+ }
5630
6201
  export interface CustomerIntegratrionErrorObject {
5631
6202
  /**
5632
6203
  * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system.
@@ -5717,92 +6288,7 @@ export interface CreditNotePaymentProviderRefundError {
5717
6288
  * @format uuid
5718
6289
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5719
6290
  */
5720
- lago_credit_note_id: string;
5721
- /**
5722
- * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system.
5723
- * @format uuid
5724
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5725
- */
5726
- lago_customer_id: string;
5727
- /**
5728
- * The customer external unique identifier (provided by your own application)
5729
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5730
- */
5731
- external_customer_id: string;
5732
- /**
5733
- * Unique identifier of the customer within the payment provider
5734
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5735
- */
5736
- provider_customer_id?: string;
5737
- /**
5738
- * The type of payment provider code
5739
- * @example "stripe"
5740
- */
5741
- payment_provider: "adyen" | "cashfree" | "gocardless" | "stripe";
5742
- /**
5743
- * Code of the payment provider
5744
- * @example "Stripe Prod"
5745
- */
5746
- payment_provider_code?: string;
5747
- provider_error?: string | Record<string, any>;
5748
- }
5749
- export interface EventErrorsObject {
5750
- /**
5751
- * HTTP status code. It will always be 422
5752
- * @example 422
5753
- */
5754
- status: number;
5755
- /**
5756
- * HTTP error description. It will always be "Unprocessable Entity"
5757
- * @example "Unprocessable Entity"
5758
- */
5759
- error: string;
5760
- message: string | Record<string, any>;
5761
- event: EventObject;
5762
- }
5763
- export interface EventsErrorsObject {
5764
- /**
5765
- * List of event transaction_id with an invalid code
5766
- * @example ["transaction_1234567890"]
5767
- */
5768
- invalid_code: string[];
5769
- /**
5770
- * List of event transaction_id with a missing aggregation property
5771
- * @example ["transaction_1234567890"]
5772
- */
5773
- missing_aggregation_property: string[];
5774
- /**
5775
- * List of event transaction_id with invalid filter values
5776
- * @example ["transaction_1234567890"]
5777
- */
5778
- invalid_filter_values: string[];
5779
- }
5780
- export interface FeeTaxProviderErrorObject {
5781
- /**
5782
- * Code of the tax provider
5783
- * @example "Stripe Prod"
5784
- */
5785
- tax_provider_code: string;
5786
- /**
5787
- * Unique identifier assigned to the charge that the fee belongs to
5788
- * @format uuid
5789
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5790
- */
5791
- lago_charge_id: string | null;
5792
- /**
5793
- * Unique identifier assigned to the transaction. This field is specifically displayed when the fee type is `charge`.
5794
- * @example "transaction_1234567890"
5795
- */
5796
- event_transaction_id: string | null;
5797
- provider_error: string | Record<string, any>;
5798
- }
5799
- export interface InvoicePaymentFailureObject {
5800
- /**
5801
- * Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system.
5802
- * @format uuid
5803
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5804
- */
5805
- lago_invoice_id: string;
6291
+ lago_credit_note_id: string;
5806
6292
  /**
5807
6293
  * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system.
5808
6294
  * @format uuid
@@ -5831,110 +6317,63 @@ export interface InvoicePaymentFailureObject {
5831
6317
  payment_provider_code?: string;
5832
6318
  provider_error?: string | Record<string, any>;
5833
6319
  }
5834
- export interface IntegrationProviderErrorObject {
5835
- /**
5836
- * Unique identifier assigned to the integration within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the integration's record within the Lago system.
5837
- * @format uuid
5838
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5839
- */
5840
- lago_integration_id: string;
6320
+ export interface EventErrorsObject {
5841
6321
  /**
5842
- * The type of integration provider
5843
- * @example "netsuite"
6322
+ * HTTP status code. It will always be 422
6323
+ * @example 422
5844
6324
  */
5845
- provider: string;
6325
+ status: number;
5846
6326
  /**
5847
- * Unique code used to identify an integration connection.
5848
- * @example "netsuite-eu-1"
6327
+ * HTTP error description. It will always be "Unprocessable Entity"
6328
+ * @example "Unprocessable Entity"
5849
6329
  */
5850
- provider_code: string;
5851
- provider_error: string | Record<string, any>;
6330
+ error: string;
6331
+ message: string | Record<string, any>;
6332
+ event: EventObject;
5852
6333
  }
5853
- export interface PaymentProviderErrorObject {
5854
- /**
5855
- * Unique identifier assigned to the payment provider within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the payment provider's record within the Lago system.
5856
- * @format uuid
5857
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5858
- */
5859
- lago_payment_provider_id: string;
5860
- /**
5861
- * The name of payment provider
5862
- * @example "Stripe Prod"
5863
- */
5864
- payment_provider_name: string;
6334
+ export interface EventsErrorsObject {
5865
6335
  /**
5866
- * Code of the payment provider
5867
- * @example "stripe"
6336
+ * List of event transaction_id with an invalid code
6337
+ * @example ["transaction_1234567890"]
5868
6338
  */
5869
- payment_provider_code: string;
6339
+ invalid_code: string[];
5870
6340
  /**
5871
- * The source of the error
5872
- * @example "stripe"
6341
+ * List of event transaction_id with a missing aggregation property
6342
+ * @example ["transaction_1234567890"]
5873
6343
  */
5874
- source: "stripe";
6344
+ missing_aggregation_property: string[];
5875
6345
  /**
5876
- * The action that was being performed when the error occurred
5877
- * @example "payment_provider.register_webhook"
6346
+ * List of event transaction_id with invalid filter values
6347
+ * @example ["transaction_1234567890"]
5878
6348
  */
5879
- action?: "payment_provider.register_webhook";
5880
- provider_error: string | Record<string, any>;
6349
+ invalid_filter_values: string[];
5881
6350
  }
5882
- export interface PaymentRequestPaymentFailureObject {
5883
- /**
5884
- * Unique identifier assigned to the payment request within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the payment request record within the Lago system.
5885
- * @format uuid
5886
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5887
- */
5888
- lago_payment_request_id: string;
6351
+ export interface FeeTaxProviderErrorObject {
5889
6352
  /**
5890
- * List of unique identifiers assigned to the invoices within the Lago application. These IDs are exclusively created by Lago and serve as unique identifiers for the invoices records within the Lago system.
5891
- * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
6353
+ * Code of the tax provider
6354
+ * @example "Stripe Prod"
5892
6355
  */
5893
- lago_invoice_ids: string[];
6356
+ tax_provider_code: string;
5894
6357
  /**
5895
- * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system.
6358
+ * Unique identifier assigned to the charge that the fee belongs to
5896
6359
  * @format uuid
5897
6360
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5898
6361
  */
5899
- lago_customer_id: string;
5900
- /**
5901
- * The customer external unique identifier (provided by your own application)
5902
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5903
- */
5904
- external_customer_id: string;
5905
- /**
5906
- * Unique identifier of the customer within the payment provider
5907
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5908
- */
5909
- provider_customer_id?: string;
5910
- /**
5911
- * The type of payment provider code
5912
- * @example "stripe"
5913
- */
5914
- payment_provider: "adyen" | "cashfree" | "gocardless" | "stripe";
6362
+ lago_charge_id: string | null;
5915
6363
  /**
5916
- * Code of the payment provider
5917
- * @example "Stripe Prod"
6364
+ * Unique identifier assigned to the transaction. This field is specifically displayed when the fee type is `charge`.
6365
+ * @example "transaction_1234567890"
5918
6366
  */
5919
- payment_provider_code?: string;
5920
- provider_error?: string | Record<string, any>;
6367
+ event_transaction_id: string | null;
6368
+ provider_error: string | Record<string, any>;
5921
6369
  }
5922
- export type SubscriptionWithCustomerObject = SubscriptionObject & {
5923
- plan?: PlanObject;
5924
- customer?: CustomerObject;
5925
- };
5926
- export type SubscriptionWithThresholdObject = SubscriptionObject & {
5927
- plan?: PlanObject;
5928
- customer?: CustomerObject;
5929
- usage_threshold?: UsageThresholdObject;
5930
- };
5931
- export interface WalletTransactionPaymentFailureObject {
6370
+ export interface InvoicePaymentFailureObject {
5932
6371
  /**
5933
- * Unique identifier assigned to the wallet transaction within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet transaction's record within the Lago system.
6372
+ * Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system.
5934
6373
  * @format uuid
5935
6374
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5936
6375
  */
5937
- lago_wallet_transaction_id: string;
6376
+ lago_invoice_id: string;
5938
6377
  /**
5939
6378
  * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system.
5940
6379
  * @format uuid
@@ -5963,262 +6402,140 @@ export interface WalletTransactionPaymentFailureObject {
5963
6402
  payment_provider_code?: string;
5964
6403
  provider_error?: string | Record<string, any>;
5965
6404
  }
5966
- export interface ApiErrorForbidden {
6405
+ export interface IntegrationProviderErrorObject {
5967
6406
  /**
5968
- * @format int32
5969
- * @example 403
6407
+ * Unique identifier assigned to the integration within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the integration's record within the Lago system.
6408
+ * @format uuid
6409
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5970
6410
  */
5971
- status: number;
5972
- /** @example "Forbidden" */
5973
- error: string;
5974
- /** @example "feature_unavailable" */
5975
- code: string;
5976
- }
5977
- /** Billing entity create input */
5978
- export interface BillingEntityCreateInput {
5979
- billing_entity: {
5980
- /**
5981
- * The unique code of the billing entity
5982
- * @example "acme_corp"
5983
- */
5984
- code: string;
5985
- /**
5986
- * The name of the billing entity
5987
- * @example "Acme Corp"
5988
- */
5989
- name: string;
5990
- /**
5991
- * The default currency of the billing entity
5992
- * @example "USD"
5993
- */
5994
- default_currency?: Currency;
5995
- /**
5996
- * The type of document numbering for this billing entity:
5997
- * - `per_customer`: document numbers are unique per customer
5998
- * - `per_billing_entity`: document numbers are unique per billing entity
5999
- */
6000
- document_numbering?: "per_customer" | "per_billing_entity";
6001
- /**
6002
- * The prefix used in document numbers for this billing entity
6003
- * @example "ABC-123"
6004
- */
6005
- document_number_prefix?: string | null;
6006
- /**
6007
- * Whether to finalize invoices with zero amount for this billing entity
6008
- * @example true
6009
- */
6010
- finalize_zero_amount_invoice?: boolean;
6011
- billing_configuration?: {
6012
- /**
6013
- * The footer text to be displayed on invoices for this billing entity
6014
- * @example "Thank you for your business"
6015
- */
6016
- invoice_footer?: string;
6017
- /**
6018
- * The language of the documents generated for this billing entity
6019
- * @example "en"
6020
- */
6021
- document_locale?: string;
6022
- /**
6023
- * The grace period (in days) for invoice finalization
6024
- * @example 0
6025
- */
6026
- invoice_grace_period?: number;
6027
- };
6028
- /**
6029
- * The net payment term (in days) for this billing entity
6030
- * @example 0
6031
- */
6032
- net_payment_term?: number;
6033
- /**
6034
- * The first line of the billing address
6035
- * @example "5230 Penfield Ave"
6036
- */
6037
- address_line1?: string | null;
6038
- /**
6039
- * The second line of the billing address
6040
- * @example "Suite 100"
6041
- */
6042
- address_line2?: string | null;
6043
- /**
6044
- * The city of the billing address
6045
- * @example "Woodland Hills"
6046
- */
6047
- city?: string | null;
6048
- /**
6049
- * The state of the billing address
6050
- * @example "CA"
6051
- */
6052
- state?: string | null;
6053
- /** The country code of the billing address */
6054
- country?: Country | null;
6055
- /**
6056
- * The zipcode of the billing address
6057
- * @example "91364"
6058
- */
6059
- zipcode?: string | null;
6060
- /**
6061
- * The email address of the billing entity
6062
- * @format email
6063
- * @example "billing@acme.com"
6064
- */
6065
- email?: string | null;
6066
- /**
6067
- * The legal name of the billing entity
6068
- * @example "Acme Corporation"
6069
- */
6070
- legal_name?: string | null;
6071
- /**
6072
- * The legal registration number of the billing entity
6073
- * @example "US123456789"
6074
- */
6075
- legal_number?: string | null;
6076
- /**
6077
- * The tax identification number of the billing entity
6078
- * @example "EU123456789"
6079
- */
6080
- tax_identification_number?: string | null;
6081
- /**
6082
- * The timezone of the billing entity
6083
- * @example "UTC"
6084
- */
6085
- timezone?: Timezone;
6086
- /** The email notification settings for this billing entity */
6087
- email_settings?: ("invoice.finalized" | "credit_note.created")[];
6088
- /**
6089
- * Whether EU tax management is enabled for this billing entity
6090
- * @example false
6091
- */
6092
- eu_tax_management?: boolean;
6093
- /**
6094
- * The base64 encoded logo image for the billing entity
6095
- * @format uri
6096
- * @example "data:image/png;base64,..."
6097
- */
6098
- logo?: string | null;
6099
- };
6100
- }
6101
- /** Billing entity update input */
6102
- export interface BillingEntityUpdateInput {
6411
+ lago_integration_id: string;
6412
+ /**
6413
+ * The type of integration provider
6414
+ * @example "netsuite"
6415
+ */
6416
+ provider: string;
6103
6417
  /**
6104
- * The unique code of the billing entity
6105
- * @example "acme_corp"
6418
+ * Unique code used to identify an integration connection.
6419
+ * @example "netsuite-eu-1"
6106
6420
  */
6107
- code: string;
6421
+ provider_code: string;
6422
+ provider_error: string | Record<string, any>;
6423
+ }
6424
+ export interface PaymentProviderErrorObject {
6108
6425
  /**
6109
- * The name of the billing entity
6110
- * @example "Acme Corp"
6426
+ * Unique identifier assigned to the payment provider within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the payment provider's record within the Lago system.
6427
+ * @format uuid
6428
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6111
6429
  */
6112
- name?: string;
6430
+ lago_payment_provider_id: string;
6113
6431
  /**
6114
- * The default currency of the billing entity
6115
- * @example "USD"
6432
+ * The name of payment provider
6433
+ * @example "Stripe Prod"
6116
6434
  */
6117
- default_currency?: Currency;
6435
+ payment_provider_name: string;
6118
6436
  /**
6119
- * The type of document numbering for this billing entity:
6120
- * - `per_customer`: document numbers are unique per customer
6121
- * - `per_billing_entity`: document numbers are unique per billing entity
6437
+ * Code of the payment provider
6438
+ * @example "stripe"
6122
6439
  */
6123
- document_numbering?: "per_customer" | "per_billing_entity";
6440
+ payment_provider_code: string;
6124
6441
  /**
6125
- * The prefix used in document numbers for this billing entity
6126
- * @example "ABC-123"
6442
+ * The source of the error
6443
+ * @example "stripe"
6127
6444
  */
6128
- document_number_prefix?: string | null;
6445
+ source: "stripe";
6129
6446
  /**
6130
- * Whether to finalize invoices with zero amount for this billing entity
6131
- * @example true
6447
+ * The action that was being performed when the error occurred
6448
+ * @example "payment_provider.register_webhook"
6132
6449
  */
6133
- finalize_zero_amount_invoice?: boolean;
6134
- billing_configuration?: {
6135
- /**
6136
- * The footer text to be displayed on invoices for this billing entity
6137
- * @example "Thank you for your business"
6138
- */
6139
- invoice_footer?: string;
6140
- /**
6141
- * The language of the documents generated for this billing entity
6142
- * @example "en"
6143
- */
6144
- document_locale?: string;
6145
- /**
6146
- * The grace period (in days) for invoice finalization
6147
- * @example 0
6148
- */
6149
- invoice_grace_period?: number;
6150
- };
6450
+ action?: "payment_provider.register_webhook";
6451
+ provider_error: string | Record<string, any>;
6452
+ }
6453
+ export interface PaymentRequestPaymentFailureObject {
6151
6454
  /**
6152
- * The net payment term (in days) for this billing entity
6153
- * @example 0
6455
+ * Unique identifier assigned to the payment request within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the payment request record within the Lago system.
6456
+ * @format uuid
6457
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6154
6458
  */
6155
- net_payment_term?: number;
6459
+ lago_payment_request_id: string;
6156
6460
  /**
6157
- * The first line of the billing address
6158
- * @example "5230 Penfield Ave"
6461
+ * List of unique identifiers assigned to the invoices within the Lago application. These IDs are exclusively created by Lago and serve as unique identifiers for the invoices records within the Lago system.
6462
+ * @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
6159
6463
  */
6160
- address_line1?: string | null;
6464
+ lago_invoice_ids: string[];
6161
6465
  /**
6162
- * The second line of the billing address
6163
- * @example "Suite 100"
6466
+ * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system.
6467
+ * @format uuid
6468
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6164
6469
  */
6165
- address_line2?: string | null;
6470
+ lago_customer_id: string;
6166
6471
  /**
6167
- * The city of the billing address
6168
- * @example "Woodland Hills"
6472
+ * The customer external unique identifier (provided by your own application)
6473
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6169
6474
  */
6170
- city?: string | null;
6475
+ external_customer_id: string;
6171
6476
  /**
6172
- * The state of the billing address
6173
- * @example "CA"
6477
+ * Unique identifier of the customer within the payment provider
6478
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6174
6479
  */
6175
- state?: string | null;
6176
- /** The country code of the billing address */
6177
- country?: Country | null;
6480
+ provider_customer_id?: string;
6178
6481
  /**
6179
- * The zipcode of the billing address
6180
- * @example "91364"
6482
+ * The type of payment provider code
6483
+ * @example "stripe"
6181
6484
  */
6182
- zipcode?: string | null;
6485
+ payment_provider: "adyen" | "cashfree" | "gocardless" | "stripe";
6183
6486
  /**
6184
- * The email address of the billing entity
6185
- * @format email
6186
- * @example "billing@acme.com"
6487
+ * Code of the payment provider
6488
+ * @example "Stripe Prod"
6187
6489
  */
6188
- email?: string | null;
6490
+ payment_provider_code?: string;
6491
+ provider_error?: string | Record<string, any>;
6492
+ }
6493
+ export type SubscriptionWithCustomerObject = SubscriptionObject & {
6494
+ plan?: PlanObject;
6495
+ customer?: CustomerObject;
6496
+ };
6497
+ export type SubscriptionWithThresholdObject = SubscriptionObject & {
6498
+ plan?: PlanObject;
6499
+ customer?: CustomerObject;
6500
+ usage_threshold?: UsageThresholdObject;
6501
+ };
6502
+ export interface WalletTransactionPaymentFailureObject {
6189
6503
  /**
6190
- * The legal name of the billing entity
6191
- * @example "Acme Corporation"
6504
+ * Unique identifier assigned to the wallet transaction within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet transaction's record within the Lago system.
6505
+ * @format uuid
6506
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6192
6507
  */
6193
- legal_name?: string | null;
6508
+ lago_wallet_transaction_id: string;
6194
6509
  /**
6195
- * The legal registration number of the billing entity
6196
- * @example "US123456789"
6510
+ * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system.
6511
+ * @format uuid
6512
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6197
6513
  */
6198
- legal_number?: string | null;
6514
+ lago_customer_id: string;
6199
6515
  /**
6200
- * The tax identification number of the billing entity
6201
- * @example "EU123456789"
6516
+ * The customer external unique identifier (provided by your own application)
6517
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6202
6518
  */
6203
- tax_identification_number?: string | null;
6519
+ external_customer_id: string;
6204
6520
  /**
6205
- * The timezone of the billing entity
6206
- * @example "UTC"
6521
+ * Unique identifier of the customer within the payment provider
6522
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6207
6523
  */
6208
- timezone?: Timezone;
6209
- /** The email notification settings for this billing entity */
6210
- email_settings?: ("invoice.finalized" | "credit_note.created")[];
6524
+ provider_customer_id?: string;
6211
6525
  /**
6212
- * Whether EU tax management is enabled for this billing entity
6213
- * @example false
6526
+ * The type of payment provider code
6527
+ * @example "stripe"
6214
6528
  */
6215
- eu_tax_management?: boolean;
6529
+ payment_provider: "adyen" | "cashfree" | "gocardless" | "stripe";
6216
6530
  /**
6217
- * The base64 encoded logo image for the billing entity
6218
- * @format uri
6219
- * @example "data:image/png;base64,..."
6531
+ * Code of the payment provider
6532
+ * @example "Stripe Prod"
6220
6533
  */
6221
- logo?: string | null;
6534
+ payment_provider_code?: string;
6535
+ provider_error?: string | Record<string, any>;
6536
+ }
6537
+ export interface CreditNotes {
6538
+ credit_notes: CreditNoteObject[];
6222
6539
  }
6223
6540
  export type CustomerPaymentProvidernErrorObject = CustomerPaymentProviderErrorObject;
6224
6541
  export type QueryParamsType = Record<string | number, any>;
@@ -6281,7 +6598,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
6281
6598
  }
6282
6599
  /**
6283
6600
  * @title Lago API documentation
6284
- * @version 1.26.0
6601
+ * @version 1.28.1
6285
6602
  * @license AGPLv3
6286
6603
  * @baseUrl https://api.getlago.com/api/v1
6287
6604
  * @externalDocs https://github.com/getlago
@@ -6303,6 +6620,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6303
6620
  listBillingEntities: (params?: RequestParams) => Promise<HttpResponse<{
6304
6621
  billing_entities: BillingEntityObject[];
6305
6622
  }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
6623
+ /**
6624
+ * @description This endpoint is used to create a new billing entity
6625
+ *
6626
+ * @tags billing_entities
6627
+ * @name CreateBillingEntity
6628
+ * @summary Create a billing entity
6629
+ * @request POST:/billing_entities
6630
+ * @secure
6631
+ */
6632
+ createBillingEntity: (data: BillingEntityCreateInput, params?: RequestParams) => Promise<HttpResponse<BillingEntityObject, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
6306
6633
  /**
6307
6634
  * @description This endpoint returns a specific billing entity by its code
6308
6635
  *
@@ -6315,6 +6642,96 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6315
6642
  getBillingEntity: (code: string, params?: RequestParams) => Promise<HttpResponse<{
6316
6643
  billing_entity: BillingEntityObjectExtended;
6317
6644
  }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
6645
+ /**
6646
+ * @description This endpoint is used to update an existing billing entity
6647
+ *
6648
+ * @tags billing_entities
6649
+ * @name UpdateBillingEntity
6650
+ * @summary Update a billing entity
6651
+ * @request PUT:/billing_entities/{code}
6652
+ * @secure
6653
+ */
6654
+ updateBillingEntity: (code: string, data: BillingEntityUpdateInput, params?: RequestParams) => Promise<HttpResponse<BillingEntityObjectExtended, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
6655
+ };
6656
+ activityLogs: {
6657
+ /**
6658
+ * @description This endpoint retrieves all existing activity logs that represent actions performed on application resources.
6659
+ *
6660
+ * @tags activity_logs
6661
+ * @name FindAllActivityLogs
6662
+ * @summary List all activity logs
6663
+ * @request GET:/activity_logs
6664
+ * @secure
6665
+ */
6666
+ findAllActivityLogs: (query?: {
6667
+ /**
6668
+ * Page number.
6669
+ * @example 1
6670
+ */
6671
+ page?: number;
6672
+ /**
6673
+ * Number of records per page.
6674
+ * @example 20
6675
+ */
6676
+ per_page?: number;
6677
+ /**
6678
+ * Filter activity logs from a specific date.
6679
+ * @format date
6680
+ * @example "2022-08-09"
6681
+ */
6682
+ from_date?: string;
6683
+ /**
6684
+ * Filter activity logs up to a specific date.
6685
+ * @format date
6686
+ * @example "2022-08-09"
6687
+ */
6688
+ to_date?: string;
6689
+ /**
6690
+ * Filter results by activity types
6691
+ * @example ["billing_metric.created","billing_metric.updated"]
6692
+ */
6693
+ activity_types?: string[];
6694
+ /**
6695
+ * Filter results by activity sources
6696
+ * @example ["api","front"]
6697
+ */
6698
+ activity_sources?: ("api" | "front" | "system")[];
6699
+ /**
6700
+ * Filter results by user emails
6701
+ * @example ["dinesh@piedpiper.test"]
6702
+ */
6703
+ user_emails?: string[];
6704
+ /**
6705
+ * Unique identifier assigned to the customer in your application.
6706
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6707
+ */
6708
+ external_customer_id?: string;
6709
+ /**
6710
+ * External subscription ID
6711
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6712
+ */
6713
+ external_subscription_id?: string;
6714
+ /**
6715
+ * Filter results by resources unique identifiers
6716
+ * @example ["5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba","1a901a90-1a90-1a90-1a90-1a901a901a90"]
6717
+ */
6718
+ resource_ids?: string[];
6719
+ /**
6720
+ * Filter results by resource class types
6721
+ * @example ["BillableMetric","Invoice"]
6722
+ */
6723
+ resource_types?: string[];
6724
+ }, params?: RequestParams) => Promise<HttpResponse<ActivityLogsPaginated, ApiErrorUnauthorized>>;
6725
+ /**
6726
+ * @description This endpoint retrieves an existing activity log that represents an action performed on some resource. The activity log is identified by its unique activity_id.
6727
+ *
6728
+ * @tags activity_logs
6729
+ * @name FindActivityLog
6730
+ * @summary Retrieve an activity log
6731
+ * @request GET:/activity_logs/{activity_id}
6732
+ * @secure
6733
+ */
6734
+ findActivityLog: (activityId: string, params?: RequestParams) => Promise<HttpResponse<ActivityLog, ApiErrorUnauthorized | ApiErrorNotFound>>;
6318
6735
  };
6319
6736
  addOns: {
6320
6737
  /**
@@ -6357,7 +6774,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6357
6774
  * @request PUT:/add_ons/{code}
6358
6775
  * @secure
6359
6776
  */
6360
- updateAddOn: (code: string, data: AddOnUpdateInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
6777
+ updateAddOn: (code: string, data: AddOnUpdateInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
6361
6778
  /**
6362
6779
  * @description This endpoint is used to retrieve a specific add-on.
6363
6780
  *
@@ -6498,7 +6915,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6498
6915
  * @request POST:/applied_coupons
6499
6916
  * @secure
6500
6917
  */
6501
- applyCoupon: (data: AppliedCouponInput, params?: RequestParams) => Promise<HttpResponse<AppliedCoupon, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
6918
+ applyCoupon: (data: AppliedCouponInput, params?: RequestParams) => Promise<HttpResponse<AppliedCoupon, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
6502
6919
  /**
6503
6920
  * @description This endpoint is used to list all applied coupons. You can filter by coupon status and by customer.
6504
6921
  *
@@ -6529,6 +6946,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6529
6946
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6530
6947
  */
6531
6948
  external_customer_id?: string;
6949
+ /**
6950
+ * The code of the coupon applied to the customer. Use it to filter applied coupons by their code.
6951
+ * @example ["BLACK_FRIDAY_2024","CHRISTMAS_2024"]
6952
+ */
6953
+ "coupon_code[]"?: string[];
6532
6954
  }, params?: RequestParams) => Promise<HttpResponse<AppliedCouponsPaginated, ApiErrorUnauthorized>>;
6533
6955
  };
6534
6956
  billableMetrics: {
@@ -6582,7 +7004,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6582
7004
  * @request PUT:/billable_metrics/{code}
6583
7005
  * @secure
6584
7006
  */
6585
- updateBillableMetric: (code: string, data: BillableMetricUpdateInput, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
7007
+ updateBillableMetric: (code: string, data: BillableMetricUpdateInput, params?: RequestParams) => Promise<HttpResponse<BillableMetric, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
6586
7008
  /**
6587
7009
  * @description This endpoint deletes an existing billable metric representing a pricing component of your application.
6588
7010
  *
@@ -6645,7 +7067,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6645
7067
  * @request PUT:/coupons/{code}
6646
7068
  * @secure
6647
7069
  */
6648
- updateCoupon: (code: string, data: CouponUpdateInput, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
7070
+ updateCoupon: (code: string, data: CouponUpdateInput, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
6649
7071
  /**
6650
7072
  * @description This endpoint is used to retrieve a specific coupon.
6651
7073
  *
@@ -6756,7 +7178,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6756
7178
  * @example ["billing_entity_code_1","billing_entity_code_2"]
6757
7179
  */
6758
7180
  billing_entity_codes?: string[];
6759
- }, params?: RequestParams) => Promise<HttpResponse<CreditNotes, ApiErrorUnauthorized>>;
7181
+ }, params?: RequestParams) => Promise<HttpResponse<CreditNotesPaginated, ApiErrorUnauthorized>>;
6760
7182
  /**
6761
7183
  * @description This endpoint updates an existing credit note.
6762
7184
  *
@@ -6766,7 +7188,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6766
7188
  * @request PUT:/credit_notes/{lago_id}
6767
7189
  * @secure
6768
7190
  */
6769
- updateCreditNote: (lagoId: string, data: CreditNoteUpdateInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
7191
+ updateCreditNote: (lagoId: string, data: CreditNoteUpdateInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
6770
7192
  /**
6771
7193
  * @description This endpoint retrieves an existing credit note.
6772
7194
  *
@@ -7040,7 +7462,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7040
7462
  * @request POST:/events/estimate_fees
7041
7463
  * @secure
7042
7464
  */
7043
- eventEstimateFees: (data: EventEstimateFeesInput, params?: RequestParams) => Promise<HttpResponse<Fees, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
7465
+ eventEstimateFees: (data: EventEstimateFeesInput, params?: RequestParams) => Promise<HttpResponse<Fees, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7044
7466
  /**
7045
7467
  * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
7046
7468
  *
@@ -7173,7 +7595,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7173
7595
  * @request PUT:/fees/{lago_id}
7174
7596
  * @secure
7175
7597
  */
7176
- updateFee: (lagoId: string, data: FeeUpdateInput, params?: RequestParams) => Promise<HttpResponse<Fee, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest | ApiErrorNotAllowed>>;
7598
+ updateFee: (lagoId: string, data: FeeUpdateInput, params?: RequestParams) => Promise<HttpResponse<Fee, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound | ApiErrorNotAllowed>>;
7177
7599
  /**
7178
7600
  * @description This endpoint is used for deleting a specific fee that has not yet been invoiced
7179
7601
  *
@@ -7294,7 +7716,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7294
7716
  * @request PUT:/invoices/{lago_id}
7295
7717
  * @secure
7296
7718
  */
7297
- updateInvoice: (lagoId: string, data: InvoiceUpdateInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
7719
+ updateInvoice: (lagoId: string, data: InvoiceUpdateInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7298
7720
  /**
7299
7721
  * @description This endpoint is used for retrieving a specific invoice that has been issued.
7300
7722
  *
@@ -7525,7 +7947,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7525
7947
  * @format uuid
7526
7948
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
7527
7949
  */
7528
- lago_invoice_id?: string;
7950
+ invoice_id?: string;
7529
7951
  }, params?: RequestParams) => Promise<HttpResponse<PaymentsPaginated, ApiErrorUnauthorized>>;
7530
7952
  /**
7531
7953
  * @description This endpoint retrieves a specific payment by its ID.
@@ -7548,7 +7970,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7548
7970
  * @request POST:/plans
7549
7971
  * @secure
7550
7972
  */
7551
- createPlan: (data: PlanCreateInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
7973
+ createPlan: (data: PlanCreateInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7552
7974
  /**
7553
7975
  * @description This endpoint retrieves all existing plans.
7554
7976
  *
@@ -7579,7 +8001,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7579
8001
  * @request PUT:/plans/{code}
7580
8002
  * @secure
7581
8003
  */
7582
- updatePlan: (code: string, data: PlanUpdateInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
8004
+ updatePlan: (code: string, data: PlanUpdateInput, params?: RequestParams) => Promise<HttpResponse<Plan, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7583
8005
  /**
7584
8006
  * @description This endpoint retrieves a specific plan.
7585
8007
  *
@@ -7611,7 +8033,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7611
8033
  * @request POST:/subscriptions
7612
8034
  * @secure
7613
8035
  */
7614
- createSubscription: (data: SubscriptionCreateInput, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
8036
+ createSubscription: (data: SubscriptionCreateInput, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7615
8037
  /**
7616
8038
  * @description This endpoint retrieves all active subscriptions.
7617
8039
  *
@@ -7657,7 +8079,15 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7657
8079
  * @request GET:/subscriptions/{external_id}
7658
8080
  * @secure
7659
8081
  */
7660
- findSubscription: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotFound>>;
8082
+ findSubscription: (externalId: string, query?: {
8083
+ /**
8084
+ * By default, this endpoint only return `active` subscriptions. If you want to retrieve a subscription with a different `status`, you can specify it here.
8085
+ *
8086
+ * _Note: As there may exists multiple `canceled` or `terminated` subscribtions for the same `external_id`, it is recommended to use the "List all subscriptions" endpoint to retrieve those subscriptions._
8087
+ * @example "active"
8088
+ */
8089
+ status?: "active" | "terminated" | "pending" | "canceled";
8090
+ }, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotFound>>;
7661
8091
  /**
7662
8092
  * @description This endpoint allows you to update a subscription.
7663
8093
  *
@@ -7667,7 +8097,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7667
8097
  * @request PUT:/subscriptions/{external_id}
7668
8098
  * @secure
7669
8099
  */
7670
- updateSubscription: (externalId: string, data: SubscriptionUpdateInput, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
8100
+ updateSubscription: (externalId: string, data: SubscriptionUpdateInput, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7671
8101
  /**
7672
8102
  * @description This endpoint allows you to terminate a subscription.
7673
8103
  *
@@ -7689,7 +8119,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7689
8119
  *
7690
8120
  * @tags subscriptions
7691
8121
  * @name GetSubscriptionLifetimeUsage
7692
- * @summary Retrive subscription lifetime usage
8122
+ * @summary Retrieve subscription lifetime usage
7693
8123
  * @request GET:/subscriptions/{external_id}/lifetime_usage
7694
8124
  * @secure
7695
8125
  */
@@ -7703,7 +8133,57 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7703
8133
  * @request PUT:/subscriptions/{external_id}/lifetime_usage
7704
8134
  * @secure
7705
8135
  */
7706
- updateSubscriptionLifetimeUsage: (externalId: string, data: LifetimeUsageInput, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
8136
+ updateSubscriptionLifetimeUsage: (externalId: string, data: LifetimeUsageInput, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8137
+ /**
8138
+ * @description This endpoint enables the retrieval of all alerts for a subscription.
8139
+ *
8140
+ * @tags subscriptions
8141
+ * @name GetSubscriptionAlerts
8142
+ * @summary List subscription alerts
8143
+ * @request GET:/subscriptions/{external_id}/alerts
8144
+ * @secure
8145
+ */
8146
+ getSubscriptionAlerts: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Alerts, ApiErrorUnauthorized | ApiErrorNotFound>>;
8147
+ /**
8148
+ * @description This endpoint allows you to create a new alert for a subscription.
8149
+ *
8150
+ * @tags subscriptions
8151
+ * @name CreateSubscriptionAlert
8152
+ * @summary Create a subscription alert
8153
+ * @request POST:/subscriptions/{external_id}/alerts
8154
+ * @secure
8155
+ */
8156
+ createSubscriptionAlert: (externalId: string, data: AlertCreateInput, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8157
+ /**
8158
+ * @description This endpoint enables the retrieval of a specific alert for a subscription.
8159
+ *
8160
+ * @tags subscriptions
8161
+ * @name GetSubscriptionAlert
8162
+ * @summary Retrieve a subscription alert
8163
+ * @request GET:/subscriptions/{external_id}/alerts/{code}
8164
+ * @secure
8165
+ */
8166
+ getSubscriptionAlert: (externalId: string, code: string, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
8167
+ /**
8168
+ * @description This endpoint allows you to update an existing alert for a subscription.
8169
+ *
8170
+ * @tags subscriptions
8171
+ * @name UpdateSubscriptionAlert
8172
+ * @summary Update a subscription alert
8173
+ * @request PUT:/subscriptions/{external_id}/alerts/{code}
8174
+ * @secure
8175
+ */
8176
+ updateSubscriptionAlert: (externalId: string, code: string, data: AlertUpdateInput, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8177
+ /**
8178
+ * @description This endpoint allows you to delete an existing alert for a subscription.
8179
+ *
8180
+ * @tags subscriptions
8181
+ * @name DeleteSubscriptionAlert
8182
+ * @summary Delete a subscription alert
8183
+ * @request DELETE:/subscriptions/{external_id}/alerts/{code}
8184
+ * @secure
8185
+ */
8186
+ deleteSubscriptionAlert: (externalId: string, code: string, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
7707
8187
  };
7708
8188
  taxes: {
7709
8189
  /**
@@ -7746,7 +8226,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7746
8226
  * @request PUT:/taxes/{code}
7747
8227
  * @secure
7748
8228
  */
7749
- updateTax: (code: string, data: TaxUpdateInput, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
8229
+ updateTax: (code: string, data: TaxUpdateInput, params?: RequestParams) => Promise<HttpResponse<Tax, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7750
8230
  /**
7751
8231
  * @description This endpoint retrieves an existing tax representing a customizable tax rate applicable to either the organization or a specific customer. The tax is identified by its unique code.
7752
8232
  *
@@ -7814,7 +8294,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7814
8294
  * @request PUT:/wallets/{lago_id}
7815
8295
  * @secure
7816
8296
  */
7817
- updateWallet: (lagoId: string, data: WalletUpdateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
8297
+ updateWallet: (lagoId: string, data: WalletUpdateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7818
8298
  /**
7819
8299
  * @description This endpoint is used to retrieve an existing wallet with prepaid credits.
7820
8300
  *
@@ -7957,7 +8437,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7957
8437
  * @request PUT:/webhook_endpoints/{lago_id}
7958
8438
  * @secure
7959
8439
  */
7960
- updateWebhookEndpoint: (lagoId: string, data: WebhookEndpointUpdateInput, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound | ApiErrorBadRequest>>;
8440
+ updateWebhookEndpoint: (lagoId: string, data: WebhookEndpointUpdateInput, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7961
8441
  /**
7962
8442
  * @description This endpoint is used to retrieve an existing webhook endpoint.
7963
8443
  *