title: Stripe session: how to add additional data?
body: <p>This is my session:</p>
  <pre><code>const stripe = require('stripe')(process.env.NEXT_PUBLIC_STRIPE_SECRET_KEY);
  export default async function handler(req, res) {
      if (req.method === 'POST') {
          try {
              const params = {
                  submit_type: 'pay',
                  mode: 'payment',
                  payment_method_types: ['card'],
                  billing_address_collection: 'auto',
                  shipping_options: [{
                          shipping_rate: 'shr_1LdjWJA0PvM7uNfTBERqQFUg'
                      },
                      {
                          shipping_rate: 'shr_1LdjXUA0PvM7uNfTAg076Fc0'
                      },
                  ],
                  line_items: req.body.map((item) =&gt; {
                      const img = item.image[0].asset._ref;
                      const newImage = img.replace('image-', 'https://cdn.sanity.io/images/w1sxln47/dev/').replace('-jpg', '.jpg')
                      return {
                          price_data: {
                              currency: 'eur',
                              product_data: {
                                  name: item.name,
                                  images: [newImage],
                                  description: item.details
                              },
                              unit_amount: item.price * 100,
                          },
                          adjustable_quantity: {
                              enabled: true,
                              minimum: 1,
                          },
                          quantity: item.quantity,
                      }
                  }),
                  success_url: `${req.headers.origin}/?success=true`,
                  cancel_url: `${req.headers.origin}/?canceled=true`,
              }
              // Create Checkout Sessions from body params.
              const session = await stripe.checkout.sessions.create(params);
              res.status(200).json(session)
          } catch (err) {
              res.status(err.statusCode || 500).json(err.message);
          }
      } else {
          res.setHeader('Allow', 'POST');
          res.status(405).end('Method Not Allowed');
      }
  }
  </code></pre>
  <p>And I have a object with a object called &quot;dress&quot;.
  Path to dress will be item.dress.height/etc
  <a href="https://i.stack.imgur.com/TaXXH.png" rel="nofollow noreferrer">image link</a></p>
  <p>How can I pass additional parameters to stripe? I tried to use metadata, but doesn't work with dynamic data. I need to pass my &quot;dress&quot; object to stripe success payment page. Thanks.</p>