Skip to content
Checkout & the First Payment

03.03 · Walkthrough

Intents, Authorization & Capture

Build a checkout that survives a customer closing the tab and coming back, by reusing one payment intent instead of creating a second.

A payment intent is the durable backend record for collecting money for a checkout, separate from the browser session that confirms it. Store the intent against the cart or order, return the same client secret when the customer resumes, and avoid duplicate charges caused by refreshes, retries, or reopened tabs.

What this lesson answers

  • how do payment intents prevent duplicate charges
  • reuse payment intent after customer closes tab
  • authorization vs capture in checkout payments

Notes

A payment intent is the durable server-side record of one attempt to collect money for one order or cart. Instead of thinking “show a card form, then charge,” think “create or find the existing intent for this checkout, then let the browser confirm it.” The intent has an ID and client secret, and it continues to exist even if the customer closes the tab, refreshes, or returns later.

The practical pattern is to create the payment intent on your backend when the checkout starts, store its ID against your cart, order, or checkout session, and send only the client secret to the frontend.

Common questions

Should a checkout create a new payment intent on every page load?
No. A page load is not a new payment attempt. Create or retrieve the backend payment intent for the active cart or order, then return its client secret to the browser. A new intent should only be created when the underlying checkout genuinely changes.
What should be stored on my server for a payment intent?
Store the payment intent ID against your cart, order, or checkout session. The browser should receive the client secret so it can confirm the payment, but your server keeps the durable link between business state and payment state.
How are authorization and capture different?
Authorization is approval to charge a payment method for an amount. Capture is the step that actually takes the money. Some checkouts do both immediately, while others authorise first and capture later after checks such as stock or fulfilment.