#kasvith-checkout-price_data

1 messages ยท Page 1 of 1 (latest)

pallid mauve
worthy urchin
#

in here it says product name is required, does this means stripe will create a product internally with the given name and associate it in future?

Lets say Fruit Cake was used as the name of product and API sets the amount dynamically(5USD)
and next time another customer buy new Fruit Cake for 10USD(API will set price)


or this is only for the record?

pallid mauve
#

It will create a product object within your account, but it won't link that to future purchases based on name. You could reuse that product if you wanted to, but you would need to pass the product's ID for that to occur.

In the scenario you mentioned, at the end of it you would have two distinct product objects with the same name and different prices.

worthy urchin
#

superb, would be cool to mention that in the above API docs ๐Ÿ™‚ thank you

pallid mauve
#

Thanks for that feedback! Always happy to help ๐Ÿ˜„

worthy urchin
#

one question, its not possible to set prices for each item with that right? i didnt see a field to set that

pallid mauve
#

It is, line_items is an array of hashes, so you would create an entry in that array for each item and then set the price_datafor each entry accordingly.

worthy urchin
pallid mauve
#

Yup. So inside of line_items you'd have an object for each item you're customer is purchasing, and for each of those items you'd specify the amount to charge with the price_data.unit_amount parameter.

worthy urchin
#

superb

#

btw any idea to expose a GraphQL API ๐Ÿ™‚

pallid mauve
#

Oohh, that I'm not familiar with

worthy urchin
#

thank you for the help btw

pallid mauve
#

Any time!

worthy urchin
#

would be cool to have this as a dedicated article in docs

pallid mauve
#

I swear we did, and was trying to find it for you

#

But that's not going well so far ๐Ÿ˜„

worthy urchin
#

there wasnt i guess, thats why i hopped in here

would you guys create an one? im pretty sure most people will need this

#

so its worthy to be written in docs as a end to end example