#marve_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/1392802121019162717
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- marve_api, 12 hours ago, 20 messages
๐ happy to help
Or do i also need to specify price data even if I added the priceId field to make sure the metadata is always in invoice line items?
https://docs.stripe.com/api/checkout/sessions/create?api-version=2025-05-28.basil#create_checkout_session-line_items-price_data-product_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And even better, would it work if when creating a product I passed this metadata? So would it be passed as metadata to invoice line items when a user subscribes to one of my product's prices? Because a product can have multiple prices (so instead of price level, at product level)
these are the only indirectly set metadata
sorry I meant to send this https://docs.stripe.com/metadata#exceptions
So I would need to set metadata here so that it is passed to invoice line items even though it's defined at product and price level?
https://docs.stripe.com/api/checkout/sessions/create?api-version=2025-05-28.basil#create_checkout_session-line_items-price_data-product_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
no
this won't be passed to the line items level
if you add the metadata to the subscription it will be copied to the Invoice Line Items
otherwise you can just keep the metadata on the price
and when you look at the Invoice Line Item
you can retrieve the price and see the metadata on it
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okay got it and is there a quick way to do it when there's quite a few line items? Eg receive invoice.created webhook and expand all line items at once? Or do I have to go one by one?
you can directly access the line items on the invoice
but if there's more than 10 you need to paginate
Yes but I dont see how i can access the price id's metadata, not seeing expandable fields for price id, only receive the string id
yes you get the id from here https://docs.stripe.com/api/invoices/object#invoice_object-lines-data-pricing-price_details-price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and then you retrieve the price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okay got it so have to go one by one (in some api calls, i can just expand fields, but not available for invoice)
yes correct
okay got it thank you