#winnie_webhooks

1 messages · Page 1 of 1 (latest)

exotic rapidsBOT
#

👋 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.

fossil tree
#

hello! taking a look, gimme a few minutes

#

can you share the Invoice id?

graceful spade
#

in_1PGXWxKcb5r2AJntfRmG05wz

#

invoice marked with 'past_due' on dashboard but doesn't seem to trigger the overdue event

fossil tree
#

This docs article explains core concepts of automations in Stripe and provides steps to set up and manage automations with examples of automation recipes like custom dunning flows, overdue invoice notifications, subscription cancellation confirmation, and creating signup credits.

#

i don't see that you are using automations on your test account

graceful spade
#

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

This docs article explains core concepts of automations in Stripe and provides steps to set up and manage automations with examples of automation recipes like custom dunning flows, overdue invoice notifications, subscription cancellation confirmation, and creating signup credits.

fossil tree
#

From what I'm seeing, it's a trigger, not an action : https://docs.stripe.com/billing/automations#choose-a-trigger

This docs article explains core concepts of automations in Stripe and provides steps to set up and manage automations with examples of automation recipes like custom dunning flows, overdue invoice notifications, subscription cancellation confirmation, and creating signup credits.

graceful spade
#

yes, to which i'm not sure how to capture that event

#

i recently tried with invoice.will_be_due on automations, that works

fossil tree
#

ah, i see, gimme a while to look into this somemore

graceful spade
#

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

fossil tree
#

hrm, and you've tried advancing the test clock a few more times too?

graceful spade
#

yes

fossil tree
#

just to be sure, you created the overdue automation before the invoice was created also?

graceful spade
#

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

fossil tree
#

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?

graceful spade
#

yes, been seeing the same behaviour for all my invoices

fossil tree
#

what if you remove the mark invoice uncollectible

#

and the wait 1 day

graceful spade
#

in the automations?

fossil tree
#

yep, just send the webhook event without any other actions / conditions to see if that works first

graceful spade
#

that was the original automation that i had, which did not work too

oak grottoBOT
fossil tree
#

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

graceful spade
#

in_1PGZ46Kcb5r2AJntWQIxk1si

#

i've advanced the clock for the customer

#

tested with another invoice in_1PGZC8Kcb5r2AJntszqf4dnq

#

same outcome 🥲

distant mantle
#

Hi, let me see

graceful spade
#

the invoice events that are sent to my webhook - no invoice.overdue

distant mantle
#

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

  1. 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
  2. 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
  3. Advance the clock past May 22, and see the Invoice full lifecycle from create -> finalized after 1 hour -> sent -> due after 1 day
graceful spade
#

by "Let's make it monthly and May 20, for example", do you mean the invoice?

distant mantle
#

The Subscription cycle date

#

And yes it will be the timing for Invoice to be created

graceful spade
#

is there a way for me to set the subscription to be monthly instead of yearly?

distant mantle
#

Well you can just create a monthly Price on Dashboard, and set that Price to the Subscription

graceful spade
#

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?

distant mantle
#

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

graceful spade
#

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?

distant mantle
#

You mean you manually add an Invoice Item to an already drafted Invoice of a Subscription, where it hasn't been finalized?

graceful spade
#

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

graceful spade
#

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

distant mantle
#

When you create that another Invoice, was it completely separated from the normal Invoice in Subscription cycle?

graceful spade
#

yes, it's supposed to be a one-off payment invoice

distant mantle
#

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

graceful spade
#

understood, that explains the issue. was trying to pinpoint why it wasn't working

#

thanks so much Orakaro

distant mantle
#

np!

graceful spade
#

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!

distant mantle
#

I see. Thanks for bring this to us too!