Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

7-9 Add the PaymentIntent Endpoint

In this lesson, we add in the PaymentIntent endpoint as well as finish some UX polish for our checkout.

We need the PaymentIntent endpoint to securely create an object that represents the transaction in Stripe’s database. This way, the user cannot modify what they are buying (or for how much).

The front end then takes the reference to this object (the PaymentIntent secret) and makes a call directly to Stripe’s API. This is more secure for the user, since their financial information never passes through our server.

See this diagram if you want to understand this flow better: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-create-intent