lago-javascript-client 1.11.0 → 1.12.2
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 +182 -50
- package/esm/openapi/client.js +35 -1
- package/package.json +1 -1
- package/script/openapi/client.d.ts +182 -50
- package/script/openapi/client.js +35 -1
package/esm/openapi/client.d.ts
CHANGED
|
@@ -1633,6 +1633,22 @@ export interface CustomerCreateInput {
|
|
|
1633
1633
|
* @example "Gavin Belson"
|
|
1634
1634
|
*/
|
|
1635
1635
|
name?: string | null;
|
|
1636
|
+
/**
|
|
1637
|
+
* First name of the customer
|
|
1638
|
+
* @example "Gavin"
|
|
1639
|
+
*/
|
|
1640
|
+
firstname?: string | null;
|
|
1641
|
+
/**
|
|
1642
|
+
* Last name of the customer
|
|
1643
|
+
* @example "Belson"
|
|
1644
|
+
*/
|
|
1645
|
+
lastname?: string | null;
|
|
1646
|
+
/**
|
|
1647
|
+
* The type of the customer. It can have one of the following values:
|
|
1648
|
+
* - `company`: the customer is a company.
|
|
1649
|
+
* - `individual`: the customer is an individual.
|
|
1650
|
+
*/
|
|
1651
|
+
customer_type?: "company" | "individual" | null;
|
|
1636
1652
|
/**
|
|
1637
1653
|
* The phone number of the customer
|
|
1638
1654
|
* @example "1-171-883-3711 x245"
|
|
@@ -1841,6 +1857,22 @@ export type CustomerObject = {
|
|
|
1841
1857
|
* @example "Gavin Belson"
|
|
1842
1858
|
*/
|
|
1843
1859
|
name?: string | null;
|
|
1860
|
+
/**
|
|
1861
|
+
* First name of the customer
|
|
1862
|
+
* @example "Gavin"
|
|
1863
|
+
*/
|
|
1864
|
+
firstname?: string | null;
|
|
1865
|
+
/**
|
|
1866
|
+
* Last name of the customer
|
|
1867
|
+
* @example "Belson"
|
|
1868
|
+
*/
|
|
1869
|
+
lastname?: string | null;
|
|
1870
|
+
/**
|
|
1871
|
+
* The type of the customer. It can have one of the following values:
|
|
1872
|
+
* - `company`: the customer is a company.
|
|
1873
|
+
* - `individual`: the customer is an individual.
|
|
1874
|
+
*/
|
|
1875
|
+
customer_type?: "company" | "individual" | null;
|
|
1844
1876
|
/**
|
|
1845
1877
|
* The phone number of the customer
|
|
1846
1878
|
* @example "1-171-883-3711 x245"
|
|
@@ -2505,6 +2537,84 @@ export interface GrossRevenueObject {
|
|
|
2505
2537
|
export interface GrossRevenues {
|
|
2506
2538
|
gross_revenues: GrossRevenueObject[];
|
|
2507
2539
|
}
|
|
2540
|
+
export interface LifetimeUsage {
|
|
2541
|
+
lifetime_usage: LifetimeUsageObject;
|
|
2542
|
+
}
|
|
2543
|
+
export interface LifetimeUsageInput {
|
|
2544
|
+
lifetime_usage: {
|
|
2545
|
+
/**
|
|
2546
|
+
* The historical usage amount in cents for the subscription (provided by your own application).
|
|
2547
|
+
* @example 100
|
|
2548
|
+
*/
|
|
2549
|
+
external_historical_usage_amount_cents: number;
|
|
2550
|
+
};
|
|
2551
|
+
}
|
|
2552
|
+
export interface LifetimeUsageObject {
|
|
2553
|
+
/**
|
|
2554
|
+
* Unique identifier assigned to the lifetime usage record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the lifetime usage record within the Lago system
|
|
2555
|
+
* @format uuid
|
|
2556
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2557
|
+
*/
|
|
2558
|
+
lago_id: string;
|
|
2559
|
+
/**
|
|
2560
|
+
* Unique identifier assigned to the subscription record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription record within the Lago system
|
|
2561
|
+
* @format uuid
|
|
2562
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2563
|
+
*/
|
|
2564
|
+
lago_subscription_id: string;
|
|
2565
|
+
/**
|
|
2566
|
+
* The subscription external unique identifier (provided by your own application).
|
|
2567
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
2568
|
+
*/
|
|
2569
|
+
external_subscription_id: string;
|
|
2570
|
+
/**
|
|
2571
|
+
* The historical usage amount in cents for the subscription (provided by your own application).
|
|
2572
|
+
* @example 100
|
|
2573
|
+
*/
|
|
2574
|
+
external_historical_usage_amount_cents: number;
|
|
2575
|
+
/**
|
|
2576
|
+
* The total invoiced usage amount in cents for the subscription.
|
|
2577
|
+
* @example 100
|
|
2578
|
+
*/
|
|
2579
|
+
invoiced_usage_amount_cents: number;
|
|
2580
|
+
/**
|
|
2581
|
+
* The current usage amount in cents for the subscription on the current billing period.
|
|
2582
|
+
* @example 100
|
|
2583
|
+
*/
|
|
2584
|
+
current_usage_amount_cents: number;
|
|
2585
|
+
/**
|
|
2586
|
+
* The recording start date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
|
|
2587
|
+
* @format date-time
|
|
2588
|
+
* @example "2024-01-01T00:00:00Z"
|
|
2589
|
+
*/
|
|
2590
|
+
from_datetime: string;
|
|
2591
|
+
/**
|
|
2592
|
+
* The recording end date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
|
|
2593
|
+
* @format date-time
|
|
2594
|
+
* @example "2024-12-31T23:59:59Z"
|
|
2595
|
+
*/
|
|
2596
|
+
to_datetime: string;
|
|
2597
|
+
/** Array of usage thresholds attached to the subscription's plan. */
|
|
2598
|
+
usage_thresholds?: LifetimeUsageThresholdObject[];
|
|
2599
|
+
}
|
|
2600
|
+
export interface LifetimeUsageThresholdObject {
|
|
2601
|
+
/**
|
|
2602
|
+
* The usage threshold amount in cents.
|
|
2603
|
+
* @example 100
|
|
2604
|
+
*/
|
|
2605
|
+
amount_cents: number;
|
|
2606
|
+
/**
|
|
2607
|
+
* The completion ratio of the usage threshold.
|
|
2608
|
+
* @example 0.5
|
|
2609
|
+
*/
|
|
2610
|
+
completion_ratio: number;
|
|
2611
|
+
/**
|
|
2612
|
+
* The date and time when the usage threshold was reached. The date and time must be in ISO 8601 format.
|
|
2613
|
+
* @format date-time
|
|
2614
|
+
* @example "2024-01-01T00:00:00Z"
|
|
2615
|
+
*/
|
|
2616
|
+
reached_at: string | null;
|
|
2617
|
+
}
|
|
2508
2618
|
/** Minimum commitment for this plan. */
|
|
2509
2619
|
export type MinimumCommitmentInput = {
|
|
2510
2620
|
/**
|
|
@@ -3179,6 +3289,48 @@ export interface PaginationMeta {
|
|
|
3179
3289
|
*/
|
|
3180
3290
|
total_count: number;
|
|
3181
3291
|
}
|
|
3292
|
+
export interface PaymentRequestObject {
|
|
3293
|
+
/**
|
|
3294
|
+
* Unique identifier of the payment request, created by Lago.
|
|
3295
|
+
* @format uuid
|
|
3296
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3297
|
+
*/
|
|
3298
|
+
lago_id: string;
|
|
3299
|
+
/**
|
|
3300
|
+
* The customer's email address used for sending dunning notifications
|
|
3301
|
+
* @format email
|
|
3302
|
+
* @example "dinesh@piedpiper.test"
|
|
3303
|
+
*/
|
|
3304
|
+
email: string;
|
|
3305
|
+
/**
|
|
3306
|
+
* The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
|
|
3307
|
+
* @example 100
|
|
3308
|
+
*/
|
|
3309
|
+
amount_cents: number;
|
|
3310
|
+
/** The currency of the payment request. */
|
|
3311
|
+
amount_currency: Currency;
|
|
3312
|
+
/**
|
|
3313
|
+
* The status of the payment associated with the payment request. It can have one of the following values:
|
|
3314
|
+
* - `pending`: the payment is pending, waiting for payment processing in the payment provider or when the invoice is emitted but users have not updated the payment status through the endpoint.
|
|
3315
|
+
* - `succeeded`: the payment of the payment request has been successfully processed.
|
|
3316
|
+
* - `failed`: the payment of the payment request has failed or encountered an error during processing.
|
|
3317
|
+
* @example "succeeded"
|
|
3318
|
+
*/
|
|
3319
|
+
payment_status: "pending" | "succeeded" | "failed";
|
|
3320
|
+
/**
|
|
3321
|
+
* The date and time when the payment request 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 payment request was initially created.
|
|
3322
|
+
* @format date-time
|
|
3323
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3324
|
+
*/
|
|
3325
|
+
created_at: string;
|
|
3326
|
+
/** The customer on which the payment request applies. It refers to the customer account or entity associated with the payment request. */
|
|
3327
|
+
customer: any;
|
|
3328
|
+
invoices: any[];
|
|
3329
|
+
}
|
|
3330
|
+
export interface PaymentRequestsPaginated {
|
|
3331
|
+
payment_requests: PaymentRequestObject[];
|
|
3332
|
+
meta: PaginationMeta;
|
|
3333
|
+
}
|
|
3182
3334
|
export interface Plan {
|
|
3183
3335
|
plan: PlanObject;
|
|
3184
3336
|
}
|
|
@@ -4098,13 +4250,13 @@ export interface WalletObject {
|
|
|
4098
4250
|
*/
|
|
4099
4251
|
rate_amount: string;
|
|
4100
4252
|
/**
|
|
4101
|
-
* The current wallet balance expressed in credits.
|
|
4253
|
+
* The current wallet balance expressed in credits. This reflects the available balance after all transactions are settled.
|
|
4102
4254
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4103
4255
|
* @example "28.0"
|
|
4104
4256
|
*/
|
|
4105
4257
|
credits_balance: string;
|
|
4106
4258
|
/**
|
|
4107
|
-
* The current wallet balance expressed in cents.
|
|
4259
|
+
* The current wallet balance expressed in cents. This reflects the available balance after all transactions are settled.
|
|
4108
4260
|
* @example 1000
|
|
4109
4261
|
*/
|
|
4110
4262
|
balance_cents: number;
|
|
@@ -4225,23 +4377,23 @@ export interface WalletObject {
|
|
|
4225
4377
|
}[];
|
|
4226
4378
|
}[];
|
|
4227
4379
|
/**
|
|
4228
|
-
* The wallet
|
|
4380
|
+
* The ongoing wallet balance expressed in cents. This represents the `balance_cents` minus the `ongoing_usage_balance_cents`, showing the real time balance after accounting for current usage including taxes.
|
|
4229
4381
|
* @example 800
|
|
4230
4382
|
*/
|
|
4231
4383
|
ongoing_balance_cents: number;
|
|
4232
4384
|
/**
|
|
4233
|
-
* The
|
|
4385
|
+
* The ongoing usage balance of the wallet, expressed in cents. This reflects all current usage including taxes.
|
|
4234
4386
|
* @example 200
|
|
4235
4387
|
*/
|
|
4236
4388
|
ongoing_usage_balance_cents: number;
|
|
4237
4389
|
/**
|
|
4238
|
-
* The wallet
|
|
4390
|
+
* The ongoing wallet balance expressed in credits. This represents the `credits_balance` minus the `credits_ongoing_usage_balance`, showing the real time balance after accounting for current usage including taxes.
|
|
4239
4391
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4240
4392
|
* @example "8.0"
|
|
4241
4393
|
*/
|
|
4242
4394
|
credits_ongoing_balance: string;
|
|
4243
4395
|
/**
|
|
4244
|
-
* The
|
|
4396
|
+
* The ongoing usage balance of the wallet, expressed in credits. This reflects all current usage including taxes.
|
|
4245
4397
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4246
4398
|
* @example "2.0"
|
|
4247
4399
|
*/
|
|
@@ -4587,7 +4739,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
4587
4739
|
}
|
|
4588
4740
|
/**
|
|
4589
4741
|
* @title Lago API documentation
|
|
4590
|
-
* @version 1.
|
|
4742
|
+
* @version 1.12.2
|
|
4591
4743
|
* @license AGPLv3
|
|
4592
4744
|
* @baseUrl https://{region}.getlago.com/api/v1
|
|
4593
4745
|
* @externalDocs https://github.com/getlago
|
|
@@ -5104,7 +5256,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5104
5256
|
*/
|
|
5105
5257
|
portal_url: string;
|
|
5106
5258
|
};
|
|
5107
|
-
},
|
|
5259
|
+
}, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
5108
5260
|
/**
|
|
5109
5261
|
* @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period.
|
|
5110
5262
|
*
|
|
@@ -5604,44 +5756,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5604
5756
|
lago_invoice_ids: string[];
|
|
5605
5757
|
};
|
|
5606
5758
|
}, params?: RequestParams) => Promise<HttpResponse<{
|
|
5607
|
-
payment_request:
|
|
5608
|
-
/**
|
|
5609
|
-
* Unique identifier of the payment request, created by Lago.
|
|
5610
|
-
* @format uuid
|
|
5611
|
-
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
5612
|
-
*/
|
|
5613
|
-
lago_id: string;
|
|
5614
|
-
/**
|
|
5615
|
-
* The customer's email address used for sending dunning notifications
|
|
5616
|
-
* @format email
|
|
5617
|
-
* @example "dinesh@piedpiper.test"
|
|
5618
|
-
*/
|
|
5619
|
-
email: string;
|
|
5620
|
-
/**
|
|
5621
|
-
* The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
|
|
5622
|
-
* @example 100
|
|
5623
|
-
*/
|
|
5624
|
-
amount_cents: number;
|
|
5625
|
-
/** The currency of the payment request. */
|
|
5626
|
-
amount_currency: Currency;
|
|
5627
|
-
/**
|
|
5628
|
-
* The status of the payment associated with the payment request. It can have one of the following values:
|
|
5629
|
-
* - `pending`: the payment is pending, waiting for payment processing in the payment provider or when the invoice is emitted but users have not updated the payment status through the endpoint.
|
|
5630
|
-
* - `succeeded`: the payment of the payment request has been successfully processed.
|
|
5631
|
-
* - `failed`: the payment of the payment request has failed or encountered an error during processing.
|
|
5632
|
-
* @example "succeeded"
|
|
5633
|
-
*/
|
|
5634
|
-
payment_status: "pending" | "succeeded" | "failed";
|
|
5635
|
-
/**
|
|
5636
|
-
* The date and time when the payment request 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 payment request was initially created.
|
|
5637
|
-
* @format date-time
|
|
5638
|
-
* @example "2022-04-29T08:59:51Z"
|
|
5639
|
-
*/
|
|
5640
|
-
created_at: string;
|
|
5641
|
-
/** The customer on which the payment request applies. It refers to the customer account or entity associated with the payment request. */
|
|
5642
|
-
customer: any;
|
|
5643
|
-
invoices: any[];
|
|
5644
|
-
};
|
|
5759
|
+
payment_request: PaymentRequestObject;
|
|
5645
5760
|
}, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
5646
5761
|
/**
|
|
5647
5762
|
* @description This endpoint is used to list all existing payment requests.
|
|
@@ -5668,10 +5783,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5668
5783
|
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
5669
5784
|
*/
|
|
5670
5785
|
external_customer_id?: string;
|
|
5671
|
-
}, params?: RequestParams) => Promise<HttpResponse<
|
|
5672
|
-
payment_requests: any[];
|
|
5673
|
-
meta: PaginationMeta;
|
|
5674
|
-
}, ApiErrorUnauthorized>>;
|
|
5786
|
+
}, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized>>;
|
|
5675
5787
|
};
|
|
5676
5788
|
plans: {
|
|
5677
5789
|
/**
|
|
@@ -5819,6 +5931,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5819
5931
|
*/
|
|
5820
5932
|
status?: string;
|
|
5821
5933
|
}, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
|
|
5934
|
+
/**
|
|
5935
|
+
* @description This endpoint enables the retrieval of the lifetime usage of a subscription.
|
|
5936
|
+
*
|
|
5937
|
+
* @tags subscriptions
|
|
5938
|
+
* @name GetSubscriptionLifetimeUsage
|
|
5939
|
+
* @summary Retrive subscription lifetime usage
|
|
5940
|
+
* @request GET:/subscriptions/{external_id}/lifetime_usage
|
|
5941
|
+
* @secure
|
|
5942
|
+
*/
|
|
5943
|
+
getSubscriptionLifetimeUsage: (externalId: string, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
5944
|
+
/**
|
|
5945
|
+
* @description This endpoint allows you to update the lifetime usage of a subscription.
|
|
5946
|
+
*
|
|
5947
|
+
* @tags subscriptions
|
|
5948
|
+
* @name UpdateSubscriptionLifetimeUsage
|
|
5949
|
+
* @summary Update a subscription lifetime usage
|
|
5950
|
+
* @request PUT:/subscriptions/{external_id}/lifetime_usage
|
|
5951
|
+
* @secure
|
|
5952
|
+
*/
|
|
5953
|
+
updateSubscriptionLifetimeUsage: (externalId: string, data: LifetimeUsageInput, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
5822
5954
|
};
|
|
5823
5955
|
taxes: {
|
|
5824
5956
|
/**
|
package/esm/openapi/client.js
CHANGED
|
@@ -148,7 +148,7 @@ export class HttpClient {
|
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
150
|
* @title Lago API documentation
|
|
151
|
-
* @version 1.
|
|
151
|
+
* @version 1.12.2
|
|
152
152
|
* @license AGPLv3
|
|
153
153
|
* @baseUrl https://{region}.getlago.com/api/v1
|
|
154
154
|
* @externalDocs https://github.com/getlago
|
|
@@ -1383,6 +1383,40 @@ export class Api extends HttpClient {
|
|
|
1383
1383
|
format: "json",
|
|
1384
1384
|
...params,
|
|
1385
1385
|
}),
|
|
1386
|
+
/**
|
|
1387
|
+
* @description This endpoint enables the retrieval of the lifetime usage of a subscription.
|
|
1388
|
+
*
|
|
1389
|
+
* @tags subscriptions
|
|
1390
|
+
* @name GetSubscriptionLifetimeUsage
|
|
1391
|
+
* @summary Retrive subscription lifetime usage
|
|
1392
|
+
* @request GET:/subscriptions/{external_id}/lifetime_usage
|
|
1393
|
+
* @secure
|
|
1394
|
+
*/
|
|
1395
|
+
getSubscriptionLifetimeUsage: (externalId, params = {}) => this.request({
|
|
1396
|
+
path: `/subscriptions/${externalId}/lifetime_usage`,
|
|
1397
|
+
method: "GET",
|
|
1398
|
+
secure: true,
|
|
1399
|
+
format: "json",
|
|
1400
|
+
...params,
|
|
1401
|
+
}),
|
|
1402
|
+
/**
|
|
1403
|
+
* @description This endpoint allows you to update the lifetime usage of a subscription.
|
|
1404
|
+
*
|
|
1405
|
+
* @tags subscriptions
|
|
1406
|
+
* @name UpdateSubscriptionLifetimeUsage
|
|
1407
|
+
* @summary Update a subscription lifetime usage
|
|
1408
|
+
* @request PUT:/subscriptions/{external_id}/lifetime_usage
|
|
1409
|
+
* @secure
|
|
1410
|
+
*/
|
|
1411
|
+
updateSubscriptionLifetimeUsage: (externalId, data, params = {}) => this.request({
|
|
1412
|
+
path: `/subscriptions/${externalId}/lifetime_usage`,
|
|
1413
|
+
method: "PUT",
|
|
1414
|
+
body: data,
|
|
1415
|
+
secure: true,
|
|
1416
|
+
type: ContentType.Json,
|
|
1417
|
+
format: "json",
|
|
1418
|
+
...params,
|
|
1419
|
+
}),
|
|
1386
1420
|
};
|
|
1387
1421
|
taxes = {
|
|
1388
1422
|
/**
|
package/package.json
CHANGED
|
@@ -1633,6 +1633,22 @@ export interface CustomerCreateInput {
|
|
|
1633
1633
|
* @example "Gavin Belson"
|
|
1634
1634
|
*/
|
|
1635
1635
|
name?: string | null;
|
|
1636
|
+
/**
|
|
1637
|
+
* First name of the customer
|
|
1638
|
+
* @example "Gavin"
|
|
1639
|
+
*/
|
|
1640
|
+
firstname?: string | null;
|
|
1641
|
+
/**
|
|
1642
|
+
* Last name of the customer
|
|
1643
|
+
* @example "Belson"
|
|
1644
|
+
*/
|
|
1645
|
+
lastname?: string | null;
|
|
1646
|
+
/**
|
|
1647
|
+
* The type of the customer. It can have one of the following values:
|
|
1648
|
+
* - `company`: the customer is a company.
|
|
1649
|
+
* - `individual`: the customer is an individual.
|
|
1650
|
+
*/
|
|
1651
|
+
customer_type?: "company" | "individual" | null;
|
|
1636
1652
|
/**
|
|
1637
1653
|
* The phone number of the customer
|
|
1638
1654
|
* @example "1-171-883-3711 x245"
|
|
@@ -1841,6 +1857,22 @@ export type CustomerObject = {
|
|
|
1841
1857
|
* @example "Gavin Belson"
|
|
1842
1858
|
*/
|
|
1843
1859
|
name?: string | null;
|
|
1860
|
+
/**
|
|
1861
|
+
* First name of the customer
|
|
1862
|
+
* @example "Gavin"
|
|
1863
|
+
*/
|
|
1864
|
+
firstname?: string | null;
|
|
1865
|
+
/**
|
|
1866
|
+
* Last name of the customer
|
|
1867
|
+
* @example "Belson"
|
|
1868
|
+
*/
|
|
1869
|
+
lastname?: string | null;
|
|
1870
|
+
/**
|
|
1871
|
+
* The type of the customer. It can have one of the following values:
|
|
1872
|
+
* - `company`: the customer is a company.
|
|
1873
|
+
* - `individual`: the customer is an individual.
|
|
1874
|
+
*/
|
|
1875
|
+
customer_type?: "company" | "individual" | null;
|
|
1844
1876
|
/**
|
|
1845
1877
|
* The phone number of the customer
|
|
1846
1878
|
* @example "1-171-883-3711 x245"
|
|
@@ -2505,6 +2537,84 @@ export interface GrossRevenueObject {
|
|
|
2505
2537
|
export interface GrossRevenues {
|
|
2506
2538
|
gross_revenues: GrossRevenueObject[];
|
|
2507
2539
|
}
|
|
2540
|
+
export interface LifetimeUsage {
|
|
2541
|
+
lifetime_usage: LifetimeUsageObject;
|
|
2542
|
+
}
|
|
2543
|
+
export interface LifetimeUsageInput {
|
|
2544
|
+
lifetime_usage: {
|
|
2545
|
+
/**
|
|
2546
|
+
* The historical usage amount in cents for the subscription (provided by your own application).
|
|
2547
|
+
* @example 100
|
|
2548
|
+
*/
|
|
2549
|
+
external_historical_usage_amount_cents: number;
|
|
2550
|
+
};
|
|
2551
|
+
}
|
|
2552
|
+
export interface LifetimeUsageObject {
|
|
2553
|
+
/**
|
|
2554
|
+
* Unique identifier assigned to the lifetime usage record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the lifetime usage record within the Lago system
|
|
2555
|
+
* @format uuid
|
|
2556
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2557
|
+
*/
|
|
2558
|
+
lago_id: string;
|
|
2559
|
+
/**
|
|
2560
|
+
* Unique identifier assigned to the subscription record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription record within the Lago system
|
|
2561
|
+
* @format uuid
|
|
2562
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2563
|
+
*/
|
|
2564
|
+
lago_subscription_id: string;
|
|
2565
|
+
/**
|
|
2566
|
+
* The subscription external unique identifier (provided by your own application).
|
|
2567
|
+
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
2568
|
+
*/
|
|
2569
|
+
external_subscription_id: string;
|
|
2570
|
+
/**
|
|
2571
|
+
* The historical usage amount in cents for the subscription (provided by your own application).
|
|
2572
|
+
* @example 100
|
|
2573
|
+
*/
|
|
2574
|
+
external_historical_usage_amount_cents: number;
|
|
2575
|
+
/**
|
|
2576
|
+
* The total invoiced usage amount in cents for the subscription.
|
|
2577
|
+
* @example 100
|
|
2578
|
+
*/
|
|
2579
|
+
invoiced_usage_amount_cents: number;
|
|
2580
|
+
/**
|
|
2581
|
+
* The current usage amount in cents for the subscription on the current billing period.
|
|
2582
|
+
* @example 100
|
|
2583
|
+
*/
|
|
2584
|
+
current_usage_amount_cents: number;
|
|
2585
|
+
/**
|
|
2586
|
+
* The recording start date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
|
|
2587
|
+
* @format date-time
|
|
2588
|
+
* @example "2024-01-01T00:00:00Z"
|
|
2589
|
+
*/
|
|
2590
|
+
from_datetime: string;
|
|
2591
|
+
/**
|
|
2592
|
+
* The recording end date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
|
|
2593
|
+
* @format date-time
|
|
2594
|
+
* @example "2024-12-31T23:59:59Z"
|
|
2595
|
+
*/
|
|
2596
|
+
to_datetime: string;
|
|
2597
|
+
/** Array of usage thresholds attached to the subscription's plan. */
|
|
2598
|
+
usage_thresholds?: LifetimeUsageThresholdObject[];
|
|
2599
|
+
}
|
|
2600
|
+
export interface LifetimeUsageThresholdObject {
|
|
2601
|
+
/**
|
|
2602
|
+
* The usage threshold amount in cents.
|
|
2603
|
+
* @example 100
|
|
2604
|
+
*/
|
|
2605
|
+
amount_cents: number;
|
|
2606
|
+
/**
|
|
2607
|
+
* The completion ratio of the usage threshold.
|
|
2608
|
+
* @example 0.5
|
|
2609
|
+
*/
|
|
2610
|
+
completion_ratio: number;
|
|
2611
|
+
/**
|
|
2612
|
+
* The date and time when the usage threshold was reached. The date and time must be in ISO 8601 format.
|
|
2613
|
+
* @format date-time
|
|
2614
|
+
* @example "2024-01-01T00:00:00Z"
|
|
2615
|
+
*/
|
|
2616
|
+
reached_at: string | null;
|
|
2617
|
+
}
|
|
2508
2618
|
/** Minimum commitment for this plan. */
|
|
2509
2619
|
export type MinimumCommitmentInput = {
|
|
2510
2620
|
/**
|
|
@@ -3179,6 +3289,48 @@ export interface PaginationMeta {
|
|
|
3179
3289
|
*/
|
|
3180
3290
|
total_count: number;
|
|
3181
3291
|
}
|
|
3292
|
+
export interface PaymentRequestObject {
|
|
3293
|
+
/**
|
|
3294
|
+
* Unique identifier of the payment request, created by Lago.
|
|
3295
|
+
* @format uuid
|
|
3296
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3297
|
+
*/
|
|
3298
|
+
lago_id: string;
|
|
3299
|
+
/**
|
|
3300
|
+
* The customer's email address used for sending dunning notifications
|
|
3301
|
+
* @format email
|
|
3302
|
+
* @example "dinesh@piedpiper.test"
|
|
3303
|
+
*/
|
|
3304
|
+
email: string;
|
|
3305
|
+
/**
|
|
3306
|
+
* The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
|
|
3307
|
+
* @example 100
|
|
3308
|
+
*/
|
|
3309
|
+
amount_cents: number;
|
|
3310
|
+
/** The currency of the payment request. */
|
|
3311
|
+
amount_currency: Currency;
|
|
3312
|
+
/**
|
|
3313
|
+
* The status of the payment associated with the payment request. It can have one of the following values:
|
|
3314
|
+
* - `pending`: the payment is pending, waiting for payment processing in the payment provider or when the invoice is emitted but users have not updated the payment status through the endpoint.
|
|
3315
|
+
* - `succeeded`: the payment of the payment request has been successfully processed.
|
|
3316
|
+
* - `failed`: the payment of the payment request has failed or encountered an error during processing.
|
|
3317
|
+
* @example "succeeded"
|
|
3318
|
+
*/
|
|
3319
|
+
payment_status: "pending" | "succeeded" | "failed";
|
|
3320
|
+
/**
|
|
3321
|
+
* The date and time when the payment request 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 payment request was initially created.
|
|
3322
|
+
* @format date-time
|
|
3323
|
+
* @example "2022-04-29T08:59:51Z"
|
|
3324
|
+
*/
|
|
3325
|
+
created_at: string;
|
|
3326
|
+
/** The customer on which the payment request applies. It refers to the customer account or entity associated with the payment request. */
|
|
3327
|
+
customer: any;
|
|
3328
|
+
invoices: any[];
|
|
3329
|
+
}
|
|
3330
|
+
export interface PaymentRequestsPaginated {
|
|
3331
|
+
payment_requests: PaymentRequestObject[];
|
|
3332
|
+
meta: PaginationMeta;
|
|
3333
|
+
}
|
|
3182
3334
|
export interface Plan {
|
|
3183
3335
|
plan: PlanObject;
|
|
3184
3336
|
}
|
|
@@ -4098,13 +4250,13 @@ export interface WalletObject {
|
|
|
4098
4250
|
*/
|
|
4099
4251
|
rate_amount: string;
|
|
4100
4252
|
/**
|
|
4101
|
-
* The current wallet balance expressed in credits.
|
|
4253
|
+
* The current wallet balance expressed in credits. This reflects the available balance after all transactions are settled.
|
|
4102
4254
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4103
4255
|
* @example "28.0"
|
|
4104
4256
|
*/
|
|
4105
4257
|
credits_balance: string;
|
|
4106
4258
|
/**
|
|
4107
|
-
* The current wallet balance expressed in cents.
|
|
4259
|
+
* The current wallet balance expressed in cents. This reflects the available balance after all transactions are settled.
|
|
4108
4260
|
* @example 1000
|
|
4109
4261
|
*/
|
|
4110
4262
|
balance_cents: number;
|
|
@@ -4225,23 +4377,23 @@ export interface WalletObject {
|
|
|
4225
4377
|
}[];
|
|
4226
4378
|
}[];
|
|
4227
4379
|
/**
|
|
4228
|
-
* The wallet
|
|
4380
|
+
* The ongoing wallet balance expressed in cents. This represents the `balance_cents` minus the `ongoing_usage_balance_cents`, showing the real time balance after accounting for current usage including taxes.
|
|
4229
4381
|
* @example 800
|
|
4230
4382
|
*/
|
|
4231
4383
|
ongoing_balance_cents: number;
|
|
4232
4384
|
/**
|
|
4233
|
-
* The
|
|
4385
|
+
* The ongoing usage balance of the wallet, expressed in cents. This reflects all current usage including taxes.
|
|
4234
4386
|
* @example 200
|
|
4235
4387
|
*/
|
|
4236
4388
|
ongoing_usage_balance_cents: number;
|
|
4237
4389
|
/**
|
|
4238
|
-
* The wallet
|
|
4390
|
+
* The ongoing wallet balance expressed in credits. This represents the `credits_balance` minus the `credits_ongoing_usage_balance`, showing the real time balance after accounting for current usage including taxes.
|
|
4239
4391
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4240
4392
|
* @example "8.0"
|
|
4241
4393
|
*/
|
|
4242
4394
|
credits_ongoing_balance: string;
|
|
4243
4395
|
/**
|
|
4244
|
-
* The
|
|
4396
|
+
* The ongoing usage balance of the wallet, expressed in credits. This reflects all current usage including taxes.
|
|
4245
4397
|
* @pattern ^[0-9]+.?[0-9]*$
|
|
4246
4398
|
* @example "2.0"
|
|
4247
4399
|
*/
|
|
@@ -4587,7 +4739,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
4587
4739
|
}
|
|
4588
4740
|
/**
|
|
4589
4741
|
* @title Lago API documentation
|
|
4590
|
-
* @version 1.
|
|
4742
|
+
* @version 1.12.2
|
|
4591
4743
|
* @license AGPLv3
|
|
4592
4744
|
* @baseUrl https://{region}.getlago.com/api/v1
|
|
4593
4745
|
* @externalDocs https://github.com/getlago
|
|
@@ -5104,7 +5256,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5104
5256
|
*/
|
|
5105
5257
|
portal_url: string;
|
|
5106
5258
|
};
|
|
5107
|
-
},
|
|
5259
|
+
}, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
5108
5260
|
/**
|
|
5109
5261
|
* @description This endpoint enables the retrieval of the usage-based billing data for a customer within the current period.
|
|
5110
5262
|
*
|
|
@@ -5604,44 +5756,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5604
5756
|
lago_invoice_ids: string[];
|
|
5605
5757
|
};
|
|
5606
5758
|
}, params?: RequestParams) => Promise<HttpResponse<{
|
|
5607
|
-
payment_request:
|
|
5608
|
-
/**
|
|
5609
|
-
* Unique identifier of the payment request, created by Lago.
|
|
5610
|
-
* @format uuid
|
|
5611
|
-
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
5612
|
-
*/
|
|
5613
|
-
lago_id: string;
|
|
5614
|
-
/**
|
|
5615
|
-
* The customer's email address used for sending dunning notifications
|
|
5616
|
-
* @format email
|
|
5617
|
-
* @example "dinesh@piedpiper.test"
|
|
5618
|
-
*/
|
|
5619
|
-
email: string;
|
|
5620
|
-
/**
|
|
5621
|
-
* The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
|
|
5622
|
-
* @example 100
|
|
5623
|
-
*/
|
|
5624
|
-
amount_cents: number;
|
|
5625
|
-
/** The currency of the payment request. */
|
|
5626
|
-
amount_currency: Currency;
|
|
5627
|
-
/**
|
|
5628
|
-
* The status of the payment associated with the payment request. It can have one of the following values:
|
|
5629
|
-
* - `pending`: the payment is pending, waiting for payment processing in the payment provider or when the invoice is emitted but users have not updated the payment status through the endpoint.
|
|
5630
|
-
* - `succeeded`: the payment of the payment request has been successfully processed.
|
|
5631
|
-
* - `failed`: the payment of the payment request has failed or encountered an error during processing.
|
|
5632
|
-
* @example "succeeded"
|
|
5633
|
-
*/
|
|
5634
|
-
payment_status: "pending" | "succeeded" | "failed";
|
|
5635
|
-
/**
|
|
5636
|
-
* The date and time when the payment request 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 payment request was initially created.
|
|
5637
|
-
* @format date-time
|
|
5638
|
-
* @example "2022-04-29T08:59:51Z"
|
|
5639
|
-
*/
|
|
5640
|
-
created_at: string;
|
|
5641
|
-
/** The customer on which the payment request applies. It refers to the customer account or entity associated with the payment request. */
|
|
5642
|
-
customer: any;
|
|
5643
|
-
invoices: any[];
|
|
5644
|
-
};
|
|
5759
|
+
payment_request: PaymentRequestObject;
|
|
5645
5760
|
}, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
|
|
5646
5761
|
/**
|
|
5647
5762
|
* @description This endpoint is used to list all existing payment requests.
|
|
@@ -5668,10 +5783,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5668
5783
|
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
5669
5784
|
*/
|
|
5670
5785
|
external_customer_id?: string;
|
|
5671
|
-
}, params?: RequestParams) => Promise<HttpResponse<
|
|
5672
|
-
payment_requests: any[];
|
|
5673
|
-
meta: PaginationMeta;
|
|
5674
|
-
}, ApiErrorUnauthorized>>;
|
|
5786
|
+
}, params?: RequestParams) => Promise<HttpResponse<PaymentRequestsPaginated, ApiErrorUnauthorized>>;
|
|
5675
5787
|
};
|
|
5676
5788
|
plans: {
|
|
5677
5789
|
/**
|
|
@@ -5819,6 +5931,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5819
5931
|
*/
|
|
5820
5932
|
status?: string;
|
|
5821
5933
|
}, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
|
|
5934
|
+
/**
|
|
5935
|
+
* @description This endpoint enables the retrieval of the lifetime usage of a subscription.
|
|
5936
|
+
*
|
|
5937
|
+
* @tags subscriptions
|
|
5938
|
+
* @name GetSubscriptionLifetimeUsage
|
|
5939
|
+
* @summary Retrive subscription lifetime usage
|
|
5940
|
+
* @request GET:/subscriptions/{external_id}/lifetime_usage
|
|
5941
|
+
* @secure
|
|
5942
|
+
*/
|
|
5943
|
+
getSubscriptionLifetimeUsage: (externalId: string, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
5944
|
+
/**
|
|
5945
|
+
* @description This endpoint allows you to update the lifetime usage of a subscription.
|
|
5946
|
+
*
|
|
5947
|
+
* @tags subscriptions
|
|
5948
|
+
* @name UpdateSubscriptionLifetimeUsage
|
|
5949
|
+
* @summary Update a subscription lifetime usage
|
|
5950
|
+
* @request PUT:/subscriptions/{external_id}/lifetime_usage
|
|
5951
|
+
* @secure
|
|
5952
|
+
*/
|
|
5953
|
+
updateSubscriptionLifetimeUsage: (externalId: string, data: LifetimeUsageInput, params?: RequestParams) => Promise<HttpResponse<LifetimeUsage, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
5822
5954
|
};
|
|
5823
5955
|
taxes: {
|
|
5824
5956
|
/**
|
package/script/openapi/client.js
CHANGED
|
@@ -152,7 +152,7 @@ class HttpClient {
|
|
|
152
152
|
exports.HttpClient = HttpClient;
|
|
153
153
|
/**
|
|
154
154
|
* @title Lago API documentation
|
|
155
|
-
* @version 1.
|
|
155
|
+
* @version 1.12.2
|
|
156
156
|
* @license AGPLv3
|
|
157
157
|
* @baseUrl https://{region}.getlago.com/api/v1
|
|
158
158
|
* @externalDocs https://github.com/getlago
|
|
@@ -1387,6 +1387,40 @@ class Api extends HttpClient {
|
|
|
1387
1387
|
format: "json",
|
|
1388
1388
|
...params,
|
|
1389
1389
|
}),
|
|
1390
|
+
/**
|
|
1391
|
+
* @description This endpoint enables the retrieval of the lifetime usage of a subscription.
|
|
1392
|
+
*
|
|
1393
|
+
* @tags subscriptions
|
|
1394
|
+
* @name GetSubscriptionLifetimeUsage
|
|
1395
|
+
* @summary Retrive subscription lifetime usage
|
|
1396
|
+
* @request GET:/subscriptions/{external_id}/lifetime_usage
|
|
1397
|
+
* @secure
|
|
1398
|
+
*/
|
|
1399
|
+
getSubscriptionLifetimeUsage: (externalId, params = {}) => this.request({
|
|
1400
|
+
path: `/subscriptions/${externalId}/lifetime_usage`,
|
|
1401
|
+
method: "GET",
|
|
1402
|
+
secure: true,
|
|
1403
|
+
format: "json",
|
|
1404
|
+
...params,
|
|
1405
|
+
}),
|
|
1406
|
+
/**
|
|
1407
|
+
* @description This endpoint allows you to update the lifetime usage of a subscription.
|
|
1408
|
+
*
|
|
1409
|
+
* @tags subscriptions
|
|
1410
|
+
* @name UpdateSubscriptionLifetimeUsage
|
|
1411
|
+
* @summary Update a subscription lifetime usage
|
|
1412
|
+
* @request PUT:/subscriptions/{external_id}/lifetime_usage
|
|
1413
|
+
* @secure
|
|
1414
|
+
*/
|
|
1415
|
+
updateSubscriptionLifetimeUsage: (externalId, data, params = {}) => this.request({
|
|
1416
|
+
path: `/subscriptions/${externalId}/lifetime_usage`,
|
|
1417
|
+
method: "PUT",
|
|
1418
|
+
body: data,
|
|
1419
|
+
secure: true,
|
|
1420
|
+
type: ContentType.Json,
|
|
1421
|
+
format: "json",
|
|
1422
|
+
...params,
|
|
1423
|
+
}),
|
|
1390
1424
|
};
|
|
1391
1425
|
taxes = {
|
|
1392
1426
|
/**
|