#Iconate-invoice-due-date

1 messages ยท Page 1 of 1 (latest)

green geode
#

Hello! Do you have a request ID that we can take a look at?

spring light
#

Sure, let me set it up

#

req: req_RxHjMGbezfumeo
account: acct_1K4dcyRAiE2htNwx

unreal sigil
#

Hey there
Looking into it

#

thank you for your patience

spring light
#

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

unreal sigil
#

ah I see.
I am going to need some time to reproduce it.

#

apologies
still working on the reprod
thank you for your patience

green geode
#

๐Ÿ‘‹ 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

orchid plinth
#

Hello!

spring light
#

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",

orchid plinth
#

Catching up, hang on...

spring light
#

req_xHE0JnZtkZ6iHh

#

acct_1K4dcyRAiE2htNwx

#

Reminder- this is in the context of a Stripe Connect account

orchid plinth
#

To clarify, the specific issue is you're not seeing a days_until_due property on the Invoice in the response to these requests?

spring light
#

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

orchid plinth
#

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?

spring light
#

Hmmm really? Let me try

orchid plinth
#

Also, due_date can't be calculated until the Invoice is finalized, so it's null until then.

spring light
#

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?

orchid plinth
#

What do you mean?

spring light
#

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

orchid plinth
#

Ah, gotcha. Yeah, you can store this in metadata or locally on your end. Metadata is probably best.

spring light
#

Ok- Any idea why this field isnt returned? ๐Ÿ˜›

orchid plinth
#

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. ๐Ÿ˜…

spring light
#

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

orchid plinth
#

Happy to help! ๐Ÿ™‚