lago-javascript-client 0.51.0-beta → 0.53.0-beta
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.
- package/esm/openapi/client.d.ts +521 -7
- package/esm/openapi/client.js +103 -1
- package/package.json +1 -1
- package/script/openapi/client.d.ts +521 -7
- package/script/openapi/client.js +103 -1
|
@@ -1373,6 +1373,11 @@ export interface CustomerChargeUsageObject {
|
|
|
1373
1373
|
* @example "graduated"
|
|
1374
1374
|
*/
|
|
1375
1375
|
charge_model: "standard" | "graduated" | "package" | "percentage" | "volume";
|
|
1376
|
+
/**
|
|
1377
|
+
* 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.
|
|
1378
|
+
* @example "Setup"
|
|
1379
|
+
*/
|
|
1380
|
+
invoice_display_name?: string;
|
|
1376
1381
|
};
|
|
1377
1382
|
/** The related billable metric object. */
|
|
1378
1383
|
billable_metric: {
|
|
@@ -1961,24 +1966,24 @@ export interface FeeObject {
|
|
|
1961
1966
|
*/
|
|
1962
1967
|
lago_true_up_parent_fee_id?: string | null;
|
|
1963
1968
|
/**
|
|
1964
|
-
* Unique identifier assigned to the subscription, created by Lago. This field is specifically displayed when the fee type is charge
|
|
1969
|
+
* Unique identifier assigned to the subscription, created by Lago. This field is specifically displayed when the fee type is charge or subscription.
|
|
1965
1970
|
* @format uuid
|
|
1966
1971
|
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1967
1972
|
*/
|
|
1968
1973
|
lago_subscription_id?: string | null;
|
|
1969
1974
|
/**
|
|
1970
|
-
* Unique identifier assigned to the customer, created by Lago. This field is specifically displayed when the fee type is charge
|
|
1975
|
+
* Unique identifier assigned to the customer, created by Lago. This field is specifically displayed when the fee type is charge or subscription.
|
|
1971
1976
|
* @format uuid
|
|
1972
1977
|
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1973
1978
|
*/
|
|
1974
1979
|
lago_customer_id?: string | null;
|
|
1975
1980
|
/**
|
|
1976
|
-
* Unique identifier assigned to the customer in your application. This field is specifically displayed when the fee type is charge
|
|
1981
|
+
* Unique identifier assigned to the customer in your application. This field is specifically displayed when the fee type is charge or subscription.
|
|
1977
1982
|
* @example "external_id"
|
|
1978
1983
|
*/
|
|
1979
1984
|
external_customer_id?: string | null;
|
|
1980
1985
|
/**
|
|
1981
|
-
* Unique identifier assigned to the subscription in your application. This field is specifically displayed when the fee type is charge
|
|
1986
|
+
* Unique identifier assigned to the subscription in your application. This field is specifically displayed when the fee type is charge or subscription.
|
|
1982
1987
|
* @example "external_id"
|
|
1983
1988
|
*/
|
|
1984
1989
|
external_subscription_id?: string | null;
|
|
@@ -2082,6 +2087,176 @@ export interface FeeObject {
|
|
|
2082
2087
|
* @example "transaction_1234567890"
|
|
2083
2088
|
*/
|
|
2084
2089
|
event_transaction_id?: string | null;
|
|
2090
|
+
/** List of all unit amount details for calculating the fee. */
|
|
2091
|
+
amount_details?: {
|
|
2092
|
+
/** Graduated ranges, used for a `graduated` charge model. */
|
|
2093
|
+
graduated_ranges?: {
|
|
2094
|
+
/**
|
|
2095
|
+
* Total units received in Lago.
|
|
2096
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2097
|
+
* @example "10.0"
|
|
2098
|
+
*/
|
|
2099
|
+
units: string;
|
|
2100
|
+
/**
|
|
2101
|
+
* Lower value of a tier. It is either 0 or the previous range's `to_value + 1`.
|
|
2102
|
+
* @example 0
|
|
2103
|
+
*/
|
|
2104
|
+
from_value: number;
|
|
2105
|
+
/**
|
|
2106
|
+
* Highest value of a tier.
|
|
2107
|
+
* - This value is higher than the from_value of the same tier.
|
|
2108
|
+
* - This value is null for the last tier.
|
|
2109
|
+
* @example 10
|
|
2110
|
+
*/
|
|
2111
|
+
to_value: number | null;
|
|
2112
|
+
/**
|
|
2113
|
+
* Flat unit amount within a specified tier.
|
|
2114
|
+
* @example "1.0"
|
|
2115
|
+
*/
|
|
2116
|
+
flat_unit_amount: string;
|
|
2117
|
+
/**
|
|
2118
|
+
* Amount per unit within a specified tier.
|
|
2119
|
+
* @example "1.0"
|
|
2120
|
+
*/
|
|
2121
|
+
per_unit_amount: string;
|
|
2122
|
+
/**
|
|
2123
|
+
* Total amount of received units to be charged within a specified tier.
|
|
2124
|
+
* @example "10.0"
|
|
2125
|
+
*/
|
|
2126
|
+
per_unit_total_amount: string;
|
|
2127
|
+
/**
|
|
2128
|
+
* Total amount to be charged for a specific tier, taking into account the flat_unit_amount and the per_unit_total_amount.
|
|
2129
|
+
* @example "11.0"
|
|
2130
|
+
*/
|
|
2131
|
+
total_with_flat_amount: string;
|
|
2132
|
+
}[];
|
|
2133
|
+
/** Graduated percentage ranges, used for a `graduated_percentage` charge model. */
|
|
2134
|
+
graduated_percentage_ranges?: {
|
|
2135
|
+
/**
|
|
2136
|
+
* Total units received in Lago.
|
|
2137
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2138
|
+
* @example "10.0"
|
|
2139
|
+
*/
|
|
2140
|
+
units: string;
|
|
2141
|
+
/**
|
|
2142
|
+
* Lower value of a tier. It is either 0 or the previous range's `to_value + 1`.
|
|
2143
|
+
* @example 0
|
|
2144
|
+
*/
|
|
2145
|
+
from_value: number;
|
|
2146
|
+
/**
|
|
2147
|
+
* Highest value of a tier.
|
|
2148
|
+
* - This value is higher than the from_value of the same tier.
|
|
2149
|
+
* - This value is null for the last tier.
|
|
2150
|
+
* @example 10
|
|
2151
|
+
*/
|
|
2152
|
+
to_value: number | null;
|
|
2153
|
+
/**
|
|
2154
|
+
* Flat unit amount within a specified tier.
|
|
2155
|
+
* @example "1.0"
|
|
2156
|
+
*/
|
|
2157
|
+
flat_unit_amount: string;
|
|
2158
|
+
/**
|
|
2159
|
+
* Amount per unit within a specified tier.
|
|
2160
|
+
* @example "1.0"
|
|
2161
|
+
*/
|
|
2162
|
+
per_unit_amount: string;
|
|
2163
|
+
/**
|
|
2164
|
+
* Total amount of received units to be charged within a specified tier.
|
|
2165
|
+
* @example "10.0"
|
|
2166
|
+
*/
|
|
2167
|
+
per_unit_total_amount: string;
|
|
2168
|
+
/**
|
|
2169
|
+
* Total amount to be charged for a specific tier, taking into account the flat_unit_amount and the per_unit_total_amount.
|
|
2170
|
+
* @example "11.0"
|
|
2171
|
+
*/
|
|
2172
|
+
total_with_flat_amount: string;
|
|
2173
|
+
}[];
|
|
2174
|
+
/**
|
|
2175
|
+
* The quantity of units that are provided free of charge for each billing period in a `package` charge model.
|
|
2176
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2177
|
+
* @example "10.0"
|
|
2178
|
+
*/
|
|
2179
|
+
free_units?: string;
|
|
2180
|
+
/**
|
|
2181
|
+
* The quantity of units that are not provided free of charge for each billing period in a `package` charge model.
|
|
2182
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2183
|
+
* @example "40.0"
|
|
2184
|
+
*/
|
|
2185
|
+
paid_units?: string;
|
|
2186
|
+
/**
|
|
2187
|
+
* The quantity of units included, defined for Package or Percentage charge model.
|
|
2188
|
+
* @example 1000
|
|
2189
|
+
*/
|
|
2190
|
+
per_package_size?: number;
|
|
2191
|
+
/**
|
|
2192
|
+
* Total amount to charge for received paid_units, defined for Package or Percentage charge model.
|
|
2193
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2194
|
+
* @example "0.5"
|
|
2195
|
+
*/
|
|
2196
|
+
per_package_unit_amount?: string;
|
|
2197
|
+
/**
|
|
2198
|
+
* The total units received in Lago for the Percentage charge model.
|
|
2199
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2200
|
+
* @example "20.0"
|
|
2201
|
+
*/
|
|
2202
|
+
units?: string;
|
|
2203
|
+
/**
|
|
2204
|
+
* Total number of free events allowed for the Percentage charge model.
|
|
2205
|
+
* @example 10
|
|
2206
|
+
*/
|
|
2207
|
+
free_events?: number;
|
|
2208
|
+
/**
|
|
2209
|
+
* Amount per unit for the Percentage charge model.
|
|
2210
|
+
* @example "1.0"
|
|
2211
|
+
*/
|
|
2212
|
+
per_unit_amount?: string;
|
|
2213
|
+
/**
|
|
2214
|
+
* Total amount of received units to be charged for the Percentage charge model.
|
|
2215
|
+
* @example "10.0"
|
|
2216
|
+
*/
|
|
2217
|
+
per_unit_total_amount?: string;
|
|
2218
|
+
/**
|
|
2219
|
+
* Total number of paid events for the Percentage charge model.
|
|
2220
|
+
* @example 20
|
|
2221
|
+
*/
|
|
2222
|
+
paid_events?: number;
|
|
2223
|
+
/**
|
|
2224
|
+
* Fixed fee unit price per received paid_event for the Percentage charge model.
|
|
2225
|
+
* @example "1.0"
|
|
2226
|
+
*/
|
|
2227
|
+
fixed_fee_unit_amount?: string;
|
|
2228
|
+
/**
|
|
2229
|
+
* Total amount to charge for received paid_events for the Percentage charge model.
|
|
2230
|
+
* @example "20.0"
|
|
2231
|
+
*/
|
|
2232
|
+
fixed_fee_total_amount?: string;
|
|
2233
|
+
/**
|
|
2234
|
+
* Total adjustment amount linked to minimum and maximum spending per transaction for the Percentage charge model.
|
|
2235
|
+
* @example "20.0"
|
|
2236
|
+
*/
|
|
2237
|
+
min_max_adjustment_total_amount?: string;
|
|
2238
|
+
/** Volume ranges, used for a `volume` charge model. */
|
|
2239
|
+
volume_ranges?: {
|
|
2240
|
+
/**
|
|
2241
|
+
* The flat amount for a whole tier, excluding tax, for a `volume` charge model.
|
|
2242
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2243
|
+
* @example "0.5"
|
|
2244
|
+
*/
|
|
2245
|
+
per_unit_amount: string;
|
|
2246
|
+
/**
|
|
2247
|
+
* The unit price, excluding tax, for a specific tier of a `volume` charge model.
|
|
2248
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2249
|
+
* @example "10.0"
|
|
2250
|
+
*/
|
|
2251
|
+
flat_unit_amount: string;
|
|
2252
|
+
/**
|
|
2253
|
+
* Total amount of received units to be charged.
|
|
2254
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
2255
|
+
* @example "10.0"
|
|
2256
|
+
*/
|
|
2257
|
+
per_unit_total_amount: string;
|
|
2258
|
+
}[];
|
|
2259
|
+
};
|
|
2085
2260
|
/** Item attached to the fee */
|
|
2086
2261
|
item: {
|
|
2087
2262
|
/**
|
|
@@ -2139,6 +2314,23 @@ export interface FeeUpdateInput {
|
|
|
2139
2314
|
payment_status: "pending" | "succeeded" | "failed" | "refunded";
|
|
2140
2315
|
};
|
|
2141
2316
|
}
|
|
2317
|
+
export interface GrossRevenueObject {
|
|
2318
|
+
/**
|
|
2319
|
+
* Identifies the month to analyze revenue.
|
|
2320
|
+
* @example "2023-11-01T00:00:00.000Z"
|
|
2321
|
+
*/
|
|
2322
|
+
month: string;
|
|
2323
|
+
/**
|
|
2324
|
+
* The total amount of revenue for a period, expressed in cents.
|
|
2325
|
+
* @example 50000
|
|
2326
|
+
*/
|
|
2327
|
+
amount_cents?: number;
|
|
2328
|
+
/** The currency of revenue analytics. Format must be ISO 4217. */
|
|
2329
|
+
currency?: Currency;
|
|
2330
|
+
}
|
|
2331
|
+
export interface GrossRevenues {
|
|
2332
|
+
gross_revenues: GrossRevenueObject[];
|
|
2333
|
+
}
|
|
2142
2334
|
export interface GroupObject {
|
|
2143
2335
|
/**
|
|
2144
2336
|
* Unique identifier of a specific group associated with the billable metric.
|
|
@@ -2176,6 +2368,23 @@ export interface GroupsPaginated {
|
|
|
2176
2368
|
groups: GroupObject[];
|
|
2177
2369
|
meta: PaginationMeta;
|
|
2178
2370
|
}
|
|
2371
|
+
export interface MrrObject {
|
|
2372
|
+
/**
|
|
2373
|
+
* Identifies the month to analyze MRR.
|
|
2374
|
+
* @example "2023-11-01T00:00:00.000Z"
|
|
2375
|
+
*/
|
|
2376
|
+
month: string;
|
|
2377
|
+
/**
|
|
2378
|
+
* The total amount of MRR, expressed in cents.
|
|
2379
|
+
* @example 50000
|
|
2380
|
+
*/
|
|
2381
|
+
amount_cents?: number;
|
|
2382
|
+
/** The currency of MRR analytics. Format must be ISO 4217. */
|
|
2383
|
+
currency?: Currency;
|
|
2384
|
+
}
|
|
2385
|
+
export interface Mrrs {
|
|
2386
|
+
mrrs: MrrObject[];
|
|
2387
|
+
}
|
|
2179
2388
|
export interface Invoice {
|
|
2180
2389
|
invoice: InvoiceObjectExtended;
|
|
2181
2390
|
}
|
|
@@ -2192,6 +2401,55 @@ export type InvoiceAppliedTaxObject = BaseAppliedTax & {
|
|
|
2192
2401
|
*/
|
|
2193
2402
|
fees_amount_cents?: number;
|
|
2194
2403
|
};
|
|
2404
|
+
export interface InvoiceCollectionObject {
|
|
2405
|
+
/**
|
|
2406
|
+
* Identifies the month to analyze revenue.
|
|
2407
|
+
* @example "2023-11-01T00:00:00.000Z"
|
|
2408
|
+
*/
|
|
2409
|
+
month: string;
|
|
2410
|
+
/**
|
|
2411
|
+
* The payment status of the invoices.
|
|
2412
|
+
* @example "succeeded"
|
|
2413
|
+
*/
|
|
2414
|
+
payment_status?: "pending" | "succeeded" | "failed";
|
|
2415
|
+
/**
|
|
2416
|
+
* Contains invoices count.
|
|
2417
|
+
* @example 10
|
|
2418
|
+
*/
|
|
2419
|
+
invoices_count: number;
|
|
2420
|
+
/**
|
|
2421
|
+
* The total amount of revenue for a period, expressed in cents.
|
|
2422
|
+
* @example 50000
|
|
2423
|
+
*/
|
|
2424
|
+
amount_cents: number;
|
|
2425
|
+
/** The currency of revenue analytics. Format must be ISO 4217. */
|
|
2426
|
+
currency?: Currency;
|
|
2427
|
+
}
|
|
2428
|
+
export interface InvoiceCollections {
|
|
2429
|
+
invoice_collections: InvoiceCollectionObject[];
|
|
2430
|
+
}
|
|
2431
|
+
export interface InvoicedUsageObject {
|
|
2432
|
+
/**
|
|
2433
|
+
* Identifies the month to analyze revenue.
|
|
2434
|
+
* @example "2023-11-01T00:00:00.000Z"
|
|
2435
|
+
*/
|
|
2436
|
+
month: string;
|
|
2437
|
+
/**
|
|
2438
|
+
* The code of the usage-based billable metrics.
|
|
2439
|
+
* @example "code1"
|
|
2440
|
+
*/
|
|
2441
|
+
code?: string;
|
|
2442
|
+
/**
|
|
2443
|
+
* The total amount of revenue for a period, expressed in cents.
|
|
2444
|
+
* @example 50000
|
|
2445
|
+
*/
|
|
2446
|
+
amount_cents: number;
|
|
2447
|
+
/** The currency of revenue analytics. Format must be ISO 4217. */
|
|
2448
|
+
currency: Currency;
|
|
2449
|
+
}
|
|
2450
|
+
export interface InvoicedUsages {
|
|
2451
|
+
invoiced_usages: InvoicedUsageObject[];
|
|
2452
|
+
}
|
|
2195
2453
|
export interface InvoiceMetadataObject {
|
|
2196
2454
|
/**
|
|
2197
2455
|
* Unique identifier assigned to the invoice metadata within the Lago application.
|
|
@@ -2464,6 +2722,8 @@ export interface OrganizationObject {
|
|
|
2464
2722
|
webhook_urls?: string[] | null;
|
|
2465
2723
|
/** The country of your organization. */
|
|
2466
2724
|
country?: Country;
|
|
2725
|
+
/** The default currency of an organization. */
|
|
2726
|
+
default_currency?: Currency;
|
|
2467
2727
|
/**
|
|
2468
2728
|
* The first line of your organization’s billing address.
|
|
2469
2729
|
* @example "100 Brex Street"
|
|
@@ -2505,6 +2765,21 @@ export interface OrganizationObject {
|
|
|
2505
2765
|
* @example null
|
|
2506
2766
|
*/
|
|
2507
2767
|
legal_number?: string | null;
|
|
2768
|
+
/**
|
|
2769
|
+
* This parameter configures the method of incrementing invoice numbers for your customers.
|
|
2770
|
+
*
|
|
2771
|
+
* - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern.
|
|
2772
|
+
* - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month.
|
|
2773
|
+
*
|
|
2774
|
+
* The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer.
|
|
2775
|
+
* @example "per_customer"
|
|
2776
|
+
*/
|
|
2777
|
+
document_numbering: "per_customer" | "per_organization";
|
|
2778
|
+
/**
|
|
2779
|
+
* Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago.
|
|
2780
|
+
* @example "ORG-1234"
|
|
2781
|
+
*/
|
|
2782
|
+
document_number_prefix: string;
|
|
2508
2783
|
/**
|
|
2509
2784
|
* The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
|
|
2510
2785
|
* @example 30
|
|
@@ -2531,6 +2806,8 @@ export interface OrganizationUpdateInput {
|
|
|
2531
2806
|
webhook_url?: string | null;
|
|
2532
2807
|
/** The country of your organization. */
|
|
2533
2808
|
country?: Country;
|
|
2809
|
+
/** The default currency of an organization. */
|
|
2810
|
+
default_currency?: Currency;
|
|
2534
2811
|
/**
|
|
2535
2812
|
* The first line of your organization’s billing address.
|
|
2536
2813
|
* @example "100 Brex Street"
|
|
@@ -2572,6 +2849,21 @@ export interface OrganizationUpdateInput {
|
|
|
2572
2849
|
* @example null
|
|
2573
2850
|
*/
|
|
2574
2851
|
legal_number?: string | null;
|
|
2852
|
+
/**
|
|
2853
|
+
* This parameter configures the method of incrementing invoice numbers for your customers.
|
|
2854
|
+
*
|
|
2855
|
+
* - `per_customer`: Invoice numbers are incremented individually for each customer. This means every customer will have their own unique sequence of invoice numbers, separate from other customers. It ensures that each customer's invoice numbers follow a distinct and isolated numbering pattern.
|
|
2856
|
+
* - `per_organization`: Invoice number incrementation is made across your entire organization. Rather than individual sequences for each customer, all invoices within the organization follow a single, unified numbering system. This creates a continuous and organization-wide sequence for all invoice numbers. Invoices are incremented per month (dynamic value used is YYYYMM), and invoice numbers are reset at the end of each month.
|
|
2857
|
+
*
|
|
2858
|
+
* The default value for `document_numbering` is set to `per_customer`, meaning that, unless changed, invoice numbers will increment uniquely for each customer.
|
|
2859
|
+
* @example "per_customer"
|
|
2860
|
+
*/
|
|
2861
|
+
document_numbering?: "per_customer" | "per_organization";
|
|
2862
|
+
/**
|
|
2863
|
+
* Sets the prefix for invoices and credit notes. Default is the first three letters of your organization name plus the last four digits of your organization ID. Customizable within 1-10 characters, and automatically capitalized by Lago.
|
|
2864
|
+
* @example "ORG-1234"
|
|
2865
|
+
*/
|
|
2866
|
+
document_number_prefix?: string;
|
|
2575
2867
|
/**
|
|
2576
2868
|
* The net payment term, expressed in days, specifies the duration within which a customer is expected to remit payment after the invoice is finalized.
|
|
2577
2869
|
* @example 30
|
|
@@ -2784,6 +3076,12 @@ export interface PlanOverridesObject {
|
|
|
2784
3076
|
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2785
3077
|
*/
|
|
2786
3078
|
id?: string;
|
|
3079
|
+
/**
|
|
3080
|
+
* Unique identifier of the billable metric created by Lago.
|
|
3081
|
+
* @format uuid
|
|
3082
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3083
|
+
*/
|
|
3084
|
+
billable_metric_id?: string;
|
|
2787
3085
|
/**
|
|
2788
3086
|
* 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.
|
|
2789
3087
|
* @example "Setup"
|
|
@@ -3067,6 +3365,11 @@ export interface SubscriptionCreateInput {
|
|
|
3067
3365
|
};
|
|
3068
3366
|
}
|
|
3069
3367
|
export interface SubscriptionUpdateInput {
|
|
3368
|
+
/**
|
|
3369
|
+
* If the field is not defined and multiple `active` and `pending` subscriptions exists, Lago will update the `active` subscription. However, if you wish to update a `pending` subscription, please ensure that you include the `status` attribute with the `pending` value in your request body.
|
|
3370
|
+
* @example "active"
|
|
3371
|
+
*/
|
|
3372
|
+
status?: "active" | "pending";
|
|
3070
3373
|
subscription: {
|
|
3071
3374
|
/**
|
|
3072
3375
|
* The display name of the subscription on an invoice. This field allows for customization of the subscription's name for billing purposes, especially useful when a single customer has multiple subscriptions using the same plan.
|
|
@@ -3184,8 +3487,8 @@ export interface SubscriptionObject {
|
|
|
3184
3487
|
next_plan_code?: string | null;
|
|
3185
3488
|
/**
|
|
3186
3489
|
* The date when the plan will be downgraded, represented in ISO 8601 date format.
|
|
3187
|
-
* @format date
|
|
3188
|
-
* @example
|
|
3490
|
+
* @format date
|
|
3491
|
+
* @example "2022-04-30"
|
|
3189
3492
|
*/
|
|
3190
3493
|
downgrade_plan_date?: string | null;
|
|
3191
3494
|
}
|
|
@@ -3339,6 +3642,25 @@ export interface WalletCreateInput {
|
|
|
3339
3642
|
* @example "2022-07-07T23:59:59Z"
|
|
3340
3643
|
*/
|
|
3341
3644
|
expiration_at?: string | null;
|
|
3645
|
+
/** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
|
|
3646
|
+
recurring_transaction_rules?: {
|
|
3647
|
+
/**
|
|
3648
|
+
* The rule type. Possible values are `interval` or `threshold`.
|
|
3649
|
+
* @example "interval"
|
|
3650
|
+
*/
|
|
3651
|
+
rule_type: "interval" | "threshold";
|
|
3652
|
+
/**
|
|
3653
|
+
* 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 rule type is `interval`.
|
|
3654
|
+
* @example "monthly"
|
|
3655
|
+
*/
|
|
3656
|
+
interval?: "weekly" | "monthly" | "quarterly" | "yearly";
|
|
3657
|
+
/**
|
|
3658
|
+
* 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 rule type is set to `threshold`.
|
|
3659
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3660
|
+
* @example "20.0"
|
|
3661
|
+
*/
|
|
3662
|
+
threshold_credits?: string;
|
|
3663
|
+
}[];
|
|
3342
3664
|
};
|
|
3343
3665
|
}
|
|
3344
3666
|
export interface WalletObject {
|
|
@@ -3424,6 +3746,49 @@ export interface WalletObject {
|
|
|
3424
3746
|
* @example "2022-09-14T16:35:31Z"
|
|
3425
3747
|
*/
|
|
3426
3748
|
terminated_at?: string | null;
|
|
3749
|
+
/** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
|
|
3750
|
+
recurring_transaction_rules?: {
|
|
3751
|
+
/**
|
|
3752
|
+
* A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule.
|
|
3753
|
+
* @format uuid
|
|
3754
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3755
|
+
*/
|
|
3756
|
+
lago_id: string;
|
|
3757
|
+
/**
|
|
3758
|
+
* The rule type. Possible values are `interval` or `threshold`.
|
|
3759
|
+
* @example "interval"
|
|
3760
|
+
*/
|
|
3761
|
+
rule_type: "interval" | "threshold";
|
|
3762
|
+
/**
|
|
3763
|
+
* 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 if rule type is set to `interval`.
|
|
3764
|
+
* @example "monthly"
|
|
3765
|
+
*/
|
|
3766
|
+
interval?: "weekly" | "monthly" | "quarterly" | "yearly";
|
|
3767
|
+
/**
|
|
3768
|
+
* 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 rule type is set to `threshold`.
|
|
3769
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3770
|
+
* @example "20.0"
|
|
3771
|
+
*/
|
|
3772
|
+
threshold_credits?: string;
|
|
3773
|
+
/**
|
|
3774
|
+
* The number of paid credits. Required only if there is no granted credits.
|
|
3775
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3776
|
+
* @example "20.0"
|
|
3777
|
+
*/
|
|
3778
|
+
paid_credits: string;
|
|
3779
|
+
/**
|
|
3780
|
+
* The number of free granted credits. Required only if there is no paid credits.
|
|
3781
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3782
|
+
* @example "10.0"
|
|
3783
|
+
*/
|
|
3784
|
+
granted_credits: string;
|
|
3785
|
+
/**
|
|
3786
|
+
* 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
|
|
3787
|
+
* @format date-time
|
|
3788
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3789
|
+
*/
|
|
3790
|
+
created_at: string;
|
|
3791
|
+
}[];
|
|
3427
3792
|
}
|
|
3428
3793
|
export interface WalletsPaginated {
|
|
3429
3794
|
wallets: WalletObject[];
|
|
@@ -3518,6 +3883,43 @@ export interface WalletUpdateInput {
|
|
|
3518
3883
|
* @example "2022-07-07T23:59:59Z"
|
|
3519
3884
|
*/
|
|
3520
3885
|
expiration_at?: string | null;
|
|
3886
|
+
/** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
|
|
3887
|
+
recurring_transaction_rules?: {
|
|
3888
|
+
/**
|
|
3889
|
+
* A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule.
|
|
3890
|
+
* @format uuid
|
|
3891
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3892
|
+
*/
|
|
3893
|
+
lago_id?: string;
|
|
3894
|
+
/**
|
|
3895
|
+
* The rule type. Possible values are `interval` or `threshold`.
|
|
3896
|
+
* @example "interval"
|
|
3897
|
+
*/
|
|
3898
|
+
rule_type?: "interval" | "threshold";
|
|
3899
|
+
/**
|
|
3900
|
+
* 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 rule type is set to `interval`.
|
|
3901
|
+
* @example "monthly"
|
|
3902
|
+
*/
|
|
3903
|
+
interval?: "weekly" | "monthly" | "quarterly" | "yearly";
|
|
3904
|
+
/**
|
|
3905
|
+
* 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 rule type is set to `threshold`.
|
|
3906
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3907
|
+
* @example "20.0"
|
|
3908
|
+
*/
|
|
3909
|
+
threshold_credits?: string;
|
|
3910
|
+
/**
|
|
3911
|
+
* The number of paid credits. Required only if there is no granted credits.
|
|
3912
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3913
|
+
* @example "20.0"
|
|
3914
|
+
*/
|
|
3915
|
+
paid_credits?: string;
|
|
3916
|
+
/**
|
|
3917
|
+
* The number of free granted credits. Required only if there is no paid credits.
|
|
3918
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
3919
|
+
* @example "10.0"
|
|
3920
|
+
*/
|
|
3921
|
+
granted_credits?: string;
|
|
3922
|
+
}[];
|
|
3521
3923
|
};
|
|
3522
3924
|
}
|
|
3523
3925
|
export interface WebhookEndpoint {
|
|
@@ -3645,7 +4047,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
3645
4047
|
}
|
|
3646
4048
|
/**
|
|
3647
4049
|
* @title Lago API documentation
|
|
3648
|
-
* @version 0.
|
|
4050
|
+
* @version 0.53.0-beta
|
|
3649
4051
|
* @license AGPLv3
|
|
3650
4052
|
* @baseUrl https://api.getlago.com/api/v1
|
|
3651
4053
|
* @externalDocs https://github.com/getlago
|
|
@@ -3717,6 +4119,77 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
3717
4119
|
*/
|
|
3718
4120
|
destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
3719
4121
|
};
|
|
4122
|
+
analytics: {
|
|
4123
|
+
/**
|
|
4124
|
+
* @description Gross revenue is the sum of monthly `finalized` invoice payments and fees paid in advance that are not invoiceable. This total is calculated after deducting taxes and discounts.
|
|
4125
|
+
*
|
|
4126
|
+
* @tags analytics
|
|
4127
|
+
* @name FindAllGrossRevenues
|
|
4128
|
+
* @summary List gross revenue
|
|
4129
|
+
* @request GET:/analytics/gross_revenue
|
|
4130
|
+
* @secure
|
|
4131
|
+
*/
|
|
4132
|
+
findAllGrossRevenues: (query?: {
|
|
4133
|
+
/** Currency of revenue analytics. Format must be ISO 4217. */
|
|
4134
|
+
currency?: Currency;
|
|
4135
|
+
/**
|
|
4136
|
+
* The customer external unique identifier (provided by your own application). Use it to filter revenue analytics at the customer level.
|
|
4137
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
4138
|
+
*/
|
|
4139
|
+
external_customer_id?: string;
|
|
4140
|
+
}, params?: RequestParams) => Promise<HttpResponse<GrossRevenues, ApiErrorUnauthorized>>;
|
|
4141
|
+
/**
|
|
4142
|
+
* @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`.
|
|
4143
|
+
*
|
|
4144
|
+
* @tags analytics
|
|
4145
|
+
* @name FindAllInvoiceCollections
|
|
4146
|
+
* @summary List of finalized invoices
|
|
4147
|
+
* @request GET:/analytics/invoice_collection
|
|
4148
|
+
* @secure
|
|
4149
|
+
*/
|
|
4150
|
+
findAllInvoiceCollections: (query?: {
|
|
4151
|
+
/** The currency of revenue analytics. Format must be ISO 4217. */
|
|
4152
|
+
currency?: Currency;
|
|
4153
|
+
}, params?: RequestParams) => Promise<HttpResponse<InvoiceCollections, ApiErrorUnauthorized>>;
|
|
4154
|
+
/**
|
|
4155
|
+
* @description Reports a monthly analysis focused on the revenue generated from all usage-based fees. It exclusively accounts for revenue that has been formally invoiced. Importantly, this report does not include revenue related to the usage in the current billing period, limiting its scope to previously invoiced amounts.
|
|
4156
|
+
*
|
|
4157
|
+
* @tags analytics
|
|
4158
|
+
* @name FindAllInvoicedUsages
|
|
4159
|
+
* @summary List usage revenue
|
|
4160
|
+
* @request GET:/analytics/invoiced_usage
|
|
4161
|
+
* @secure
|
|
4162
|
+
*/
|
|
4163
|
+
findAllInvoicedUsages: (query?: {
|
|
4164
|
+
/** The currency of invoiced usage analytics. Format must be ISO 4217. */
|
|
4165
|
+
currency?: Currency;
|
|
4166
|
+
}, params?: RequestParams) => Promise<HttpResponse<InvoicedUsages, ApiErrorUnauthorized>>;
|
|
4167
|
+
/**
|
|
4168
|
+
* @description This endpoint is used to list MRR.
|
|
4169
|
+
*
|
|
4170
|
+
* @tags analytics
|
|
4171
|
+
* @name FindAllMrrs
|
|
4172
|
+
* @summary List MRR
|
|
4173
|
+
* @request GET:/analytics/mrr
|
|
4174
|
+
* @secure
|
|
4175
|
+
*/
|
|
4176
|
+
findAllMrrs: (query?: {
|
|
4177
|
+
/**
|
|
4178
|
+
* Quantifies the revenue generated from `subscription` fees on a monthly basis. This figure is calculated post-application of applicable taxes and deduction of any applicable discounts. The method of calculation varies based on the subscription billing cycle:
|
|
4179
|
+
*
|
|
4180
|
+
* - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued.
|
|
4181
|
+
* - Revenue from `quarterly` subscription invoices is distributed evenly over three months. This distribution applies to fees paid in advance (allocated to the next remaining months depending on calendar or anniversary billing) as well as to fees paid in arrears (allocated to the preceding months depending on calendar or anniversary billing).
|
|
4182
|
+
* - Revenue from `yearly` subscription invoices is distributed evenly over twelve months. This allocation is applicable for fees paid in advance (spread over the next remaining months depending on calendar or anniversary billing) and for fees paid in arrears (spread over the previous months depending on calendar or anniversary billing).
|
|
4183
|
+
* - Revenue from `weekly` subscription invoices, the total revenue from all invoices issued within a month is summed up. This total is then divided by the number of invoices issued during that month, and the result is multiplied by 4.33, representing the average number of weeks in a month.
|
|
4184
|
+
*/
|
|
4185
|
+
currency?: Currency;
|
|
4186
|
+
/**
|
|
4187
|
+
* Show data only for given number of months.
|
|
4188
|
+
* @example 12
|
|
4189
|
+
*/
|
|
4190
|
+
months?: number;
|
|
4191
|
+
}, params?: RequestParams) => Promise<HttpResponse<Mrrs, ApiErrorUnauthorized>>;
|
|
4192
|
+
};
|
|
3720
4193
|
appliedCoupons: {
|
|
3721
4194
|
/**
|
|
3722
4195
|
* @description This endpoint is used to apply a specific coupon to a customer, before or during a subscription.
|
|
@@ -4127,6 +4600,37 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
4127
4600
|
*/
|
|
4128
4601
|
periods_count?: number;
|
|
4129
4602
|
}, params?: RequestParams) => Promise<HttpResponse<CustomerPastUsage, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4603
|
+
/**
|
|
4604
|
+
* @description This endpoint regenerates the Payment Provider Checkout URL of a Customer.
|
|
4605
|
+
*
|
|
4606
|
+
* @tags customers
|
|
4607
|
+
* @name GenerateCustomerCheckoutUrl
|
|
4608
|
+
* @summary Generate a Customer Payment Provider Checkout URL
|
|
4609
|
+
* @request POST:/customers/{external_customer_id}/checkout_url
|
|
4610
|
+
* @secure
|
|
4611
|
+
*/
|
|
4612
|
+
generateCustomerCheckoutUrl: (externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<{
|
|
4613
|
+
/**
|
|
4614
|
+
* 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
|
|
4615
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
4616
|
+
*/
|
|
4617
|
+
lago_customer_id?: string | undefined;
|
|
4618
|
+
/**
|
|
4619
|
+
* The customer external unique identifier (provided by your own application)
|
|
4620
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
4621
|
+
*/
|
|
4622
|
+
external_customer_id?: string | undefined;
|
|
4623
|
+
/**
|
|
4624
|
+
* The Payment Provider name linked to the Customer.
|
|
4625
|
+
* @example "stripe"
|
|
4626
|
+
*/
|
|
4627
|
+
payment_provider?: string | undefined;
|
|
4628
|
+
/**
|
|
4629
|
+
* The new generated Payment Provider Checkout URL for the Customer.
|
|
4630
|
+
* @example "https://foo.bar"
|
|
4631
|
+
*/
|
|
4632
|
+
checkout_url?: string | undefined;
|
|
4633
|
+
}, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
4130
4634
|
};
|
|
4131
4635
|
events: {
|
|
4132
4636
|
/**
|
|
@@ -4402,6 +4906,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
4402
4906
|
* @secure
|
|
4403
4907
|
*/
|
|
4404
4908
|
retryPayment: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
|
|
4909
|
+
/**
|
|
4910
|
+
* @description This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`.
|
|
4911
|
+
*
|
|
4912
|
+
* @tags invoices
|
|
4913
|
+
* @name VoidInvoice
|
|
4914
|
+
* @summary Void an invoice
|
|
4915
|
+
* @request POST:/invoices/{lago_id}/void
|
|
4916
|
+
* @secure
|
|
4917
|
+
*/
|
|
4918
|
+
voidInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
4405
4919
|
};
|
|
4406
4920
|
organizations: {
|
|
4407
4921
|
/**
|