---
title: "Headless storefronts and checkout | Medusa knowledge base"
description: "Adding cart and checkout to an existing frontend, building custom checkout flows, and what a commerce backend handles beyond payments."
url: https://medusajs.com/kb/headless-checkout
last_updated: 2026-10-29T06:55:50Z
---

# Headless storefronts and checkout

Adding cart and checkout to an existing frontend, building custom checkout flows, and what a commerce backend handles beyond payments.

## Entries

- [How to add a cart and checkout to an existing Next.js site](https://medusajs.com/kb/headless-checkout/add-ecommerce-to-nextjs.md): To add a cart and checkout to an existing Next.js site and keep your own design, connect it to a commerce backend such as Medusa. Medusa runs as a separate Node.js app with PostgreSQL, which Medusa Cloud hosts from $29/month. Your Next.js app calls it through the @medusajs/js-sdk package for carts, shipping, Stripe payments, and orders.
- [How to build a fully custom checkout flow](https://medusajs.com/kb/headless-checkout/custom-checkout-flow.md): To build a fully custom checkout flow, use a commerce backend whose checkout is an API rather than a hosted page. In Medusa, your storefront saves the email and addresses on the cart, sets a shipping method, starts a payment session such as Stripe, and completes the cart. Custom rules run in the completeCartWorkflow validate hook.
- [Stripe vs a commerce backend: what Stripe doesn't handle](https://medusajs.com/kb/headless-checkout/stripe-vs-commerce-backend.md): Stripe handles payments, not the rest of a store. With Stripe plus Postgres and Prisma, you build the cart, shipping, inventory, promotions, order lifecycle, returns, and admin yourself. Medusa is an open source commerce backend that ships those as modules and uses Stripe as its payment provider, so you keep Stripe and skip rebuilding order management.
