lago-javascript-client 1.54.0 → 1.55.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 +124 -82
- package/esm/openapi/client.js +8 -8
- package/esm/openapi/webhooks.d.ts +132 -86
- package/package.json +1 -1
- package/script/openapi/client.d.ts +124 -82
- package/script/openapi/client.js +8 -8
- package/script/openapi/webhooks.d.ts +132 -86
package/esm/openapi/client.d.ts
CHANGED
|
@@ -629,8 +629,8 @@ export interface ActivityLogObject {
|
|
|
629
629
|
*/
|
|
630
630
|
user_email?: string | null;
|
|
631
631
|
/**
|
|
632
|
-
* This field stores the
|
|
633
|
-
* @example "
|
|
632
|
+
* This field stores the activity action that was performed on the activity_object.
|
|
633
|
+
* @example "billable_metric.created"
|
|
634
634
|
*/
|
|
635
635
|
activity_type: string;
|
|
636
636
|
/**
|
|
@@ -670,12 +670,6 @@ export interface ActivityLogObject {
|
|
|
670
670
|
* @example "BillableMetric"
|
|
671
671
|
*/
|
|
672
672
|
resource_type: string;
|
|
673
|
-
/**
|
|
674
|
-
* Unique identifier for the organization associated with the activity log.
|
|
675
|
-
* @format uuid
|
|
676
|
-
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
677
|
-
*/
|
|
678
|
-
organization_id: string;
|
|
679
673
|
/**
|
|
680
674
|
* The logged date of the activity, presented in the ISO 8601 datetime format, specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record was created within the Lago application
|
|
681
675
|
* @format date-time
|
|
@@ -844,10 +838,10 @@ export interface ApiLogObject {
|
|
|
844
838
|
*/
|
|
845
839
|
logged_at: string;
|
|
846
840
|
/**
|
|
847
|
-
*
|
|
848
|
-
* @example
|
|
841
|
+
* The parameters of the request, keyed by their top-level name. Nested values are returned JSON-encoded.
|
|
842
|
+
* @example {"billable_metric":"{\"name\":\"Storage\",\"code\":\"storage\"}"}
|
|
849
843
|
*/
|
|
850
|
-
request_body: string
|
|
844
|
+
request_body: Record<string, any>;
|
|
851
845
|
/**
|
|
852
846
|
* This field represents the API origin of the requested URL
|
|
853
847
|
* @example "https://app.lago.dev/"
|
|
@@ -871,10 +865,10 @@ export interface ApiLogObject {
|
|
|
871
865
|
*/
|
|
872
866
|
request_id: string;
|
|
873
867
|
/**
|
|
874
|
-
*
|
|
875
|
-
* @example "{
|
|
868
|
+
* The body Lago returned for the request, keyed by its top-level name. Nested values are returned JSON-encoded. Null when the response had no body.
|
|
869
|
+
* @example {"billable_metric":"{\"lago_id\":\"b9155544-e261-4e92-b54e-f65d7609294c\"}"}
|
|
876
870
|
*/
|
|
877
|
-
request_response?:
|
|
871
|
+
request_response?: object | null;
|
|
878
872
|
}
|
|
879
873
|
export interface ApiLogsPaginated {
|
|
880
874
|
api_logs: ApiLogObject[];
|
|
@@ -1355,10 +1349,10 @@ export interface BillableMetricObject {
|
|
|
1355
1349
|
*/
|
|
1356
1350
|
created_at: string;
|
|
1357
1351
|
/**
|
|
1358
|
-
* Expression used to calculate the event units. The expression is
|
|
1352
|
+
* Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units.
|
|
1359
1353
|
* @example "round((ended_at - started_at) * units)"
|
|
1360
1354
|
*/
|
|
1361
|
-
expression?: string;
|
|
1355
|
+
expression?: string | null;
|
|
1362
1356
|
/**
|
|
1363
1357
|
* Property of the billable metric used for aggregating usage data. This field is not required for `count_agg`.
|
|
1364
1358
|
* @example "gb"
|
|
@@ -1416,8 +1410,8 @@ export interface BillableMetricBaseInput {
|
|
|
1416
1410
|
*/
|
|
1417
1411
|
recurring?: boolean;
|
|
1418
1412
|
/**
|
|
1419
|
-
* Expression used to calculate the event units. The expression is
|
|
1420
|
-
* Accepted
|
|
1413
|
+
* Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units.
|
|
1414
|
+
* Accepted functions are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations.
|
|
1421
1415
|
* Round is accepting an optional second parameter to specify the number of decimal.
|
|
1422
1416
|
* @example "round((ended_at - started_at) * units)"
|
|
1423
1417
|
*/
|
|
@@ -1457,8 +1451,8 @@ export interface BillableMetric {
|
|
|
1457
1451
|
}
|
|
1458
1452
|
export interface BillableMetricEvaluateExpressionInput {
|
|
1459
1453
|
/**
|
|
1460
|
-
* Expression used to calculate the event units. The expression is
|
|
1461
|
-
* Accepted
|
|
1454
|
+
* Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units.
|
|
1455
|
+
* Accepted functions are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations.
|
|
1462
1456
|
* Round is accepting an optional second parameter to specify the number of decimal.
|
|
1463
1457
|
* @example "round((ended_at - started_at) * units)"
|
|
1464
1458
|
*/
|
|
@@ -5539,13 +5533,13 @@ export interface EventObject {
|
|
|
5539
5533
|
*/
|
|
5540
5534
|
code: string;
|
|
5541
5535
|
/**
|
|
5542
|
-
*
|
|
5536
|
+
* The date and time at which the event occurred, in ISO 8601 format with millisecond precision and expressed in Coordinated Universal Time (UTC). When no timestamp is sent on the event, it is set to the time of event reception.
|
|
5543
5537
|
* @format date-time
|
|
5544
5538
|
* @example "2022-04-29T08:59:51.123Z"
|
|
5545
5539
|
*/
|
|
5546
5540
|
timestamp: string;
|
|
5547
5541
|
/**
|
|
5548
|
-
* The precise total amount that was sent in the event payload. This
|
|
5542
|
+
* The precise total amount that was sent in the event payload. This field is used by the `dynamic` pricing model.
|
|
5549
5543
|
* @example "1234.56"
|
|
5550
5544
|
*/
|
|
5551
5545
|
precise_total_amount_cents?: string | null;
|
|
@@ -5565,7 +5559,7 @@ export interface EventObject {
|
|
|
5565
5559
|
*/
|
|
5566
5560
|
lago_subscription_id: string | null;
|
|
5567
5561
|
/**
|
|
5568
|
-
* The unique identifier of the subscription within your application
|
|
5562
|
+
* The unique identifier of the subscription within your application, as sent on the event. It is the value Lago uses to attach the event to a subscription.
|
|
5569
5563
|
* @example "sub_1234567890"
|
|
5570
5564
|
*/
|
|
5571
5565
|
external_subscription_id: string;
|
|
@@ -5604,7 +5598,7 @@ export interface EventInputObject {
|
|
|
5604
5598
|
/**
|
|
5605
5599
|
* This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC).
|
|
5606
5600
|
* If this timestamp is not provided, the API will automatically set it to the time of event reception.
|
|
5607
|
-
* You can also provide
|
|
5601
|
+
* You can also provide milliseconds precision by appending decimals to the timestamp.
|
|
5608
5602
|
* @example "1651240791.123"
|
|
5609
5603
|
*/
|
|
5610
5604
|
timestamp?: number | string;
|
|
@@ -5666,6 +5660,11 @@ export interface EventEstimateFeesInput {
|
|
|
5666
5660
|
* @example "sub_1234567890"
|
|
5667
5661
|
*/
|
|
5668
5662
|
external_subscription_id: string;
|
|
5663
|
+
/**
|
|
5664
|
+
* The precise total amount in cents with precision used by the `dynamic` pricing model to compute the estimated usage amount. Defaults to `0` when omitted.
|
|
5665
|
+
* @example "1234.56"
|
|
5666
|
+
*/
|
|
5667
|
+
precise_total_amount_cents?: string | null;
|
|
5669
5668
|
/** This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. Any property of the targeted billable metric can be sent here, in addition to the documented fields below. */
|
|
5670
5669
|
properties?: {
|
|
5671
5670
|
/**
|
|
@@ -7292,7 +7291,7 @@ export interface MinimumCommitmentObject {
|
|
|
7292
7291
|
* Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
|
|
7293
7292
|
* @example "Minimum Commitment (C1)"
|
|
7294
7293
|
*/
|
|
7295
|
-
invoice_display_name?: string;
|
|
7294
|
+
invoice_display_name?: string | null;
|
|
7296
7295
|
/**
|
|
7297
7296
|
* The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `semiannual`, `quarterly`, `monthly` or `weekly`.
|
|
7298
7297
|
* @example "monthly"
|
|
@@ -7694,7 +7693,7 @@ export interface FixedChargeObject {
|
|
|
7694
7693
|
* 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.
|
|
7695
7694
|
* @example "Setup fee"
|
|
7696
7695
|
*/
|
|
7697
|
-
invoice_display_name: string;
|
|
7696
|
+
invoice_display_name: string | null;
|
|
7698
7697
|
/**
|
|
7699
7698
|
* Unique code used to identify the add-on.
|
|
7700
7699
|
* @example "setup_fee"
|
|
@@ -7748,6 +7747,23 @@ export interface FixedChargeObject {
|
|
|
7748
7747
|
/** List of taxes applied to the fixed charge. */
|
|
7749
7748
|
taxes?: TaxObject[];
|
|
7750
7749
|
}
|
|
7750
|
+
export interface ApplicableUsageThreshold {
|
|
7751
|
+
/**
|
|
7752
|
+
* The display name of the usage threshold.
|
|
7753
|
+
* @example "Threshold 1"
|
|
7754
|
+
*/
|
|
7755
|
+
threshold_display_name: string | null;
|
|
7756
|
+
/**
|
|
7757
|
+
* The amount to reach to trigger a `progressive_billing` invoice.
|
|
7758
|
+
* @example 10000
|
|
7759
|
+
*/
|
|
7760
|
+
amount_cents: number;
|
|
7761
|
+
/**
|
|
7762
|
+
* This field when set to `true` indicates that a `progressive_billing` invoice will be created every time the lifetime usage increases by the specified amount.
|
|
7763
|
+
* @example true
|
|
7764
|
+
*/
|
|
7765
|
+
recurring: boolean;
|
|
7766
|
+
}
|
|
7751
7767
|
export type PlanEntitlementPrivilegeObject = FeaturePrivilegeObject & {
|
|
7752
7768
|
/**
|
|
7753
7769
|
* Value assigned to this privilege in the entitlement. Type depends on the privilege's value_type.
|
|
@@ -7796,7 +7812,7 @@ export interface PlanObject {
|
|
|
7796
7812
|
* Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the plan will be used as the default display name.
|
|
7797
7813
|
* @example "Startup plan"
|
|
7798
7814
|
*/
|
|
7799
|
-
invoice_display_name?: string;
|
|
7815
|
+
invoice_display_name?: string | null;
|
|
7800
7816
|
/**
|
|
7801
7817
|
* The date and time when the plan 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 plan was initially created.
|
|
7802
7818
|
* @format date-time
|
|
@@ -7815,9 +7831,9 @@ export interface PlanObject {
|
|
|
7815
7831
|
interval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly";
|
|
7816
7832
|
/**
|
|
7817
7833
|
* The description on the plan.
|
|
7818
|
-
* @example ""
|
|
7834
|
+
* @example "Plan for early stage startups."
|
|
7819
7835
|
*/
|
|
7820
|
-
description?: string;
|
|
7836
|
+
description?: string | null;
|
|
7821
7837
|
/**
|
|
7822
7838
|
* The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
|
|
7823
7839
|
* @example 10000
|
|
@@ -7832,7 +7848,7 @@ export interface PlanObject {
|
|
|
7832
7848
|
* The duration in days during which the base cost of the plan is offered for free.
|
|
7833
7849
|
* @example 5
|
|
7834
7850
|
*/
|
|
7835
|
-
trial_period?: number;
|
|
7851
|
+
trial_period?: number | null;
|
|
7836
7852
|
/**
|
|
7837
7853
|
* This field determines the billing timing for the plan. When set to `true`, the base cost of the plan is due at the beginning of each billing period. Conversely, when set to `false`, the base cost of the plan is due at the end of each billing period.
|
|
7838
7854
|
* @example true
|
|
@@ -7848,6 +7864,17 @@ export interface PlanObject {
|
|
|
7848
7864
|
* @example null
|
|
7849
7865
|
*/
|
|
7850
7866
|
bill_fixed_charges_monthly?: boolean | null;
|
|
7867
|
+
/**
|
|
7868
|
+
* Unique identifier of the parent plan, created by Lago. It is set on plans that override a parent plan for a single subscription, and `null` on standard plans.
|
|
7869
|
+
* @format uuid
|
|
7870
|
+
* @example null
|
|
7871
|
+
*/
|
|
7872
|
+
parent_id?: string | null;
|
|
7873
|
+
/**
|
|
7874
|
+
* This field is set to `true` when the plan is scheduled for deletion but still attached to subscriptions that have to be billed first.
|
|
7875
|
+
* @example false
|
|
7876
|
+
*/
|
|
7877
|
+
pending_deletion?: boolean;
|
|
7851
7878
|
minimum_commitment?: MinimumCommitmentObject;
|
|
7852
7879
|
/**
|
|
7853
7880
|
* Additional usage-based charges for this plan.
|
|
@@ -7863,6 +7890,8 @@ export interface PlanObject {
|
|
|
7863
7890
|
taxes?: TaxObject[];
|
|
7864
7891
|
/** List of usage thresholds applied to the plan. */
|
|
7865
7892
|
usage_thresholds?: UsageThresholdObject[];
|
|
7893
|
+
/** List of usage thresholds that actually apply to the plan. For an overriding plan these are inherited from its parent plan; for a standard plan they match `usage_thresholds`. */
|
|
7894
|
+
applicable_usage_thresholds?: ApplicableUsageThreshold[];
|
|
7866
7895
|
/** List of all feature entitlements and their privileges available for this plan. */
|
|
7867
7896
|
entitlements?: PlanEntitlement[];
|
|
7868
7897
|
/**
|
|
@@ -8078,7 +8107,7 @@ export interface PlanCreateInput {
|
|
|
8078
8107
|
}[];
|
|
8079
8108
|
/**
|
|
8080
8109
|
* Additional fixed charges for this plan.
|
|
8081
|
-
* @example [{"add_on_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","code":"setup_fee","invoice_display_name":"Setup Fee","charge_model":"standard","pay_in_advance":true,"prorated":false,"properties":{"amount":"500"},"units":1,"tax_codes":["french_standard_vat"]},{"add_on_id":"4d604d60-4d60-4d60-4d60-4d604d604d60","invoice_display_name":"Support Tier","charge_model":"graduated","pay_in_advance":false,"prorated":true,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"per_unit_amount":"5","flat_amount":"200"},{"from_value":11,"to_value":null,"per_unit_amount":"1","flat_amount":"300"}]},"units":2},{"add_on_id":"6f406f40-6f40-6f40-6f40-6f406f406f40","charge_model":"volume","properties":{"volume_ranges":[{"from_value":0,"to_value":100,"per_unit_amount":"2","flat_amount":"1"},{"from_value":101,"to_value":null,"per_unit_amount":"1","flat_amount":"0"}]},"units":50}]
|
|
8110
|
+
* @example [{"add_on_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","code":"setup_fee","invoice_display_name":"Setup Fee","charge_model":"standard","pay_in_advance":true,"prorated":false,"properties":{"amount":"500"},"units":1,"apply_units_immediately":false,"tax_codes":["french_standard_vat"]},{"add_on_id":"4d604d60-4d60-4d60-4d60-4d604d604d60","invoice_display_name":"Support Tier","charge_model":"graduated","pay_in_advance":false,"prorated":true,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"per_unit_amount":"5","flat_amount":"200"},{"from_value":11,"to_value":null,"per_unit_amount":"1","flat_amount":"300"}]},"units":2},{"add_on_id":"6f406f40-6f40-6f40-6f40-6f406f406f40","charge_model":"volume","properties":{"volume_ranges":[{"from_value":0,"to_value":100,"per_unit_amount":"2","flat_amount":"1"},{"from_value":101,"to_value":null,"per_unit_amount":"1","flat_amount":"0"}]},"units":50}]
|
|
8082
8111
|
*/
|
|
8083
8112
|
fixed_charges?: {
|
|
8084
8113
|
/**
|
|
@@ -8130,6 +8159,12 @@ export interface PlanCreateInput {
|
|
|
8130
8159
|
properties?: FixedChargeProperties;
|
|
8131
8160
|
/** List of taxes applied to the fixed charge. */
|
|
8132
8161
|
tax_codes?: TaxCodes;
|
|
8162
|
+
/**
|
|
8163
|
+
* When set to `true`, the fixed charge units are applied immediately for active subscriptions. When set to `false`, the units are applied at the next billing period.
|
|
8164
|
+
* @default false
|
|
8165
|
+
* @example false
|
|
8166
|
+
*/
|
|
8167
|
+
apply_units_immediately?: boolean;
|
|
8133
8168
|
}[];
|
|
8134
8169
|
/** List of usage thresholds to apply to the plan. */
|
|
8135
8170
|
usage_thresholds?: UsageThresholdInput[];
|
|
@@ -9157,23 +9192,6 @@ export interface SubscriptionCreateInput {
|
|
|
9157
9192
|
activation_rules?: SubscriptionActivationRuleInput[];
|
|
9158
9193
|
};
|
|
9159
9194
|
}
|
|
9160
|
-
export interface ApplicableUsageThreshold {
|
|
9161
|
-
/**
|
|
9162
|
-
* The display name of the usage threshold.
|
|
9163
|
-
* @example "Threshold 1"
|
|
9164
|
-
*/
|
|
9165
|
-
threshold_display_name: string | null;
|
|
9166
|
-
/**
|
|
9167
|
-
* The amount to reach to trigger a `progressive_billing` invoice.
|
|
9168
|
-
* @example 10000
|
|
9169
|
-
*/
|
|
9170
|
-
amount_cents: number;
|
|
9171
|
-
/**
|
|
9172
|
-
* This field when set to `true` indicates that a `progressive_billing` invoice will be created every time the lifetime usage increases by the specified amount.
|
|
9173
|
-
* @example true
|
|
9174
|
-
*/
|
|
9175
|
-
recurring: boolean;
|
|
9176
|
-
}
|
|
9177
9195
|
export type SubscriptionObjectExtended = SubscriptionObject & {
|
|
9178
9196
|
plan?: PlanObject;
|
|
9179
9197
|
/** List of usage thresholds applicable to this subscription. */
|
|
@@ -9448,15 +9466,15 @@ export interface AlertUpdateInput {
|
|
|
9448
9466
|
}
|
|
9449
9467
|
export type SubscriptionEntitlementPrivilegeObject = FeaturePrivilegeObject & {
|
|
9450
9468
|
/**
|
|
9451
|
-
* Applicable value
|
|
9469
|
+
* Applicable value for this subscription (override_value if set, plan_value otherwise). Type depends on the privilege's value_type.
|
|
9452
9470
|
* @example 10
|
|
9453
9471
|
*/
|
|
9454
9472
|
value: number | boolean | string;
|
|
9455
9473
|
/**
|
|
9456
|
-
* Value assigned to this privilege in the plan. Type depends on the privilege's value_type.
|
|
9474
|
+
* Value assigned to this privilege in the plan. Type depends on the privilege's value_type. Null when the privilege only exists as a subscription override.
|
|
9457
9475
|
* @example 10
|
|
9458
9476
|
*/
|
|
9459
|
-
plan_value: number | boolean | string;
|
|
9477
|
+
plan_value: number | boolean | string | null;
|
|
9460
9478
|
/**
|
|
9461
9479
|
* Value assigned to this subscription specifically. Type depends on the privilege's value_type. Null if no override is set.
|
|
9462
9480
|
* @example 10
|
|
@@ -9490,9 +9508,6 @@ export interface SubscriptionEntitlementObject {
|
|
|
9490
9508
|
export interface SubscriptionEntitlements {
|
|
9491
9509
|
entitlements: SubscriptionEntitlementObject[];
|
|
9492
9510
|
}
|
|
9493
|
-
export interface SubscriptionEntitlement {
|
|
9494
|
-
entitlement: SubscriptionEntitlementObject;
|
|
9495
|
-
}
|
|
9496
9511
|
export interface SubscriptionChargeOverride {
|
|
9497
9512
|
/** Properties of a charge that can be overridden at the subscription level. */
|
|
9498
9513
|
charge: ChargeOverridableInput;
|
|
@@ -9859,7 +9874,7 @@ export interface WebhookPublicKey {
|
|
|
9859
9874
|
}
|
|
9860
9875
|
export interface WebhookEndpointObject {
|
|
9861
9876
|
/**
|
|
9862
|
-
* Unique identifier assigned to the
|
|
9877
|
+
* Unique identifier assigned to the webhook endpoint within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the webhook endpoint's record within the Lago system.
|
|
9863
9878
|
* @format uuid
|
|
9864
9879
|
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
9865
9880
|
*/
|
|
@@ -9909,7 +9924,8 @@ export interface WebhookEndpointCreateInput {
|
|
|
9909
9924
|
*/
|
|
9910
9925
|
webhook_url: string;
|
|
9911
9926
|
/**
|
|
9912
|
-
* The
|
|
9927
|
+
* The algorithm used to sign the webhook payload. Defaults to `jwt` when no value is passed.
|
|
9928
|
+
* @default "jwt"
|
|
9913
9929
|
* @example "hmac"
|
|
9914
9930
|
*/
|
|
9915
9931
|
signature_algo?: "jwt" | "hmac";
|
|
@@ -9934,9 +9950,9 @@ export interface WebhookEndpointUpdateInput {
|
|
|
9934
9950
|
* The URL of the webhook endpoint.
|
|
9935
9951
|
* @example "https://foo.bar"
|
|
9936
9952
|
*/
|
|
9937
|
-
webhook_url
|
|
9953
|
+
webhook_url?: string;
|
|
9938
9954
|
/**
|
|
9939
|
-
* The
|
|
9955
|
+
* The algorithm used to sign the webhook payload. When the field is omitted, the current value is kept.
|
|
9940
9956
|
* @example "hmac"
|
|
9941
9957
|
*/
|
|
9942
9958
|
signature_algo?: "jwt" | "hmac";
|
|
@@ -10412,6 +10428,9 @@ export interface WalletTransactionPaymentFailureObject {
|
|
|
10412
10428
|
payment_provider_code?: string;
|
|
10413
10429
|
provider_error?: string | Record<string, any>;
|
|
10414
10430
|
}
|
|
10431
|
+
export interface SubscriptionEntitlement {
|
|
10432
|
+
entitlement: SubscriptionEntitlementObject;
|
|
10433
|
+
}
|
|
10415
10434
|
export type QueryParamsType = Record<string | number, any>;
|
|
10416
10435
|
export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
|
|
10417
10436
|
export interface FullRequestParams extends Omit<RequestInit, "body"> {
|
|
@@ -10472,7 +10491,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
10472
10491
|
}
|
|
10473
10492
|
/**
|
|
10474
10493
|
* @title Lago API documentation
|
|
10475
|
-
* @version 1.
|
|
10494
|
+
* @version 1.55.0
|
|
10476
10495
|
* @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
|
|
10477
10496
|
* @baseUrl https://api.getlago.com/api/v1
|
|
10478
10497
|
* @externalDocs https://github.com/getlago
|
|
@@ -10567,7 +10586,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10567
10586
|
to_date?: string;
|
|
10568
10587
|
/**
|
|
10569
10588
|
* Filter results by activity types
|
|
10570
|
-
* @example ["
|
|
10589
|
+
* @example ["billable_metric.created","billable_metric.updated"]
|
|
10571
10590
|
*/
|
|
10572
10591
|
"activity_types[]"?: string[];
|
|
10573
10592
|
/**
|
|
@@ -10724,10 +10743,15 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10724
10743
|
*/
|
|
10725
10744
|
api_version?: string;
|
|
10726
10745
|
/**
|
|
10727
|
-
* Filter results by the path of the request
|
|
10728
|
-
* @example "/billable_metrics
|
|
10746
|
+
* Filter results by the path of the request. A value containing `*` is matched as a wildcard, otherwise the path must match exactly.
|
|
10747
|
+
* @example ["/api/v1/billable_metrics","*billable_metrics*"]
|
|
10748
|
+
*/
|
|
10749
|
+
"request_paths[]"?: string[];
|
|
10750
|
+
/**
|
|
10751
|
+
* Filter results by the client that issued the request, as reported by its user agent.
|
|
10752
|
+
* @example ["Lago Ruby v1.26.0"]
|
|
10729
10753
|
*/
|
|
10730
|
-
|
|
10754
|
+
"clients[]"?: string[];
|
|
10731
10755
|
}, params?: RequestParams) => Promise<HttpResponse<ApiLogsPaginated, ApiErrorUnauthorized>>;
|
|
10732
10756
|
/**
|
|
10733
10757
|
* @description This endpoint retrieves an existing api log that represents a request made to the API. The api log is identified by its unique request_id.
|
|
@@ -10758,6 +10782,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10758
10782
|
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
10759
10783
|
*/
|
|
10760
10784
|
external_customer_id?: string;
|
|
10785
|
+
/**
|
|
10786
|
+
* Restrict the analytics to a single billing entity, identified by its code. An unknown code is ignored and the analytics cover the whole organization.
|
|
10787
|
+
* @example "acme_corp"
|
|
10788
|
+
*/
|
|
10789
|
+
billing_entity_code?: string;
|
|
10761
10790
|
/**
|
|
10762
10791
|
* Show data only for given number of months.
|
|
10763
10792
|
* @example 12
|
|
@@ -10776,6 +10805,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10776
10805
|
findAllInvoiceCollections: (query?: {
|
|
10777
10806
|
/** The currency of revenue analytics. Format must be ISO 4217. */
|
|
10778
10807
|
currency?: Currency;
|
|
10808
|
+
/**
|
|
10809
|
+
* Restrict the analytics to a single billing entity, identified by its code. An unknown code is ignored and the analytics cover the whole organization.
|
|
10810
|
+
* @example "acme_corp"
|
|
10811
|
+
*/
|
|
10812
|
+
billing_entity_code?: string;
|
|
10779
10813
|
/**
|
|
10780
10814
|
* Show data only for given number of months.
|
|
10781
10815
|
* @example 12
|
|
@@ -10794,6 +10828,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10794
10828
|
findAllInvoicedUsages: (query?: {
|
|
10795
10829
|
/** The currency of invoiced usage analytics. Format must be ISO 4217. */
|
|
10796
10830
|
currency?: Currency;
|
|
10831
|
+
/**
|
|
10832
|
+
* Restrict the analytics to a single billing entity, identified by its code. An unknown code is ignored and the analytics cover the whole organization.
|
|
10833
|
+
* @example "acme_corp"
|
|
10834
|
+
*/
|
|
10835
|
+
billing_entity_code?: string;
|
|
10797
10836
|
/**
|
|
10798
10837
|
* Show data only for given number of months.
|
|
10799
10838
|
* @example 12
|
|
@@ -10801,7 +10840,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10801
10840
|
months?: number;
|
|
10802
10841
|
}, params?: RequestParams) => Promise<HttpResponse<InvoicedUsages, ApiErrorUnauthorized>>;
|
|
10803
10842
|
/**
|
|
10804
|
-
* @description This
|
|
10843
|
+
* @description 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: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - 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). - 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). - Revenue from `semiannual` subscription invoices is distributed evenly over six 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). - 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.
|
|
10805
10844
|
*
|
|
10806
10845
|
* @tags analytics
|
|
10807
10846
|
* @name FindAllMrrs
|
|
@@ -10810,16 +10849,13 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10810
10849
|
* @secure
|
|
10811
10850
|
*/
|
|
10812
10851
|
findAllMrrs: (query?: {
|
|
10852
|
+
/** The currency of MRR analytics. Format must be ISO 4217. */
|
|
10853
|
+
currency?: Currency;
|
|
10813
10854
|
/**
|
|
10814
|
-
*
|
|
10815
|
-
*
|
|
10816
|
-
* - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued.
|
|
10817
|
-
* - 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).
|
|
10818
|
-
* - 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).
|
|
10819
|
-
* - Revenue from `semiannual` subscription invoices is distributed evenly over six 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).
|
|
10820
|
-
* - 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.
|
|
10855
|
+
* Restrict the analytics to a single billing entity, identified by its code. An unknown code is ignored and the analytics cover the whole organization.
|
|
10856
|
+
* @example "acme_corp"
|
|
10821
10857
|
*/
|
|
10822
|
-
|
|
10858
|
+
billing_entity_code?: string;
|
|
10823
10859
|
/**
|
|
10824
10860
|
* Show data only for given number of months.
|
|
10825
10861
|
* @example 12
|
|
@@ -10843,6 +10879,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10843
10879
|
* @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
|
|
10844
10880
|
*/
|
|
10845
10881
|
external_customer_id?: string;
|
|
10882
|
+
/**
|
|
10883
|
+
* Restrict the analytics to a single billing entity, identified by its code. An unknown code is ignored and the analytics cover the whole organization.
|
|
10884
|
+
* @example "acme_corp"
|
|
10885
|
+
*/
|
|
10886
|
+
billing_entity_code?: string;
|
|
10846
10887
|
/**
|
|
10847
10888
|
* Show data only for given number of months.
|
|
10848
10889
|
* @example 12
|
|
@@ -10860,7 +10901,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10860
10901
|
*/
|
|
10861
10902
|
findAllUsages: (query?: {
|
|
10862
10903
|
/**
|
|
10863
|
-
* The time granularity of usage analytics. Possible values are 'daily', 'weekly'
|
|
10904
|
+
* The time granularity of usage analytics. Possible values are 'daily', 'weekly' and 'monthly'. Defaults to 'daily'.
|
|
10905
|
+
* @default "daily"
|
|
10864
10906
|
* @example "monthly"
|
|
10865
10907
|
*/
|
|
10866
10908
|
time_granularity?: "daily" | "weekly" | "monthly";
|
|
@@ -11098,11 +11140,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11098
11140
|
*/
|
|
11099
11141
|
findFeature: (code: string, params?: RequestParams) => Promise<HttpResponse<Feature, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
11100
11142
|
/**
|
|
11101
|
-
* @description
|
|
11143
|
+
* @description This endpoint deletes a privilege from a feature. Deleting a privilege removes it from all plans and subscriptions.
|
|
11102
11144
|
*
|
|
11103
11145
|
* @tags features
|
|
11104
11146
|
* @name DeleteFeaturePrivilege
|
|
11105
|
-
* @summary Delete a privilege
|
|
11147
|
+
* @summary Delete a privilege
|
|
11106
11148
|
* @request DELETE:/features/{code}/privileges/{privilege_code}
|
|
11107
11149
|
* @secure
|
|
11108
11150
|
*/
|
|
@@ -12194,7 +12236,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
12194
12236
|
*/
|
|
12195
12237
|
code?: string;
|
|
12196
12238
|
/**
|
|
12197
|
-
* Requires `external_subscription_id` to be set
|
|
12239
|
+
* Requires `external_subscription_id` to be set, and cannot be combined with `timestamp_from`. Filter events by timestamp after the subscription started at datetime.
|
|
12198
12240
|
* @example true
|
|
12199
12241
|
*/
|
|
12200
12242
|
timestamp_from_started_at?: boolean;
|
|
@@ -13089,7 +13131,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13089
13131
|
*/
|
|
13090
13132
|
findAllEntitlements: (code: string, params?: RequestParams) => Promise<HttpResponse<PlanEntitlements, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
13091
13133
|
/**
|
|
13092
|
-
* @description This accepts a list of entitlements to update. If the feature isn't part of the plan yet, it's added with all the privileges from the payload. If the feature is already part of the plan, the privilege and values are updated or added. All privileges must be valid for the feature. All features
|
|
13134
|
+
* @description This accepts a list of entitlements to update. If the feature isn't part of the plan yet, it's added with all the privileges from the payload. If the feature is already part of the plan, the privilege and values are updated or added. All privileges must be valid for the feature. All features and privileges not part of the payload are left untouched. To remove privileges or features, use the DELETE endpoints.
|
|
13093
13135
|
*
|
|
13094
13136
|
* @tags entitlements
|
|
13095
13137
|
* @name UpdateEntitlement
|
|
@@ -13773,7 +13815,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13773
13815
|
subscription_status?: "pending" | "active" | "terminated" | "canceled";
|
|
13774
13816
|
}, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
13775
13817
|
/**
|
|
13776
|
-
* @description This accepts a list of entitlements to update. If the feature isn't part of the subscription yet, it's added with all the privileges from the payload. If the feature is already part of the subscription (via plan or via override), the privilege and values are updated or added. All privileges must be valid for the feature. All features
|
|
13818
|
+
* @description This accepts a list of entitlements to update. If the feature isn't part of the subscription yet, it's added with all the privileges from the payload. If the feature is already part of the subscription (via plan or via override), the privilege and values are updated or added. All privileges must be valid for the feature. All features and privileges not part of the payload are left untouched. To remove privileges or features, use the DELETE endpoints.
|
|
13777
13819
|
*
|
|
13778
13820
|
* @tags entitlements
|
|
13779
13821
|
* @name UpdateSubscriptionEntitlements
|
|
@@ -13790,7 +13832,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13790
13832
|
subscription_status?: "pending" | "active" | "terminated" | "canceled";
|
|
13791
13833
|
}, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorBadRequest | ApiErrorNotFound>>;
|
|
13792
13834
|
/**
|
|
13793
|
-
* @description This endpoint removes a specific feature entitlement from a subscription. The entitlement remains available from the plan.
|
|
13835
|
+
* @description This endpoint removes a specific feature entitlement from a subscription. The entitlement remains available from the plan. It returns the full list of entitlements remaining on the subscription.
|
|
13794
13836
|
*
|
|
13795
13837
|
* @tags entitlements
|
|
13796
13838
|
* @name DestroySubscriptionEntitlement
|
|
@@ -13805,9 +13847,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13805
13847
|
* @example "active"
|
|
13806
13848
|
*/
|
|
13807
13849
|
subscription_status?: "pending" | "active" | "terminated" | "canceled";
|
|
13808
|
-
}, params?: RequestParams) => Promise<HttpResponse<
|
|
13850
|
+
}, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
13809
13851
|
/**
|
|
13810
|
-
* @description This endpoint removes a specific privilege from a subscription entitlement. The privilege entitlement remains available from the plan.
|
|
13852
|
+
* @description This endpoint removes a specific privilege from a subscription entitlement. The privilege entitlement remains available from the plan. It returns the full list of entitlements remaining on the subscription.
|
|
13811
13853
|
*
|
|
13812
13854
|
* @tags entitlements
|
|
13813
13855
|
* @name DestroySubscriptionEntitlementPrivilege
|
|
@@ -13822,7 +13864,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13822
13864
|
* @example "active"
|
|
13823
13865
|
*/
|
|
13824
13866
|
subscription_status?: "pending" | "active" | "terminated" | "canceled";
|
|
13825
|
-
}, params?: RequestParams) => Promise<HttpResponse<
|
|
13867
|
+
}, params?: RequestParams) => Promise<HttpResponse<SubscriptionEntitlements, ApiErrorUnauthorized | ApiErrorBadRequest | ApiErrorNotFound>>;
|
|
13826
13868
|
/**
|
|
13827
13869
|
* @description This endpoint retrieves all effective fixed charges for a specific subscription. The `units` of each fixed charge reflect any per-subscription unit override applied to the subscription; when no override exists, the plan-level units are returned.
|
|
13828
13870
|
*
|
package/esm/openapi/client.js
CHANGED
|
@@ -156,7 +156,7 @@ export class HttpClient {
|
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* @title Lago API documentation
|
|
159
|
-
* @version 1.
|
|
159
|
+
* @version 1.55.0
|
|
160
160
|
* @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
|
|
161
161
|
* @baseUrl https://api.getlago.com/api/v1
|
|
162
162
|
* @externalDocs https://github.com/getlago
|
|
@@ -445,7 +445,7 @@ export class Api extends HttpClient {
|
|
|
445
445
|
...params,
|
|
446
446
|
}),
|
|
447
447
|
/**
|
|
448
|
-
* @description This
|
|
448
|
+
* @description 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: - Revenue from `monthly` subscription invoices is included in the MRR for the month in which the invoice is issued. - 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). - 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). - Revenue from `semiannual` subscription invoices is distributed evenly over six 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). - 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.
|
|
449
449
|
*
|
|
450
450
|
* @tags analytics
|
|
451
451
|
* @name FindAllMrrs
|
|
@@ -725,11 +725,11 @@ export class Api extends HttpClient {
|
|
|
725
725
|
...params,
|
|
726
726
|
}),
|
|
727
727
|
/**
|
|
728
|
-
* @description
|
|
728
|
+
* @description This endpoint deletes a privilege from a feature. Deleting a privilege removes it from all plans and subscriptions.
|
|
729
729
|
*
|
|
730
730
|
* @tags features
|
|
731
731
|
* @name DeleteFeaturePrivilege
|
|
732
|
-
* @summary Delete a privilege
|
|
732
|
+
* @summary Delete a privilege
|
|
733
733
|
* @request DELETE:/features/{code}/privileges/{privilege_code}
|
|
734
734
|
* @secure
|
|
735
735
|
*/
|
|
@@ -2439,7 +2439,7 @@ export class Api extends HttpClient {
|
|
|
2439
2439
|
...params,
|
|
2440
2440
|
}),
|
|
2441
2441
|
/**
|
|
2442
|
-
* @description This accepts a list of entitlements to update. If the feature isn't part of the plan yet, it's added with all the privileges from the payload. If the feature is already part of the plan, the privilege and values are updated or added. All privileges must be valid for the feature. All features
|
|
2442
|
+
* @description This accepts a list of entitlements to update. If the feature isn't part of the plan yet, it's added with all the privileges from the payload. If the feature is already part of the plan, the privilege and values are updated or added. All privileges must be valid for the feature. All features and privileges not part of the payload are left untouched. To remove privileges or features, use the DELETE endpoints.
|
|
2443
2443
|
*
|
|
2444
2444
|
* @tags entitlements
|
|
2445
2445
|
* @name UpdateEntitlement
|
|
@@ -3200,7 +3200,7 @@ export class Api extends HttpClient {
|
|
|
3200
3200
|
...params,
|
|
3201
3201
|
}),
|
|
3202
3202
|
/**
|
|
3203
|
-
* @description This accepts a list of entitlements to update. If the feature isn't part of the subscription yet, it's added with all the privileges from the payload. If the feature is already part of the subscription (via plan or via override), the privilege and values are updated or added. All privileges must be valid for the feature. All features
|
|
3203
|
+
* @description This accepts a list of entitlements to update. If the feature isn't part of the subscription yet, it's added with all the privileges from the payload. If the feature is already part of the subscription (via plan or via override), the privilege and values are updated or added. All privileges must be valid for the feature. All features and privileges not part of the payload are left untouched. To remove privileges or features, use the DELETE endpoints.
|
|
3204
3204
|
*
|
|
3205
3205
|
* @tags entitlements
|
|
3206
3206
|
* @name UpdateSubscriptionEntitlements
|
|
@@ -3219,7 +3219,7 @@ export class Api extends HttpClient {
|
|
|
3219
3219
|
...params,
|
|
3220
3220
|
}),
|
|
3221
3221
|
/**
|
|
3222
|
-
* @description This endpoint removes a specific feature entitlement from a subscription. The entitlement remains available from the plan.
|
|
3222
|
+
* @description This endpoint removes a specific feature entitlement from a subscription. The entitlement remains available from the plan. It returns the full list of entitlements remaining on the subscription.
|
|
3223
3223
|
*
|
|
3224
3224
|
* @tags entitlements
|
|
3225
3225
|
* @name DestroySubscriptionEntitlement
|
|
@@ -3236,7 +3236,7 @@ export class Api extends HttpClient {
|
|
|
3236
3236
|
...params,
|
|
3237
3237
|
}),
|
|
3238
3238
|
/**
|
|
3239
|
-
* @description This endpoint removes a specific privilege from a subscription entitlement. The privilege entitlement remains available from the plan.
|
|
3239
|
+
* @description This endpoint removes a specific privilege from a subscription entitlement. The privilege entitlement remains available from the plan. It returns the full list of entitlements remaining on the subscription.
|
|
3240
3240
|
*
|
|
3241
3241
|
* @tags entitlements
|
|
3242
3242
|
* @name DestroySubscriptionEntitlementPrivilege
|