lago-javascript-client 1.40.0 → 1.44.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.
@@ -2323,173 +2323,463 @@ export type CreditNoteAppliedTaxObject = BaseAppliedTax & {
2323
2323
  /** @example 100 */
2324
2324
  base_amount_cents?: number;
2325
2325
  };
2326
- /**
2327
- * Custom metadata stored as key-value pairs.
2328
- * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
2329
- * @example {"external_id":"ext-123","synced_at":"2024-01-15","source":null}
2330
- */
2331
- export type MetadataObject = object | null;
2332
- export interface CreditNoteErrorDetailsObject {
2326
+ /** @example "US" */
2327
+ export type CountryOrNull = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";
2328
+ /** @example "America/Los_Angeles" */
2329
+ export type TimezoneOrNull = "UTC" | "Africa/Algiers" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Monrovia" | "Africa/Nairobi" | "America/Argentina/Buenos_Aires" | "America/Bogota" | "America/Caracas" | "America/Chicago" | "America/Chihuahua" | "America/Denver" | "America/Godthab" | "America/Guatemala" | "America/Guyana" | "America/Halifax" | "America/Indiana/Indianapolis" | "America/Juneau" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Mazatlan" | "America/Mexico_City" | "America/Monterrey" | "America/Montevideo" | "America/New_York" | "America/Phoenix" | "America/Puerto_Rico" | "America/Regina" | "America/Santiago" | "America/Sao_Paulo" | "America/St_Johns" | "America/Tijuana" | "Asia/Almaty" | "Asia/Baghdad" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Dhaka" | "Asia/Hong_Kong" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kathmandu" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuwait" | "Asia/Magadan" | "Asia/Muscat" | "Asia/Novosibirsk" | "Asia/Rangoon" | "Asia/Riyadh" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tokyo" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Cape_Verde" | "Atlantic/South_Georgia" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Darwin" | "Australia/Hobart" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "Europe/Amsterdam" | "Europe/Athens" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Helsinki" | "Europe/Istanbul" | "Europe/Kaliningrad" | "Europe/Kiev" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Madrid" | "Europe/Minsk" | "Europe/Moscow" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zurich" | "GMT+12" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Chatham" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Majuro" | "Pacific/Midway" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Port_Moresby" | "Pacific/Tongatapu";
2330
+ /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2331
+ export interface CustomerBillingConfiguration {
2333
2332
  /**
2334
- * The credit note error details unique identifier, created by Lago.
2335
- * @format uuid
2336
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2333
+ * The grace period, expressed in days, for the invoice. This period refers to the additional time granted to the customer beyond the invoice due date to adjust usage and line items
2334
+ * @example 3
2337
2335
  */
2338
- lago_id: string;
2336
+ invoice_grace_period?: number;
2339
2337
  /**
2340
- * The type of the error.
2341
- * @example "tax_error"
2338
+ * Defines whether the issuing date follows the current billing period's end date or the next period starting date.
2339
+ * @default null
2340
+ * @example "next_period_start"
2342
2341
  */
2343
- error_code: "not_provided" | "tax_error" | "tax_voiding_error" | "invoice_generation_error";
2344
- /** The details of the error. */
2345
- details: object;
2342
+ subscription_invoice_issuing_date_anchor?: "current_period_end" | "next_period_start";
2343
+ /**
2344
+ * The logic applied on top of the subscription_invoice_issuing_date_anchor rule. You can opt to use the invoice finalization date, that includes any configured grace period.
2345
+ * @default null
2346
+ * @example "keep_anchor"
2347
+ */
2348
+ subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
2349
+ /**
2350
+ * The payment provider utilized to initiate payments for invoices issued by Lago.
2351
+ * Accepted values: `stripe`, `adyen`, `gocardless` or null. This field is required if you intend to assign a `provider_customer_id`.
2352
+ * @example "stripe"
2353
+ */
2354
+ payment_provider?: "stripe" | "adyen" | "gocardless";
2355
+ /**
2356
+ * Unique code used to identify a payment provider connection.
2357
+ * @example "stripe-eu-1"
2358
+ */
2359
+ payment_provider_code?: string;
2360
+ /**
2361
+ * The customer ID within the payment provider's system. If this field is not provided, Lago has the option to create a new customer record within the payment provider's system on behalf of the customer
2362
+ * @example "cus_12345"
2363
+ */
2364
+ provider_customer_id?: string;
2365
+ /**
2366
+ * Set this field to `true` if you want to create the customer in the payment provider synchronously with the customer creation process in Lago. This option is applicable only when the `provider_customer_id` is `null` and the customer is automatically created in the payment provider through Lago. By default, the value is set to `false`
2367
+ * @example true
2368
+ */
2369
+ sync?: boolean;
2370
+ /**
2371
+ * Set this field to `true` if you want to create a customer record in the payment provider's system. This option is applicable only when the `provider_customer_id` is null and the `sync_with_provider` field is set to `true`. By default, the value is set to `false`
2372
+ * @example true
2373
+ */
2374
+ sync_with_provider?: boolean;
2375
+ /**
2376
+ * The document locale, specified in the ISO 639-1 format. This field represents the language or locale used for the documents issued by Lago
2377
+ * @example "fr"
2378
+ */
2379
+ document_locale?: string;
2380
+ /**
2381
+ * Specifies the available payment methods that can be used for this customer when `payment_provider` is set to `stripe`. The `provider_payment_methods` field is an array that allows multiple payment options to be defined. If this field is not explicitly set, the payment methods will be set to `card`. For now, possible values are `card`, `sepa_debit`, `us_bank_account`, `bacs_debit`, `boleto`, `link`, `crypto` and `customer_balance`. Note that when `link` is selected, `card` should also be provided in the array. When `customer_balance` is selected, no other payment can be selected.
2382
+ * @example ["card","sepa_debit","us_bank_account","bacs_debit","link","boleto","crypto","customer_balance"]
2383
+ */
2384
+ provider_payment_methods?: any[] | null;
2346
2385
  }
2347
- export interface CreditNoteObject {
2386
+ /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2387
+ export interface Address {
2348
2388
  /**
2349
- * The credit note unique identifier, created by Lago.
2350
- * @format uuid
2351
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2389
+ * The first line of the billing address
2390
+ * @example "5230 Penfield Ave"
2352
2391
  */
2353
- lago_id: string;
2392
+ address_line1?: string | null;
2354
2393
  /**
2355
- * The unique code of the billing entity associated with the credit note.
2356
- * @example "acme_corp"
2394
+ * The second line of the billing address
2395
+ * @example null
2357
2396
  */
2358
- billing_entity_code: string;
2397
+ address_line2?: string | null;
2359
2398
  /**
2360
- * The sequential identifier of the credit note, specifically scoped on the associated invoice. It provides a unique numerical identifier for the credit note within the context of the invoice.
2361
- * @example 2
2399
+ * The city of the customer's billing address
2400
+ * @example "Woodland Hills"
2362
2401
  */
2363
- sequential_id: number;
2402
+ city?: string | null;
2364
2403
  /**
2365
- * The credit note unique number.
2366
- * @example "LAG-1234-CN2"
2404
+ * Country code of the customer's billing address. Format must be ISO 3166 (alpha-2)
2405
+ * @example "US"
2367
2406
  */
2368
- number: string;
2407
+ country?: CountryOrNull;
2369
2408
  /**
2370
- * Unique identifier assigned to the invoice that the credit note belongs to
2371
- * @format uuid
2372
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2409
+ * The state of the customer's billing address
2410
+ * @example "CA"
2373
2411
  */
2374
- lago_invoice_id: string;
2412
+ state?: string | null;
2375
2413
  /**
2376
- * The invoice unique number, related to the credit note.
2377
- * @example "LAG-1234"
2414
+ * The zipcode of the customer's billing address
2415
+ * @example "91364"
2378
2416
  */
2379
- invoice_number: string;
2417
+ zipcode?: string | null;
2418
+ }
2419
+ /** Set of key-value pairs that you can attach to a customer. This can be useful for storing additional information about the customer in a structured format */
2420
+ export interface CustomerMetadata {
2380
2421
  /**
2381
- * The date of creation of the credit note. It follows the ISO 8601 date format and provides the specific date when the credit note was created.
2382
- * @format date
2383
- * @example "2022-12-06"
2422
+ * A unique identifier for the customer metadata object in the Lago application. Can be used to update a key-value pair
2423
+ * @format uuid
2424
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2384
2425
  */
2385
- issuing_date: string;
2426
+ lago_id: string;
2386
2427
  /**
2387
- * The status of the credit portion of the credit note. It indicates the current state or condition of the credit amount associated with the credit note. The possible values for this field are:
2388
- *
2389
- * - `available`: this status indicates that an amount remains available for future usage. The credit can be applied towards future transactions or invoices.
2390
- * - `consumed`: this status indicates that the credit amount has been fully consumed. The remaining amount is 0, indicating that the credit has been utilized in its entirety.
2391
- * - `voided`: this status indicates that the remaining amount of the credit cannot be used any further. The credit has been voided and is no longer available for application or redemption.
2392
- * @example "available"
2428
+ * The metadata object key
2429
+ * @example "Purchase Order"
2393
2430
  */
2394
- credit_status?: "available" | "consumed" | "voided";
2431
+ key: string;
2395
2432
  /**
2396
- * The status of the refund portion of the credit note. It indicates the current state or condition of the refund associated with the credit note. The possible values for this field are:
2397
- *
2398
- * - `pending`: this status indicates that the refund is pending execution. The refund request has been initiated but has not been processed or completed yet.
2399
- * - `succeeded`: this status indicates that the refund has been successfully executed. The refund amount has been processed and returned to the customer or the designated recipient.
2400
- * - `failed`: this status indicates that the refund failed to execute. The refund request encountered an error or unsuccessful processing, and the refund amount could not be returned.
2401
- * @example "pending"
2433
+ * The metadata object value
2434
+ * @example "123456789"
2402
2435
  */
2403
- refund_status?: "pending" | "succeeded" | "failed";
2436
+ value: string;
2404
2437
  /**
2405
- * The reason of the credit note creation.
2406
- * Possible values are `duplicated_charge`, `product_unsatisfactory`, `order_change`, `order_cancellation`, `fraudulent_charge` or `other`.
2407
- * @example "other"
2438
+ * Determines whether the item or information should be displayed in the invoice. If set to true, the item or information will be included and visible in the generated invoice. If set to false, the item or information will be excluded and not displayed in the invoice.
2439
+ * @example true
2408
2440
  */
2409
- reason: "duplicated_charge" | "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "other";
2441
+ display_in_invoice: boolean;
2410
2442
  /**
2411
- * The description of the credit note.
2412
- * @example "Free text"
2443
+ * The date of the metadata object creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the metadata object was created
2444
+ * @format date-time
2445
+ * @example "2022-04-29T08:59:51Z"
2413
2446
  */
2414
- description?: string | null;
2447
+ created_at: string;
2448
+ }
2449
+ export interface CustomerBaseObject {
2415
2450
  /**
2416
- * The currency of the credit note.
2417
- * @example "EUR"
2451
+ * 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
2452
+ * @format uuid
2453
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2418
2454
  */
2419
- currency: Currency;
2455
+ lago_id: string;
2420
2456
  /**
2421
- * The total amount of the credit note, expressed in cents.
2422
- * @example 120
2457
+ * The unique identifier assigned to the customer within the organization's scope. This identifier is used to track and reference the customer's order of creation within the organization's system. It ensures that each customer has a distinct `sequential_id`` associated with them, allowing for easy identification and sorting based on the order of creation
2458
+ * @example 1
2423
2459
  */
2424
- total_amount_cents: number;
2460
+ sequential_id: number;
2425
2461
  /**
2426
- * The tax amount of the credit note, expressed in cents.
2427
- * @example 20
2462
+ * A concise and unique identifier for the customer, formed by combining the Organization's `name`, `id`, and customer's `sequential_id`
2463
+ * @example "LAG-1234-001"
2428
2464
  */
2429
- taxes_amount_cents: number;
2465
+ slug: string;
2430
2466
  /**
2431
- * The tax rate associated with this specific credit note.
2432
- * @example 20
2467
+ * The customer external unique identifier (provided by your own application)
2468
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
2433
2469
  */
2434
- taxes_rate: number;
2470
+ external_id: string;
2435
2471
  /**
2436
- * The subtotal of the credit note excluding any applicable taxes, expressed in cents.
2437
- * @example 100
2472
+ * The unique code of the billing entity associated with the customer.
2473
+ * @example "acme_corp"
2438
2474
  */
2439
- sub_total_excluding_taxes_amount_cents: number;
2475
+ billing_entity_code?: string;
2440
2476
  /**
2441
- * The remaining credit note amount, expressed in cents.
2442
- * @example 100
2477
+ * The first line of the billing address
2478
+ * @example "5230 Penfield Ave"
2443
2479
  */
2444
- balance_amount_cents: number;
2480
+ address_line1?: string | null;
2445
2481
  /**
2446
- * The credited amount of the credit note, expressed in cents.
2447
- * @example 100
2482
+ * The second line of the billing address
2483
+ * @example null
2448
2484
  */
2449
- credit_amount_cents: number;
2485
+ address_line2?: string | null;
2486
+ /** The customer's applicable timezone, used for billing purposes in their local time. */
2487
+ applicable_timezone: Timezone;
2450
2488
  /**
2451
- * The refunded amount of the credit note, expressed in cents.
2452
- * @example 0
2489
+ * The city of the customer's billing address
2490
+ * @example "Woodland Hills"
2453
2491
  */
2454
- refund_amount_cents: number;
2492
+ city?: string | null;
2455
2493
  /**
2456
- * The ofsetted amount (deducted from the invoice balance) of the credit note, expressed in cents.
2457
- * @example 0
2494
+ * Country code of the customer's billing address. Format must be ISO 3166 (alpha-2)
2495
+ * @example "US"
2458
2496
  */
2459
- offset_amount_cents: number;
2497
+ country?: CountryOrNull;
2460
2498
  /**
2461
- * The pro-rated amount of the coupons applied to the source invoice.
2462
- * @example 20
2499
+ * Currency of the customer. Format must be ISO 4217
2500
+ * @example "USD"
2463
2501
  */
2464
- coupons_adjustment_amount_cents: number;
2502
+ currency?: CurrencyOrNull;
2465
2503
  /**
2466
- * The date when the credit note was created. It is expressed in Coordinated Universal Time (UTC).
2467
- * @format date-time
2468
- * @example "2022-09-14T16:35:31Z"
2504
+ * The email of the customer
2505
+ * @format email
2506
+ * @example "dinesh@piedpiper.test"
2469
2507
  */
2470
- created_at: string;
2508
+ email?: string | null;
2471
2509
  /**
2472
- * The date when the credit note was last updated. It is expressed in Coordinated Universal Time (UTC).
2473
- * @format date-time
2474
- * @example "2022-09-14T16:35:31Z"
2510
+ * The legal company name of the customer
2511
+ * @example "Coleman-Blair"
2475
2512
  */
2476
- updated_at: string;
2513
+ legal_name?: string | null;
2477
2514
  /**
2478
- * The PDF file of the credit note.
2479
- * @example "https://getlago.com/credit_note/file"
2515
+ * The legal company number of the customer
2516
+ * @example "49-008-2965"
2480
2517
  */
2481
- file_url?: string | null;
2482
- /** Array of credit note's items. */
2483
- items?: CreditNoteItemObject[];
2484
- applied_taxes?: CreditNoteAppliedTaxObject[];
2518
+ legal_number?: string | null;
2485
2519
  /**
2486
- * Indicates if the credit note belongs to self-billed invoice. Self-billing is a process where an organization creates the invoice on behalf of the partner.
2487
- * @example false
2520
+ * The logo URL of the customer
2521
+ * @example "http://hooli.com/logo.png"
2488
2522
  */
2489
- self_billed?: boolean;
2523
+ logo_url?: string | null;
2490
2524
  /**
2491
- * Custom metadata stored as key-value pairs.
2492
- * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
2525
+ * The full name of the customer
2526
+ * @example "Gavin Belson"
2527
+ */
2528
+ name?: string | null;
2529
+ /**
2530
+ * First name of the customer
2531
+ * @example "Gavin"
2532
+ */
2533
+ firstname?: string | null;
2534
+ /**
2535
+ * Last name of the customer
2536
+ * @example "Belson"
2537
+ */
2538
+ lastname?: string | null;
2539
+ /**
2540
+ * The type of the account. It can have one of the following values:
2541
+ * - `customer`: the account is a customer.
2542
+ * - `partner`: the account is a partner.
2543
+ * @example "customer"
2544
+ */
2545
+ account_type?: "customer" | "partner";
2546
+ /**
2547
+ * The type of the customer. It can have one of the following values:
2548
+ * - `company`: the customer is a company.
2549
+ * - `individual`: the customer is an individual.
2550
+ */
2551
+ customer_type?: "company" | "individual";
2552
+ /**
2553
+ * The phone number of the customer
2554
+ * @example "1-171-883-3711 x245"
2555
+ */
2556
+ phone?: string | null;
2557
+ /**
2558
+ * The state of the customer's billing address
2559
+ * @example "CA"
2560
+ */
2561
+ state?: string | null;
2562
+ /**
2563
+ * The tax identification number of the customer
2564
+ * @example "EU123456789"
2565
+ */
2566
+ tax_identification_number?: string | null;
2567
+ /** The customer's timezone, used for billing purposes in their local time. Overrides the organization's timezone */
2568
+ timezone?: TimezoneOrNull;
2569
+ /**
2570
+ * The custom website URL of the customer
2571
+ * @example "http://hooli.com"
2572
+ */
2573
+ url?: string | null;
2574
+ /**
2575
+ * The zipcode of the customer's billing address
2576
+ * @example "91364"
2577
+ */
2578
+ zipcode?: string | null;
2579
+ /**
2580
+ * The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
2581
+ * @example 30
2582
+ */
2583
+ net_payment_term?: number | null;
2584
+ /**
2585
+ * The date of the customer creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the customer object was created
2586
+ * @format date-time
2587
+ * @example "2022-04-29T08:59:51Z"
2588
+ */
2589
+ created_at: string;
2590
+ /**
2591
+ * The date of the customer update, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The update_date provides a standardized and internationally recognized timestamp for when the customer object was updated
2592
+ * @format date-time
2593
+ * @example "2022-04-29T08:59:51Z"
2594
+ */
2595
+ updated_at?: string;
2596
+ /**
2597
+ * Specifies how invoices with a zero total amount should be handled:
2598
+ * - `inherit`: (Default) Follows the organization-level configuration.
2599
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
2600
+ * - `skip`: Invoices with a total amount of zero are not finalized.
2601
+ * @example "inherit"
2602
+ */
2603
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
2604
+ /**
2605
+ * Set to true to exclude all invoice custom sections from PDF generation for this customer only.
2606
+ * @example false
2607
+ */
2608
+ skip_invoice_custom_sections?: boolean;
2609
+ /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2610
+ billing_configuration?: CustomerBillingConfiguration;
2611
+ /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2612
+ shipping_address?: Address;
2613
+ metadata?: CustomerMetadata[];
2614
+ }
2615
+ /**
2616
+ * Custom metadata stored as key-value pairs.
2617
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
2618
+ * @example {"external_id":"ext-123","synced_at":"2024-01-15","source":null}
2619
+ */
2620
+ export type MetadataObject = object | null;
2621
+ export interface CreditNoteErrorDetailsObject {
2622
+ /**
2623
+ * The credit note error details unique identifier, created by Lago.
2624
+ * @format uuid
2625
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2626
+ */
2627
+ lago_id: string;
2628
+ /**
2629
+ * The type of the error.
2630
+ * @example "tax_error"
2631
+ */
2632
+ error_code: "not_provided" | "tax_error" | "tax_voiding_error" | "invoice_generation_error";
2633
+ /** The details of the error. */
2634
+ details: object;
2635
+ }
2636
+ export interface CreditNoteObject {
2637
+ /**
2638
+ * The credit note unique identifier, created by Lago.
2639
+ * @format uuid
2640
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2641
+ */
2642
+ lago_id: string;
2643
+ /**
2644
+ * The unique code of the billing entity associated with the credit note.
2645
+ * @example "acme_corp"
2646
+ */
2647
+ billing_entity_code: string;
2648
+ /**
2649
+ * The sequential identifier of the credit note, specifically scoped on the associated invoice. It provides a unique numerical identifier for the credit note within the context of the invoice.
2650
+ * @example 2
2651
+ */
2652
+ sequential_id: number;
2653
+ /**
2654
+ * The credit note unique number.
2655
+ * @example "LAG-1234-CN2"
2656
+ */
2657
+ number: string;
2658
+ /**
2659
+ * Unique identifier assigned to the invoice that the credit note belongs to
2660
+ * @format uuid
2661
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2662
+ */
2663
+ lago_invoice_id: string;
2664
+ /**
2665
+ * The invoice unique number, related to the credit note.
2666
+ * @example "LAG-1234"
2667
+ */
2668
+ invoice_number: string;
2669
+ /**
2670
+ * The date of creation of the credit note. It follows the ISO 8601 date format and provides the specific date when the credit note was created.
2671
+ * @format date
2672
+ * @example "2022-12-06"
2673
+ */
2674
+ issuing_date: string;
2675
+ /**
2676
+ * The status of the credit portion of the credit note. It indicates the current state or condition of the credit amount associated with the credit note. The possible values for this field are:
2677
+ *
2678
+ * - `available`: this status indicates that an amount remains available for future usage. The credit can be applied towards future transactions or invoices.
2679
+ * - `consumed`: this status indicates that the credit amount has been fully consumed. The remaining amount is 0, indicating that the credit has been utilized in its entirety.
2680
+ * - `voided`: this status indicates that the remaining amount of the credit cannot be used any further. The credit has been voided and is no longer available for application or redemption.
2681
+ * @example "available"
2682
+ */
2683
+ credit_status?: "available" | "consumed" | "voided";
2684
+ /**
2685
+ * The status of the refund portion of the credit note. It indicates the current state or condition of the refund associated with the credit note. The possible values for this field are:
2686
+ *
2687
+ * - `pending`: this status indicates that the refund is pending execution. The refund request has been initiated but has not been processed or completed yet.
2688
+ * - `succeeded`: this status indicates that the refund has been successfully executed. The refund amount has been processed and returned to the customer or the designated recipient.
2689
+ * - `failed`: this status indicates that the refund failed to execute. The refund request encountered an error or unsuccessful processing, and the refund amount could not be returned.
2690
+ * @example "pending"
2691
+ */
2692
+ refund_status?: "pending" | "succeeded" | "failed";
2693
+ /**
2694
+ * The reason of the credit note creation.
2695
+ * Possible values are `duplicated_charge`, `product_unsatisfactory`, `order_change`, `order_cancellation`, `fraudulent_charge` or `other`.
2696
+ * @example "other"
2697
+ */
2698
+ reason: "duplicated_charge" | "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "other";
2699
+ /**
2700
+ * The description of the credit note.
2701
+ * @example "Free text"
2702
+ */
2703
+ description?: string | null;
2704
+ /**
2705
+ * The currency of the credit note.
2706
+ * @example "EUR"
2707
+ */
2708
+ currency: Currency;
2709
+ /**
2710
+ * The total amount of the credit note, expressed in cents.
2711
+ * @example 120
2712
+ */
2713
+ total_amount_cents: number;
2714
+ /**
2715
+ * The tax amount of the credit note, expressed in cents.
2716
+ * @example 20
2717
+ */
2718
+ taxes_amount_cents: number;
2719
+ /**
2720
+ * The tax rate associated with this specific credit note.
2721
+ * @example 20
2722
+ */
2723
+ taxes_rate: number;
2724
+ /**
2725
+ * The subtotal of the credit note excluding any applicable taxes, expressed in cents.
2726
+ * @example 100
2727
+ */
2728
+ sub_total_excluding_taxes_amount_cents: number;
2729
+ /**
2730
+ * The remaining credit note amount, expressed in cents.
2731
+ * @example 100
2732
+ */
2733
+ balance_amount_cents: number;
2734
+ /**
2735
+ * The credited amount of the credit note, expressed in cents.
2736
+ * @example 100
2737
+ */
2738
+ credit_amount_cents: number;
2739
+ /**
2740
+ * The refunded amount of the credit note, expressed in cents.
2741
+ * @example 0
2742
+ */
2743
+ refund_amount_cents: number;
2744
+ /**
2745
+ * The ofsetted amount (deducted from the invoice balance) of the credit note, expressed in cents.
2746
+ * @example 0
2747
+ */
2748
+ offset_amount_cents: number;
2749
+ /**
2750
+ * The pro-rated amount of the coupons applied to the source invoice.
2751
+ * @example 20
2752
+ */
2753
+ coupons_adjustment_amount_cents: number;
2754
+ /**
2755
+ * The date when the credit note was created. It is expressed in Coordinated Universal Time (UTC).
2756
+ * @format date-time
2757
+ * @example "2022-09-14T16:35:31Z"
2758
+ */
2759
+ created_at: string;
2760
+ /**
2761
+ * The date when the credit note was last updated. It is expressed in Coordinated Universal Time (UTC).
2762
+ * @format date-time
2763
+ * @example "2022-09-14T16:35:31Z"
2764
+ */
2765
+ updated_at: string;
2766
+ /**
2767
+ * The PDF file of the credit note.
2768
+ * @example "https://getlago.com/credit_note/file"
2769
+ */
2770
+ file_url?: string | null;
2771
+ /** Array of credit note's items. */
2772
+ items?: CreditNoteItemObject[];
2773
+ applied_taxes?: CreditNoteAppliedTaxObject[];
2774
+ /**
2775
+ * Indicates if the credit note belongs to self-billed invoice. Self-billing is a process where an organization creates the invoice on behalf of the partner.
2776
+ * @example false
2777
+ */
2778
+ self_billed?: boolean;
2779
+ customer?: CustomerBaseObject;
2780
+ /**
2781
+ * Custom metadata stored as key-value pairs.
2782
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
2493
2783
  */
2494
2784
  metadata?: MetadataObject;
2495
2785
  error_details?: any[] | null;
@@ -2558,8 +2848,11 @@ export interface CreditNoteCreateInput {
2558
2848
  metadata?: MetadataInput;
2559
2849
  };
2560
2850
  }
2561
- export interface CreditNote {
2562
- credit_note: CreditNoteObject;
2851
+ export type CreditNoteExtendedObject = CreditNoteObject & {
2852
+ customer?: CustomerBaseObject;
2853
+ };
2854
+ export interface CreditNoteExtended {
2855
+ credit_note: CreditNoteExtendedObject;
2563
2856
  }
2564
2857
  export interface CreditNoteUpdateInput {
2565
2858
  credit_note: {
@@ -2576,6 +2869,9 @@ export interface CreditNoteUpdateInput {
2576
2869
  metadata?: MetadataInput;
2577
2870
  };
2578
2871
  }
2872
+ export interface CreditNote {
2873
+ credit_note: CreditNoteObject;
2874
+ }
2579
2875
  export interface CreditNoteEstimateInput {
2580
2876
  credit_note: {
2581
2877
  /**
@@ -2740,349 +3036,80 @@ export interface CreditNoteMetadataResponse {
2740
3036
  */
2741
3037
  metadata: MetadataObject;
2742
3038
  }
2743
- /** @example "US" */
2744
- export type CountryOrNull = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";
2745
- /** @example "America/Los_Angeles" */
2746
- export type TimezoneOrNull = "UTC" | "Africa/Algiers" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Monrovia" | "Africa/Nairobi" | "America/Argentina/Buenos_Aires" | "America/Bogota" | "America/Caracas" | "America/Chicago" | "America/Chihuahua" | "America/Denver" | "America/Godthab" | "America/Guatemala" | "America/Guyana" | "America/Halifax" | "America/Indiana/Indianapolis" | "America/Juneau" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Mazatlan" | "America/Mexico_City" | "America/Monterrey" | "America/Montevideo" | "America/New_York" | "America/Phoenix" | "America/Puerto_Rico" | "America/Regina" | "America/Santiago" | "America/Sao_Paulo" | "America/St_Johns" | "America/Tijuana" | "Asia/Almaty" | "Asia/Baghdad" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Dhaka" | "Asia/Hong_Kong" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kathmandu" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuwait" | "Asia/Magadan" | "Asia/Muscat" | "Asia/Novosibirsk" | "Asia/Rangoon" | "Asia/Riyadh" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tokyo" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Cape_Verde" | "Atlantic/South_Georgia" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Darwin" | "Australia/Hobart" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "Europe/Amsterdam" | "Europe/Athens" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Helsinki" | "Europe/Istanbul" | "Europe/Kaliningrad" | "Europe/Kiev" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Madrid" | "Europe/Minsk" | "Europe/Moscow" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zurich" | "GMT+12" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Chatham" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Majuro" | "Pacific/Midway" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Port_Moresby" | "Pacific/Tongatapu";
2747
- /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2748
- export interface CustomerBillingConfiguration {
2749
- /**
2750
- * The grace period, expressed in days, for the invoice. This period refers to the additional time granted to the customer beyond the invoice due date to adjust usage and line items
2751
- * @example 3
2752
- */
2753
- invoice_grace_period?: number;
2754
- /**
2755
- * Defines whether the issuing date follows the current billing period's end date or the next period starting date.
2756
- * @default null
2757
- * @example "next_period_start"
2758
- */
2759
- subscription_invoice_issuing_date_anchor?: "current_period_end" | "next_period_start";
3039
+ /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
3040
+ export interface IntegrationCustomer {
2760
3041
  /**
2761
- * The logic applied on top of the subscription_invoice_issuing_date_anchor rule. You can opt to use the invoice finalization date, that includes any configured grace period.
2762
- * @default null
2763
- * @example "keep_anchor"
3042
+ * A unique identifier for the integration customer object in the Lago application.
3043
+ * @format uuid
3044
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2764
3045
  */
2765
- subscription_invoice_issuing_date_adjustment?: "align_with_finalization_date" | "keep_anchor";
3046
+ lago_id: string;
2766
3047
  /**
2767
- * The payment provider utilized to initiate payments for invoices issued by Lago.
2768
- * Accepted values: `stripe`, `adyen`, `gocardless` or null. This field is required if you intend to assign a `provider_customer_id`.
2769
- * @example "stripe"
3048
+ * The integration type used for accounting and tax syncs.
3049
+ * Accepted values: `netsuite, anrok`.
3050
+ * @example "netsuite"
2770
3051
  */
2771
- payment_provider?: "stripe" | "adyen" | "gocardless";
3052
+ type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
2772
3053
  /**
2773
- * Unique code used to identify a payment provider connection.
2774
- * @example "stripe-eu-1"
3054
+ * Unique code used to identify an integration connection.
3055
+ * @example "netsuite-eu-1"
2775
3056
  */
2776
- payment_provider_code?: string;
3057
+ integration_code: string;
2777
3058
  /**
2778
- * The customer ID within the payment provider's system. If this field is not provided, Lago has the option to create a new customer record within the payment provider's system on behalf of the customer
3059
+ * 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.
2779
3060
  * @example "cus_12345"
2780
3061
  */
2781
- provider_customer_id?: string;
2782
- /**
2783
- * Set this field to `true` if you want to create the customer in the payment provider synchronously with the customer creation process in Lago. This option is applicable only when the `provider_customer_id` is `null` and the customer is automatically created in the payment provider through Lago. By default, the value is set to `false`
2784
- * @example true
2785
- */
2786
- sync?: boolean;
3062
+ external_customer_id: string;
2787
3063
  /**
2788
- * Set this field to `true` if you want to create a customer record in the payment provider's system. This option is applicable only when the `provider_customer_id` is null and the `sync_with_provider` field is set to `true`. By default, the value is set to `false`
3064
+ * 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`
2789
3065
  * @example true
2790
3066
  */
2791
- sync_with_provider?: boolean;
2792
- /**
2793
- * The document locale, specified in the ISO 639-1 format. This field represents the language or locale used for the documents issued by Lago
2794
- * @example "fr"
2795
- */
2796
- document_locale?: string;
2797
- /**
2798
- * Specifies the available payment methods that can be used for this customer when `payment_provider` is set to `stripe`. The `provider_payment_methods` field is an array that allows multiple payment options to be defined. If this field is not explicitly set, the payment methods will be set to `card`. For now, possible values are `card`, `sepa_debit`, `us_bank_account`, `bacs_debit`, `boleto`, `link`, `crypto` and `customer_balance`. Note that when `link` is selected, `card` should also be provided in the array. When `customer_balance` is selected, no other payment can be selected.
2799
- * @example ["card","sepa_debit","us_bank_account","bacs_debit","link","boleto","crypto","customer_balance"]
2800
- */
2801
- provider_payment_methods?: any[] | null;
2802
- }
2803
- /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
2804
- export interface Address {
2805
- /**
2806
- * The first line of the billing address
2807
- * @example "5230 Penfield Ave"
2808
- */
2809
- address_line1?: string | null;
2810
- /**
2811
- * The second line of the billing address
2812
- * @example null
2813
- */
2814
- address_line2?: string | null;
2815
- /**
2816
- * The city of the customer's billing address
2817
- * @example "Woodland Hills"
2818
- */
2819
- city?: string | null;
3067
+ sync_with_provider?: boolean | null;
2820
3068
  /**
2821
- * Country code of the customer's billing address. Format must be ISO 3166 (alpha-2)
2822
- * @example "US"
3069
+ * This optional field is needed only when working with `netsuite` connection.
3070
+ * @example "2"
2823
3071
  */
2824
- country?: CountryOrNull;
3072
+ subsidiary_id?: string;
2825
3073
  /**
2826
- * The state of the customer's billing address
2827
- * @example "CA"
3074
+ * This optional field is present only when working with `hubspot` connection.
3075
+ * @example "contacts"
2828
3076
  */
2829
- state?: string | null;
3077
+ targeted_object?: string | null;
2830
3078
  /**
2831
- * The zipcode of the customer's billing address
2832
- * @example "91364"
3079
+ * This optional field is present only when working with `hubspot` connection.
3080
+ * @example "dinesh@piedpiper.test"
2833
3081
  */
2834
- zipcode?: string | null;
3082
+ email?: string | null;
2835
3083
  }
2836
- /** Set of key-value pairs that you can attach to a customer. This can be useful for storing additional information about the customer in a structured format */
2837
- export interface CustomerMetadata {
3084
+ export type CustomerObject = CustomerBaseObject & {
3085
+ integration_customers?: IntegrationCustomer[];
3086
+ };
3087
+ export interface ErrorDetailObject {
2838
3088
  /**
2839
- * A unique identifier for the customer metadata object in the Lago application. Can be used to update a key-value pair
3089
+ * Unique identifier assigned to the error_detail within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the error's record within the Lago system.
2840
3090
  * @format uuid
2841
3091
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2842
3092
  */
2843
- lago_id: string;
2844
- /**
2845
- * The metadata object key
2846
- * @example "Purchase Order"
2847
- */
2848
- key: string;
2849
- /**
2850
- * The metadata object value
2851
- * @example "123456789"
2852
- */
2853
- value: string;
3093
+ lago_id: string | null;
2854
3094
  /**
2855
- * Determines whether the item or information should be displayed in the invoice. If set to true, the item or information will be included and visible in the generated invoice. If set to false, the item or information will be excluded and not displayed in the invoice.
2856
- * @example true
3095
+ * Code that specifies part of the application / connection, where the error originally happened
3096
+ * @example "tax_error"
2857
3097
  */
2858
- display_in_invoice: boolean;
3098
+ error_code: string;
2859
3099
  /**
2860
- * The date of the metadata object creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the metadata object was created
2861
- * @format date-time
2862
- * @example "2022-04-29T08:59:51Z"
3100
+ * Key value list of more elaborated error detail, where by the key of error_code an external service error details are stored
3101
+ * @example {"tax_error":"taxDateTooFarInFuture"}
2863
3102
  */
2864
- created_at: string;
3103
+ details: Record<string, string>;
2865
3104
  }
2866
- export interface CustomerBaseObject {
2867
- /**
2868
- * 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
2869
- * @format uuid
2870
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2871
- */
2872
- lago_id: string;
2873
- /**
2874
- * The unique identifier assigned to the customer within the organization's scope. This identifier is used to track and reference the customer's order of creation within the organization's system. It ensures that each customer has a distinct `sequential_id`` associated with them, allowing for easy identification and sorting based on the order of creation
2875
- * @example 1
2876
- */
2877
- sequential_id: number;
2878
- /**
2879
- * A concise and unique identifier for the customer, formed by combining the Organization's `name`, `id`, and customer's `sequential_id`
2880
- * @example "LAG-1234-001"
2881
- */
2882
- slug: string;
2883
- /**
2884
- * The customer external unique identifier (provided by your own application)
2885
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
2886
- */
2887
- external_id: string;
2888
- /**
2889
- * The unique code of the billing entity associated with the customer.
2890
- * @example "acme_corp"
2891
- */
2892
- billing_entity_code?: string;
2893
- /**
2894
- * The first line of the billing address
2895
- * @example "5230 Penfield Ave"
2896
- */
2897
- address_line1?: string | null;
2898
- /**
2899
- * The second line of the billing address
2900
- * @example null
2901
- */
2902
- address_line2?: string | null;
2903
- /** The customer's applicable timezone, used for billing purposes in their local time. */
2904
- applicable_timezone: Timezone;
2905
- /**
2906
- * The city of the customer's billing address
2907
- * @example "Woodland Hills"
2908
- */
2909
- city?: string | null;
2910
- /**
2911
- * Country code of the customer's billing address. Format must be ISO 3166 (alpha-2)
2912
- * @example "US"
2913
- */
2914
- country?: CountryOrNull;
2915
- /**
2916
- * Currency of the customer. Format must be ISO 4217
2917
- * @example "USD"
2918
- */
2919
- currency?: CurrencyOrNull;
2920
- /**
2921
- * The email of the customer
2922
- * @format email
2923
- * @example "dinesh@piedpiper.test"
2924
- */
2925
- email?: string | null;
2926
- /**
2927
- * The legal company name of the customer
2928
- * @example "Coleman-Blair"
2929
- */
2930
- legal_name?: string | null;
2931
- /**
2932
- * The legal company number of the customer
2933
- * @example "49-008-2965"
2934
- */
2935
- legal_number?: string | null;
2936
- /**
2937
- * The logo URL of the customer
2938
- * @example "http://hooli.com/logo.png"
2939
- */
2940
- logo_url?: string | null;
2941
- /**
2942
- * The full name of the customer
2943
- * @example "Gavin Belson"
2944
- */
2945
- name?: string | null;
2946
- /**
2947
- * First name of the customer
2948
- * @example "Gavin"
2949
- */
2950
- firstname?: string | null;
2951
- /**
2952
- * Last name of the customer
2953
- * @example "Belson"
2954
- */
2955
- lastname?: string | null;
2956
- /**
2957
- * The type of the account. It can have one of the following values:
2958
- * - `customer`: the account is a customer.
2959
- * - `partner`: the account is a partner.
2960
- * @example "customer"
2961
- */
2962
- account_type?: "customer" | "partner";
2963
- /**
2964
- * The type of the customer. It can have one of the following values:
2965
- * - `company`: the customer is a company.
2966
- * - `individual`: the customer is an individual.
2967
- */
2968
- customer_type?: "company" | "individual";
2969
- /**
2970
- * The phone number of the customer
2971
- * @example "1-171-883-3711 x245"
2972
- */
2973
- phone?: string | null;
2974
- /**
2975
- * The state of the customer's billing address
2976
- * @example "CA"
2977
- */
2978
- state?: string | null;
2979
- /**
2980
- * The tax identification number of the customer
2981
- * @example "EU123456789"
2982
- */
2983
- tax_identification_number?: string | null;
2984
- /** The customer's timezone, used for billing purposes in their local time. Overrides the organization's timezone */
2985
- timezone?: TimezoneOrNull;
2986
- /**
2987
- * The custom website URL of the customer
2988
- * @example "http://hooli.com"
2989
- */
2990
- url?: string | null;
2991
- /**
2992
- * The zipcode of the customer's billing address
2993
- * @example "91364"
2994
- */
2995
- zipcode?: string | null;
2996
- /**
2997
- * The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
2998
- * @example 30
2999
- */
3000
- net_payment_term?: number | null;
3001
- /**
3002
- * The date of the customer creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the customer object was created
3003
- * @format date-time
3004
- * @example "2022-04-29T08:59:51Z"
3005
- */
3006
- created_at: string;
3007
- /**
3008
- * The date of the customer update, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The update_date provides a standardized and internationally recognized timestamp for when the customer object was updated
3009
- * @format date-time
3010
- * @example "2022-04-29T08:59:51Z"
3011
- */
3012
- updated_at?: string;
3013
- /**
3014
- * Specifies how invoices with a zero total amount should be handled:
3015
- * - `inherit`: (Default) Follows the organization-level configuration.
3016
- * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
3017
- * - `skip`: Invoices with a total amount of zero are not finalized.
3018
- * @example "inherit"
3019
- */
3020
- finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
3021
- /**
3022
- * Set to true to exclude all invoice custom sections from PDF generation for this customer only.
3023
- * @example false
3024
- */
3025
- skip_invoice_custom_sections?: boolean;
3026
- /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
3027
- billing_configuration?: CustomerBillingConfiguration;
3028
- /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
3029
- shipping_address?: Address;
3030
- metadata?: CustomerMetadata[];
3031
- }
3032
- /** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
3033
- export interface IntegrationCustomer {
3034
- /**
3035
- * A unique identifier for the integration customer object in the Lago application.
3036
- * @format uuid
3037
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3038
- */
3039
- lago_id: string;
3040
- /**
3041
- * The integration type used for accounting and tax syncs.
3042
- * Accepted values: `netsuite, anrok`.
3043
- * @example "netsuite"
3044
- */
3045
- type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
3046
- /**
3047
- * Unique code used to identify an integration connection.
3048
- * @example "netsuite-eu-1"
3049
- */
3050
- integration_code: string;
3051
- /**
3052
- * 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.
3053
- * @example "cus_12345"
3054
- */
3055
- external_customer_id: string;
3056
- /**
3057
- * 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`
3058
- * @example true
3059
- */
3060
- sync_with_provider?: boolean | null;
3061
- /**
3062
- * This optional field is needed only when working with `netsuite` connection.
3063
- * @example "2"
3064
- */
3065
- subsidiary_id?: string;
3066
- /**
3067
- * This optional field is present only when working with `hubspot` connection.
3068
- * @example "contacts"
3069
- */
3070
- targeted_object?: string | null;
3071
- /**
3072
- * This optional field is present only when working with `hubspot` connection.
3073
- * @example "dinesh@piedpiper.test"
3074
- */
3075
- email?: string | null;
3076
- }
3077
- export type CustomerObject = CustomerBaseObject & {
3078
- integration_customers?: IntegrationCustomer[];
3079
- };
3080
3105
  export type CustomerObjectExtended = CustomerObject & {
3081
3106
  metadata?: CustomerMetadata[];
3082
3107
  /** List of customer taxes */
3083
3108
  taxes?: TaxObject[];
3084
3109
  /** The customer’s invoice custom section used for generating invoices. */
3085
3110
  applicable_invoice_custom_sections?: InvoiceCustomSectionObject[];
3111
+ /** List of errors with details that might have been raised while processing backgroud actions for the customers */
3112
+ error_details?: ErrorDetailObject[];
3086
3113
  };
3087
3114
  export interface CustomersPaginated {
3088
3115
  customers: CustomerObjectExtended[];
@@ -3411,6 +3438,16 @@ export interface InvoiceBaseObject {
3411
3438
  * @example 0
3412
3439
  */
3413
3440
  prepaid_credit_amount_cents: number;
3441
+ /**
3442
+ * The portion of prepaid credits discounted on the invoice that originated from granted (free) credits, expressed in cents. Only populated for invoices associated with traceable wallets.
3443
+ * @example 0
3444
+ */
3445
+ prepaid_granted_credit_amount_cents?: number | null;
3446
+ /**
3447
+ * The portion of prepaid credits discounted on the invoice that originated from purchased (paid) credits, expressed in cents. Only populated for invoices associated with traceable wallets.
3448
+ * @example 0
3449
+ */
3450
+ prepaid_purchased_credit_amount_cents?: number | null;
3414
3451
  /**
3415
3452
  * The usage already billed in previous invoices. Only apply to `progressive_billing` and `subscription` invoices.
3416
3453
  * @example 0
@@ -3532,6 +3569,41 @@ export type InvoiceAppliedTaxObject = BaseAppliedTax & {
3532
3569
  */
3533
3570
  fees_amount_cents?: number;
3534
3571
  };
3572
+ export interface InvoiceAppliedInvoiceCustomSectionObject {
3573
+ /**
3574
+ * Unique identifier of the applied invoice custom section in the Lago application.
3575
+ * @format uuid
3576
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3577
+ */
3578
+ lago_id: string;
3579
+ /**
3580
+ * Unique identifier of the invoice this custom section is applied to.
3581
+ * @format uuid
3582
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3583
+ */
3584
+ lago_invoice_id: string;
3585
+ /**
3586
+ * Unique code identifying the invoice custom section.
3587
+ * @example "eu_bank_details"
3588
+ */
3589
+ code: string;
3590
+ /**
3591
+ * The value shown on the invoice PDF.
3592
+ * @example "Bank Name: Lago Bank, IBAN: FR7630004000031234567890143"
3593
+ */
3594
+ details: string;
3595
+ /**
3596
+ * The name of the invoice custom section displayed on the invoice.
3597
+ * @example "Bank Details:"
3598
+ */
3599
+ display_name: string;
3600
+ /**
3601
+ * The date of the applied invoice custom section creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3602
+ * @format date-time
3603
+ * @example "2023-07-06T14:35:58Z"
3604
+ */
3605
+ created_at: string;
3606
+ }
3535
3607
  export interface UsageThresholdObject {
3536
3608
  /**
3537
3609
  * Unique identifier of the usage threshold created by Lago.
@@ -3587,6 +3659,8 @@ export type InvoiceObject = InvoiceBaseObject & {
3587
3659
  billing_periods?: BillingPeriodObject[];
3588
3660
  metadata?: InvoiceMetadataObject[];
3589
3661
  applied_taxes?: InvoiceAppliedTaxObject[];
3662
+ /** The invoice custom sections applied to this invoice for PDF generation. */
3663
+ applied_invoice_custom_sections?: InvoiceAppliedInvoiceCustomSectionObject[];
3590
3664
  applied_usage_thresholds?: AppliedUsageThresholdObject[];
3591
3665
  };
3592
3666
  export interface InvoicesPaginated {
@@ -3613,6 +3687,8 @@ export interface PaymentObject {
3613
3687
  external_customer_id: string;
3614
3688
  /** List of invoice IDs associated with the payment. */
3615
3689
  invoice_ids: string[];
3690
+ /** List of invoice numbers associated with the payment. */
3691
+ invoice_numbers?: string[];
3616
3692
  /**
3617
3693
  * The unique identifier of the paid resource, created by Lago.
3618
3694
  * @format uuid
@@ -3676,6 +3752,12 @@ export interface PaymentObject {
3676
3752
  * @example "cus_5eb0285bcf941bc6ba"
3677
3753
  */
3678
3754
  provider_customer_id: string;
3755
+ /**
3756
+ * The unique identifier of the payment method used for this payment.
3757
+ * @format uuid
3758
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3759
+ */
3760
+ payment_method_id?: string | null;
3679
3761
  /**
3680
3762
  * The next action to be taken by the customer to complete the payment. Should usually be empty, except when receiving the `payment.requires_action` webhook.
3681
3763
  * @example {"type":"redirect_to_url","redirect_to_url":{"url":"https://hooks.stripe.com/3d_secure_2/hosted?merchant=acct_AAA&payment_intent=pi_BBB&payment_intent_client_secret=pi_BBB&publishable_key=pk_test_CCC","return_url":"https://app.example.com"}}
@@ -3737,6 +3819,40 @@ export interface PaymentRequestsPaginated {
3737
3819
  payment_requests: PaymentRequestObject[];
3738
3820
  meta: PaginationMeta;
3739
3821
  }
3822
+ export interface AppliedInvoiceCustomSectionObject {
3823
+ /**
3824
+ * Unique identifier of the applied invoice custom section in the Lago application.
3825
+ * @format uuid
3826
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3827
+ */
3828
+ lago_id: string;
3829
+ /**
3830
+ * Unique identifier of the invoice custom section that was applied.
3831
+ * @format uuid
3832
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3833
+ */
3834
+ invoice_custom_section_id: string;
3835
+ /**
3836
+ * The date of the applied invoice custom section creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3837
+ * @format date-time
3838
+ * @example "2023-07-06T14:35:58Z"
3839
+ */
3840
+ created_at: string;
3841
+ }
3842
+ /** Reference to a specific payment method for processing the payment. */
3843
+ export interface PaymentMethodReference {
3844
+ /**
3845
+ * The type of payment method to use.
3846
+ * @example "provider"
3847
+ */
3848
+ payment_method_type?: "provider" | "manual";
3849
+ /**
3850
+ * The unique identifier of the payment method (required when using a specific provider payment method).
3851
+ * @format uuid
3852
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3853
+ */
3854
+ payment_method_id?: string;
3855
+ }
3740
3856
  export interface SubscriptionObject {
3741
3857
  /**
3742
3858
  * Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription's record within the Lago system
@@ -3775,6 +3891,16 @@ export interface SubscriptionObject {
3775
3891
  * @example "premium"
3776
3892
  */
3777
3893
  plan_code: string;
3894
+ /**
3895
+ * The base cost of the related plan, excluding any applicable taxes, that is billed on a recurring basis.
3896
+ * @example 10000
3897
+ */
3898
+ plan_amount_cents?: number;
3899
+ /**
3900
+ * The currency of the related plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed.
3901
+ * @example "USD"
3902
+ */
3903
+ plan_amount_currency?: Currency;
3778
3904
  /**
3779
3905
  * The status of the subscription, which can have the following values:
3780
3906
  * - `active`: the subscription is currently active and applied to the customer.
@@ -3860,12 +3986,13 @@ export interface SubscriptionObject {
3860
3986
  *
3861
3987
  * - `credit`: A credit note is generated for the unused subscription time. The unused amount is credited back to the customer.
3862
3988
  * - `refund`: A credit note is generated for the unused subscription time. If the invoice is paid or partially paid, the unused paid amount is refunded; any unpaid unused amount is credited back to the customer.
3989
+ * - `offset`: A credit note is generated for the unused subscription time. If the invoice is paid or partially paid, the unused paid amount is refunded; any unpaid unused amount is applied to the invoice reducing its amount due.
3863
3990
  * - `skip`: No credit note is generated for the unused subscription time.
3864
3991
  *
3865
3992
  * _Note: This field is only applicable to pay-in-advance plans and will be `null` for pay-in-arrears plans._
3866
3993
  * @example "credit"
3867
3994
  */
3868
- on_termination_credit_note: "credit" | "refund" | "skip";
3995
+ on_termination_credit_note: "credit" | "refund" | "offset" | "skip";
3869
3996
  /**
3870
3997
  * When a subscription is terminated before the end of its billing period, we generate an invoice for the unbilled usage.
3871
3998
  * This field allows you to control the behavior of the invoice generation:
@@ -3876,6 +4003,10 @@ export interface SubscriptionObject {
3876
4003
  * @example "generate"
3877
4004
  */
3878
4005
  on_termination_invoice: "generate" | "skip";
4006
+ /** The invoice custom sections applied to invoices generated by this subscription. */
4007
+ applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
4008
+ /** The payment method assigned to this subscription for processing payments. */
4009
+ payment_method?: PaymentMethodReference;
3879
4010
  }
3880
4011
  export interface SubscriptionsPaginated {
3881
4012
  subscriptions: SubscriptionObject[];
@@ -3976,6 +4107,10 @@ export interface WalletRecurringTransactionRule {
3976
4107
  * @example false
3977
4108
  */
3978
4109
  ignore_paid_top_up_limits: boolean;
4110
+ /** The invoice custom sections applied to invoices generated by this recurring transaction rule. */
4111
+ applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
4112
+ /** The payment method assigned to this recurring transaction rule for processing top-up payments. */
4113
+ payment_method?: PaymentMethodReference;
3979
4114
  }
3980
4115
  export interface WalletObject {
3981
4116
  /**
@@ -4010,6 +4145,11 @@ export interface WalletObject {
4010
4145
  * @example "Prepaid"
4011
4146
  */
4012
4147
  name?: string | null;
4148
+ /**
4149
+ * The code of the wallet.
4150
+ * @example "prepaid"
4151
+ */
4152
+ code?: string | null;
4013
4153
  /**
4014
4154
  * Wallet priority for ordering when a customer has multiple wallets. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
4015
4155
  * @min 1
@@ -4122,6 +4262,10 @@ export interface WalletObject {
4122
4262
  * @example 1000
4123
4263
  */
4124
4264
  paid_top_up_max_amount_cents?: number | null;
4265
+ /** The invoice custom sections applied to invoices generated by this wallet. */
4266
+ applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
4267
+ /** The payment method assigned to this wallet for processing top-up payments. */
4268
+ payment_method?: PaymentMethodReference;
4125
4269
  /**
4126
4270
  * Custom metadata stored as key-value pairs.
4127
4271
  * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
@@ -4132,95 +4276,536 @@ export interface WalletsPaginated {
4132
4276
  wallets: WalletObject[];
4133
4277
  meta: PaginationMeta;
4134
4278
  }
4135
- /** Details about the pricing unit used for charge usage. */
4136
- export interface UsagePricingUnitDetailsObject {
4137
- /**
4138
- * The amount in cents in the pricing unit.
4139
- * @example 200
4140
- */
4141
- amount_cents: number;
4279
+ /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
4280
+ export interface InvoiceCustomSectionInput {
4142
4281
  /**
4143
- * The short name of the pricing unit.
4144
- * @example "CR"
4282
+ * Set to `true` to exclude all invoice custom sections from PDF generation for invoices related to this resource. When `true`, `invoice_custom_section_codes` is ignored.
4283
+ * @example false
4145
4284
  */
4146
- short_name: string;
4285
+ skip_invoice_custom_sections?: boolean;
4147
4286
  /**
4148
- * The conversion rate from pricing units to the plan's currency.
4149
- * @example "0.5"
4287
+ * List of unique codes identifying the invoice custom sections to apply. These override the default invoice custom sections configured at the customer or billing entity level.
4288
+ * @example ["eu_bank_details"]
4150
4289
  */
4151
- conversion_rate: string;
4290
+ invoice_custom_section_codes?: string[];
4152
4291
  }
4153
- /** Array of filter object, representing multiple dimensions for a charge item. */
4154
- export type CustomerChargeFiltersUsageObject = {
4155
- /**
4156
- * The number of units consumed for a specific charge filter related to a charge item.
4157
- * @pattern ^[0-9]+.?[0-9]*$
4158
- * @example "0.9"
4159
- */
4160
- units?: string;
4161
- /**
4162
- * The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
4163
- * @pattern ^[0-9]+.?[0-9]*$
4164
- * @example "1.0"
4165
- */
4166
- total_aggregated_units?: string;
4167
- /**
4168
- * The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
4169
- * @example 1000
4170
- */
4171
- amount_cents?: number;
4172
- /**
4173
- * The quantity of usage events that have been recorded for a particular charge filter during the specified time period. These events may also be referred to as the number of transactions in some contexts.
4174
- * @example 10
4175
- */
4176
- events_count?: number;
4177
- /**
4178
- * Specifies the name that will be displayed on an invoice.
4179
- * @example "AWS eu-east-1"
4180
- */
4181
- invoice_display_name?: string;
4182
- /** Details about the pricing unit used for charge usage. */
4183
- pricing_unit_details?: UsagePricingUnitDetailsObject;
4184
- /**
4185
- * List of filter values applied to the usage.
4186
- * @example {"region":["us-east-1"]}
4187
- */
4188
- values?: Record<string, string[]>;
4189
- }[];
4190
- /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
4191
- export type CustomerChargeGroupedUsageObject = {
4192
- /**
4193
- * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
4194
- * @example 1000
4195
- */
4196
- amount_cents?: number;
4197
- /**
4198
- * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
4199
- * @example 10
4200
- */
4201
- events_count?: number;
4202
- /**
4203
- * The number of units consumed for a specific group related to a charge item.
4204
- * @pattern ^[0-9]+.?[0-9]*$
4205
- * @example "0.9"
4206
- */
4207
- units?: string;
4208
- /**
4209
- * The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
4210
- * @pattern ^[0-9]+.?[0-9]*$
4211
- * @example "1.0"
4212
- */
4213
- total_aggregated_units?: string;
4214
- /** Details about the pricing unit used for charge usage. */
4215
- pricing_unit_details?: UsagePricingUnitDetailsObject;
4216
- /** Key value list of event properties aggregated by the charge model */
4217
- grouped_by?: Record<string, string>;
4218
- /** Array of filter object, representing multiple dimensions for a charge item. */
4219
- filters?: CustomerChargeFiltersUsageObject;
4220
- }[];
4221
- export interface CustomerChargeUsageObject {
4222
- /**
4223
- * The number of units consumed by the customer for a specific charge item.
4292
+ export interface WalletCreateInput {
4293
+ wallet?: {
4294
+ /**
4295
+ * The name of the wallet.
4296
+ * @example "Prepaid"
4297
+ */
4298
+ name?: string | null;
4299
+ /**
4300
+ * The code of the wallet.
4301
+ * @example "prepaid"
4302
+ */
4303
+ code?: string | null;
4304
+ /**
4305
+ * Wallet priority for ordering when a customer has multiple wallets. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
4306
+ * @min 1
4307
+ * @max 50
4308
+ * @example 50
4309
+ */
4310
+ priority?: number;
4311
+ /**
4312
+ * The rate of conversion between credits and the amount in the specified currency. It indicates the ratio or factor used to convert credits into the corresponding monetary value in the currency of the transaction.
4313
+ * @pattern ^[0-9]+.?[0-9]*$
4314
+ * @example "1.5"
4315
+ */
4316
+ rate_amount: string;
4317
+ /**
4318
+ * The currency of the wallet.
4319
+ * @example "USD"
4320
+ */
4321
+ currency: Currency;
4322
+ /**
4323
+ * The number of paid credits. Required only if there is no granted credits.
4324
+ * @pattern ^[0-9]+.?[0-9]*$
4325
+ * @example "20.0"
4326
+ */
4327
+ paid_credits?: string | null;
4328
+ /**
4329
+ * The number of free granted credits. Required only if there is no paid credits.
4330
+ * @pattern ^[0-9]+.?[0-9]*$
4331
+ * @example "10.0"
4332
+ */
4333
+ granted_credits?: string | null;
4334
+ /**
4335
+ * The customer external unique identifier (provided by your own application)
4336
+ * @example "hooli_1234"
4337
+ */
4338
+ external_customer_id: string;
4339
+ /**
4340
+ * The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
4341
+ * @format date-time
4342
+ * @example "2022-07-07T23:59:59Z"
4343
+ */
4344
+ expiration_at?: string | null;
4345
+ /**
4346
+ * A boolean setting that, when set to true, delays issuing an invoice for a wallet top-up until a successful payment is made; if false, the invoice is issued immediately upon wallet top-up, regardless of the payment status. Default value of false.
4347
+ * @example false
4348
+ */
4349
+ invoice_requires_successful_payment?: boolean;
4350
+ /**
4351
+ * This optional field allows you to store a list of key-value pairs that provide additional information or custom attributes. These key-value pairs will be included in the metadata of wallet transactions generated during the wallet creation process.
4352
+ * @example [{"key":"example_key","value":"example_value"},{"key":"another_key","value":"another_value"}]
4353
+ */
4354
+ transaction_metadata?: any[] | null;
4355
+ /**
4356
+ * The name of the wallet transactions triggered when creating the wallet. It will appear on the invoice as the label for the fee. If not set, the label on the invoice will fallback to either `Prepaid credits - {{wallet_name}}` if the wallet name is set, or `Prepaid credits`.
4357
+ * @example "Tokens for models 'high-fidelity-boost'"
4358
+ */
4359
+ transaction_name?: string | null;
4360
+ /** Set wallet limitations to fee types. */
4361
+ applies_to?: {
4362
+ /**
4363
+ * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
4364
+ * @example ["charge"]
4365
+ */
4366
+ fee_types?: any[] | null;
4367
+ /**
4368
+ * An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
4369
+ * @example []
4370
+ */
4371
+ billable_metric_codes?: any[] | null;
4372
+ };
4373
+ /**
4374
+ * Minimum amount of cents that can be top-up with a single paid transaction.
4375
+ * @example 100
4376
+ */
4377
+ paid_top_up_min_amount_cents?: number | null;
4378
+ /**
4379
+ * Maximum amount of cents that can be top-up with a single paid transaction.
4380
+ * @example 1000
4381
+ */
4382
+ paid_top_up_max_amount_cents?: number | null;
4383
+ /**
4384
+ * If set to true, the wallet will ignore paid top-up limits on creation.
4385
+ * @example false
4386
+ */
4387
+ ignore_paid_top_up_limits_on_creation?: boolean | null;
4388
+ /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
4389
+ invoice_custom_section?: InvoiceCustomSectionInput;
4390
+ /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
4391
+ recurring_transaction_rules?: any[] | null;
4392
+ /** Optional payment method to use for processing wallet top-up payments. */
4393
+ payment_method?: PaymentMethodReference;
4394
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
4395
+ metadata?: MetadataInput;
4396
+ };
4397
+ }
4398
+ export interface Wallet {
4399
+ wallet: WalletObject;
4400
+ }
4401
+ export interface WalletUpdateInput {
4402
+ wallet: {
4403
+ /**
4404
+ * The name of the wallet.
4405
+ * @example "new_name"
4406
+ */
4407
+ name?: string | null;
4408
+ /**
4409
+ * The code of the wallet.
4410
+ * @example "prepaid"
4411
+ */
4412
+ code?: string | null;
4413
+ /**
4414
+ * Wallet priority for ordering when a customer has multiple wallets. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
4415
+ * @min 1
4416
+ * @max 50
4417
+ * @example 50
4418
+ */
4419
+ priority?: number;
4420
+ /**
4421
+ * The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
4422
+ * @format date-time
4423
+ * @example "2022-07-07T23:59:59Z"
4424
+ */
4425
+ expiration_at?: string | null;
4426
+ /**
4427
+ * A boolean setting that, when set to true, delays issuing an invoice for a wallet top-up until a successful payment is made; if false, the invoice is issued immediately upon wallet top-up, regardless of the payment status. Default value of false.
4428
+ * @example false
4429
+ */
4430
+ invoice_requires_successful_payment?: boolean;
4431
+ /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
4432
+ invoice_custom_section?: InvoiceCustomSectionInput;
4433
+ /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
4434
+ recurring_transaction_rules?: {
4435
+ /**
4436
+ * A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule.
4437
+ * @format uuid
4438
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4439
+ */
4440
+ lago_id?: string;
4441
+ /**
4442
+ * The trigger. Possible values are `interval` or `threshold`.
4443
+ * @example "interval"
4444
+ */
4445
+ trigger?: "interval" | "threshold";
4446
+ /**
4447
+ * The method used for recurring top-up. Possible values are `fixed` or `target`.
4448
+ * @example "target"
4449
+ */
4450
+ method?: "fixed" | "target";
4451
+ /**
4452
+ * The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly`, `semiannual` or `yearly`. Required only when trigger is set to `interval`.
4453
+ * @example "monthly"
4454
+ */
4455
+ interval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
4456
+ /**
4457
+ * The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when trigger is set to `threshold`.
4458
+ * @pattern ^[0-9]+.?[0-9]*$
4459
+ * @example "20.0"
4460
+ */
4461
+ threshold_credits?: string;
4462
+ /**
4463
+ * The number of paid credits. Required only if there is no granted credits.
4464
+ * @pattern ^[0-9]+.?[0-9]*$
4465
+ * @example "20.0"
4466
+ */
4467
+ paid_credits?: string | null;
4468
+ /**
4469
+ * The number of free granted credits. Required only if there is no paid credits.
4470
+ * @pattern ^[0-9]+.?[0-9]*$
4471
+ * @example "10.0"
4472
+ */
4473
+ granted_credits?: string | null;
4474
+ /**
4475
+ * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4476
+ * @format date-time
4477
+ * @example "2022-08-08T00:00:00Z"
4478
+ */
4479
+ started_at?: string | null;
4480
+ /**
4481
+ * The expiration date and time for this specific recurring transaction rule. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
4482
+ * @format date-time
4483
+ * @example "2023-09-30T23:59:59Z"
4484
+ */
4485
+ expiration_at?: string | null;
4486
+ /**
4487
+ * The target ongoing balance is the value set for the ongoing balance to be reached by the automatic top-up. Required only when trigger is set to `target`.
4488
+ * @pattern ^[0-9]+.?[0-9]*$
4489
+ * @example "200.0"
4490
+ */
4491
+ target_ongoing_balance?: string;
4492
+ /**
4493
+ * A boolean setting that, when set to true, delays issuing an invoice for a wallet top-up until a successful payment is made; if false, the invoice is issued immediately upon wallet top-up, regardless of the payment status. Default value of false.
4494
+ * @example false
4495
+ */
4496
+ invoice_requires_successful_payment?: boolean;
4497
+ /**
4498
+ * This optional field allows you to store a list of key-value pairs containing additional information or custom attributes. These key-value pairs will populate the metadata of the wallet transactions triggered by this rule.
4499
+ * @example [{"key":"example_key","value":"example_value"},{"key":"another_key","value":"another_value"}]
4500
+ */
4501
+ transaction_metadata?: {
4502
+ /** The unique identifier for the attribute. */
4503
+ key?: string;
4504
+ /** The value associated with the key. */
4505
+ value?: string;
4506
+ }[];
4507
+ /**
4508
+ * The name of the wallet transactions triggered by this rule. It will appear on the invoice as the label for the fee. If not set, the label on the invoice will fallback to either `Prepaid credits - {{wallet_name}}` if the wallet name is set, or `Prepaid credits`.
4509
+ * @example "Tokens for models 'high-fidelity-boost'"
4510
+ */
4511
+ transaction_name?: string | null;
4512
+ /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
4513
+ invoice_custom_section?: InvoiceCustomSectionInput;
4514
+ /** Optional payment method to use for processing recurring top-up payments. */
4515
+ payment_method?: PaymentMethodReference;
4516
+ }[];
4517
+ /** Optional payment method to use for processing wallet top-up payments. */
4518
+ payment_method?: PaymentMethodReference;
4519
+ /** Set wallet limitations to fee types. */
4520
+ applies_to?: {
4521
+ /**
4522
+ * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
4523
+ * @example ["charge"]
4524
+ */
4525
+ fee_types?: any[] | null;
4526
+ /**
4527
+ * An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
4528
+ * @example []
4529
+ */
4530
+ billable_metric_codes?: any[] | null;
4531
+ };
4532
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
4533
+ metadata?: MetadataInput;
4534
+ };
4535
+ }
4536
+ export interface WalletMetadataResponse {
4537
+ /**
4538
+ * Custom metadata stored as key-value pairs.
4539
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
4540
+ */
4541
+ metadata: MetadataObject;
4542
+ }
4543
+ export interface AlertThresholdBaseObject {
4544
+ /**
4545
+ * Unique identifier of the usage threshold created by Lago.
4546
+ * @example "warn"
4547
+ */
4548
+ code?: string | null;
4549
+ /**
4550
+ * 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.
4551
+ * @default false
4552
+ * @example false
4553
+ */
4554
+ recurring?: boolean;
4555
+ }
4556
+ export type AlertThresholdObject = AlertThresholdBaseObject & {
4557
+ /**
4558
+ * A value that should trigger this alert, formatted as a BigDecimal.
4559
+ * @pattern ^[0-9]+.?[0-9]*$
4560
+ * @example "99.0"
4561
+ */
4562
+ value: string;
4563
+ };
4564
+ export interface AlertObject {
4565
+ /**
4566
+ * Unique identifier of the alert, created by Lago.
4567
+ * @format uuid
4568
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4569
+ */
4570
+ lago_id: string;
4571
+ /**
4572
+ * Unique identifier of the organization, created by Lago.
4573
+ * @format uuid
4574
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4575
+ */
4576
+ lago_organization_id: string;
4577
+ /**
4578
+ * The subscription external unique identifier (provided by your own application).
4579
+ * @example "sub_1234567890"
4580
+ */
4581
+ external_subscription_id: string | null;
4582
+ /**
4583
+ * The customer external unique identifier (provided by your own application).
4584
+ * @example "cus_0987654321"
4585
+ */
4586
+ external_customer_id: string;
4587
+ /**
4588
+ * Unique identifier of the wallet, created by Lago.
4589
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4590
+ */
4591
+ lago_wallet_id?: string | null;
4592
+ /**
4593
+ * The wallet external unique identifier (provided by your own application).
4594
+ * @example "wallet_code"
4595
+ */
4596
+ wallet_code?: string | null;
4597
+ /** The billable metric associated with the alert. Only for alerts based on a billable metric. */
4598
+ billable_metric: BillableMetricObject;
4599
+ /**
4600
+ * The type of alert.
4601
+ * @example "billable_metric_current_usage_amount"
4602
+ */
4603
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
4604
+ /**
4605
+ * Unique code used to identify the alert.
4606
+ * @example "storage_threshold_alert"
4607
+ */
4608
+ code: string;
4609
+ /**
4610
+ * The name of the alert.
4611
+ * @example "Storage Usage Alert"
4612
+ */
4613
+ name: string | null;
4614
+ /**
4615
+ * Indicates whether the alert is triggered when the monitored metric goes above or below the threshold.
4616
+ * @example "increasing"
4617
+ */
4618
+ direction?: "increasing" | "decreasing";
4619
+ /**
4620
+ * When the system checked if this alert should be triggered, this value was retrieved and checked against the thresholds.
4621
+ * @example 1000
4622
+ */
4623
+ previous_value: number;
4624
+ /**
4625
+ * 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.
4626
+ * @format date-time
4627
+ * @example "2025-05-19T10:04:21Z"
4628
+ */
4629
+ last_processed_at: string | null;
4630
+ /** Array of thresholds associated with the alert. */
4631
+ thresholds: AlertThresholdObject[];
4632
+ /**
4633
+ * The date and time in UTC (ISO 8601) when the alert was created.
4634
+ * @format date-time
4635
+ * @example "2025-03-20T10:00:00Z"
4636
+ */
4637
+ created_at: string;
4638
+ }
4639
+ export interface Alerts {
4640
+ alerts: AlertObject[];
4641
+ meta?: PaginationMeta;
4642
+ }
4643
+ export type AlertThresholdInput = AlertThresholdBaseObject & {
4644
+ /**
4645
+ * A value that should trigger this alert. This can be an integer or a string formatted as a BigDecimal.
4646
+ * @example 99
4647
+ */
4648
+ value: number | string;
4649
+ };
4650
+ export interface AlertBaseInput {
4651
+ /**
4652
+ * Unique code used to identify the alert.
4653
+ * @example "storage_threshold_alert"
4654
+ */
4655
+ code?: string;
4656
+ /**
4657
+ * The name of the alert.
4658
+ * @example "Storage Usage Alert"
4659
+ */
4660
+ name?: string | null;
4661
+ /** Array of thresholds associated with the alert. */
4662
+ thresholds?: AlertThresholdInput[];
4663
+ }
4664
+ export interface WalletAlertCreateInput {
4665
+ alert: AlertBaseInput & {
4666
+ /**
4667
+ * The type of alert.
4668
+ * @example "wallet_balance_amount"
4669
+ */
4670
+ alert_type: "wallet_balance_amount" | "wallet_credits_balance";
4671
+ /**
4672
+ * Unique code used to identify the alert.
4673
+ * @example "wallet_balance_alert"
4674
+ */
4675
+ code: string;
4676
+ /**
4677
+ * The name of the alert.
4678
+ * @example "Wallet Balance Alert"
4679
+ */
4680
+ name?: string | null;
4681
+ };
4682
+ }
4683
+ export interface WalletAlertBatchCreateInput {
4684
+ /** Array of alerts to create. All alerts are created atomically - if any fail validation, none are created. */
4685
+ alerts: (AlertBaseInput & {
4686
+ /**
4687
+ * The type of alert.
4688
+ * @example "wallet_balance_amount"
4689
+ */
4690
+ alert_type: "wallet_balance_amount" | "wallet_credits_balance";
4691
+ /**
4692
+ * Unique code used to identify the alert.
4693
+ * @example "wallet_balance_alert"
4694
+ */
4695
+ code: string;
4696
+ /**
4697
+ * The name of the alert.
4698
+ * @example "Wallet Balance Alert"
4699
+ */
4700
+ name?: string | null;
4701
+ })[];
4702
+ }
4703
+ export interface Alert {
4704
+ alert: AlertObject;
4705
+ }
4706
+ export interface WalletAlertUpdateInput {
4707
+ alert: AlertBaseInput & {
4708
+ /**
4709
+ * Unique code used to identify the alert.
4710
+ * @example "wallet_balance_alert"
4711
+ */
4712
+ code?: string;
4713
+ /**
4714
+ * The name of the alert.
4715
+ * @example "Wallet Balance Alert"
4716
+ */
4717
+ name?: string | null;
4718
+ };
4719
+ }
4720
+ /** Details about the pricing unit used for charge usage. */
4721
+ export interface UsagePricingUnitDetailsObject {
4722
+ /**
4723
+ * The amount in cents in the pricing unit.
4724
+ * @example 200
4725
+ */
4726
+ amount_cents: number;
4727
+ /**
4728
+ * The short name of the pricing unit.
4729
+ * @example "CR"
4730
+ */
4731
+ short_name: string;
4732
+ /**
4733
+ * The conversion rate from pricing units to the plan's currency.
4734
+ * @example "0.5"
4735
+ */
4736
+ conversion_rate: string;
4737
+ }
4738
+ /** Array of filter object, representing multiple dimensions for a charge item. */
4739
+ export type CustomerChargeFiltersUsageObject = {
4740
+ /**
4741
+ * The number of units consumed for a specific charge filter related to a charge item.
4742
+ * @pattern ^[0-9]+.?[0-9]*$
4743
+ * @example "0.9"
4744
+ */
4745
+ units?: string;
4746
+ /**
4747
+ * The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
4748
+ * @pattern ^[0-9]+.?[0-9]*$
4749
+ * @example "1.0"
4750
+ */
4751
+ total_aggregated_units?: string;
4752
+ /**
4753
+ * The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
4754
+ * @example 1000
4755
+ */
4756
+ amount_cents?: number;
4757
+ /**
4758
+ * The quantity of usage events that have been recorded for a particular charge filter during the specified time period. These events may also be referred to as the number of transactions in some contexts.
4759
+ * @example 10
4760
+ */
4761
+ events_count?: number;
4762
+ /**
4763
+ * Specifies the name that will be displayed on an invoice.
4764
+ * @example "AWS eu-east-1"
4765
+ */
4766
+ invoice_display_name?: string;
4767
+ /** Details about the pricing unit used for charge usage. */
4768
+ pricing_unit_details?: UsagePricingUnitDetailsObject;
4769
+ /**
4770
+ * List of filter values applied to the usage.
4771
+ * @example {"region":["us-east-1"]}
4772
+ */
4773
+ values?: Record<string, string[]>;
4774
+ }[];
4775
+ /** Array of aggregated fees, grouped by the event properties defined in a `standard` charge model. */
4776
+ export type CustomerChargeGroupedUsageObject = {
4777
+ /**
4778
+ * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
4779
+ * @example 1000
4780
+ */
4781
+ amount_cents?: number;
4782
+ /**
4783
+ * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
4784
+ * @example 10
4785
+ */
4786
+ events_count?: number;
4787
+ /**
4788
+ * The number of units consumed for a specific group related to a charge item.
4789
+ * @pattern ^[0-9]+.?[0-9]*$
4790
+ * @example "0.9"
4791
+ */
4792
+ units?: string;
4793
+ /**
4794
+ * The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
4795
+ * @pattern ^[0-9]+.?[0-9]*$
4796
+ * @example "1.0"
4797
+ */
4798
+ total_aggregated_units?: string;
4799
+ /** Details about the pricing unit used for charge usage. */
4800
+ pricing_unit_details?: UsagePricingUnitDetailsObject;
4801
+ /** Key value list of event properties aggregated by the charge model */
4802
+ grouped_by?: Record<string, string>;
4803
+ /** Array of filter object, representing multiple dimensions for a charge item. */
4804
+ filters?: CustomerChargeFiltersUsageObject;
4805
+ }[];
4806
+ export interface CustomerChargeUsageObject {
4807
+ /**
4808
+ * The number of units consumed by the customer for a specific charge item.
4224
4809
  * @pattern ^[0-9]+.?[0-9]*$
4225
4810
  * @example "1.0"
4226
4811
  */
@@ -4407,35 +4992,78 @@ export interface CustomerPastUsage {
4407
4992
  usage_periods: CustomerUsage[];
4408
4993
  meta: PaginationMeta;
4409
4994
  }
4410
- /** . */
4411
4995
  export interface CustomerCheckoutUrl {
4412
- customer?: {
4413
- /**
4414
- * 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
4415
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4416
- */
4417
- lago_customer_id: string;
4418
- /**
4419
- * The customer external unique identifier (provided by your own application)
4420
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
4421
- */
4422
- external_customer_id: string;
4423
- /**
4424
- * The Payment Provider name linked to the Customer.
4425
- * @example "stripe"
4426
- */
4427
- payment_provider: string;
4428
- /**
4429
- * Code of the payment provider
4430
- * @example "Stripe Prod"
4431
- */
4432
- payment_provider_code?: string;
4433
- /**
4434
- * The new generated Payment Provider Checkout URL for the Customer.
4435
- * @example "https://foo.bar"
4436
- */
4437
- checkout_url?: string;
4438
- };
4996
+ /**
4997
+ * 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
4998
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4999
+ */
5000
+ lago_customer_id: string;
5001
+ /**
5002
+ * The customer external unique identifier (provided by your own application)
5003
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5004
+ */
5005
+ external_customer_id: string;
5006
+ /**
5007
+ * The Payment Provider name linked to the Customer.
5008
+ * @example "stripe"
5009
+ */
5010
+ payment_provider: string;
5011
+ /**
5012
+ * Code of the payment provider
5013
+ * @example "Stripe Prod"
5014
+ */
5015
+ payment_provider_code?: string;
5016
+ /**
5017
+ * The new generated Payment Provider Checkout URL for the Customer.
5018
+ * @example "https://foo.bar"
5019
+ */
5020
+ checkout_url?: string;
5021
+ }
5022
+ export interface PaymentMethodObject {
5023
+ /**
5024
+ * The unique identifier of the payment method, created by Lago.
5025
+ * @format uuid
5026
+ * @example "4cf085a7-c196-4f07-a543-97c50ec6e8b2"
5027
+ */
5028
+ lago_id: string;
5029
+ /**
5030
+ * Indicates whether this payment method is the default one for the customer.
5031
+ * @example true
5032
+ */
5033
+ is_default: boolean;
5034
+ /**
5035
+ * Code of the payment provider associated with this payment method.
5036
+ * @example "stripe_prod"
5037
+ */
5038
+ payment_provider_code?: string | null;
5039
+ /**
5040
+ * Human-readable name of the payment provider.
5041
+ * @example "Stripe"
5042
+ */
5043
+ payment_provider_name?: string | null;
5044
+ /**
5045
+ * The type of the payment provider.
5046
+ * @example "stripe"
5047
+ */
5048
+ payment_provider_type: "adyen" | "cashfree" | "gocardless" | "stripe" | "flutterwave" | "moneyhash";
5049
+ /**
5050
+ * Unique identifier of the payment method within the payment provider.
5051
+ * @example "pm_1N8ZQX2eZvKYlo2CkL9Y8XYZ"
5052
+ */
5053
+ provider_method_id: string;
5054
+ /**
5055
+ * Timestamp when the payment method was created in Lago's database.
5056
+ * @format date-time
5057
+ * @example "2025-01-21T00:10:29Z"
5058
+ */
5059
+ created_at: string;
5060
+ }
5061
+ export interface PaymentMethodsPaginated {
5062
+ payment_methods: PaymentMethodObject[];
5063
+ meta: PaginationMeta;
5064
+ }
5065
+ export interface PaymentMethod {
5066
+ payment_method: PaymentMethodObject;
4439
5067
  }
4440
5068
  export interface EventObject {
4441
5069
  /**
@@ -4869,26 +5497,12 @@ export interface InvoiceOneOffCreateInput {
4869
5497
  */
4870
5498
  skip_psp?: boolean | null;
4871
5499
  }[];
5500
+ /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
5501
+ invoice_custom_section?: InvoiceCustomSectionInput;
5502
+ /** Optional payment method to use for processing the invoice payment. */
5503
+ payment_method?: PaymentMethodReference;
4872
5504
  };
4873
5505
  }
4874
- export interface ErrorDetailObject {
4875
- /**
4876
- * Unique identifier assigned to the error_detail within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the error's record within the Lago system.
4877
- * @format uuid
4878
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4879
- */
4880
- lago_id: string | null;
4881
- /**
4882
- * Code that specifies part of the application / connection, where the error originally happened
4883
- * @example "tax_error"
4884
- */
4885
- error_code: string;
4886
- /**
4887
- * Key value list of more elaborated error detail, where by the key of error_code an external service error details are stored
4888
- * @example {"tax_error":"taxDateTooFarInFuture"}
4889
- */
4890
- details: object;
4891
- }
4892
5506
  export type InvoiceObjectExtended = InvoiceObject & {
4893
5507
  credits?: CreditObject[];
4894
5508
  fees?: FeeObject[];
@@ -5400,6 +6014,8 @@ export interface PaymentRequestCreateInput {
5400
6014
  email: string;
5401
6015
  /** A list of Lago IDs for the customer's overdue invoices to start the dunning process */
5402
6016
  lago_invoice_ids: string[];
6017
+ /** Optional payment method to use for processing the payment request. */
6018
+ payment_method?: PaymentMethodReference;
5403
6019
  };
5404
6020
  }
5405
6021
  export interface PaymentRequest {
@@ -5661,6 +6277,11 @@ export interface ChargeObject {
5661
6277
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5662
6278
  */
5663
6279
  lago_billable_metric_id: string;
6280
+ /**
6281
+ * Unique code identifying the charge within the plan.
6282
+ * @example "api_requests_charge"
6283
+ */
6284
+ code?: string | null;
5664
6285
  /**
5665
6286
  * Unique code identifying a billable metric.
5666
6287
  * @example "requests"
@@ -5670,7 +6291,7 @@ export interface ChargeObject {
5670
6291
  * 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.
5671
6292
  * @example "Setup"
5672
6293
  */
5673
- invoice_display_name: string | null;
6294
+ invoice_display_name?: string | null;
5674
6295
  /**
5675
6296
  * The date and time when the charge was created. It is expressed in UTC format according to the ISO 8601 datetime standard.
5676
6297
  * @format date-time
@@ -5740,6 +6361,17 @@ export interface ChargeObject {
5740
6361
  */
5741
6362
  conversion_rate: string;
5742
6363
  };
6364
+ /**
6365
+ * Specifies whether the charge accepts a target wallet for prepaid credits deduction.
6366
+ * @example false
6367
+ */
6368
+ accepts_target_wallet?: boolean | null;
6369
+ /**
6370
+ * Unique identifier of the parent charge (if this is an override).
6371
+ * @format uuid
6372
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6373
+ */
6374
+ lago_parent_id?: string | null;
5743
6375
  }
5744
6376
  export interface FixedChargeProperties {
5745
6377
  /**
@@ -5837,7 +6469,7 @@ export interface FixedChargeObject {
5837
6469
  * Unique code for the fixed charge.
5838
6470
  * @example "setup_fee"
5839
6471
  */
5840
- code?: string;
6472
+ code: string;
5841
6473
  /**
5842
6474
  * The charge model for the fixed charge. Only `standard`, `graduated`, and `volume` models are supported for fixed charges.
5843
6475
  * @example "standard"
@@ -6120,6 +6752,11 @@ export interface PlanCreateInput {
6120
6752
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6121
6753
  */
6122
6754
  billable_metric_id: string;
6755
+ /**
6756
+ * Unique code identifying the charge within the plan.
6757
+ * @example "api_requests_charge"
6758
+ */
6759
+ code?: string;
6123
6760
  /**
6124
6761
  * Specifies the pricing model used for the calculation of the final fee. It can be any of the following values:
6125
6762
  * - [`dynamic`](https://docs.getlago.com/guide/plans/charges/charge-models/dynamic)
@@ -6190,6 +6827,11 @@ export interface PlanCreateInput {
6190
6827
  */
6191
6828
  conversion_rate?: string;
6192
6829
  };
6830
+ /**
6831
+ * Specifies whether the charge accepts a target wallet for prepaid credits deduction.
6832
+ * @example false
6833
+ */
6834
+ accepts_target_wallet?: boolean | null;
6193
6835
  }[];
6194
6836
  /**
6195
6837
  * Additional fixed charges for this plan.
@@ -6333,6 +6975,11 @@ export interface PlanUpdateInput {
6333
6975
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6334
6976
  */
6335
6977
  billable_metric_id?: string;
6978
+ /**
6979
+ * Unique code identifying the charge within the plan.
6980
+ * @example "api_requests_charge"
6981
+ */
6982
+ code?: string;
6336
6983
  /**
6337
6984
  * Specifies the pricing model used for the calculation of the final fee. It can be any of the following values:
6338
6985
  * - [`dynamic`](https://docs.getlago.com/guide/plans/charges/charge-models/dynamic)
@@ -6398,6 +7045,11 @@ export interface PlanUpdateInput {
6398
7045
  */
6399
7046
  conversion_rate?: string;
6400
7047
  };
7048
+ /**
7049
+ * Specifies whether the charge accepts a target wallet for prepaid credits deduction.
7050
+ * @example false
7051
+ */
7052
+ accepts_target_wallet?: boolean | null;
6401
7053
  }[];
6402
7054
  /**
6403
7055
  * Additional fixed charges for this plan.
@@ -6468,30 +7120,336 @@ export interface PlanUpdateInput {
6468
7120
  /** List of usage thresholds to apply to the plan. */
6469
7121
  usage_thresholds?: UsageThresholdInput[];
6470
7122
  /**
6471
- * This field determines whether the changes made to the plan 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`.
7123
+ * This field determines whether the changes made to the plan 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`.
7124
+ * @example true
7125
+ */
7126
+ cascade_updates?: boolean;
7127
+ /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
7128
+ metadata?: MetadataInput;
7129
+ };
7130
+ }
7131
+ export interface PlanEntitlements {
7132
+ entitlements: PlanEntitlementObject[];
7133
+ }
7134
+ export interface EntitlementUpdateInput {
7135
+ /**
7136
+ * Feature entitlements with their privilege values. Each key is a feature code, and the value is an object containing privilege codes with their associated values.
7137
+ * @example {"seats":{"max":20,"max_admins":10,"root":false},"sso":{"provider":"okta"}}
7138
+ */
7139
+ entitlements: Record<string, Record<string, number | boolean | string>>;
7140
+ }
7141
+ export interface PlanMetadataResponse {
7142
+ /**
7143
+ * Custom metadata stored as key-value pairs.
7144
+ * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
7145
+ */
7146
+ metadata: MetadataObject;
7147
+ }
7148
+ export interface ChargesPaginated {
7149
+ charges: ChargeObject[];
7150
+ meta: PaginationMeta;
7151
+ }
7152
+ /** Properties of a charge that can be overridden at the subscription level. */
7153
+ export interface ChargeOverridableInput {
7154
+ /**
7155
+ * 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.
7156
+ * @example "Setup"
7157
+ */
7158
+ invoice_display_name?: string;
7159
+ /**
7160
+ * The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
7161
+ * @example 0
7162
+ */
7163
+ min_amount_cents?: number;
7164
+ /** List of all thresholds utilized for calculating the charge. */
7165
+ properties?: ChargeProperties;
7166
+ /** List of filters used to apply differentiated pricing based on additional event properties. */
7167
+ filters?: ChargeFilterInput[];
7168
+ /** List of unique code used to identify the taxes. */
7169
+ tax_codes?: TaxCodes;
7170
+ /** The pricing unit to apply to the charge. */
7171
+ applied_pricing_unit?: {
7172
+ /**
7173
+ * The code of the pricing unit.
7174
+ * @example "credits"
7175
+ */
7176
+ code?: string;
7177
+ /**
7178
+ * The conversion rate from pricing units to the plan's currency.
7179
+ * This rate determines how many currency units (in the plan's base currency) equal one pricing unit.
7180
+ * For example, if the plan uses USD and the conversion rate is 0.5, then 1 pricing unit = $0.50.
7181
+ * @example "0.5"
7182
+ */
7183
+ conversion_rate?: string;
7184
+ };
7185
+ }
7186
+ export type ChargeInput = ChargeOverridableInput & {
7187
+ /**
7188
+ * Unique identifier of the billable metric created by Lago.
7189
+ * @format uuid
7190
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
7191
+ */
7192
+ billable_metric_id?: string;
7193
+ /**
7194
+ * Unique code identifying the charge within the plan.
7195
+ * @example "api_requests_charge"
7196
+ */
7197
+ code?: string;
7198
+ /**
7199
+ * Specifies the pricing model used for the calculation of the final fee. It can be any of the following values:
7200
+ * - [`dynamic`](https://docs.getlago.com/guide/plans/charges/charge-models/dynamic)
7201
+ * - [`graduated_percentage`](https://docs.getlago.com/guide/plans/charges/charge-models/graduated-percentage)
7202
+ * - [`graduated`](https://docs.getlago.com/guide/plans/charges/charge-models/graduated)
7203
+ * - [`package`](https://docs.getlago.com/guide/plans/charges/charge-models/package)
7204
+ * - [`percentage`](https://docs.getlago.com/guide/plans/charges/charge-models/percentage)
7205
+ * - [`standard`](https://docs.getlago.com/guide/plans/charges/charge-models/standard)
7206
+ * - [`volume`](https://docs.getlago.com/guide/plans/charges/charge-models/volume)
7207
+ */
7208
+ charge_model?: ChargeModelEnum;
7209
+ /**
7210
+ * This field determines the billing timing for this specific usage-based charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to false, the charge is due and invoiced at the end of each billing period.
7211
+ * @example false
7212
+ */
7213
+ pay_in_advance?: boolean;
7214
+ /**
7215
+ * This field specifies whether the charge should be included in a proper invoice. If set to false, no invoice will be issued for this charge. You can only set it to `false` when `pay_in_advance` is `true`.
7216
+ * @example true
7217
+ */
7218
+ invoiceable?: boolean;
7219
+ /**
7220
+ * This setting can only be configured if `pay_in_advance` is `true` and `invoiceable` is `false`.
7221
+ * This field determines whether and when the charge fee should be included in
7222
+ * the invoice. If `null`, no invoice will be issued for this charge fee.
7223
+ * If `invoice`, an invoice will be generated at the end of the period,
7224
+ * consolidating all charge fees with a succeeded payment status.
7225
+ * @example null
7226
+ */
7227
+ regroup_paid_fees?: "invoice";
7228
+ /**
7229
+ * Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
7230
+ *
7231
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
7232
+ * - If set to `false`, the charge is billed in full.
7233
+ * - If not defined in the request, default value is `false`.
7234
+ * @example false
7235
+ */
7236
+ prorated?: boolean;
7237
+ };
7238
+ export interface ChargeCreateInput {
7239
+ charge: ChargeInput & {
7240
+ /**
7241
+ * This field determines whether the creation of the charge should be cascaded to the children plans. When set to `true`, the charge will be created in children plans. Conversely, when set to `false`, the charge will only be created in the plan itself. If not defined in the request, default value is `false`.
7242
+ * @example true
7243
+ */
7244
+ cascade_updates?: boolean;
7245
+ };
7246
+ }
7247
+ export interface Charge {
7248
+ charge: ChargeObject;
7249
+ }
7250
+ export interface ChargeUpdateInput {
7251
+ charge: ChargeInput & {
7252
+ /**
7253
+ * This field determines whether the changes made to the 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`.
7254
+ * @example true
7255
+ */
7256
+ cascade_updates?: boolean;
7257
+ };
7258
+ }
7259
+ export interface ChargeDeleteInput {
7260
+ charge?: {
7261
+ /**
7262
+ * When set to `true`, the deletion will be cascaded to the children plans.
7263
+ * @example true
7264
+ */
7265
+ cascade_updates?: boolean;
7266
+ };
7267
+ }
7268
+ /** Charge filter values used to apply differentiated pricing based on additional event properties. */
7269
+ export interface ChargeFilterFullObject {
7270
+ /**
7271
+ * Unique identifier of the charge filter, created by Lago.
7272
+ * @format uuid
7273
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
7274
+ */
7275
+ lago_id: string;
7276
+ /**
7277
+ * Unique code identifying the charge this filter belongs to.
7278
+ * @example "api_requests_charge"
7279
+ */
7280
+ charge_code: string;
7281
+ /**
7282
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the values of the filter will be used as the default display name.
7283
+ * @example "AWS"
7284
+ */
7285
+ invoice_display_name: string | null;
7286
+ /** List of all thresholds utilized for calculating the charge. */
7287
+ properties: ChargeProperties;
7288
+ /**
7289
+ * List of possible filter values. The key and values must match one of the billable metric filters.
7290
+ * @example {"region":["us-east-1"]}
7291
+ */
7292
+ values: Record<string, string[]>;
7293
+ }
7294
+ export interface ChargeFiltersPaginated {
7295
+ filters: ChargeFilterFullObject[];
7296
+ meta: PaginationMeta;
7297
+ }
7298
+ export interface ChargeFilterCreateInput {
7299
+ filter: {
7300
+ /**
7301
+ * This field determines whether the creation of the filter 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`.
7302
+ * @example true
7303
+ */
7304
+ cascade_updates?: boolean;
7305
+ /**
7306
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the values of the filter will be used as the default display name.
7307
+ * @example "AWS"
7308
+ */
7309
+ invoice_display_name?: string | null;
7310
+ /** List of all thresholds utilized for calculating the charge. */
7311
+ properties: ChargeProperties;
7312
+ /**
7313
+ * List of possible filter values. The key and values must match one of the billable metric filters.
7314
+ * @example {"region":["us-east-1"]}
7315
+ */
7316
+ values: Record<string, string[]>;
7317
+ };
7318
+ }
7319
+ export interface ChargeFilterResponse {
7320
+ /** Charge filter values used to apply differentiated pricing based on additional event properties. */
7321
+ filter: ChargeFilterFullObject;
7322
+ }
7323
+ export interface ChargeFilterUpdateInput {
7324
+ filter: {
7325
+ /**
7326
+ * This field determines whether the changes made to the filter 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`.
7327
+ * @example true
7328
+ */
7329
+ cascade_updates?: boolean;
7330
+ /**
7331
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the values of the filter will be used as the default display name.
7332
+ * @example "AWS"
7333
+ */
7334
+ invoice_display_name?: string | null;
7335
+ /** List of all thresholds utilized for calculating the charge. */
7336
+ properties?: ChargeProperties;
7337
+ /**
7338
+ * List of possible filter values. The key and values must match one of the billable metric filters.
7339
+ * @example {"region":["us-east-1"]}
7340
+ */
7341
+ values?: Record<string, string[]>;
7342
+ };
7343
+ }
7344
+ export interface ChargeFilterDeleteInput {
7345
+ filter?: {
7346
+ /**
7347
+ * When set to `true`, the deletion will be cascaded to the children plans.
7348
+ * @example true
7349
+ */
7350
+ cascade_updates?: boolean;
7351
+ };
7352
+ }
7353
+ export interface FixedChargesPaginated {
7354
+ fixed_charges: FixedChargeObject[];
7355
+ meta: PaginationMeta;
7356
+ }
7357
+ /** Properties of a fixed charge that can be overridden at the subscription level. */
7358
+ export interface FixedChargeOverridableInput {
7359
+ /**
7360
+ * 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.
7361
+ * @example "Setup Fee"
7362
+ */
7363
+ invoice_display_name?: string | null;
7364
+ /**
7365
+ * The quantity of units for the fixed charge.
7366
+ * @example "1.0"
7367
+ */
7368
+ units?: string;
7369
+ /**
7370
+ * 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.
7371
+ * @example false
7372
+ */
7373
+ apply_units_immediately?: boolean;
7374
+ /** List of all thresholds utilized for calculating the fixed charge. */
7375
+ properties?: ChargeProperties;
7376
+ /** List of unique code used to identify the taxes. */
7377
+ tax_codes?: TaxCodes;
7378
+ }
7379
+ /**
7380
+ * Specifies the pricing model used for the calculation of the fixed charge fee. It can be any of the following values:
7381
+ * - `standard`
7382
+ * - `graduated`
7383
+ * - `volume`
7384
+ */
7385
+ export type FixedChargeModelEnum = "standard" | "graduated" | "volume";
7386
+ export type FixedChargeInput = FixedChargeOverridableInput & {
7387
+ /**
7388
+ * Unique identifier of the add-on. Either add_on_id or add_on_code is required.
7389
+ * @format uuid
7390
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
7391
+ */
7392
+ add_on_id?: string;
7393
+ /**
7394
+ * Unique code identifying an add-on. Either add_on_id or add_on_code is required.
7395
+ * @example "setup_fee"
7396
+ */
7397
+ add_on_code?: string;
7398
+ /**
7399
+ * Unique code identifying the fixed charge within the plan.
7400
+ * @example "setup_fee_charge"
7401
+ */
7402
+ code?: string;
7403
+ /**
7404
+ * Specifies the pricing model used for the calculation of the fixed charge fee. It can be any of the following values:
7405
+ * - `standard`
7406
+ * - `graduated`
7407
+ * - `volume`
7408
+ */
7409
+ charge_model?: FixedChargeModelEnum;
7410
+ /**
7411
+ * 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.
7412
+ * @example true
7413
+ */
7414
+ pay_in_advance?: boolean;
7415
+ /**
7416
+ * Specifies whether a fixed charge is prorated based on the remaining number of days in the billing period or billed fully.
7417
+ *
7418
+ * - If set to `true`, the charge is prorated based on the remaining days in the current billing period.
7419
+ * - If set to `false`, the charge is billed in full.
7420
+ * @example false
7421
+ */
7422
+ prorated?: boolean;
7423
+ };
7424
+ export interface FixedChargeCreateInput {
7425
+ fixed_charge: FixedChargeInput & {
7426
+ /**
7427
+ * 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`.
6472
7428
  * @example true
6473
7429
  */
6474
7430
  cascade_updates?: boolean;
6475
- /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
6476
- metadata?: MetadataInput;
6477
7431
  };
6478
7432
  }
6479
- export interface PlanEntitlements {
6480
- entitlements: PlanEntitlementObject[];
7433
+ export interface FixedCharge {
7434
+ fixed_charge: FixedChargeObject;
6481
7435
  }
6482
- export interface EntitlementUpdateInput {
6483
- /**
6484
- * Feature entitlements with their privilege values. Each key is a feature code, and the value is an object containing privilege codes with their associated values.
6485
- * @example {"seats":{"max":20,"max_admins":10,"root":false},"sso":{"provider":"okta"}}
6486
- */
6487
- entitlements: Record<string, Record<string, number | boolean | string>>;
7436
+ export interface FixedChargeUpdateInput {
7437
+ fixed_charge: FixedChargeInput & {
7438
+ /**
7439
+ * 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`.
7440
+ * @example true
7441
+ */
7442
+ cascade_updates?: boolean;
7443
+ };
6488
7444
  }
6489
- export interface PlanMetadataResponse {
6490
- /**
6491
- * Custom metadata stored as key-value pairs.
6492
- * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
6493
- */
6494
- metadata: MetadataObject;
7445
+ export interface FixedChargeDeleteInput {
7446
+ fixed_charge?: {
7447
+ /**
7448
+ * When set to `true`, the deletion will be cascaded to the children plans.
7449
+ * @example true
7450
+ */
7451
+ cascade_updates?: boolean;
7452
+ };
6495
7453
  }
6496
7454
  /** Based plan overrides. */
6497
7455
  export interface PlanOverridesObject {
@@ -6543,6 +7501,11 @@ export interface PlanOverridesObject {
6543
7501
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6544
7502
  */
6545
7503
  billable_metric_id?: string;
7504
+ /**
7505
+ * Unique code identifying the charge within the plan.
7506
+ * @example "api_requests_charge"
7507
+ */
7508
+ code?: string;
6546
7509
  /**
6547
7510
  * Specifies the pricing model used for the calculation of the final fee. It can be any of the following values:
6548
7511
  * - [`dynamic`](https://docs.getlago.com/guide/plans/charges/charge-models/dynamic)
@@ -6682,12 +7645,35 @@ export interface SubscriptionCreateInput {
6682
7645
  subscription_at?: string;
6683
7646
  /** Based plan overrides. */
6684
7647
  plan_overrides?: PlanOverridesObject;
7648
+ /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
7649
+ invoice_custom_section?: InvoiceCustomSectionInput;
7650
+ /** Optional payment method to use for processing subscription payments. */
7651
+ payment_method?: PaymentMethodReference;
6685
7652
  };
6686
7653
  }
7654
+ export interface ApplicableUsageThreshold {
7655
+ /**
7656
+ * The display name of the usage threshold.
7657
+ * @example "Threshold 1"
7658
+ */
7659
+ threshold_display_name: string | null;
7660
+ /**
7661
+ * The amount to reach to trigger a `progressive_billing` invoice.
7662
+ * @example 10000
7663
+ */
7664
+ amount_cents: number;
7665
+ /**
7666
+ * This field when set to `true` indicates that a `progressive_billing` invoice will be created every time the lifetime usage increases by the specified amount.
7667
+ * @example true
7668
+ */
7669
+ recurring: boolean;
7670
+ }
6687
7671
  export type SubscriptionObjectExtended = SubscriptionObject & {
6688
7672
  plan?: PlanObject;
7673
+ /** List of usage thresholds applicable to this subscription. */
7674
+ applicable_usage_thresholds?: ApplicableUsageThreshold[];
6689
7675
  };
6690
- export interface Subscription {
7676
+ export interface SubscriptionExtended {
6691
7677
  subscription: SubscriptionObjectExtended;
6692
7678
  }
6693
7679
  export interface SubscriptionUpdateInput {
@@ -6705,548 +7691,243 @@ export interface SubscriptionUpdateInput {
6705
7691
  /**
6706
7692
  * The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC).
6707
7693
  * @format date-time
6708
- * @example "2022-10-08T00:00:00Z"
6709
- */
6710
- ending_at: string | null;
6711
- /**
6712
- * The start date and time of the subscription. This field can only be modified for pending subscriptions that have not yet started. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
6713
- * @format date-time
6714
- * @example "2022-08-08T00:00:00Z"
6715
- */
6716
- subscription_at?: string;
6717
- /** Based plan overrides. */
6718
- plan_overrides?: PlanOverridesObject;
6719
- };
6720
- }
6721
- export interface LifetimeUsageThresholdObject {
6722
- /**
6723
- * The usage threshold amount in cents.
6724
- * @example 100
6725
- */
6726
- amount_cents: number;
6727
- /**
6728
- * The completion ratio of the usage threshold.
6729
- * @example 0.5
6730
- */
6731
- completion_ratio: number;
6732
- /**
6733
- * The date and time when the usage threshold was reached. The date and time must be in ISO 8601 format.
6734
- * @format date-time
6735
- * @example "2024-01-01T00:00:00Z"
6736
- */
6737
- reached_at: string | null;
6738
- }
6739
- export interface LifetimeUsageObject {
6740
- /**
6741
- * Unique identifier assigned to the lifetime usage record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the lifetime usage record within the Lago system
6742
- * @format uuid
6743
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6744
- */
6745
- lago_id: string;
6746
- /**
6747
- * Unique identifier assigned to the subscription record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription record within the Lago system
6748
- * @format uuid
6749
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6750
- */
6751
- lago_subscription_id: string;
6752
- /**
6753
- * The subscription external unique identifier (provided by your own application).
6754
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6755
- */
6756
- external_subscription_id: string;
6757
- /**
6758
- * The historical usage amount in cents for the subscription (provided by your own application).
6759
- * @example 100
6760
- */
6761
- external_historical_usage_amount_cents: number;
6762
- /**
6763
- * The total invoiced usage amount in cents for the subscription.
6764
- * @example 100
6765
- */
6766
- invoiced_usage_amount_cents: number;
6767
- /**
6768
- * The current usage amount in cents for the subscription on the current billing period.
6769
- * @example 100
6770
- */
6771
- current_usage_amount_cents: number;
6772
- /**
6773
- * The recording start date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
6774
- * @format date-time
6775
- * @example "2024-01-01T00:00:00Z"
6776
- */
6777
- from_datetime: string | null;
6778
- /**
6779
- * The recording end date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
6780
- * @format date-time
6781
- * @example "2024-12-31T23:59:59Z"
6782
- */
6783
- to_datetime: string;
6784
- /** Array of usage thresholds attached to the subscription's plan. */
6785
- usage_thresholds?: LifetimeUsageThresholdObject[];
6786
- }
6787
- export interface LifetimeUsage {
6788
- lifetime_usage: LifetimeUsageObject;
6789
- }
6790
- export interface LifetimeUsageInput {
6791
- lifetime_usage: {
6792
- /**
6793
- * The historical usage amount in cents for the subscription (provided by your own application).
6794
- * @example 100
6795
- */
6796
- external_historical_usage_amount_cents: number;
6797
- };
6798
- }
6799
- export interface AlertThresholdBaseObject {
6800
- /**
6801
- * Unique identifier of the usage threshold created by Lago.
6802
- * @example "warn"
6803
- */
6804
- code?: string | null;
6805
- /**
6806
- * 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.
6807
- * @default false
6808
- * @example false
6809
- */
6810
- recurring?: boolean;
6811
- }
6812
- export type AlertThresholdObject = AlertThresholdBaseObject & {
6813
- /**
6814
- * A value that should trigger this alert, formatted as a BigDecimal.
6815
- * @pattern ^[0-9]+.?[0-9]*$
6816
- * @example "99.0"
6817
- */
6818
- value: string;
6819
- };
6820
- export interface AlertObject {
6821
- /**
6822
- * Unique identifier of the alert, created by Lago.
6823
- * @format uuid
6824
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6825
- */
6826
- lago_id: string;
6827
- /**
6828
- * Unique identifier of the organization, created by Lago.
6829
- * @format uuid
6830
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6831
- */
6832
- lago_organization_id: string;
6833
- /**
6834
- * The subscription external unique identifier (provided by your own application).
6835
- * @example "sub_1234567890"
6836
- */
6837
- external_subscription_id: string;
6838
- /**
6839
- * The customer external unique identifier (provided by your own application).
6840
- * @example "cus_0987654321"
6841
- */
6842
- external_customer_id: string;
6843
- /** The billable metric associated with the alert. Only for alerts based on a billable metric. */
6844
- billable_metric: BillableMetricObject;
6845
- /**
6846
- * The type of alert.
6847
- * @example "billable_metric_current_usage_amount"
6848
- */
6849
- alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
6850
- /**
6851
- * Unique code used to identify the alert.
6852
- * @example "storage_threshold_alert"
6853
- */
6854
- code: string;
6855
- /**
6856
- * The name of the alert.
6857
- * @example "Storage Usage Alert"
6858
- */
6859
- name: string | null;
6860
- /**
6861
- * When the system checked if this alert should be triggered, this value was retrieved and checked against the thresholds.
6862
- * @example 1000
6863
- */
6864
- previous_value: number;
6865
- /**
6866
- * 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.
6867
- * @format date-time
6868
- * @example "2025-05-19T10:04:21Z"
6869
- */
6870
- last_processed_at: string | null;
6871
- /** Array of thresholds associated with the alert. */
6872
- thresholds: AlertThresholdObject[];
6873
- /**
6874
- * The date and time in UTC (ISO 8601) when the alert was created.
6875
- * @format date-time
6876
- * @example "2025-03-20T10:00:00Z"
6877
- */
6878
- created_at: string;
6879
- }
6880
- export interface Alerts {
6881
- alerts: AlertObject[];
6882
- meta?: PaginationMeta;
6883
- }
6884
- export type AlertThresholdInput = AlertThresholdBaseObject & {
6885
- /**
6886
- * A value that should trigger this alert. This can be an integer or a string formatted as a BigDecimal.
6887
- * @example 99
6888
- */
6889
- value: number | string;
6890
- };
6891
- export interface AlertBaseInput {
6892
- /**
6893
- * Unique code used to identify the alert.
6894
- * @example "storage_threshold_alert"
6895
- */
6896
- code?: string;
6897
- /**
6898
- * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
6899
- * @example "storage_usage"
6900
- */
6901
- billable_metric_code?: string | null;
6902
- /**
6903
- * The name of the alert.
6904
- * @example "Storage Usage Alert"
6905
- */
6906
- name?: string | null;
6907
- /** Array of thresholds associated with the alert. */
6908
- thresholds?: AlertThresholdInput[];
6909
- }
6910
- export interface AlertCreateInput {
6911
- alert: AlertBaseInput & {
6912
- /**
6913
- * The type of alert.
6914
- * @example "billable_metric_current_usage_amount"
7694
+ * @example "2022-10-08T00:00:00Z"
6915
7695
  */
6916
- alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
7696
+ ending_at: string | null;
6917
7697
  /**
6918
- * Unique code used to identify the alert.
6919
- * @example "storage_threshold_alert"
7698
+ * The start date and time of the subscription. This field can only be modified for pending subscriptions that have not yet started. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
7699
+ * @format date-time
7700
+ * @example "2022-08-08T00:00:00Z"
6920
7701
  */
6921
- code: string;
7702
+ subscription_at?: string;
7703
+ /** Based plan overrides. */
7704
+ plan_overrides?: PlanOverridesObject;
7705
+ /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
7706
+ invoice_custom_section?: InvoiceCustomSectionInput;
7707
+ /** Optional payment method to use for processing subscription payments. */
7708
+ payment_method?: PaymentMethodReference;
6922
7709
  };
6923
7710
  }
6924
- export interface Alert {
6925
- alert: AlertObject;
6926
- }
6927
- export interface AlertUpdateInput {
6928
- alert: AlertBaseInput;
7711
+ export interface Subscription {
7712
+ subscription: SubscriptionObject;
6929
7713
  }
6930
- export type SubscriptionEntitlementPrivilegeObject = FeaturePrivilegeObject & {
6931
- /**
6932
- * Applicable value this this subscription (override_value if set, plan_value otherwise). Type depends on the privilege's value_type.
6933
- * @example 10
6934
- */
6935
- value: number | boolean | string;
7714
+ export interface LifetimeUsageThresholdObject {
6936
7715
  /**
6937
- * Value assigned to this privilege in the plan. Type depends on the privilege's value_type.
6938
- * @example 10
7716
+ * The usage threshold amount in cents.
7717
+ * @example 100
6939
7718
  */
6940
- plan_value: number | boolean | string;
7719
+ amount_cents: number;
6941
7720
  /**
6942
- * Value assigned to this subscription specifically. Type depends on the privilege's value_type. Null if no override is set.
6943
- * @example 10
7721
+ * The completion ratio of the usage threshold.
7722
+ * @example 0.5
6944
7723
  */
6945
- override_value: number | boolean | string | null;
6946
- };
6947
- export interface SubscriptionEntitlementObject {
7724
+ completion_ratio: number;
6948
7725
  /**
6949
- * Unique code used to identify the feature. Max 255 characters.
6950
- * @example "seats"
7726
+ * The date and time when the usage threshold was reached. The date and time must be in ISO 8601 format.
7727
+ * @format date-time
7728
+ * @example "2024-01-01T00:00:00Z"
6951
7729
  */
6952
- code: string;
7730
+ reached_at: string | null;
7731
+ }
7732
+ export interface LifetimeUsageObject {
6953
7733
  /**
6954
- * Name of the feature. Max 255 characters.
6955
- * @example "Number of seats"
7734
+ * Unique identifier assigned to the lifetime usage record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the lifetime usage record within the Lago system
7735
+ * @format uuid
7736
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6956
7737
  */
6957
- name: string | null;
7738
+ lago_id: string;
6958
7739
  /**
6959
- * Description of the feature. Max 600 characters.
6960
- * @example "Number of users of the account"
7740
+ * Unique identifier assigned to the subscription record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription record within the Lago system
7741
+ * @format uuid
7742
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
6961
7743
  */
6962
- description: string | null;
7744
+ lago_subscription_id: string;
6963
7745
  /**
6964
- * Privileges associated with this feature. Each privilege shows the plan value and any subscription override.
6965
- * @example [{"code":"max","name":"Maximum","value_type":"integer","config":{},"value":15,"plan_value":10,"override_value":15},{"code":"max_admins","name":"Max Admins","value_type":"integer","config":{},"value":5,"plan_value":5,"override_value":null},{"code":"root","name":"Allow root user","value_type":"boolean","config":{},"value":true,"plan_value":true,"override_value":null},{"code":"provider","name":"SSO Provider","value_type":"select","value":"okta","plan_value":"google","override_value":"okta","config":{"select_options":["google","okta"]}}]
7746
+ * The subscription external unique identifier (provided by your own application).
7747
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
6966
7748
  */
6967
- privileges: SubscriptionEntitlementPrivilegeObject[];
6968
- /** @example {"max":15,"provider":"okta"} */
6969
- overrides: Record<string, any>;
6970
- }
6971
- export interface SubscriptionEntitlements {
6972
- entitlements: SubscriptionEntitlementObject[];
6973
- }
6974
- export interface SubscriptionEntitlement {
6975
- entitlement: SubscriptionEntitlementObject;
6976
- }
6977
- export interface FixedCharges {
6978
- fixed_charges: FixedChargeObject[];
6979
- }
6980
- export interface TaxesPaginated {
6981
- taxes: TaxObject[];
6982
- meta: PaginationMeta;
6983
- }
6984
- export interface TaxBaseInput {
7749
+ external_subscription_id: string;
6985
7750
  /**
6986
- * Name of the tax.
6987
- * @example "TVA"
7751
+ * The historical usage amount in cents for the subscription (provided by your own application).
7752
+ * @example 100
6988
7753
  */
6989
- name?: string;
7754
+ external_historical_usage_amount_cents: number;
6990
7755
  /**
6991
- * Unique code used to identify the tax associated with the API request.
6992
- * @example "french_standard_vat"
7756
+ * The total invoiced usage amount in cents for the subscription.
7757
+ * @example 100
6993
7758
  */
6994
- code?: string;
7759
+ invoiced_usage_amount_cents: number;
6995
7760
  /**
6996
- * The percentage rate of the tax
6997
- * @pattern ^[0-9]+.?[0-9]*$
6998
- * @example "20.0"
7761
+ * The current usage amount in cents for the subscription on the current billing period.
7762
+ * @example 100
6999
7763
  */
7000
- rate?: string;
7764
+ current_usage_amount_cents: number;
7001
7765
  /**
7002
- * Internal description of the taxe
7003
- * @example "French standard VAT"
7766
+ * The recording start date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
7767
+ * @format date-time
7768
+ * @example "2024-01-01T00:00:00Z"
7004
7769
  */
7005
- description?: string | null;
7770
+ from_datetime: string | null;
7006
7771
  /**
7007
- * 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.
7008
- * @deprecated
7009
- * @example true
7772
+ * The recording end date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
7773
+ * @format date-time
7774
+ * @example "2024-12-31T23:59:59Z"
7010
7775
  */
7011
- applied_to_organization?: boolean;
7012
- }
7013
- export interface TaxCreateInput {
7014
- tax: TaxBaseInput;
7015
- }
7016
- export interface Tax {
7017
- tax: TaxObject;
7776
+ to_datetime: string;
7777
+ /** Array of usage thresholds attached to the subscription's plan. */
7778
+ usage_thresholds?: LifetimeUsageThresholdObject[];
7018
7779
  }
7019
- export interface TaxUpdateInput {
7020
- tax: TaxBaseInput;
7780
+ export interface LifetimeUsage {
7781
+ lifetime_usage: LifetimeUsageObject;
7021
7782
  }
7022
- export interface WalletCreateInput {
7023
- wallet?: {
7024
- /**
7025
- * The name of the wallet.
7026
- * @example "Prepaid"
7027
- */
7028
- name?: string | null;
7029
- /**
7030
- * Wallet priority for ordering when a customer has multiple wallets. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
7031
- * @min 1
7032
- * @max 50
7033
- * @example 50
7034
- */
7035
- priority?: number;
7036
- /**
7037
- * The rate of conversion between credits and the amount in the specified currency. It indicates the ratio or factor used to convert credits into the corresponding monetary value in the currency of the transaction.
7038
- * @pattern ^[0-9]+.?[0-9]*$
7039
- * @example "1.5"
7040
- */
7041
- rate_amount: string;
7042
- /**
7043
- * The currency of the wallet.
7044
- * @example "USD"
7045
- */
7046
- currency: Currency;
7047
- /**
7048
- * The number of paid credits. Required only if there is no granted credits.
7049
- * @pattern ^[0-9]+.?[0-9]*$
7050
- * @example "20.0"
7051
- */
7052
- paid_credits?: string | null;
7053
- /**
7054
- * The number of free granted credits. Required only if there is no paid credits.
7055
- * @pattern ^[0-9]+.?[0-9]*$
7056
- * @example "10.0"
7057
- */
7058
- granted_credits?: string | null;
7059
- /**
7060
- * The customer external unique identifier (provided by your own application)
7061
- * @example "hooli_1234"
7062
- */
7063
- external_customer_id: string;
7064
- /**
7065
- * The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
7066
- * @format date-time
7067
- * @example "2022-07-07T23:59:59Z"
7068
- */
7069
- expiration_at?: string | null;
7070
- /**
7071
- * A boolean setting that, when set to true, delays issuing an invoice for a wallet top-up until a successful payment is made; if false, the invoice is issued immediately upon wallet top-up, regardless of the payment status. Default value of false.
7072
- * @example false
7073
- */
7074
- invoice_requires_successful_payment?: boolean;
7075
- /**
7076
- * This optional field allows you to store a list of key-value pairs that provide additional information or custom attributes. These key-value pairs will be included in the metadata of wallet transactions generated during the wallet creation process.
7077
- * @example [{"key":"example_key","value":"example_value"},{"key":"another_key","value":"another_value"}]
7078
- */
7079
- transaction_metadata?: any[] | null;
7783
+ export interface LifetimeUsageInput {
7784
+ lifetime_usage: {
7080
7785
  /**
7081
- * The name of the wallet transactions triggered when creating the wallet. It will appear on the invoice as the label for the fee. If not set, the label on the invoice will fallback to either `Prepaid credits - {{wallet_name}}` if the wallet name is set, or `Prepaid credits`.
7082
- * @example "Tokens for models 'high-fidelity-boost'"
7786
+ * The historical usage amount in cents for the subscription (provided by your own application).
7787
+ * @example 100
7083
7788
  */
7084
- transaction_name?: string | null;
7085
- /** Set wallet limitations to fee types. */
7086
- applies_to?: {
7087
- /**
7088
- * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
7089
- * @example ["charge"]
7090
- */
7091
- fee_types?: any[] | null;
7092
- /**
7093
- * An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
7094
- * @example []
7095
- */
7096
- billable_metric_codes?: any[] | null;
7097
- };
7789
+ external_historical_usage_amount_cents: number;
7790
+ };
7791
+ }
7792
+ export interface AlertCreateInput {
7793
+ alert: AlertBaseInput & {
7098
7794
  /**
7099
- * Minimum amount of cents that can be top-up with a single paid transaction.
7100
- * @example 100
7795
+ * The type of alert.
7796
+ * @example "billable_metric_current_usage_amount"
7101
7797
  */
7102
- paid_top_up_min_amount_cents?: number | null;
7798
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
7103
7799
  /**
7104
- * Maximum amount of cents that can be top-up with a single paid transaction.
7105
- * @example 1000
7800
+ * Unique code used to identify the alert.
7801
+ * @example "storage_threshold_alert"
7106
7802
  */
7107
- paid_top_up_max_amount_cents?: number | null;
7803
+ code: string;
7108
7804
  /**
7109
- * If set to true, the wallet will ignore paid top-up limits on creation.
7110
- * @example false
7805
+ * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
7806
+ * @example "storage_usage"
7111
7807
  */
7112
- ignore_paid_top_up_limits_on_creation?: boolean | null;
7113
- /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
7114
- recurring_transaction_rules?: any[] | null;
7115
- /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
7116
- metadata?: MetadataInput;
7808
+ billable_metric_code?: string | null;
7117
7809
  };
7118
7810
  }
7119
- export interface Wallet {
7120
- wallet: WalletObject;
7121
- }
7122
- export interface WalletUpdateInput {
7123
- wallet: {
7124
- /**
7125
- * The name of the wallet.
7126
- * @example "new_name"
7127
- */
7128
- name?: string | null;
7811
+ export interface AlertBatchCreateInput {
7812
+ /** Array of alerts to create. All alerts are created atomically - if any fail validation, none are created. */
7813
+ alerts: (AlertBaseInput & {
7129
7814
  /**
7130
- * Wallet priority for ordering when a customer has multiple wallets. Allowed values: 1-50, where 1 is highest priority and 50 is lowest. Defaults to 50.
7131
- * @min 1
7132
- * @max 50
7133
- * @example 50
7815
+ * The type of alert.
7816
+ * @example "billable_metric_current_usage_amount"
7134
7817
  */
7135
- priority?: number;
7818
+ alert_type: "current_usage_amount" | "billable_metric_current_usage_amount" | "billable_metric_current_usage_units" | "lifetime_usage_amount";
7136
7819
  /**
7137
- * The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
7138
- * @format date-time
7139
- * @example "2022-07-07T23:59:59Z"
7820
+ * Unique code used to identify the alert.
7821
+ * @example "storage_threshold_alert"
7140
7822
  */
7141
- expiration_at?: string | null;
7823
+ code: string;
7824
+ })[];
7825
+ }
7826
+ export interface AlertUpdateInput {
7827
+ alert: AlertBaseInput & {
7142
7828
  /**
7143
- * A boolean setting that, when set to true, delays issuing an invoice for a wallet top-up until a successful payment is made; if false, the invoice is issued immediately upon wallet top-up, regardless of the payment status. Default value of false.
7144
- * @example false
7829
+ * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
7830
+ * @example "storage_usage"
7145
7831
  */
7146
- invoice_requires_successful_payment?: boolean;
7147
- /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
7148
- recurring_transaction_rules?: {
7149
- /**
7150
- * A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule.
7151
- * @format uuid
7152
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
7153
- */
7154
- lago_id?: string;
7155
- /**
7156
- * The trigger. Possible values are `interval` or `threshold`.
7157
- * @example "interval"
7158
- */
7159
- trigger?: "interval" | "threshold";
7160
- /**
7161
- * The method used for recurring top-up. Possible values are `fixed` or `target`.
7162
- * @example "target"
7163
- */
7164
- method?: "fixed" | "target";
7165
- /**
7166
- * The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: `weekly`, `monthly`, `quarterly`, `semiannual` or `yearly`. Required only when trigger is set to `interval`.
7167
- * @example "monthly"
7168
- */
7169
- interval?: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
7170
- /**
7171
- * The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when trigger is set to `threshold`.
7172
- * @pattern ^[0-9]+.?[0-9]*$
7173
- * @example "20.0"
7174
- */
7175
- threshold_credits?: string;
7176
- /**
7177
- * The number of paid credits. Required only if there is no granted credits.
7178
- * @pattern ^[0-9]+.?[0-9]*$
7179
- * @example "20.0"
7180
- */
7181
- paid_credits?: string | null;
7182
- /**
7183
- * The number of free granted credits. Required only if there is no paid credits.
7184
- * @pattern ^[0-9]+.?[0-9]*$
7185
- * @example "10.0"
7186
- */
7187
- granted_credits?: string | null;
7188
- /**
7189
- * The effective start date for recurring top-ups. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
7190
- * @format date-time
7191
- * @example "2022-08-08T00:00:00Z"
7192
- */
7193
- started_at?: string | null;
7194
- /**
7195
- * The expiration date and time for this specific recurring transaction rule. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
7196
- * @format date-time
7197
- * @example "2023-09-30T23:59:59Z"
7198
- */
7199
- expiration_at?: string | null;
7200
- /**
7201
- * The target ongoing balance is the value set for the ongoing balance to be reached by the automatic top-up. Required only when trigger is set to `target`.
7202
- * @pattern ^[0-9]+.?[0-9]*$
7203
- * @example "200.0"
7204
- */
7205
- target_ongoing_balance?: string;
7206
- /**
7207
- * A boolean setting that, when set to true, delays issuing an invoice for a wallet top-up until a successful payment is made; if false, the invoice is issued immediately upon wallet top-up, regardless of the payment status. Default value of false.
7208
- * @example false
7209
- */
7210
- invoice_requires_successful_payment?: boolean;
7211
- /**
7212
- * This optional field allows you to store a list of key-value pairs containing additional information or custom attributes. These key-value pairs will populate the metadata of the wallet transactions triggered by this rule.
7213
- * @example [{"key":"example_key","value":"example_value"},{"key":"another_key","value":"another_value"}]
7214
- */
7215
- transaction_metadata?: {
7216
- /** The unique identifier for the attribute. */
7217
- key?: string;
7218
- /** The value associated with the key. */
7219
- value?: string;
7220
- }[];
7221
- /**
7222
- * The name of the wallet transactions triggered by this rule. It will appear on the invoice as the label for the fee. If not set, the label on the invoice will fallback to either `Prepaid credits - {{wallet_name}}` if the wallet name is set, or `Prepaid credits`.
7223
- * @example "Tokens for models 'high-fidelity-boost'"
7224
- */
7225
- transaction_name?: string | null;
7226
- }[];
7227
- /** Set wallet limitations to fee types. */
7228
- applies_to?: {
7229
- /**
7230
- * An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
7231
- * @example ["charge"]
7232
- */
7233
- fee_types?: any[] | null;
7234
- /**
7235
- * An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
7236
- * @example []
7237
- */
7238
- billable_metric_codes?: any[] | null;
7239
- };
7240
- /** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
7241
- metadata?: MetadataInput;
7832
+ billable_metric_code?: string | null;
7242
7833
  };
7243
7834
  }
7244
- export interface WalletMetadataResponse {
7835
+ export type SubscriptionEntitlementPrivilegeObject = FeaturePrivilegeObject & {
7245
7836
  /**
7246
- * Custom metadata stored as key-value pairs.
7247
- * Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
7837
+ * Applicable value this this subscription (override_value if set, plan_value otherwise). Type depends on the privilege's value_type.
7838
+ * @example 10
7248
7839
  */
7249
- metadata: MetadataObject;
7840
+ value: number | boolean | string;
7841
+ /**
7842
+ * Value assigned to this privilege in the plan. Type depends on the privilege's value_type.
7843
+ * @example 10
7844
+ */
7845
+ plan_value: number | boolean | string;
7846
+ /**
7847
+ * Value assigned to this subscription specifically. Type depends on the privilege's value_type. Null if no override is set.
7848
+ * @example 10
7849
+ */
7850
+ override_value: number | boolean | string | null;
7851
+ };
7852
+ export interface SubscriptionEntitlementObject {
7853
+ /**
7854
+ * Unique code used to identify the feature. Max 255 characters.
7855
+ * @example "seats"
7856
+ */
7857
+ code: string;
7858
+ /**
7859
+ * Name of the feature. Max 255 characters.
7860
+ * @example "Number of seats"
7861
+ */
7862
+ name: string | null;
7863
+ /**
7864
+ * Description of the feature. Max 600 characters.
7865
+ * @example "Number of users of the account"
7866
+ */
7867
+ description: string | null;
7868
+ /**
7869
+ * Privileges associated with this feature. Each privilege shows the plan value and any subscription override.
7870
+ * @example [{"code":"max","name":"Maximum","value_type":"integer","config":{},"value":15,"plan_value":10,"override_value":15},{"code":"max_admins","name":"Max Admins","value_type":"integer","config":{},"value":5,"plan_value":5,"override_value":null},{"code":"root","name":"Allow root user","value_type":"boolean","config":{},"value":true,"plan_value":true,"override_value":null},{"code":"provider","name":"SSO Provider","value_type":"select","value":"okta","plan_value":"google","override_value":"okta","config":{"select_options":["google","okta"]}}]
7871
+ */
7872
+ privileges: SubscriptionEntitlementPrivilegeObject[];
7873
+ /** @example {"max":15,"provider":"okta"} */
7874
+ overrides: Record<string, any>;
7875
+ }
7876
+ export interface SubscriptionEntitlements {
7877
+ entitlements: SubscriptionEntitlementObject[];
7878
+ }
7879
+ export interface SubscriptionEntitlement {
7880
+ entitlement: SubscriptionEntitlementObject;
7881
+ }
7882
+ export interface SubscriptionChargeOverride {
7883
+ /** Properties of a charge that can be overridden at the subscription level. */
7884
+ charge: ChargeOverridableInput;
7885
+ }
7886
+ export interface SubscriptionFixedChargeOverride {
7887
+ /** Properties of a fixed charge that can be overridden at the subscription level. */
7888
+ fixed_charge: FixedChargeOverridableInput;
7889
+ }
7890
+ export interface TaxesPaginated {
7891
+ taxes: TaxObject[];
7892
+ meta: PaginationMeta;
7893
+ }
7894
+ export interface TaxBaseInput {
7895
+ /**
7896
+ * Name of the tax.
7897
+ * @example "TVA"
7898
+ */
7899
+ name?: string;
7900
+ /**
7901
+ * Unique code used to identify the tax associated with the API request.
7902
+ * @example "french_standard_vat"
7903
+ */
7904
+ code?: string;
7905
+ /**
7906
+ * The percentage rate of the tax
7907
+ * @pattern ^[0-9]+.?[0-9]*$
7908
+ * @example "20.0"
7909
+ */
7910
+ rate?: string;
7911
+ /**
7912
+ * Internal description of the taxe
7913
+ * @example "French standard VAT"
7914
+ */
7915
+ description?: string | null;
7916
+ /**
7917
+ * 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.
7918
+ * @deprecated
7919
+ * @example true
7920
+ */
7921
+ applied_to_organization?: boolean;
7922
+ }
7923
+ export interface TaxCreateInput {
7924
+ tax: TaxBaseInput;
7925
+ }
7926
+ export interface Tax {
7927
+ tax: TaxObject;
7928
+ }
7929
+ export interface TaxUpdateInput {
7930
+ tax: TaxBaseInput;
7250
7931
  }
7251
7932
  export interface WalletTransactionCreateInput {
7252
7933
  wallet_transaction: {
@@ -7291,6 +7972,10 @@ export interface WalletTransactionCreateInput {
7291
7972
  * @example false
7292
7973
  */
7293
7974
  ignore_paid_top_up_limits?: boolean;
7975
+ /** Configuration for invoice custom sections to apply to invoices generated by this resource. */
7976
+ invoice_custom_section?: InvoiceCustomSectionInput;
7977
+ /** Optional payment method to use for processing the wallet transaction payment. */
7978
+ payment_method?: PaymentMethodReference;
7294
7979
  /**
7295
7980
  * This optional field allows you to store a list of key-value pairs that hold additional information or custom attributes related to the data.
7296
7981
  * @example [{"key":"example key","value":"example value"},{"key":"another key","value":"another value"}]
@@ -7311,6 +7996,12 @@ export interface WalletTransactionObject {
7311
7996
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
7312
7997
  */
7313
7998
  lago_wallet_id: string;
7999
+ /**
8000
+ * Unique identifier of the invoice that was voided and triggered the creation of this inbound wallet transaction. Only present for inbound transactions on traceable wallets that were created as a result of an invoice void.
8001
+ * @format uuid
8002
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8003
+ */
8004
+ lago_voided_invoice_id?: string | null;
7314
8005
  /**
7315
8006
  * The status of the wallet transaction. Possible values are `pending`, `settled` or `failed`.
7316
8007
  * @example "settled"
@@ -7358,6 +8049,17 @@ export interface WalletTransactionObject {
7358
8049
  /** The value associated with the key. */
7359
8050
  value?: string;
7360
8051
  }[];
8052
+ /**
8053
+ * The remaining unconsumed amount of an inbound wallet transaction, expressed in cents. Only present for inbound transactions on traceable wallets. Tracks how much of the original credited amount has not yet been consumed by outbound transactions.
8054
+ * @example 5000
8055
+ */
8056
+ remaining_amount_cents?: number | null;
8057
+ /**
8058
+ * The remaining unconsumed amount of an inbound wallet transaction, expressed in credits. Only present for inbound transactions on traceable wallets.
8059
+ * @pattern ^[0-9]+.?[0-9]*$
8060
+ * @example "5.0"
8061
+ */
8062
+ remaining_credit_amount?: string | null;
7361
8063
  /**
7362
8064
  * The date when wallet transaction is settled, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
7363
8065
  * @format date-time
@@ -7381,6 +8083,10 @@ export interface WalletTransactionObject {
7381
8083
  * @example "Tokens for models 'high-fidelity-boost'"
7382
8084
  */
7383
8085
  name: string | null;
8086
+ /** The invoice custom sections applied to invoices generated by this wallet transaction. */
8087
+ applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
8088
+ /** The payment method assigned to this wallet transaction for processing the payment. */
8089
+ payment_method?: PaymentMethodReference;
7384
8090
  }
7385
8091
  export interface WalletTransactions {
7386
8092
  wallet_transactions: WalletTransactionObject[];
@@ -7415,6 +8121,70 @@ export interface WalletTransactionPaymentUrl {
7415
8121
  payment_url?: string;
7416
8122
  };
7417
8123
  }
8124
+ export interface WalletTransactionConsumptionObject {
8125
+ /**
8126
+ * Unique identifier assigned to the wallet transaction consumption within the Lago application.
8127
+ * @format uuid
8128
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8129
+ */
8130
+ lago_id: string;
8131
+ /**
8132
+ * The amount consumed from the inbound wallet transaction, expressed in cents.
8133
+ * @example 5000
8134
+ */
8135
+ amount_cents: number;
8136
+ /**
8137
+ * The amount consumed from the inbound wallet transaction, expressed in credits.
8138
+ * @pattern ^[0-9]+.?[0-9]*$
8139
+ * @example "5.0"
8140
+ */
8141
+ credit_amount: string;
8142
+ /**
8143
+ * The date of the consumption record creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
8144
+ * @format date-time
8145
+ * @example "2022-04-29T08:59:51Z"
8146
+ */
8147
+ created_at: string;
8148
+ wallet_transaction: WalletTransactionObject;
8149
+ }
8150
+ export interface WalletTransactionConsumptions {
8151
+ wallet_transaction_consumptions: WalletTransactionConsumptionObject[];
8152
+ }
8153
+ export type WalletTransactionConsumptionsPaginated = WalletTransactionConsumptions & {
8154
+ meta: PaginationMeta;
8155
+ };
8156
+ export interface WalletTransactionFundingObject {
8157
+ /**
8158
+ * Unique identifier assigned to the wallet transaction funding within the Lago application.
8159
+ * @format uuid
8160
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
8161
+ */
8162
+ lago_id: string;
8163
+ /**
8164
+ * The amount funded from the inbound wallet transaction, expressed in cents.
8165
+ * @example 5000
8166
+ */
8167
+ amount_cents: number;
8168
+ /**
8169
+ * The amount funded from the inbound wallet transaction, expressed in credits.
8170
+ * @pattern ^[0-9]+.?[0-9]*$
8171
+ * @example "5.0"
8172
+ */
8173
+ credit_amount: string;
8174
+ /**
8175
+ * The date of the funding record creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
8176
+ * @format date-time
8177
+ * @example "2022-04-29T08:59:51Z"
8178
+ */
8179
+ created_at: string;
8180
+ wallet_transaction: WalletTransactionObject;
8181
+ }
8182
+ export interface WalletTransactionFundings {
8183
+ wallet_transaction_fundings: WalletTransactionFundingObject[];
8184
+ }
8185
+ export type WalletTransactionFundingsPaginated = WalletTransactionFundings & {
8186
+ meta: PaginationMeta;
8187
+ };
7418
8188
  export type WalletTransactionsPaginated = WalletTransactions & {
7419
8189
  meta: PaginationMeta;
7420
8190
  };
@@ -7513,6 +8283,11 @@ export interface TriggeredAlertObject {
7513
8283
  * @example "sub_1234567890"
7514
8284
  */
7515
8285
  external_subscription_id: string;
8286
+ /**
8287
+ * The customer external unique identifier (provided by your own application).
8288
+ * @example "cust_1234567890"
8289
+ */
8290
+ external_customer_id: string;
7516
8291
  /**
7517
8292
  * The code of the billable metric associated with the alert. Only for alerts based on a billable metric.
7518
8293
  * @example "storage_usage"
@@ -7633,9 +8408,6 @@ export type CustomerViesCheckObject = CustomerBaseObject & {
7633
8408
  valid?: boolean;
7634
8409
  };
7635
8410
  };
7636
- export type CreditNoteExtendedObject = CreditNoteObject & {
7637
- customer?: CustomerBaseObject;
7638
- };
7639
8411
  export interface CreditNotePaymentProviderRefundError {
7640
8412
  /**
7641
8413
  * Unique identifier assigned to the credit note within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit note record within the Lago system.
@@ -7745,6 +8517,9 @@ export interface FeeTaxProviderErrorObject {
7745
8517
  event_transaction_id: string | null;
7746
8518
  provider_error: string | Record<string, any>;
7747
8519
  }
8520
+ export type InvoicePaymentDisputeLostObject = InvoiceObjectExtended & {
8521
+ provider_error?: string | Record<string, any>;
8522
+ };
7748
8523
  export interface InvoicePaymentFailureObject {
7749
8524
  /**
7750
8525
  * 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.
@@ -7876,6 +8651,8 @@ export type SubscriptionWithThresholdObject = SubscriptionObject & {
7876
8651
  plan: PlanObject;
7877
8652
  customer: CustomerObject;
7878
8653
  usage_threshold: UsageThresholdObject;
8654
+ /** List of usage thresholds applicable to this subscription. */
8655
+ applicable_usage_thresholds?: ApplicableUsageThreshold[];
7879
8656
  };
7880
8657
  export type WalletTransactionObjectExtended = WalletTransactionObject & {
7881
8658
  wallet?: WalletObject;
@@ -7976,8 +8753,8 @@ export declare class HttpClient<SecurityDataType = unknown> {
7976
8753
  }
7977
8754
  /**
7978
8755
  * @title Lago API documentation
7979
- * @version 1.40.0
7980
- * @license AGPLv3
8756
+ * @version 1.44.0
8757
+ * @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
7981
8758
  * @baseUrl https://api.getlago.com/api/v1
7982
8759
  * @externalDocs https://github.com/getlago
7983
8760
  * @contact <tech@getlago.com>
@@ -8680,7 +9457,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8680
9457
  * @request POST:/credit_notes
8681
9458
  * @secure
8682
9459
  */
8683
- createCreditNote: (data: CreditNoteCreateInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
9460
+ createCreditNote: (data: CreditNoteCreateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteExtended, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
8684
9461
  /**
8685
9462
  * @description This endpoint list all existing credit notes.
8686
9463
  *
@@ -8769,7 +9546,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8769
9546
  * @request PUT:/credit_notes/{lago_id}
8770
9547
  * @secure
8771
9548
  */
8772
- updateCreditNote: (lagoId: string, data: CreditNoteUpdateInput, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
9549
+ updateCreditNote: (lagoId: string, data: CreditNoteUpdateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteExtended, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8773
9550
  /**
8774
9551
  * @description This endpoint retrieves an existing credit note.
8775
9552
  *
@@ -8779,7 +9556,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8779
9556
  * @request GET:/credit_notes/{lago_id}
8780
9557
  * @secure
8781
9558
  */
8782
- findCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotFound>>;
9559
+ findCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNoteExtended, ApiErrorUnauthorized | ApiErrorNotFound>>;
8783
9560
  /**
8784
9561
  * @description This endpoint downloads the PDF of an existing credit note.
8785
9562
  *
@@ -8809,7 +9586,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8809
9586
  * @request PUT:/credit_notes/{lago_id}/void
8810
9587
  * @secure
8811
9588
  */
8812
- voidCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
9589
+ voidCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNoteExtended, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
8813
9590
  /**
8814
9591
  * @description This endpoint replaces all existing metadata on a credit note with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
8815
9592
  *
@@ -9239,10 +10016,20 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9239
10016
  */
9240
10017
  "status[]"?: ("pending" | "canceled" | "terminated" | "active")[];
9241
10018
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
10019
+ /**
10020
+ * @description This endpoint is used to create a wallet with prepaid credits.
10021
+ *
10022
+ * @tags wallets
10023
+ * @name CreateCustomerWallet
10024
+ * @summary Create a wallet
10025
+ * @request POST:/customers/{external_customer_id}/wallets
10026
+ * @secure
10027
+ */
10028
+ createCustomerWallet: (externalCustomerId: string, data: WalletCreateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
9242
10029
  /**
9243
10030
  * @description This endpoint is used to list all wallets with prepaid credits of a customer
9244
10031
  *
9245
- * @tags customers, wallets
10032
+ * @tags wallets
9246
10033
  * @name FindAllCustomerWallets
9247
10034
  * @summary List all customer's wallets
9248
10035
  * @request GET:/customers/{external_customer_id}/wallets
@@ -9260,6 +10047,136 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9260
10047
  */
9261
10048
  per_page?: number;
9262
10049
  }, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
10050
+ /**
10051
+ * @description This endpoint is used to update an existing wallet with prepaid credits.
10052
+ *
10053
+ * @tags wallets
10054
+ * @name UpdateCustomerWallet
10055
+ * @summary Update a wallet
10056
+ * @request PUT:/customers/{external_customer_id}/wallets/{code}
10057
+ * @secure
10058
+ */
10059
+ updateCustomerWallet: (externalCustomerId: string, code: string, data: WalletUpdateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
10060
+ /**
10061
+ * @description This endpoint is used to retrieve an existing wallet with prepaid credits.
10062
+ *
10063
+ * @tags wallets
10064
+ * @name FindCustomerWallet
10065
+ * @summary Retrieve a wallet
10066
+ * @request GET:/customers/{external_customer_id}/wallets/{code}
10067
+ * @secure
10068
+ */
10069
+ findCustomerWallet: (externalCustomerId: string, code: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
10070
+ /**
10071
+ * @description This endpoint is used to terminate an existing wallet with prepaid credits.
10072
+ *
10073
+ * @tags wallets
10074
+ * @name DestroyCustomerWallet
10075
+ * @summary Terminate a wallet
10076
+ * @request DELETE:/customers/{external_customer_id}/wallets/{code}
10077
+ * @secure
10078
+ */
10079
+ destroyCustomerWallet: (externalCustomerId: string, code: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
10080
+ /**
10081
+ * @description This endpoint replaces all existing metadata on a wallet with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
10082
+ *
10083
+ * @tags wallets
10084
+ * @name ReplaceCustomerWalletMetadata
10085
+ * @summary Replace wallet metadata
10086
+ * @request POST:/customers/{external_customer_id}/wallets/{wallet_code}/metadata
10087
+ * @secure
10088
+ */
10089
+ replaceCustomerWalletMetadata: (externalCustomerId: string, walletCode: string, data: WalletMetadataResponse, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10090
+ /**
10091
+ * @description This endpoint merges the provided metadata with existing metadata on the wallet. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
10092
+ *
10093
+ * @tags wallets
10094
+ * @name MergeCustomerWalletMetadata
10095
+ * @summary Merge wallet metadata
10096
+ * @request PATCH:/customers/{external_customer_id}/wallets/{wallet_code}/metadata
10097
+ * @secure
10098
+ */
10099
+ mergeCustomerWalletMetadata: (externalCustomerId: string, walletCode: string, data: WalletMetadataResponse, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10100
+ /**
10101
+ * @description This endpoint removes all metadata from a wallet.
10102
+ *
10103
+ * @tags wallets
10104
+ * @name DeleteAllCustomerWalletMetadata
10105
+ * @summary Delete all wallet metadata
10106
+ * @request DELETE:/customers/{external_customer_id}/wallets/{wallet_code}/metadata
10107
+ * @secure
10108
+ */
10109
+ deleteAllCustomerWalletMetadata: (externalCustomerId: string, walletCode: string, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
10110
+ /**
10111
+ * @description This endpoint removes a single metadata key from a wallet.
10112
+ *
10113
+ * @tags wallets
10114
+ * @name DeleteCustomerWalletMetadataKey
10115
+ * @summary Delete a metadata key
10116
+ * @request DELETE:/customers/{external_customer_id}/wallets/{wallet_code}/metadata/{key}
10117
+ * @secure
10118
+ */
10119
+ deleteCustomerWalletMetadataKey: (externalCustomerId: string, walletCode: string, key: string, params?: RequestParams) => Promise<HttpResponse<WalletMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
10120
+ /**
10121
+ * @description This endpoint enables the retrieval of all alerts for a wallet.
10122
+ *
10123
+ * @tags wallets
10124
+ * @name GetCustomerWalletAlerts
10125
+ * @summary List wallet alerts
10126
+ * @request GET:/customers/{external_customer_id}/wallets/{wallet_code}/alerts
10127
+ * @secure
10128
+ */
10129
+ getCustomerWalletAlerts: (externalCustomerId: string, walletCode: string, params?: RequestParams) => Promise<HttpResponse<Alerts, ApiErrorUnauthorized | ApiErrorNotFound>>;
10130
+ /**
10131
+ * @description This endpoint allows you to create new alerts for a wallet. Send a single alert object wrapped in `alert` key to create one alert, or an array of alert objects wrapped in `alerts` key to create multiple alerts atomically.
10132
+ *
10133
+ * @tags wallets
10134
+ * @name CreateCustomerWalletAlert
10135
+ * @summary Create wallet alert(s)
10136
+ * @request POST:/customers/{external_customer_id}/wallets/{wallet_code}/alerts
10137
+ * @secure
10138
+ */
10139
+ createCustomerWalletAlert: (externalCustomerId: string, walletCode: string, data: WalletAlertCreateInput | WalletAlertBatchCreateInput, params?: RequestParams) => Promise<HttpResponse<Alerts | Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10140
+ /**
10141
+ * @description This endpoint allows you to delete all alerts for a wallet.
10142
+ *
10143
+ * @tags wallets
10144
+ * @name DeleteAllCustomerWalletAlerts
10145
+ * @summary Delete all wallet alerts
10146
+ * @request DELETE:/customers/{external_customer_id}/wallets/{wallet_code}/alerts
10147
+ * @secure
10148
+ */
10149
+ deleteAllCustomerWalletAlerts: (externalCustomerId: string, walletCode: string, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotFound>>;
10150
+ /**
10151
+ * @description This endpoint enables the retrieval of a specific alert for a wallet.
10152
+ *
10153
+ * @tags wallets
10154
+ * @name GetCustomerWalletAlert
10155
+ * @summary Retrieve a wallet alert
10156
+ * @request GET:/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}
10157
+ * @secure
10158
+ */
10159
+ getCustomerWalletAlert: (externalCustomerId: string, walletCode: string, code: string, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
10160
+ /**
10161
+ * @description This endpoint allows you to update an existing alert for a wallet.
10162
+ *
10163
+ * @tags wallets
10164
+ * @name UpdateCustomerWalletAlert
10165
+ * @summary Update a wallet alert
10166
+ * @request PUT:/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}
10167
+ * @secure
10168
+ */
10169
+ updateCustomerWalletAlert: (externalCustomerId: string, walletCode: string, code: string, data: WalletAlertUpdateInput, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10170
+ /**
10171
+ * @description This endpoint allows you to delete an existing alert for a wallet.
10172
+ *
10173
+ * @tags wallets
10174
+ * @name DeleteCustomerWalletAlert
10175
+ * @summary Delete a wallet alert
10176
+ * @request DELETE:/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}
10177
+ * @secure
10178
+ */
10179
+ deleteCustomerWalletAlert: (externalCustomerId: string, walletCode: string, code: string, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
9263
10180
  /**
9264
10181
  * @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period.
9265
10182
  *
@@ -9281,6 +10198,28 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9281
10198
  * @example true
9282
10199
  */
9283
10200
  apply_taxes?: boolean;
10201
+ /**
10202
+ * Filter usage to a specific charge by its Lago ID (UUID).
10203
+ * @format uuid
10204
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
10205
+ */
10206
+ filter_by_charge_id?: string;
10207
+ /**
10208
+ * Filter usage to a specific charge by its code.
10209
+ * @example "storage"
10210
+ */
10211
+ filter_by_charge_code?: string;
10212
+ /**
10213
+ * Filter usage by pricing group. Pass key/value pairs as query parameters, e.g. `filter_by_group[cloud]=aws`.
10214
+ * @example {"cloud":"aws"}
10215
+ */
10216
+ filter_by_group?: Record<string, string>;
10217
+ /**
10218
+ * When `true`, returns usage since subscription start instead of the current billing period. Requires either `filter_by_charge_id`, `filter_by_charge_code`, or `filter_by_group` to be set.
10219
+ * @default false
10220
+ * @example true
10221
+ */
10222
+ full_usage?: boolean;
9284
10223
  }, params?: RequestParams) => Promise<HttpResponse<CustomerUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
9285
10224
  /**
9286
10225
  * @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period. It also returns the projected usage for the current period based on the current usage.
@@ -9350,6 +10289,47 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9350
10289
  * @secure
9351
10290
  */
9352
10291
  generateCustomerCheckoutUrl: (externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<CustomerCheckoutUrl, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
10292
+ /**
10293
+ * @description This endpoint retrieves all payment methods of a Customer.
10294
+ *
10295
+ * @tags payment_methods
10296
+ * @name FindAllCustomersPaymentMethods
10297
+ * @summary List all customer payment methods
10298
+ * @request GET:/customers/{external_customer_id}/payment_methods
10299
+ * @secure
10300
+ */
10301
+ findAllCustomersPaymentMethods: (externalCustomerId: string, query?: {
10302
+ /**
10303
+ * Page number.
10304
+ * @example 1
10305
+ */
10306
+ page?: number;
10307
+ /**
10308
+ * Number of records per page.
10309
+ * @example 20
10310
+ */
10311
+ per_page?: number;
10312
+ }, params?: RequestParams) => Promise<HttpResponse<PaymentMethodsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
10313
+ /**
10314
+ * @description Use the payment method as default when not selected a payment method
10315
+ *
10316
+ * @tags payment_methods
10317
+ * @name PaymentMethodSetAsDefault
10318
+ * @summary Set the payment method as default
10319
+ * @request PUT:/customers/{external_customer_id}/payment_methods/{lago_id}/set_as_default
10320
+ * @secure
10321
+ */
10322
+ paymentMethodSetAsDefault: (lagoId: string, externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<PaymentMethod, ApiErrorUnauthorized | ApiErrorNotFound>>;
10323
+ /**
10324
+ * @description This endpoint deletes a specific payment method for a customer.
10325
+ *
10326
+ * @tags payment_methods
10327
+ * @name DestroyPaymentMethod
10328
+ * @summary Delete a payment method
10329
+ * @request DELETE:/customers/{external_customer_id}/payment_methods/{lago_id}
10330
+ * @secure
10331
+ */
10332
+ destroyPaymentMethod: (lagoId: string, externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<PaymentMethod, ApiErrorUnauthorized | ApiErrorNotFound>>;
9353
10333
  };
9354
10334
  events: {
9355
10335
  /**
@@ -9793,7 +10773,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9793
10773
  * @request POST:/invoices/{lago_id}/retry_payment
9794
10774
  * @secure
9795
10775
  */
9796
- retryPayment: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
10776
+ retryPayment: (lagoId: string, data?: {
10777
+ /** Reference to a specific payment method for processing the payment. */
10778
+ payment_method?: PaymentMethodReference;
10779
+ }, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
9797
10780
  /**
9798
10781
  * @description This endpoint is used for voiding an invoice. • When no body parameters are provided, the invoice can be voided only if it is in a `finalized` status and its payment status is NOT `succeeded`. • When `generate_credit_note` is provided (optionally with `refund_amount` and/or `credit_amount`), this validation is bypassed: the invoice is forcibly voided and a credit note is generated. If the specified refund/credit amounts do not cover the full invoice total, the remainder is issued on a second credit note that is created and immediately voided.
9799
10782
  *
@@ -10047,83 +11030,266 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10047
11030
  /**
10048
11031
  * @description This accepts a list of entitlements to update. If the feature isn't part of the plan yet, it's added with all the privileges from the payload. If the feature is already part of the plan, the privilege and values are updated or added. All privileges must be valid for the feature. All features and privileges not part of the payload are left untouched. To remove privileges or features, use the DELETE endpoints.
10049
11032
  *
10050
- * @tags entitlements
10051
- * @name UpdateEntitlement
10052
- * @summary Partial update of an entitlement
10053
- * @request PATCH:/plans/{code}/entitlements
11033
+ * @tags entitlements
11034
+ * @name UpdateEntitlement
11035
+ * @summary Partial update of an entitlement
11036
+ * @request PATCH:/plans/{code}/entitlements
11037
+ * @secure
11038
+ */
11039
+ updateEntitlement: (code: string, data: EntitlementUpdateInput, params?: RequestParams) => Promise<HttpResponse<PlanEntitlements, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11040
+ /**
11041
+ * @description This endpoint retrieves a specific entitlement for a plan.
11042
+ *
11043
+ * @tags entitlements
11044
+ * @name FindEntitlement
11045
+ * @summary Retrieve an entitlement
11046
+ * @request GET:/plans/{code}/entitlements/{feature_code}
11047
+ * @secure
11048
+ */
11049
+ findEntitlement: (code: string, featureCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
11050
+ /**
11051
+ * @description This endpoint deletes an existing entitlement by removing the feature from the plan.
11052
+ *
11053
+ * @tags entitlements
11054
+ * @name DestroyEntitlement
11055
+ * @summary Delete an entitlement
11056
+ * @request DELETE:/plans/{code}/entitlements/{feature_code}
11057
+ * @secure
11058
+ */
11059
+ destroyEntitlement: (code: string, featureCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
11060
+ /**
11061
+ * @description This endpoint removes a specific privilege and its value from an entitlement. The privilege remains untouched on the original feature.
11062
+ *
11063
+ * @tags entitlements
11064
+ * @name RemoveEntitlementPrivilege
11065
+ * @summary Remove a privilege from an entitlement
11066
+ * @request DELETE:/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code}
11067
+ * @secure
11068
+ */
11069
+ removeEntitlementPrivilege: (code: string, featureCode: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
11070
+ /**
11071
+ * @description This endpoint replaces all existing metadata on a plan with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
11072
+ *
11073
+ * @tags plans
11074
+ * @name ReplacePlanMetadata
11075
+ * @summary Replace plan metadata
11076
+ * @request POST:/plans/{code}/metadata
11077
+ * @secure
11078
+ */
11079
+ replacePlanMetadata: (code: string, data: PlanMetadataResponse, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
11080
+ /**
11081
+ * @description This endpoint merges the provided metadata with existing metadata on the plan. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
11082
+ *
11083
+ * @tags plans
11084
+ * @name MergePlanMetadata
11085
+ * @summary Merge plan metadata
11086
+ * @request PATCH:/plans/{code}/metadata
11087
+ * @secure
11088
+ */
11089
+ mergePlanMetadata: (code: string, data: PlanMetadataResponse, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
11090
+ /**
11091
+ * @description This endpoint removes all metadata from a plan.
11092
+ *
11093
+ * @tags plans
11094
+ * @name DeleteAllPlanMetadata
11095
+ * @summary Delete all plan metadata
11096
+ * @request DELETE:/plans/{code}/metadata
11097
+ * @secure
11098
+ */
11099
+ deleteAllPlanMetadata: (code: string, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
11100
+ /**
11101
+ * @description This endpoint removes a single metadata key from a plan.
11102
+ *
11103
+ * @tags plans
11104
+ * @name DeletePlanMetadataKey
11105
+ * @summary Delete a metadata key
11106
+ * @request DELETE:/plans/{code}/metadata/{key}
11107
+ * @secure
11108
+ */
11109
+ deletePlanMetadataKey: (code: string, key: string, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
11110
+ /**
11111
+ * @description This endpoint creates a new charge for a specific plan.
11112
+ *
11113
+ * @tags plans
11114
+ * @name CreatePlanCharge
11115
+ * @summary Create a charge
11116
+ * @request POST:/plans/{code}/charges
11117
+ * @secure
11118
+ */
11119
+ createPlanCharge: (code: string, data: ChargeCreateInput, params?: RequestParams) => Promise<HttpResponse<Charge, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11120
+ /**
11121
+ * @description This endpoint retrieves all charges for a specific plan.
11122
+ *
11123
+ * @tags plans
11124
+ * @name FindAllPlanCharges
11125
+ * @summary List all charges for a plan
11126
+ * @request GET:/plans/{code}/charges
11127
+ * @secure
11128
+ */
11129
+ findAllPlanCharges: (code: string, query?: {
11130
+ /**
11131
+ * Page number.
11132
+ * @example 1
11133
+ */
11134
+ page?: number;
11135
+ /**
11136
+ * Number of records per page.
11137
+ * @example 20
11138
+ */
11139
+ per_page?: number;
11140
+ }, params?: RequestParams) => Promise<HttpResponse<ChargesPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
11141
+ /**
11142
+ * @description This endpoint retrieves a specific charge for a plan.
11143
+ *
11144
+ * @tags plans
11145
+ * @name FindPlanCharge
11146
+ * @summary Retrieve a charge
11147
+ * @request GET:/plans/{code}/charges/{charge_code}
11148
+ * @secure
11149
+ */
11150
+ findPlanCharge: (code: string, chargeCode: string, params?: RequestParams) => Promise<HttpResponse<Charge, ApiErrorUnauthorized | ApiErrorNotFound>>;
11151
+ /**
11152
+ * @description This endpoint updates a specific charge for a plan.
11153
+ *
11154
+ * @tags plans
11155
+ * @name UpdatePlanCharge
11156
+ * @summary Update a charge
11157
+ * @request PUT:/plans/{code}/charges/{charge_code}
11158
+ * @secure
11159
+ */
11160
+ updatePlanCharge: (code: string, chargeCode: string, data: ChargeUpdateInput, params?: RequestParams) => Promise<HttpResponse<Charge, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11161
+ /**
11162
+ * @description This endpoint deletes a specific charge from a plan.
11163
+ *
11164
+ * @tags plans
11165
+ * @name DestroyPlanCharge
11166
+ * @summary Delete a charge
11167
+ * @request DELETE:/plans/{code}/charges/{charge_code}
11168
+ * @secure
11169
+ */
11170
+ destroyPlanCharge: (code: string, chargeCode: string, data: ChargeDeleteInput, params?: RequestParams) => Promise<HttpResponse<Charge, ApiErrorUnauthorized | ApiErrorNotFound>>;
11171
+ /**
11172
+ * @description This endpoint creates a new filter for a specific charge.
11173
+ *
11174
+ * @tags plans
11175
+ * @name CreatePlanChargeFilter
11176
+ * @summary Create a charge filter
11177
+ * @request POST:/plans/{code}/charges/{charge_code}/filters
11178
+ * @secure
11179
+ */
11180
+ createPlanChargeFilter: (code: string, chargeCode: string, data: ChargeFilterCreateInput, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11181
+ /**
11182
+ * @description This endpoint retrieves all filters for a specific charge.
11183
+ *
11184
+ * @tags plans
11185
+ * @name FindAllPlanChargeFilters
11186
+ * @summary List all filters for a charge
11187
+ * @request GET:/plans/{code}/charges/{charge_code}/filters
11188
+ * @secure
11189
+ */
11190
+ findAllPlanChargeFilters: (code: string, chargeCode: string, query?: {
11191
+ /**
11192
+ * Page number.
11193
+ * @example 1
11194
+ */
11195
+ page?: number;
11196
+ /**
11197
+ * Number of records per page.
11198
+ * @example 20
11199
+ */
11200
+ per_page?: number;
11201
+ }, params?: RequestParams) => Promise<HttpResponse<ChargeFiltersPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
11202
+ /**
11203
+ * @description This endpoint retrieves a specific filter for a charge.
11204
+ *
11205
+ * @tags plans
11206
+ * @name FindPlanChargeFilter
11207
+ * @summary Retrieve a charge filter
11208
+ * @request GET:/plans/{code}/charges/{charge_code}/filters/{filter_id}
10054
11209
  * @secure
10055
11210
  */
10056
- updateEntitlement: (code: string, data: EntitlementUpdateInput, params?: RequestParams) => Promise<HttpResponse<PlanEntitlements, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11211
+ findPlanChargeFilter: (code: string, chargeCode: string, filterId: string, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
10057
11212
  /**
10058
- * @description This endpoint retrieves a specific entitlement for a plan.
11213
+ * @description This endpoint updates a specific filter for a charge.
10059
11214
  *
10060
- * @tags entitlements
10061
- * @name FindEntitlement
10062
- * @summary Retrieve an entitlement
10063
- * @request GET:/plans/{code}/entitlements/{feature_code}
11215
+ * @tags plans
11216
+ * @name UpdatePlanChargeFilter
11217
+ * @summary Update a charge filter
11218
+ * @request PUT:/plans/{code}/charges/{charge_code}/filters/{filter_id}
10064
11219
  * @secure
10065
11220
  */
10066
- findEntitlement: (code: string, featureCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
11221
+ updatePlanChargeFilter: (code: string, chargeCode: string, filterId: string, data: ChargeFilterUpdateInput, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10067
11222
  /**
10068
- * @description This endpoint deletes an existing entitlement by removing the feature from the plan.
11223
+ * @description This endpoint deletes a specific filter from a charge.
10069
11224
  *
10070
- * @tags entitlements
10071
- * @name DestroyEntitlement
10072
- * @summary Delete an entitlement
10073
- * @request DELETE:/plans/{code}/entitlements/{feature_code}
11225
+ * @tags plans
11226
+ * @name DestroyPlanChargeFilter
11227
+ * @summary Delete a charge filter
11228
+ * @request DELETE:/plans/{code}/charges/{charge_code}/filters/{filter_id}
10074
11229
  * @secure
10075
11230
  */
10076
- destroyEntitlement: (code: string, featureCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
11231
+ destroyPlanChargeFilter: (code: string, chargeCode: string, filterId: string, data: ChargeFilterDeleteInput, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
10077
11232
  /**
10078
- * @description This endpoint removes a specific privilege and its value from an entitlement. The privilege remains untouched on the original feature.
11233
+ * @description This endpoint creates a new fixed charge for a specific plan.
10079
11234
  *
10080
- * @tags entitlements
10081
- * @name RemoveEntitlementPrivilege
10082
- * @summary Remove a privilege from an entitlement
10083
- * @request DELETE:/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code}
11235
+ * @tags plans
11236
+ * @name CreatePlanFixedCharge
11237
+ * @summary Create a fixed charge
11238
+ * @request POST:/plans/{code}/fixed_charges
10084
11239
  * @secure
10085
11240
  */
10086
- removeEntitlementPrivilege: (code: string, featureCode: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
11241
+ createPlanFixedCharge: (code: string, data: FixedChargeCreateInput, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10087
11242
  /**
10088
- * @description This endpoint replaces all existing metadata on a plan with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
11243
+ * @description This endpoint retrieves all fixed charges for a specific plan.
10089
11244
  *
10090
11245
  * @tags plans
10091
- * @name ReplacePlanMetadata
10092
- * @summary Replace plan metadata
10093
- * @request POST:/plans/{code}/metadata
11246
+ * @name FindAllPlanFixedCharges
11247
+ * @summary List all fixed charges for a plan
11248
+ * @request GET:/plans/{code}/fixed_charges
10094
11249
  * @secure
10095
11250
  */
10096
- replacePlanMetadata: (code: string, data: PlanMetadataResponse, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
11251
+ findAllPlanFixedCharges: (code: string, query?: {
11252
+ /**
11253
+ * Page number.
11254
+ * @example 1
11255
+ */
11256
+ page?: number;
11257
+ /**
11258
+ * Number of records per page.
11259
+ * @example 20
11260
+ */
11261
+ per_page?: number;
11262
+ }, params?: RequestParams) => Promise<HttpResponse<FixedChargesPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
10097
11263
  /**
10098
- * @description This endpoint merges the provided metadata with existing metadata on the plan. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
11264
+ * @description This endpoint retrieves a specific fixed charge for a plan.
10099
11265
  *
10100
11266
  * @tags plans
10101
- * @name MergePlanMetadata
10102
- * @summary Merge plan metadata
10103
- * @request PATCH:/plans/{code}/metadata
11267
+ * @name FindPlanFixedCharge
11268
+ * @summary Retrieve a fixed charge
11269
+ * @request GET:/plans/{code}/fixed_charges/{fixed_charge_code}
10104
11270
  * @secure
10105
11271
  */
10106
- mergePlanMetadata: (code: string, data: PlanMetadataResponse, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
11272
+ findPlanFixedCharge: (code: string, fixedChargeCode: string, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorNotFound>>;
10107
11273
  /**
10108
- * @description This endpoint removes all metadata from a plan.
11274
+ * @description This endpoint updates a specific fixed charge for a plan.
10109
11275
  *
10110
11276
  * @tags plans
10111
- * @name DeleteAllPlanMetadata
10112
- * @summary Delete all plan metadata
10113
- * @request DELETE:/plans/{code}/metadata
11277
+ * @name UpdatePlanFixedCharge
11278
+ * @summary Update a fixed charge
11279
+ * @request PUT:/plans/{code}/fixed_charges/{fixed_charge_code}
10114
11280
  * @secure
10115
11281
  */
10116
- deleteAllPlanMetadata: (code: string, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
11282
+ updatePlanFixedCharge: (code: string, fixedChargeCode: string, data: FixedChargeUpdateInput, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10117
11283
  /**
10118
- * @description This endpoint removes a single metadata key from a plan.
11284
+ * @description This endpoint deletes a specific fixed charge from a plan.
10119
11285
  *
10120
11286
  * @tags plans
10121
- * @name DeletePlanMetadataKey
10122
- * @summary Delete a metadata key
10123
- * @request DELETE:/plans/{code}/metadata/{key}
11287
+ * @name DestroyPlanFixedCharge
11288
+ * @summary Delete a fixed charge
11289
+ * @request DELETE:/plans/{code}/fixed_charges/{fixed_charge_code}
10124
11290
  * @secure
10125
11291
  */
10126
- deletePlanMetadataKey: (code: string, key: string, params?: RequestParams) => Promise<HttpResponse<PlanMetadataResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
11292
+ destroyPlanFixedCharge: (code: string, fixedChargeCode: string, data: FixedChargeDeleteInput, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorNotFound>>;
10127
11293
  };
10128
11294
  subscriptions: {
10129
11295
  /**
@@ -10135,7 +11301,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10135
11301
  * @request POST:/subscriptions
10136
11302
  * @secure
10137
11303
  */
10138
- createSubscription: (data: SubscriptionCreateInput, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11304
+ createSubscription: (data: SubscriptionCreateInput, params?: RequestParams) => Promise<HttpResponse<SubscriptionExtended, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10139
11305
  /**
10140
11306
  * @description This endpoint retrieves all active subscriptions.
10141
11307
  *
@@ -10190,7 +11356,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10190
11356
  * @example "active"
10191
11357
  */
10192
11358
  status?: "active" | "terminated" | "pending" | "canceled";
10193
- }, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotFound>>;
11359
+ }, params?: RequestParams) => Promise<HttpResponse<SubscriptionExtended, ApiErrorUnauthorized | ApiErrorNotFound>>;
10194
11360
  /**
10195
11361
  * @description This endpoint allows you to update a subscription.
10196
11362
  *
@@ -10274,17 +11440,48 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10274
11440
  * @request GET:/subscriptions/{external_id}/alerts
10275
11441
  * @secure
10276
11442
  */
10277
- getSubscriptionAlerts: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Alerts, ApiErrorUnauthorized | ApiErrorNotFound>>;
11443
+ getSubscriptionAlerts: (externalId: string, query?: {
11444
+ /**
11445
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11446
+ * @default "active"
11447
+ * @example "active"
11448
+ */
11449
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11450
+ }, params?: RequestParams) => Promise<HttpResponse<Alerts, ApiErrorUnauthorized | ApiErrorNotFound>>;
10278
11451
  /**
10279
- * @description This endpoint allows you to create a new alert for a subscription.
11452
+ * @description This endpoint allows you to create alerts for a subscription. Send a single alert object wrapped in `alert` key to create one alert, or an array of alert objects wrapped in `alerts` key to create multiple alerts atomically.
10280
11453
  *
10281
11454
  * @tags subscriptions
10282
11455
  * @name CreateSubscriptionAlert
10283
- * @summary Create a subscription alert
11456
+ * @summary Create subscription alert(s)
10284
11457
  * @request POST:/subscriptions/{external_id}/alerts
10285
11458
  * @secure
10286
11459
  */
10287
- createSubscriptionAlert: (externalId: string, data: AlertCreateInput, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11460
+ createSubscriptionAlert: (externalId: string, data: AlertCreateInput | AlertBatchCreateInput, query?: {
11461
+ /**
11462
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11463
+ * @default "active"
11464
+ * @example "active"
11465
+ */
11466
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11467
+ }, params?: RequestParams) => Promise<HttpResponse<Alerts | Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11468
+ /**
11469
+ * @description This endpoint allows you to delete all alerts for a subscription.
11470
+ *
11471
+ * @tags subscriptions
11472
+ * @name DeleteAllSubscriptionAlerts
11473
+ * @summary Delete all subscription alerts
11474
+ * @request DELETE:/subscriptions/{external_id}/alerts
11475
+ * @secure
11476
+ */
11477
+ deleteAllSubscriptionAlerts: (externalId: string, query?: {
11478
+ /**
11479
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11480
+ * @default "active"
11481
+ * @example "active"
11482
+ */
11483
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11484
+ }, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotFound>>;
10288
11485
  /**
10289
11486
  * @description This endpoint enables the retrieval of a specific alert for a subscription.
10290
11487
  *
@@ -10294,7 +11491,14 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10294
11491
  * @request GET:/subscriptions/{external_id}/alerts/{code}
10295
11492
  * @secure
10296
11493
  */
10297
- getSubscriptionAlert: (externalId: string, code: string, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
11494
+ getSubscriptionAlert: (externalId: string, code: string, query?: {
11495
+ /**
11496
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11497
+ * @default "active"
11498
+ * @example "active"
11499
+ */
11500
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11501
+ }, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
10298
11502
  /**
10299
11503
  * @description This endpoint allows you to update an existing alert for a subscription.
10300
11504
  *
@@ -10304,7 +11508,14 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10304
11508
  * @request PUT:/subscriptions/{external_id}/alerts/{code}
10305
11509
  * @secure
10306
11510
  */
10307
- updateSubscriptionAlert: (externalId: string, code: string, data: AlertUpdateInput, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11511
+ updateSubscriptionAlert: (externalId: string, code: string, data: AlertUpdateInput, query?: {
11512
+ /**
11513
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11514
+ * @default "active"
11515
+ * @example "active"
11516
+ */
11517
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11518
+ }, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10308
11519
  /**
10309
11520
  * @description This endpoint allows you to delete an existing alert for a subscription.
10310
11521
  *
@@ -10314,7 +11525,14 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10314
11525
  * @request DELETE:/subscriptions/{external_id}/alerts/{code}
10315
11526
  * @secure
10316
11527
  */
10317
- deleteSubscriptionAlert: (externalId: string, code: string, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
11528
+ deleteSubscriptionAlert: (externalId: string, code: string, query?: {
11529
+ /**
11530
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11531
+ * @default "active"
11532
+ * @example "active"
11533
+ */
11534
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11535
+ }, params?: RequestParams) => Promise<HttpResponse<Alert, ApiErrorUnauthorized | ApiErrorNotFound>>;
10318
11536
  /**
10319
11537
  * @description This endpoint retrieves all entitlements for a specific subscription, including both plan entitlements and any subscription-specific overrides.
10320
11538
  *
@@ -10324,7 +11542,14 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10324
11542
  * @request GET:/subscriptions/{external_id}/entitlements
10325
11543
  * @secure
10326
11544
  */
10327
- findAllSubscriptionEntitlements: (externalId: string, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorNotFound>>;
11545
+ findAllSubscriptionEntitlements: (externalId: string, query?: {
11546
+ /**
11547
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11548
+ * @default "active"
11549
+ * @example "active"
11550
+ */
11551
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11552
+ }, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorNotFound>>;
10328
11553
  /**
10329
11554
  * @description This accepts a list of entitlements to update. If the feature isn't part of the subscription yet, it's added with all the privileges from the payload. If the feature is already part of the subscription (via plan or via override), the privilege and values are updated or added. All privileges must be valid for the feature. All features and privileges not part of the payload are left untouched. To remove privileges or features, use the DELETE endpoints.
10330
11555
  *
@@ -10334,7 +11559,14 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10334
11559
  * @request PATCH:/subscriptions/{external_id}/entitlements
10335
11560
  * @secure
10336
11561
  */
10337
- updateSubscriptionEntitlements: (externalId: string, data: EntitlementUpdateInput, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11562
+ updateSubscriptionEntitlements: (externalId: string, data: EntitlementUpdateInput, query?: {
11563
+ /**
11564
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11565
+ * @default "active"
11566
+ * @example "active"
11567
+ */
11568
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11569
+ }, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
10338
11570
  /**
10339
11571
  * @description This endpoint removes a specific feature entitlement from a subscription. The entitlement remains available from the plan.
10340
11572
  *
@@ -10344,7 +11576,14 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10344
11576
  * @request DELETE:/subscriptions/{external_id}/entitlements/{feature_code}
10345
11577
  * @secure
10346
11578
  */
10347
- destroySubscriptionEntitlement: (externalId: string, featureCode: string, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
11579
+ destroySubscriptionEntitlement: (externalId: string, featureCode: string, query?: {
11580
+ /**
11581
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11582
+ * @default "active"
11583
+ * @example "active"
11584
+ */
11585
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11586
+ }, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorNotFound>>;
10348
11587
  /**
10349
11588
  * @description This endpoint removes a specific privilege from a subscription entitlement. The privilege entitlement remains available from the plan.
10350
11589
  *
@@ -10354,17 +11593,231 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10354
11593
  * @request DELETE:/subscriptions/{external_id}/entitlements/{feature_code}/privileges/{privilege_code}
10355
11594
  * @secure
10356
11595
  */
10357
- destroySubscriptionEntitlementPrivilege: (externalId: string, featureCode: string, privilegeCode: string, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorBadRequest | ApiErrorNotFound>>;
11596
+ destroySubscriptionEntitlementPrivilege: (externalId: string, featureCode: string, privilegeCode: string, query?: {
11597
+ /**
11598
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11599
+ * @default "active"
11600
+ * @example "active"
11601
+ */
11602
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11603
+ }, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlement, ApiErrorUnauthorized | ApiErrorBadRequest | ApiErrorNotFound>>;
10358
11604
  /**
10359
- * @description This endpoint retrieves all fixed charges for a specific subscription.
11605
+ * @description This endpoint retrieves all effective fixed charges for a specific subscription. If the subscription has plan overrides with fixed charge overrides, the overridden fixed charges are returned.
10360
11606
  *
10361
11607
  * @tags subscriptions
10362
11608
  * @name FindAllSubscriptionFixedCharges
10363
- * @summary List subscription fixed charges
11609
+ * @summary List all fixed charges for a subscription
10364
11610
  * @request GET:/subscriptions/{external_id}/fixed_charges
10365
11611
  * @secure
10366
11612
  */
10367
- findAllSubscriptionFixedCharges: (externalId: string, params?: RequestParams) => Promise<HttpResponse<FixedCharges, ApiErrorUnauthorized | ApiErrorNotFound>>;
11613
+ findAllSubscriptionFixedCharges: (externalId: string, query?: {
11614
+ /**
11615
+ * Page number.
11616
+ * @example 1
11617
+ */
11618
+ page?: number;
11619
+ /**
11620
+ * Number of records per page.
11621
+ * @example 20
11622
+ */
11623
+ per_page?: number;
11624
+ /**
11625
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11626
+ * @default "active"
11627
+ * @example "active"
11628
+ */
11629
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11630
+ }, params?: RequestParams) => Promise<HttpResponse<FixedChargesPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
11631
+ /**
11632
+ * @description This endpoint retrieves all effective charges for a specific subscription. If the subscription has plan overrides with charge overrides, the overridden charges are returned.
11633
+ *
11634
+ * @tags subscriptions
11635
+ * @name FindAllSubscriptionCharges
11636
+ * @summary List all charges for a subscription
11637
+ * @request GET:/subscriptions/{external_id}/charges
11638
+ * @secure
11639
+ */
11640
+ findAllSubscriptionCharges: (externalId: string, query?: {
11641
+ /**
11642
+ * Page number.
11643
+ * @example 1
11644
+ */
11645
+ page?: number;
11646
+ /**
11647
+ * Number of records per page.
11648
+ * @example 20
11649
+ */
11650
+ per_page?: number;
11651
+ /**
11652
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11653
+ * @default "active"
11654
+ * @example "active"
11655
+ */
11656
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11657
+ }, params?: RequestParams) => Promise<HttpResponse<ChargesPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
11658
+ /**
11659
+ * @description This endpoint retrieves a specific effective charge for a subscription. If the subscription has a plan override with a charge override, the overridden charge is returned.
11660
+ *
11661
+ * @tags subscriptions
11662
+ * @name FindSubscriptionCharge
11663
+ * @summary Retrieve a charge for a subscription
11664
+ * @request GET:/subscriptions/{external_id}/charges/{charge_code}
11665
+ * @secure
11666
+ */
11667
+ findSubscriptionCharge: (externalId: string, chargeCode: string, query?: {
11668
+ /**
11669
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11670
+ * @default "active"
11671
+ * @example "active"
11672
+ */
11673
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11674
+ }, params?: RequestParams) => Promise<HttpResponse<Charge, ApiErrorUnauthorized | ApiErrorNotFound>>;
11675
+ /**
11676
+ * @description This endpoint creates or updates a charge override for a specific subscription. If the subscription does not have a plan override yet, one will be created automatically. The charge override allows customizing specific charge properties (invoice_display_name, min_amount_cents, properties, filters, taxes, applied_pricing_unit) without affecting the original plan charge. This is a premium feature.
11677
+ *
11678
+ * @tags subscriptions
11679
+ * @name OverrideSubscriptionCharge
11680
+ * @summary Override a charge for a subscription
11681
+ * @request PUT:/subscriptions/{external_id}/charges/{charge_code}
11682
+ * @secure
11683
+ */
11684
+ overrideSubscriptionCharge: (externalId: string, chargeCode: string, data: SubscriptionChargeOverride, query?: {
11685
+ /**
11686
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11687
+ * @default "active"
11688
+ * @example "active"
11689
+ */
11690
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11691
+ }, params?: RequestParams) => Promise<HttpResponse<Charge, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
11692
+ /**
11693
+ * @description This endpoint creates a new filter for a specific charge on a subscription.
11694
+ *
11695
+ * @tags subscriptions
11696
+ * @name CreateSubscriptionChargeFilter
11697
+ * @summary Create a charge filter
11698
+ * @request POST:/subscriptions/{external_id}/charges/{charge_code}/filters
11699
+ * @secure
11700
+ */
11701
+ createSubscriptionChargeFilter: (externalId: string, chargeCode: string, data: ChargeFilterCreateInput, query?: {
11702
+ /**
11703
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11704
+ * @default "active"
11705
+ * @example "active"
11706
+ */
11707
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11708
+ }, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11709
+ /**
11710
+ * @description This endpoint retrieves all filters for a specific charge on a subscription.
11711
+ *
11712
+ * @tags subscriptions
11713
+ * @name FindAllSubscriptionChargeFilters
11714
+ * @summary List all filters for a charge
11715
+ * @request GET:/subscriptions/{external_id}/charges/{charge_code}/filters
11716
+ * @secure
11717
+ */
11718
+ findAllSubscriptionChargeFilters: (externalId: string, chargeCode: string, query?: {
11719
+ /**
11720
+ * Page number.
11721
+ * @example 1
11722
+ */
11723
+ page?: number;
11724
+ /**
11725
+ * Number of records per page.
11726
+ * @example 20
11727
+ */
11728
+ per_page?: number;
11729
+ /**
11730
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11731
+ * @default "active"
11732
+ * @example "active"
11733
+ */
11734
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11735
+ }, params?: RequestParams) => Promise<HttpResponse<ChargeFiltersPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
11736
+ /**
11737
+ * @description This endpoint retrieves a specific filter for a charge on a subscription.
11738
+ *
11739
+ * @tags subscriptions
11740
+ * @name FindSubscriptionChargeFilter
11741
+ * @summary Retrieve a charge filter
11742
+ * @request GET:/subscriptions/{external_id}/charges/{charge_code}/filters/{filter_id}
11743
+ * @secure
11744
+ */
11745
+ findSubscriptionChargeFilter: (externalId: string, chargeCode: string, filterId: string, query?: {
11746
+ /**
11747
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11748
+ * @default "active"
11749
+ * @example "active"
11750
+ */
11751
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11752
+ }, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
11753
+ /**
11754
+ * @description This endpoint updates a specific filter for a charge on a subscription.
11755
+ *
11756
+ * @tags subscriptions
11757
+ * @name UpdateSubscriptionChargeFilter
11758
+ * @summary Update a charge filter
11759
+ * @request PUT:/subscriptions/{external_id}/charges/{charge_code}/filters/{filter_id}
11760
+ * @secure
11761
+ */
11762
+ updateSubscriptionChargeFilter: (externalId: string, chargeCode: string, filterId: string, data: ChargeFilterUpdateInput, query?: {
11763
+ /**
11764
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11765
+ * @default "active"
11766
+ * @example "active"
11767
+ */
11768
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11769
+ }, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
11770
+ /**
11771
+ * @description This endpoint deletes a specific filter from a charge on a subscription.
11772
+ *
11773
+ * @tags subscriptions
11774
+ * @name DestroySubscriptionChargeFilter
11775
+ * @summary Delete a charge filter
11776
+ * @request DELETE:/subscriptions/{external_id}/charges/{charge_code}/filters/{filter_id}
11777
+ * @secure
11778
+ */
11779
+ destroySubscriptionChargeFilter: (externalId: string, chargeCode: string, filterId: string, query?: {
11780
+ /**
11781
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11782
+ * @default "active"
11783
+ * @example "active"
11784
+ */
11785
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11786
+ }, params?: RequestParams) => Promise<HttpResponse<ChargeFilterResponse, ApiErrorUnauthorized | ApiErrorNotFound>>;
11787
+ /**
11788
+ * @description This endpoint retrieves a specific effective fixed charge for a subscription. If the subscription has a plan override with a fixed charge override, the overridden fixed charge is returned.
11789
+ *
11790
+ * @tags subscriptions
11791
+ * @name FindSubscriptionFixedCharge
11792
+ * @summary Retrieve a fixed charge for a subscription
11793
+ * @request GET:/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}
11794
+ * @secure
11795
+ */
11796
+ findSubscriptionFixedCharge: (externalId: string, fixedChargeCode: string, query?: {
11797
+ /**
11798
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11799
+ * @default "active"
11800
+ * @example "active"
11801
+ */
11802
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11803
+ }, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorNotFound>>;
11804
+ /**
11805
+ * @description This endpoint creates or updates a fixed charge override for a specific subscription. If the subscription does not have a plan override yet, one will be created automatically. The fixed charge override allows customizing specific fixed charge properties (invoice_display_name, units, properties, taxes) without affecting the original plan fixed charge. This is a premium feature.
11806
+ *
11807
+ * @tags subscriptions
11808
+ * @name OverrideSubscriptionFixedCharge
11809
+ * @summary Override a fixed charge for a subscription
11810
+ * @request PUT:/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}
11811
+ * @secure
11812
+ */
11813
+ overrideSubscriptionFixedCharge: (externalId: string, fixedChargeCode: string, data: SubscriptionFixedChargeOverride, query?: {
11814
+ /**
11815
+ * Filter by subscription status. When provided, the subscription is looked up with this status instead of the default `active` status. Possible values are `pending`, `active`, `terminated`, or `canceled`.
11816
+ * @default "active"
11817
+ * @example "active"
11818
+ */
11819
+ subscription_status?: "pending" | "active" | "terminated" | "canceled";
11820
+ }, params?: RequestParams) => Promise<HttpResponse<FixedCharge, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
10368
11821
  };
10369
11822
  taxes: {
10370
11823
  /**
@@ -10604,6 +12057,48 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10604
12057
  * @secure
10605
12058
  */
10606
12059
  walletTransactionPaymentUrl: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WalletTransactionPaymentUrl, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
12060
+ /**
12061
+ * @description This endpoint is used to list all consumption records for an inbound wallet transaction. It shows how the credits from this inbound transaction were consumed by outbound transactions. Only available for traceable wallets.
12062
+ *
12063
+ * @tags wallets
12064
+ * @name FindAllWalletTransactionConsumptions
12065
+ * @summary List all consumptions for a wallet transaction
12066
+ * @request GET:/wallet_transactions/{lago_id}/consumptions
12067
+ * @secure
12068
+ */
12069
+ findAllWalletTransactionConsumptions: (lagoId: string, query?: {
12070
+ /**
12071
+ * Page number.
12072
+ * @example 1
12073
+ */
12074
+ page?: number;
12075
+ /**
12076
+ * Number of records per page.
12077
+ * @example 20
12078
+ */
12079
+ per_page?: number;
12080
+ }, params?: RequestParams) => Promise<HttpResponse<WalletTransactionConsumptionsPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
12081
+ /**
12082
+ * @description This endpoint is used to list all funding records for an outbound wallet transaction. It shows which inbound transactions funded this outbound transaction. Only available for traceable wallets.
12083
+ *
12084
+ * @tags wallets
12085
+ * @name FindAllWalletTransactionFundings
12086
+ * @summary List all fundings for a wallet transaction
12087
+ * @request GET:/wallet_transactions/{lago_id}/fundings
12088
+ * @secure
12089
+ */
12090
+ findAllWalletTransactionFundings: (lagoId: string, query?: {
12091
+ /**
12092
+ * Page number.
12093
+ * @example 1
12094
+ */
12095
+ page?: number;
12096
+ /**
12097
+ * Number of records per page.
12098
+ * @example 20
12099
+ */
12100
+ per_page?: number;
12101
+ }, params?: RequestParams) => Promise<HttpResponse<WalletTransactionFundingsPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
10607
12102
  };
10608
12103
  webhooks: {
10609
12104
  /**