#elitan

1 messages ยท Page 1 of 1 (latest)

knotty elmBOT
open crest
#

I'm asking because I would expect an invoice to always have an id.

serene verge
#

Hi there

#

Yes it would always have an ID.

open crest
#

Ok, then coming back to my first question. Why is id optional for the Invoice interface?

#

id?: string instead of id: string

serene verge
#

Yeah good question

#

I'm not super familiar with TS

#

Let me check

serene verge
#

K yeah just double checked with a teammate and essentially these types are just somewhat vague โ€” they are determined from our OpenAPI spec, which comes from internal definitions, and various fields default to being nullable.

#

Though yeah that's odd that it changed there

#

I'll file some feedback internally so we can take a closer look at these types and ensure they are accurate

open crest
#

ok, thanks. I'll override with id: string internally for now then. Thank you.

serene verge
#

๐Ÿ‘

#

@open crest okay so the actual reason here is because the upcoming invoice endpoint uses the same model and in that case the ID actually is not present (since the invoice hasn't been created yet).

#

Forgot about that

open crest
#

Hmm, not sure I understand. Is it a future endpoint that will be released?

serene verge
#

So if you want to preview a future invoice

#

You use that endpoint