Feature access
Learn how to determine feature access for a given user to your product.
Once you have created a subject, you can use our customer access APIs to control feature access for a subject.
Billing state
Section titled “Billing state”You can fetch the billing state for a subject to check if they have an active subscription and if they have accrued overage. The latter will be true if they the customer is a subscribed to a usage based rate and their usage has exceeded the included quantity for that rate.
billing_state = lark_client.customer_access.retrieve_billing_state( subject_id="1234567890")
feature_access_allowed = billing_state.has_active_subscription and not billing_state.has_overage_for_usageIf the subject isn’t allowed access to a feature, you should show them a paywall to subscribe or upgrade their plan.