Create a Payment Intent How to create a Payment Intent on the Server

This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below.
SignUp for Unlimited PRO Access


*Enrollment provides full access to this course (and updates) for life.

Create a Payment Intent

file_type_typescript payments.ts
import { stripe } from './';

 * Create a Payment Intent with a specific amount
export async function createPaymentIntent(amount: number) {
  const paymentIntent = await stripe.paymentIntents.create({
    currency: 'usd',
    // receipt_email: '',


  return paymentIntent;

Payments Endpoint

file_type_typescript api.ts
import { createPaymentIntent } from './payments';

 * Payment Intents
  runAsync(async ({ body }: Request, res: Response) => {
      await createPaymentIntent(body.amount)

Q&A Chat