#migs-price-list

1 messages · Page 1 of 1 (latest)

pseudo dragonBOT
wraith anchor
#

That call should give you the products and a list of their prices, can you tell me more about what data you aren't getting back that you are expecting?

restive rose
#

I've got 4 products, each has at least one price. Each price has 3 currencies. I'm trying to get all this data so I can render a custom pricing table

#

I am not getting all the currencies

wraith anchor
#

Ah so single price objects with multiple currencies. You may need to expand something on the price object, checking in to this...

restive rose
#

I thought I could do prices.retrieve(price.id, { expand: ['currency_options'] }) but currency_options doesn't seem to be present

pseudo dragonBOT
wraith anchor
#

Even when retrieving the price directly? That is surprising

#

Can you send me the ID of a price that you are seeing this behavior with? price_1234

restive rose
#

actually I am getting it now

#

now my questions is: can I do this with 2 calls, rather than 3 calls?

queen sparrow
#

migs-price-list

wraith anchor
#

Have you tried expanding prices.data.currency_options on the list product call?

queen sparrow
#

that doesn't make sense, Product doesn't have prices

restive rose
#

product has default_price

queen sparrow
#

sure but that's not the same

#

@restive rose the best option is to call the List Prices API https://stripe.com/docs/api/prices/list and at the same time expand product (to get the full Product object) and currency_options to get all additional currencies.
You loop over every Price that way and you can aggregate Products

restive rose
#

that's one call that brings all the data I need right?

#

thanks for you help!