#BrittanyG-subscription-webhook
1 messages · Page 1 of 1 (latest)
Can you clarify what you mean by " every time a subscription is successfully charged on my site"? Every time a subscription is created or every time one is renewed?
Also can you tell me a bit more about the Integration on your site? Are you using Checkout, your own custom Elements page, etc?
So I have a system where different subscriptions will allow a certain amount of a "thing" per month. When the month is complete for that particular user depends on when the user was successfully charged for that subscription. And when their month is over, I need to reset the amount of the "thing" to it's original amount.
If the subscription is created I guess that means the charge was successful, correct? So maybe that's what I am looking for.
For the subscription being created you will want to listen for the invoice.paid event and check to see if the billing_reason is subscription_create https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
You will also want to check the billing_cycle_anchor to see on what day of the month we have the subscription cycle as https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_cycle_anchor
Because you are using Metered Billing correct?
Also is that clear so far?