Checkout quickstart

Create a server endpoint that creates a Checkout Session, then redirect the customer to the session URL.

const session = await stripe.checkout.sessions.create({
  mode: "payment",
  line_items: [{ price: "price_123", quantity: 1 }],
  success_url: "https://example.com/success",
  cancel_url: "https://example.com/cancel"
});

See Checkout Sessions API and Checkout webhooks.

Original source: https://docs.stripe.com/checkout/quickstart