lago-javascript-client 1.18.0 → 1.22.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.
- package/esm/openapi/client.d.ts +780 -18
- package/esm/openapi/client.js +78 -7
- package/package.json +1 -1
- package/script/openapi/client.d.ts +780 -18
- package/script/openapi/client.js +78 -7
|
@@ -1372,6 +1372,11 @@ export interface CreditNoteObject {
|
|
|
1372
1372
|
/** Array of credit note's items. */
|
|
1373
1373
|
items?: CreditNoteItemObject[];
|
|
1374
1374
|
applied_taxes?: CreditNoteAppliedTaxObject[];
|
|
1375
|
+
/**
|
|
1376
|
+
* Indicates if the credit note belongs to self-billed invoice. Self-billing is a process where an organization creates the invoice on behalf of the partner.
|
|
1377
|
+
* @example false
|
|
1378
|
+
*/
|
|
1379
|
+
self_billed?: boolean;
|
|
1375
1380
|
}
|
|
1376
1381
|
export interface CreditNotes {
|
|
1377
1382
|
credit_notes: CreditNoteObject[];
|
|
@@ -1437,6 +1442,44 @@ export interface CreditNoteUpdateInput {
|
|
|
1437
1442
|
refund_status: "pending" | "succeeded" | "failed";
|
|
1438
1443
|
};
|
|
1439
1444
|
}
|
|
1445
|
+
export type CreditNoteExtendedObject = CreditNoteObject & {
|
|
1446
|
+
customer?: any;
|
|
1447
|
+
};
|
|
1448
|
+
export interface CreditNotePaymentProviderRefundError {
|
|
1449
|
+
/**
|
|
1450
|
+
* Unique identifier assigned to the credit note within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit note record within the Lago system.
|
|
1451
|
+
* @format uuid
|
|
1452
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1453
|
+
*/
|
|
1454
|
+
lago_credit_note_id: string;
|
|
1455
|
+
/**
|
|
1456
|
+
* 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.
|
|
1457
|
+
* @format uuid
|
|
1458
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1459
|
+
*/
|
|
1460
|
+
lago_customer_id: string;
|
|
1461
|
+
/**
|
|
1462
|
+
* The customer external unique identifier (provided by your own application)
|
|
1463
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
1464
|
+
*/
|
|
1465
|
+
external_customer_id: string;
|
|
1466
|
+
/**
|
|
1467
|
+
* Unique identifier of the customer within the payment provider
|
|
1468
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
1469
|
+
*/
|
|
1470
|
+
provider_customer_id?: string;
|
|
1471
|
+
/**
|
|
1472
|
+
* The type of payment provider code
|
|
1473
|
+
* @example "stripe"
|
|
1474
|
+
*/
|
|
1475
|
+
payment_provider: "adyen" | "cashfree" | "gocardless" | "stripe";
|
|
1476
|
+
/**
|
|
1477
|
+
* Code of the payment provider
|
|
1478
|
+
* @example "Stripe Prod"
|
|
1479
|
+
*/
|
|
1480
|
+
payment_provider_code?: string;
|
|
1481
|
+
provider_error?: string | Record<string, any>;
|
|
1482
|
+
}
|
|
1440
1483
|
/** @example "USD" */
|
|
1441
1484
|
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";
|
|
1442
1485
|
export interface Customer {
|
|
@@ -1514,8 +1557,8 @@ export interface CustomerBillingConfiguration {
|
|
|
1514
1557
|
*/
|
|
1515
1558
|
document_locale?: string;
|
|
1516
1559
|
/**
|
|
1517
|
-
* Specifies the available payment methods that can be used for this customer when `payment_provider` is set to `stripe`. The `provider_payment_methods` field is an array that allows multiple payment options to be defined. If this field is not explicitly set, the payment methods will be set to `card`. For now, possible values are `card`, `sepa_debit`, `us_bank_account`, `bacs_debit` and `
|
|
1518
|
-
* @example ["card","sepa_debit"]
|
|
1560
|
+
* Specifies the available payment methods that can be used for this customer when `payment_provider` is set to `stripe`. The `provider_payment_methods` field is an array that allows multiple payment options to be defined. If this field is not explicitly set, the payment methods will be set to `card`. For now, possible values are `card`, `sepa_debit`, `us_bank_account`, `bacs_debit`, `boleto`, `link`, `crypto` and `customer_balance`. Note that when `link` is selected, `card` should also be provided in the array. When `customer_balance` is selected, no other payment can be selected.
|
|
1561
|
+
* @example ["card","sepa_debit","us_bank_account","bacs_debit","link","boleto","crypto","customer_balance"]
|
|
1519
1562
|
*/
|
|
1520
1563
|
provider_payment_methods?: string[] | null;
|
|
1521
1564
|
}
|
|
@@ -1554,6 +1597,25 @@ export interface IntegrationCustomer {
|
|
|
1554
1597
|
*/
|
|
1555
1598
|
subsidiary_id?: string;
|
|
1556
1599
|
}
|
|
1600
|
+
export interface IntegrationProviderErrorObject {
|
|
1601
|
+
/**
|
|
1602
|
+
* Unique identifier assigned to the integration within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the integration's record within the Lago system.
|
|
1603
|
+
* @format uuid
|
|
1604
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1605
|
+
*/
|
|
1606
|
+
lago_integration_id: string;
|
|
1607
|
+
/**
|
|
1608
|
+
* The type of integration provider
|
|
1609
|
+
* @example "netsuite"
|
|
1610
|
+
*/
|
|
1611
|
+
provider: string;
|
|
1612
|
+
/**
|
|
1613
|
+
* Unique code used to identify an integration connection.
|
|
1614
|
+
* @example "netsuite-eu-1"
|
|
1615
|
+
*/
|
|
1616
|
+
provider_code: string;
|
|
1617
|
+
provider_error: string | Record<string, any>;
|
|
1618
|
+
}
|
|
1557
1619
|
/** Array of filter object, representing multiple dimensions for a charge item. */
|
|
1558
1620
|
export type CustomerChargeFiltersUsageObject = {
|
|
1559
1621
|
/**
|
|
@@ -1741,6 +1803,13 @@ export interface CustomerCreateInput {
|
|
|
1741
1803
|
* @example "Belson"
|
|
1742
1804
|
*/
|
|
1743
1805
|
lastname?: string | null;
|
|
1806
|
+
/**
|
|
1807
|
+
* The type of the account. It can have one of the following values:
|
|
1808
|
+
* - `customer`: the account is a customer, default value.
|
|
1809
|
+
* - `partner`: the account is a partner.
|
|
1810
|
+
* @example "customer"
|
|
1811
|
+
*/
|
|
1812
|
+
account_type?: "customer" | "partner" | null;
|
|
1744
1813
|
/**
|
|
1745
1814
|
* The type of the customer. It can have one of the following values:
|
|
1746
1815
|
* - `company`: the customer is a company.
|
|
@@ -1866,6 +1935,30 @@ export interface CustomerCreateInput {
|
|
|
1866
1935
|
invoice_custom_section_codes?: string[];
|
|
1867
1936
|
};
|
|
1868
1937
|
}
|
|
1938
|
+
export interface CustomerIntegratrionErrorObject {
|
|
1939
|
+
/**
|
|
1940
|
+
* 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.
|
|
1941
|
+
* @format uuid
|
|
1942
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
1943
|
+
*/
|
|
1944
|
+
lago_customer_id: string;
|
|
1945
|
+
/**
|
|
1946
|
+
* The customer external unique identifier (provided by your own application)
|
|
1947
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
1948
|
+
*/
|
|
1949
|
+
external_customer_id: string;
|
|
1950
|
+
/**
|
|
1951
|
+
* The type of accounting provider code
|
|
1952
|
+
* @example "anrok"
|
|
1953
|
+
*/
|
|
1954
|
+
accounting_provider: "anrok" | "hubspot" | "netsuite" | "okta" | "salesforce" | "xero";
|
|
1955
|
+
/**
|
|
1956
|
+
* Code of the accounting provider
|
|
1957
|
+
* @example "Netsuite Prod"
|
|
1958
|
+
*/
|
|
1959
|
+
accounting_provider_code: string;
|
|
1960
|
+
provider_error: string | Record<string, any>;
|
|
1961
|
+
}
|
|
1869
1962
|
/** Set of key-value pairs that you can attach to a customer. This can be useful for storing additional information about the customer in a structured format */
|
|
1870
1963
|
export interface CustomerMetadata {
|
|
1871
1964
|
/**
|
|
@@ -1981,6 +2074,13 @@ export type CustomerObject = {
|
|
|
1981
2074
|
* @example "Belson"
|
|
1982
2075
|
*/
|
|
1983
2076
|
lastname?: string | null;
|
|
2077
|
+
/**
|
|
2078
|
+
* The type of the account. It can have one of the following values:
|
|
2079
|
+
* - `customer`: the account is a customer.
|
|
2080
|
+
* - `partner`: the account is a partner.
|
|
2081
|
+
* @example "customer"
|
|
2082
|
+
*/
|
|
2083
|
+
account_type?: "customer" | "partner";
|
|
1984
2084
|
/**
|
|
1985
2085
|
* The type of the customer. It can have one of the following values:
|
|
1986
2086
|
* - `company`: the customer is a company.
|
|
@@ -2112,10 +2212,58 @@ export interface CustomerPastUsage {
|
|
|
2112
2212
|
usage_periods: CustomerUsage[];
|
|
2113
2213
|
meta: PaginationMeta;
|
|
2114
2214
|
}
|
|
2215
|
+
export interface CustomerPaymentProvidernErrorObject {
|
|
2216
|
+
/**
|
|
2217
|
+
* 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.
|
|
2218
|
+
* @format uuid
|
|
2219
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2220
|
+
*/
|
|
2221
|
+
lago_customer_id: string;
|
|
2222
|
+
/**
|
|
2223
|
+
* The customer external unique identifier (provided by your own application)
|
|
2224
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
2225
|
+
*/
|
|
2226
|
+
external_customer_id: string;
|
|
2227
|
+
/**
|
|
2228
|
+
* The type of payment provider
|
|
2229
|
+
* @example "stripe"
|
|
2230
|
+
*/
|
|
2231
|
+
payment_provider: "adyen" | "cashfree" | "gocardless" | "stripe";
|
|
2232
|
+
/**
|
|
2233
|
+
* Code of the payment provider
|
|
2234
|
+
* @example "Stripe Prod"
|
|
2235
|
+
*/
|
|
2236
|
+
payment_provider_code: string;
|
|
2237
|
+
provider_error: string | Record<string, any>;
|
|
2238
|
+
}
|
|
2115
2239
|
export interface CustomersPaginated {
|
|
2116
2240
|
customers: CustomerObjectExtended[];
|
|
2117
2241
|
meta: PaginationMeta;
|
|
2118
2242
|
}
|
|
2243
|
+
export interface CustomerTaxProviderErrorObject {
|
|
2244
|
+
/**
|
|
2245
|
+
* 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.
|
|
2246
|
+
* @format uuid
|
|
2247
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2248
|
+
*/
|
|
2249
|
+
lago_customer_id: string;
|
|
2250
|
+
/**
|
|
2251
|
+
* The customer external unique identifier (provided by your own application)
|
|
2252
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
2253
|
+
*/
|
|
2254
|
+
external_customer_id: string;
|
|
2255
|
+
/**
|
|
2256
|
+
* The type of tax provider
|
|
2257
|
+
* @example "anrock"
|
|
2258
|
+
*/
|
|
2259
|
+
tax_provider: "anrock" | "hubspot" | "netsuite" | "okta" | "salesforce" | "xero";
|
|
2260
|
+
/**
|
|
2261
|
+
* Code of the tax provider
|
|
2262
|
+
* @example "Stripe Prod"
|
|
2263
|
+
*/
|
|
2264
|
+
tax_provider_code: string;
|
|
2265
|
+
provider_error: string | Record<string, any>;
|
|
2266
|
+
}
|
|
2119
2267
|
export interface CustomerUsage {
|
|
2120
2268
|
customer_usage: CustomerUsageObject;
|
|
2121
2269
|
}
|
|
@@ -2167,6 +2315,15 @@ export interface CustomerUsageObject {
|
|
|
2167
2315
|
/** Array of charges that comprise the current usage. It contains detailed information about individual charge items associated with the usage. */
|
|
2168
2316
|
charges_usage: CustomerChargeUsageObject[];
|
|
2169
2317
|
}
|
|
2318
|
+
export type CustomerViesCheckObject = {
|
|
2319
|
+
vies_check?: {
|
|
2320
|
+
/**
|
|
2321
|
+
* Whether the VIES check was successful
|
|
2322
|
+
* @example true
|
|
2323
|
+
*/
|
|
2324
|
+
valid?: boolean;
|
|
2325
|
+
};
|
|
2326
|
+
};
|
|
2170
2327
|
export interface Event {
|
|
2171
2328
|
event: EventObject;
|
|
2172
2329
|
}
|
|
@@ -2286,6 +2443,37 @@ export interface EventObject {
|
|
|
2286
2443
|
*/
|
|
2287
2444
|
created_at: string;
|
|
2288
2445
|
}
|
|
2446
|
+
export interface EventErrorsObject {
|
|
2447
|
+
/**
|
|
2448
|
+
* HTTP status code. It will always be 422
|
|
2449
|
+
* @example 422
|
|
2450
|
+
*/
|
|
2451
|
+
status: number;
|
|
2452
|
+
/**
|
|
2453
|
+
* HTTP error description. It will always be "Unprocessable Entity"
|
|
2454
|
+
* @example "Unprocessable Entity"
|
|
2455
|
+
*/
|
|
2456
|
+
error: string;
|
|
2457
|
+
message: string | Record<string, any>;
|
|
2458
|
+
event: EventObject;
|
|
2459
|
+
}
|
|
2460
|
+
export interface EventsErrorsObject {
|
|
2461
|
+
/**
|
|
2462
|
+
* List of event transaction_id with an invalid code
|
|
2463
|
+
* @example ["transaction_1234567890"]
|
|
2464
|
+
*/
|
|
2465
|
+
invalid_code: string[];
|
|
2466
|
+
/**
|
|
2467
|
+
* List of event transaction_id with a missing aggregation property
|
|
2468
|
+
* @example ["transaction_1234567890"]
|
|
2469
|
+
*/
|
|
2470
|
+
missing_aggregation_property: string[];
|
|
2471
|
+
/**
|
|
2472
|
+
* List of event transaction_id with invalid filter values
|
|
2473
|
+
* @example ["transaction_1234567890"]
|
|
2474
|
+
*/
|
|
2475
|
+
invalid_filter_values: string[];
|
|
2476
|
+
}
|
|
2289
2477
|
export interface Fee {
|
|
2290
2478
|
fee: FeeObject;
|
|
2291
2479
|
}
|
|
@@ -2649,20 +2837,25 @@ export interface FeeObject {
|
|
|
2649
2837
|
per_unit_total_amount: string;
|
|
2650
2838
|
}[];
|
|
2651
2839
|
};
|
|
2840
|
+
/**
|
|
2841
|
+
* Indicates if the fee belongs to self-billed invoice. Self-billing is a process where an organization creates the invoice on behalf of the partner.
|
|
2842
|
+
* @example false
|
|
2843
|
+
*/
|
|
2844
|
+
self_billed?: boolean;
|
|
2652
2845
|
/** Item attached to the fee */
|
|
2653
2846
|
item: {
|
|
2654
2847
|
/**
|
|
2655
|
-
* The fee type. Possible values are `add-on`, `charge`, `credit` or `
|
|
2848
|
+
* The fee type. Possible values are `add-on`, `charge`, `credit`, `subscription` or `commitment`.
|
|
2656
2849
|
* @example "subscription"
|
|
2657
2850
|
*/
|
|
2658
2851
|
type: "charge" | "add_on" | "subscription" | "credit";
|
|
2659
2852
|
/**
|
|
2660
|
-
* The code of the fee item. It can be the code of the `add-
|
|
2853
|
+
* The code of the fee item. It can be the code of the `add-on`, the code of the `charge`, the code of the `credit` or the code of the `subscription`.
|
|
2661
2854
|
* @example "startup"
|
|
2662
2855
|
*/
|
|
2663
2856
|
code: string;
|
|
2664
2857
|
/**
|
|
2665
|
-
* The name of the fee item. It can be the name of the `add-on`, the
|
|
2858
|
+
* The name of the fee item. It can be the name of the `add-on`, the `charge`, the `credit`, the `subscription` or the `commitment`.
|
|
2666
2859
|
* @example "Startup"
|
|
2667
2860
|
*/
|
|
2668
2861
|
name: string;
|
|
@@ -2679,13 +2872,13 @@ export interface FeeObject {
|
|
|
2679
2872
|
/** Key value list of event properties */
|
|
2680
2873
|
filters?: Record<string, string[]>;
|
|
2681
2874
|
/**
|
|
2682
|
-
* Unique identifier of the fee item, created by Lago. It can be the identifier of the `add-on`, the
|
|
2875
|
+
* Unique identifier of the fee item, created by Lago. It can be the identifier of the `add-on`, the `charge`, the `credit`, the `subscription` or the `commitment`.
|
|
2683
2876
|
* @format uuid
|
|
2684
2877
|
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2685
2878
|
*/
|
|
2686
2879
|
lago_item_id: string;
|
|
2687
2880
|
/**
|
|
2688
|
-
* The type of the fee item. Possible values are `AddOn`, `BillableMetric`, `WalletTransaction` or `
|
|
2881
|
+
* The type of the fee item. Possible values are `AddOn`, `BillableMetric`, `WalletTransaction`, `Subscription` or `Commitment`.
|
|
2689
2882
|
* @example "Subscription"
|
|
2690
2883
|
*/
|
|
2691
2884
|
item_type: "AddOn" | "BillableMetric" | "Subscription" | "WalletTransaction";
|
|
@@ -2701,6 +2894,25 @@ export interface Fees {
|
|
|
2701
2894
|
export type FeesPaginated = Fees & {
|
|
2702
2895
|
meta: PaginationMeta;
|
|
2703
2896
|
};
|
|
2897
|
+
export interface FeeTaxProviderErrorObject {
|
|
2898
|
+
/**
|
|
2899
|
+
* Code of the tax provider
|
|
2900
|
+
* @example "Stripe Prod"
|
|
2901
|
+
*/
|
|
2902
|
+
tax_provider_code: string;
|
|
2903
|
+
/**
|
|
2904
|
+
* Unique identifier assigned to the charge that the fee belongs to
|
|
2905
|
+
* @format uuid
|
|
2906
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2907
|
+
*/
|
|
2908
|
+
lago_charge_id: string | null;
|
|
2909
|
+
/**
|
|
2910
|
+
* Unique identifier assigned to the transaction. This field is specifically displayed when the fee type is `charge`.
|
|
2911
|
+
* @example "transaction_1234567890"
|
|
2912
|
+
*/
|
|
2913
|
+
event_transaction_id: string | null;
|
|
2914
|
+
provider_error: string | Record<string, any>;
|
|
2915
|
+
}
|
|
2704
2916
|
export interface FeeUpdateInput {
|
|
2705
2917
|
fee: {
|
|
2706
2918
|
/**
|
|
@@ -3116,6 +3328,11 @@ export type InvoiceObject = {
|
|
|
3116
3328
|
total_amount_cents: number;
|
|
3117
3329
|
/** @example 3 */
|
|
3118
3330
|
version_number: number;
|
|
3331
|
+
/**
|
|
3332
|
+
* Indicates if the invoice is self-billed. Self-billing is a process where an organization creates the invoice on behalf of the partner. This field specifies whether the invoice is self-billed or not.
|
|
3333
|
+
* @example false
|
|
3334
|
+
*/
|
|
3335
|
+
self_billed?: boolean;
|
|
3119
3336
|
/**
|
|
3120
3337
|
* Contains the URL that provides direct access to the invoice PDF file. You can use this URL to download or view the PDF document of the invoice
|
|
3121
3338
|
* @format uri
|
|
@@ -3137,6 +3354,54 @@ export type InvoiceObject = {
|
|
|
3137
3354
|
} & {
|
|
3138
3355
|
/** The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
|
|
3139
3356
|
customer?: CustomerObject;
|
|
3357
|
+
billing_period?: {
|
|
3358
|
+
/**
|
|
3359
|
+
* Unique identifier assigned to the subscription, created by Lago.
|
|
3360
|
+
* @format uuid
|
|
3361
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3362
|
+
*/
|
|
3363
|
+
lago_subscription_id: string;
|
|
3364
|
+
/**
|
|
3365
|
+
* Unique identifier assigned to the subscription in your application.
|
|
3366
|
+
* @example "external_id"
|
|
3367
|
+
*/
|
|
3368
|
+
external_subscription_id: string;
|
|
3369
|
+
/**
|
|
3370
|
+
* Unique identifier assigned to the plan, created by Lago.
|
|
3371
|
+
* @format uuid
|
|
3372
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3373
|
+
*/
|
|
3374
|
+
lago_plan_id?: string;
|
|
3375
|
+
/**
|
|
3376
|
+
* The beginning date of the subscription billing period. This field indicates the start date of the billing period associated with the subscription fee.
|
|
3377
|
+
* @format date-time
|
|
3378
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3379
|
+
*/
|
|
3380
|
+
subscription_from_datetime: string;
|
|
3381
|
+
/**
|
|
3382
|
+
* The ending date of the subscription billing period. This field indicates the end date of the billing period associated with the subscription fee.
|
|
3383
|
+
* @format date-time
|
|
3384
|
+
* @example "2022-05-29T08:59:51Z"
|
|
3385
|
+
*/
|
|
3386
|
+
subscription_to_datetime: string;
|
|
3387
|
+
/**
|
|
3388
|
+
* The beginning date of the period that covers the charge fees. It is applicable only to the `charge` fees attached to the subscription. This field indicates the start date of the billing period or subscription period associated with the fees.
|
|
3389
|
+
* @format date-time
|
|
3390
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3391
|
+
*/
|
|
3392
|
+
charges_from_datetime: string;
|
|
3393
|
+
/**
|
|
3394
|
+
* The ending date of the period that covers the charge fees. It is applicable only to the `charge` fees attached to the subscription. This field indicates the end date of the billing period or subscription period associated with the fees.
|
|
3395
|
+
* @format date-time
|
|
3396
|
+
* @example "2022-05-29T08:59:51Z"
|
|
3397
|
+
*/
|
|
3398
|
+
charges_to_datetime: string;
|
|
3399
|
+
/**
|
|
3400
|
+
* The reason explaining why this subscription appears on the invoice.
|
|
3401
|
+
* @example "subscription_starting"
|
|
3402
|
+
*/
|
|
3403
|
+
invoicing_reason: "subscription_starting" | "subscription_periodic" | "subscription_terminating" | "in_advance_charge" | "in_advance_charge_periodic" | "progressive_billing";
|
|
3404
|
+
}[];
|
|
3140
3405
|
metadata?: InvoiceMetadataObject[];
|
|
3141
3406
|
applied_taxes?: InvoiceAppliedTaxObject[];
|
|
3142
3407
|
applied_usage_thresholds?: AppliedUsageThresholdObject[] | null;
|
|
@@ -3211,6 +3476,41 @@ export interface InvoiceOneOffCreateInput {
|
|
|
3211
3476
|
}[];
|
|
3212
3477
|
};
|
|
3213
3478
|
}
|
|
3479
|
+
export interface InvoicePaymentFailureObject {
|
|
3480
|
+
/**
|
|
3481
|
+
* Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system.
|
|
3482
|
+
* @format uuid
|
|
3483
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3484
|
+
*/
|
|
3485
|
+
lago_invoice_id: string;
|
|
3486
|
+
/**
|
|
3487
|
+
* 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.
|
|
3488
|
+
* @format uuid
|
|
3489
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3490
|
+
*/
|
|
3491
|
+
lago_customer_id: string;
|
|
3492
|
+
/**
|
|
3493
|
+
* The customer external unique identifier (provided by your own application)
|
|
3494
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3495
|
+
*/
|
|
3496
|
+
external_customer_id: string;
|
|
3497
|
+
/**
|
|
3498
|
+
* Unique identifier of the customer within the payment provider
|
|
3499
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3500
|
+
*/
|
|
3501
|
+
provider_customer_id?: string;
|
|
3502
|
+
/**
|
|
3503
|
+
* The type of payment provider code
|
|
3504
|
+
* @example "stripe"
|
|
3505
|
+
*/
|
|
3506
|
+
payment_provider: "adyen" | "cashfree" | "gocardless" | "stripe";
|
|
3507
|
+
/**
|
|
3508
|
+
* Code of the payment provider
|
|
3509
|
+
* @example "Stripe Prod"
|
|
3510
|
+
*/
|
|
3511
|
+
payment_provider_code?: string;
|
|
3512
|
+
provider_error?: string | Record<string, any>;
|
|
3513
|
+
}
|
|
3214
3514
|
export interface InvoicesPaginated {
|
|
3215
3515
|
invoices: InvoiceObject[];
|
|
3216
3516
|
meta: PaginationMeta;
|
|
@@ -3536,6 +3836,80 @@ export interface PaginationMeta {
|
|
|
3536
3836
|
*/
|
|
3537
3837
|
total_count: number;
|
|
3538
3838
|
}
|
|
3839
|
+
export interface PaymentObject {
|
|
3840
|
+
/**
|
|
3841
|
+
* The unique identifier of the paid resource, created by Lago.
|
|
3842
|
+
* @format uuid
|
|
3843
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3844
|
+
*/
|
|
3845
|
+
lago_payable_id: string;
|
|
3846
|
+
/**
|
|
3847
|
+
* Unique identifier of the customer, created by Lago.
|
|
3848
|
+
* @format uuid
|
|
3849
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3850
|
+
*/
|
|
3851
|
+
lago_customer_id: string;
|
|
3852
|
+
/**
|
|
3853
|
+
* The status of the payment within the payment provider
|
|
3854
|
+
* @example "processing"
|
|
3855
|
+
*/
|
|
3856
|
+
status: string;
|
|
3857
|
+
/**
|
|
3858
|
+
* The customer external unique identifier (provided by your own application)
|
|
3859
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3860
|
+
*/
|
|
3861
|
+
external_id: string;
|
|
3862
|
+
/**
|
|
3863
|
+
* Unique identifier of the customer within the payment provider
|
|
3864
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3865
|
+
*/
|
|
3866
|
+
provider_customer_id: string;
|
|
3867
|
+
/**
|
|
3868
|
+
* Code of the payment provider
|
|
3869
|
+
* @example "Stripe Prod"
|
|
3870
|
+
*/
|
|
3871
|
+
payment_provider_code?: string;
|
|
3872
|
+
/**
|
|
3873
|
+
* The type of payment provider
|
|
3874
|
+
* @example "stripe"
|
|
3875
|
+
*/
|
|
3876
|
+
payment_provider_type: "adyen" | "cashfree" | "gocardless" | "stripe";
|
|
3877
|
+
/**
|
|
3878
|
+
* Unique identifier of the payment within the payment provider
|
|
3879
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3880
|
+
*/
|
|
3881
|
+
provider_payment_id: string;
|
|
3882
|
+
next_action: Record<string, any>;
|
|
3883
|
+
}
|
|
3884
|
+
export interface PaymentProviderErrorObject {
|
|
3885
|
+
/**
|
|
3886
|
+
* Unique identifier assigned to the payment provider within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the payment provider's record within the Lago system.
|
|
3887
|
+
* @format uuid
|
|
3888
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3889
|
+
*/
|
|
3890
|
+
lago_payment_provider_id: string;
|
|
3891
|
+
/**
|
|
3892
|
+
* The name of payment provider
|
|
3893
|
+
* @example "Stripe Prod"
|
|
3894
|
+
*/
|
|
3895
|
+
payment_provider_name: string;
|
|
3896
|
+
/**
|
|
3897
|
+
* Code of the payment provider
|
|
3898
|
+
* @example "stripe"
|
|
3899
|
+
*/
|
|
3900
|
+
payment_provider_code: string;
|
|
3901
|
+
/**
|
|
3902
|
+
* The source of the error
|
|
3903
|
+
* @example "stripe"
|
|
3904
|
+
*/
|
|
3905
|
+
source: "stripe";
|
|
3906
|
+
/**
|
|
3907
|
+
* The action that was being performed when the error occurred
|
|
3908
|
+
* @example "payment_provider.register_webhook"
|
|
3909
|
+
*/
|
|
3910
|
+
action?: "payment_provider.register_webhook";
|
|
3911
|
+
provider_error: string | Record<string, any>;
|
|
3912
|
+
}
|
|
3539
3913
|
export interface PaymentRequestObject {
|
|
3540
3914
|
/**
|
|
3541
3915
|
* Unique identifier of the payment request, created by Lago.
|
|
@@ -3577,6 +3951,46 @@ export interface PaymentRequestObject {
|
|
|
3577
3951
|
customer: any;
|
|
3578
3952
|
invoices: any[];
|
|
3579
3953
|
}
|
|
3954
|
+
export interface PaymentRequestPaymentFailureObject {
|
|
3955
|
+
/**
|
|
3956
|
+
* Unique identifier assigned to the payment request within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the payment request record within the Lago system.
|
|
3957
|
+
* @format uuid
|
|
3958
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3959
|
+
*/
|
|
3960
|
+
lago_payment_request_id: string;
|
|
3961
|
+
/**
|
|
3962
|
+
* List of unique identifiers assigned to the invoices within the Lago application. These IDs are exclusively created by Lago and serve as unique identifiers for the invoices records within the Lago system.
|
|
3963
|
+
* @example ["1a901a90-1a90-1a90-1a90-1a901a901a90"]
|
|
3964
|
+
*/
|
|
3965
|
+
lago_invoice_ids: string[];
|
|
3966
|
+
/**
|
|
3967
|
+
* 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.
|
|
3968
|
+
* @format uuid
|
|
3969
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3970
|
+
*/
|
|
3971
|
+
lago_customer_id: string;
|
|
3972
|
+
/**
|
|
3973
|
+
* The customer external unique identifier (provided by your own application)
|
|
3974
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3975
|
+
*/
|
|
3976
|
+
external_customer_id: string;
|
|
3977
|
+
/**
|
|
3978
|
+
* Unique identifier of the customer within the payment provider
|
|
3979
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
3980
|
+
*/
|
|
3981
|
+
provider_customer_id?: string;
|
|
3982
|
+
/**
|
|
3983
|
+
* The type of payment provider code
|
|
3984
|
+
* @example "stripe"
|
|
3985
|
+
*/
|
|
3986
|
+
payment_provider: "adyen" | "cashfree" | "gocardless" | "stripe";
|
|
3987
|
+
/**
|
|
3988
|
+
* Code of the payment provider
|
|
3989
|
+
* @example "Stripe Prod"
|
|
3990
|
+
*/
|
|
3991
|
+
payment_provider_code?: string;
|
|
3992
|
+
provider_error?: string | Record<string, any>;
|
|
3993
|
+
}
|
|
3580
3994
|
export interface PaymentRequestsPaginated {
|
|
3581
3995
|
payment_requests: PaymentRequestObject[];
|
|
3582
3996
|
meta: PaginationMeta;
|
|
@@ -4076,6 +4490,15 @@ export interface SubscriptionUpdateInput {
|
|
|
4076
4490
|
plan_overrides?: PlanOverridesObject;
|
|
4077
4491
|
};
|
|
4078
4492
|
}
|
|
4493
|
+
export type SubscriptionWithCustomerObject = SubscriptionObject & {
|
|
4494
|
+
plan?: PlanObject;
|
|
4495
|
+
customer?: CustomerObject;
|
|
4496
|
+
};
|
|
4497
|
+
export type SubscriptionWithThresholdObject = SubscriptionObject & {
|
|
4498
|
+
plan?: PlanObject;
|
|
4499
|
+
customer?: CustomerObject;
|
|
4500
|
+
usage_threshold?: UsageThresholdObject;
|
|
4501
|
+
};
|
|
4079
4502
|
export interface SubscriptionObject {
|
|
4080
4503
|
/**
|
|
4081
4504
|
* Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription's record within the Lago system
|
|
@@ -4774,6 +5197,41 @@ export interface WalletTransactionObject {
|
|
|
4774
5197
|
*/
|
|
4775
5198
|
created_at: string;
|
|
4776
5199
|
}
|
|
5200
|
+
export interface WalletTransactionPaymentFailureObject {
|
|
5201
|
+
/**
|
|
5202
|
+
* Unique identifier assigned to the wallet transaction within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet transaction's record within the Lago system.
|
|
5203
|
+
* @format uuid
|
|
5204
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
5205
|
+
*/
|
|
5206
|
+
lago_wallet_transaction_id: string;
|
|
5207
|
+
/**
|
|
5208
|
+
* 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.
|
|
5209
|
+
* @format uuid
|
|
5210
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
5211
|
+
*/
|
|
5212
|
+
lago_customer_id: string;
|
|
5213
|
+
/**
|
|
5214
|
+
* The customer external unique identifier (provided by your own application)
|
|
5215
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
5216
|
+
*/
|
|
5217
|
+
external_customer_id: string;
|
|
5218
|
+
/**
|
|
5219
|
+
* Unique identifier of the customer within the payment provider
|
|
5220
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
5221
|
+
*/
|
|
5222
|
+
provider_customer_id?: string;
|
|
5223
|
+
/**
|
|
5224
|
+
* The type of payment provider code
|
|
5225
|
+
* @example "stripe"
|
|
5226
|
+
*/
|
|
5227
|
+
payment_provider: "adyen" | "cashfree" | "gocardless" | "stripe";
|
|
5228
|
+
/**
|
|
5229
|
+
* Code of the payment provider
|
|
5230
|
+
* @example "Stripe Prod"
|
|
5231
|
+
*/
|
|
5232
|
+
payment_provider_code?: string;
|
|
5233
|
+
provider_error?: string | Record<string, any>;
|
|
5234
|
+
}
|
|
4777
5235
|
export interface WalletTransactions {
|
|
4778
5236
|
wallet_transactions: WalletTransactionObject[];
|
|
4779
5237
|
}
|
|
@@ -4994,7 +5452,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
4994
5452
|
}
|
|
4995
5453
|
/**
|
|
4996
5454
|
* @title Lago API documentation
|
|
4997
|
-
* @version 1.
|
|
5455
|
+
* @version 1.22.0
|
|
4998
5456
|
* @license AGPLv3
|
|
4999
5457
|
* @baseUrl https://api.getlago.com/api/v1
|
|
5000
5458
|
* @externalDocs https://github.com/getlago
|
|
@@ -5433,6 +5891,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5433
5891
|
* @example 100000
|
|
5434
5892
|
*/
|
|
5435
5893
|
amount_to?: number;
|
|
5894
|
+
/**
|
|
5895
|
+
* Filter credit notes belonging to a self billed invoice. Possible values are `true` or `false`.
|
|
5896
|
+
* @example true
|
|
5897
|
+
*/
|
|
5898
|
+
self_billed?: boolean;
|
|
5436
5899
|
}, params?: RequestParams) => Promise<HttpResponse<CreditNotes, ApiErrorUnauthorized>>;
|
|
5437
5900
|
/**
|
|
5438
5901
|
* @description This endpoint updates an existing credit note.
|
|
@@ -5516,6 +5979,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5516
5979
|
* @example 20
|
|
5517
5980
|
*/
|
|
5518
5981
|
per_page?: number;
|
|
5982
|
+
/**
|
|
5983
|
+
* Filter customers by account type.
|
|
5984
|
+
* @example ["customer","partner"]
|
|
5985
|
+
*/
|
|
5986
|
+
account_type?: ("customer" | "partner")[];
|
|
5519
5987
|
}, params?: RequestParams) => Promise<HttpResponse<CustomersPaginated, ApiErrorUnauthorized>>;
|
|
5520
5988
|
/**
|
|
5521
5989
|
* @description This endpoint retrieves an existing customer.
|
|
@@ -5523,20 +5991,20 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5523
5991
|
* @tags customers
|
|
5524
5992
|
* @name FindCustomer
|
|
5525
5993
|
* @summary Retrieve a customer
|
|
5526
|
-
* @request GET:/customers/{
|
|
5994
|
+
* @request GET:/customers/{external_customer_id}
|
|
5527
5995
|
* @secure
|
|
5528
5996
|
*/
|
|
5529
|
-
findCustomer: (
|
|
5997
|
+
findCustomer: (externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
5530
5998
|
/**
|
|
5531
5999
|
* @description This endpoint deletes an existing customer.
|
|
5532
6000
|
*
|
|
5533
6001
|
* @tags customers
|
|
5534
6002
|
* @name DestroyCustomer
|
|
5535
6003
|
* @summary Delete a customer
|
|
5536
|
-
* @request DELETE:/customers/{
|
|
6004
|
+
* @request DELETE:/customers/{external_customer_id}
|
|
5537
6005
|
* @secure
|
|
5538
6006
|
*/
|
|
5539
|
-
destroyCustomer: (
|
|
6007
|
+
destroyCustomer: (externalCustomerId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
5540
6008
|
/**
|
|
5541
6009
|
* @description This endpoint is used to delete a specific coupon that has been applied to a customer.
|
|
5542
6010
|
*
|
|
@@ -5580,6 +6048,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5580
6048
|
* @example "sub_1234567890"
|
|
5581
6049
|
*/
|
|
5582
6050
|
external_subscription_id: string;
|
|
6051
|
+
/**
|
|
6052
|
+
* Optional flag to determine if taxes should be applied. Defaults to `true` if not provided or if null.
|
|
6053
|
+
* @default true
|
|
6054
|
+
* @example true
|
|
6055
|
+
*/
|
|
6056
|
+
apply_taxes?: boolean;
|
|
5583
6057
|
}, params?: RequestParams) => Promise<HttpResponse<CustomerUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
5584
6058
|
/**
|
|
5585
6059
|
* @description This endpoint enables the retrieval of the usage-based billing data for a customer within past periods.
|
|
@@ -5632,17 +6106,22 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5632
6106
|
* 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
|
|
5633
6107
|
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
5634
6108
|
*/
|
|
5635
|
-
lago_customer_id
|
|
6109
|
+
lago_customer_id: string;
|
|
5636
6110
|
/**
|
|
5637
6111
|
* The customer external unique identifier (provided by your own application)
|
|
5638
6112
|
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
5639
6113
|
*/
|
|
5640
|
-
external_customer_id
|
|
6114
|
+
external_customer_id: string;
|
|
5641
6115
|
/**
|
|
5642
6116
|
* The Payment Provider name linked to the Customer.
|
|
5643
6117
|
* @example "stripe"
|
|
5644
6118
|
*/
|
|
5645
|
-
payment_provider
|
|
6119
|
+
payment_provider: string;
|
|
6120
|
+
/**
|
|
6121
|
+
* Code of the payment provider
|
|
6122
|
+
* @example "Stripe Prod"
|
|
6123
|
+
*/
|
|
6124
|
+
payment_provider_code?: string | undefined;
|
|
5646
6125
|
/**
|
|
5647
6126
|
* The new generated Payment Provider Checkout URL for the Customer.
|
|
5648
6127
|
* @example "https://foo.bar"
|
|
@@ -5908,6 +6387,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5908
6387
|
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
5909
6388
|
*/
|
|
5910
6389
|
external_customer_id?: string;
|
|
6390
|
+
/**
|
|
6391
|
+
* Filter invoices of at least a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types.
|
|
6392
|
+
* @example 9000
|
|
6393
|
+
*/
|
|
6394
|
+
amount_from?: number;
|
|
6395
|
+
/**
|
|
6396
|
+
* Filter invoices up to a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types.
|
|
6397
|
+
* @example 100000
|
|
6398
|
+
*/
|
|
6399
|
+
amount_to?: number;
|
|
5911
6400
|
/**
|
|
5912
6401
|
* Filter invoices starting from a specific date.
|
|
5913
6402
|
* @format date
|
|
@@ -5944,8 +6433,18 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5944
6433
|
* @example true
|
|
5945
6434
|
*/
|
|
5946
6435
|
payment_dispute_lost?: boolean;
|
|
5947
|
-
/** Filter invoices by invoice type. Possible values are `subscription`, `add_on`, `credit`, `one_off` or `
|
|
5948
|
-
invoice_type?: "subscription" | "add_on" | "credit" | "one_off" | "advance_charges";
|
|
6436
|
+
/** Filter invoices by invoice type. Possible values are `subscription`, `add_on`, `credit`, `one_off`, `advance_charges` or `progressive_billing`. */
|
|
6437
|
+
invoice_type?: "subscription" | "add_on" | "credit" | "one_off" | "advance_charges" | "progressive_billing";
|
|
6438
|
+
/**
|
|
6439
|
+
* Filter invoices by self billed. Possible values are `true` or `false`.
|
|
6440
|
+
* @example true
|
|
6441
|
+
*/
|
|
6442
|
+
self_billed?: boolean;
|
|
6443
|
+
/**
|
|
6444
|
+
* Filter invoices by metadata. Replace `key` with the actual metadata key you want to match, and provide the corresponding value. Providing empty value will search for invoice without given metadata key. For example, `metadata[color]=blue`.
|
|
6445
|
+
* @example "someValue"
|
|
6446
|
+
*/
|
|
6447
|
+
"metadata[key]"?: string;
|
|
5949
6448
|
}, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized>>;
|
|
5950
6449
|
/**
|
|
5951
6450
|
* @description This endpoint is used for updating an existing invoice.
|
|
@@ -6055,6 +6554,141 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
6055
6554
|
payment_url?: string | undefined;
|
|
6056
6555
|
} | undefined;
|
|
6057
6556
|
}, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
6557
|
+
/**
|
|
6558
|
+
* @description This endpoint is used for generating invoice preview.
|
|
6559
|
+
*
|
|
6560
|
+
* @tags invoices
|
|
6561
|
+
* @name InvoicePreview
|
|
6562
|
+
* @summary Create an invoice preview
|
|
6563
|
+
* @request POST:/invoices/preview
|
|
6564
|
+
* @secure
|
|
6565
|
+
*/
|
|
6566
|
+
invoicePreview: (data: {
|
|
6567
|
+
customer: {
|
|
6568
|
+
/**
|
|
6569
|
+
* The first line of the billing address
|
|
6570
|
+
* @example "5230 Penfield Ave"
|
|
6571
|
+
*/
|
|
6572
|
+
address_line1?: string;
|
|
6573
|
+
/**
|
|
6574
|
+
* The second line of the billing address
|
|
6575
|
+
* @example null
|
|
6576
|
+
*/
|
|
6577
|
+
address_line2?: string | null;
|
|
6578
|
+
/**
|
|
6579
|
+
* The city of the customer's billing address
|
|
6580
|
+
* @example "Woodland Hills"
|
|
6581
|
+
*/
|
|
6582
|
+
city?: string;
|
|
6583
|
+
/**
|
|
6584
|
+
* Country code of the customer's billing address. Format must be ISO 3166 (alpha-2)
|
|
6585
|
+
* @example "US"
|
|
6586
|
+
*/
|
|
6587
|
+
country?: Country;
|
|
6588
|
+
/**
|
|
6589
|
+
* Unique identifier assigned to the customer in your application.
|
|
6590
|
+
* @example "hooli_1234"
|
|
6591
|
+
*/
|
|
6592
|
+
external_id?: string;
|
|
6593
|
+
integration_customers?: {
|
|
6594
|
+
/**
|
|
6595
|
+
* The integration type used for accounting and tax syncs.
|
|
6596
|
+
* Accepted values: `anrok`.
|
|
6597
|
+
* @example "anrok"
|
|
6598
|
+
*/
|
|
6599
|
+
integration_type: "anrok";
|
|
6600
|
+
/**
|
|
6601
|
+
* Unique code used to identify an integration connection.
|
|
6602
|
+
* @example "anrok1"
|
|
6603
|
+
*/
|
|
6604
|
+
integration_code: string;
|
|
6605
|
+
}[];
|
|
6606
|
+
/**
|
|
6607
|
+
* The full name of the customer
|
|
6608
|
+
* @example "Gavin Belson"
|
|
6609
|
+
*/
|
|
6610
|
+
name?: string;
|
|
6611
|
+
/**
|
|
6612
|
+
* The currency of the invoice.
|
|
6613
|
+
* @example "EUR"
|
|
6614
|
+
*/
|
|
6615
|
+
currency?: Currency;
|
|
6616
|
+
/** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
|
|
6617
|
+
shipping_address?: Address;
|
|
6618
|
+
/**
|
|
6619
|
+
* The state of the customer's billing address
|
|
6620
|
+
* @example "CA"
|
|
6621
|
+
*/
|
|
6622
|
+
state?: string;
|
|
6623
|
+
/**
|
|
6624
|
+
* The tax identification number of the customer
|
|
6625
|
+
* @example "EU123456789"
|
|
6626
|
+
*/
|
|
6627
|
+
tax_identification_number?: string;
|
|
6628
|
+
/** The customer's timezone, used for billing purposes in their local time. Overrides the organization's timezone */
|
|
6629
|
+
timezone?: Timezone;
|
|
6630
|
+
};
|
|
6631
|
+
/**
|
|
6632
|
+
* The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
|
|
6633
|
+
* @example "startup"
|
|
6634
|
+
*/
|
|
6635
|
+
plan_code?: string;
|
|
6636
|
+
/**
|
|
6637
|
+
* The anniversary date and time of the initial subscription. This date serves as the basis for billing subscriptions with `anniversary` billing time. The `anniversary_date` should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
6638
|
+
* @format date-time
|
|
6639
|
+
* @example "2022-08-08T00:00:00Z"
|
|
6640
|
+
*/
|
|
6641
|
+
subscription_at?: string;
|
|
6642
|
+
/**
|
|
6643
|
+
* The billing time for the subscription, which can be set as either `anniversary` or `calendar`. If not explicitly provided, it will default to `calendar`. The billing time determines the timing of recurring billing cycles for the subscription. By specifying `anniversary`, the billing cycle will be based on the specific date the subscription started (billed fully), while `calendar` sets the billing cycle at the first day of the week/month/year (billed with proration).
|
|
6644
|
+
* @example "anniversary"
|
|
6645
|
+
*/
|
|
6646
|
+
billing_time?: "calendar" | "anniversary";
|
|
6647
|
+
coupons?: {
|
|
6648
|
+
/**
|
|
6649
|
+
* The name of the coupon.
|
|
6650
|
+
* @example "Startup Deal"
|
|
6651
|
+
*/
|
|
6652
|
+
name?: string;
|
|
6653
|
+
/**
|
|
6654
|
+
* Unique code used to identify the coupon.
|
|
6655
|
+
* @example "startup_deal"
|
|
6656
|
+
*/
|
|
6657
|
+
code: string;
|
|
6658
|
+
/**
|
|
6659
|
+
* The type of the coupon. It can have two possible values: `fixed_amount` or `percentage`.
|
|
6660
|
+
*
|
|
6661
|
+
* - If set to `fixed_amount`, the coupon represents a fixed amount discount.
|
|
6662
|
+
* - If set to `percentage`, the coupon represents a percentage-based discount.
|
|
6663
|
+
* @example "fixed_amount"
|
|
6664
|
+
*/
|
|
6665
|
+
coupon_type?: "fixed_amount" | "percentage";
|
|
6666
|
+
/**
|
|
6667
|
+
* The amount of the coupon in cents. This field is required only for coupon with `fixed_amount` type.
|
|
6668
|
+
* @example 5000
|
|
6669
|
+
*/
|
|
6670
|
+
amount_cents?: number | null;
|
|
6671
|
+
/**
|
|
6672
|
+
* The currency of the coupon. This field is required only for coupon with `fixed_amount` type.
|
|
6673
|
+
* @example "USD"
|
|
6674
|
+
*/
|
|
6675
|
+
amount_currency?: Currency | null;
|
|
6676
|
+
/**
|
|
6677
|
+
* The percentage rate of the coupon. This field is required only for coupons with a `percentage` coupon type.
|
|
6678
|
+
* @pattern ^[0-9]+.?[0-9]*$
|
|
6679
|
+
* @example null
|
|
6680
|
+
*/
|
|
6681
|
+
percentage_rate?: string | null;
|
|
6682
|
+
/**
|
|
6683
|
+
* Specifies the number of billing periods to which the coupon applies. This field is required only for coupons with a `recurring` frequency type
|
|
6684
|
+
* @example 6
|
|
6685
|
+
*/
|
|
6686
|
+
frequency_duration?: number | null;
|
|
6687
|
+
}[];
|
|
6688
|
+
subscriptions?: {
|
|
6689
|
+
external_ids: string[];
|
|
6690
|
+
};
|
|
6691
|
+
}, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
6058
6692
|
/**
|
|
6059
6693
|
* @description This endpoint resends an invoice for collection and retry a payment.
|
|
6060
6694
|
*
|
|
@@ -6104,7 +6738,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
6104
6738
|
* The customer external unique identifier (provided by your own application)
|
|
6105
6739
|
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
6106
6740
|
*/
|
|
6107
|
-
|
|
6741
|
+
external_customer_id: string;
|
|
6108
6742
|
/**
|
|
6109
6743
|
* The customer's email address used for sending dunning notifications
|
|
6110
6744
|
* @format email
|
|
@@ -6144,6 +6778,124 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
6144
6778
|
external_customer_id?: string;
|
|
6145
6779
|
}, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized>>;
|
|
6146
6780
|
};
|
|
6781
|
+
payments: {
|
|
6782
|
+
/**
|
|
6783
|
+
* @description This endpoint is used to create a manual payment
|
|
6784
|
+
*
|
|
6785
|
+
* @tags payments
|
|
6786
|
+
* @name CreatePayment
|
|
6787
|
+
* @summary Create a payment
|
|
6788
|
+
* @request POST:/payments
|
|
6789
|
+
* @secure
|
|
6790
|
+
*/
|
|
6791
|
+
createPayment: (data: {
|
|
6792
|
+
payment: {
|
|
6793
|
+
/**
|
|
6794
|
+
* Unique identifier assigned to the invoice
|
|
6795
|
+
* @example "486b147a-02a1-4ccf-8603-f3541fc25e7a"
|
|
6796
|
+
*/
|
|
6797
|
+
invoice_id: string;
|
|
6798
|
+
/**
|
|
6799
|
+
* The payment amount in cents
|
|
6800
|
+
* @example 100
|
|
6801
|
+
*/
|
|
6802
|
+
amount_cents: number;
|
|
6803
|
+
/**
|
|
6804
|
+
* Reference for the payment
|
|
6805
|
+
* @example "ref1"
|
|
6806
|
+
*/
|
|
6807
|
+
reference: string;
|
|
6808
|
+
/**
|
|
6809
|
+
* The date the payment was made
|
|
6810
|
+
* @format date
|
|
6811
|
+
* @example "2025-02-20"
|
|
6812
|
+
*/
|
|
6813
|
+
paid_at?: string;
|
|
6814
|
+
};
|
|
6815
|
+
}, params?: RequestParams) => Promise<HttpResponse<{
|
|
6816
|
+
payment: {
|
|
6817
|
+
/**
|
|
6818
|
+
* The unique identifier of the payment, created by Lago.
|
|
6819
|
+
* @format uuid
|
|
6820
|
+
* @example "4cf085a7-c196-4f07-a543-97c50ec6e8b2"
|
|
6821
|
+
*/
|
|
6822
|
+
lago_id?: string;
|
|
6823
|
+
/** List of invoice IDs associated with the payment. */
|
|
6824
|
+
invoice_ids?: string[];
|
|
6825
|
+
/**
|
|
6826
|
+
* The amount of the payment in cents.
|
|
6827
|
+
* @example 100
|
|
6828
|
+
*/
|
|
6829
|
+
amount_cents?: number;
|
|
6830
|
+
/**
|
|
6831
|
+
* The currency of the payment amount.
|
|
6832
|
+
* @example "USD"
|
|
6833
|
+
*/
|
|
6834
|
+
amount_currency?: string;
|
|
6835
|
+
/**
|
|
6836
|
+
* The current status of the payment.
|
|
6837
|
+
* @example "succeeded"
|
|
6838
|
+
*/
|
|
6839
|
+
payment_status?: string;
|
|
6840
|
+
/**
|
|
6841
|
+
* The type of payment.
|
|
6842
|
+
* @example "manual"
|
|
6843
|
+
*/
|
|
6844
|
+
type?: string;
|
|
6845
|
+
/**
|
|
6846
|
+
* Reference for the payment.
|
|
6847
|
+
* @example "ref1"
|
|
6848
|
+
*/
|
|
6849
|
+
reference?: string;
|
|
6850
|
+
/**
|
|
6851
|
+
* External identifier for the payment (if applicable).
|
|
6852
|
+
* @example null
|
|
6853
|
+
*/
|
|
6854
|
+
external_payment_id?: string | null;
|
|
6855
|
+
/**
|
|
6856
|
+
* Timestamp when the payment was created.
|
|
6857
|
+
* @format date-time
|
|
6858
|
+
* @example "2025-02-20T00:00:00Z"
|
|
6859
|
+
*/
|
|
6860
|
+
created_at?: string;
|
|
6861
|
+
};
|
|
6862
|
+
}, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
6863
|
+
/**
|
|
6864
|
+
* @description This endpoint is used to list all payments
|
|
6865
|
+
*
|
|
6866
|
+
* @tags payments
|
|
6867
|
+
* @name FindAllPayments
|
|
6868
|
+
* @summary List all payments
|
|
6869
|
+
* @request GET:/payments
|
|
6870
|
+
* @secure
|
|
6871
|
+
*/
|
|
6872
|
+
findAllPayments: (query?: {
|
|
6873
|
+
/**
|
|
6874
|
+
* Page number.
|
|
6875
|
+
* @example 1
|
|
6876
|
+
*/
|
|
6877
|
+
page?: number;
|
|
6878
|
+
/**
|
|
6879
|
+
* Number of records per page.
|
|
6880
|
+
* @example 20
|
|
6881
|
+
*/
|
|
6882
|
+
per_page?: number;
|
|
6883
|
+
/**
|
|
6884
|
+
* Unique identifier assigned to the customer in your application.
|
|
6885
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
6886
|
+
*/
|
|
6887
|
+
external_customer_id?: string;
|
|
6888
|
+
/**
|
|
6889
|
+
* Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system.
|
|
6890
|
+
* @format uuid
|
|
6891
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
6892
|
+
*/
|
|
6893
|
+
lago_invoice_id?: string;
|
|
6894
|
+
}, params?: RequestParams) => Promise<HttpResponse<{
|
|
6895
|
+
payments: any[];
|
|
6896
|
+
meta: PaginationMeta;
|
|
6897
|
+
}, ApiErrorUnauthorized>>;
|
|
6898
|
+
};
|
|
6147
6899
|
plans: {
|
|
6148
6900
|
/**
|
|
6149
6901
|
* @description This endpoint creates a plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.
|
|
@@ -6489,6 +7241,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
6489
7241
|
* @secure
|
|
6490
7242
|
*/
|
|
6491
7243
|
createWalletTransaction: (data: WalletTransactionCreateInput, params?: RequestParams) => Promise<HttpResponse<WalletTransactions, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
7244
|
+
/**
|
|
7245
|
+
* @description This endpoint is used to retrieve a specific wallet transactions.
|
|
7246
|
+
*
|
|
7247
|
+
* @tags wallets
|
|
7248
|
+
* @name FindWalletTransaction
|
|
7249
|
+
* @summary Retrieve a wallet transaction
|
|
7250
|
+
* @request GET:/wallet_transactions/{lago_id}
|
|
7251
|
+
* @secure
|
|
7252
|
+
*/
|
|
7253
|
+
findWalletTransaction: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WalletTransactionObject, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
6492
7254
|
};
|
|
6493
7255
|
webhooks: {
|
|
6494
7256
|
/**
|