#jean-emmanuel-bois_webhooks

1 messages · Page 1 of 1 (latest)

steep schoonerBOT
#

đź‘‹ 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/1387068701768941658

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

hazy robin
#

Is the parameter Automatically write-off invoices under the “Adjustments” section (visible only in the Sandbox) meant to trigger automatic credit note creation for overdue invoices?
In the Stripe Sandbox environment, we noticed the “Automatically write-off invoices” parameter, but it is not visible in Production.
Can you share where you're seeing this? This sounds like Dashboard behaviour that might be doing something else under the hood.

frozen heron
#

Hello, I need help now because I would like more information on a workflow that could be build around this case. I understand in your response in my previous thread that the setting in the sandbox that I have talked about is only for partially paid invoices (and currently only exists in the sandbox), what about building a custom solutions that automatically creates a credite note attached to a past due invoice? (referring to its specific invoice id, just like going on the stripe dashboard, on an invoice, and crediting it). Thanks.

hazy robin
#

I don't think there's any way for Stripe to do this for you automatically, currently, since there is no event after N days in past due (only when the invoice first transitions), so there'd be no way to trigger an automation etc to do this

#

Yes, I think you'd need to track this past due invoices in your system and run a job if that status remained for 31 days

#

and issue credit notes etc as needed at that point

frozen heron
#

Ok thank you for your answer. Do you think it is possible for us to create credit notes attached to specific invoices? Or is it ok if we just create credit notes seperately, will it mark the last invoice as paid?

hazy robin
#

So this is what you'd do at your 31 day threshold

frozen heron
#

Ok thank you very much for your help. Do you confirm that we would need to create a script to run this, and host this script on our end? (like the other workflows related to stripe webhooks we listen to for example)

hazy robin
#

Yes, currently I expect your own script & schedule job would be able to achieve this.

frozen heron
#

Ok thank you very much, and this would run for example daily on a specific time setup in advance, scan all invoices "open" more than 31 days prior to today, and automatically credit them according to the documentation you sent me, correct?

hazy robin
#

Yes, either polling invoices or you keep track of when an invoice moves to past due and listening for updates, then run based on that list

steep schoonerBOT
frozen heron
#

Ok thanks, i'm sorry but i'm not sure of the event to track for past due invoices in order to listen to updates and then run the script based on that? Thanks

cold parrot
#

Hello, I think you would want to listen to invoice.updated events which will be triggered by each status change. If the invoice's status is past_due and the event's previous_attributes property contains status that indicates that this event is specifically about the invoice becoming past due https://docs.stripe.com/api/events/types#event_types-invoice.updated

frozen heron
#

Ok I will have a look at this then, I understand I need to listen to an event rather than calling for specific invoices.
I'm not sure about your sentence "and the event's previous_attributes property contains status that indicates that this event is specifically about the invoice becoming past due" though, could you elaborate on that please?

#

Because there is no invoice "status" that is equal to "overdue", I can only see "open", "draft", "paid", "void" or "uncollectible"

cold parrot
#

My apologies, the API and dashboard have two subtlely different sets of statuses and I mixed them up

#

Looking in to what past due invoices actually look like API-wise

frozen heron
#

I think there is just the event "invoice.overdue" -->"Occurs X number of days after an invoice becomes due—where X is determined by Automations"

X is setup in the Stripe dashboard parameters (I think)
So normally, this would trigger after X number of days of when the invoice is due, in our case, invoices are marked as past due when all payments fail (using smartretry automatic retry logic) and/or the payment is due 30 days invoice is sent

cold parrot
#

Ah yes, apoligies, I overlooked that one because I misunderstood your situation a bit. That definitely looks like a good event for what you are trying to do!

frozen heron
#

Ok great I'll investigate on that then

#

Thank you all for your help!