#coachleyton
1 messages ยท Page 1 of 1 (latest)
Can you share the request id where you listed the invoice items?
Yes, it's req_hhGlAfJEun7jlz ๐
I should be able to see both of these, right?
But I can only see the "Unused time on Standard after 11 Jun 2025" one
@lunar bay My apologies for the direct @, I can see that the server is quite busy. Any update on this one? I still can't figure out why I can only see one line item
alrighty ๐
Hello! That Invoice has an Invoice Item (the one you can see when listing Invoice Items) and a Subscription Item (which you can't see when listing Invoice Items because it's a different type of object.
You can list Subscription Items separately: https://stripe.com/docs/api/subscription_items/list
Or you can expand the invoice_item and subscription_item properties when you retrieve the Invoice, which is what I would recommend so you can do it in a single API request: https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-invoice_item
You would specifically expand lines.data.invoice_item and lines.data.subscription_item when retrieving the Invoice.
I see. The reason I'm doing this btw, is so I can calculate how much I need to refund users when they downgrade. If the sum of the items is a negative, then that amount will be added to their credit, so I just refund immediately. But actually, I could just use the invoice total property, right?
Yes, most likely. I don't want to say for sure because I don't know your use case/integration well, but it sounds like that's worth investigating to see if it suits your needs.
We have a small section in the docs about this here: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#credits-for-downgrades