#unmatchedplaya_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.
โฑ๏ธ 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/1311102947807203448
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
G'day!
How did you retrieve the ID that begins with il_tmp_?
from /v1/invoices/upcoming
Got it, okay. That endpoint doesn't actually create an Invoice, it's just a preview of what an upcoming invoice will look like
So you can't delete the "temporary" invoice items since they don't actually exist, if that makes sense
that's correct, but i think those temporary items are due to prices added to a subscription before the next invoice. I am looking for a way to get rid of those items
So there may be a better way than using upcoming and delete. I have also tried removing the prices with proration_behavior set to none but this still invoices those items
Can you share the customer ID you're using when calling the upcoming invoice endpoint?
So, to be clear, you want to remove the $39.43 invoice item from this customer so it's not added to a future invoice?
yes
I prefer not to use balance transactions
like literally just delete it if possiblee
Okay, good! What I recommend doing is listing all invoice items for this customer so you can get the relevant ID: https://docs.stripe.com/api/invoiceitems/list
Then deleting the item: https://docs.stripe.com/api/invoiceitems/delete
ok I think that's done it.. So is the upcoming invoice item a reference to an actual invoice item? then deleting the latter cascades?
The upcoming invoice item is just a temporary snapshot of what the customer's next invoice will look like if created with the details passed in the request to retrieve the upcoming invoice.
If you want to delete an actual invoice item that has already been created for the customer, you'll need to look at the actual invoice items for that customer instead, not the "temporary" upcoming invoice
mm ok I will have a look. thank you for that information