#winnie_webhooks
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/1240140836512206910
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
in_1PGXWxKcb5r2AJntfRmG05wz
invoice marked with 'past_due' on dashboard but doesn't seem to trigger the overdue event
the invoice.overdue event is only triggered if you are using Automations : https://docs.stripe.com/api/events/types?event_types-invoice.payment_succeeded=#event_types-invoice.overdue
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i don't see that you are using automations on your test account
yes, i've added the automations for invoice overdue
also realized while invoice.overdue webhook can be added to automations, the action is not stated in the documentation https://docs.stripe.com/billing/automations#choose-actions
From what I'm seeing, it's a trigger, not an action : https://docs.stripe.com/billing/automations#choose-a-trigger
yes, to which i'm not sure how to capture that event
i recently tried with invoice.will_be_due on automations, that works
ah, i see, gimme a while to look into this somemore
here's my automation for invoice overdue
used test clock to test: invoice was not marked as uncollectible and invoice.overdue event was not sent
hrm, and you've tried advancing the test clock a few more times too?
yes
just to be sure, you created the overdue automation before the invoice was created also?
correct
in the automation logs for the above: "No automation runs found"
i have another automation for invoice.will_be_due just to try out, the event was sent without any issues
testing this out on my own account
hrm, odd, it works perfectly fine for me
you've tried with another invoice? and it's the same issue?
yes, been seeing the same behaviour for all my invoices
in the automations?
yep, just send the webhook event without any other actions / conditions to see if that works first
that was the original automation that i had, which did not work too
if you have the time to spare now, I would suggest clearing all your automations, and starting with only the overdue automation without any other conditions or actions. Create an invoice with the test clock and advance it past the overdue date. Let us know what's that invoice id here
in_1PGZ46Kcb5r2AJntWQIxk1si
i've advanced the clock for the customer
tested with another invoice in_1PGZC8Kcb5r2AJntszqf4dnq
same outcome 🥲
Hi, let me see
the invoice events that are sent to my webhook - no invoice.overdue
Umm okie I can confirm it doesn't generate such an event
Hold on let me try to test on my account too
Can you
- Create a Subscription first, with collection_method = send_invoice, set to due after 1 day Invoice is sent. Let's make it monthly and May 20, for example
- Create a test billing clock on the Subscription. Make sure the Invoice for May 20 is not created yet. The clock should exists before the invoice.created event
- Advance the clock past May 22, and see the Invoice full lifecycle from create -> finalized after 1 hour -> sent -> due after 1 day
by "Let's make it monthly and May 20, for example", do you mean the invoice?
The Subscription cycle date
And yes it will be the timing for Invoice to be created
is there a way for me to set the subscription to be monthly instead of yearly?
Well you can just create a monthly Price on Dashboard, and set that Price to the Subscription
ah okay, could only do that if the price is a monthly recurring instead of yearly. will proceed with the next steps
ah i see the change following the steps you laid out
but i don't understand though, does that mean i'll need to make sure the clock exists before testing?
Just make sure the clock on the Subscription exists before the Invoice you are going to test, is created
In another word, let's test on a complete new Invoice in the far future, after enabled clock
got it. but the use case that i'd need to test is invoice generated for adding products to an existing subscription.
in that case, i'd generate an invoice using the subscription id of the existing subscription. in the event the user does not proceed with payment after the invoice is due, i'd like to capture the invoice.overdue event to then void the invoice
what's the best way for me to test this case?
You mean you manually add an Invoice Item to an already drafted Invoice of a Subscription, where it hasn't been finalized?
i create a new invoice with additional invoice items as a one-off invoice, and in the the event of successful invoice payment i will add the items to the subscription manually
in the event the user does not pay within the invoice validity i will need to detect the invoice.overdue event to then void the invoice so payment cannot be done after the due date
i realize there's a pattern here: when i create a new recurring subscription (either monthly/yearly) and set the collection_method = send_invoice and the due to 1 day after invoice is sent, a draft invoice would be created. after that i create a test clock for that particular subscription, then create another invoice
when i advance the clock past the due, the invoice.overdue event would be sent. but that event would be relative to the draft invoice that was created with the subscription creation, not the subsequent invoice created after that
When you create that another Invoice, was it completely separated from the normal Invoice in Subscription cycle?
yes, it's supposed to be a one-off payment invoice
Yeah so I think the Automations only works for Subscription Invoices then. Sorry it looks like a limitation from our end
Happy to forward to our Billing team
understood, that explains the issue. was trying to pinpoint why it wasn't working
thanks so much Orakaro
np!
just want to say: invoice.will_be_due works for invoices outside of subscription though. would be happy is the same can work for invoice.overdue
thanks again!
I see. Thanks for bring this to us too!