#carrotfertilitysupport_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1214649354569252925
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
Here's an example of the two invoices created - one Draft and one open
And despite seeing a sent event on the open invoice:
Hello! Can you give me the two IDs for those Invoices? The IDs start with in_
We're not receiving the test emails. So I'm wondering if sendInvoice is the correct function to be using in this scenario
Sure thing
the Open invoice is: in_1Or3CvK1rU3BMAyYYlPebTBo
Draft: in_1Or3CvK1rU3BMAyYbGCsO0Ik
are we unintentionally creating duplicates?
With a few exceptions, we don't send emails in test mode, so that's expected.
Ah okay - even when sent to an active team member within our verified domain as mentioned here: https://docs.stripe.com/billing/revenue-recovery/customer-emails?locale=en-US#test-your-configuration ?
Yep, your Node code is unintentionally creating duplicate Invoices. Have a look at these two requests:
ah ok - as i suspected! hrmmmm
We are supposed to send emails in test mode under the conditions you linked to, but candidly it's flaky and I wouldn't count on any emails working in test mode.
ah okay - that's helpful to know. wanted to make sure we weren't crazy lol
and just to confirm - using the function sendInvoice vs finalizeInvoice is what we want to be using here if we are attempting to both finalize & trigger an email to the customer?
You don't need both, I don't think. Using sendInvoice should finalize it for you.
great - this is super helpful, thank you
now to figure out how/why we're unintentionally creating dupes ๐ค
appreciate your assistance!
would calling createInvoiceItem unintentionally create a new invoice? even if we're passing it an invoice ID from a previous createInvoice call?
Yes, probably, but I would need to see the code to say for sure. One thing I noticed was that the metadata is different between the two creation requests. Looking for that metadata difference should help you find where in your code the duplicate creation request is happening.
Ah, okay - perfect. Thank you!
Happy to help!