#Wheaty
1 messages ยท Page 1 of 1 (latest)
Hi there!
๐
Can you share the product ID (prod_xxx)?
thsi product is inactive, so if you use Stripe.products.list you need to set active: false
https://stripe.com/docs/api/products/list#list_products-active
Is it possible to run a query with said ids, and return both inactive and active products at the same time?
You would need to call the list endpoint twice, once with active: false and active: true
Ah, unfortunate but manageable.
Still not getting any returns when active is set to false however -
const products = await Stripe.products.list({ ids: productIds, active: false });
Output of productIds then products request:
https://sx.physgun.net/1677756021-Crafty-Irishwaterspaniel.png
๐ taking over for my colleague. Let me catch up.
No problem. ๐
Hi @jade shell - do you have any additional insight on this?
Does not appear products.list returns anything when active is set to false and no ids are passed either.
Is this the proper way to retrieve the product object of one-time items for one-time invoices?
still looking into this
Can you paste those prod_xxx IDs here they're you're expecting to see returned please
Is prod_NS3ihDPLxayAok one?
prod_NS3ihDPLxayAok
prod_N69XSOusOme6rn```
prod_NS3ihDPLxayAok - One-time item via one-time invoice. Returns fine via Stripe.products.retrieve, however not via Stripe.products.list.
prod_N69XSOusOme6rn - Standard stripe product.
I suspect in the case of prod_NS3ihDPLxayAok it's because it's an 'inline' object (i.e. created indirectly via other parameters). Those aren't returned via list endpoints
This is returned via the /products/:id endpoint though?
How else can I retrieve the product object of this id?
Yep, that's just by design. Otherwise if you're a heavy user of inline objects (Price/Product) it'd be an extensive list of objects
It's in the response of the API call that created it: https://dashboard.stripe.com/test/logs/req_wiEdIqkcqoWJuP
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I'm attempting to retrieve this for the purposes of the product name via invoice.lines.data
I suppose if it is a line_item I can use just the description.
Thanks for the clarification guys ๐
Yep, that description === product.name
Doesn't appear to be so entirely, as if there is a unit_type that is included in the description
but for one-time, yeah, seems to be the case ๐
Well, you can get the full Product object if you wanted it via that API: https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-price-product
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You just need to 'expand' it
Is it possible to expand each line item to have the product object via the Stripe.invoices.list call?
or via Stripe.invoices.retrieve
np