lago-javascript-client 1.31.0 → 1.32.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.
@@ -1,5 +1,5 @@
1
1
  /** @example "USD" */
2
- export type Currency = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SZL" | "THB" | "TJS" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW";
2
+ export type Currency = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SZL" | "THB" | "TJS" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW";
3
3
  /** @example "US" */
4
4
  export type Country = "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";
5
5
  /** @example "America/Los_Angeles" */
@@ -535,7 +535,7 @@ export interface BillingEntityUpdateInput {
535
535
  */
536
536
  eu_tax_management?: boolean;
537
537
  /**
538
- * The base64 encoded logo image for the billing entity
538
+ * The base64 encoded logo image for the billing entity. Sending "null" will remove the logo, if any exist.
539
539
  * @format uri
540
540
  * @example "data:image/png;base64,..."
541
541
  */
@@ -670,7 +670,7 @@ export interface AddOnObject {
670
670
  * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
671
671
  * @example "Setup Fee (SF1)"
672
672
  */
673
- invoice_display_name?: string;
673
+ invoice_display_name: string | null;
674
674
  /**
675
675
  * Unique code used to identify the add-on.
676
676
  * @example "setup_fee"
@@ -690,7 +690,7 @@ export interface AddOnObject {
690
690
  * The description of the add-on.
691
691
  * @example "Implementation fee for new customers."
692
692
  */
693
- description?: string | null;
693
+ description: string | null;
694
694
  /**
695
695
  * The date and time when the add-on was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the add-on was initially created.
696
696
  * @format date-time
@@ -714,7 +714,7 @@ export interface AddOnBaseInput {
714
714
  * 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.
715
715
  * @example "Setup Fee (SF1)"
716
716
  */
717
- invoice_display_name?: string;
717
+ invoice_display_name?: string | null;
718
718
  /**
719
719
  * Unique code used to identify the add-on.
720
720
  * @example "setup_fee"
@@ -907,12 +907,12 @@ export interface MrrObject {
907
907
  * The total amount of MRR, expressed in cents.
908
908
  * @example 50000
909
909
  */
910
- amount_cents?: number;
910
+ amount_cents: number;
911
911
  /**
912
912
  * The currency of MRR analytics. Format must be ISO 4217.
913
913
  * @example "USD"
914
914
  */
915
- currency?: Currency;
915
+ currency: Currency;
916
916
  }
917
917
  export interface Mrrs {
918
918
  mrrs: MrrObject[];
@@ -1562,6 +1562,11 @@ export interface CouponUpdateInput {
1562
1562
  coupon: CouponBaseInput;
1563
1563
  }
1564
1564
  export interface FeeAmountDetails {
1565
+ /**
1566
+ * The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
1567
+ * @example 10000
1568
+ */
1569
+ plan_amount_cents?: number;
1565
1570
  /** Graduated ranges, used for a `graduated` charge model. */
1566
1571
  graduated_ranges?: {
1567
1572
  /**
@@ -1790,6 +1795,49 @@ export type FeeAppliedTaxObject = BaseAppliedTax & {
1790
1795
  */
1791
1796
  lago_fee_id?: string;
1792
1797
  };
1798
+ export interface PricingUnitDetailsObject {
1799
+ /**
1800
+ * Unique identifier of the pricing unit, created by Lago.
1801
+ * @format uuid
1802
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1803
+ */
1804
+ lago_pricing_unit_id: string;
1805
+ /**
1806
+ * The code of the pricing unit.
1807
+ * @example "credits"
1808
+ */
1809
+ pricing_unit_code: string;
1810
+ /**
1811
+ * The short name of the pricing unit. Will be used as currency name in the UI and PDFs.
1812
+ * @example "CR"
1813
+ */
1814
+ short_name: string;
1815
+ /**
1816
+ * The amount in cents in the pricing unit.
1817
+ * @example 200
1818
+ */
1819
+ amount_cents: number;
1820
+ /**
1821
+ * The precise amount in cents in the pricing unit.
1822
+ * @example "200.0"
1823
+ */
1824
+ precise_amount_cents: string;
1825
+ /**
1826
+ * The unit amount in cents in the pricing unit.
1827
+ * @example 100
1828
+ */
1829
+ unit_amount_cents: number;
1830
+ /**
1831
+ * The precise unit amount in the pricing unit.
1832
+ * @example "100.0"
1833
+ */
1834
+ precise_unit_amount: string;
1835
+ /**
1836
+ * The conversion rate from pricing units to the plan's currency.
1837
+ * @example "0.5"
1838
+ */
1839
+ conversion_rate: string;
1840
+ }
1793
1841
  export interface FeeObject {
1794
1842
  /**
1795
1843
  * Unique identifier assigned to the fee within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the fee's record within the Lago system.
@@ -2022,6 +2070,8 @@ export interface FeeObject {
2022
2070
  };
2023
2071
  /** List of fee applied taxes */
2024
2072
  applied_taxes?: FeeAppliedTaxObject[];
2073
+ /** Details about the pricing unit used and amounts for this fee. */
2074
+ pricing_unit_details?: object | null;
2025
2075
  }
2026
2076
  export interface CreditNoteItemObject {
2027
2077
  /**
@@ -2053,6 +2103,21 @@ export type CreditNoteAppliedTaxObject = BaseAppliedTax & {
2053
2103
  /** @example 100 */
2054
2104
  base_amount_cents?: number;
2055
2105
  };
2106
+ export interface CreditNoteErrorDetailsObject {
2107
+ /**
2108
+ * The credit note error details unique identifier, created by Lago.
2109
+ * @format uuid
2110
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2111
+ */
2112
+ lago_id: string;
2113
+ /**
2114
+ * The type of the error.
2115
+ * @example "tax_error"
2116
+ */
2117
+ error_code: "not_provided" | "tax_error" | "tax_voiding_error" | "invoice_generation_error";
2118
+ /** The details of the error. */
2119
+ details: object;
2120
+ }
2056
2121
  export interface CreditNoteObject {
2057
2122
  /**
2058
2123
  * The credit note unique identifier, created by Lago.
@@ -2191,6 +2256,7 @@ export interface CreditNoteObject {
2191
2256
  * @example false
2192
2257
  */
2193
2258
  self_billed?: boolean;
2259
+ error_details?: any[] | null;
2194
2260
  }
2195
2261
  export interface CreditNotesPaginated {
2196
2262
  credit_notes: CreditNoteObject[];
@@ -2310,6 +2376,11 @@ export interface CreditNoteEstimated {
2310
2376
  * @example 20
2311
2377
  */
2312
2378
  taxes_amount_cents: number;
2379
+ /**
2380
+ * The precise tax amount of the credit note, expressed in cents with decimal precision.
2381
+ * @example 20.1
2382
+ */
2383
+ precise_taxes_amount_cents: number;
2313
2384
  /**
2314
2385
  * The tax rate associated with this specific credit note.
2315
2386
  * @example 20
@@ -2335,6 +2406,11 @@ export interface CreditNoteEstimated {
2335
2406
  * @example 20
2336
2407
  */
2337
2408
  coupons_adjustment_amount_cents: number;
2409
+ /**
2410
+ * The precise pro-rated amount with decimal precision of the coupons applied to the source invoice.
2411
+ * @example 20.1
2412
+ */
2413
+ precise_coupons_adjustment_amount_cents: number;
2338
2414
  /** Array of credit note's items. */
2339
2415
  items: {
2340
2416
  /**
@@ -2686,33 +2762,43 @@ export interface IntegrationCustomer {
2686
2762
  * @format uuid
2687
2763
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2688
2764
  */
2689
- lago_id?: string;
2765
+ lago_id: string;
2690
2766
  /**
2691
2767
  * The integration type used for accounting and tax syncs.
2692
2768
  * Accepted values: `netsuite, anrok`.
2693
2769
  * @example "netsuite"
2694
2770
  */
2695
- type?: "netsuite" | "anrok";
2771
+ type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
2696
2772
  /**
2697
2773
  * Unique code used to identify an integration connection.
2698
2774
  * @example "netsuite-eu-1"
2699
2775
  */
2700
- integration_code?: string;
2776
+ integration_code: string;
2701
2777
  /**
2702
2778
  * 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.
2703
2779
  * @example "cus_12345"
2704
2780
  */
2705
- external_customer_id?: string;
2781
+ external_customer_id: string;
2706
2782
  /**
2707
2783
  * 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`
2708
2784
  * @example true
2709
2785
  */
2710
- sync_with_provider?: boolean;
2786
+ sync_with_provider?: boolean | null;
2711
2787
  /**
2712
2788
  * This optional field is needed only when working with `netsuite` connection.
2713
2789
  * @example "2"
2714
2790
  */
2715
2791
  subsidiary_id?: string;
2792
+ /**
2793
+ * This optional field is present only when working with `hubspot` connection.
2794
+ * @example "contacts"
2795
+ */
2796
+ targeted_object?: string | null;
2797
+ /**
2798
+ * This optional field is present only when working with `hubspot` connection.
2799
+ * @example "dinesh@piedpiper.test"
2800
+ */
2801
+ email?: string | null;
2716
2802
  }
2717
2803
  export type CustomerObject = CustomerBaseObject & {
2718
2804
  integration_customers?: IntegrationCustomer[];
@@ -2933,6 +3019,24 @@ export interface CustomerCreateInput {
2933
3019
  export interface Customer {
2934
3020
  customer: CustomerObjectExtended;
2935
3021
  }
3022
+ /** Details about the pricing unit used for charge usage. */
3023
+ export interface UsagePricingUnitDetailsObject {
3024
+ /**
3025
+ * The amount in cents in the pricing unit.
3026
+ * @example 200
3027
+ */
3028
+ amount_cents: number;
3029
+ /**
3030
+ * The short name of the pricing unit.
3031
+ * @example "CR"
3032
+ */
3033
+ short_name: string;
3034
+ /**
3035
+ * The conversion rate from pricing units to the plan's currency.
3036
+ * @example "0.5"
3037
+ */
3038
+ conversion_rate: string;
3039
+ }
2936
3040
  /** Array of filter object, representing multiple dimensions for a charge item. */
2937
3041
  export type CustomerChargeFiltersUsageObject = {
2938
3042
  /**
@@ -2956,6 +3060,8 @@ export type CustomerChargeFiltersUsageObject = {
2956
3060
  * @example "AWS eu-east-1"
2957
3061
  */
2958
3062
  invoice_display_name?: string;
3063
+ /** Details about the pricing unit used for charge usage. */
3064
+ pricing_unit_details?: UsagePricingUnitDetailsObject;
2959
3065
  /**
2960
3066
  * List of filter values applied to the usage.
2961
3067
  * @example {"region":"us-east-1"}
@@ -2980,6 +3086,8 @@ export type CustomerChargeGroupedUsageObject = {
2980
3086
  * @example "0.9"
2981
3087
  */
2982
3088
  units?: string;
3089
+ /** Details about the pricing unit used for charge usage. */
3090
+ pricing_unit_details?: UsagePricingUnitDetailsObject;
2983
3091
  /** Key value list of event properties aggregated by the charge model */
2984
3092
  grouped_by?: Record<string, string>;
2985
3093
  /** Array of filter object, representing multiple dimensions for a charge item. */
@@ -3007,6 +3115,8 @@ export interface CustomerChargeUsageObject {
3007
3115
  * @example "EUR"
3008
3116
  */
3009
3117
  amount_currency: Currency;
3118
+ /** Details about the pricing unit used for charge usage. */
3119
+ pricing_unit_details?: UsagePricingUnitDetailsObject;
3010
3120
  /** Object listing all the properties for a specific charge item. */
3011
3121
  charge: {
3012
3122
  /**
@@ -3242,17 +3352,32 @@ export interface EventInputObject {
3242
3352
  * This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required.
3243
3353
  * @example {"gb":10}
3244
3354
  */
3245
- properties?: Record<string, string | number>;
3355
+ properties?: object | null;
3246
3356
  }
3247
3357
  export interface EventInput {
3248
3358
  event: EventInputObject;
3249
3359
  }
3250
- export interface Event {
3251
- event: EventObject;
3360
+ export interface EventCreated {
3361
+ event: EventObject & {
3362
+ /**
3363
+ * The value will always be null in this response as the event processing is done asynchronously
3364
+ * @example null
3365
+ */
3366
+ lago_customer_id?: null;
3367
+ };
3252
3368
  }
3253
3369
  export interface EventBatchInput {
3254
3370
  events: EventInputObject[];
3255
3371
  }
3372
+ export interface EventsCreated {
3373
+ events: (EventObject & {
3374
+ /**
3375
+ * The value will always be null in this response as the event processing is done asynchronously
3376
+ * @example null
3377
+ */
3378
+ lago_customer_id?: null;
3379
+ })[];
3380
+ }
3256
3381
  export interface EventEstimateFeesInput {
3257
3382
  event: {
3258
3383
  /**
@@ -3272,6 +3397,215 @@ export interface EventEstimateFeesInput {
3272
3397
  export interface Fees {
3273
3398
  fees: FeeObject[];
3274
3399
  }
3400
+ export interface EventEstimateInstantFeesInput {
3401
+ event: {
3402
+ /**
3403
+ * The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
3404
+ * @example "storage"
3405
+ */
3406
+ code: string;
3407
+ /**
3408
+ * The unique identifier of the subscription within your application.
3409
+ * @example "sub_1234567890"
3410
+ */
3411
+ external_subscription_id: string;
3412
+ /** This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. */
3413
+ properties?: object;
3414
+ /**
3415
+ * This field represents a unique identifier for the event.
3416
+ * @example "transaction_1234567890"
3417
+ */
3418
+ transaction_id?: string | null;
3419
+ };
3420
+ }
3421
+ export interface FeeEstimateObject {
3422
+ lago_id?: null;
3423
+ /**
3424
+ * Unique identifier assigned to the charge that the fee belongs to
3425
+ * @format uuid
3426
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3427
+ */
3428
+ lago_charge_id?: string;
3429
+ /**
3430
+ * Unique identifier assigned to the charge filter that the fee belongs to
3431
+ * @format uuid
3432
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3433
+ */
3434
+ lago_charge_filter_id?: string | null;
3435
+ lago_invoice_id?: null;
3436
+ lago_true_up_fee_id?: null;
3437
+ lago_true_up_parent_fee_id?: null;
3438
+ /**
3439
+ * Unique identifier assigned to the subscription, created by Lago. This field is specifically displayed when the fee type is charge or subscription.
3440
+ * @format uuid
3441
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3442
+ */
3443
+ lago_subscription_id?: string;
3444
+ /**
3445
+ * Unique identifier assigned to the customer, created by Lago. This field is specifically displayed when the fee type is charge or subscription.
3446
+ * @format uuid
3447
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3448
+ */
3449
+ lago_customer_id?: string;
3450
+ /**
3451
+ * Unique identifier assigned to the customer in your application. This field is specifically displayed when the fee type is charge or subscription.
3452
+ * @example "external_id"
3453
+ */
3454
+ external_customer_id?: string;
3455
+ /**
3456
+ * Unique identifier assigned to the subscription in your application. This field is specifically displayed when the fee type is charge or subscription.
3457
+ * @example "external_id"
3458
+ */
3459
+ external_subscription_id?: string;
3460
+ /**
3461
+ * The cost of this specific fee, excluding any applicable taxes.
3462
+ * @example 100
3463
+ */
3464
+ amount_cents: number;
3465
+ /**
3466
+ * The cost of this specific fee, excluding any applicable taxes, with precision.
3467
+ * @example 1.0001
3468
+ */
3469
+ precise_amount?: number;
3470
+ /**
3471
+ * The cost of this specific fee, including any applicable taxes, with precision.
3472
+ * @example 1.0212
3473
+ */
3474
+ precise_total_amount?: number;
3475
+ /**
3476
+ * The currency of this specific fee. It indicates the monetary unit in which the fee's cost is expressed.
3477
+ * @example "EUR"
3478
+ */
3479
+ amount_currency: Currency;
3480
+ /**
3481
+ * The cost of the tax associated with this specific fee.
3482
+ * @example 0
3483
+ */
3484
+ taxes_amount_cents: number;
3485
+ /**
3486
+ * The cost of the tax associated with this specific fee, with precision.
3487
+ * @example 0
3488
+ */
3489
+ taxes_precise_amount?: number;
3490
+ /**
3491
+ * The tax rate associated with this specific fee.
3492
+ * @example 20
3493
+ */
3494
+ taxes_rate: number;
3495
+ /**
3496
+ * The number of units used to charge the customer. This field indicates the quantity or count of units consumed or utilized in the context of the charge. It helps in determining the basis for calculating the fee or cost associated with the usage of the service or product provided to the customer.
3497
+ * @example "0.32"
3498
+ */
3499
+ units: string;
3500
+ description?: null;
3501
+ /**
3502
+ * The unit amount of the fee per unit, with precision.
3503
+ * @example 312.5
3504
+ */
3505
+ precise_unit_amount: number;
3506
+ /**
3507
+ * The coupon amount applied to the estimated instant fee. It will always returns 0
3508
+ * @example "0.0"
3509
+ */
3510
+ precise_coupons_amount_cents?: string;
3511
+ /**
3512
+ * The cost of this specific fee, including any applicable taxes.
3513
+ * @example 120
3514
+ */
3515
+ total_amount_cents: number;
3516
+ /**
3517
+ * The currency of this specific fee, including any applicable taxes.
3518
+ * @example "EUR"
3519
+ */
3520
+ total_amount_currency: Currency;
3521
+ /**
3522
+ * The number of events that have been sent and used to charge the customer. This field indicates the count or quantity of events that have been processed and considered in the charging process.
3523
+ * @example 1
3524
+ */
3525
+ events_count?: number;
3526
+ /**
3527
+ * Flag that indicates whether the fee was paid in advance. It serves as a boolean value, where `true` represents that the fee was paid in advance (straightaway), and `false` indicates that the fee was not paid in arrears (at the end of the period).
3528
+ * @example true
3529
+ */
3530
+ pay_in_advance: boolean;
3531
+ /**
3532
+ * Flag that indicates whether the fee was included on the invoice. It serves as a boolean value, where `true` represents that the fee was included on the invoice, and `false` indicates that the fee was not included on the invoice.
3533
+ * @example true
3534
+ */
3535
+ invoiceable: boolean;
3536
+ /**
3537
+ * Indicates the payment status of the fee. It represents the current status of the payment associated with the fee. The value will always `pending`.
3538
+ * @example "pending"
3539
+ */
3540
+ payment_status: "pending";
3541
+ created_at?: null;
3542
+ succeeded_at?: null;
3543
+ failed_at?: null;
3544
+ refunded_at?: null;
3545
+ /**
3546
+ * Unique identifier assigned to the transaction. This field is specifically displayed when the fee type is `charge` and the payment for the fee is made in advance (`pay_in_advance` is set to `true`).
3547
+ * @example "transaction_1234567890"
3548
+ */
3549
+ event_transaction_id?: string;
3550
+ amount_details?: null;
3551
+ /** Item attached to the fee */
3552
+ item: {
3553
+ /**
3554
+ * The fee type. The value will be `charge`.
3555
+ * @example "charge"
3556
+ */
3557
+ type: "charge";
3558
+ /**
3559
+ * The code of the fee item. It will be the code of the `billable_metric`.
3560
+ * @example "startup"
3561
+ */
3562
+ code: string;
3563
+ /**
3564
+ * The name of the fee item. It will be the name of the `billable_metric`.
3565
+ * @example "Startup"
3566
+ */
3567
+ name: string;
3568
+ /**
3569
+ * The description of the fee item. It will be the name of the `billable_metric`.
3570
+ * @example "Startup description"
3571
+ */
3572
+ description?: string;
3573
+ /**
3574
+ * 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.
3575
+ * @example "Setup Fee (SF1)"
3576
+ */
3577
+ invoice_display_name?: string;
3578
+ /**
3579
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the actual charge filter values will be used as the default display name.
3580
+ * @example "AWS eu-east-1"
3581
+ */
3582
+ filter_invoice_display_name?: string | null;
3583
+ /** Key value list of event properties */
3584
+ filters?: object | null;
3585
+ /**
3586
+ * Unique identifier of the fee item, created by Lago. It will be the identifier of the `billable_metric`.
3587
+ * @format uuid
3588
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3589
+ */
3590
+ lago_item_id: string;
3591
+ /**
3592
+ * The type of the fee item. Values is `BillableMetric`.
3593
+ * @example "BillableMetric"
3594
+ */
3595
+ item_type: "BillableMetric";
3596
+ /** Key value list of event properties aggregated by the charge model */
3597
+ grouped_by?: Record<string, string>;
3598
+ };
3599
+ }
3600
+ export interface FeesEstimate {
3601
+ fees: FeeEstimateObject[];
3602
+ }
3603
+ export interface EventBatchEstimateInstantFeesInput {
3604
+ events: EventEstimateInstantFeesInput[];
3605
+ }
3606
+ export interface Event {
3607
+ event: EventObject;
3608
+ }
3275
3609
  export type FeesPaginated = Fees & {
3276
3610
  meta: PaginationMeta;
3277
3611
  };
@@ -3461,7 +3795,7 @@ export interface BillingPeriodObject {
3461
3795
  * @format uuid
3462
3796
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3463
3797
  */
3464
- lago_plan_id?: string;
3798
+ lago_plan_id: string;
3465
3799
  /**
3466
3800
  * The beginning date of the subscription billing period. This field indicates the start date of the billing period associated with the subscription fee.
3467
3801
  * @format date-time
@@ -3540,7 +3874,7 @@ export interface UsageThresholdObject {
3540
3874
  * The display name of the usage threshold.
3541
3875
  * @example "Threshold 1"
3542
3876
  */
3543
- threshold_display_name?: string | null;
3877
+ threshold_display_name: string | null;
3544
3878
  /**
3545
3879
  * The amount to reach to trigger a `progressive_billing` invoice.
3546
3880
  * @example 10000
@@ -3573,6 +3907,7 @@ export interface AppliedUsageThresholdObject {
3573
3907
  /**
3574
3908
  * The date and time when the lifetime usage was computed. It is expressed in UTC format according to the ISO 8601 datetime standard.
3575
3909
  * @format date-time
3910
+ * @example "2025-03-31T12:31:44Z"
3576
3911
  */
3577
3912
  created_at: string;
3578
3913
  usage_threshold: UsageThresholdObject;
@@ -3583,7 +3918,7 @@ export type InvoiceObject = InvoiceBaseObject & {
3583
3918
  billing_periods?: BillingPeriodObject[];
3584
3919
  metadata?: InvoiceMetadataObject[];
3585
3920
  applied_taxes?: InvoiceAppliedTaxObject[];
3586
- applied_usage_thresholds?: any[] | null;
3921
+ applied_usage_thresholds?: AppliedUsageThresholdObject[];
3587
3922
  };
3588
3923
  export interface InvoicesPaginated {
3589
3924
  invoices: InvoiceObject[];
@@ -3759,6 +4094,27 @@ export interface SubscriptionObject {
3759
4094
  * @example "2022-09-08T00:00:00Z"
3760
4095
  */
3761
4096
  current_billing_period_ending_at?: string | null;
4097
+ /**
4098
+ * When a pay-in-advance subscription is terminated before the end of its billing period, we generate a credit note for the unused subscription time by default.
4099
+ * This field allows you to control the behavior of the credit note generation:
4100
+ *
4101
+ * - `credit`: A credit note is generated for the unused subscription time. The unused amount is credited to the credit note wallet.
4102
+ * - `skip`: No credit note is generated for the unused subscription time.
4103
+ *
4104
+ * _Note: This field is only applicable to pay-in-advance plans and will be `null` for pay-in-arrears plans._
4105
+ * @example "credit"
4106
+ */
4107
+ on_termination_credit_note: "credit" | "skip";
4108
+ /**
4109
+ * When a subscription is terminated before the end of its billing period, we generate an invoice for the unbilled usage.
4110
+ * This field allows you to control the behavior of the invoice generation:
4111
+ *
4112
+ * - `generate`: An invoice is generated for the unbilled usage.
4113
+ * - `skip`: No invoice is generated for the unbilled usage.
4114
+ * @default "generate"
4115
+ * @example "generate"
4116
+ */
4117
+ on_termination_invoice: "generate" | "skip";
3762
4118
  }
3763
4119
  export interface ErrorDetailObject {
3764
4120
  /**
@@ -4704,7 +5060,7 @@ export interface ChargeObject {
4704
5060
  * 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.
4705
5061
  * @example "Setup"
4706
5062
  */
4707
- invoice_display_name?: string;
5063
+ invoice_display_name: string | null;
4708
5064
  /**
4709
5065
  * The date and time when the charge was created. It is expressed in UTC format according to the ISO 8601 datetime standard.
4710
5066
  * @format date-time
@@ -4717,12 +5073,12 @@ export interface ChargeObject {
4717
5073
  * 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.
4718
5074
  * @example true
4719
5075
  */
4720
- pay_in_advance?: boolean;
5076
+ pay_in_advance: boolean;
4721
5077
  /**
4722
5078
  * 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`.
4723
5079
  * @example true
4724
5080
  */
4725
- invoiceable?: boolean;
5081
+ invoiceable: boolean;
4726
5082
  /**
4727
5083
  * This setting can only be configured if `pay_in_advance` is `true` and `invoiceable` is `false`.
4728
5084
  * This field determines whether and when the charge fee should be included in
@@ -4731,7 +5087,7 @@ export interface ChargeObject {
4731
5087
  * consolidating all charge fees with a succeeded payment status.
4732
5088
  * @example "invoice"
4733
5089
  */
4734
- regroup_paid_fees?: "invoice";
5090
+ regroup_paid_fees: "invoice";
4735
5091
  /**
4736
5092
  * Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
4737
5093
  *
@@ -4740,18 +5096,31 @@ export interface ChargeObject {
4740
5096
  * - If not defined in the request, default value is `false`.
4741
5097
  * @example false
4742
5098
  */
4743
- prorated?: boolean;
5099
+ prorated: boolean;
4744
5100
  /**
4745
5101
  * 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.
4746
5102
  * @example 1200
4747
5103
  */
4748
- min_amount_cents?: number;
5104
+ min_amount_cents: number;
4749
5105
  /** List of all thresholds utilized for calculating the charge. */
4750
- properties?: ChargeProperties;
5106
+ properties: ChargeProperties;
4751
5107
  /** List of filters used to apply differentiated pricing based on additional event properties. */
4752
- filters?: ChargeFilterObject[];
5108
+ filters: ChargeFilterObject[];
4753
5109
  /** All taxes applied to the charge. */
4754
5110
  taxes?: TaxObject[];
5111
+ /** The pricing unit applied to the charge. */
5112
+ applied_pricing_unit?: {
5113
+ /**
5114
+ * The code of the pricing unit.
5115
+ * @example "unit_code"
5116
+ */
5117
+ code: string;
5118
+ /**
5119
+ * The conversion rate from pricing units to the plan's currency.
5120
+ * @example "0.5"
5121
+ */
5122
+ conversion_rate: string;
5123
+ };
4755
5124
  }
4756
5125
  export interface PlanObject {
4757
5126
  /**
@@ -4819,7 +5188,7 @@ export interface PlanObject {
4819
5188
  minimum_commitment?: MinimumCommitmentObject;
4820
5189
  /**
4821
5190
  * Additional usage-based charges for this plan.
4822
- * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"filters":[{"invoice_display_name":"Europe","properties":{"amount":"10"},"values":{"region":["Europe"]}},{"invoice_display_name":"USA","properties":{"amount":"5"},"values":{"region":["USA"]}},{"invoice_display_name":"Africa","properties":{"amount":"8"},"values":{"region":["Africa"]}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"regroup_paid_fees":"invoice","prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"filters":[]}]
5191
+ * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":0,"properties":{},"filters":[{"invoice_display_name":"Europe","properties":{"amount":"10"},"values":{"region":["Europe"]}},{"invoice_display_name":"USA","properties":{"amount":"5"},"values":{"region":["USA"]}},{"invoice_display_name":"Africa","properties":{"amount":"8"},"values":{"region":["Africa"]}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"regroup_paid_fees":"invoice","prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"filters":[]}]
4823
5192
  */
4824
5193
  charges?: ChargeObject[];
4825
5194
  /** All taxes applied to the plan. */
@@ -4857,12 +5226,12 @@ export interface ChargeFilterInput {
4857
5226
  */
4858
5227
  invoice_display_name?: string | null;
4859
5228
  /** List of all thresholds utilized for calculating the charge. */
4860
- properties?: ChargeProperties;
5229
+ properties: ChargeProperties;
4861
5230
  /**
4862
5231
  * List of possible filter values. The key and values must match one of the billable metric filters.
4863
5232
  * @example {"region":["us-east-1"]}
4864
5233
  */
4865
- values?: Record<string, string[]>;
5234
+ values: Record<string, string[]>;
4866
5235
  }
4867
5236
  export interface UsageThresholdInput {
4868
5237
  /**
@@ -5009,6 +5378,21 @@ export interface PlanCreateInput {
5009
5378
  * @example ["french_standard_vat"]
5010
5379
  */
5011
5380
  tax_codes?: string[];
5381
+ /** The pricing unit to apply to the charge. */
5382
+ applied_pricing_unit?: {
5383
+ /**
5384
+ * The code of the pricing unit.
5385
+ * @example "credits"
5386
+ */
5387
+ code?: string;
5388
+ /**
5389
+ * The conversion rate from pricing units to the plan's currency.
5390
+ * This rate determines how many currency units (in the plan's base currency) equal one pricing unit.
5391
+ * For example, if the plan uses USD and the conversion rate is 0.5, then 1 pricing unit = $0.50.
5392
+ * @example "0.5"
5393
+ */
5394
+ conversion_rate?: string;
5395
+ };
5012
5396
  }[];
5013
5397
  /** List of usage thresholds to apply to the plan. */
5014
5398
  usage_thresholds?: UsageThresholdInput[];
@@ -5145,6 +5529,16 @@ export interface PlanUpdateInput {
5145
5529
  * @example ["french_standard_vat"]
5146
5530
  */
5147
5531
  tax_codes?: string[];
5532
+ /** Updates the pricing unit conversion rate for this charge. Only applies if the charge has applied pricing unit. */
5533
+ applied_pricing_unit?: {
5534
+ /**
5535
+ * The conversion rate from pricing units to the plan's currency.
5536
+ * This rate determines how many currency units (in the plan's base currency) equal one pricing unit.
5537
+ * For example, if the plan uses USD and the conversion rate is 0.5, then 1 pricing unit = $0.50 USD.
5538
+ * @example "0.5"
5539
+ */
5540
+ conversion_rate?: string;
5541
+ };
5148
5542
  }[];
5149
5543
  /** List of usage thresholds to apply to the plan. */
5150
5544
  usage_thresholds?: UsageThresholdInput[];
@@ -5230,6 +5624,16 @@ export interface PlanOverridesObject {
5230
5624
  * @example ["french_standard_vat"]
5231
5625
  */
5232
5626
  tax_codes?: string[];
5627
+ /** Updates the pricing unit conversion rate for this charge. Only applies if the charge has applied pricing unit. */
5628
+ applied_pricing_unit?: {
5629
+ /**
5630
+ * The conversion rate from pricing units to the plan's currency.
5631
+ * This rate determines how many currency units (in the plan's base currency) equal one pricing unit.
5632
+ * For example, if the plan uses USD and the conversion rate is 0.5, then 1 pricing unit = $0.50 USD.
5633
+ * @example "0.5"
5634
+ */
5635
+ conversion_rate?: string;
5636
+ };
5233
5637
  }[];
5234
5638
  /** List of usage thresholds applied to the subscription. */
5235
5639
  usage_thresholds?: UsageThresholdObject[];
@@ -5613,13 +6017,13 @@ export interface WalletRecurringTransactionRule {
5613
6017
  * @format date-time
5614
6018
  * @example "2022-08-08T00:00:00Z"
5615
6019
  */
5616
- started_at?: string;
6020
+ started_at?: string | null;
5617
6021
  /**
5618
6022
  * 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`.
5619
6023
  * @pattern ^[0-9]+.?[0-9]*$
5620
6024
  * @example "200.0"
5621
6025
  */
5622
- target_ongoing_balance: string;
6026
+ target_ongoing_balance: string | null;
5623
6027
  /**
5624
6028
  * 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
5625
6029
  * @format date-time
@@ -5631,7 +6035,7 @@ export interface WalletRecurringTransactionRule {
5631
6035
  * @format date-time
5632
6036
  * @example "2023-09-30T23:59:59Z"
5633
6037
  */
5634
- expiration_at?: string;
6038
+ expiration_at?: string | null;
5635
6039
  /**
5636
6040
  * 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.
5637
6041
  * @example false
@@ -5680,7 +6084,7 @@ export interface WalletObject {
5680
6084
  * The name of the wallet.
5681
6085
  * @example "Prepaid"
5682
6086
  */
5683
- name?: string;
6087
+ name?: string | null;
5684
6088
  /**
5685
6089
  * 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.
5686
6090
  * @pattern ^[0-9]+.?[0-9]*$
@@ -5738,14 +6142,14 @@ export interface WalletObject {
5738
6142
  * 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.
5739
6143
  * @example false
5740
6144
  */
5741
- invoice_requires_successful_payment?: boolean;
6145
+ invoice_requires_successful_payment: boolean;
5742
6146
  /** Set wallet limitations to fee types. */
5743
6147
  applies_to?: {
5744
6148
  /**
5745
6149
  * 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.
5746
6150
  * @example ["charge"]
5747
6151
  */
5748
- fee_types?: any[] | null;
6152
+ fee_types?: ("charge" | "subscription" | "commitment")[];
5749
6153
  };
5750
6154
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
5751
6155
  recurring_transaction_rules?: WalletRecurringTransactionRule[];
@@ -5782,7 +6186,7 @@ export interface WalletCreateInput {
5782
6186
  * The name of the wallet.
5783
6187
  * @example "Prepaid"
5784
6188
  */
5785
- name?: string;
6189
+ name?: string | null;
5786
6190
  /**
5787
6191
  * 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.
5788
6192
  * @pattern ^[0-9]+.?[0-9]*$
@@ -5826,12 +6230,7 @@ export interface WalletCreateInput {
5826
6230
  * 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.
5827
6231
  * @example [{"key":"example_key","value":"example_value"},{"key":"another_key","value":"another_value"}]
5828
6232
  */
5829
- transaction_metadata?: {
5830
- /** The unique identifier for the attribute. */
5831
- key?: string;
5832
- /** The corresponding value for the key. */
5833
- value?: string;
5834
- }[];
6233
+ transaction_metadata?: any[] | null;
5835
6234
  /** Set wallet limitations to fee types. */
5836
6235
  applies_to?: {
5837
6236
  /**
@@ -5841,74 +6240,7 @@ export interface WalletCreateInput {
5841
6240
  fee_types?: any[] | null;
5842
6241
  };
5843
6242
  /** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
5844
- recurring_transaction_rules?: {
5845
- /**
5846
- * The number of paid credits used for recurring top-up.
5847
- * @pattern ^[0-9]+.?[0-9]*$
5848
- * @example "20.0"
5849
- */
5850
- paid_credits?: string | null;
5851
- /**
5852
- * The number of free granted credits used for recurring top-up.
5853
- * @pattern ^[0-9]+.?[0-9]*$
5854
- * @example "10.0"
5855
- */
5856
- granted_credits?: string | null;
5857
- /**
5858
- * The method used for recurring top-up. Possible values are `fixed` or `target`.
5859
- * @example "target"
5860
- */
5861
- method?: "fixed" | "target";
5862
- /**
5863
- * The trigger. Possible values are `interval` or `threshold`.
5864
- * @example "interval"
5865
- */
5866
- trigger: "interval" | "threshold";
5867
- /**
5868
- * 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` or `yearly`. Required only when trigger is `interval`.
5869
- * @example "monthly"
5870
- */
5871
- interval?: "weekly" | "monthly" | "quarterly" | "yearly";
5872
- /**
5873
- * 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).
5874
- * @format date-time
5875
- * @example "2022-08-08T00:00:00Z"
5876
- */
5877
- started_at?: string;
5878
- /**
5879
- * 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).
5880
- * @format date-time
5881
- * @example "2023-09-30T23:59:59Z"
5882
- */
5883
- expiration_at?: string | null;
5884
- /**
5885
- * 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`.
5886
- * @pattern ^[0-9]+.?[0-9]*$
5887
- * @example "20.0"
5888
- */
5889
- threshold_credits?: string;
5890
- /**
5891
- * 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`.
5892
- * @pattern ^[0-9]+.?[0-9]*$
5893
- * @example "200.0"
5894
- */
5895
- target_ongoing_balance?: string;
5896
- /**
5897
- * 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.
5898
- * @example false
5899
- */
5900
- invoice_requires_successful_payment?: boolean;
5901
- /**
5902
- * 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.
5903
- * @example [{"key":"example_key","value":"example_value"},{"key":"another_key","value":"another_value"}]
5904
- */
5905
- transaction_metadata?: {
5906
- /** The unique identifier for the attribute. */
5907
- key?: string;
5908
- /** The value associated with the key. */
5909
- value?: string;
5910
- }[];
5911
- }[];
6243
+ recurring_transaction_rules?: any[] | null;
5912
6244
  };
5913
6245
  }
5914
6246
  export interface Wallet {
@@ -5966,19 +6298,19 @@ export interface WalletUpdateInput {
5966
6298
  * @pattern ^[0-9]+.?[0-9]*$
5967
6299
  * @example "20.0"
5968
6300
  */
5969
- paid_credits?: string;
6301
+ paid_credits?: string | null;
5970
6302
  /**
5971
6303
  * The number of free granted credits. Required only if there is no paid credits.
5972
6304
  * @pattern ^[0-9]+.?[0-9]*$
5973
6305
  * @example "10.0"
5974
6306
  */
5975
- granted_credits?: string;
6307
+ granted_credits?: string | null;
5976
6308
  /**
5977
6309
  * 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).
5978
6310
  * @format date-time
5979
6311
  * @example "2022-08-08T00:00:00Z"
5980
6312
  */
5981
- started_at?: string;
6313
+ started_at?: string | null;
5982
6314
  /**
5983
6315
  * 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).
5984
6316
  * @format date-time
@@ -6030,19 +6362,19 @@ export interface WalletTransactionCreateInput {
6030
6362
  * @pattern ^[0-9]+.?[0-9]*$
6031
6363
  * @example "20.0"
6032
6364
  */
6033
- paid_credits?: string;
6365
+ paid_credits?: string | null;
6034
6366
  /**
6035
6367
  * The number of free granted credits.
6036
6368
  * @pattern ^[0-9]+.?[0-9]*$
6037
6369
  * @example "10.0"
6038
6370
  */
6039
- granted_credits?: string;
6371
+ granted_credits?: string | null;
6040
6372
  /**
6041
6373
  * The number of voided credits.
6042
6374
  * @pattern ^[0-9]+.?[0-9]*$
6043
6375
  * @example "5.0"
6044
6376
  */
6045
- voided_credits?: string;
6377
+ voided_credits?: string | null;
6046
6378
  /**
6047
6379
  * 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.
6048
6380
  * @example false
@@ -6052,12 +6384,7 @@ export interface WalletTransactionCreateInput {
6052
6384
  * This optional field allows you to store a list of key-value pairs that hold additional information or custom attributes related to the data.
6053
6385
  * @example [{"key":"example key","value":"example value"},{"key":"another key","value":"another value"}]
6054
6386
  */
6055
- metadata?: {
6056
- /** The unique identifier for the attribute. */
6057
- key?: string;
6058
- /** The value associated with the key. */
6059
- value?: string;
6060
- }[];
6387
+ metadata?: any[] | null;
6061
6388
  };
6062
6389
  }
6063
6390
  export interface WalletTransactionObject {
@@ -6079,10 +6406,10 @@ export interface WalletTransactionObject {
6079
6406
  */
6080
6407
  status: "pending" | "settled" | "failed";
6081
6408
  /**
6082
- * The source field represents the origin or trigger of the wallet transaction. Possible values are `manual`, `interval`. `threshold`
6409
+ * The source field represents the origin or trigger of the wallet transaction. Possible values are `manual`, `interval`, `threshold`
6083
6410
  * @example "manual"
6084
6411
  */
6085
- source?: "manual" | "interval" | "threshold";
6412
+ source: "manual" | "interval" | "threshold";
6086
6413
  /**
6087
6414
  * The transaction status of the wallet transaction. Possible values are `purchased` (with pending or settled status), `granted` (without invoice_id), `voided` or `invoiced`.
6088
6415
  * @example "purchased"
@@ -6125,13 +6452,13 @@ export interface WalletTransactionObject {
6125
6452
  * @format date-time
6126
6453
  * @example "2022-04-29T08:59:51Z"
6127
6454
  */
6128
- settled_at?: string;
6455
+ settled_at?: string | null;
6129
6456
  /**
6130
6457
  * The date when the wallet transaction failed, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
6131
6458
  * @format date-time
6132
6459
  * @example "2022-04-29T08:59:51Z"
6133
6460
  */
6134
- failed_at?: string;
6461
+ failed_at?: string | null;
6135
6462
  /**
6136
6463
  * The date of the wallet transaction creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
6137
6464
  * @format date-time
@@ -6435,8 +6762,8 @@ export interface EventErrorsObject {
6435
6762
  */
6436
6763
  status: number;
6437
6764
  /**
6438
- * HTTP error description. It will always be "Unprocessable Entity"
6439
- * @example "Unprocessable Entity"
6765
+ * HTTP error description. It will always be "Unprocessable entity"
6766
+ * @example "Unprocessable entity"
6440
6767
  */
6441
6768
  error: string;
6442
6769
  message: string | Record<string, any>;
@@ -6458,6 +6785,8 @@ export interface EventsErrorsObject {
6458
6785
  * @example ["transaction_1234567890"]
6459
6786
  */
6460
6787
  invalid_filter_values: string[];
6788
+ /** @deprecated */
6789
+ missing_group_key: string[];
6461
6790
  }
6462
6791
  export interface FeeTaxProviderErrorObject {
6463
6792
  /**
@@ -6645,9 +6974,6 @@ export interface WalletTransactionPaymentFailureObject {
6645
6974
  payment_provider_code?: string;
6646
6975
  provider_error?: string | Record<string, any>;
6647
6976
  }
6648
- export interface CreditNotes {
6649
- credit_notes: CreditNoteObject[];
6650
- }
6651
6977
  export type CustomerPaymentProvidernErrorObject = CustomerPaymentProviderErrorObject;
6652
6978
  export type QueryParamsType = Record<string | number, any>;
6653
6979
  export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
@@ -6854,7 +7180,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6854
7180
  * @request POST:/add_ons
6855
7181
  * @secure
6856
7182
  */
6857
- createAddOn: (data: AddOnCreateInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
7183
+ createAddOn: (data: AddOnCreateInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
6858
7184
  /**
6859
7185
  * @description This endpoint is used to list all existing add-ons.
6860
7186
  *
@@ -6875,7 +7201,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6875
7201
  * @example 20
6876
7202
  */
6877
7203
  per_page?: number;
6878
- }, params?: RequestParams) => Promise<HttpResponse<AddOnsPaginated, ApiErrorUnauthorized>>;
7204
+ }, params?: RequestParams) => Promise<HttpResponse<AddOnsPaginated, ApiErrorUnauthorized | ApiErrorForbidden>>;
6879
7205
  /**
6880
7206
  * @description This endpoint is used to update an existing add-on.
6881
7207
  *
@@ -6885,7 +7211,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6885
7211
  * @request PUT:/add_ons/{code}
6886
7212
  * @secure
6887
7213
  */
6888
- updateAddOn: (code: string, data: AddOnUpdateInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7214
+ updateAddOn: (code: string, data: AddOnUpdateInput, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
6889
7215
  /**
6890
7216
  * @description This endpoint is used to retrieve a specific add-on.
6891
7217
  *
@@ -6895,7 +7221,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6895
7221
  * @request GET:/add_ons/{code}
6896
7222
  * @secure
6897
7223
  */
6898
- findAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorNotFound>>;
7224
+ findAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
6899
7225
  /**
6900
7226
  * @description This endpoint is used to delete an existing add-on.
6901
7227
  *
@@ -6905,7 +7231,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6905
7231
  * @request DELETE:/add_ons/{code}
6906
7232
  * @secure
6907
7233
  */
6908
- destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorNotFound>>;
7234
+ destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
6909
7235
  };
6910
7236
  apiLogs: {
6911
7237
  /**
@@ -6952,9 +7278,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6952
7278
  "http_statuses[]"?: ("succeeded" | "failed" | number)[];
6953
7279
  /**
6954
7280
  * Filter results by API version
6955
- * @example ["v1"]
7281
+ * @example "v1"
6956
7282
  */
6957
- "api_version[]"?: string[];
7283
+ api_version?: string;
6958
7284
  /**
6959
7285
  * Filter results by the path of the request
6960
7286
  * @example "/billable_metrics/"
@@ -6995,7 +7321,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6995
7321
  * @example 12
6996
7322
  */
6997
7323
  months?: number;
6998
- }, params?: RequestParams) => Promise<HttpResponse<GrossRevenues, ApiErrorUnauthorized>>;
7324
+ }, params?: RequestParams) => Promise<HttpResponse<GrossRevenues, ApiErrorUnauthorized | ApiErrorForbidden>>;
6999
7325
  /**
7000
7326
  * @description Represents a monthly aggregation, detailing both the total count and the cumulative amount of invoices that have been marked as `finalized`. This report sorts invoices categorically based on their `payment_status`.
7001
7327
  *
@@ -7056,7 +7382,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7056
7382
  * @example 12
7057
7383
  */
7058
7384
  months?: number;
7059
- }, params?: RequestParams) => Promise<HttpResponse<Mrrs, ApiErrorUnauthorized>>;
7385
+ }, params?: RequestParams) => Promise<HttpResponse<Mrrs, ApiErrorUnauthorized | ApiErrorForbidden>>;
7060
7386
  /**
7061
7387
  * @description Overdue balance is the total amount associated with overdue invoices (invoices with pending or failed payments which are past their due dates).
7062
7388
  *
@@ -7079,7 +7405,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7079
7405
  * @example 12
7080
7406
  */
7081
7407
  months?: number;
7082
- }, params?: RequestParams) => Promise<HttpResponse<OverdueBalances, ApiErrorUnauthorized>>;
7408
+ }, params?: RequestParams) => Promise<HttpResponse<OverdueBalances, ApiErrorUnauthorized | ApiErrorForbidden>>;
7083
7409
  };
7084
7410
  appliedCoupons: {
7085
7411
  /**
@@ -7575,7 +7901,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7575
7901
  * @request POST:/events
7576
7902
  * @secure
7577
7903
  */
7578
- createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
7904
+ createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<EventCreated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
7579
7905
  /**
7580
7906
  * @description This endpoint is used for retrieving all events.
7581
7907
  *
@@ -7618,7 +7944,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7618
7944
  * @example "2022-08-08T00:00:00Z"
7619
7945
  */
7620
7946
  timestamp_to?: string;
7621
- }, params?: RequestParams) => Promise<HttpResponse<EventsPaginated, ApiErrorUnauthorized>>;
7947
+ }, params?: RequestParams) => Promise<HttpResponse<EventsPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden>>;
7622
7948
  /**
7623
7949
  * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
7624
7950
  *
@@ -7628,7 +7954,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7628
7954
  * @request POST:/events/batch
7629
7955
  * @secure
7630
7956
  */
7631
- createBatchEvents: (data: EventBatchInput, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
7957
+ createBatchEvents: (data: EventBatchInput, params?: RequestParams) => Promise<HttpResponse<EventsCreated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
7632
7958
  /**
7633
7959
  * @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple pay in advance charges
7634
7960
  *
@@ -7638,7 +7964,27 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7638
7964
  * @request POST:/events/estimate_fees
7639
7965
  * @secure
7640
7966
  */
7641
- eventEstimateFees: (data: EventEstimateFeesInput, params?: RequestParams) => Promise<HttpResponse<Fees, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
7967
+ eventEstimateFees: (data: EventEstimateFeesInput, params?: RequestParams) => Promise<HttpResponse<Fees, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
7968
+ /**
7969
+ * @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple pay in advance standard or percentage charges
7970
+ *
7971
+ * @tags events
7972
+ * @name EventEstimateInstantFees
7973
+ * @summary Estimate instant fees for a pay in advance charge
7974
+ * @request POST:/events/estimate_instant_fees
7975
+ * @secure
7976
+ */
7977
+ eventEstimateInstantFees: (data: EventEstimateInstantFeesInput, params?: RequestParams) => Promise<HttpResponse<FeesEstimate, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
7978
+ /**
7979
+ * @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple pay in advance standard or percentage charges
7980
+ *
7981
+ * @tags events
7982
+ * @name EventBatchEstimateInstantFees
7983
+ * @summary Batch estimate instant fees for a pay in advance charge
7984
+ * @request POST:/events/batch_estimate_instant_fees
7985
+ * @secure
7986
+ */
7987
+ eventBatchEstimateInstantFees: (data: EventBatchEstimateInstantFeesInput, params?: RequestParams) => Promise<HttpResponse<FeesEstimate, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
7642
7988
  /**
7643
7989
  * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
7644
7990
  *
@@ -7648,7 +7994,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
7648
7994
  * @request GET:/events/{transaction_id}
7649
7995
  * @secure
7650
7996
  */
7651
- findEvent: (transactionId: string, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorUnauthorized | ApiErrorNotFound>>;
7997
+ findEvent: (transactionId: string, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
7652
7998
  };
7653
7999
  fees: {
7654
8000
  /**
@@ -8080,6 +8426,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8080
8426
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
8081
8427
  */
8082
8428
  external_customer_id?: string;
8429
+ /**
8430
+ * Filter by payment status. Possible values are `pending`, `failed` or `succeeded`.
8431
+ * @example "pending"
8432
+ */
8433
+ payment_status?: "pending" | "failed" | "succeeded";
8083
8434
  }, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized>>;
8084
8435
  };
8085
8436
  payments: {
@@ -8289,6 +8640,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8289
8640
  * @example "pending"
8290
8641
  */
8291
8642
  status?: string;
8643
+ /**
8644
+ * When a pay-in-advance subscription is terminated before the end of its billing period, we generate a credit note for the unused subscription time by default.
8645
+ * This field allows you to control the behavior of the credit note generation:
8646
+ *
8647
+ * - `credit`: A credit note is generated for the unused subscription time.
8648
+ * - `skip`: No credit note is generated for the unused subscription time.
8649
+ *
8650
+ * _Note: This field is only applicable to pay-in-advance plans and is ignored for pay-in-arrears plans._
8651
+ * @example "credit"
8652
+ */
8653
+ on_termination_credit_note?: "credit" | "skip";
8654
+ /**
8655
+ * When a subscription is terminated before the end of its billing period, we generate an invoice for the unbilled usage.
8656
+ * This field allows you to control the behavior of the invoice generation:
8657
+ *
8658
+ * - `generate`: An invoice is generated for the unbilled usage.
8659
+ * - `skip`: No invoice is generated for the unbilled usage.
8660
+ * @example "generate"
8661
+ */
8662
+ on_termination_invoice?: "generate" | "skip";
8292
8663
  }, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
8293
8664
  /**
8294
8665
  * @description This endpoint enables the retrieval of the lifetime usage of a subscription.
@@ -8434,7 +8805,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8434
8805
  * @request POST:/wallets
8435
8806
  * @secure
8436
8807
  */
8437
- createWallet: (data: WalletCreateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
8808
+ createWallet: (data: WalletCreateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
8438
8809
  /**
8439
8810
  * @description This endpoint is used to list all wallets with prepaid credits.
8440
8811
  *
@@ -8460,7 +8831,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8460
8831
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
8461
8832
  */
8462
8833
  external_customer_id: string;
8463
- }, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized>>;
8834
+ }, params?: RequestParams) => Promise<HttpResponse<WalletsPaginated, ApiErrorUnauthorized | ApiErrorForbidden>>;
8464
8835
  /**
8465
8836
  * @description This endpoint is used to update an existing wallet with prepaid credits.
8466
8837
  *
@@ -8470,7 +8841,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8470
8841
  * @request PUT:/wallets/{lago_id}
8471
8842
  * @secure
8472
8843
  */
8473
- updateWallet: (lagoId: string, data: WalletUpdateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
8844
+ updateWallet: (lagoId: string, data: WalletUpdateInput, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden | ApiErrorNotFound>>;
8474
8845
  /**
8475
8846
  * @description This endpoint is used to retrieve an existing wallet with prepaid credits.
8476
8847
  *
@@ -8480,7 +8851,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8480
8851
  * @request GET:/wallets/{lago_id}
8481
8852
  * @secure
8482
8853
  */
8483
- findWallet: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorNotFound>>;
8854
+ findWallet: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
8484
8855
  /**
8485
8856
  * @description This endpoint is used to terminate an existing wallet with prepaid credits.
8486
8857
  *
@@ -8490,7 +8861,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8490
8861
  * @request DELETE:/wallets/{lago_id}
8491
8862
  * @secure
8492
8863
  */
8493
- destroyWallet: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
8864
+ destroyWallet: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Wallet, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
8494
8865
  /**
8495
8866
  * @description This endpoint is used to list all wallet transactions.
8496
8867
  *
@@ -8526,7 +8897,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8526
8897
  * @example "inbound"
8527
8898
  */
8528
8899
  transaction_type?: string;
8529
- }, params?: RequestParams) => Promise<HttpResponse<WalletTransactionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
8900
+ }, params?: RequestParams) => Promise<HttpResponse<WalletTransactionsPaginated, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
8530
8901
  };
8531
8902
  walletTransactions: {
8532
8903
  /**
@@ -8538,7 +8909,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8538
8909
  * @request POST:/wallet_transactions
8539
8910
  * @secure
8540
8911
  */
8541
- createWalletTransaction: (data: WalletTransactionCreateInput, params?: RequestParams) => Promise<HttpResponse<WalletTransactions, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest>>;
8912
+ createWalletTransaction: (data: WalletTransactionCreateInput, params?: RequestParams) => Promise<HttpResponse<WalletTransactions, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorForbidden>>;
8542
8913
  /**
8543
8914
  * @description This endpoint is used to retrieve a specific wallet transactions.
8544
8915
  *
@@ -8548,7 +8919,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8548
8919
  * @request GET:/wallet_transactions/{lago_id}
8549
8920
  * @secure
8550
8921
  */
8551
- findWalletTransaction: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WalletTransactionObject, ApiErrorUnauthorized | ApiErrorNotFound>>;
8922
+ findWalletTransaction: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WalletTransactionObject, ApiErrorUnauthorized | ApiErrorForbidden | ApiErrorNotFound>>;
8552
8923
  /**
8553
8924
  * @description This endpoint generates a checkout link for a specific wallet transaction.
8554
8925
  *
@@ -8558,7 +8929,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8558
8929
  * @request POST:/wallet_transactions/{lago_id}/payment_url
8559
8930
  * @secure
8560
8931
  */
8561
- walletTransactionPaymentUrl: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WalletTransactionPaymentUrl, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
8932
+ walletTransactionPaymentUrl: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WalletTransactionPaymentUrl, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorForbidden | ApiErrorNotFound>>;
8562
8933
  };
8563
8934
  webhooks: {
8564
8935
  /**