logo
Try for free
  • Product
  • Solutions
  • Developers
  • Resources
  • AI
  • Pricing
  • Log in
  • Create a store
  • Product

  • AI
  • Pricing
  • Try for free
  • Log In
  • Merchandising

  • Operations

  • Building

  • Integrations

  • Products

    Powerful modeling and versatile presentation of your entire catalog.

  • Subscriptions

    Sell recurring physical and virtual products alongside one-time offerings.

  • Discounts

    Get the sale with coupons, BXGY promotions, and automatic discounts.

  • Wholesale

    Sell B2B like it's DTC, along with volume pricing, customer groups, and invoicing.

  • Content

    Manage all your products content through the admin dashboard.

  • Users

    Multi-store admin accounts and role-based permission controls.

  • Customers

    Manage customer info, generate reports, and see buyer activity.

  • Orders

    Edit orders anytime and get the right information for smooth fulfillment.

  • Fulfillment

    Ship from multiple locations, track inventory, and split shipments.

  • Reporting

    Monitor your store's performance to ensure you have visibility across the business.

  • Storefronts

    Swell storefronts are fully customizable, allowing you to create just the right experience.

  • Checkouts

    Use our hosted checkout, integrate with a partner, or build a custom flow.

  • Payments

    Connect multiple gateways simultaneously, store cards, and split payments.

  • Internationalization

    Go global with region-specific languages, pricing, and payment methods.

No-code integrations

Connect with 40+ services for marketing, payments, fulfillment, automation, and more.

See all integrations →

Use Cases

  • Direct-to-consumer

    Tell your story and give customers a unique shopping experience

  • Subscriptions

    Sell personalized subscription bundles, memberships, and one-time items together

  • B2B/B2C

    Support retail and wholesale customers from one catalog and dashboard

  • Marketplaces

    Create a B2B or B2C marketplace with multi-vendor carts and split payouts

Customer Stories

  • Spinn Coffee

    A coffee revolution sparked by a connected machine and marketplace

  • Smashing magazine

    Global tax and shipping for complex product bundles

  • Infinitas Learning

    Delievering leading educational experiences in Europe

All customer stories →

Documentation

  • Quickstart

  • Backend API reference

  • Frontend API reference

  • Guides

  • Core concepts

  • Storefronts

  • Headless commerce

Community

  • GitHub

  • Discussion forum

  • Changelog

  • API status

Resources

  • Help Center

    The latest industry news, updates and info.

  • Customer stories

    Learn how our customers are making big changes.

  • Become a partner

    For agencies creating innovative commerce experiences.

Latest blog posts

  • deep-dive-app-functions
    Nov 06, 2025

    Build smarter workflows with App Functions

  • storefronts-v2-and-the-future-of-swell-apps
    Oct 22, 2025

    Storefronts V2 and the future of Swell Apps

  • Changelog

  • API Status

  • Contact us

  • Swell Merch

Blog

Best Ecommerce Backends for AI-Built Sites in 2026 (v0, Bolt, Lovable)

Ranked: commerce backends for stores built with v0, Bolt.new, Lovable and Replit, scored on key separation, SDK quality, data model and hosting fit.

Swell Team | November 04, 2026
Developer typing code on a laptop by a window.

If an AI builder such as v0, Bolt.new, Lovable or Replit is writing your storefront, the best commerce backend is the one the generated code can call safely from the browser, with a documented SDK the model follows, a data model that already covers carts, variants, tax and subscriptions, and a checkout that runs wherever the builder deploys. On those criteria, Swell ranks first, followed by the Shopify Storefront API, Stripe Checkout with Products, Medusa, Commerce Layer, Snipcart and a do-it-yourself Supabase plus Stripe stack.

This guide is a buyer's ranking, not a build tutorial. It scores each backend on four things that matter specifically when a model writes the integration code: how cleanly public and secret keys are split, how reliably the docs and SDK translate into working generated code, how much of the commerce data model exists before the model starts inventing tables, and how well the backend fits the hosting each builder ships to.

The short version: pick a backend with a browser-safe key, a single JavaScript SDK and a hosted checkout, so the generated app never has to handle card data or secret keys on the client.

Key Takeaways

  • Swell ranks first for AI-built sites: a browser-safe public key used by one JavaScript SDK (swell-js), secret keys kept to the Backend API, native subscriptions, and a hosted checkout reached through the cart's checkout_url.
  • Shopify's Storefront API is a strong second with a clear public/private token split and a hosted checkout, but it is GraphQL-first and Hydrogen is tuned for Shopify's own Oxygen hosting.
  • Stripe has a clear publishable/secret key split, but it is a payments backend: there is no storefront cart or browsable catalog the browser can call with the publishable key, so the model has to build those.
  • Medusa and Commerce Layer are capable but ask more of AI-generated code: Medusa needs a running server, database and worker, and Commerce Layer needs an OAuth token request scoped to a market before any call.
  • Snipcart and Supabase plus Stripe work for small catalogs, but both push validation, tax or order administration back onto code the model wrote.
  • Whatever you choose, test the generated store for price tampering, session persistence and webhook handling before taking real orders.

How we scored backends for AI-written code

Traditional platform comparisons focus on merchandising, themes and app stores. When a model writes the code, a different set of properties decides whether the store works and stays safe. We scored each backend on four criteria.

  • Key separation. Does the vendor issue a key that is explicitly safe to ship in browser code, with sensitive operations locked behind a separate secret key? Models put keys wherever the code runs. A backend whose public key can only read public data and build carts limits the damage when that happens.
  • Docs and SDK the model follows. One official JavaScript SDK with stable, descriptive method names produces better generated code than a choice of GraphQL clients, REST wrappers and community packages. Docs that show the same pattern on every page help too.
  • Data model breadth. Products with variants, carts, shipping rates, tax, customer accounts, subscriptions and order management should exist in the backend. Every gap is a table, endpoint or webhook the model has to invent, and invented commerce logic is where bugs hide.
  • Hosting fit. v0 deploys to Vercel, Bolt publishes to Bolt hosting or Netlify, Lovable runs its own cloud with edge functions, and Replit offers several deployment types. A backend that is fully hosted and callable over HTTPS fits all of them; one that needs its own long-running server does not.

The 2026 ranking: commerce backends for AI-built sites

1. Swell: best overall backend for AI-generated storefronts

Swell is a headless commerce platform with two APIs designed for exactly the split AI builders need. The Frontend API is authenticated with a public key and returns only data that has been made public, with products, categories, content pages, carts, accounts and subscriptions available by default. The Backend API uses secret keys prefixed sk_test_ or sk_live_ and is meant for server code only.

  • Key separation: Public keys (pk_) are created in the dashboard under Developer, then API keys, and passed to swell.init with your store ID. Custom models and custom fields are not public by default, so a model that wires up the Frontend API cannot accidentally expose internal data. Secret keys can be added or revoked if one leaks.
  • Docs and SDK: One npm package, swell-js, covers products, carts, accounts and subscriptions, with checkout handled by redirecting to the cart's checkout_url, and it runs in both server and client contexts. A useCamelCase option matches JavaScript conventions, and generic swell.get and swell.post methods cover any other endpoint. An experimental GraphQL option is also available.
  • Data model: Products carry variants with stock tracking, carts return shipping rates and tax totals, and customers can create, update, pause, skip and cancel subscriptions directly from the frontend. Orders, accounts and webhooks are in the Backend API, so the model does not need to design an orders table.
  • Hosting fit: Every cart gets a checkout_url once it has items, shipping or billing details, and Swell's hosted checkout handles one-time and subscription purchases with cards, PayPal, Apple Pay, Google Pay, Amazon Pay and Klarna. The generated app redirects to that URL and never touches card data. swell.session.getCookie and setCookie let you store the encoded session cookie and restore it later, for example when your app manages sessions itself.

Why it ranks first: a builder like v0 or Bolt can produce a working catalog, cart and checkout using only the public key and swell-js, which is the smallest and safest surface area of any backend on this list. When the project needs server logic (order sync, fulfillment, custom pricing), the Backend API is there with the same data model. Swell pricing is published as plans with included annual revenue and an overage rate above it that falls as you upgrade, starting at $29 per month billed yearly; see Swell pricing for current tiers.

2. Shopify Storefront API and Hydrogen

Shopify's Storefront API is a GraphQL API for headless Shopify storefronts, and its key model is well documented.

  • Key separation: Shopify offers tokenless access for products, collections, search and cart, public access tokens sent as X-Shopify-Storefront-Access-Token for browser use, and private tokens sent as Shopify-Storefront-Private-Token that must not be used client-side. Server requests should also pass the buyer's IP, a detail generated code often omits, which can lead to throttling and weaker bot protection.
  • Docs and SDK: The API is GraphQL-only ("There's no REST API for storefronts"), it is versioned quarterly, and there are several client options (Hydrogen, a lightweight Storefront API client, raw fetch). Expect more variation in generated code than with a single SDK.
  • Data model: Strong. Products, variants, selling plans and carts are native, and the cart exposes a checkoutUrl that sends buyers to Shopify's hosted checkout.
  • Hosting fit: Hydrogen is Shopify's React framework (built on Remix from the React Router team) and deploys to Oxygen, which is included on all Shopify plans except Starter. Shopify documents self-hosting Hydrogen on Vercel, Netlify and Cloudflare Workers, with version caveats. A v0 project on Next.js will call the Storefront API directly rather than use Hydrogen.

Shopify is a reasonable choice when a merchant already runs Shopify.

3. Stripe Checkout with Products and Prices

Many AI builders reach for Stripe first because it is the payment provider they know. As a backend for a store, it scores high on keys and docs and low on data model.

  • Key separation: Stripe documents its key types clearly. Publishable keys (pk_) are safe to expose; secret keys (sk_) and restricted keys (rk_) are not, and Stripe recommends restricted keys for new server-side use. The publishable key cannot create charges or read account data.
  • Docs and SDK: Excellent and consistent, with one Checkout Sessions API used across hosted, embedded and Elements UIs.
  • Data model: Thin for commerce. Products, Prices, subscriptions and Checkout (with optional Stripe Tax and promotion codes) exist, but there is no shopper-facing cart or catalog the browser can call with the publishable key. Listing products and creating Checkout Sessions both need server code with a secret or restricted key, and the model has to build the cart, inventory rules and order records itself.
  • Hosting fit: Good anywhere server functions exist (Vercel, Netlify, Lovable edge functions, Replit autoscale). A purely static deployment cannot create Checkout Sessions.

Stripe is often the right payment processor underneath a commerce backend. On its own it works best for a few products or a single subscription offer, not a growing catalog.

4. Medusa

Medusa is an open-source commerce framework with a broad data model. For AI-built sites, the main question is infrastructure, not features.

  • Key separation: Store routes require a publishable API key in the x-publishable-api-key header, scoped to a sales channel. Admin access uses separate credentials.
  • Docs and SDK: Thorough, with a JS SDK, but the backend is code you own, so models also generate and modify server modules, which widens what can break.
  • Data model: Broad: products, variants, carts, regions, tax, fulfillment and orders.
  • Hosting fit: Weakest on this list for builder-hosted projects. A self-hosted Medusa deployment needs PostgreSQL, Redis, a server instance and a worker instance, with at least 2GB of RAM recommended. Medusa also offers a managed Medusa Cloud, but the generated storefront still talks to a backend your team maintains.

For the full trade-off between running your own engine and using a hosted one, see Swell vs Medusa.

5. Commerce Layer

Commerce Layer is an API-first commerce engine aimed at multi-market brands, with a clean credential model and a heavier authentication step.

  • Key separation: Sales channel credentials authenticate with a client ID only and are safe client-side; integration credentials need a client secret and stay on the server.
  • Docs and SDK: Every call first needs an OAuth access token, and sales channel tokens must include a market in scope. That extra token step is a common place for generated code to fail or to cache tokens incorrectly.
  • Data model: Strong on SKUs, prices, inventory, markets and orders. Commerce Layer also offers drop-in.js, web components that link to a hosted, PCI-compliant checkout.
  • Hosting fit: Fully hosted, so it works with any builder's deployment once token handling is right.

6. Snipcart

Snipcart adds a cart and checkout to any HTML site with a script tag and a public API key. Products are defined in the page markup rather than in a product API.

  • Key separation: Fine. The public key is the only key in the browser.
  • Docs and SDK: Simple for models to copy, since products are HTML attributes.
  • Data model: Limited. Before creating an order, Snipcart fetches each item's URL and compares price, ID and other fields with what the site advertises; if one check fails, the payment is refused. AI-generated single-page apps often render products only in JavaScript, so confirm the crawler can read your product definitions before launch.
  • Hosting fit: Works on any static host, which suits Bolt and Replit static deployments.

For other options in this category, see Snipcart alternatives.

7. Supabase plus Stripe (do it yourself)

Many builders, Lovable in particular, default to a Postgres database plus Stripe. It is flexible, and it puts the most commerce logic in model-written code.

  • Key separation: Supabase now issues publishable and secret keys, replacing the legacy anon and service_role keys. (Supabase is deprecating anon and service_role keys by the end of 2026; legacy keys keep working until you disable them.) The publishable key is only safe if Row Level Security is enabled on every table, which generated schemas do not always do.
  • Docs and SDK: Good for both tools, but the commerce layer between them is whatever the model writes.
  • Data model: None for commerce. Products, variants, carts, inventory, tax and order status are tables the model designs, and the webhooks that mark orders paid are functions it writes.
  • Hosting fit: Good, with edge functions handling Stripe calls.

This route works for a prototype or a handful of products. It becomes expensive to maintain as soon as you need returns, subscription changes or multi-currency pricing.

Which builder pairs with which backend

Each AI builder has a default stack and deployment target. The pairing below reflects how well each backend fits that target.

  • v0 (Next.js on Vercel): v0 deploys to Vercel and generates Next.js. Swell fits with swell-js in client and server components and a redirect to checkout_url; Shopify's Storefront API is the next best fit; Stripe works through route handlers.
  • Bolt.new (Bolt hosting or Netlify): Bolt hosting publishes your files to a live address, with Netlify as an alternative. A fully hosted backend with a browser-safe key (Swell, Shopify, Snipcart) avoids needing server functions at all.
  • Lovable (Lovable Cloud and edge functions): Lovable's Stripe integration stores the secret as a backend secret used by edge functions. Swell's public-key flow needs no edge function for catalog, cart and checkout; secret-key work can go in an edge function later.
  • Replit (static, autoscale or reserved VM): Static deployments suit marketing pages without backend code, so pair them with a public-key backend. Autoscale or reserved VM deployments can run server code for Stripe or a Swell Backend API integration.
  • Cursor-style coding agents in your own repo: Hosting is your choice, so the deciding factor is SDK clarity and data model breadth. Swell and Shopify give the agent the most existing structure to build on.

Prompt-proofing: four checks for any generated store

These checks apply to every backend on this list. Run them in test mode before taking real orders.

  1. Tamper with the cart. Change a price or quantity in the browser's developer tools and complete checkout. The total charged must come from the backend, not the page.
  2. Reload across server and browser. Add an item, refresh, open a server-rendered page, then return to the cart. If the cart empties, the generated code is not carrying the session between server and client.
  3. Follow one order end to end. Place a test order and confirm it appears in the backend's order list, triggers its webhook and sends the confirmation email. Generated code often stops at the payment redirect.
  4. Read the environment variables. List every variable exposed to the client bundle (for example those prefixed for the browser by your framework) and confirm each one is a value the vendor documents as safe to expose.

Reality check: payments, compliance and cost

A hosted checkout matters more for AI-built sites than for hand-built ones, because it takes card handling out of code no one reviewed line by line. Swell, Shopify, Stripe Checkout and Commerce Layer's drop-in all offer one. With Snipcart, the checkout runs in its own overlay. With Supabase plus Stripe, Stripe Checkout covers card entry but order state is still yours.

Tax is the next gap. Swell carts return tax totals, Shopify calculates tax in its checkout, and Stripe Checkout can collect tax when Stripe Tax is enabled. In a DIY stack, someone has to decide where tax is calculated and test it for each region you sell to.

Costs differ in shape. Swell publishes plans with included annual revenue and an overage rate above each ceiling. Shopify charges a plan fee, and Oxygen hosting for Hydrogen is excluded on the Starter plan. Stripe charges per transaction. Medusa adds hosting for a database, Redis, a server and a worker, or a Medusa Cloud subscription. The cheapest first month is rarely the cheapest first year once someone has to maintain generated commerce code.

How to choose

  • Choose Swell if you want the generated site to handle catalog, cart, accounts, subscriptions and checkout with only a public key, and you expect the store to grow into custom data models or server-side automation.
  • Choose Shopify's Storefront API if the merchant already runs on Shopify and the team is comfortable with GraphQL.
  • Choose Stripe alone for a single product, a donation page or one subscription offer, where a full catalog would be overkill.
  • Choose Medusa if your team wants to own and operate the commerce engine and has backend engineers to review model-written server code.
  • Choose Commerce Layer for multi-market catalogs where per-market pricing and inventory justify the extra token handling.
  • Choose Snipcart or Supabase plus Stripe for small, static or prototype stores, with a plan to migrate when order volume or catalog size grows.

Frequently Asked Questions

What is the best ecommerce backend for a v0 or Bolt.new site in 2026?

Swell is the best fit for most AI-built storefronts because its public key and swell-js SDK cover catalog, cart, accounts and subscriptions from the browser, and its hosted checkout keeps card data out of the generated code. Shopify's Storefront API is the strongest alternative, especially for existing Shopify merchants.

Can AI-generated code call a commerce API directly from the browser?

Yes, if the vendor issues a key designed for it. Swell public keys, Shopify public access tokens, Stripe publishable keys, Medusa publishable API keys, Commerce Layer sales channel credentials and Supabase publishable keys are all meant for client code. Secret keys from any of these vendors must stay on the server.

Is Stripe enough on its own for an online store?

For a few products, often yes. For a catalog with variants, a persistent cart, customer accounts and order management, Stripe leaves most of that to your code, because Products and Checkout Sessions are server-side and there is no browser-facing cart API.

Do I need a server to use these backends with an AI builder?

Not for Swell, Shopify or Snipcart if you only need catalog, cart and hosted checkout, since all three work with browser-safe keys. Stripe, Supabase plus Stripe and self-hosted Medusa need server code or functions for core flows.

Why does data model breadth matter more for AI-built stores?

When the backend lacks a concept such as a cart, a subscription or an order status, the model invents it in your database or code. That invented logic is untested, inconsistent between prompts and hard to change later. A backend that already models these objects gives the model fewer things to get wrong.

How do I keep a generated store secure before launch?

Use a backend with a clean public and secret key split, send shoppers to a hosted checkout, and run the four prompt-proofing checks above in test mode: cart tampering, session persistence, an end-to-end test order and a review of client-side environment variables.

Build your store on Swell

Headless commerce with a full API on every plan, native subscriptions and custom data models. Start a store and see how it fits your build.

Try Swell for freeTalk to us

Next-level commerce for everyone.

X.comGitHubLinkedIn

Subscribe to our newsletter for product updates and stories

Resources

Help CenterDeveloper CenterCommunityChangelogLearnSwell Merch

Use cases

SubscriptionsB2B WholesaleMarketplaceOmnichannelDirect-to-consumerEnterprise

Explore

FeaturesPricingIntegrationsCustomer stories

Developers

OverviewDocumentationGuidesStorefrontsHeadlessSwell Apps

Company

BlogAbout usPartnersContact us

© 2026 Swell. All rights reserved.

Privacy PolicyTerms of Service