#sumodd
1 messages · Page 1 of 1 (latest)
Hello! You would model that as three different Products. As for specific Pricing, I don't think what you want is possible in Stripe. We have usage-based billing, but it's if you want to charge for each use. Your use case doesn't really fit that, and the Customer Portal doesn't support usage-based billing and other features: https://stripe.com/docs/customer-management#customer-portal-limitations
You would likely need to keep track of usage on your end instead.
Hmm okay if I decide to track on my end:
-
do u think its a good idea to keep this usage count on the metadata in the user's subscription object?
-
if so, is there anyway to reset this metadata at the end of the month since on subscription renewal the same object is updated?
If above is not ideal solution, do you think its a good idea for me to store the current_period_start and current_period_end for each user subscription and track sessions between these timestamps?
Using metadata for this kind of thing usually works fine, yep.
Resetting the metadata would be up to you. You can listen for Subscription-related events to determine when to do that: https://stripe.com/docs/billing/subscriptions/overview#subscription-events
Thank you, i will try to implement. Much appreciated!!!
Hi @lethal turtle I'm taking over, let me know if you have any questions
hi Jack, so to use the metadata approach i described above, in order to reset the metadata so that i can refresh the alotted sessions per user each month, is the invoice.created correct webhook event to listen to?
Have you tried what Rubeus recommends ?
Yes I am referring to his suggestion, but just making sure if the invoice.created event would be the correct event to listen to for me to reset the session count on each user's subscription metadata?
Because I also see this customer.subscription.updated event as a possible option which gets sent on renewal but how can i be sure this event was sent due to a renewal vs any other update?
Both invoice.created and customer.subscription.updated are sent when a subscription renews