#Wurkzen

1 messages · Page 1 of 1 (latest)

buoyant glacierBOT
turbid cairn
#

Do we just create new prices every time we send a stripe checkout for this product_id?

cerulean basin
turbid cairn
#

so do i create a price with the product or no?

cerulean basin
#

You only need to pre-create a product. Price can be set every time a Checkout Session is created.

#

One question: do you have the amount at the time when you create a Checkout Session? Or you only want to collect payment information?

turbid cairn
#

yes

#

we have the amounts

#

they set it prior to creating the custom checkout

#

so we can set dynamically for every checkout i guess

#

thank you!

cerulean basin
#

Yes, then you can create the the Checkout session with custom amount, like this:

const session = await stripe.checkout.sessions.create({
  ...
  line_items: [
    {
        price_data: {
           currency: 'usd',
           product: 'prod_xxx', // your existing product ID
           unit_amount: 9900, // custom estimated amount for this session
        }
        quantity: 1
     },
  ],
  mode: 'payment',
});