#napolean_solo
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- napolean_solo, 6 hours ago, 13 messages
Hello! The invoice.paid Event contains the Invoice. You can look at the Invoice's lines property to see what the Invoice was for: https://stripe.com/docs/api/invoices/object#invoice_object-lines
alright but let's say the invoice paid was not for a product so then what does it look like?
will it not contain price_id?
Not sure I understand. What do you mean by "not for a product"?
Basically I have a subscrption with usage-based pricing that is independent from the sub. So in case user has made extra usage that invoice is created seperately.
so in this case what exactly is shown in the lines attribute? It won't contain any price_id?
I believe in that case it will have a subscription_item set pertaining to the usage-based Subscription Item: https://stripe.com/docs/api/invoices/object#invoice_object-lines-data-subscription_item
I think price_id is also set, but it might depend on the specifics of the Subscription. The best way to know for sure is to test this in test mode so you can see exactly what it looks like.
alright
I found there's an attribute called 'type'
https://stripe.com/docs/api/invoices/object#invoice_object-lines-data-type
I guess this will be set to subscription if it is related to a subscription or invoiceitem if it is not related to subscription
Yep.