Entitlements
Determine when you can grant or revoke product feature access to customers.
Entitlements enable you to map the features of your internal service to Stripe products. After you map your features, Stripe notifies you about when to provision or de-provision access (according to your customer’s subscription status), and to what features, based on your mapping choices.
Use Entitlements to:
- Launch, change, and experiment with your pricing without needing to change your codebase
- Grant, revoke, and manage customer’s feature access
- Simplify your billing integration
Stripe Billing Entitlements API demo
Before you begin![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
This guide assumes that you’re already using Stripe Subscriptions and Customer resources.
Get started![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
To get started with Entitlements:
- Set up your features: Create each feature in Stripe Billing using the Feature API. For example, “Email” or “SMS” are separate individual features.
- Add your features to products: Attach Features to corresponding Stripe Products. You can add a single feature to multiple products.
- Get customers’ active entitlements: When customers subscribe to your products, Stripe Billing entitles the customer to the product’s features. Listen to the Active Entitlement Summary webhook and use the List Active Entitlements API for a given customer to execute your feature provisioning process.
![Diagram with Entitlements and its relationship with a Customer and Product's features](https://b.stripecdn.com/docs-statics-srv/assets/entitlements-diagram.240f8f8017776fc513dd69f291daed0d.png)
Set up your features![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
Provide a name and a unique lookup_
for each feature you create. Because the lookup_
is unique to each feature, you can’t reuse it across different features.
Add your features to products![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
Assign your feature to one or more products.
Note
Existing subscriptions will create active entitlements for any product feature changes at the start of the next billing period.
After you submit a request to attach your feature to your product, you receive a response similar to the following:
{ "id": "{{PRODUCT_FEATURE_ID}}", "object": "product_feature", "entitlement_feature": { "id": "{{ENTITLEMENTS_FEATURE_ID}}", "object": "entitlements.feature", "name": "My feature", "lookup_key": "myinternalfeaturecode" } }
List the features attached to a product by paging through the list of product features:
And remove a feature from a specific product by deleting the product feature attachment:
Get customers' active entitlements![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
During the lifecycle of a customer’s subscription, from activation, through upgrades, downgrades, and so on, Stripe updates the customer’s entitlements based on your mapped features.
When a customer’s subscription is first activated, Stripe creates entitlements for the features that they’re subscribed to.
As long as a customer maintains an active subscription for a feature, they retain an active entitlement. Make sure you provision access in your system for any users entitled to this feature.
Listen for webhook events ![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
If your webhooks are enabled, we send the following webhook event to notify you when a customer’s entitlements change.
Limited entitlements available in summary webhook
The entitlement summary’s active_
property only contains a maximum of 10 entitlements. We also provide a URL to retrieve the full, paginated list of the customer’s entitlements.
Event | Description |
---|---|
entitlements. | Occurs each time a customer’s active entitlements change. |
Retrieve the list of all active entitlements for a customer ![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
The list endpoint returns paginated view of a customer’s active entitlements.
Recommendation
We recommend you persist these entitlements internally for faster resolution.
Note
Subscription pricing, plan, and entitlement changes might be subject to certain legal requirements. Consult with your legal counsel for advice specific to your business.