Define available features and plan quotas
First, define the available features for each plan. For instance, the Basic plan has a limited set of features, while the Premium plan offers the full range. You can also use Lago to bill metering and overage. Pass that information to Oso’splan_quota and quota_used to limit the usage of a specific feature.
Send Lago entitlements to Oso
Lago holds the limits, Oso enforces them. Read the entitlements of a subscription from Lago, then write them to Oso asplan_quota and quota_used facts.
1
Entitle your features in Lago
Create a feature for each capability you gate, give it the privileges that carry its limits, and entitle it to your plans. You can also override a value on a single subscription. See Entitlements for the whole setup.
2
Read the entitlements of the subscription
Get the entitlements of a subscription
value, which is the value in force for this subscription, plus the plan_value and the override_value it comes from.3
Write the facts in Oso
Send the privilege Refresh the facts when the entitlements change. Lago sends a
value of each feature to Oso as plan_quota, and the units the customer has already consumed as quota_used. Read those units from the current usage of the subscription.subscription.updated webhook when the entitlements of a subscription change, and a plan.updated webhook when the entitlements of a plan change.