#dannyboi_unexpected
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.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ 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/1294332679013138433
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
I'm taking a look.
Oh, the InvoiceItems you referenced were created after the latest invoice was generated
They will be picked up on the next Invoice
The request you shared was sent at 2024-10-11 15:38:51 UTC
But the latest Invoice was created at 2024-10-11 14:56:47 UTC
Is the "Upcoming invoice" view in the dashboard and the response from Invoice.upcoming() showing the next invoice, the one that we'd expect to pick up these invoice items?
That is what I would expect, yes
But that's not what we're seeing right? A colleague of mine modified the subscription recently which triggered a new invoice so I just made a new invoice item with request id req_ysGKWiBWa51Smj and it's not showing up on the upcoming invoice
Hmm okay let me run a test scenario to see if I can replicate this behavior
Thank you!
Hmmm... I am seeing the behavior I expect. I created a Subscription and then created two new Invoice items. When I get the upcoming invoice, I see all 3 invoice items
Hmmm weird thanks for running a test scenario. Just to confirm, on your end are you able to see what I'm seeing that for my subscription the invoice items aren't being added?
No, in my scenario I
- Create a customer & subscription with a single Subscription Item - at this point the first invoice is already created & paid
- Create 2 new Invoice Item objects, specifying the Customer and Subscription IDs from the first step
- Use the
create_previewAPI (https://docs.stripe.com/api/invoices/create_preview) to retrieve the next Invoice
I see all 3 invoice items for the upcoming invoice
๐ Stepping in for my teammate
I think you may already be discussing this issue over email with another teammate of ours. I was just testing with them as well and we could not reproduce the behavior you see. That said, the way we were testing was via Test Clocks and the API.
I see you were also editing Subscriptions via the Dashboard simultaneously, which was also resulting in Invoices being cut outside of the typical cycles
To make things cleaner I just made a new subscription, created an invoice item, and am still not seeing it on the upcoming invoice
The request id is req_zBaLyzva7U53cH
And just to check, are you able to look at my stripe dashboard and/or make requests with the customer id and subscription id from that invoice item request?
I can't make requests on your behalf but can look at your logs
Is there more information I can provide to help debug this? I'm able to see the invoice item is not showing up both in the Stripe dashboard in the Upcoming Invoice section on the associated subscription's page and in the response from Invoice.upcoming
Give me a few minutes to review these logs
Thank you. I just made request req_fjgKLDouC9ngeO to get the upcoming invoice to hopefully show that the invoice item is not there
I can't see the results of GET requests on my end unfortunately
Doing some more testing that more closely aligns with the conditions you're using (a $0 price to begin with)
Hm, okay, we still can't reproduce what you see
We're going to continue investigating on our end and keep you updated over email. Thanks for the latest example!
I figured it out! I wasn't specifying a tax behavior when creatiing the invoice item. When I specify "tax_behavior": "exclusive" it works
Thank you so much for your support with this issue
Ooh!
Ah, I see what you mean. We were testing with prices that both had unspecified tax behavior
I see your most recent example used a price with exclusive and the price for the invoice item you created defaulted to unspecified
This piece of information is somewhat buried in our docs: https://docs.stripe.com/api/invoices/create#create_invoice-automatic_tax-enabled
We'll work on adding this to a few other places (the API reference for adding InvoiceItems to specific Subscriptions and the docs for adding one-off InvoiceItems)