#Iconate-invoice-due-date
1 messages ยท Page 1 of 1 (latest)
No problem ๐
Get back to me whenever you can- I emailed someone named Alex Rattray back in Dec 2019 about this issue, but he only confirmed he also didnt see it in the response back then (same issue).
So I dunno if I need to be creating the invoices in a specific way or something, but it would be easier for me to use this param rather than trying to calculate the unix time based on the users timezone
ah I see.
I am going to need some time to reproduce it.
apologies
still working on the reprod
thank you for your patience
๐ I think the issues here has to do with the fact that this invoice was initially created through the dashboard (the dashboard goes through a slighlty different flow compared to our typical invoice API).
Do you plan on creating invoices through the dashboard often and updating the days_until_due like that? I'm not able to replicate the same behavior when just creating Invoices through the API, so if you're only creating invoices through the dashboard for testing you may not have to worry
I also want to add - even though due_date is empty for now, it should definitely get populated when the invoice is finalized
Hello!
Hello
Just wanted to follow up about Karbi's response, Not sure if the library im using doesnt support or something. Im using node "stripe": "^8.148.0",
Catching up, hang on...
I made a new invoice just now VIA the API, and made only 1 request so it wouldnt have a bunch of garbage data or requests:
https://dashboard.stripe.com/acct_1K4dcyRAiE2htNwx/test/logs/req_xHE0JnZtkZ6iHh
req_xHE0JnZtkZ6iHh
acct_1K4dcyRAiE2htNwx
Reminder- this is in the context of a Stripe Connect account
To clarify, the specific issue is you're not seeing a days_until_due property on the Invoice in the response to these requests?
Its also just not applying at all- as far as I can tell
You can see in that request, the response has due_date as null, but also there is no days_until_due returned either
Yeah, those are both expected since the Invoice hasn't been finalized yet. Invoices do not have a days_until_due property, and the due_date won't be populated until the Invoice is finalized.
If you finalize the Invoice does the due_date appear with the date and time you expect?
Hmmm really? Let me try
Yeah, if you look at the API reference at the Invoice object, which documents the properties on an Invoice, there is no days_until_due listed there: https://stripe.com/docs/api/invoices/object
Also, due_date can't be calculated until the Invoice is finalized, so it's null until then.
Hmm ok yes- Its due_date is now 30 days out...but how would you recommend persisting this if the user is working on a draft?
just metadata or something?
What do you mean?
If the user sets days_until_due on a draft, then comes back later, there is nothing natively on the invoice entity that indicates what is currently set (ex 30 days). So I cannot set the UI to display this properly (unless im also storing it in metadata until its finalized)
Cause even in this request:
Iconate: req_xHE0JnZtkZ6iHh
Iconate: acct_1K4dcyRAiE2htNwx
There is no days_until_due field returned
Ah, gotcha. Yeah, you can store this in metadata or locally on your end. Metadata is probably best.
Ok- Any idea why this field isnt returned? ๐
I didn't design this API, but my guess is that it would be confusing 90%+ of the time. If we showed it while the Invoice was in draft status it could be misleading (for example, if I looked at the Invoice and saw days_until_due was 30, and thought to myself, oh, it'll be due 30 days from right now, but then the Invoice wasn't finalized for two more days I'd be two days off).
If we showed it after the Invoice is finalized should it display the original value (meaning always 30 even 10 days after finalization) or should it be like a countdown (meaning 20 ten days after finalization)? Either case would be confusing to about half the people involved. ๐
Gotcha, I can appreciate that understanding; Nonetheless, thanks for getting to the bottom of this for me! I was wrestling with this param for a while and never bothered to finalize
Happy to help! ๐