Guides / How to build

How to Build an Online Store: Products, Cart, Checkout and Inventory

How to build an online store with AI: catalog, cart, Stripe Checkout, orders and inventory, tax and shipping choices, and when Shopify is the better fit.

Mythex Team · 2026-09-29 · 6 min read

To build an online store, you need a product catalog, a cart, a checkout that takes payment through a provider such as Stripe, a way to record orders and reduce stock, and an admin view to fulfil them. An AI app builder can put all of that together from a clear description. What deserves the most thought is not the storefront but the parts around money: when an order counts as paid, how stock is reserved, and how you handle tax, shipping and refunds.

Custom store or Shopify? Decide first

Be honest about this before building anything.

A hosted commerce platform (Shopify, Squarespace Commerce, WooCommerce and similar) is usually better when:

  • You sell physical products with shipping rates, labels and returns
  • You need tax calculated across many regions
  • A non-technical team will add products and process orders every day
  • You want an app store of add-ons — reviews, email marketing, loyalty
  • You sell across several channels and need one stock count

Shopify's plans are a monthly subscription with a discount for paying yearly, and card payments carry processing fees on top; check its pricing page for your country, because prices vary by region.

A custom store tends to win when:

  • The product is unusual: made-to-order configurators, bookings plus products, digital downloads with licences, B2B price lists per customer
  • The store is one part of a larger app (a course platform, a membership site, a marketplace)
  • You sell a small catalog and want full control over the design and checkout flow
  • You want to own the code and avoid platform lock-in

Many small sellers are best served by a platform. If your needs are ordinary, that is a good thing — take the shortcut.

What an online store needs

Data

TableKey fields
ProductsName, slug, description, images, price, active yes/no, category
VariantsProduct, option values (size, colour), SKU, price override, stock
OrdersNumber, customer email, shipping address, status, subtotal, shipping, tax, total, payment ID
Order itemsOrder, variant, quantity, unit price at time of purchase
Stock movementsVariant, change (+/−), reason (sale, restock, refund, correction), date
Discount codesCode, type, amount, expiry, usage limit — later, not first

Store the price at the time of purchase on each order item. If you change a price next month, old orders must still show what the customer paid.

Pages

  • Storefront: home, category or collection pages, product pages, cart, checkout redirect, order confirmation.
  • Admin: products and stock, orders with status (paid, packed, shipped, refunded), customers, simple sales numbers.
  • Legal and policy: shipping, returns, privacy and terms. Shoppers look for these before they buy, and many regions require some of them by law.

Permissions

Let shoppers buy without an account — guest checkout removes a step, and accounts can come later. Only admins can see orders and edit products — protect the admin area with real login and server-side checks.

How checkout should work

The safest pattern for a custom store is a hosted checkout page. With Stripe:

  1. The shopper clicks Checkout. Your server re-checks prices and stock from the database — never trusting what the browser sends — and creates a Stripe Checkout session.
  2. The shopper pays on Stripe's page. Card details never reach your server.
  3. Stripe calls your app's webhook endpoint to say payment succeeded. Only then do you mark the order paid and reduce stock.
  4. The shopper lands on your confirmation page, and you send a confirmation email.

Two mistakes to avoid: creating the "paid" order from the success page redirect (people close tabs, and redirects can be faked) and calculating the total in the browser. Both are easy for an AI to get wrong unless you say so.

Stripe's standard pricing is a percentage plus a fixed fee per successful card payment, with no setup or monthly fees (as of September 2026); the exact rate depends on your country and the card. Build everything in Stripe test mode with its test card numbers first. Our guide to adding payments to your app covers keys, test mode and webhooks.

Tax, shipping and inventory decisions

These are business decisions the AI cannot make for you:

  • Tax. Whether you must charge sales tax or VAT, and at what rate, depends on where you and your customers are. Stripe offers a product for this (Stripe Tax), or you can set fixed rates if your situation is simple. Ask an accountant if you are unsure.
  • Shipping. Start with a few flat rates (domestic, international, free over a threshold). Real-time carrier rates and label printing are where platforms like Shopify save a lot of work.
  • Inventory. Decide whether stock is reserved when checkout starts or only when payment succeeds. For small stores, reducing stock on payment and re-checking just before checkout is simpler; overselling the last item occasionally is then possible, so decide how you'll handle it. For stock tracking beyond the store, see how to build an inventory management app.

A first prompt that works

Build an online store for Loam & Clay, a small ceramics studio selling mugs, bowls and vases. Storefront: home page with featured products, a shop page with category filters, product pages with an image gallery, colour variants and stock status, and a slide-out cart. Save products, variants, orders and order items in a database and seed 10 realistic products. Admin area (login required) to add and edit products, upload images, change stock, and see orders with status paid / packed / shipped. The checkout button can be a placeholder for now — we'll add Stripe Checkout next. Warm, minimal design, mobile-first. No fake reviews or "free shipping worldwide" claims.

Starting with the checkout as a placeholder is deliberate: get the catalog and admin right first, then wire payments in a separate step you can test properly.

Build steps

  1. Catalog and product pages, with real product names, prices and photos.
  2. Cart that survives a page refresh.
  3. Admin: products, variants, stock, image uploads. Protect it with login.
  4. Stripe Checkout in test mode, with the server re-checking prices and stock.
  5. Webhook that marks orders paid and reduces stock. Test it end to end with a test card.
  6. Order emails to the customer and to you.
  7. Policies and SEO: shipping and returns pages, product titles and descriptions, share images. See SEO for AI-built websites.
  8. Go live: switch to live Stripe keys, place a real small order yourself, refund it.

Common mistakes

  • Trusting prices from the browser. Always recalculate on the server.
  • Marking orders paid on the success page instead of on the webhook.
  • Overwriting stock numbers instead of recording movements — you lose the history of why stock changed.
  • Launching without shipping and returns pages.
  • Huge product images. Compress them and serve them from file storage, not inside the code.
  • Building wishlists, reviews and loyalty points before the first sale.

Running costs

Plan for: hosting and a database, payment processing fees on every sale, a domain, an email provider for order confirmations, and possibly a tax service. A custom store avoids a platform subscription and app fees, but you take on the maintenance: when something breaks at checkout, it is yours to fix.

If you want sellers other than yourself — several vendors, each paid out — that is a marketplace, with different payment rules. See how to build a marketplace.

Building it with Mythex

On Mythex you describe the store and the agent builds the catalog, cart and admin in a live preview, with a Postgres database for products and orders and file storage for product images. The docs' store use case recommends exactly the order above: catalog first, checkout later.

Payments use your own Stripe account: you add your Stripe keys as project secrets and ask the agent to add Checkout, then test with Stripe's test cards in the preview (Stripe recipe). Webhooks need a public URL, so publish before you point Stripe at them (webhooks recipe). Tax, shipping and inventory sync are not built-in Mythex features, and there is no native Shopify integration — if you need those as a finished product, Shopify is the better choice. For a starting point, see the store templates, such as the ecommerce store.

Questions

Can I build an online store with AI?

Yes. An AI app builder can build the catalog, product pages, cart and order management, and connect checkout to a payment provider such as Stripe using your own account. Tax, shipping and fulfilment rules are the parts you still need to decide and test carefully.

Do I need Shopify to sell online?

No. You can sell with a custom store and a payment provider like Stripe. Shopify is still the easier choice if you want inventory, shipping, tax and apps handled as one product, or if a non-technical team will run the store day to day.

How do I take payments on a custom online store?

Most custom stores send shoppers to Stripe Checkout, a payment page hosted by Stripe, and create the order when Stripe confirms the payment through a webhook. Your card details never touch your own server, which keeps things simpler and safer.

How do I keep inventory accurate?

Reduce stock only when payment is confirmed, check stock again right before creating the checkout, and record every change (sale, restock, refund) as a movement rather than overwriting a number. Anything sold in other channels needs to update the same stock count.

Keep reading

  • How to Add Payments to Your App: Checkout, Subscriptions and Webhooks — How to take payments in an app you built: Stripe Payment Links vs Checkout vs subscriptions, webhooks, test mode, going live, and what to know about tax.
  • How to Build a Blog with AI: Posts, Editor, SEO and Hosting — Build your own blog with an AI app builder: posts, an editor, categories, newsletter signup and SEO search engines can read, plus when a platform fits better.
  • How to Build a Booking App: Slots, Availability, Reminders and Deposits — How to build a booking app with AI: services, availability and time slots, double-booking rules, time zones, reminders, deposits, and when Calendly is enough.
  • How to Build a Budget App: Categories, Transactions, Imports and Reports — Build a personal or household budget app: budgeting methods, transactions, CSV imports vs bank connections, handling money correctly, and privacy.
  • How to Build a Changelog Page: Entries, Tags, RSS and 'What's New' — How to build a product changelog page: what each entry needs, files vs database, tags, RSS, email updates, an in-app 'what's new' badge, and writing tips.
  • How to Build a Church Website: Services, Sermons, Events and Giving — How to build a church website that helps visitors find you: service times, sermons, events, online giving, privacy for members and children, and an AI prompt.

Start building free · Templates · Docs