Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
retrieve customer email on stripe after checkout session node.js

I have this:

    app.get('/create-checkout-session', async (req, res) => {
    let customer = {
        price: req.query.price,
        quantity: req.query.number,
        page: req.query.page
    }

    let successurl = 'http://localhost:1111/' + customer.page + ''
    let failedurl = 'http://localhost:1111/' + customer.page + ''
  const session = await stripe.checkout.sessions.create({
    payment_method_types: ['card'],
    line_items: [
      {
        price_data: {
          currency: 'cad',
          product_data: {
            name: 'Giveaway Entry',
          },
          unit_amount: customer.price,
        },
        quantity: customer.quantity,
      },
    ],
    mode: 'payment',
    success_url: successurl,
    cancel_url: failedurl,
  });
  console.log(session)

  res.redirect(303, session.url);
});

it is working fantastic. Except that after the checkout session completes, it redirects me back to my page. But it doesn't store the email address that they type in (on the stripe checkout page) in the session object. so I logged it like this:

console.log(session)

and it returns:

customer_email: null

why is this happening and how can i fix it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The Checkout Session's customer_email property is for creating a Checkout Session with an email pre-filled[1]. To see the email that your customer entered in to the Checkout form, check the Session's customer_details.email property[2].

[1] https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_email

[2] https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details-email

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!