#kikko088_subscription-webhook-events
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/1342173611817177181
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
There is a 1 hour delay for renewal Invoices before they finalize/charge.
If you want that to occur immediately you need to force payment via https://docs.stripe.com/api/invoices/pay
Also, to teset this you can use Test Clocks: https://docs.stripe.com/billing/testing/test-clocks
You don't need to wait a day to test.
Lastly, I'd recommend not using invoice.paid at all here.
Instead, you should just listen to customer.subscription.updated
That will fire each time the Subscription cycles
And you just look at the status of the Subscription based on that Webhook
mmm but so I should update my subscription locally before the payment has been received?
what is the payment fails? I know I can delete the new subscription in my local db but I'd give 1h for free?
given in a rel world the subs is monlty, 1h for free is not a big deal, but it is logically wrong
Can you share the Subscription ID you tested with?
sub_1QrKUnRVLdRWMHyQyFEObIhD
the event has 20 Feb, 14:32 as starting date, I've received the event at 15:32
and this is the event id evt_1Qubk5RVLdRWMHyQWMKr1NEJ
Yeah that's correct, that's due to the 1 hour finalziation delay that I mentioned above, we explain this here: https://docs.stripe.com/billing/invoices/subscription#subscription-renewal
So yeah, as I mentioned if you don't want to potentially have that 1 hour period be "free" then you should force payment using the API when you receive invoice.created or customer.subscription.updated
ok, is there a reason why you have this 1h delay? whats the best practice in generale to manage subs renewal?
Hi ๐
i'm stepping in as my colleague has to go
The 1 hour draft status is intended to allow merchants to modify the generated Invoice prior to when it if finalized and we attempt to charge the customer
shouldn't be better to create the invoice 1h earlier and finalize it when the subs period ends?
I don't currently have access to the documentation where that was discussed but I strongly suspect that was debated internally.
To be clear, the billing period still covers that hour
If you do not want to wait 1hr, you can listen for the invoice.created webhook event and automatically trigger finalization in response to that.
ok, I'll have a look and find the best solution for this, thanks for the feedback!
Sure thing! We recognize that our defaults might not be the best fit for all individual use cases so we try to provide enough other actions you can take so you can tailor your integration to fit your needs.