Working around a Stripe Entitlements Gotcha
"Entitlements are updated at subscription creation or on a new billing cycle"
I recently got a message from a client that a new feature wasn’t working as intended. It had to do with a new feature we had deployed that takes advantage of Stripe Entitlements. You can use Entitlements to “Determine when you can grant or revoke product feature access to customers” (from the linked page).
What I missed was that “Entitlements are updated at subscription creation or on a new billing cycle.” I didn’t see that in the documentation. It says that on the Stripe Customer page under the Entitlements heading. What this means is that if you link “Feature A” to “Premium Subscription” - any user/Stripe customer that had already purchased the subscription previously (before adding the Feature and linking to the subscribed Product) - won’t get the Entitlement.
The good news is - there’s a workaround. You can clone the pricing level of the Subscription (different ID but all the other details are the same) and update the subscription, changing it from the original pricing level to the cloned pricing level. This is enough of a modification to make the Entitlement show up for the Customer. (Once this was done - I re-ran the update, setting everything back to the original pricing level and archived the cloned pricing level.)
A simple C# program to do this update can be found here - https://github.com/jtrotman10/StripeEntitlementsWorkaround.