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

257
Views
How to create checkout session for payment intent?

I'm using stripe to create an payment integration in my system, after creating an payment intent i want to create checkout session for this payment, after this i want to retrieve an url property from this checkout and send to the user.

But i don't have an idea how to "connect" created payment intent to checkout session.

Right now i create payment intent in this way:

    const paymentIntent = await stripe.paymentIntents.create(
      {
        amount: 500,
        currency: "usd",
        customer: customerId
      },
      {
        stripeAccount: ""
      }
    );

and checkout session:

    const session = await stripe.checkout.sessions.create({
      success_url: "",
      cancel_url: "",
      mode: "payment",
      customer: customerId,
      payment_method_types: ["card"]
    });

The problem is in this, that i don't know how to create checkout session based on created before an payment intent.

Thanks for any help!

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

0

The Checkout Session itself will create a PaymentIntent. You can create an equivalent PaymentIntent with the line_items.price_data.unit_amount[1], line_items.price_data.currency[2], and customer[3] parameters of the checkout.sessions.create call. Make sure to pass in the stripeAccount parameter to your Session creation call as well if you want to create the Session/PaymentIntent on their account.

[1] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-unit_amount

[2] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-currency

[3] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer

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!