question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invoice.id is shouldn't be optional

See original GitHub issue

Describe the bug

According to https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-id, invoice.id should be required.

As I am upgrading to v10.0.0, it looks like it was made optional

https://github.com/stripe/stripe-node/blob/0cd1aa77f2a14f4446bc6190c908e78244f19c3b/types/2022-08-01/Invoices.d.ts#L12

To Reproduce

Perform any operation on an invoice and get an incorrectly typed object as the response.

Expected behavior

This should be a required property so I don’t have to litter my code with unnecessary run-time undefined checks.

Code snippets

No response

OS

macOS

Node version

All Node Version

Library version

stripe-node v10.0.0

API version

2022-08-01

Additional context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kamil-stripecommented, Sep 8, 2022

We’re working on the issue with the product team. Apologies for the delay. The resource represents both Invoice and UpcomingInvoice, where the ID is optional. That’s why it was made optional and the fix is not as easy as reverting the change.

1reaction
michelblcommented, Nov 28, 2022

Any update on this issue ? The type is still optional for v11.1.0 : https://github.com/stripe/stripe-node/blob/v11.1.0/types/2022-11-15/Invoices.d.ts#L43

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is An Invoice Number And How To Generate It - Deskera
In this format, the invoice ID begins with the customer number, followed by the date (again, optional), and ends with the sequence number....
Read more >
Invoice number - What is an invoice number? | SumUp Invoices
Invoice numbers are a mandatory invoice field. They should be assigned sequentially, meaning that the number of each new invoice increases.
Read more >
Validation Rules for Invoice Files - WWAWiki
Payor reference should not be blank but can be optional if Invoice type in 'M'(Miscellaneous). Addition validation for BLUEANCHOR. Validate CustomerOffice if ...
Read more >
How to Assign Invoice Numbers? - Indy
An invoice number is assigned to each invoice you send to clients to make it easy to track. It is typically a unique...
Read more >
Solved: Duplicate Invoice numbers - QuickBooks - Intuit
Currently, there isn't an option in place to warn if duplicate customer invoice number is used with the popup message window in QBO...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found