#Dave
1 messages · Page 1 of 1 (latest)
Hi again!
Mostly yes, but you want to use a Price ID for the different sizes
So it would be 1 Product with 3 Prices (one Price for each size)
Then you pass the Price ID to the Checkout Session: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price
So those docs are talking about setting prices up inside Stripe itself, and then getting the price ID and price data from inside Stripe (eg: price_H5ggYwtDq4fbrJ) Is that right?
Yep exactly
Or, if you wanted to, you could create the Price inline when you create the Checkout Session using price_data
If I create the product in the Stripe dashboard, and set up multiple pricing also in the Stripe dashboard - can I override the product image in line items still? In product_data?
{
price_data: {
currency: 'gbp',
product_data: {
name: 'T-shirt',
images: ['https://images.jpg'],
},
unit_amount: 2000,
},
quantity: 1,
},
],```
No don't believe so
You would only do one or the other - use line_items.price or line_items.price_data
Okay - so if I'm going down the line_items.price_data route, which allows me to add a custom image on the Stripe checkout page for each customer (line_items.price_data.product_data.images) - I also need to set the product up though the line_items.price_data API (line_items.price_data.product_data) and not set up a product through the Stripe dashboard.
Is that right?
Nope that's up to you. You can either re-use a Product you already created, or create a new Product each time
Notice there is a line_items.price_data.product param and a line_items.price_data.product_data param
Thanks a lot - that's really helped clear it all up in my head.
Happy to hear it!
Are there any blog posts about doing the above, or just the API docs?
By blog posts do you mean like an integration guide?
Yeh I guess. Anything which has a runthrough of what we've been talking about.
Hmm not really a blog post. We have our integration guide for Checkout here: https://stripe.com/docs/payments/accept-a-payment
Okay perfect - thanks again bismark
Sure thing!