#hallmatt_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/1430637485884702780
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello, the way to look at this in our API ref is to look at the entry for the object. Basically object fields are expandable in all API calls that work with the object so that is where we show what is expandable. In this case if you go to the Invoice object entry you can see the Expandable tag on certain properties like this:
seems like line items arent expandable...specifically the product inside the line item
thats a bummer. thanks for the tip!
Expansion only goes four levels deep and I do see that that is five levels. Trying to think of what you can do here
If all you need is the items, we do have a list invoice items endpoint where this is expandable https://docs.stripe.com/api/invoiceitems/object?api-version=2024-12-18.acacia#invoiceitem_object-price-product
yeah...that might help
i essentially store some metadata on the product...that i need. ill try to figure something else out ๐
Ah gotcha, if you are fine replicating data, you can set metadata on the subscription and that will bet copied to the invoice when it is created. https://docs.stripe.com/api/invoices/object#invoice_object-parent-subscription_details-metadata
Though of course this would be separate so if you are update the metadata on the product it wouldn't update any of the metadata anywhere else in this case.
I'm using one time purchases with invoices
With Checkout hosted pages.
I could copy over the metadata when I redirect...but if we end up using "add ons" or something like that, it might get weird
Hi there, taking over for @hallow stump as they had to step away
Looking over the prior messages, it looks like your original approach was to retrieve an Invoice and expand lines.data.pricing.price_details.product, which is a valid approach but is more than 4 levels deep
@hallow stump suggested the list invoice items endpoint, which should enable you to expand the to the product
Do you think that approach would work for your use case?
I am replicating data locally, so I'll try to figure something out. I might be able to expand it...but I'm listing quite a few invoices out and wanted to grab a bit more info. Most of our invoices will just have one line item that I need to grab data from (it's a credits based system...customers buy credits they can then use on the site)
Got it. If there's a specific example that we can help with, just let us know!