{"slug": "how-to-build-your-own-online-store-with-your-agent-tested-end-to-end", "title": "How to build your own online store with your agent, tested end to end", "summary": "A walkthrough published by floo shows how a single prompt to Claude Code, Codex or Cursor can deploy floo's storefront template into a working online store with a cart, Stripe Checkout, shipping options and customer accounts, using only a Stripe secret key as the required secret. In a real run on December 2 and 3, 2026 against a test store called `storefront-check` in Stripe test mode, the first deploy intentionally failed on the missing `STRIPE_SECRET_KEY` until the key was set via `floo env set STRIPE_SECRET_KEY --stdin`, after which the rebuild completed migrations and created the Stripe webhook automatically. The store counts an order as paid only when Stripe's signed webhook confirms it, and owners run it from `/admin` or through the store's API at `/api/orders` and `/api/products`.", "body_md": "## TL;DR\n\n**The fastest way to get your own online store out of an agent is to start from one that already takes payments. We used floo's [storefront template](https://getfloo.com/templates/storefront), one prompt to Claude Code, and a single Stripe key, and ended up with a store with a cart, Stripe Checkout, shipping options and customer accounts, plus an API our agent used to ship the order.**\n\n- The only secret you set is your Stripe key. The store wires up its own webhook every time it deploys.\n- Card numbers stay with Stripe. An order counts as paid only once Stripe's signed webhook confirms it.\n- After launch you run the store from its owner page at `/admin` , or let your agent do the same work through the store's API.\n- Everything quoted below came from a real run on December 2 and 3, 2026, against a test store called `storefront-check` in Stripe test mode.\n\nAsk an agent to build \"my own online store\" and you'll usually get one of two answers. Either it sends you to a hosted store builder, or it starts writing a shop from an empty folder and leaves the payments, webhooks and hosting for you to figure out. There's a middle path, and it's the one this post walks through. You start from a store that already works, deploy it with one prompt, and let your agent change whatever you want from there.\n\nWe built it, bought from it with a test card, and fixed the things that broke along the way. Those fixes are in here too, because they're the parts you'd otherwise run into yourself.\n\n## What are you building?\n\nA small shop. People browse, add things to a cart, and pay on Stripe's checkout page. They can create an account to see past orders, or check out as a guest. Behind the scenes, you (or an agent) pick up paid orders and mark them shipped.\n\n``` php\nshopper -> floo gateway (public) -> Next.js store -> Postgres\n                                         |-> Stripe Checkout (card, shipping, tax)\nStripe  -> /webhooks/stripe (signed)   -> order paid, stock down, cart emptied\nowner             -> floo gateway (floo sign-in) -> /admin\nagent             -> floo gateway (app API key)  -> /api/orders, /api/products\n```\n\nProducts, carts and orders live in the store's own Postgres database, and product photos go in a storage bucket that floo sets up for each environment. Stripe takes care of the money. floo runs everything else, including shopper sign-in.\n\n## Step 1: Deploy with one prompt\n\nPaste this into Claude Code, Codex or Cursor:\n\n```\nDeploy the template at https://github.com/getfloo/storefront-template on floo for me.\nUse my existing floo org. If you cannot run commands here, guide me through them\none at a time. Follow https://getfloo.com/agents.md to create a floo-hosted project,\nreplace its starter code with this template's files (keep the project's [app] name\nin floo.app.toml), push, and give me the dev URL. The deploy stops on\nSTRIPE_SECRET_KEY: have me copy my Stripe test-mode secret key and set it with\n`floo env set STRIPE_SECRET_KEY --stdin`, never pasting it to you, then redeploy.\nThen walk me through a test purchase with Stripe's test card.\n```\n\nDon't worry when the first deploy fails. It's supposed to. The template marks the Stripe key as required, which means a store can't go live before it's able to take payments:\n\n```\nRequired config is missing\n  Required configuration is missing.\n  Add the missing config field and retry the deploy.\n```\n\n## Step 2: Set your Stripe key\n\nSwitch the Stripe Dashboard to test mode, copy the secret key, and set it from your own terminal:\n\n```\nfloo env set STRIPE_SECRET_KEY --stdin --app storefront-check\nfloo deploy --rebuild --app storefront-check\n```\n\nWith `--stdin`, you type the key into a hidden prompt, so it never shows up in the chat or in your agent's transcript. Production gets its own live key later, with `--env prod`. Test and live keys never share an environment.\n\nWhen the rebuild runs, the store sets up its Stripe webhook by itself:\n\n```\nMigration completed successfully.\nStripe webhook: created we_1UiQ… for https://storefront-check.getfloo.app/webhooks/stripe.\n```\n\nIt didn't always work this way. On our first try we created the webhook by hand in Stripe, which meant answering three questions most store owners have never thought about (your account or connected accounts, snapshot or thin payloads, which API version). Then we pasted in the wrong URL. The test purchase went through on Stripe's side, but the order sat at \"pending\" because the confirmation was going to an address with nothing behind it.\n\nSo now the store handles it. Each deploy makes sure there's exactly one webhook pointed at the store's current address, with the events and API version its code expects. If you add a custom domain later, the next deploy moves the webhook over. If Stripe disables it after a run of failed deliveries, the next deploy turns it back on. Deploying a second time changed nothing, which is what you'd want:\n\n```\nStripe webhook: we_1UiQ… sends to https://storefront-check.getfloo.app/webhooks/stripe.\n```\n\n## Step 3: Add products and photos\n\nYou don't start with an empty shop. Outside production, each deploy adds six sample products while the catalog is empty, so dev has something to buy right away. Production starts empty.\n\nYour own products go in through the owner page at `/admin`. You're a member of the app, so floo signs you in there. Each product gets a form for its name, price, stock and photo, plus a box that takes it out of the shop, and there's a form at the bottom for adding a new one. Shoppers aren't members of the app, so they never get past floo's sign-in page.\n\nPhotos land in a private bucket, and the store serves them itself with a long cache. We uploaded a PNG and got the same bytes back with `cache-control: public, max-age=31536000, immutable`. The store turned down an SVG (` The photo must be one of image/jpeg, image/png, image/webp, image/avif.`), since SVG files can carry scripts.\n\nOur first version loaded the samples with a script you ran yourself, holding an app API key. That works from a terminal. A store started from a chat has no terminal, though, so the store now does it on deploy.\n\n## Step 4: Buy something\n\nOpen the store, put something in the cart and check out. Before you leave the cart, it tells you what shipping will cost:\n\n```\nShipping from $5.00, free over $50.00. You choose the method and pay on the next page, by Stripe.\n```\n\nOn Stripe's page you'll see the items, the shipping options and the total. Pay with the test card `4242 4242 4242 4242`, using any future date and any CVC. Here's our Express order as the API reported it afterwards:\n\n```\n{ \"status\": \"paid\", \"shippingMethod\": \"Express\", \"shippingCents\": 1500, \"taxCents\": 0, \"totalCents\": 3900 }\n```\n\nStock for the item dropped by one and the cart emptied at the same moment the order was marked paid. All three changes happen together in one database transaction, and only for an order that's still pending. That matters because Stripe sometimes delivers the same event twice, and a duplicate doesn't double-count anything. If the shopper was signed in, the order shows up on their orders page with the shipping line and the total.\n\nOne more thing broke here. A shopper who signed up and entered the emailed code still wasn't signed in afterwards, so their order was saved as a guest's. That turned out to be deliberate on floo's side. Confirming a code shouldn't sign anyone in, because if someone else had registered your email first, you'd land in an account whose password they know. The store now signs the shopper in with the password they chose at sign-up, straight after the code is confirmed.\n\n## Step 5: Ship the order\n\nPaid orders sit at the top of `/admin`, each with its items, the shipping address and the method the shopper paid for. Mark one shipped and the shopper's orders page goes from \"Paid, preparing to ship\" to \"Shipped\". Ship the same order twice and the page tells you `Order is fulfilled; only a paid order can be fulfilled.`\n\nAn agent can do the same work through the store's API. Give it a key with the `api` scope:\n\n```\nfloo apps consumers create fulfillment-agent --app storefront-check\nfloo apps keys create fulfillment-key --consumer fulfillment-agent --scope api --app storefront-check\nexport STORE_URL=https://storefront-check.getfloo.app STORE_API_KEY=<key>\ncurl -H \"Authorization: Bearer $STORE_API_KEY\" \"$STORE_URL/api/orders?status=paid\"\ncurl -X POST -H \"Authorization: Bearer $STORE_API_KEY\" \"$STORE_URL/api/orders/$ORDER_ID/fulfill\"\n```\n\nA retry on an order that already shipped gets a 409, so an agent can't send anything out twice. The whole API is documented at `/api/openapi.json`, generated from the same schemas the code validates against. A request with no key never reaches the store. floo's gateway answers it with a 401.\n\nThe owner page had one trap worth knowing about. Next.js accepts a server action posted to any path, including the public shop pages, so protecting the `/admin` route isn't enough on its own. Every owner action checks the floo identity itself. We posted the ship action to the shop's home page with forged identity headers: the gateway stripped the headers, the action refused, and the order stayed paid.\n\n## Step 6: Make it yours\n\nMost store-wide settings are in `lib/store.ts`. That's where you set the name, currency, countries you ship to, shipping rates, the free-shipping threshold, and whether to collect tax. Tax needs one extra step. Set up Stripe Tax in the Stripe Dashboard before you flip `COLLECT_TAX` to `true`, otherwise Stripe won't open the checkout page.\n\nFor anything else, ask your agent. We've tried prompts like these:\n\n- \"Take a tracking number when an order is fulfilled and show it on the customer's orders page.\"\n- \"Add product categories and a filter on the shop page.\"\n- \"Add a daily job that lists products with fewer than five left.\"\n\nThe repository's `AGENTS.md` tells the agent which rules not to break. Stripe only ever charges the prices saved on the order. Only the webhook can mark an order paid. Stock can't go below zero.\n\n## Step 7: Your domain and production\n\nTo use your own domain, add it to `floo.app.toml`, deploy to production and publish the DNS records floo gives you. The next deploy moves everything over to it: the store's URL, its page titles and link previews, the sitemap, and the Stripe webhook.\n\nProduction runs as a separate copy with its own database, photo bucket and live Stripe key. Set the live key with `floo env set STRIPE_SECRET_KEY --stdin --env prod`. Then release with `floo promote` if floo hosts your repository, or with a GitHub release if it's your own. Pushing code never touches production by itself.\n\n## Start your store\n\nThe template is a starting point that already takes payments. Whatever your store needs next, from discount codes to order emails, your agent builds on top of it in code you own. Start with the [storefront template](https://getfloo.com/templates/storefront).\n\n[Talk to the founder about your store](mailto:patrick@getfloo.com?subject=Building%20a%20store%20on%20floo).\n\n## Frequently asked questions\n\n### Can my agent build me an online store I own, instead of a store on a hosted builder?\n\nYes. Paste the deploy prompt from floo's storefront template into Claude Code, Codex or Cursor and it deploys a Next.js store with a catalog, a cart, Stripe Checkout, shipping rates, customer accounts and a Postgres database. The code lives in a repository floo hosts for you, or in your own GitHub repository if you prefer.\n\n### Which secrets do I have to set?\n\nOnly your Stripe secret key. You set it yourself with floo env set STRIPE_SECRET_KEY --stdin, so it never passes through the chat. The store creates its own Stripe webhook on each deploy and keeps the signing secret in its database.\n\n### How does the store handle shipping and sales tax?\n\nShoppers pick Standard or Express on Stripe's checkout page, and Standard is free over $50. You can change both in lib/store.ts. To charge sales tax, VAT or GST, set up Stripe Tax in the Stripe Dashboard and then turn on COLLECT_TAX. Every paid order records the shipping method, the shipping cost, the tax and the total charged.\n\n### How do I run the store after launch?\n\nOpen /admin on your store. floo signs you in, and you get the orders to ship with their addresses, and every product, where you change prices, stock and photos or add new ones. An agent can do the same through the store's API, with an app API key that has the api scope. The API is described at /api/openapi.json.", "url": "https://wpnews.pro/news/how-to-build-your-own-online-store-with-your-agent-tested-end-to-end", "canonical_source": "https://getfloo.com/blog/build-your-own-online-store-with-your-agent", "published_at": "2026-12-03 00:00:00+00:00", "updated_at": "2026-12-04 04:43:47.926187+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools"], "entities": ["floo", "Claude Code", "Codex", "Cursor", "Stripe", "storefront-check", "Next.js", "Postgres"], "also_reported_by": [], "takeaway": "Deploying floo's storefront template with one agent prompt and setting `STRIPE_SECRET_KEY` via `floo env set --stdin` produces a working Stripe Checkout store whose webhook is created automatically on rebuild, with orders marked paid only after Stripe's signed webhook confirms.", "recommendation": {"advice": "Start agents from a working storefront template and keep the Stripe key out of the transcript by setting it with `floo env set STRIPE_SECRET_KEY --stdin`, then redeploy so the webhook is created automatically.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/how-to-build-your-own-online-store-with-your-agent-tested-end-to-end", "markdown": "https://wpnews.pro/news/how-to-build-your-own-online-store-with-your-agent-tested-end-to-end.md", "text": "https://wpnews.pro/news/how-to-build-your-own-online-store-with-your-agent-tested-end-to-end.txt", "jsonld": "https://wpnews.pro/news/how-to-build-your-own-online-store-with-your-agent-tested-end-to-end.jsonld"}}