#rezamirzad

1 messages · Page 1 of 1 (latest)

wintry yokeBOT
serene parrot
#

I'm not sure I understand. There aren't different Price objects depending on the quantity, it's just a single price_xxx ID

#

You can't pass quantity as its not a field on the Price object

#

What is it you're actually trying to do?

crystal plover
#

Hi,

so, how to retrieve the amount for a multi tiered product?

like, the client is ordering 7 items, i want to be able to retrieve the amount for 6 items, which should be 6*4=24 euros

#

this is the actual tiers table

serene parrot
crystal plover
#

this is exactly where I am blocked.
my query

  const price = await stripe.prices.search({        query: "active:'true' AND product:'" + ctx.request.body?.productId + "' ",      });

retrieves price, but I am not seeing the amount or unit_amount in the response (screen shot)

serene parrot
#

You need to pass expand: ['tiers']. It's not returned in the repsonse by default

#
await stripe.prices.search({
  query: "active:'true' AND product:'" + ctx.request.body?.productId + "' ",
  expand: ['tiers']
});
crystal plover
#

great!

i got the data i was looking for
thank you

serene parrot
#

np!