#coachleyton

1 messages ยท Page 1 of 1 (latest)

small dirgeBOT
lunar bay
#

Can you share the request id where you listed the invoice items?

soft garden
#

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

lunar bay
#

Ah sorry

#

Looking now

#

Oh weird. Let me ask a colleague about this

soft garden
#

alrighty ๐Ÿ™‚

vale delta
#

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.

soft garden
#

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?

vale delta
#

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.