#do-do_best-practices
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1447604398200061973
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there, customers who already have this product in their subscriptions will receive entitlements based on that feature change automatically on their next billing period. Doc Reference
you will receive this webhook event when this occurs for a customer
any chance to update this immediately after changing the product?
That event should be triggered automatically. Is that what you are talking about or are you asking about something else updating immediately?
I mean that the customer’s active features should be updated immediately after the product is updated. In other words, the case is literally that the customer should gain access to any new features I add to the product as soon as I add them.
Ah, my apologies I now see that by defauly we don't apply the new entitlements until the next billing cycle. Looking into whether there is a way to speed that up https://docs.stripe.com/billing/entitlements?dashboard-or-api=dashboard#assign
Not finding a way to do this without resetting the billing cycle on existing subscriptions unfortunately.
Trying to think of anything that may be helpful here. If you're integration is creating these features, you can list the subscriptions that use that product's prices to get a list of customers to provision that feature to before you get an event about it. https://docs.stripe.com/api/subscriptions/list#list_subscriptions-price
Unfortunately no event is emitted when a feature is created via the dashboard so there isn't a way to trigger an autoamtic update to what is provisioned on your side. That may have to be a manual process
So, it turns out that the only way to immediately grant a new feature to a customer after adding it to a product is to do it manually? That is:
- Retrieve the products the customer is subscribed to.
- Get the list of features for each product.
- Calculate the difference between the product features and the features the customer already has.
- Create new entitlements for the customer for the missing features.
Is that correct?
That could work and would be a good thing to do if you have already added many features and aren't sure of the state of any customer.
The way I was suggesting was:
- List each price for the product
- List all active subscriptions with each price
- Provision new feature for each customer subscribed to one of those prices
Which would be less API calls because with step 2 you can list up to 100 existing subscriptions per call.
Okay, thanks for the help! Have a nice day!