#sumodd

1 messages · Page 1 of 1 (latest)

flint bayBOT
young hedge
#

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.

lethal turtle
#

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?

flint bayBOT
young hedge
#

Using metadata for this kind of thing usually works fine, yep.

lethal turtle
#

Thank you, i will try to implement. Much appreciated!!!

tulip grove
#

Hi @lethal turtle I'm taking over, let me know if you have any questions

lethal turtle
#

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?

tulip grove
#

Have you tried what Rubeus recommends ?

lethal turtle
#

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?

tulip grove
#

Both invoice.created and customer.subscription.updated are sent when a subscription renews