#Fred - Invoice due_date
1 messages ยท Page 1 of 1 (latest)
in_1KX4AYC0QKj18akVnmwq61h9
Thank you for the ID. Will check in to it in a minute.
Thank you very much ๐ I believe this is happening with multiple of our invoices. I forgot to mention that this is the timestamp information from the webhook events
evt_1KX4AZC0QKj18akVunNF9smG
Interesting. So just to confirm your question: we are trying to figure out why there is a 4 week gap between finalize_at and due_date for some Invoices?
Are you trying to set the due date to be earlier or something?
Exactly ๐ And on the PDF invoice it seems to be the same date as the finalized at
I'm not even setting the due_date, because that's not possible for invoices created with collection_method=charge_automatically
Hello! It looks like this Invoice is due in 30 days (days_until_due is set to 30) so that would explain the gap, but let me see if I can figure out the date on the PDF...
I've just checked the code where this is created, and there's no days_until_due being set. Is this a default value I have to overwrite?
Oh, this is a charge automatically Invoice, so it's due immediately. Sorry, I didn't notice it wasn't an Invoice being emailed out. The days until due doesn't apply to charge automatically Invoices.
Wait, sorry, I think I maybe have missed something. Let me read the thread again...
But when I get the timestamp from the API, it's more than 4 weeks ahead of the finalize_at
Can you clarify what you mean here? Which API? Which specific property are you looking at?
Sure
I can see the due_date on the PDF being Feb 25, and that seems to be correct since it's the same time as the finalize_at.
But in the webhook events, I use the property "due_date" and it's giving me a value of March 27
For example this event: evt_1KX4AdC0QKj18akVikGRUKQd
Here's me using the same method to convert the timestamps to something readable.
Top = due_date
Bottom = finalize
Ah, okay, this is due to the API version of those events. Prior to API version 2019-10-17 the due_date property could not be null, so we had to set it to something. If you use a more recent API version this should no longer happen: https://stripe.com/docs/upgrades#2019-10-17
Okey, so because my default API version is too old, this is happening?
Yep.
This makes sense. I already control the API version with the header, but I didn't think about this for webhooks ๐ Thank you so much
Happy to help!