Open a high street of online shops on your own server
Storewright is a self-hosted online store builder that you run as your own software business. Merchants sign up on your platform, describe what they sell and get a working shop with products, pages and a theme in minutes, on a free subdomain or their own domain. They take orders with their own payment accounts; you sell them monthly or yearly plans.
This guide is written for first-time installers. Every command is shown in full, every setting says where to find it, and every outside service says what it costs before you turn it on.
Thank you for choosing Storewright. This guide takes you from the download to a running store-builder business: your platform installed, your first plan for sale and a first shop taking orders.
What it is and who it is for
Storewright is three things in one program: a platform you run, an admin where merchants run their shops, and the storefronts their customers buy from. Four words are used everywhere in this guide and in the app:
Platform: your installation. You, the buyer of this item, are its owner (the super-admin). You set the plans, the prices and the look of your own sign-up pages.
Shop: one merchant on your platform, with its own products, orders, customers, theme, domain and payment accounts. Shops never see each other's data.
Staff: the people who run a shop: its owner, managers and staff members (see Staff and roles).
Customer: a person who buys from a shop, with or without an account. A customer belongs to one shop; the same person buying at two shops is two customers.
Each shop pays you for a plan (for example $49 a month). Each shop takes its own customers' money through its own payment accounts (Stripe, PayPal, Razorpay, Paystack, Mollie, bank transfer or cash on delivery), so shop sales go straight to the merchant, never through you.
What you get
The shop admin for your merchants: a home page with today's sales and a setup checklist, analytics, products with up to three options and their variants, stock per location, digital files, CSV import, collections by hand or by rules, orders with partial fulfilment, refunds, returns and abandoned checkouts, customers, discounts, shipping zones, taxes, payment gateways, three themes with a live theme editor, pages, a blog, navigation menus, SEO and redirects, domains, staff roles, notifications, API keys, outgoing webhooks and an MCP server for AI assistants.
AI onboarding: a merchant describes the shop in a sentence or two and gets a first catalogue, About and Shipping pages, a theme with brand colours and a home page, written by the AI provider you choose with your own key. Without any AI key, built-in starter content for the shop's kind of business does the same job, clearly labelled as starter content.
Fast storefronts: three themes that look truly different (Atelier, Market and Summit), rendered on the server and cached, with a cart drawer, checkout, order status page, customer accounts with returns, search, blog, sitemap, structured data for search engines, and six storefront languages including Arabic written right to left.
The platform admin for you: revenue, shops, trials and shop sales this month; shops (change plan, suspend, open as owner); plans and limits; billing gateways and invoices; themes per plan; white label, email, storage, AI providers and languages; and a setup check that tests every outside service live.
Domains with automatic HTTPS: every shop gets a free subdomain, and shops on the right plan connect their own domain with clear DNS steps; certificates are made on demand by the bundled Caddy server (or by Traefik if you already run it).
One-command self-hosting with Docker: one compiled Rust program that also serves the web app and the storefronts, PostgreSQL, MinIO file storage and optional automatic HTTPS.
What is in the download
Path
What it is
apps/backend/
The server, written in Rust (Axum): the /api/v1 API, the storefronts, checkout, the payment webhooks, the background jobs and the built web app, compiled into one program called storewright.
apps/frontend/
The web app: React, React Router, Vite and Tailwind CSS. The shop admin, the platform admin, sign-in, the install wizard and your public site.
apps/storefront-js/
The small storefront script (TypeScript): cart drawer, variant picker, discount codes, checkout steps and the payment redirect.
crates/
Rust libraries the server is built from: commerce (money, discounts, shipping and tax rules), payments (the gateways), storefront (theme rendering, SEO), ai (AI providers and writers) and mcp (the MCP server).
themes/
The three storefront themes, the parts they share (checkout, account, order status) and the storefront translations.
migrations/
The PostgreSQL database schema. The server applies it by itself when it starts.
docker/, compose.yaml
The Dockerfile, the Docker Compose stack and the Caddy HTTPS config.
.env.example
Every setting, explained. Copy it to .env.
docs/
This documentation as one HTML file and as a PDF, plus the list of third-party licences.
README.md, CHANGELOG.md, LICENSE.txt
A one-page overview, the version history and the licence notes.
AI disclosure
AI tools used to create this item: Yes
Source code: Yes. Written with Claude by Anthropic as an AI coding assistant, then reviewed, tested (unit tests for every money rule, server tests against a real PostgreSQL including tests that send requests at the same moment, payment gateway tests against stand-in servers, and browser tests) and integrated by us.
Documentation: Yes. Drafted with Claude by Anthropic and checked against the code and the running app.
Graphics: No AI-generated images. No image was made with an AI image generator. The logo is a simple SVG drawn in code, and every screenshot in this guide is a capture of the running app. The demo shops' product photos are real Pixabay photos (none of them AI-generated), used only in the live preview and not shipped in the download, which holds same-size placeholders instead (see Credits and licences).
Demo text: Yes. The demo shops' product names, descriptions and pages were written with Claude by Anthropic and edited by us.
AI-powered features: Yes
AI onboarding (a first catalogue, pages, theme and colours from a short description) and the AI writers (product description, SEO title and meta description, collection description, blog post draft).
Review the output. AI text can contain mistakes, invented details or prices that do not suit the shop. Everything the AI writes is saved as a draft for the merchant to read and change before it goes live.
Not affiliated
Storewright is not affiliated with, endorsed by or sponsored by Stripe, PayPal, Razorpay, Paystack, Mollie, OpenAI, Anthropic, Google or OpenRouter. Their names are trademarks of their owners. Storewright works with your own accounts at these companies.
Screenshots
The main screens of the shop admin, the platform admin and each storefront theme, captured from the live demo. Most chapters below have more.
The shop admin
The shop's home: today's sales, the last 30 days, orders to fulfil, low stock and the setup checklistThe product editor: description with Write with AI, media, options and variants, stock per location and the search previewOne order: its lines, payment, shipments, timeline and customerThe theme editor: home sections on the left, the live storefront in the middle, settings on the rightAnalytics: sales, orders, average order value, sessions and the conversion funnelThe end of AI onboarding: the shop's products, pages, colours and theme, ready to open
The platform admin
Your platform: monthly recurring revenue, shops, trials, shop sales this month and sign-upsPlans and limits: prices, trials and every limit each plan allowsEvery shop with its plan, status, usage and salesThe setup check: each service with a status, a fix and a live test
The storefront themes
Atelier: editorial and airy, shown with the ceramics demo shopMarket: friendly and rounded, shown with the houseplants demo shopSummit: bold and dark, shown with the outdoor gear demo shopCheckout in the shop's own colours and fonts: information, shipping, payment
The shop admin on a phoneAn order on a phoneA product page on a phoneThe cart drawer on a phone
Requirements
To run it (recommended: Docker)
A 64-bit Linux server (Intel/AMD or ARM) with Docker Engine 24 or newer and Docker Compose 2.20 or newer (the stack uses Compose's include feature). Docker Desktop on macOS or Windows works for trying it on your own computer.
For the first build Docker compiles the Rust server from source, which needs more memory than running it: plan 2 processor cores and 4 GB of memory (or 2 GB plus swap) and at least 6 GB of free disk for Docker's build cache. docker builder prune gives the cache's space back once the app runs. You can also build on another computer and copy the program over (see Deploy on a VPS).
To run it the server needs far less: plan at least 1 GB of memory for a small platform, PostgreSQL and MinIO included.
PostgreSQL: the Docker stack ships PostgreSQL 17. Without Docker, PostgreSQL 15 or newer.
A domain name and HTTPS for a public launch. Payment gateways only send webhooks to https addresses, and browsers keep sign-ins and checkouts safe on https. The bundled Caddy gets free certificates for you, for shops' domains too.
Outgoing HTTPS from the server to the payment gateways, the AI provider you choose, your email provider and, for domain checks, a DNS resolver.
Browsers: a current version of Chrome, Edge, Firefox or Safari, on a computer or a phone, for you, your merchants and their customers.
Node.js 24 and pnpm (corepack enable installs the pnpm version the project asks for).
PostgreSQL 15 or newer.
Optional: any S3-compatible storage (MinIO, AWS S3, Cloudflare R2, Backblaze B2…). Without it, files are kept in a local folder.
Accounts you need
Account
What it is for
Needed
A billing gateway: Stripe, or PayPal, Razorpay, Paystack or Mollie
Charging shops for your plans.
To sell plans. Without one, shops stay on their free trial.
An SMTP email provider
Order confirmations, shipping notices, password resets, staff invites and renewal invoices. Without it, each email is written to the app's log.
For a public launch
An AI provider: OpenAI, Anthropic, Google Gemini, OpenRouter or an OpenAI-compatible endpoint
AI onboarding and the AI writers.
Optional. Without a key, onboarding uses built-in starter content.
A domain name with DNS you can edit
Your platform's address, and a wildcard record for shop subdomains.
For a public launch
S3-compatible storage
Product images, logos and digital downloads. The bundled MinIO does this on the same server.
Optional
Your merchants bring their own payment accounts for their shops' checkouts (see Payments).
Install with Docker
This runs Storewright on your own computer or on a server, in one command. The first build compiles the server from source, so it takes longer than later starts.
Unzip the download and open a terminal in the storewright/ folder (the one with compose.yaml in it).
Create your settings file:
cp .env.example .env
Open .env in any text editor and fill in these four values:
APP_URL=http://localhost:8080 # your public https:// address on a server
APP_SECRET=paste-a-random-string-here # make one with: openssl rand -hex 32
POSTGRES_PASSWORD=pick-a-long-password # letters and digits only
S3_SECRET_ACCESS_KEY=pick-another-password # at least 8 characters
Change both passwords: the example values are public. Keep APP_SECRET safe and never change it after the install, because it seals every payment and AI key that you and your shops save. Leave DATABASE_URL empty: Docker builds the database address from the values above. Everything else can wait.
Build and start everything, in one command:
docker compose up -d --build
Docker builds the app (the web app, then the Rust server), starts PostgreSQL and MinIO (file storage), creates the storage bucket and starts the app, which applies the database migrations by itself. Later builds reuse Docker's cache and are much quicker.
Find the install token in the app's log (if the app has restarted, use the last one):
docker compose logs app | grep -i "install token"
The line reads Install token: sw-install-… (open /install and paste it).
Open http://localhost:8080. The install wizard opens: paste the token, check the server, create your platform account and name your platform.
Good to know
See what the app is doing with docker compose logs -f app. Stop it with docker compose down; your data stays in Docker volumes. Use another port by setting APP_PORT=8090 in .env and running docker compose up -d. The app port is open on this computer only (APP_BIND=127.0.0.1); on a server, visitors come in through HTTPS (see Deploy on a VPS).
Shops work before DNS
Until you set up shop subdomains, every shop answers at <APP_URL>/s/<handle>, for example http://localhost:8080/s/kilnhouse. That address always works, on your own computer too.
Out of memory during the build
If the build stops with "signal: 9" or "killed", the server ran out of memory while compiling. Add swap (for example 4 GB) and run the same command again, or build on a bigger computer and copy the result (see Build on another computer).
Install wizard
The first visit to a new install opens the wizard at /install. Until it is finished, every page leads there and nobody can sign up. It runs once; afterwards the page is locked.
Install token and server checks. Paste the install token from the app's log and press Check the server. The app prints a token at every start until the install is finished, and a restart makes a new one, so use the last line. Lost it? Set INSTALL_TOKEN in .env to a value of your choice and run docker compose up -d. The wizard then shows the database, file storage, the app address, email, billing and AI settings from .env. A red line that is required blocks Continue until you change .env, restart the app and press Test again; everything else can be set up later.
Your platform account. Your name, email and password (at least 10 characters). This is the super-admin account you run the platform with. Load the demo shops (off by default) adds Kilnhouse Ceramics, Little Canopy, Trailmade Outfitters and sample shops so you can see a full platform; Platform admin → Settings → Maintenance → Remove demo data takes them away again.
Your platform. Its name (shown on your public site, the sign-up pages, the shop admin and emails; you can change it any time), its brand colour (add your logo later in Settings → White label), how shop addresses will look (set by STORE_ROOT_DOMAIN in .env), and Add the sample plans (on by default): Starter, Growth and Scale with monthly and yearly prices and a 14-day free trial (see Plans). Untick it to make your own plans.
Done. A summary of what was created and what was skipped, and the way into the platform admin. Email, billing gateways and AI providers are set up from the platform admin when you are ready, and the Setup check shows what is still missing.
Paste the install token from the server log; each check is marked ready or for laterThe platform is ready: what was created and what to set up next
Setup check
Platform admin → Setup check lists everything a running platform depends on, with a plain-words status, what to do about it and, where possible, a Test button that calls the service for real.
Row
What it shows, and what Test does
Database
PostgreSQL answers and how many migrations are applied. Test reads the PostgreSQL version.
File storage
The S3-compatible bucket or the server's own disk. Test writes, reads and deletes a small file.
Email (SMTP)
The sender and server. Test connects and signs in, and sends a test email when you type an address.
Billing gateways
Which gateways are set up to charge shops for plans, and whether the Stripe webhook secret is set. Test reads your Stripe balance and says whether the key is in test or live mode.
AI providers
Which providers have a platform key (saved in the platform admin or in .env). Test tries the keys. Without any key, AI onboarding uses starter content and the AI writers explain that AI needs a key.
App address
Whether APP_URL is https. Test calls APP_URL/api/health to prove the address reaches this server.
Shop addresses
Whether STORE_ROOT_DOMAIN is set for shop subdomains, and how shops' own domains get HTTPS (see Shop addresses and domains).
Failed jobs in the last 24 hours and jobs waiting for more than 10 minutes, with the reason a job failed and a Retry button (see Background jobs).
A live test result on the setup check
Part 02
Your platform
Everything in this part happens in the platform admin at /admin, signed in with the account the install wizard made. Outside services can be set in .env or in the platform admin; values saved in the platform admin take precedence over .env, are sealed with your APP_SECRET, and are never shown again once saved (only a short hint). Change a value by typing a new one.
Plans, limits and free trials
You decide what each plan costs and what it allows. Platform admin → Plans.
Each plan has a name, a description, a monthly price and an optional yearly price, a free trial in days, a list of features shown on your pricing page, whether it is public, whether it is the default plan new shops start their trial on, and an optional "Most popular" badge. Its limits are checked on the server, inside the database transaction that adds the rows and under a lock per shop and limit, so requests sent at the same moment can never pass a limit together:
Limit
Key in the API
What happens when it is reached
Products
products
A new product (by hand, CSV import, AI onboarding, the API or MCP) is refused with an upgrade prompt. Archived products count; deleted ones do not.
Staff accounts
staff
Members plus open invitations, the owner included. Inviting another person is refused.
Stock locations
locations
Adding another location is refused.
Custom domains
customDomains
Connecting another domain is refused; 0 means the plan has subdomains only.
AI credits a month
aiCredits
One credit pays for one AI writer request (a product description, an SEO title and description, a collection description or a blog post draft); AI onboarding uses one per part it writes. Claimed before the provider is called and given back when the call fails. When used up, the AI buttons say so until the next calendar month (UTC) or an upgrade.
Themes it may publish
themes
The theme editor can preview every theme, but publishing a theme the plan does not include is refused.
File storage
storageMb
Every upload counts toward the shop's total; an upload past it is refused.
API access
apiAccess
Switch: API keys, outgoing webhooks and the MCP server. Off: they cannot be made, and existing keys stop working.
Remove "Powered by"
removeBranding
Switch: hides the small "Powered by" line (with your platform's name) in the storefront footer.
An empty limit means no limit. A refused request answers 402 plan_limit with limit set to the key above, and the screens show the plan-limit dialog with an upgrade button. Moving a shop to a smaller plan deletes nothing: what it already has stays, and adding more is refused until it is under the new limit. Archiving a plan takes it off sale; its shops keep it, and you can restore it later.
The sample plans
The install wizard adds these three (change or archive them any time). A year costs ten months. Starter is the default plan, so a new shop starts its free trial there unless it picks another plan at sign-up.
Limit
Starter
Growth
Scale
Price a month
$19
$49
$129
Price a year
$190
$490
$1,290
Free trial
14 days, no card
14 days, no card
14 days, no card
Products
100
2,000
No limit
Staff accounts
1
5
15
Stock locations
1
3
10
Custom domains
0
1
5
AI credits a month
50
300
1,500
Themes it may publish
Atelier, Market
All themes
All themes
File storage
500 MB
5 GB
25 GB
REST API, webhooks and MCP
No
Yes
Yes
Remove "Powered by"
No
No
Yes
Free trials
A new shop gets its plan's free trial (14 days on the sample plans) without a card. Its storefront is live during the trial.
The owner can pay for a plan at any time in Settings → Plan and billing; the trial's remaining days are not lost when a Stripe subscription starts.
When a trial ends with no plan paid, the shop becomes past due: its storefront shows "closed for now", and its admin stays open so the owner can pay (see Shop statuses).
Platform admin → Plans: one plan's prices, trial and limitsA shop's Plan and billing page: usage meters, change plan and invoices
Billing your shops
Shops pay you for their plan through the billing gateway you set up in Platform admin → Billing. Two ways of charging are built in.
Stripe
PayPal, Razorpay, Paystack, Mollie
How a shop pays
A Stripe subscription: Stripe Checkout the first time, then Stripe charges the card every month or year by itself.
One period at a time: the shop pays the month or year on the gateway's own page, then pays each renewal from an emailed pay link.
Renewal
Automatic. A failed card is retried by Stripe; the owner gets a "payment failed" email.
A renewal invoice with a pay link is emailed 7 days before the period ends. After the period ends there are 3 days' grace, then the shop is past due until it pays. Change both numbers in Platform admin → Billing.
Card changes and cancelling
Stripe's billing portal (Settings → Plan and billing → Manage billing).
Nothing to cancel: an unpaid renewal simply ends the plan.
Changing plan
The first paid plan through Stripe Checkout; after that, in Stripe's billing portal (Manage billing), where Stripe works out the difference. A trial that is still running keeps its free days.
A bigger plan on the same billing interval starts at once, for the price difference over the rest of the period. A smaller plan, or a switch between monthly and yearly, starts at the next renewal. A trial that is still running keeps its free days.
How payment is confirmed
Stripe's signed webhooks.
The gateway's webhook, checked the gateway's own way, or the pay page's return.
Every paid period gets an invoice numbered SW-0001, SW-0002, … in Platform admin → Invoices, and the shop sees its own invoices in Settings → Plan and billing. Plans switch on only from a payment the gateway confirmed; a shop can never give itself a plan.
Shop statuses
Status
When
Storefront
Shop admin
Trial
A new shop, during its free trial.
Open
Everything its plan allows.
Active
The current period is paid.
Open
Everything its plan allows.
Past due
A trial ended with no plan paid, a renewal was not paid after the grace days, or Stripe gave up on a card.
"Closed for now" page
Fully open, except AI writing: paid orders can still be fulfilled and refunded. Paying makes the shop active again at once.
Suspended
You suspended it in Platform admin → Shops.
"Closed for now" page
Read-only, except Plan and billing.
Closed
The owner (or you) closed the shop.
Gone
Gone; the data is removed 30 days later (see Personal data).
Stripe (subscriptions)
Stripe's fees
Stripe is a third-party payment service with its own pricing, and you pay its fees: in the USA 2.9% + 30¢ per successful card payment, plus 0.7% of subscription volume for Stripe Billing. Other countries, cards and currencies have their own rates on Stripe's pricing page.
In the Stripe Dashboard, switch to Test mode first. Under Developers → API keys, copy the Secret key (sk_test_…) and the Publishable key, and paste them into Platform admin → Billing → Stripe (or STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY in .env).
In Stripe, open Product catalog → Add product for each paid plan, with a recurring monthly price and, if you sell yearly, a recurring yearly price. Copy each price's ID (price_…) into the plan in Platform admin → Plans. Storewright reads the price from Stripe and shows its amount and interval, so a wrong ID is caught before a shop sees it.
In Stripe, open Developers → Webhooks → Add endpoint with the address https://store.example.com/api/v1/webhooks/stripe (your APP_URL plus /api/v1/webhooks/stripe), with these events: checkout.session.completed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted, invoice.paid, invoice.payment_succeeded, invoice.payment_failed, charge.refunded, charge.dispute.created, charge.dispute.closed, customer.updated, payment_method.attached and payment_method.updated.
Copy the endpoint's Signing secret (whsec_…) into Platform admin → Billing → Stripe (or STRIPE_WEBHOOK_SECRET). Without it, plans paid through Stripe never switch on, and the setup check says so.
In Stripe, open Settings → Billing → Customer portal and activate it, with payment method updates, invoice history and cancellation turned on. To let shops change plan there, turn on Customers can switch plans and add the products of your paid plans.
Test a full upgrade with Stripe's test card 4242 4242 4242 4242, then repeat steps 1 to 4 in live mode with your live keys and live price IDs.
PayPal (one period at a time)
PayPal's fees
PayPal is a third-party payment service with its own pricing, and the account holder pays its fees per transaction, which depend on the country, the currency and the way the buyer pays; see PayPal's merchant fees.
In the PayPal Developer Dashboard, open Apps & Credentials, create an app (Sandbox first), and copy its Client ID and Secret into Platform admin → Billing → PayPal. Add a webhook to the app with the address shown on that card, and paste the Webhook ID PayPal gives it: Storewright asks PayPal to verify every notification with it. Press Test keys, then switch the card to live with your live app's details.
Razorpay (one period at a time)
Razorpay's fees
Razorpay is a third-party payment service with its own pricing, and the account holder pays its fees: about 2% per domestic payment in India, more for international cards and some payment methods; see Razorpay's pricing.
In the Razorpay Dashboard, open Account & Settings → API Keys, generate a key (Test mode first) and copy the Key ID and Key Secret into Platform admin → Billing → Razorpay. Under Webhooks, add the address shown on that card with a secret of your choice and the payment and payment link events, and paste the same secret into Storewright: every notification is checked with it (HMAC-SHA256).
Paystack (one period at a time)
Paystack's fees
Paystack is a third-party payment service with its own pricing, and the account holder pays its fees: in Nigeria, for example, 1.5% + ₦100 per local payment (the ₦100 is waived under ₦2,500, and the fee is capped), with other rates in Ghana, Kenya and South Africa; see Paystack's pricing.
In the Paystack Dashboard, open Settings → API Keys & Webhooks, copy the Secret Key (test first) into Platform admin → Billing → Paystack, and set the Webhook URL to the address shown on that card. Paystack signs every notification with your secret key (HMAC-SHA512) and Storewright checks it.
Mollie (one period at a time)
Mollie's fees
Mollie is a third-party payment service with its own pricing, and the account holder pays a fee per successful payment that depends on the payment method (a fixed fee for methods such as iDEAL, a percentage plus a fixed fee for cards); see Mollie's pricing.
In the Mollie Dashboard, open Developers → API keys and copy the Test API key (later the Live key) into Platform admin → Billing → Mollie. Mollie needs no webhook setup: each payment tells Mollie where to report, and Storewright then fetches the payment from Mollie by its id, so a made-up notification can never mark anything paid.
Demo payments
DEMO_PAYMENTS="true" in .env turns on demo payments: a plan change completes without any card or money, labelled "Demo payment (no card charged)". It is for a test copy only, is "false" in the shipped file, and must stay "false" on a live platform.
Licence
Charging shops for plans through Storewright requires the Envato Extended Licence. The Regular Licence covers a single end product whose users are not charged.
Platform admin → Billing: each gateway's keys, its webhook address and a Test keys button
The platform admin
Your side of Storewright, at /admin. The install wizard makes you its first super-admin. In Users, make a colleague a platform admin, or a read-only viewer who can look at everything and change nothing. They need an account first: they sign up, or you add a shop for them.
Page
What it does
Overview
Monthly recurring revenue, shops by status and plan, trials ending, shop sales across the platform this month, sign-ups over time and what needs attention (failed payments, shops at a limit, failed jobs). Shops sell in their own currencies; the overview adds their sales up in your platform's currency at the European Central Bank's daily reference rates.
Shops
Search and filter by status and plan. A shop's page shows its plan, usage against each limit, owner, domains, invoices and sales, and lets you change the plan by hand (no gateway is charged), suspend or restore it, close it, and open it as owner: a 30-minute session with a banner and an exit button, written to the shop's audit log, that can never reveal saved keys or reach the platform admin. Add shop starts a shop for someone and emails its owner a link to set a password; Send password reset emails an owner a new link; Export downloads the list as CSV.
Users
Everyone with an account, with their shops and last visit. Give or take the platform admin and read-only roles, suspend or restore an account (a suspended person is signed out everywhere), or email a password reset. Nobody can demote or suspend themselves.
Plans
Prices, trials and limits (see Plans), and who may sign up: anyone, only shops you add, or nobody.
Every platform invoice (SW-0001, …) with its shop, period, gateway and status, in tabs for open, past due and paid, with the totals of each and a CSV export.
Themes
Which storefront themes each plan may publish.
Settings
General (platform name, support email), white label, email, storage, AI providers and languages (see the next chapters), Legal (your terms, privacy and refund policies, linked from the sales site and sign-up), and Maintenance (while you work, shop staff see a maintenance page with your message and sign-ups pause; storefronts keep selling and platform admins get through), and Remove demo data under it.
One shop: plan, usage, owner, suspend and open as ownerEvery platform invoice with its shop, period and statusWhich themes each plan may publishPlatform settings
White label, languages and your public site
Platform admin → Settings → White label changes your platform's name, logo, main colour and support email without touching code. They show on your public site (home, pricing, themes gallery), the sign-in and sign-up pages, the shop admin, emails and the browser tab, on the next page load. The logo must be a PNG, SVG or WebP of at most 1 MB; SVG files with scripts are refused. The storefronts wear each shop's own brand, never yours, except the small "Powered by" line on plans that do not remove it.
Your public site
Your platform's home page (/), pricing page (/pricing, built from your public plans) and themes gallery (/themes) are part of the web app. They are written for a store-builder business and carry your platform name. To change their wording beyond the settings, edit the React pages (see Customise the code) and rebuild.
Interface languages
The shop admin, the platform admin and the storefronts' own words come in English, Spanish, French, German, Portuguese and Arabic. Platform admin → Settings → Languages sets the default language for new staff and new shops (and for visitors who have not picked one); each person can pick their own in the account menu. Each shop picks its storefront language in Settings → General (see Languages).
Help links and search engines
Storewright never links to an address of ours. Settings → General has a documentation link (where you published this guide, shown in your own admin's menu) and a support link (your own help page, shown in every shop admin's Help menu). Your merchants never see this guide: it is written for you.
Search engines may index your public pages and every live storefront, never the admin, the platform or the API. With SEARCH_INDEXING=off in .env, for a staging copy, every /robots.txt closes every page and every answer carries X-Robots-Tag: noindex, nofollow. Restart the app after changing it.
Settings → White label: name, logo, colour and support email
Email (SMTP)
Storewright sends shop emails to customers (order confirmation, shipping and delivery, refund, return updates, abandoned checkout reminder, account and password reset) and platform emails to shop staff (staff invitations, password resets, trial ending, renewal invoices with a pay link, payment failed, plan limit reached, shop suspended). Each platform notice goes out at most once per event; demo shops never send email.
Email costs
Email providers are third-party services with their own pricing, and you pay them: Amazon SES, for example, charges about $0.10 per 1,000 emails, and most other providers sell monthly plans with a small free tier.
Get SMTP details from any email provider (Amazon SES, Postmark, Brevo, Mailgun, your own mail server…): host, port, user name, password and a sender address on a domain you have verified with that provider.
Enter them in Platform admin → Settings → Email (or the SMTP_* keys in .env). Use starttls on port 587, tls on port 465.
Press Test on the Email row of the setup check, with your own address.
Without SMTP, each email is written to the app's log with its links (docker compose logs app), which is enough for testing. Shop emails go out from your sender address with the shop's name and the shop's own reply-to address, so customers' replies reach the merchant. Merchants preview each email in Settings → Notifications (see Notifications); the wording of the platform emails is editable in Platform admin → Settings → Email.
File storage
Product images, shop logos, digital downloads, theme images and your own logo are stored in an S3-compatible bucket. The Docker stack includes MinIO with a private bucket on the same server, so this works out of the box.
Storage costs
The bundled MinIO and the server's own disk cost nothing extra. Outside storage providers are third-party services with their own pricing, and you pay them for space and sometimes for downloads: Cloudflare R2, for example, charges $0.015 per GB a month after the first 10 GB, with no fee for downloads.
Another bucket (AWS S3, Cloudflare R2, Backblaze B2, Wasabi…): set S3_ENDPOINT, S3_REGION, S3_BUCKET, S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY in .env, or enter them in Platform admin → Settings → Storage. Keep the bucket private.
A local folder: STORAGE_DRIVER=local keeps files in the app-storage Docker volume. Fine for one server; for several servers use a bucket (see Several servers).
The storefronts serve product and theme images through the app, with long cache times. Digital downloads are private: a customer gets a download link for a paid order only. Uploads are checked by their content (pictures, PDF, CSV and text) and may be up to 10 MB each. Each plan's file storage limit caps what one shop keeps.
AI providers, credits and costs
AI writes a merchant's first shop (AI onboarding) and helps with product descriptions, SEO text, collection descriptions and blog drafts. It uses the provider you choose, with your own key.
Any OpenAI-compatible endpoint (a self-hosted model, a regional provider)
Its own key, its base URL and the model name
The model you name
Add a key in Platform admin → Settings → AI (or OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY or OPENROUTER_API_KEY in .env), choose which provider writes, change the model if you like, and press Test. On plans that allow it, a shop can add its own key in Settings → AI; its own key is then used instead of yours, and its provider bills the shop.
AI credits
Each plan gives a shop a number of AI credits a month. Each AI writer (a product description, an SEO title and description, a collection description, a blog post draft) uses one credit; AI onboarding uses one credit for each part it writes, 11 to 17 in all (see Sign-up and AI onboarding). Credits are claimed before the provider is called (one locked database step, so requests at the same moment cannot pass the limit) and given back when the call fails, so a shop never pays for an error. A shop that uses its own AI key (on plans that allow it) spends no credits. Credits start again on the first day of each calendar month (UTC). A past-due shop cannot use AI writing.
Without any AI key
Storewright works fully without AI. AI onboarding then builds the first shop from built-in starter content for the kind of business described (ceramics and home goods, plants, outdoor gear, fashion, food and drink, beauty, or a general shop): products, collections, pages, theme and colours, clearly labelled as starter content for the merchant to replace. The Write with AI buttons explain that AI needs a key and use no credits.
OpenAI
OpenAI's costs
OpenAI is a third-party AI service with its own pricing, and you (or a shop that uses its own key) pay for every request; its list prices per million tokens are in the table below and on OpenAI's pricing page.
Anthropic
Anthropic's costs
Anthropic is a third-party AI service with its own pricing, and you (or a shop that uses its own key) pay for every request; its list prices per million tokens are in the table below and on Anthropic's pricing page.
Google Gemini
Google Gemini's costs
Google Gemini is a third-party AI service with its own pricing, and you (or a shop that uses its own key) pay for every request; its list prices per million tokens are in the table below and on Google's Gemini API pricing page.
OpenRouter
OpenRouter's costs
OpenRouter is a third-party AI service with its own pricing, and you (or a shop that uses its own key) pay for every request at the price of the model it reaches; see OpenRouter's models and prices.
OpenAI-compatible endpoints
Costs
An OpenAI-compatible provider is a third-party service with its own pricing (or, for a model you host yourself, your own server's running costs), and you pay them. Enter its prices in the price table so the cost figures stay right.
What AI writing costs
The list prices Storewright uses for its cost figures, in US dollars per million tokens (a token is about four characters of text). Change them in Platform admin → Settings → AI when a provider changes its prices; the defaults are marked.
Provider
Model
Input
Output
OpenAI
gpt-5-mini (default)
$0.25
$2
OpenAI
gpt-5-nano
$0.05
$0.40
OpenAI
gpt-5
$1.25
$10
OpenAI
gpt-4.1-mini
$0.40
$1.60
OpenAI
any other model
$1.25
$10
Anthropic
claude-haiku-5-5 (default)
$0.10
$0.50
Anthropic
claude-sonnet-5-5
$2
$10
Anthropic
claude-opus-5-5
$4
$20
Anthropic
claude-haiku-4-5
$1
$5
Anthropic
any other model
$2
$10
Google Gemini
gemini-2.5-flash-lite
$0.10
$0.40
Google Gemini
gemini-2.5-flash (default)
$0.30
$2.50
Google Gemini
gemini-2.5-pro
$1.25
$10
Google Gemini
any other model
$0.30
$2.50
OpenRouter
openai/gpt-5-mini (default)
$0.25
$2
OpenRouter
any other model
$0.50
$2
OpenAI-compatible
your endpoint's model (enter its prices yourself)
$0
$0
The most one request can cost with each default model, worked out from each action's longest allowed reply and a request of 2,000 tokens (the instructions plus the shop's own words). Most replies are shorter, so most requests cost less. If a reply cannot be read, the AI is asked once more to fix it, which can double that request's cost.
Action
AI credits
Longest reply
OpenAI gpt-5-mini
Anthropic claude-haiku-5-5
Google Gemini gemini-2.5-flash
OpenRouter openai/gpt-5-mini
AI onboarding: a whole shop draft from a short description
11 to 17
12,000 tokens
$0.0245
$0.0062
$0.0306
$0.0245
Product description
1
2,000 tokens
$0.0045
$0.0012
$0.0056
$0.0045
SEO title and meta description
1
1,000 tokens
$0.0025
$0.0007
$0.0031
$0.0025
Collection description
1
1,500 tokens
$0.0035
$0.0009
$0.0043
$0.0035
Alt_text
1
400 tokens
$0.0013
$0.0004
$0.0016
$0.0013
Blog post draft
1
6,000 tokens
$0.0125
$0.0032
$0.0156
$0.0125
Section_copy
1
800 tokens
$0.0021
$0.0006
$0.0026
$0.0021
Page
1
4,000 tokens
$0.0085
$0.0022
$0.0106
$0.0085
So the most each sample plan's AI credits can cost you in a month, if a shop spends every credit on the action that costs the most per credit:
Plan
AI credits a month
OpenAI gpt-5-mini
Anthropic claude-haiku-5-5
Google Gemini gemini-2.5-flash
OpenRouter openai/gpt-5-mini
Starter
50
$0.63
$0.16
$0.78
$0.63
Growth
300
$3.75
$0.96
$4.68
$3.75
Scale
1,500
$18.75
$4.80
$23.40
$18.75
When a provider refuses
A failed AI request gives its credit back and shows the provider's reason in plain words. What each reason means:
Code
What it means
What to do
auth
The key is wrong, revoked or lacks access (HTTP 401/403)
Copy the key again from the provider's dashboard, check that it is not revoked and may use the model, save it and press Test.
rate_limited
Too many requests right now (HTTP 429); trying again later works
Wait a moment and try again. If it happens often, ask the provider for a higher rate limit.
quota
The account is out of credit or over a hard quota; retrying will not help
Add credit, or raise the spending limit, on the provider's billing page.
bad_request
The request was refused as invalid (unknown model, bad parameter)
Usually the model name: check it against the provider's model list. For Gemini it can also mean the API is not offered in the server's region.
timeout
No answer within the configured timeout
Try again. If it keeps happening, pick a faster model.
server
The provider failed on its side (HTTP 5xx, overloaded)
Try again later: the provider had a problem on its side. Check its status page if it lasts.
network
The provider could not be reached (DNS, TLS, connection reset)
Check that the server can reach the provider over HTTPS (firewall, DNS, outgoing proxy).
parse
The provider answered with something that could not be read
Rare. For an OpenAI-compatible endpoint, check that it speaks the Chat Completions format.
refused
The provider declined to answer (safety filter, blocked prompt)
The provider's safety filter declined the request. Reword the product facts or the description and try again.
not_configured
Something needed for the call is missing (key, base URL)
Add a key for this provider (and the base URL for an OpenAI-compatible endpoint) in Platform admin → Settings → AI.
Set a spending limit
Set a monthly spending limit (or a prepaid balance) with each AI provider, as a second stop behind the plans' AI credits.
Platform admin → Settings → AI: providers, keys, models and list prices
Third-party services and costs
Storewright has no monthly fee of its own. The outside services below are run by other companies, not by us. Each has its own pricing tiers, and you, the buyer, are responsible for any costs they charge (a shop that uses its own payment or AI account pays that company itself). List prices checked in November 2026; each company sets and changes its own prices.
Service
What it is for
What it costs
Stripe
Billing your plans (subscriptions); a shop's checkout with its own account
Stripe is a third-party payment service with its own pricing, and you pay its fees: in the USA 2.9% + 30¢ per successful card payment, plus 0.7% of subscription volume for Stripe Billing. A shop that uses Stripe for its checkout pays Stripe's fees on its own sales. Pricing
PayPal
Billing your plans; a shop's checkout
PayPal is a third-party payment service with its own pricing, and the account holder pays its fees per transaction, which depend on the country, the currency and the way the buyer pays. Pricing
Razorpay
Billing your plans; a shop's checkout (India)
Razorpay is a third-party payment service with its own pricing, and the account holder pays its fees: about 2% per domestic payment in India, more for international cards and some payment methods. Pricing
Paystack
Billing your plans; a shop's checkout (Africa)
Paystack is a third-party payment service with its own pricing, and the account holder pays its fees: in Nigeria, for example, 1.5% + ₦100 per local payment (the ₦100 is waived under ₦2,500, and the fee is capped). Pricing
Mollie
Billing your plans; a shop's checkout (Europe)
Mollie is a third-party payment service with its own pricing, and the account holder pays a fee per successful payment that depends on the payment method. Pricing
OpenAI
AI onboarding and writers
OpenAI is a third-party AI service with its own pricing, and you (or a shop that uses its own key) pay for every request. Pricing
Anthropic
AI onboarding and writers
Anthropic is a third-party AI service with its own pricing, and you (or a shop that uses its own key) pay for every request. Pricing
Google Gemini
AI onboarding and writers
Google Gemini is a third-party AI service with its own pricing, and you (or a shop that uses its own key) pay for every request. Pricing
OpenRouter
AI onboarding and writers
OpenRouter is a third-party AI service with its own pricing, and you (or a shop that uses its own key) pay for every request at the price of the model it reaches. Pricing
An OpenAI-compatible provider
AI onboarding and writers
An OpenAI-compatible provider is a third-party service with its own pricing (or, for a model you host yourself, your own server's running costs), and you pay them.
Email providers are third-party services with their own pricing, and you pay them: Amazon SES, for example, charges about $0.10 per 1,000 emails. SES pricing
File storage: the bundled MinIO, AWS S3, Cloudflare R2…
Images, logos and digital downloads
The bundled MinIO and the server's own disk cost nothing extra. Outside storage providers are third-party services with their own pricing, and you pay them: Cloudflare R2, for example, charges $0.015 per GB a month after the first 10 GB. R2 pricing
Server (VPS), domain name and DNS
Running the Docker stack; your platform's address and shop subdomains
Your server and your domain come from third-party providers with their own pricing, and you pay them: about $10 to $40 a month for a server with 2 cores and 4 GB of memory, and about $10 to $20 a year for a domain name. Shop owners pay for their own domains.
HTTPS certificates
Your platform, shop subdomains and shops' own domains
Free: the bundled Caddy gets them from Let's Encrypt (or ZeroSSL), which charge nothing.
Keeping costs known
Plans cap the two costs that grow with use: AI credits cap AI requests (see What AI writing costs), and file storage caps each shop's files. Payment fees are paid by whoever owns the payment account: you for plan payments, each merchant for their own sales.
Part 03
Running a shop
This part follows a merchant on your platform, so you can answer their questions. Everything happens in the shop admin at /app. Money is always kept in whole units of the shop's currency's smallest coin (cents, pence, yen…), never as rounded decimals, and every rule below is checked by the server, not only by the screens.
Shop sign-up and AI onboarding
Sign-up
On your public site, the merchant presses Start free trial (on the pricing page, with a plan already picked) and opens /signup.
They type the shop name. Storewright suggests a handle (letters, digits and hyphens), shows the address it gives (kilnhouse.yourdomain.com, or yourdomain.com/s/kilnhouse without shop subdomains), and checks it is free.
They give their name, email and a password (at least 10 characters), the shop's country and currency, and pick a plan. The free trial starts at once, without a card.
Sign-ups can be open to everyone, limited to shops you add yourself, or closed (Platform admin → Plans → Trial and sign-ups). One person can own or work in several shops and switch between them from the account menu.
AI onboarding
Right after sign-up the merchant is asked to describe the shop in a sentence or two ("Handmade stoneware mugs, plates and vases from a small studio in Portland"). Storewright then builds a first draft and shows each part as it is made:
6 to 12 products with titles, descriptions, prices in the shop's currency and options (such as Size or Colour) where they make sense, grouped into a few collections;
an About page and a Shipping and returns page, written as sensible defaults for the merchant to check;
a theme (Atelier, Market or Summit) with five brand colours, and home page sections (a banner, featured products, collections, a story, a newsletter sign-up, questions and answers).
When the draft is ready, Storewright adds it to the shop in one step: the products (active, with stock counting off until the merchant sets their stock), the collections, the pages and the theme settings. A shop that has never published a theme opens with the new one at once; a shop that already has one gets it as a draft in the theme editor. The merchant then reviews the products, pages, colours and theme, changes what they like, and sees Your shop is live. Nothing invented is presented as fact: the AI is told not to write customer reviews, testimonials, awards or certifications, and the shipping page avoids promising delivery times.
The draft is one AI request, but it uses one AI credit for each part it writes: the shop description, the theme and colours, each product, each page and the home sections. Nine products and two pages use 14 credits; the most is 17. The most it could use is set aside before the AI is called and the rest is given back; a failed call gives it all back. A shop that uses its own AI key spends no credits.
The draft comes from built-in starter content for the kind of business described instead, at no credit, when there is no AI key, when the month's credits cannot cover the 17 (or the shop's plan payment is overdue), or when the AI call fails. The draft is labelled as starter content with the reason, and its pages start with "Starter content" so the merchant knows to replace them. Products beyond the plan's product limit are left out (the result says how many), and a theme the plan cannot publish is swapped for one it can. Merchants can skip onboarding and start with an empty shop.
Review the output
AI text can contain mistakes, invented details or prices that do not suit the shop, and the products are on sale as soon as the shop is live. Merchants should read every product and page and set real prices and stock before they share the shop's address.
Describe your shop in a sentence or twoThe draft to check before the shop opens (here from the built-in starter)
Products, options and variants
Products → Add product. A product has a title, a description (with Write with AI), pictures, a type, a vendor, tags, collections, an SEO title and description with a search preview, and a status: Active (on sale), Draft (hidden) or Archived.
Options and variants
A product can have up to three options, such as Size, Colour and Material, each with its values.
Storewright makes one variant for each combination of values (Small / Oatmeal, Small / Fog, …). A product without options has one variant.
Each variant has its own price, compare-at price (the old price, shown struck through), SKU, barcode, weight (for shipping rates by weight), picture, stock at each location, and switches for track stock, continue selling when out of stock, needs shipping and charge tax.
Digital products
Turn off needs shipping and attach a digital file to the variant. After the order is paid, the customer gets a private download link on the order status page, in their account and in the confirmation email. The file counts toward the shop's file storage.
Lists and bulk changes
Products has tabs for Active, Draft and Archived, a search, filters by collection, type, vendor and stock, and bulk actions (publish, archive, add to a collection). Deleting a product hides it everywhere; past orders keep their own copy of what was bought.
Products with their status, stock and price range
Import products from a CSV file
Products → Import adds or updates many products at once from a spreadsheet saved as CSV. A preview shows the first rows and every error before anything is saved; the import then runs in the background and shows how many products were created, updated and skipped, with the reason for each skipped row.
The file
UTF-8 text, comma-separated, with the column names in the first row. Any spreadsheet app saves this as "CSV UTF-8".
One row per variant. Rows with the same handle are one product; the product's own columns (title, description, tags…) are read from its first row and may be left empty on the others.
Put a value that contains a comma in double quotes ("mug, stoneware").
A handle that already exists in the shop updates that product; its variants are matched by SKU, then by their option values. A new handle creates a product.
Prices are decimal numbers in the shop's currency with a dot and no currency sign: 34.00, 1250 for yen.
The plan's product limit applies: rows for products past the limit are skipped with that reason. The file may be up to 10 MB.
The columns
Column
Required
Values
handle
Yes
The product's address in the shop (/products/<handle>): lower-case letters, digits and hyphens.
title
Yes, on the product's first row
The product's name.
description
No
Text, or simple HTML (paragraphs, bold, lists, links).
vendor
No
Text.
type
No
Text, for example Mug. Collections can use it in their rules.
tags
No
Words separated by commas, in quotes: "mug, stoneware".
status
No
active, draft (the default) or archived.
collections
No
Handles of existing hand-picked collections, separated by commas, in quotes.
option1_name, option1_value
No
The first option and this variant's value: Colour, Oatmeal. Leave both empty for a product without options.
The old price shown struck through; higher than price.
weight_grams
No
A whole number of grams, for shipping rates by weight.
track_stock
No
true (the default) or false.
continue_selling
No
true keeps selling at zero stock; false is the default.
requires_shipping
No
true (the default); false for digital products and services.
taxable
No
true (the default) or false.
stock
No
A whole number: the stock at the shop's first location (the lowest priority number).
stock:<location name>
No
One column per location, for example stock:Warehouse — Reno, with that location's stock. The location must exist.
image_url
No
On the product's first row: one or more https:// picture addresses separated by spaces. Each is downloaded once into the shop's storage. On another row: that variant's picture.
seo_title, seo_description
No
What search engines show; empty means the title and the start of the description.
A sample file
Two products: a mug in two colours, and a set of bowls without options. Download this sample and open it in any spreadsheet app.
handle,title,description,vendor,type,tags,status,option1_name,option1_value,sku,price,compare_at_price,weight_grams,stock,image_url
speckled-stoneware-mug,Speckled Stoneware Mug,"Wheel-thrown stoneware with a speckled glaze. Holds 350 ml.",Kilnhouse,Mug,"mug, stoneware",active,Colour,Oatmeal,KH-MUG-OAT,34.00,,420,24,https://example.com/images/mug-oatmeal.jpg
speckled-stoneware-mug,,,,,,,Colour,Fog,KH-MUG-FOG,34.00,,420,18,
nesting-bowls,Nesting Bowls,"Three bowls that stack into one.",Kilnhouse,Bowl,"bowl, set",active,,,KH-BWL-3,58.00,64.00,1350,9,
Columns you do not need can be left out. Products → Export writes the shop's products in the same columns, so an export can be edited and imported again.
Moving from Shopify, WooCommerce or Etsy
The import screen also reads the product file each of these platforms exports, unchanged. Pick the platform when you choose the file; Storewright maps its columns as the tables below show and ignores every other column. Imported products from Etsy and WooCommerce are saved as drafts unless the file says they are published, so the merchant can check them first.
Shopify (Products → Export → CSV for Excel or plain CSV)
track_stock (on when a tracker is named), stock at the first location, continue_selling (continue)
Variant Requires Shipping, Variant Taxable
requires_shipping, taxable
Image Src (in Image Position order), Variant Image
the product's pictures and each variant's picture
SEO Title, SEO Description
seo_title, seo_description
WooCommerce (Products → Export, all columns)
WooCommerce column
Becomes
Type
simple → a product without options; variable → a product whose variation rows (joined by Parent) are its variants. Grouped and external products are skipped.
Name
title, and the handle made from it
Description (or Short description when empty)
description
Published
1 → active, anything else → draft
Categories, Tags
tags (each category name becomes a tag, so a collection by rules can gather them)
SKU, Regular price, Sale price
sku; price is the sale price when there is one, and the regular price then becomes the compare-at price
Weight (kg)
weight_grams (× 1,000)
Stock, Backorders allowed?, Tax status
stock at the first location (track_stock on when a number is given), continue_selling, taxable (none → not taxable)
up to two options, with a variant for each combination
IMAGE1 … IMAGE10
the pictures
Etsy's file has no price, SKU or stock per variation, so every variant of an Etsy listing gets the listing's price and quantity: check them after the import. Etsy listings are imported as drafts.
Names
Shopify, WooCommerce and Etsy are trademarks of their owners. Storewright reads the files they let merchants export; it is not affiliated with them.
Products → Import: the preview with each row's errors before the import starts
Collections
A collection groups products for the storefront's menus and home sections (Mugs and Cups, Seconds Sale, New This Week). Products → Collections.
Hand-picked: the merchant adds and orders the products.
By rules: every product that matches all (or any) of the rules is in it, and new products join by themselves. Rules look at a product's tag, price, type or vendor (for example "tag is seconds" or "price is less than 20").
Each collection has a title, a description (with Write with AI), a picture, a sort order (best selling, price, newest, alphabetical, or by hand), SEO fields and whether it is visible on the storefront at /collections/<handle>.
A collection by rules: tag, price, type or vendor
Inventory and locations
A location is a place that holds stock: a studio, a warehouse, a shop. Settings → Locations lists them with a priority; the number of locations is a plan limit. Products → Inventory shows each variant's stock at each location.
Adjust a count (a delivery came in, a stock take) or transfer units between locations. Every change is written to the variant's history with who made it and why.
An order takes stock from the active locations in priority order: from the first location that has enough, line by line.
Stock never goes below zero. Placing an order takes each line's stock with one conditional database update ("take 2 where at least 2 are left"), inside the order's own transaction. If any line is short, the whole order is refused and the customer is told which item ran out; nothing is half-saved. Two customers buying the last mug at the same moment cannot both get it.
Variants with track stock off, or continue selling when out of stock on, skip this check.
An unpaid order that pays online holds its stock for 30 minutes. When the payment fails, or the time runs out and the gateway confirms there is no payment, the stock goes back on sale (see How money moves).
A refund can put items back into stock (restock), at the location the merchant picks.
Inventory: each variant's stock at each location, with adjust and transfer
Orders and fulfilment
Every order gets the shop's next number (#1001, #1002, …). Orders has tabs for Unfulfilled, Unpaid, Open and Archived, and a search by number, email or name.
Create order takes an order by phone or in person: pick the products and quantities, the customer, shipping or pickup at one of the shop's locations, and whether it is paid already. Stock and the order number work the same way as for a storefront order, and the timeline says which staff member made it.
An order's two statuses
Payment status
Meaning
pending
Waiting for payment: an online payment not confirmed yet (stock held for 30 minutes), or a bank transfer or cash on delivery not marked as received.
authorized
The gateway approved the payment but has not taken it yet.
paid
The money was taken.
partially_refunded, refunded
Some or all of the money went back.
voided
An approved payment was cancelled before it was taken.
expired
Not paid in time (the gateway was asked first and had no payment); its stock and its discount use went back.
The fulfilment status is unfulfilled, partial or fulfilled. An order can also be cancelled (an unpaid order gives back its stock and its discount use) or archived (moved out of the way once it is done).
The order page
The order's lines (with what each cost at the time of the order), payment, shipments, customer and addresses, a staff note that stays at the top of the order, and a timeline of everything that happened: placed, paid, emails sent, shipments, refunds, notes. Manual payments get a Mark as paid button; an unpaid online payment gets Check payment, which asks the gateway for the payment's real state (see Recovering missed webhooks). A payment the gateway took after the order had closed, or that does not cover the order, is never applied silently: it is written to the timeline for staff to refund or settle with the customer.
Fulfil
Press Fulfil, choose the location the items ship from, the items and quantities (all, or some of them for a partial shipment), and an optional carrier and tracking number. The customer gets a shipping email with the tracking link, unless the merchant unticks it. Digital items are delivered by their download link and need no shipment.
Orders: unfulfilled, unpaid, open and archivedFulfil: location, items, carrier and tracking
Refunds and returns
Refunds
On a paid order, Refund opens a sheet: the items and how many of each, whether to put them back into stock and where, shipping to refund, and the amount (worked out from the items, and changeable). The refund goes back through the gateway the customer paid with.
A refund can never pass what was paid. The amount is checked and set aside on the order in one locked step, together with each line's refunded quantity, so two refunds pressed at the same moment cannot both pass.
The gateway is asked once, with the key refund:<refund id>, so a retried request can never refund twice.
If the gateway refuses (for example the payment is too old), the refund is undone and the sheet says why: no money moved and no item went back into stock.
If the gateway does not answer, the refund stays pending; a background sweeper asks the gateway again after 10 minutes and settles it, or marks it needs review so the merchant can check it in the gateway's dashboard (see How money moves).
Manual payments (bank transfer, cash on delivery) are refunded by the merchant outside Storewright; the refund is recorded on the order.
Returns
A signed-in customer asks to return items from the order page in their account. The return moves through requested → approved → received → refunded, or declined, and the customer gets an email at each step. Staff can also open a return for a customer from the order page (for example after a phone call), approved straight away if they choose. A return can never ask for more items than were shipped and not yet refunded or returned. Orders → Returns lists them; Refund on a received return opens the refund sheet with its items filled in.
The refund sheet: items, restock, shipping and amountReturns and their status
Abandoned checkouts
A checkout where the customer typed an email but did not place the order within an hour is an abandoned checkout. Orders → Abandoned checkouts lists them with the cart and its value. Storewright sends one reminder email with a link back to the same cart; the merchant can also copy the link or send the reminder again by hand. A checkout that later becomes an order leaves the list.
Abandoned checkouts with their cart and reminder
Customers
A customer is made by their first order, by creating an account on the storefront, or by signing up to the newsletter. Customers belong to one shop. Customers → a customer shows their orders, total spent, addresses, tags, notes and whether they accept marketing emails. Customers can buy as guests or create an account (Settings → Checkout decides whether accounts are off, optional or required); an account shows past orders and returns and can reset its password by email. Customer accounts never reach the shop admin.
A customer: orders, total spent, addresses and notes
Discounts
Discounts → Add discount. A discount is a code the customer types (SUMMER10) or automatic (applied to every cart that qualifies). It takes off a percentage, a fixed amount, or gives free shipping, with optional limits: a minimum order, start and end dates, a total number of uses, and once per customer.
A percentage is worked out on the subtotal and rounded half up to the smallest coin. It is then shared across the lines in proportion to their totals, any rounding remainder going to the largest line, so the lines' discounts always add up to the order's. Example: a fixed $1.00 off three $10.00 lines is $0.34 + $0.33 + $0.33.
A fixed amount never takes off more than the lines it applies to. Free shipping sets the shipping rate to zero and nothing else.
Usage limits hold under load: a use is counted with one conditional update ("only while uses are below the limit"), and "once per customer" is a unique row per customer email, so a code cannot be used more often than allowed, even by orders placed at the same moment. A cancelled unpaid order gives its use back.
A discount code with its value, minimum, dates and limits
Shipping zones and rates
Settings → Shipping. A zone is a list of countries, each optionally narrowed to regions (states, provinces). Each zone has its rates:
Rate
When it applies
Flat
Always, for one price.
By weight
When the cart's weight is between a minimum and a maximum (in grams).
By price
When the cart's subtotal is between a minimum and a maximum.
Free over
Any rate can become free when the subtotal is over an amount.
Local pickup
Turned on per location, with pickup instructions; costs nothing.
At checkout, the most specific zone that matches the address is used (a zone naming the region wins over one naming only the country), and the customer picks one of its eligible rates; the cheapest is selected first. An address that no zone covers gets "We don't ship to this address". Carts with only digital items skip shipping.
Shipping zones with their flat, weight and price rates
Taxes
Settings → Taxes. Add a rate per destination country, optionally per region (for example 20% for the United Kingdom, 8.25% for Texas). Each line gets the rate of the address it ships to (or of the shop's country for local pickup and digital goods), only when its variant is taxable. Tax is worked out after discounts, line by line.
Setting
How tax is worked out
Example
Prices include tax (usual in Europe, the UK, Australia)
The price already holds the tax: tax = price − price ÷ (1 + rate), rounded per line. The total does not change; the receipt says "including … tax".
A €30.00 line at 20% holds €5.00 tax (30 − 30 ÷ 1.2); the customer pays €30.00.
Add tax at checkout (usual in the USA and Canada)
Tax is added on top: tax = line after discount × rate, rounded half up per line.
An $80.00 line with a 10% discount is $72.00; at 8.25% the tax is $5.94; the customer pays $77.94 plus shipping.
A switch adds tax to the shipping charge as well. The order total is: subtotal − discount + shipping + tax when tax is added at checkout, and subtotal − discount + shipping when prices include tax (the tax is then shown as included). Storewright works out the tax from the rates the merchant enters; it does not file returns or look rates up, so merchants should check the rates and rules that apply to them with their tax adviser.
Tax rates by country and region, and whether prices include tax
Payments (each shop's gateways)
Each shop takes its customers' money through its own accounts: the money goes straight to the merchant, never through you. Settings → Payments.
The merchant presses Connect on a gateway, pastes its keys, adds the shop's webhook address in the gateway's dashboard, and presses Test keys; a gateway is switched on only once its keys work. Keys are sealed with your APP_SECRET as soon as they are saved, each secret on its own; the screens show only whether each one is set and its last four characters. Each shop's webhook address is:
<APP_URL>/api/v1/webhooks/<gateway>/<shop id> for example https://store.example.com/api/v1/webhooks/stripe/9b1c…
The connect sheet shows the exact address with a copy button. Every notification is checked with that shop's keys only, so a gateway account can only ever settle orders of its own shop.
Stripe
Stripe's fees
Stripe is a third-party payment service with its own pricing, and the shop pays its fees on its own sales: in the USA 2.9% + 30¢ per successful card payment; other countries, cards and currencies have their own rates on Stripe's pricing page.
Keys: the Secret key from Developers → API keys, and the Signing secret of a webhook endpoint at the shop's address with the events checkout.session.completed, checkout.session.async_payment_succeeded, checkout.session.async_payment_failed, checkout.session.expired and charge.refunded. Customers pay on Stripe Checkout.
PayPal
PayPal's fees
PayPal is a third-party payment service with its own pricing, and the shop pays its fees per transaction, which depend on the country, the currency and the way the buyer pays; see PayPal's merchant fees.
Keys: a REST app's Client ID and Secret (PayPal Developer Dashboard → Apps & Credentials), and the Webhook ID of a webhook at the shop's address with CHECKOUT.ORDER.APPROVED, CHECKOUT.ORDER.VOIDED, PAYMENT.CAPTURE.COMPLETED, PAYMENT.CAPTURE.DECLINED, PAYMENT.CAPTURE.DENIED and PAYMENT.CAPTURE.REFUNDED. Storewright asks PayPal to verify each notification, and captures an approved order before marking it paid.
Razorpay
Razorpay's fees
Razorpay is a third-party payment service with its own pricing, and the shop pays its fees: about 2% per domestic payment in India, more for international cards and some payment methods; see Razorpay's pricing.
Keys: the Key ID and Key Secret (Account & Settings → API Keys), and the secret of a webhook at the shop's address with order.paid, payment.authorized, payment.captured, payment.failed, payment_link.paid, payment_link.expired, payment_link.cancelled and refund.processed. Notifications are checked with HMAC-SHA256.
Paystack
Paystack's fees
Paystack is a third-party payment service with its own pricing, and the shop pays its fees: in Nigeria, for example, 1.5% + ₦100 per local payment (the ₦100 is waived under ₦2,500, and the fee is capped), with other rates in Ghana, Kenya and South Africa; see Paystack's pricing.
Keys: the Secret Key (Settings → API Keys & Webhooks), with the shop's address as the Webhook URL on the same page. Paystack signs every notification with the secret key (HMAC-SHA512).
Mollie
Mollie's fees
Mollie is a third-party payment service with its own pricing, and the shop pays a fee per successful payment that depends on the payment method; see Mollie's pricing.
Keys: the API key (Developers → API keys). Nothing to set up for webhooks: each payment tells Mollie the shop's address, and Storewright fetches the payment from Mollie by its id before believing it.
Manual payments
Bank transfer and cash on delivery, each with the instructions the customer sees at checkout and on the order status page. The order stays pending (its stock reserved) until staff press Mark as paid. They cost nothing in Storewright; the merchant's bank sets its own charges.
Demo payments
Only when DEMO_PAYMENTS="true" or DEMO_MODE="true" is set on the server (a test copy or the public demo), a Demo payment option pays an order at once with no card, labelled "Demo payment (no card charged)". It does not exist on a normal install.
Settings → Payments: each gateway with its connect sheet and Test keys
Themes and the theme editor
Three themes come with Storewright, each with its own layout, type and feel, and every one supports every feature:
Atelier: editorial serif headings, airy spacing, warm neutrals. Made for crafts, ceramics, fashion and beauty.
Market: friendly rounded cards and warm colour. Made for plants, food, gifts and everyday goods.
Summit: bold, dark, condensed type and big pictures. Made for outdoor gear, sport, tech and tools.
Online store → Themes shows the current theme and the library, each with a preview on the shop's own products. The plan decides which themes a shop may publish.
The theme editor
Online store → Themes → Customise opens the editor full screen: the home page sections on the left (add, reorder, hide, delete), the live storefront in the middle with a desktop and phone switch, and the selected section's or the theme's settings on the right: logo, the five brand colours, heading and body fonts, and each section's words, pictures, collection and button. Changes are a draft that only staff see in the preview until Publish puts them live.
The home section types, available in every theme: banner (heading, text, button, picture), featured collection, collection list, image with text, rich text, testimonials, newsletter sign-up (adds customers who accept marketing) and questions and answers.
Online store → Themes: the current theme and the libraryThe theme editor with the phone previewAtelier: a product page with its variantsMarket: a collection pageSummit: a product pageThe order status page a customer sees after paying
Pages, blog and navigation
Pages (Online store → Pages): About, Shipping and returns, Contact, any page, at /pages/<handle>, with a rich text editor and SEO fields.
Blog (Online store → Blog): posts with a picture, an excerpt, tags, a publish date and Write with AI for a first draft, at /blog and /blog/<handle>.
Navigation (Online store → Navigation): the main menu and the footer menu, with links to collections, products, pages, posts or any address, nested one level for dropdowns.
The main and footer menus
SEO and redirects
Every product, collection, page and post has an SEO title and meta description (with Write with AI), filled from its own title and text when left empty, and a search preview.
Every storefront page has a canonical address, Open Graph tags for social sharing and structured data (JSON-LD) for search engines: the organisation, each product with its offer (or a price range for several variants), breadcrumbs and blog articles.
Each shop has its own /sitemap.xml and /robots.txt.
When a handle changes, a 301 redirect from the old address is added by itself. Online store → SEO lists every redirect and lets the merchant add their own (useful when moving from another shop system).
Online store → SEO: the redirects
Home and analytics
The shop's home shows today's sales and orders, the last 30 days, orders to fulfil, low stock and, for a new shop, a setup checklist (add products, connect a payment gateway, set up shipping, choose a theme, connect a domain). Analytics shows sales, orders, average order value, sessions, the conversion funnel (sessions → product views → add to cart → checkout started → orders), top products, top sources and returning customers, by day for any range.
The storefronts count visits with a tiny beacon that uses no cookies: a visitor is a hash of their address, browser and a salt that changes every day, never stored in plain form, so visitors cannot be followed from one day to the next. The counts are kept per shop and day.
Staff and roles
Settings → Staff: invite people by email with a role. The number of staff accounts is a plan limit. The server checks the role on every request; the screens only hide what a role cannot use.
Role
What it can do
Owner
Everything, including plan and billing, domains, staff, and closing the shop. One owner per shop; the owner can hand the shop to a manager.
Manager
Everything except plan and billing, staff, and closing the shop: products, orders, customers, discounts, settings, payments, themes, domains, API keys.
Staff
Products, collections, inventory, orders, customers and discounts. No settings, payments, domains, themes or API keys.
Storefront customers are not staff and never reach the shop admin. The platform's super-admins are not shop staff either; they can only open a shop as its owner for 30 minutes, which the shop's audit log records.
Settings → Staff: members, roles and open invitations
Notifications
Settings → Notifications previews every email the shop sends to its customers (order confirmation, shipping, delivery, refund, return updates, abandoned checkout reminder, account invitation and password reset) in the shop's own logo and colours, and lets the merchant turn the optional ones off. Staff choose which emails they get about new orders, returns and low stock. All emails go through the platform's SMTP settings (see Email).
Part 04
Domains and languages
Shop addresses and custom domains
Every shop answers at up to three addresses. Storewright looks at the address a visitor typed and finds the shop in this order:
The shop's own domain, once it is verified: trailmade.example or shop.trailmade.example.
A free subdomain of your platform: <handle>.<STORE_ROOT_DOMAIN>, for example kilnhouse.shops.example.com. Needs one wildcard DNS record.
The path address on your platform: <APP_URL>/s/<handle>, for example https://store.example.com/s/kilnhouse. It always works and needs no DNS at all, so it is what a new install, a test copy or a server without wildcard DNS uses.
Set up free subdomains (you, once)
Domain and DNS costs
Your server and your domain come from third-party providers with their own pricing, and you pay them: about $10 to $40 a month for a server with 2 cores and 4 GB of memory, and about $10 to $20 a year for a domain name. Shop owners pay for their own domains.
At your domain's DNS provider, add these records (replace 203.0.113.10 with your server's IP address and example.com with your domain):
Type
Name
Value
Why
A
store
203.0.113.10
Your platform: public site, sign-up, shop admin and platform admin (store.example.com).
A
*.shops
203.0.113.10
Every shop's free subdomain (kilnhouse.shops.example.com).
A
shops
203.0.113.10
The name shops' own domains point their CNAME record at.
Run docker compose --profile https up -d and wait until ping kilnhouse.shops.example.com shows your server's address. Without STORE_ROOT_DOMAIN, shops simply keep their path address.
Connect a shop's own domain (the merchant)
On plans with custom domains, the shop owner or a manager opens Online store → Domains, types the domain (shop.trailmade.example) and sees the exact records to add at their own DNS provider, with copy buttons:
Type
Name
Value
When
CNAME
shop (or www, or any subdomain)
your STORE_CNAME_TARGET, e.g. shops.example.com
For a subdomain: the usual choice.
A
@
your SERVER_IP
For a bare domain (trailmade.example), which cannot have a CNAME.
TXT
_storewright.shop (the full name is _storewright.shop.trailmade.example)
the token shown on the page
Always: it proves the domain belongs to this shop.
Then Check now. Storewright looks the records up and marks the domain verified only when it points at your server and the TXT token matches. A domain still pending is checked again by itself in the background every hour, so the merchant can come back later. Once verified, the first visit gets its HTTPS certificate (a few seconds) and the domain shows HTTPS ready.
One domain is the shop's primary address: its storefront links, canonical addresses and sitemap use it, and the shop's other addresses (its free subdomain, its path address and any other connected domain) send visitors there with a permanent redirect. A domain belongs to one shop at most; the number of domains is a plan limit.
Why the TXT record
Without the TXT proof, anyone could point a domain they do not own at your server and claim it for their shop. With it, only the domain's real owner can connect it, and your server only ever asks for certificates for names it really serves.
Online store → Domains: the free subdomain, a custom domain's DNS records and its status
Automatic HTTPS for every shop
With the bundled Caddy (recommended)
Start the stack with the https profile, with ports 80 and 443 open in your server's firewall:
docker compose --profile https up -d --build
Caddy gets and renews a free certificate for APP_DOMAIN at once, and for every other name on demand: the first time a visitor opens a shop's subdomain or its own domain, Caddy first asks Storewright whether that name may have a certificate:
GET http://app:8080/api/v1/tls/ask?domain=shop.trailmade.example
Storewright answers 200 only for your platform's own host, for the subdomain of a shop that exists and is not closed, and for a verified domain of such a shop; any other name gets 404 and no certificate. Nothing else is needed: no list to keep, no restart when a shop connects a domain.
Many new shops a week?
Let's Encrypt issues a limited number of new certificates per registered domain each week, and every shop subdomain counts toward your domain's allowance. Caddy turns to ZeroSSL by itself when that happens. A platform that opens hundreds of shops a week should use one wildcard certificate for *.shops.example.com instead, which needs your DNS provider's API (a Caddy build with that provider's DNS plugin); shops' own domains keep working on demand.
With Traefik you already run
Traefik cannot ask Storewright before each certificate, so Storewright writes the list of verified domains into a dynamic configuration file that Traefik's file provider watches. Set TRAEFIK_DOMAINS_FILE to a path in a folder both containers share; the app rewrites the file (through a temporary file, so Traefik never reads half of it) whenever a domain is verified or removed. It looks like this:
# Written by Storewright: the verified custom domains of its shops. The app rewrites it; do not edit.
http:
routers:
storewright-domain-0:
rule: "Host(`shop.trailmade.example`)"
entryPoints: [websecure]
service: storewright@docker
tls:
certResolver: letsencrypt
So your Traefik needs an entry point named websecure, a certificate resolver named letsencrypt (HTTP or TLS challenge), and the app's service named storewright through its Docker labels. Your platform's own host gets a router from the labels; shop subdomains need a wildcard certificate, which Let's Encrypt only gives through a DNS challenge (a second resolver, here letsencrypt-dns, set up for your DNS provider). A compose.override.yaml next to compose.yaml, which Docker Compose reads by itself:
# compose.override.yaml: Storewright behind a Traefik (v3) that runs in Docker
services:
app:
networks: [default, proxy] # default: the app's own database and storage
environment:
TRAEFIK_DOMAINS_FILE: /app/traefik/storewright-domains.yml
volumes:
- /opt/traefik/dynamic:/app/traefik # the folder Traefik's file provider watches
labels:
- traefik.enable=true
- traefik.docker.network=proxy
- traefik.http.services.storewright.loadbalancer.server.port=8080
- traefik.http.routers.storewright-app.rule=Host(`store.example.com`)
- traefik.http.routers.storewright-app.entrypoints=websecure
- traefik.http.routers.storewright-app.tls.certresolver=letsencrypt
- traefik.http.routers.storewright-app.service=storewright
- traefik.http.routers.storewright-shops.rule=HostRegexp(`^[a-z0-9-]+\.shops\.example\.com$`)
- traefik.http.routers.storewright-shops.entrypoints=websecure
- traefik.http.routers.storewright-shops.tls.certresolver=letsencrypt-dns
- traefik.http.routers.storewright-shops.tls.domains[0].main=shops.example.com
- traefik.http.routers.storewright-shops.tls.domains[0].sans=*.shops.example.com
- traefik.http.routers.storewright-shops.service=storewright
networks:
proxy:
external: true
name: proxy # your proxy's network, as docker network ls shows it
Give the shared folder to the app's user (sudo chown 10001 /opt/traefik/dynamic) and start Traefik's file provider on it (--providers.file.directory=/etc/traefik/dynamic --providers.file.watch=true, with the same host folder mounted there). Start Storewright without the https profile: docker compose up -d --build. On Traefik v2, write the subdomain rule as HostRegexp(`{sub:[a-z0-9-]+}.shops.example.com`).
With Nginx or Apache
They cannot get certificates on demand. Use them for your platform's host and a wildcard certificate for the shop subdomains, and let the bundled Caddy (or Traefik) serve shops' own domains; or put Caddy in front of everything. The proxy settings for your own proxy are in Deploy on a VPS.
Storefront and admin languages
Storewright speaks English, Spanish, French, German, Portuguese and Arabic.
Storefronts: each shop picks its storefront language in Settings → General. Every word that belongs to Storewright (buttons, the cart, checkout, the order status page, customer accounts, search, the 404 and "closed for now" pages, and the customer emails) is shown in that language. The merchant's own products, pages and posts are written in whatever language they choose; a shop has one storefront language.
Prices are written the way the language and the currency expect ($34.00, 34,00 €, ¥3,400), with the currency's own number of decimals: none for the yen, three for the Kuwaiti dinar, two for most others.
Arabic storefronts are written right to left: the page carries dir="rtl", and every theme mirrors its layout (menus, the cart drawer, arrows, checkout steps) with logical CSS, never with a separate copy.
The admin and the platform admin: each person picks a language in the account menu; the platform's default is set in Platform admin → Settings → Languages. Arabic mirrors these screens too.
Change a word or add a language
English is the source. Every visible string is written in English in the code, and each language has a catalogue that maps the English text to its own; a string missing from a catalogue shows in English.
Admin and platform: apps/frontend/src/i18n/<language>.json.
Storefronts and customer emails: themes/_i18n/<language>.json.
To change a word, edit its line in the catalogue. To add a language, copy es.json to a new file named with the language's code (for example it.json), translate the right-hand side of each line, add the code to the list of languages in the code, and rebuild (docker compose up -d --build). A test lists every string the code uses and fails when a catalogue lacks one, so nothing is missed.
A storefront in Arabic, laid out right to left
Part 05
For developers
REST API and API keys
The web app uses the same /api/v1 API as everyone else. Shops on plans with API access can call the shop resources (products, variants, collections, inventory, orders, fulfilments, refunds, customers, discounts) from their own code with an API key.
API keys
Settings → Developers → API keys → Create key: a name and its scopes, read (GET requests) and/or write (every other request). Owners and managers make keys.
The key (swk_…) is shown once. Storewright keeps only its SHA-256 hash and its first characters, so a lost key cannot be shown again: revoke it and make a new one. Revoking takes effect at once.
A key belongs to the shop, not to the person who made it, and acts at staff level: it never reaches settings, staff, billing or other owner and manager routes. It works only while the shop's plan has API access.
JSON in and out, with camelCase keys. Times are ISO 8601 in UTC. Money is a whole number in the currency's smallest unit (3400 is $34.00), with the currency code beside it.
Lists take ?page=1&size=50 and answer {rows, total, page, size}.
Errors answer {"error": {"code": "…", "message": "…", "details": {…}}}. A plan limit answers 402 plan_limit with details.limit set to one of products, staff, locations, customDomains, aiCredits, themes, storageMb, apiAccess or removeBranding, plus used and max. Stock that ran out answers 409 out_of_stock naming the item. A row of another shop answers 404, exactly like a row that does not exist.
Requests made with the web app's session cookie must carry the header x-storewright: 1 on every change (browsers cannot add it from another site); requests with an API key do not need it.
Calls are rate limited (see Security notes); a refused call answers 429 with a Retry-After header.
Every route
These 241 routes are generated from the server code when the release is built. "Any staff member, or an API key" means the route works with a session of any role and with an API key that has the scope named.
Method
Address
Who may call it
What it does
System
GET
/api/health
Anyone
The health check: 200 while the server is serving, 503 while a stopping copy hands over to a new one
GET
/api/app-version
Anyone
The running version: open pages compare it with their own and offer a reload after an update
GET
/robots.txt
Anyone
Tells search engines which pages of the app host they may index: the public pages, or none with SEARCH_INDEXING=off
GET
/files/{key}
Anyone
A public file
Install, public pages, HTTPS check and payment webhooks
GET
/api/v1/public/config
Anyone
The brand, sign-up mode, demo sign-ins and what the web app needs before sign-in
GET
/api/v1/public/plans
Anyone
The public plans for the pricing page
GET
/api/v1/public/legal/{slug}
Anyone
One legal page
GET
/api/v1/install/status
Anyone, until the install is done (install token)
Whether the install wizard has run
POST
/api/v1/install/check
Anyone, until the install is done (install token)
Checks the install token and the setup before the wizard's last step
POST
/api/v1/install/complete
Anyone, until the install is done (install token)
Finishes the install: the super-admin, brand and sample plans (runs once)
POST
/api/v1/webhooks/stripe
Stripe (signed webhook)
A Stripe webhook event (signature checked, applied once)
GET
/api/v1/tls/ask
The HTTPS proxy, before it gets a certificate
200 when a certificate may be made for the host (the app's host, a live shop's subdomain, a verified domain), else 404
POST
/api/v1/webhooks/{gateway}/{shop}
The payment gateway (checked per gateway)
Checks the notification with the shop's keys and applies it once
POST
/api/v1/webhooks/{gateway}
The payment gateway (checked per gateway)
Checks the notification with the platform's keys and applies it once
GET
/api/v1/public/shop-logo/{shop}/{file}
Anyone
A shop's logo or browser icon, with no sign-in (the storefront and emails show it; the name holds the file's hash), cached for a year
GET
/api/v1/public/exports/{ws}/{file}
Anyone with the signed link, for an hour
The export file, for an hour after it was made, to whoever holds the signed link (403 link_expired after that, 404 for a wrong signature)
GET
/api/v1/public/logo/{file}
Anyone
The uploaded brand logo (no sign-in; long cache, the name changes with the file)
Sign-in and account
POST
/api/v1/auth/register
Anyone
Creates an account and its first shop (when sign-ups are open), on the picked plan's free trial
POST
/api/v1/auth/login
Anyone
Signs in with email and password (wrong passwords count down, then the account waits)
POST
/api/v1/auth/logout
Signed in
Signs out of this browser
GET
/api/v1/auth/me
Signed in
The signed-in user, their shops, role and capabilities
GET
/api/v1/auth/session
Anyone
{ me } like /auth/me when signed in, { me: null } when not
POST
/api/v1/auth/switch-shop
Signed in
Makes another of the user's shops the current one
GET
/api/v1/auth/handle
Anyone
Whether a shop address is free, the host it gives, and a free one when not
POST
/api/v1/auth/shops
Signed in
Creates another shop owned by the user
POST
/api/v1/auth/forgot
Anyone
Emails a password reset link when the email belongs to an account
POST
/api/v1/auth/reset
Anyone
Sets a new password with a reset link and signs in (each link works once)
GET
/api/v1/auth/reset/{token}
Anyone
Whose link this is (404 when it expired or was used)
POST
/api/v1/auth/impersonation/exit
Signed in
Ends an "open as owner" session and goes back to the super-admin's own
GET
/api/v1/auth/invites/{token}
Anyone
What an invitation link is for (shop, role, email)
POST
/api/v1/auth/invites/accept
Anyone
Accepts an invitation, signing in or creating the account
PATCH
/api/v1/auth/profile
Signed in
Changes the user's name, picture or interface language (null = the platform's); answers the session (Me)
POST
/api/v1/auth/password
Signed in
Changes the password (the current one is asked for); other sessions end
POST
/api/v1/auth/demo
Anyone, public demo only
One-click demo sign-in as the shop owner, the manager, the staff member or the read-only platform owner (DEMO_MODE only)
The shop: settings, staff, files, export and live events
GET
/api/v1/shop/domains
Manager or owner
The shop's addresses
POST
/api/v1/shop/domains
Manager or owner
Connects a domain
POST
/api/v1/shop/domains/subdomain/primary
Manager or owner
Makes the free subdomain the primary address again
DELETE
/api/v1/shop/domains/{id}
Manager or owner
Removes a domain
POST
/api/v1/shop/domains/{id}/check
Manager or owner
Checks a domain's DNS now (429 when it was checked in the last 30 seconds)
POST
/api/v1/shop/domains/{id}/primary
Manager or owner
Makes a verified domain the primary address
GET
/api/v1/shop/payments
Manager or owner
The gateways, whether demo payments are allowed, and this month's paid orders by gateway
PUT
/api/v1/shop/payments/{gateway}
Manager or owner
Saves a gateway's keys, test mode, manual methods or customer text (new keys are locked on the public demo)
POST
/api/v1/shop/payments/{gateway}/test
Manager or owner
Tests a gateway's keys (a failed test is in lastTest, not an error)
POST
/api/v1/shop/payments/{gateway}/enable
Manager or owner
Switches a gateway on or off (409 gateway_not_ready until it is ready)
GET
/api/v1/shop/ai
Any staff member, or an API key with read
The AI page: { credits: { used, allowed, resetsAt }, uses, provider: { source, name, model }, ownKeyAllowed, available }
GET
/api/v1/shop/analytics/home
Any staff member, or an API key with read
The home page's data
GET
/api/v1/shop/analytics
Any staff member, or an API key with read
The analytics page's data for a range
PATCH
/api/v1/shop/checklist
Manager or owner
Hides or shows the setup checklist
GET
/api/v1/shop/notifications
Manager or owner
The emails and their settings
PUT
/api/v1/shop/notifications/{key}
Manager or owner
Saves one email's switch, words or recipients
GET
/api/v1/shop/notifications/{key}/preview
Manager or owner
The email as it would go out now
POST
/api/v1/shop/notifications/{key}/test
Manager or owner
Sends the preview to the signed-in person
GET
/api/v1/shop/onboarding
Manager or owner
The latest run, or null
POST
/api/v1/shop/onboarding
Manager or owner
Starts a run
DELETE
/api/v1/shop/onboarding/{id}
Manager or owner
Starts over: answers what was removed and what was kept
Makes a key: { id, kind, name, scopes, key, url? }, the key shown only in this answer
DELETE
/api/v1/shop/api-keys/{id}
Manager or owner
Revokes a key at once
GET
/api/v1/shop/counts
Any staff member, or an API key with read
The sidebar's counts
GET
/api/v1/notifications
Any staff member, or an API key with read
The newest notifications
POST
/api/v1/notifications/read-all
Any staff member, or an API key with write
Marks every notification read
GET
/api/v1/shop/shipping
Manager or owner
The whole settings
PATCH
/api/v1/shop/shipping
Manager or owner
Saves whether orders may be split across locations
POST
/api/v1/shop/shipping/zones
Manager or owner
Adds a shipping zone
PUT
/api/v1/shop/shipping/zones/{id}
Manager or owner
Saves a shipping zone
DELETE
/api/v1/shop/shipping/zones/{id}
Manager or owner
Deletes a shipping zone
GET
/api/v1/shop
Any staff member, or an API key with read
The current shop
PATCH
/api/v1/shop
Manager or owner
Changes the fields sent of the shop's settings — name, contact email, phone, legal name, address, country, currency (only while there are no orders: 409 currency_locked), time zone, language, weight unit, order prefix, tax switches, open/closed with its message, password protection and the storefront password
DELETE
/api/v1/shop
Shop owner
Closes the shop
POST
/api/v1/shop/logo
Manager or owner
The shop's logo (multipart file: PNG, JPEG or WebP up to 1 MB)
DELETE
/api/v1/shop/logo
Manager or owner
Removes the shop's logo
POST
/api/v1/shop/icon
Manager or owner
The storefront's browser icon (multipart file: PNG, JPEG or WebP up to 1 MB)
DELETE
/api/v1/shop/icon
Manager or owner
Removes the browser icon
GET
/api/v1/notifications/preferences
Any staff member, or an API key with read
My email choices in this shop
PUT
/api/v1/notifications/preferences
Any staff member, or an API key with write
Saves my choices (any part of { orders: { email }, billing })
GET
/api/v1/staff
Any staff member, or an API key with read
The shop's people, owners first, then the open invitations; staff see only the owners and managers
POST
/api/v1/staff/invites
Shop owner
Invites someone as manager or staff
POST
/api/v1/staff/invites/{id}/resend
Shop owner
Sends an invitation again with a new seven-day link
DELETE
/api/v1/staff/invites/{id}
Shop owner
Withdraws an invitation
PATCH
/api/v1/staff/members/{id}
Shop owner
Changes a member's role (the last owner stays)
DELETE
/api/v1/staff/members/{id}
Shop owner
Removes a member (never the last owner); their sessions leave the shop
POST
/api/v1/staff/access-requests
Any staff member, or an API key with write
Emails the shop's owners that this person asked for access to a page
GET
/api/v1/shop/taxes
Manager or owner
The tax settings
POST
/api/v1/shop/taxes/rates
Manager or owner
Adds a tax rate
PUT
/api/v1/shop/taxes/rates/{id}
Manager or owner
Saves a tax rate
DELETE
/api/v1/shop/taxes/rates/{id}
Manager or owner
Deletes a tax rate
GET
/api/v1/shop/checkout
Manager or owner
The checkout settings
PUT
/api/v1/shop/checkout
Manager or owner
Saves the checkout settings
GET
/api/v1/shop/themes
Manager or owner
The theme library
GET
/api/v1/shop/themes/{theme}
Manager or owner
One theme for the editor
PUT
/api/v1/shop/themes/{theme}/draft
Manager or owner
Saves the draft
POST
/api/v1/shop/themes/{theme}/publish
Manager or owner
Publishes the draft
POST
/api/v1/shop/themes/{theme}/discard
Manager or owner
Throws the draft away
POST
/api/v1/shop/themes/{theme}/preview
Manager or owner
Answers { url } for the theme editor's preview
GET
/api/v1/shop/webhooks
Manager or owner
The endpoints and the events they can choose
POST
/api/v1/shop/webhooks
Manager or owner
Adds an endpoint: { endpoint, secret }, the secret in full (402 without API access, 409 at 20 endpoints)
PATCH
/api/v1/shop/webhooks/{id}
The payment gateway (checked per gateway)
Changes an endpoint
DELETE
/api/v1/shop/webhooks/{id}
The payment gateway (checked per gateway)
Deletes an endpoint
GET
/api/v1/shop/webhooks/{id}/secret
The payment gateway (checked per gateway)
The endpoint's signing secret (not while a platform admin works as the owner, nor on the public demo)
GET
/api/v1/shop/webhooks/{id}/deliveries
The payment gateway (checked per gateway)
The endpoint's newest deliveries
POST
/api/v1/shop/webhooks/deliveries/{id}/resend
The payment gateway (checked per gateway)
Sends a delivery again now
POST
/api/v1/shop/export
Shop owner
Makes the file and answers { url, expiresAt, fileName, sizeBytes, format }; the link works for an hour
GET
/api/v1/events
Any staff member, or an API key with read
The live stream (Server-Sent Events) for the current shop: new orders, stock changes and job progress, with a ping every 25 seconds
POST
/api/v1/media
Any staff member, or an API key with write
Uploads a file (multipart file: a picture, PDF, CSV or text file up to 10 MB)
GET
/api/v1/media/{id}
Any staff member, or an API key with read
A shop file, to members of that shop only
Products, variants, collections and imports
GET
/api/v1/products
Any staff member, or an API key with read
One page of the product list
POST
/api/v1/products
Any staff member, or an API key with write
Makes a product (402 products at the plan's limit)
POST
/api/v1/products/bulk
Any staff member, or an API key with write
A bulk change: { updated }
POST
/api/v1/products/media
Any staff member, or an API key with write
A product photo (counted in the shop's storage): { id, url, alt }
POST
/api/v1/products/import
Any staff member, or an API key with write
Checks a product file, and imports it unless preview is 1 or true
GET
/api/v1/products/export
Any staff member, or an API key with read
The shop's products (the list's tab and words) as a CSV download
GET
/api/v1/products/{id}
Any staff member, or an API key with read
One product as the editor shows it
PATCH
/api/v1/products/{id}
Any staff member, or an API key with write
Saves the editor's whole product
DELETE
/api/v1/products/{id}
Any staff member, or an API key with write
Deletes a product
POST
/api/v1/products/{id}/duplicate
Any staff member, or an API key with write
Copies a product as a draft
GET
/api/v1/collections
Any staff member, or an API key with read
Every collection of the shop, by title
POST
/api/v1/collections
Any staff member, or an API key with write
Makes a collection
POST
/api/v1/collections/preview
Any staff member, or an API key with write
The products a rule gives now (the first 50) and how many: { count, products }
GET
/api/v1/collections/{id}
Any staff member, or an API key with read
One collection
PATCH
/api/v1/collections/{id}
Any staff member, or an API key with write
Saves a collection
DELETE
/api/v1/collections/{id}
Any staff member, or an API key with write
Deletes a collection
Inventory and locations
GET
/api/v1/inventory
Any staff member, or an API key with read
One page of counted variants
POST
/api/v1/inventory/adjust
Any staff member, or an API key with write
Adds, removes or counts one stock level
POST
/api/v1/inventory/transfers
Any staff member, or an API key with write
Sends stock from one location to another
POST
/api/v1/inventory/transfers/{id}/receive
Any staff member, or an API key with write
Receives a transfer at its location
GET
/api/v1/inventory/history
Any staff member, or an API key with read
The latest stock changes
GET
/api/v1/inventory/export
Any staff member, or an API key with read
The stock as a CSV download
GET
/api/v1/locations
Any staff member, or an API key with read
The shop's locations, in the order orders take stock
POST
/api/v1/locations
Manager or owner
Adds a location
PUT
/api/v1/locations/order
Manager or owner
Sets the order locations fill orders in
PUT
/api/v1/locations/{id}
Manager or owner
Saves a location
DELETE
/api/v1/locations/{id}
Manager or owner
Deletes a location without stock
Orders, fulfilments, refunds, returns and abandoned checkouts
GET
/api/v1/orders
Any staff member, or an API key with read
One page of the order list
POST
/api/v1/orders
Any staff member, or an API key with write
Takes an order for the shop (by phone or in person): priced like a storefront order (catalogue prices, the shop's shipping, tax and automatic discounts), stock taken at once
GET
/api/v1/orders/export
Any staff member, or an API key with read
The list's orders as a CSV download
GET
/api/v1/orders/{id}
Any staff member, or an API key with read
One order in full
POST
/api/v1/orders/{id}/notes
Any staff member, or an API key with write
Adds a team note to the order's timeline and answers it
PUT
/api/v1/orders/{id}/note
Any staff member, or an API key with write
Replaces the order's standing note (the one shown beside the order; empty clears it) and answers the order
POST
/api/v1/orders/{id}/fulfilments
Any staff member, or an API key with write
Records a shipment and answers the order
POST
/api/v1/orders/{id}/refunds/preview
Any staff member, or an API key with write
What a refund would give back
POST
/api/v1/orders/{id}/refunds
Any staff member, or an API key with write
Refunds items and shipping through the order's gateway (the Idempotency-Key header makes a retry safe) and answers the order; a received return on the order becomes refunded
POST
/api/v1/orders/{id}/mark-paid
Any staff member, or an API key with write
Records the payment of a manual order still waiting for it (409 not_pending otherwise)
POST
/api/v1/orders/{id}/check-payment
Any staff member, or an API key with write
Asks the order's gateway where its payment stands
POST
/api/v1/orders/{id}/cancel
Any staff member, or an API key with write
Cancels an order nothing has been sent from (its stock and discount use go back) and answers it
POST
/api/v1/orders/{id}/archive
Any staff member, or an API key with write
Archives an order
POST
/api/v1/orders/{id}/unarchive
Any staff member, or an API key with write
Brings an archived order back
POST
/api/v1/orders/{id}/resend-email
Any staff member, or an API key with write
Sends the order's confirmation to the customer again, now: { ok, to } (409 no_email without an address)
GET
/api/v1/returns
Any staff member, or an API key with read
Returns by status
POST
/api/v1/returns
Any staff member, or an API key with write
Opens a return on an order for the shop (the customer phoned or wrote); answers the return
POST
/api/v1/returns/{id}/{action}
Any staff member, or an API key with write
approve, decline, receive or replace a return; answers it
Customers
GET
/api/v1/customers
Any staff member, or an API key with read
One page of customers
POST
/api/v1/customers
Any staff member, or an API key with write
Adds a customer by hand
GET
/api/v1/customers/export
Any staff member, or an API key with read
The customers of a tab as a CSV download
POST
/api/v1/customers/import
Any staff member, or an API key with write
Checks a customers file, and imports it unless preview is 1 or true
GET
/api/v1/customers/{id}
Any staff member, or an API key with read
One customer in full
PATCH
/api/v1/customers/{id}
Any staff member, or an API key with write
Saves the fields sent
POST
/api/v1/customers/{id}/invite
Any staff member, or an API key with write
Emails the customer an account invite
GET
/api/v1/customers/{id}/data
Any staff member, or an API key with read
Everything the shop holds about the customer, as one JSON file to send them
POST
/api/v1/customers/{id}/erase
Manager or owner
Erases the customer's personal data (manager or owner, a person, not on the public demo); the audit log keeps who
POST
/api/v1/customers/{id}/addresses
Any staff member, or an API key with write
Saves an address for the customer
DELETE
/api/v1/customers/{id}/addresses/{address}
Any staff member, or an API key with write
Removes one of the customer's addresses
Discounts
GET
/api/v1/discounts
Any staff member, or an API key with read
The discounts in a tab matching the words
POST
/api/v1/discounts
Any staff member, or an API key with write
Adds a discount (201)
GET
/api/v1/discounts/export
Any staff member, or an API key with read
The discounts in a tab matching the words, as a CSV download
GET
/api/v1/discounts/{id}
Any staff member, or an API key with read
One discount
PUT
/api/v1/discounts/{id}
Any staff member, or an API key with write
Saves a discount
DELETE
/api/v1/discounts/{id}
Any staff member, or an API key with write
Deletes a discount; orders that used it keep it
Online store: themes, pages, blog, navigation, SEO and domains
GET
/api/v1/pages
Manager or owner
The shop's pages
POST
/api/v1/pages
Manager or owner
Adds a page
GET
/api/v1/pages/{id}
Manager or owner
One page
PUT
/api/v1/pages/{id}
Manager or owner
Saves a page
DELETE
/api/v1/pages/{id}
Manager or owner
Deletes a page
GET
/api/v1/menus
Manager or owner
The shop's menus
POST
/api/v1/menus
Manager or owner
Adds a menu
GET
/api/v1/menus/{id}
Manager or owner
One menu
PUT
/api/v1/menus/{id}
Manager or owner
Saves a menu's title and items
DELETE
/api/v1/menus/{id}
Manager or owner
Deletes a menu
GET
/api/v1/redirects
Manager or owner
One page of redirects
POST
/api/v1/redirects
Manager or owner
Adds a redirect
POST
/api/v1/redirects/import
Manager or owner
Adds the redirects of a CSV upload (multipart file, from,to per line)
DELETE
/api/v1/redirects/{id}
Manager or owner
Deletes a redirect
AI writing and keys
POST
/api/v1/ai/write
Any staff member, or an API key with write
Writes the text and answers it with the month's credits after
GET
/api/v1/provider-keys
Manager or owner
The shop's own keys, hints only
POST
/api/v1/provider-keys
Manager or owner
Adds a shop key (plans with own keys only: 402 plan_limit (ownAiKey) otherwise; 409 key_exists for a second key of a provider)
PATCH
/api/v1/provider-keys/{id}
Manager or owner
Changes a shop key
DELETE
/api/v1/provider-keys/{id}
Manager or owner
Removes a shop key
POST
/api/v1/provider-keys/{id}/test
Manager or owner
Tests a shop key
Plan and billing
GET
/api/v1/billing
Shop owner
The plan, subscription, usage, invoices and card on file
GET
/api/v1/billing/plans
Shop owner
The plans a shop can pick
POST
/api/v1/billing/checkout
Shop owner
Starts a plan change (Stripe Checkout link, test checkout, or a switch to a free plan)
POST
/api/v1/billing/portal
Shop owner
A Stripe customer portal link (owner only)
POST
/api/v1/billing/cancel
Shop owner
Cancels the paid plan at the end of the period (owner only)
Platform (super-admin)
GET
/api/v1/admin/overview
Super-admin (the read-only login reads)
The platform dashboard: recurring revenue, shops (new, trials, past due), every shop's sales this month and last in the platform currency (at the stored exchange rates, the best sellers, sign-ups per week, plans and themes, the newest shops, AI credits and what needs attention
GET
/api/v1/admin/shops
Super-admin (the read-only login reads)
The shop list (search, status and plan filters, sorting, paging)
POST
/api/v1/admin/shops
Super-admin
Opens a shop for someone on a plan (its free trial starts as on sign-up); the owner gets an invitation to set a password
GET
/api/v1/admin/shops/export
Super-admin (the read-only login reads)
The shop list as CSV (every page)
GET
/api/v1/admin/shops/{id}
Super-admin (the read-only login reads)
One shop
PATCH
/api/v1/admin/shops/{id}
Super-admin
Changes a shop's plan or suspends it (emailing the owners) and restores it (back to its trial while that runs, else active)
DELETE
/api/v1/admin/shops/{id}
Super-admin
Closes a shop after cancelling its paid subscription; the data is purged 30 days later
POST
/api/v1/admin/shops/{id}/impersonate
Super-admin
"Open as owner": a 30-minute session as the shop's owner
GET
/api/v1/admin/users
Super-admin (the read-only login reads)
The user list (search, platform role, status)
PATCH
/api/v1/admin/users/{id}
Super-admin
Changes a user's platform role or status
POST
/api/v1/admin/users/{id}/password-reset
Super-admin
Emails the person a link to choose a new password (valid an hour)
GET
/api/v1/admin/plans
Super-admin (the read-only login reads)
Every plan, archived ones too
POST
/api/v1/admin/plans
Super-admin
Adds a plan
POST
/api/v1/admin/plans/check-price
Super-admin
The "Found in Stripe" badge: reads a price id from Stripe
PATCH
/api/v1/admin/plans/{id}
Super-admin
Changes a plan (prices, Stripe ids, limits, features)
DELETE
/api/v1/admin/plans/{id}
Super-admin
Takes a plan off sale; its subscribers keep it
POST
/api/v1/admin/plans/{id}/restore
Super-admin
Puts an archived plan back on sale
GET
/api/v1/admin/payments
Super-admin (the read-only login reads)
The plan invoices (tabs, search, paging) with the counts per tab and this month's totals: collected, outstanding (open and past due) and renewing in the next 30 days (in the platform currency)
GET
/api/v1/admin/payments/export
Super-admin (the read-only login reads)
The invoices of a tab as CSV
GET
/api/v1/admin/subscriptions
Super-admin (the read-only login reads)
Every subscription (filters, paging)
GET
/api/v1/admin/settings
Super-admin (the read-only login reads)
The platform settings (secrets masked), server facts and storage stats
POST
/api/v1/admin/settings/branding/logo
Super-admin
The brand logo (PNG, SVG or WebP up to 1 MB, checked by content), served publicly as the logo and favicon
PUT
/api/v1/admin/settings/{section}
Super-admin
Saves one settings section (secrets are sealed; an empty secret keeps .env)
GET
/api/v1/admin/emails
Super-admin (the read-only login reads)
The platform emails with their built-in and saved wording, for the email editor
GET
/api/v1/admin/setup-check
Super-admin (the read-only login reads)
The setup check rows
POST
/api/v1/admin/setup-check/{id}/test
Super-admin
Tests one setup check row against the real service
GET
/api/v1/admin/jobs
Super-admin (the read-only login reads)
Background jobs (status and kind filters) with counts per status
POST
/api/v1/admin/jobs/{id}/retry
Super-admin
Queues a failed job again
POST
/api/v1/admin/demo-data/remove
Super-admin
Removes the demo data (demo-marked rows only)
GET
/api/v1/admin/provider-keys
Super-admin (the read-only login reads)
The platform's keys, which .env keys are set, and demo mode
POST
/api/v1/admin/provider-keys
Super-admin
Adds a platform key
PATCH
/api/v1/admin/provider-keys/{id}
Super-admin
Changes a platform key
DELETE
/api/v1/admin/provider-keys/{id}
Super-admin
Removes a platform key
POST
/api/v1/admin/provider-keys/{id}/test
Super-admin
Tests a platform key
Storefront (the shop's pages and the storefront script)
GET
/s/{handle}/files/{key}
Storefront visitors
A public file of that shop, on the path form of its storefront
Other
GET
/api/v1/abandoned-checkouts
Any staff member, or an API key with read
The last 30 days' abandoned checkouts
GET
/api/v1/blog-posts
Manager or owner
The shop's posts in a tab
POST
/api/v1/blog-posts
Manager or owner
Adds a post
GET
/api/v1/blog-posts/{id}
Manager or owner
One post
PUT
/api/v1/blog-posts/{id}
Manager or owner
Saves a post
DELETE
/api/v1/blog-posts/{id}
Manager or owner
Deletes a post
GET
/api/v1/search
Any staff member, or an API key with read
What the header search finds
Outgoing webhooks
A shop can send its events to its own systems (a warehouse, an accounting tool, an automation service). Settings → Developers → Webhooks → Add endpoint: an https:// address and the events it wants (none chosen = every event). Each endpoint gets a signing secret, shown in the sheet. A shop may have up to 20 endpoints; they need the plan's API access.
The events
Event
Sent when
order.created
A customer placed an order (paid or not yet paid), or staff created one.
order.paid
An order's payment was confirmed by the gateway, or staff marked a manual payment as received.
order.cancelled
An order was cancelled, or an unpaid order expired.
order.refunded
A refund was settled (part or all of the order).
order.fulfilled
Items of an order were marked as shipped or picked up.
product.created
A product was added (by hand, by import, by AI onboarding, through the API or MCP).
product.updated
A product or one of its variants changed.
product.deleted
A product was deleted.
customer.created
A new customer: an account, a first order or a newsletter sign-up.
customer.updated
A customer's details, addresses or tags changed.
inventory.updated
The stock of a variant at a location changed.
What arrives
A POST with a JSON body and these headers:
Storewright-Signature: t=1764500000,v1=5f1c… (HMAC-SHA256, see below)
Storewright-Event: order.paid
Storewright-Event-Id: 7c0e… (the same for every try of this event)
Storewright-Delivery: 41a2… (one per endpoint and event)
{"id": "7c0e…", "type": "order.paid", "shopId": "9b1c…", "createdAt": "2026-11-30T14:02:11Z", "data": { … }}
Answer with any 2xx status within 10 seconds. The same event can arrive more than once (after a timeout, or when staff press Resend), so use Storewright-Event-Id to do each event's work once.
Check the signature (Node.js)
The signature is an HMAC-SHA256, with the endpoint's secret, of the time, a dot and the raw body exactly as it arrived. Check it before you trust anything in the body, and refuse old times so a captured request cannot be sent again later:
import crypto from "node:crypto";
import express from "express";
const SECRET = process.env.STOREWRIGHT_WEBHOOK_SECRET; // from Settings → Developers → Webhooks
const app = express();
// The raw body is needed: parsing and re-serialising the JSON would change the bytes.
app.post("/storewright", express.raw({ type: "application/json" }), (req, res) => {
const header = req.get("Storewright-Signature") ?? "";
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const t = Number(parts.t);
const expected = crypto.createHmac("sha256", SECRET).update(`${t}.${req.body}`).digest("hex");
const given = Buffer.from(parts.v1 ?? "", "hex");
const ok =
given.length === 32 &&
crypto.timingSafeEqual(given, Buffer.from(expected, "hex")) &&
Math.abs(Date.now() / 1000 - t) < 300;
if (!ok) return res.status(400).send("bad signature");
const event = JSON.parse(req.body);
// Do the work once per event.id, then answer quickly.
res.sendStatus(204);
});
app.listen(3000);
Retries and the deliveries log
A delivery that fails (no answer within 10 seconds, or an answer other than 2xx) is tried again 5 times, after waits of 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours. After the last try it stays failed in the deliveries log, where staff can send it again. Each delivery is claimed by one background worker, so several workers or servers never send it twice at once. The endpoint's Deliveries list shows every try with its answer, and Resend sends any delivery again.
Settings → Developers: API keys, webhook endpoints with their deliveries, and the MCP connection
MCP server for AI assistants
Storewright includes an MCP server (Model Context Protocol), so a merchant can ask an AI assistant such as Claude or ChatGPT about the shop and let it do work: "which mugs are low on stock?", "set the stock of KH-MUG-FOG to 40", "fulfil order #1042 with this tracking number". It needs the plan's API access.
Address: POST <APP_URL>/mcp, Streamable HTTP with JSON-RPC 2.0 (initialize, tools/list, tools/call). initialize returns a session in the Mcp-Session-Id header; DELETE /mcp ends it.
Sign-in, two ways: a shop API key in the Authorization: Bearer swk_… header, or a connector URL (<APP_URL>/mcp/u/<token>) for apps that cannot send a header. Settings → Developers → MCP makes a connector URL: a separate key that works only for MCP, is shown once and can be revoked at any time. Treat the whole URL like a password.
The key's scopes decide what the assistant may do: read tools need any scope, write tools need the write scope. Every call acts in the key's own shop only. Failures come back as a plain message the assistant can read.
The tools
Tool
Scope
What it does
search_products
read
Find products in the shop by words, status or collection. Returns a page of products with prices and stock; pass next_cursor to get the next page.
get_product
read
Get one product by id or handle, with its options, variants (prices, SKUs, stock), images and collections.
create_product
write
Create a product. Give price for a product without options, or options and variants. New products are drafts unless status is active.
update_product
write
Change a product's title, description, vendor, type, tags, status, SEO fields, or its variants' prices and SKUs. Only the given fields change.
set_inventory
write
Set the number of units in stock for one variant, found by variant id or SKU. The quantity replaces the current count.
list_orders
read
List orders, newest first, filtered by status, dates or a search for number, email or name.
get_order
read
Get one order by id or number, with its lines, totals, address and shipments.
fulfil_order
write
Mark an order (or some of its lines) as shipped, with optional carrier and tracking, and email the customer unless notify_customer is false.
sales_summary
read
Sales totals for a date range: orders, gross and net sales, discounts, refunds, shipping, tax, average order value, best sellers and a series by day, week or month.
Claude Desktop
Make an API key (read, or read and write) and add Storewright to Claude Desktop's configuration file (Claude Desktop → Settings → Developer → Edit Config). mcp-remote connects Claude Desktop to a remote MCP server and sends the key as a header; it needs Node.js on the merchant's computer.
Restart Claude Desktop; the Storewright tools appear in the tools menu. Claude asks before it runs a tool. A connector URL also works in Claude's Settings → Connectors → Add custom connector, with no header needed.
ChatGPT
ChatGPT's custom connectors take an address, not a header, so they use a connector URL. ChatGPT and Claude are third-party apps with their own plans and pricing, which the merchant pays; Storewright charges nothing for MCP use and it does not use the shop's AI credits.
In Storewright, Settings → Developers → MCP → Create connector URL, choose read or read and write, and copy the URL (it is shown once).
In ChatGPT, open Settings → Apps & Connectors → Advanced settings and turn on Developer mode (offered on ChatGPT's paid plans).
Back in Apps & Connectors, press Create, give it a name (your shop's name), paste the connector URL as the MCP server URL, choose No authentication (the URL carries the key), and confirm that you trust it.
In a chat, turn the connector on from the tools menu and ask about the shop. ChatGPT asks before it runs a tool that changes something.
The OpenAI API (your own code)
The OpenAI Responses API calls remote MCP servers itself and can send the key as a header. OpenAI is a third-party AI service with its own pricing: whoever owns the OpenAI key pays OpenAI for these requests, and they do not use the shop's AI credits.
import OpenAI from "openai";
const openai = new OpenAI();
const answer = await openai.responses.create({
model: "gpt-5-mini",
tools: [{
type: "mcp",
server_label: "storewright",
server_url: "https://store.example.com/mcp",
headers: { Authorization: `Bearer ${process.env.STOREWRIGHT_KEY}` },
require_approval: "always"
}],
input: "Which products have fewer than 5 in stock?"
});
console.log(answer.output_text);
AI assistants make mistakes
An assistant can misread a request. Give it a read key unless it really needs to change things, keep approval on for tools that write, and check what it did. The AI service's own costs are paid by whoever owns that AI account (the merchant, for their own ChatGPT or Claude plan or API key).
Every key, explained
Every setting in .env. The outside-service keys can also be set in the platform admin, which takes precedence. This table is generated from .env.example and the server's own settings code when the release is built.
Key
Required
What it does
Required
APP_URL
Yes
The public address of the app, without a trailing slash, for example https://store.example.com. Links in emails, the Stripe webhook address, the path form of every shop (<APP_URL>/s/<handle>) and secure cookies come from it. Use https on a public server.
APP_SECRET
Yes
A long random string of at least 32 characters (openssl rand -hex 32). It seals every key you and your shops save (payment gateway keys, AI keys, platform secrets), signs export links, and keys the hashed visitor addresses of the rate limits and the analytics. Never change it after the install: saved keys could no longer be read.
POSTGRES_DB
No
The name of the database the stack creates. Default storewright.
POSTGRES_USER
No
The database user the stack creates. Default storewright.
POSTGRES_PASSWORD
Yes
The database password. Letters and digits only, because it goes into a connection address. Docker refuses to start without it. Change the example value: it is public.
DATABASE_URL
Outside Docker
The database address, only when you run the server without Docker, for example postgres://storewright:password@localhost:5432/storewright. Leave it empty with Docker: the stack builds its own from the three keys above.
INSTALL_TOKEN
No
The token the install wizard asks for. Empty: a new one is printed in the app's log at every start until the install is finished (docker compose logs app | grep -i "install token").
File storage (product images, shop logos, digital downloads, the brand logo)
STORAGE_DRIVER
No
s3 (the bundled MinIO, AWS S3, Cloudflare R2 or any S3-compatible store) or local (files in a Docker volume). Default in Docker s3.
S3_ENDPOINT
With s3
The storage address. The bundled MinIO is http://minio:9000; for R2 use your account's S3 address; for AWS S3 leave it empty.
S3_REGION
No
The bucket's region. Default us-east-1; R2 uses auto.
S3_BUCKET
No
The bucket name. Default storewright; the stack creates it in MinIO.
S3_ACCESS_KEY_ID
With s3
The storage access key. With the bundled MinIO this is also its admin user.
S3_SECRET_ACCESS_KEY
Yes
The storage secret, at least 8 characters. With the bundled MinIO this is also its admin password, so Docker refuses to start without it. Change the example value: it is public.
Payments (Stripe; empty = paid plans off)
STRIPE_SECRET_KEY
For Stripe billing
Your Stripe secret key (sk_live_…, or sk_test_… while testing), from Stripe → Developers → API keys, for selling plans to shops with Stripe subscriptions. It can also be saved in Platform admin → Billing. Empty, and no other billing gateway set up: paid plans are off (shops stay on their free trial). Shops connect their own Stripe account for their own checkout; this key is only for your plans.
STRIPE_WEBHOOK_SECRET
For Stripe billing
The signing secret (whsec_…) of your Stripe webhook endpoint <APP_URL>/api/v1/webhooks/stripe. Without it, plans paid through Stripe never switch on.
STRIPE_PUBLISHABLE_KEY
No
Your Stripe publishable key (pk_…). Shown next to the secret key in the platform admin, so you can see which Stripe account is in use.
DEMO_PAYMENTS
No
"true" turns on demo payments: a plan change and a shop's checkout complete without any card or real money, labelled "Demo payment (no card charged)". Only for a test copy. It is "false" in the shipped file: keep it that way on a live site.
Email (SMTP; empty = emails are written to the app's log)
SMTP_HOST
For email
Your email provider's SMTP server. Empty: every email (order confirmations, shipping notices, password resets, staff invites, renewal invoices) is written to the app's log instead of being sent.
SMTP_PORT
No
The SMTP port. Default 587.
SMTP_USERNAME
For email
The SMTP user name.
SMTP_PASSWORD
For email
The SMTP password or API key.
SMTP_SECURE
No
starttls (port 587, the default), tls (port 465) or none.
SMTP_FROM
For email
The sender, for example Your Platform <orders@example.com>. Use an address on a domain your provider has verified. Shop emails go out with the shop's name and its own reply-to address.
AI providers (optional)
OPENAI_API_KEY
No
The platform's OpenAI key (sk-…, from platform.openai.com → API keys) for AI onboarding and the AI writers. A key saved in Platform admin → Settings → AI takes its place. OpenAI bills you for every request; each plan's AI credits cap what a shop uses.
ANTHROPIC_API_KEY
No
The platform's Anthropic (Claude) key (sk-ant-…, from console.anthropic.com → API keys). Used the same way as the OpenAI key.
GEMINI_API_KEY
No
The platform's Google Gemini key (AIza…, from Google AI Studio → Get API key). Used the same way as the OpenAI key.
OPENROUTER_API_KEY
No
The platform's OpenRouter key (sk-or-…, from openrouter.ai → Keys), which reaches many models from one account. Used the same way as the OpenAI key.
Storefront domains (optional)
STORE_ROOT_DOMAIN
For shop subdomains
The domain under which every shop gets its own address, for example shops.example.com → kilnhouse.shops.example.com. It needs a wildcard DNS record (*.shops.example.com) pointing at this server. Empty: each shop answers at <APP_URL>/s/<handle>, which needs no DNS at all.
STORE_CNAME_TARGET
No
The host a shop owner's own domain points its CNAME record at, shown on the shop's Domains page, for example shops.example.com. Empty: the host of APP_URL.
SERVER_IP
For bare domains
This server's public IPv4 address, shown to shop owners whose domain needs an A record (a bare domain such as example.com, which cannot have a CNAME). Empty: the Domains page offers only the CNAME record.
TRAEFIK_DOMAINS_FILE
Only with Traefik
Only when Traefik (not the bundled Caddy) serves HTTPS: the file inside the app's container where the app writes a Traefik dynamic configuration with one router per verified custom domain. Mount a folder that Traefik's file provider watches. With Caddy, leave it empty: Caddy asks the app before each certificate.
Network
APP_PORT
No
The port on this server where the app answers. Default 8080.
APP_BIND
No
Which address the port is open on. Default 127.0.0.1: this server only, so visitors come in through Caddy or your own proxy. Use 0.0.0.0 only with TRUSTED_PROXY_HOPS=0 or a firewall that lets only your proxy reach the port.
APP_DOMAIN
With Caddy
The domain Caddy gets an HTTPS certificate for: the host of APP_URL, for example store.example.com. Shop subdomains and shops' own domains get their certificates on demand and need nothing here.
TRUSTED_PROXY_HOPS
No
How many reverse proxies in front of the app add the visitor's address to X-Forwarded-For. 1 = the bundled Caddy (the default in Docker); 0 = trust no proxy. Never set it higher than the proxies really in front of the app.
Advanced
COMPOSE_PROJECT_NAME
No
Only for a second copy on the same server (for example staging): give each copy its own name, so their containers, database, files, network, image and build cache stay apart. Empty = the name of the Storewright folder.
SEARCH_INDEXING
No
on (the default): search engines may index your public pages (home, pricing, themes) and every live shop's storefront, never the admin, the platform or the API. off, for a staging copy: every /robots.txt closes every page and every answer carries X-Robots-Tag: noindex, nofollow.
JOB_WORKERS
No
Background job workers in this server (outgoing webhooks, emails, domain checks, the refund sweeper, exports, housekeeping), 1 to 32. Default 4.
THEMES_DIR
No
For theme work only: a folder with the themes/ files, read from disk on every page instead of the copy built into the program, so a template change shows without a rebuild. Leave it empty on a live site.
DEMO_MODE
No
Only for a public demo: "true" seeds the demo platform and its shops with one-click sign-ins, turns on demo payments, locks risky actions and resets the data every day. It is "false" in the shipped file: never turn it on for a live site.
DEMO_SHOP_HOSTS
No
Demo mode only: "true" gives the three showcase shops their own addresses next to the app's (app.example.com gives kilnhouse.example.com), or list them as kilnhouse=shop1.example.com,littlecanopy=…,trailmade=…. "false" in the shipped file.
RUST_LOG
No
How much the server logs: info (the default), warn or debug.
Set by Docker, or for development
ASSET_ARCHIVE
No
For your own zero-downtime deploys: a folder that keeps older builds' files, so pages still open in a browser keep working.
BIND
No
The address the server listens on. Default 0.0.0.0: plus PORT.
BUILD_TARGET
No
How Docker gets the program: built (the default, built on this server) or prebuilt (uses prebuilt/storewright, built on another computer).
CARGO_MANIFEST_DIR
No
DRAIN_SECS
No
For your own zero-downtime deploys: seconds a stopping server keeps answering while the health check reports it is stopping. Default 0.
LOCAL_STORAGE_DIR
Set by Docker
The folder for files with STORAGE_DRIVER=local (/app/storage in Docker, a volume).
OUT_DIR
No
PORT
Set by Docker
The port the server listens on inside its container (8080).
READY_FILE
No
For your own zero-downtime deploys: the health check passes only once this file exists.
STRIPE_API_URL
No
For tests only: another address for Stripe's API.
WEB_DIST
Set by Docker
Where the built web app is, when it is not packed into the program.
File structure
storewright/
├── apps/
│ ├── backend/ the Rust server (Axum): crate storewright-server, program "storewright"
│ │ ├── src/main.rs the commands: serve, migrate, seed-demo, reset-demo, pack
│ │ ├── src/lib.rs the HTTP app: /api/health, /api/v1, /mcp, the storefronts, the web app
│ │ ├── src/api/ one module per area of the /api/v1 API
│ │ ├── src/checkout.rs carts and checkout
│ │ ├── src/orders.rs placing, paying, cancelling and expiring orders
│ │ ├── src/inventory.rs stock per location (never below zero)
│ │ ├── src/refunds.rs refunds and the refund sweeper
│ │ ├── src/payment_events.rs the payment gateways' webhooks
│ │ ├── src/billing.rs billing your plans, trials and renewals
│ │ ├── src/limits.rs plan limits and the AI credit meter
│ │ ├── src/domains.rs custom domains, the HTTPS check and the Traefik file
│ │ ├── src/webhooks.rs outgoing webhooks
│ │ ├── src/jobs.rs the background job queue and the scheduler
│ │ ├── src/settings.rs platform settings over .env
│ │ ├── src/setup_check.rs the setup check rows and live tests
│ │ ├── src/demo.rs the sample plans and the public demo
│ │ └── tests/ server tests (need a PostgreSQL)
│ ├── frontend/ the web app (React Router, Vite, Tailwind CSS)
│ │ ├── src/routes.ts every page: address → file
│ │ ├── src/pages/ shop admin, platform admin, sign-in, install, public site
│ │ ├── src/i18n/ the admin's translations
│ │ └── e2e/ browser tests (Playwright)
│ └── storefront-js/ the storefront script (TypeScript, built to one file)
├── crates/
│ ├── commerce/ money, discounts, shipping and tax rules (pure, with tests)
│ ├── payments/ Stripe, PayPal, Razorpay, Paystack, Mollie, manual and demo
│ ├── storefront/ theme rendering, SEO, sitemap, page cache keys
│ ├── ai/ AI providers, onboarding, writers and starter content
│ └── mcp/ the MCP server and its tools
├── themes/
│ ├── atelier/, market/, summit/ templates, theme.css and theme.json (settings and sections)
│ ├── _shared/ checkout, order status, account, 404, "closed for now"
│ └── _i18n/ storefront translations
├── migrations/ the database schema (applied on start)
├── docker/ Dockerfile, docker-compose.yml, Caddyfile
├── compose.yaml "docker compose up" from this folder
├── Cargo.toml, Cargo.lock the Rust workspace
├── .env.example every setting
└── docs/ this guide (HTML and PDF) and the third-party licences
Customise the code
Run it for development
Start a PostgreSQL (for example docker compose up -d postgres with ports: ["127.0.0.1:5432:5432"] added to the postgres service in a compose.override.yaml, or your own) and set DATABASE_URL in .env. For development set STORAGE_DRIVER=local.
Start the server from apps/backend: cargo run -- serve (it reads .env from the folder or the ones above it and listens on port 8080).
Start the web app from apps/frontend: pnpm install, then pnpm dev, and open http://localhost:5173. Calls to /api go to the server on port 8080. Screens reload as you save.
For theme work, set THEMES_DIR to the themes folder: the server then reads the templates from disk on every page, so a change shows on the next reload without a rebuild.
Themes
Each theme in themes/<name>/ has its page templates (in the minijinja template language, close to Jinja), theme.css, and theme.json: the settings the theme editor shows (colours, fonts, logo) and the home section types. The pages every theme shares (checkout, order status, account, 404, "closed for now") are in themes/_shared/ and wear the theme's colours and fonts. Templates get the page's data (shop, navigation, product, collection, cart, customer…) and helpers for money, translations ({{ t("Add to cart") }}), addresses and pictures. The themes are built into the program; rebuild after a change (docker compose up -d --build), or use THEMES_DIR while you work. A test renders every template of every theme with sample data, so a broken template fails the build.
The web app
Colours, fonts and sizes live in apps/frontend/src/styles.css as CSS variables, one block for light and one for dark. The platform's main colour set in White label replaces the brand colour at run time, so most rebrands need no code.
Pages are in apps/frontend/src/pages/, one folder per area; src/routes.ts maps each address to its file. Your public site (home, pricing, themes) is in src/pages/public/.
Wrap every visible string in t("…") and add it to the catalogues (see Languages). Use logical layout classes (ms-, me-, ps-, pe-, start-, end-) so Arabic stays right.
The server
Each area of the API is one module in apps/backend/src/api/; its routes() function lists the addresses.
Money, discount, shipping and tax rules are in crates/commerce, with no database code, so they are easy to read and test.
A database change is a new file in migrations/ named YYYYMMDDHHMMSS_what.sql. Never edit a migration that has already run: the server checks them.
Worked example: add a payment gateway
Say your merchants need another gateway. All payment code sits behind one interface in crates/payments, with five jobs: start a payment and return the page to send the customer to, check an incoming webhook and say what it means, fetch a payment's real state, refund with an idempotency key, and test the keys.
Copy the shortest adapter that is closest to the new gateway (for example paystack.rs) to crates/payments/src/acme.rs, and add the gateway to the list of gateway kinds with its name and label.
Fill in the five jobs with the gateway's API: amounts are always whole numbers in the currency's smallest unit (use the helpers in amounts.rs for the gateway's own form), the base address comes from the configuration (so tests can point it at a stand-in server), and a webhook must be checked the gateway's own way (a signature, or fetching the payment by its id) before it is believed.
Add tests in crates/payments/tests/acme.rs against a stand-in server, as the other gateways do, including a forged webhook that must be refused, and run cargo test -p storewright-payments.
In the web app, add the gateway's connect sheet (its key fields) to Settings → Payments.
The server needs no other change: checkout, webhooks (/api/v1/webhooks/acme/<shop id>), refunds and the payment re-checks go through the same interface.
Rebuild and deploy your changes
docker compose up -d --build # or with --profile https on your server
Docker rebuilds only what changed; a change to the web app alone reuses the compiled server. Keep your changes in a Git repository, so you can compare them with each new Storewright version.
Run the tests
Every money rule, every race between requests and every gateway has a test. Run them before and after you change the code.
What
Command (from the storewright folder unless noted)
The crates: money rules, gateways (against stand-in servers), AI providers (against recorded replies), themes, MCP
cargo test --workspace --exclude storewright-server
Rust only, no network
The server: every API route, tenancy (one shop cannot read or change another's rows), plan limits, stock, discount codes and refunds sent at the same moment
TEST_DATABASE_URL=postgres://user:password@127.0.0.1:5432/postgres cargo test -p storewright-server
A PostgreSQL login that may create databases: each test makes its own fresh database and drops it afterwards. Without TEST_DATABASE_URL these tests say so and pass.
Licences and security advisories of the Rust crates
The web app: types, lint, unit tests, every string translated
in apps/frontend: pnpm typecheck, pnpm lint, pnpm test
Node.js and pnpm
Browser tests of the main screens
in apps/frontend: pnpm exec playwright install chromium once, then pnpm e2e
Node.js and pnpm
The storefront script
in apps/storefront-js: pnpm test
Node.js and pnpm
A quick PostgreSQL for the server tests: docker run -d --name storewright-tests -e POSTGRES_PASSWORD=test -p 127.0.0.1:55432:5432 postgres:17-alpine, then TEST_DATABASE_URL=postgres://postgres:test@127.0.0.1:55432/postgres. Remove it afterwards with docker rm -f storewright-tests.
Database
PostgreSQL. The schema is in migrations/ and is applied by the server on start. Ids are UUIDs, times are UTC, and money is a whole number in the currency's smallest unit. Every row of a shop carries its shop_id, and rows inside a shop point at each other through the shop's own keys, so a row can never point at another shop's row. Platform payments and subscriptions are never deleted with their shop. These 67 tables are generated from the migrations when the release is built.
Table
What it holds
Keys
Points to
People, sign-in and shops
users
Every person who signs in to the admin or the platform: platform staff and shop staff, with their platform role (none, admin, or the read-only viewer). Storefront customers are not here
primary key id; unique email (any case)
–
sessions
Signed-in browsers of the admin and platform (only a hash of the cookie is stored), including a super-admin's 30-minute "open as owner" sessions
primary key id; unique token_hash
users, shops
password_resets
Password reset links (hashed, valid for a limited time, used once)
primary key id; unique token_hash
users
invites
Open invitations to join a shop's staff, with the role to join as (manager or staff)
primary key id; unique token_hash; unique email (any case) per shop, when accepted_at is null
shops, users
rate_limits
Fixed-window counters for sign-in, sign-up, reset, invite and export limits (keys hold a keyed hash, never a plain address)
primary key key
–
shops
A shop (the tenant): its handle, plan, status (trial, active, past due, suspended, closed), currency, language, settings and white label
The plans you sell: prices, trial days, limits (products, staff, locations, custom domains, AI credits, themes, storage) and switches (API access, remove branding)
primary key id
–
subscriptions
A shop's paid plan: a Stripe subscription, or the current period paid through another billing gateway; never deleted with a shop
primary key id; unique provider_ref
shops, plans
payments
Platform invoices (SW-0001, …) paid, failed or refunded, for your plans; never deleted with a shop
primary key id; unique number; unique provider_ref; unique per shop, when status = 'pending'
shops, plans, subscriptions
stripe_events
Stripe events already applied, so a delivery Stripe sends again is never applied twice
primary key id
–
ai_usage_months
The AI credit meter: writing requests claimed per shop and calendar month (UTC)
primary key shop_id + month
shops
email_notices
Platform emails sent once per shop and period (plan limit reached, payment failed, trial ended, …)
primary key shop_id + kind + period
shops
Platform
platform_settings
Settings saved in the platform admin (they override .env); secret fields are sealed with APP_SECRET
primary key key
users
provider_keys
AI provider keys, sealed: the platform's, or a shop's own on plans that allow it; with model, base URL and the last test result
primary key id
shops
jobs
The durable background job queue (webhook deliveries, domain checks, the refund sweeper, exports, housekeeping)
primary key id; unique dedupe_key, when dedupe_key is not null and status in ('queued', 'running')
shops
Catalogue
products
A shop's products: title, handle, description, type, vendor, tags, status (active, draft, archived), SEO title and description
primary key id; unique handle per shop, when deleted_at is null
shops, users
product_options
Up to three options per product (Size, Colour, …), each with its values in order
primary key id; unique product_id + position
products
product_media
The pictures of a product, in order
primary key id; unique product_id + media_id
products, media
variants
One variant per option combination (a product without options has one default variant): price, compare-at price, SKU, barcode, weight, stock settings and digital file
Groups of products: hand-picked (manual) or every product matching rules (tag, price, type, vendor)
primary key id; unique handle per shop
shops, media
collection_products
Which products are in which collection, in order (written by the rules for a rules collection)
primary key collection_id + product_id
collections, products
Stock
locations
Places that hold stock (a studio, a warehouse, a shop); orders take stock from them in priority order
primary key id
shops
inventory_levels
Stock of one variant at one location; it never goes below zero
primary key variant_id + location_id
variants, locations
inventory_adjustments
Every change of stock and why (an order, a refund with restock, a transfer, a hand count): the audit trail of inventory
primary key id
users, variants, locations
Customers
customers
A shop's customers (per shop: the same person at two shops is two customers); a password makes an account
primary key id; unique email (any case) per shop, when erased_at is null
shops
customer_addresses
A customer's saved addresses
primary key id
customers
customer_sessions
A storefront customer's sign-in (cookie sw_cust; only the token's hash is kept)
primary key id; unique token_hash
customers
Discounts, shipping and taxes
discounts
Discount codes (SUMMER10) and automatic discounts: percent, fixed amount or free shipping, with limits and dates
primary key id; unique code (any case) per shop, when code is not null
shops, users
discount_redemptions
One row per order that used a discount (and per customer for "once per customer" codes)
primary key id; unique order_id + discount_id; unique discount_id + customer_email (any case), when once
discounts, orders
shipping_zones
Shipping zones: the countries (and regions) each one covers
primary key id
shops
shipping_rates
A zone's rates: flat, by weight or by order price, each with an optional "free over" amount
primary key id
shipping_zones
tax_rates
Tax rates by destination country (and optional region code)
primary key id; unique country + region per shop
shops
Checkout and orders
checkouts
A cart on its way to becoming an order (cookie sw_cart holds its token; only the hash is kept); with an email and no order an hour later it is an abandoned checkout
primary key id; unique number per shop; unique gateway + payment_ref per shop, when payment_ref is not null
shops, customers, discounts
order_lines
What was bought, as it was at the time (title, variant, SKU and price are copied, so later edits never change it)
primary key id
orders, variants, products, locations
order_events
An order's timeline: placed, paid, notes, fulfilments, refunds, emails
primary key id
users, orders
fulfilments
Shipments of an order: location, carrier and tracking
primary key id
users, orders, locations
fulfilment_lines
Which order lines, and how many of each, a shipment holds
primary key fulfilment_id + order_line_id
fulfilments, order_lines
refunds
Money back for items and/or shipping, with the gateway's answer (pending, done, failed or needs review)
primary key id; unique idempotency_key
users, orders
refund_lines
Which order lines a refund covers, how many, and whether they went back into stock
primary key refund_id + order_line_id
refunds, order_lines
returns
A customer's request to send items back: requested, approved, received, refunded, or declined
primary key id
orders, customers, refunds
return_lines
The items and quantities of a return
primary key return_id + order_line_id
returns, order_lines
Payments of the shops
shop_gateways
The shop's own payment gateways for checkout, with their keys sealed with APP_SECRET
primary key id; unique gateway per shop
shops
gateway_events
Gateway webhook events seen (gateway + event id is unique), so a replay is ignored
primary key id; unique gateway + event_id
shops
Online store
onboarding_runs
AI onboarding runs: what the merchant described, each step shown on the waiting screen, whether the draft came from the AI or the built-in starter content (and why), the credits it used and the draft itself; one open run per shop at a time
primary key id; unique per shop, when status in ('queued', 'running')
shops
theme_settings
A shop's settings for each theme it has opened in the editor: the draft being edited and what is published
primary key shop_id + theme
shops, users
pages
A shop's pages (About, Shipping and returns, …)
primary key id; unique handle per shop
shops, users
blog_posts
A shop's blog posts
primary key id; unique handle per shop
shops, users, media
menus
Navigation menus (main, footer, …) with their links to products, collections, pages, posts or addresses
primary key id; unique handle per shop
shops
redirects
301 redirects on the storefront: written when a handle changes, and edited by the owner
primary key id; unique path (any case) per shop
shops, users
shop_domains
Custom domains: the host, the verification token, the status (pending, verified) and which one is primary
primary key id; unique host; unique per shop, when is_primary
shops, users
analytics_daily
Storefront numbers per shop and day: visitors, page views, product views, add to carts, checkouts started, orders and sales
primary key shop_id + day
shops
Developers
api_keys
API keys (swk_…): shown once, kept as a SHA-256; scopes read and/or write
primary key id; unique key_hash
shops, users
webhook_endpoints
A shop's outgoing webhook endpoints: address, events and signing secret (sealed)
primary key id
shops
webhook_deliveries
Each outgoing webhook delivery: event, payload, tries, the last answer and when the next try is due
primary key id
webhook_endpoints
Other tables
ai_uses
What a shop's AI requests were for, per calendar month (UTC): the AI settings page lists them
primary key shop_id + month + kind
shops
product_image_imports
Pictures an import names by address, fetched by the products.images job into the shop's storage: for the product (at position among its pictures) or for one variant
primary key id
products, variants
inventory_transfers
Stock on its way from one location to another: it leaves from when the transfer is made (in_transit) and arrives at to when it is received
primary key id
shops, users, locations
inventory_transfer_lines
primary key transfer_id + variant_id
inventory_transfers, variants
blog_post_views
Storefront views of a post per day (the shop's day), for "1,240 views" over the last 30 days
primary key post_id + day
blog_posts
analytics_sources
Sessions per traffic source, shop and day (the shop's time zone): the visit's landing utm_source, else the referrer's site by name, else Direct (analytics::source_name)
primary key shop_id + day + source
shops
analytics_devices
Sessions per device, shop and day (analytics::device)
primary key shop_id + day + device
shops
Part 06
Operate and maintain
Architecture
Storewright is one program, storewright, next to PostgreSQL and file storage, behind an HTTPS proxy. Everything a visitor, a merchant or you see comes from that one program.
The program serves the web app (built in), the /api/v1 API, the MCP server, every shop's storefront (rendered on the server from the theme templates and cached), checkout and the gateways' webhooks, and runs the background jobs. There is no separate worker to start. Several copies can run side by side behind one proxy (see Several servers).
PostgreSQL holds everything: shops, catalogues, orders, customers, settings, the job queue, sessions and the rate-limit counters. Saved keys are sealed with APP_SECRET before they reach it.
File storage holds pictures, logos and digital downloads.
The HTTPS proxy gets certificates for your platform, shop subdomains and verified shop domains, asking the program first (see Automatic HTTPS).
Outside services are only called by the server, never by a visitor's browser, except the gateways' own payment pages that customers are sent to.
How money moves
Two flows move a customer's money: paying for an order, and refunding it. Both are built so that a repeated message, a click pressed twice, two staff working at once, or a crash in the middle never takes or returns money twice.
Checkout → payment → webhook → paid
The customer presses Pay on the last checkout step.
In one database transaction, Storewright prices every line from the catalogue (never from the browser), works out the discount, shipping and tax, counts the discount code's use, gives the order the shop's next number, and takes each line's stock with a conditional update. The order is pending and holds its stock for 30 minutes.
Storewright asks the shop's gateway, with the shop's own keys, to create a payment for the order's total and the addresses to come back to.
The gateway answers with its payment page.
The browser goes to that page.
The customer pays on the gateway's own page. Card details never touch Storewright.
The gateway sends the customer back to the shop's order status page, which says the payment is being confirmed until step 9 is done.
The gateway sends a webhook to /api/v1/webhooks/<gateway>/<shop id>.
Storewright checks it the gateway's own way with that shop's keys (Stripe's signature, PayPal's verification API, Razorpay's HMAC-SHA256, Paystack's HMAC-SHA512, Mollie by fetching the payment), records the gateway's event id once, and in the same transaction marks the order paid, writes the timeline and queues the confirmation email and the order.paid webhook.
It answers 200, and the gateway stops sending.
When something goes wrong:
Step 2, an item ran out: the whole transaction is undone and the customer sees out_of_stock with the item's name. No order, no stock taken, no discount use.
Step 3, the gateway cannot start a payment (wrong keys, the gateway is down): the customer sees the reason and can try again or choose another payment method; the unpaid order's stock is given back when its hold ends.
Step 6, the customer gives up or the payment fails: no payment is taken. When the gateway reports a failure or an expired payment page, or when the 30-minute hold runs out and Storewright has asked the gateway and been told there is no payment, the order becomes expired and its stock and discount use go back. If the gateway says the payment was taken after all, the order is marked paid instead.
Step 8, the webhook is forged or sent to another shop's address: the check in step 9 fails with that shop's keys and nothing changes.
Step 8, the same webhook arrives again: its event id is already recorded, so it changes nothing and gets 200.
Step 9 fails half-way (the database is briefly unreachable): nothing of it is kept, the event id is not recorded, and Storewright answers 5xx, so the gateway sends it again later and it is applied then. Every step is safe to run twice.
The webhook never arrives (a firewall, a wrong address in the gateway's dashboard): the order stays pending until the hold runs out, and Storewright asks the gateway before it gives up (above). Staff can also press Check payment on the order at any time (see Recovering missed webhooks).
The amount or currency does not match the order, or the payment came after the order had expired or was cancelled: the order is not marked paid; the timeline says what the gateway took, so staff can refund it in the gateway or settle it with the customer.
Refunds: set aside, ask the gateway, settle
Staff choose the items, restock and amount in the refund sheet and press Refund.
In one transaction, under the order's row lock, Storewright checks that what is already refunded plus this amount is not more than what was paid, and that no line is refunded more times than it was bought, then sets the amount aside as a pending refund. A second refund pressed at the same moment waits for the lock and then sees the first one, so together they can never pass the amount paid.
Storewright asks the gateway to refund, with the idempotency key refund:<refund id>: if the request is sent again (a retry, a timeout), the gateway returns the first refund instead of making a second.
The gateway accepts, or refuses with a reason.
Accepted: the refund is settled, the items go back into stock if asked, and the order becomes partially_refunded or refunded.
Staff see the result; the customer gets the refund email and the order.refunded webhook is queued.
If the gateway never answered step 3, the refund stays pending (its amount still set aside, so nobody can refund it again). After 10 minutes the refund sweeper asks the gateway what became of it.
The gateway says it was done, failed, or it still cannot say.
Done: settled as in step 5. Failed: undone. Still unknown: marked needs review; its amount is no longer counted on the order, and the order page asks staff to check the refund in the gateway's dashboard.
The gateway refuses (for example the payment is too old or already refunded in the gateway): the set-aside amount is released, nothing goes back into stock, and the refund sheet shows the gateway's reason.
The same request arrives twice (a double click, a browser retry): the second one is answered with the first refund; no second refund is made.
The server stops between steps 3 and 5: the refund is still pending in the database, and the sweeper finishes it as in steps 7 to 9.
A refund made in the gateway's own dashboard: its webhook records it on the order, once.
Background jobs
Work that talks to outside services or takes time runs in the background, inside the same storewright program: there is no separate worker to start. The job queue is a table in PostgreSQL; each job is claimed by exactly one worker (several workers and several server copies never run one job twice), tried again after a failure with a growing wait (10 seconds, doubling, at most an hour, up to 5 tries), and picked up again after a crash: a job that has been running for more than 15 minutes goes back into the queue. JOB_WORKERS (default 4) sets how many run in each server copy. A scheduler in every copy looks every minute.
Job
When
What it does
Outgoing webhooks
As soon as an event happens, and every minute for retries that are due
Sends each shop's events to its endpoints, signed (see Outgoing webhooks).
Unpaid order expiry
Every minute
Unpaid online orders past their 30-minute hold: asks the gateway first, then marks them paid or expired (stock and discount use back).
Refund sweeper
Every minute
Refunds still pending after 10 minutes: asks the gateway and settles, undoes or marks them for review.
Emails
As soon as they are due
Order, shipping, refund, return, reminder and platform emails.
For gateways that charge one period at a time: renewal invoices 7 days before a period ends, then past due after 3 days' grace (both set in Platform admin → Billing).
Exchange rates
Every day
Fetches the European Central Bank's free daily reference rates, used only to add up shop sales on your overview. Nothing about your shops is sent. Demo mode keeps its seeded rates.
Domain checks
Every hour
Checks pending custom domains again (each at most every 10 minutes).
Product import
When a merchant starts one
Reads the CSV file and saves the products (see CSV import).
Export clean-up
An hour after an export
Deletes the export file.
Housekeeping
Every hour
Clears expired sessions, rate-limit windows, reset links, old invitations and old finished jobs; ends trials nobody paid for; removes shops closed more than 30 days ago.
Demo reset
Daily at 10:00 UTC and as each month begins, demo mode only
To check that it all runs: Platform admin → Setup check → Background jobs shows failed jobs of the last 24 hours and jobs waiting for more than 10 minutes, with the reason and a Retry button; docker compose logs -f app shows the jobs as they run; and a shop's webhook deliveries log shows every try.
Recovering missed webhooks
Payment gateways tell Storewright about payments with webhooks. If one never arrives (a firewall, a wrong address in the gateway's dashboard, a long outage), nothing is lost, because Storewright can always ask the gateway itself:
Check payment on an unpaid order (Orders → the order) asks the shop's gateway for the payment's real state, now. Paid: the order is marked paid, exactly as the webhook would have done it, once. Failed or expired: the order says so. Still open: nothing changes.
Before an unpaid order expires, the expiry job asks the gateway the same question, so an order paid during a webhook outage is marked paid instead of being released.
Refunds that the gateway did not confirm are asked about again by the refund sweeper after 10 minutes (see How money moves).
Gateways also send webhooks again by themselves for hours or days when Storewright answered with an error, and a repeated webhook is applied only once. Stripe's and PayPal's dashboards can resend an event by hand.
Your plans: Stripe subscriptions follow Stripe's webhooks and Stripe's retries; renewal payments through the other gateways are confirmed on the gateway's return page as well as by webhook.
To find out why webhooks are missing, open the webhook list in the gateway's dashboard: it shows each delivery to /api/v1/webhooks/… and the answer it got. The usual causes are an APP_URL that is not the public https address, a firewall in front of the server, or a signing secret pasted wrongly (the answer is then 400).
Several servers
One server runs a large platform. When you need more, run several copies of the storewright program against the same PostgreSQL and file storage, behind one load balancer or proxy. What keeps that safe:
Concern
How Storewright handles it, and what you set up
Background jobs
Every job is claimed with a database row lock (FOR UPDATE SKIP LOCKED), so each runs on one copy only. The hourly and daily jobs are queued once per period however many schedulers run. Order expiry and the refund sweeper lock each row they work on. No extra lock service is needed.
Sessions
Kept in PostgreSQL (only a hash of the cookie), so any copy can answer any request; no sticky sessions.
Settings, live updates and new jobs
Passed between copies with PostgreSQL's LISTEN/NOTIFY, so a setting saved on one copy applies on all of them at once.
Storefront page cache
Each copy keeps its own cache, keyed by the shop's content version in the database. Any change to a shop's catalogue, pages or theme moves that version on, so every copy shows the change at its next request.
Rate limits
The sign-in, sign-up, reset, invite and export limits are counted in PostgreSQL and hold across copies. The short-term allowances per person and per address are kept in each copy's memory, so with three copies a visitor can make up to three times as many quick calls.
File storage
Use an S3-compatible bucket (MinIO on its own server, AWS S3, R2…). STORAGE_DRIVER=local keeps files on one machine and does not work with several copies.
Database connections
Each copy opens up to 20 connections, plus one that listens for notifications. Keep PostgreSQL's max_connections above 21 × copies + your own tools. A connection pooler must run in session mode (live updates and the start-up migration lock need it); transaction mode breaks them.
Migrations
Every copy applies new migrations when it starts; a database lock makes the copies take turns, so each migration runs once.
Proxy headers
The proxy must pass the original Host header (it decides which shop is shown) and add the visitor's address to X-Forwarded-For. Set TRUSTED_PROXY_HOPS to the number of proxies that add an address (see Visitor addresses).
HTTPS certificates
Run one Caddy (or Traefik) in front of all copies, so one place holds the certificates. Several Caddy servers need shared certificate storage.
Personal data
You run the platform, so you are responsible for the personal data on it, together with each merchant for their own customers. This chapter lists where personal data is kept, how to export or erase it, and when it is deleted by itself.
Where personal data is kept
Table
Whose data
What
users, sessions, password_resets, invites
You, your colleagues, shop staff
Name, email, password hash, picture; sign-in sessions (a hash of the cookie); reset and invitation links (hashed).
Email, phone, shipping and billing addresses, the customer's note, what was bought, tracking numbers, return reasons.
checkouts
Shoppers
Carts with the email and addresses typed so far (abandoned checkouts).
discount_redemptions
Shoppers
The email that used a "once per customer" code.
webhook_deliveries
Shoppers
Copies of the events a shop sent to its own endpoints (they can hold order details).
subscriptions, payments
Shop owners
Billing name and email, the gateway's customer reference, invoices.
audit_log
Staff
Who did what in a shop, and when.
media and the file storage
Anyone in an uploaded file
Whatever the merchant uploaded.
Not kept: card numbers (customers pay on the gateway's own pages), plain visitor IP addresses (the rate limits keep a keyed hash, the analytics a daily changing hash), and tracking cookies (the storefronts set none; their cookies are only the cart, the customer's sign-in and the staff sign-in).
Export and erase
A shopper asks for their data: the merchant opens Customers → the customer → Export data, which downloads everything the shop holds about that customer (details, addresses, orders, returns) as one JSON file to send them.
A shopper asks to be erased: Customers → the customer → Erase personal data blanks their name, email, phone, addresses and notes on the customer, their addresses and their orders, and signs them out. Orders keep their amounts, products and dates for the shop's accounts, under "Erased customer".
A whole shop's data (for the merchant's own records, or when they leave): Settings → Privacy and data → Export downloads everything the shop holds as one JSON file or a zip of CSV files: the shop, staff, products with variants and stock, collections, customers with addresses, orders with lines, shipments and refunds, discounts, pages and posts. Passwords, API keys, payment keys and webhook secrets are never exported. The download link works for an hour, then the file is deleted.
A staff member asks to be removed: the shop owner removes them in Settings → Staff; you can suspend or delete a person in Platform admin → Users.
A request that reaches you instead of the merchant: open the shop as its owner (Platform admin → Shops → the shop → Open as owner) and use the same buttons; the shop's audit log records it.
Deletion schedule
What
Deleted
Expired sign-in sessions and rate-limit windows
Within the hour after they expire
Password reset links
A day after they expire
Invitations nobody accepted
30 days after they expire
Finished background jobs
After 14 days
Export files
An hour after they are made
A closed shop
30 days after it is closed, the hourly housekeeping removes everything it held: catalogue, stock, customers, orders, content, domains, payment settings, API keys and webhooks, files, staff, invitations and the AI meter. Your platform's invoices and subscriptions for that shop are kept for your books, on a blanked row ("Closed shop").
Orders and customers of a live shop are kept until the merchant deletes or erases them: shops usually must keep sales records for several years. Your backups keep deleted data until they are rotated, so keep backups only as long as you need them.
A customer's Export data and Erase personal data buttons
Deploy on a VPS
For a public launch, Storewright must be reachable at an https:// address: payment gateways send their webhooks there, and every email links there.
1. Pick a server
Size
Good for
2 cores, 4 GB memory, 40 GB disk
Building on the server and running a growing platform.
1 to 2 cores, 1 to 2 GB memory
Running a build made on another computer (below), or building with swap added.
4+ cores, 8+ GB memory
Hundreds of busy shops with large catalogues and many pictures.
Any provider that sells Linux servers with Docker works. Disk use grows mainly with pictures and digital files (unless they are in an outside bucket) and with orders; keep backups (see Backups and updates).
When nothing else on the server uses ports 80 and 443, the bundled Caddy does it all. Open both ports in your server's firewall, then:
docker compose --profile https up -d --build
Open https://store.example.com; the first visit takes a few seconds while the certificate is issued.
Already running a proxy?
Caddy needs ports 80 and 443 for itself. If Traefik, Nginx Proxy Manager, Nginx or Apache already owns them, leave out --profile https, start with docker compose up -d --build, and let your proxy pass visitors on to Storewright as below. For shops' own domains, see With Traefik you already run.
Behind a proxy you already run
Installed on the server itself (Nginx or Apache from the system's packages): point it at http://127.0.0.1:8080 (APP_PORT), the port the app opens on this server only.
In a Docker container (Traefik, Nginx Proxy Manager, an Nginx container): put the app on the proxy's Docker network with a compose.override.yaml (the Traefik example is in Automatic HTTPS), and send traffic to the app's name on that network, port 8080.
Whatever the proxy, send every host to the app (your platform's host, *.shops.example.com and shops' own domains), keep the original Host header, and set the visitor's address. In Nginx:
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host; # the app picks the shop by its host
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off; # live updates are a stream
client_max_body_size 11m; # uploads go up to 10 MB
}
Visitor addresses and rate limits
Storewright limits sign-ins, sign-ups and password resets per visitor address, so nobody can guess passwords at speed. It reads the visitor's address from the X-Forwarded-For header only behind the number of proxies you trust, set with TRUSTED_PROXY_HOPS. A visitor can type any X-Forwarded-For they like, so trusting it without a proxy would let them make up a new address for every try.
Your setup
Setting
The bundled Caddy (--profile https)
TRUSTED_PROXY_HOPS=1 (the Docker default). The app port is published on 127.0.0.1 only, so Caddy is the only way in, and Caddy replaces any X-Forwarded-For a visitor sends with the real address.
Your own Nginx, Apache or Traefik on the same server
TRUSTED_PROXY_HOPS=1 and keep APP_BIND=127.0.0.1.
A load balancer or CDN in front of your proxy (for example Cloudflare, then Caddy)
TRUSTED_PROXY_HOPS=2: one hop for each proxy that adds an address. Never set a higher number than the proxies really in front of the app.
No proxy at all (app port open to the internet)
TRUSTED_PROXY_HOPS=0 and APP_BIND=0.0.0.0. No header is trusted and the per-account limits still apply. Without HTTPS this suits only testing.
Build on another computer
If your server is small, build the program on a bigger computer with Docker and copy it over. The packed program is one file that already holds the web app.
# on the bigger computer, in the storewright folder (use --platform linux/arm64 for an ARM server)
docker build -f docker/Dockerfile --target pack -t storewright-pack --platform linux/amd64 .
docker create --name storewright-pack-copy storewright-pack
mkdir -p prebuilt
docker cp storewright-pack-copy:/storewright prebuilt/storewright
docker rm storewright-pack-copy
# copy prebuilt/storewright into the same folder on the server, then on the server:
BUILD_TARGET=prebuilt docker compose --profile https up -d --build
Set BUILD_TARGET=prebuilt in .env to keep it for later starts. The program must match the server's processor type (Intel/AMD = linux/amd64, ARM = linux/arm64).
Without Docker
cd apps/frontend && corepack enable && pnpm install && pnpm build && cd ../..
cd apps/storefront-js && pnpm install && pnpm build && cd ../..
cargo build --release -p storewright-server
./target/release/storewright pack apps/frontend/dist/client ./storewright
# .env next to where you start it: DATABASE_URL, APP_URL, APP_SECRET; STORAGE_DRIVER=local or your S3 bucket
BIND=127.0.0.1:8080 ./storewright serve
Run it behind your own HTTPS proxy and keep it running with a service manager such as systemd. The server applies the migrations when it starts; ./storewright migrate applies them on their own.
Two copies on one server
To run a staging copy next to the live one, unzip Storewright into a second folder and give each copy its own .env with its own COMPOSE_PROJECT_NAME (for example storewright and storewright-staging), APP_PORT, APP_URL, passwords and APP_SECRET, and SEARCH_INDEXING=off on staging. Use test keys for every gateway on staging. Only one copy can run the bundled Caddy, so put both behind one proxy.
Run it in the Storewright folder every day (for example from cron) and keep copies off the server. Every shop's catalogue, orders and customers live in this database.
Also keep a copy of .env (above all APP_SECRET, without which the saved payment and AI keys cannot be read) and of your files: the minio-data Docker volume, your own bucket, or the app-storage volume. Restore a database backup into an empty database with docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" "$POSTGRES_DB"' < backup.sql.
Update to a new version
Updates are made to keep your data: the database migrations run by themselves when the new version starts, they only add to the schema, and shops' products, orders, customers, themes settings, domains and keys stay as they are. There is no licence key and nothing is locked to a domain, so you can move the platform to another server or domain whenever you like.
Update in the same folder
Docker names the stack, and with it the database volume, after the folder unless COMPOSE_PROJECT_NAME is set. If you move or rename the folder, set COMPOSE_PROJECT_NAME to the old folder name first, or the app starts with an empty database. Your data is not lost; it is under the old name (docker volume ls shows it before _postgres-data).
Back up as above.
From the folder that holds storewright/ (not inside it), run unzip -o storewright-x.y.z.zip with the new version's file name. The zip has a top-level storewright/ folder, so it unpacks over your install. Your .env, compose.override.yaml and prebuilt/ are kept, because the zip does not contain them.
Compare your .env with the new .env.example: this lists the keys your .env does not have yet:
cd storewright
for k in $(grep -oE '^#? ?[A-Z][A-Z0-9_]*=' .env.example | tr -d '# ='); do grep -q "^$k=" .env || echo "$k"; done
Copy the ones you need, with their comments, into .env; a key you leave out keeps its default.
In the storewright folder, run docker compose up -d --build (with --profile https on your server). The new version applies any new migrations when it starts.
If disk is tight, run docker builder prune afterwards to free the build cache.
If you changed the code or the themes, compare your changes with the new version first (keep them in Git). CHANGELOG.md lists what changed and marks security fixes.
Security notes
What the server checks and limits, so you can answer your merchants' questions and know what to keep safe.
Shops are kept apart
The current shop always comes from the signed-in session or the API key, never from the request. Every query is filtered by it, and rows inside a shop point at each other through the shop's own keys in the database. Another shop's id answers "not found", so one shop cannot even learn what another holds. A test for each resource proves it.
Roles are checked by the server on every request; the screens only hide what a role cannot use.
Each shop's payment gateway webhooks are checked with that shop's keys only: a gateway account can only settle orders of its own shop.
Storefront customers belong to one shop and never reach the admin.
Accounts, sessions and keys
Passwords (at least 10 characters) are hashed with Argon2id. A password change or reset signs the person out on every other device.
The staff session cookie (sw_session) and the customer cookie (sw_cust) are HttpOnly, Secure on https and SameSite=Lax (on the public demo only, cross-site, so the marketplace's preview frame can sign in). Only hashes of session tokens, reset links, invitations and API keys are stored.
Every change made with the staff session cookie must carry the header x-storewright: 1, which browsers cannot add from another site, so other sites cannot make changes for a signed-in person.
Payment keys, AI keys and the secrets saved in the platform admin are sealed with AES-256-GCM, with a key derived from APP_SECRET. They are never sent back to the browser (only their last characters) and never written to logs.
"Open as owner" sessions last 30 minutes, are written to the shop's audit log, and cannot reveal saved keys or reach the platform admin.
Rate limits
These limits are kept in PostgreSQL, so they hold across restarts and several copies of the server. They are keyed by a keyed hash of the account or the visitor address (taken only from trusted proxies), never by a plain address:
Limit
Allowed
What it protects
Data exports, per shop
10 per hour
Exports a shop may make in an hour (each one reads every order it holds)
Notification_test
10 per hour
Test sends per person
Sign-in, per address
20 per 15 minutes
Sign-in attempts from one address
Sign-in, per account
5 per 15 minutes
Wrong passwords for one account; after five the account waits, even for the right password
Sign-up, per address
5 per hour
New accounts from one address
Password reset, per address
5 per hour
Password reset emails asked for from one address
Password reset, per account
3 per hour
Password reset emails sent to one account
Reset and invite links, per address
20 per hour
Tries at a reset or invite link from one address
Demo sign-in, per address
60 per hour
Public demo sign-ins from one address
Access_requests
10 per hour
Access requests sent by one person in one shop
Staff invitations, per shop
50 per hour
Invites sent by one shop
Every other call takes from short-term allowances in memory: each signed-in person may make 240 calls at once and then 20 a second, and all calls from one visitor address together (counted only behind a trusted proxy) 1,200 at once and then 60 a second. Payment gateway webhooks and the HTTPS check are never limited. A refused call answers 429 with a Retry-After header.
Money
Prices, discounts, shipping and tax are always worked out by the server from the catalogue, never taken from the browser. Money is kept as whole numbers of the currency's smallest unit, never as rounded decimals.
Stock, discount uses, AI credits, plan limits and refunds are each changed with one conditional database update or under a lock, so requests sent at the same moment cannot oversell, overuse or over-refund. Tests send such requests together to prove it.
Orders are marked paid only from a payment the gateway confirmed; plans switch on only from a confirmed plan payment. Every gateway event is applied once.
DEMO_PAYMENTS and DEMO_MODE are "false" in the shipped file: a fresh install never accepts an order or a plan without a real payment.
Platform invoices and subscriptions are never deleted with a shop or a plan.
What loads from other servers
The admin, the platform admin and the storefronts load nothing from other servers: fonts, icons and scripts are part of the build. Customers leave the shop only to pay on their gateway's own page. Every payment, AI and email call is made by your server.
Keep it safe
Use https, long unique passwords and two-factor sign-in on your server, your gateways, your email provider and your AI providers.
Set a monthly spending limit with each AI provider, as a second stop behind the plans' AI credits.
Keep .env and your backups private; anyone with APP_SECRET and a backup can read the saved keys.
Install Storewright updates; security fixes are marked as such in the changelog.
Demo mode and the seed commands
Demo mode
DEMO_MODE="true" turns an install into a public demo, like the item's live preview. It is "false" in the shipped .env.example: never turn it on for a real platform. With it on:
The demo platform is added on start: three showcase shops (Kilnhouse Ceramics on the Atelier theme, Little Canopy on Market, Trailmade Outfitters on Summit) with their products, orders, customers and 30 days of sales, plus sample shops on mixed plans for the platform's numbers.
The sign-in page shows one-click sign-ins: Kilnhouse's owner (Mara Ellison), manager (Theo Park) and staff member (Ines Duarte), a read-only platform owner, and a Kilnhouse customer (Jonah Reyes) who opens his account on the storefront. They work inside the marketplace's preview frame too. DEMO_SHOP_HOSTS="true" gives the three showcase shops their own addresses next to the app's.
Demo payments are on: checkout and plan changes complete without a card and are labelled "Demo payment (no card charged)". No real gateway, AI provider or email is called.
The install wizard is off, demo shops send no email, and risky actions (gateway and AI keys, passwords, domains, platform settings and plans) are locked. Nothing can be deleted and no file can be uploaded; visitors can still add and edit, and the daily reset puts everything back.
The demo data is removed and added again every day at 10:00 UTC (2 a.m. in Kilnhouse’s US Pacific time, so its “today” fills again), and once more as each month begins (00:05 UTC on the 1st), so this month’s figures never sit at zero.
Seed commands
Command
What it does
docker compose exec app storewright seed-demo
Adds the demo data, every row marked as demo. It only adds rows and never deletes anything. It refuses to run on a database that has any real account or shop.
docker compose exec app storewright reset-demo
Removes the demo rows and adds them again. It refuses to run when the database holds any real account or shop.
Platform admin → Settings → Maintenance → Remove demo data
Deletes only rows marked as demo. A demo shop that has a real payment is kept.
docker compose exec app storewright migrate
Applies the database migrations and stops (the server also does this on every start).
The public demo's sign-in page with its one-click sign-ins
Part 07
Help
Troubleshooting
Orders stay "pending" after the customer paid
The gateway's webhooks are not reaching the shop. Press Check payment on the order to settle it now (see Recovering missed webhooks). Then, in the gateway's dashboard, check that the webhook address is the one shown on the shop's Settings → Payments card (<APP_URL>/api/v1/webhooks/<gateway>/<shop id>), that it lists the events named there, and what answer the deliveries got: 400 means the signing secret saved in the shop does not match the gateway's; no delivery at all means the address is wrong or a firewall blocks it.
Paid plans don't switch on
Platform admin → Setup check → Billing gateways must be green. For Stripe, the endpoint in Stripe → Developers → Webhooks must point to <APP_URL>/api/v1/webhooks/stripe with the events listed in Billing your shops, and STRIPE_WEBHOOK_SECRET must be its signing secret. For the other gateways, use the webhook address shown on the gateway's card in Platform admin → Billing. Every gateway's dashboard shows each delivery and the answer it got.
A shop's subdomain shows "shop not found" or the platform's home page
Check that STORE_ROOT_DOMAIN is set (for example shops.example.com), that the wildcard DNS record *.shops.example.com points at the server, and that your proxy passes the original Host header. Each shop also answers at <APP_URL>/s/<handle>, which needs no DNS: if that works, the problem is DNS or the proxy.
A custom domain stays "pending"
The Domains page shows the records it looks for and what DNS answered. Both are needed: the CNAME (or the A record for a bare domain) and the TXT record _storewright.<domain> with the token. DNS changes can take up to a day to show everywhere; press Check now again later (the hourly check also keeps trying). With Cloudflare, set the record to "DNS only" (grey cloud), because a proxied record hides the CNAME.
A domain shows a certificate warning
Ports 80 and 443 must be open to the internet for Let's Encrypt to check the domain, and the domain must be verified on the Domains page first: the proxy asks Storewright before each certificate and gets "no" for an unverified domain. docker compose logs caddy names the reason. With Traefik, see With Traefik you already run.
Checkout says an item is out of stock although the product page shows stock
Unpaid online orders hold their stock for 30 minutes. When they expire unpaid, the stock comes back by itself. Inventory → the product shows what is held.
The install wizard asks for a token I don't have
The app prints it in its log at every start until the install is finished, and each restart makes a new one, so use the last line of docker compose logs app | grep -i "install token". Or set INSTALL_TOKEN in .env and run docker compose up -d.
After an update everything is empty
The folder was moved or renamed: Docker names the stack and its database volume after the folder unless COMPOSE_PROJECT_NAME is set, so it started a new, empty one. docker volume ls shows the old one as <old name>_postgres-data. Stop the app with docker compose down, set COMPOSE_PROJECT_NAME to the part before _postgres-data and run docker compose up -d again.
The app does not start
docker compose logs app names the problem, for example "APP_SECRET must be at least 32 characters" or "DATABASE_URL is not set". docker compose ps shows whether PostgreSQL and MinIO are healthy.
The build stops with "killed" or "signal: 9"
The server ran out of memory while compiling. Add swap or build on another computer (see Deploy on a VPS).
Emails don't arrive
Without SMTP, emails are written to docker compose logs app. With SMTP, press Test on the Email row of the setup check, and check that the sender's domain is verified with your provider. Demo shops never send email.
Uploads fail with "too large"
A file can be up to 10 MB. Behind your own Nginx, raise client_max_body_size to 11m; the plan's storage limit may also be reached (the shop's Settings → Plan shows its use).
AI writing says the credits are used up
The shop has used this month's AI credits. They start again on the 1st of the month (UTC); a higher plan has more. Writing by hand always works.
New orders and stock don't update live in the admin
A proxy is buffering the live stream. With the bundled Caddy it works as is; with Nginx add proxy_buffering off;.
Too many sign-in attempts from everyone at once
TRUSTED_PROXY_HOPS is 0 behind a proxy, so every visitor shares one address. Set it to the number of proxies in front of the app (see Visitor addresses).
FAQ
Do I take a share of my merchants' sales?
No. Each shop's customers pay into the merchant's own payment account; Storewright adds no fee of its own. You earn from the plans you sell to the shops (see Plans and trials).
Does it connect to Shopify, WooCommerce or Etsy?
No. A merchant moving from one of them exports their products as a CSV file there and imports it into Storewright (see Products from other platforms). Orders and customers are not moved.
Can I try it without payment or AI keys?
Yes. On a test copy, DEMO_PAYMENTS="true" completes checkouts and plan changes without a card, and DEMO_MODE="true" adds the full demo platform (see Demo mode). Without an AI key, onboarding builds shops from built-in starter content.
How much does the AI cost me?
See AI costs: each AI request costs a fraction of a cent to a few cents at list prices, and each plan's AI credits cap what a shop can use in a month.
Can merchants use their own domain?
Yes, on plans that allow custom domains. They add two DNS records, Storewright checks them, and the HTTPS certificate is issued by itself (see Shop addresses and custom domains).
Do card numbers ever reach my server?
No. Customers pay on the gateway's own page and come back to the shop; Storewright only stores the gateway's reference for the payment.
Do I need to know Rust?
No, not to install, rebrand or run it: Docker builds everything. Changing the screens needs React, changing a theme needs HTML and CSS, and changing server rules needs Rust (see Customise).
Can I use another database or host it without Docker?
PostgreSQL 15 or newer is required. Without Docker, run the one storewright program behind your own HTTPS proxy (see Deploy on a VPS). Managed PostgreSQL services work through DATABASE_URL.
Which licence do I need?
To charge merchants for plans, the Envato Extended Licence. See Support and licence.
Credits and licences
Storewright is built with these open-source projects, each under its own licence:
Docker images:PostgreSQL (PostgreSQL Licence), MinIO (GNU AGPL 3.0, run unmodified as a separate service), Caddy (Apache 2.0), and the official Rust, Node.js and Debian images used to build and run the app.
Every dependency
The Rust crates (from Cargo.lock) and the npm packages, counted by licence when the release is built. docs/third-party-licenses.txt lists every package by name, version and licence.
Licence
Rust crates
npm packages
MIT
60
275
Apache-2.0 OR MIT
238
4
Unicode-3.0
18
–
Apache-2.0
3
10
ISC
2
10
MIT OR Unlicense
5
–
MPL-2.0
2
2
OFL-1.1
–
4
(MIT OR Apache-2.0) AND Unicode-3.0
3
–
Apache-2.0 OR MIT OR Zlib
3
–
Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
3
–
BSD-3-Clause
1
2
0BSD
1
1
Apache-2.0 OR BSD-2-Clause OR MIT
2
–
Apache-2.0 OR BSL-1.0 OR MIT
2
–
Apache-2.0 OR ISC OR MIT
2
–
Apache-2.0 OR LGPL-2.1-or-later OR MIT
2
–
BSD-2-Clause
–
2
CDLA-Permissive-2.0
2
–
Zlib
2
–
(Apache-2.0 OR MIT) AND BSD-3-Clause
1
–
(MIT OR Apache-2.0) AND Apache-2.0
1
–
0BSD OR Apache-2.0 OR MIT
1
–
Apache-2.0 AND ISC
1
–
Apache-2.0 OR BSL-1.0
1
–
BlueOak-1.0.0
–
1
CC-BY-4.0
–
1
MIT AND BSD-3-Clause
1
–
MIT-0
–
1
Unlicense
–
1
Total
357
314
Every licence above allows use in a commercial product. cargo deny check licenses checks the Rust crates against this list.
Third-party services
Storewright works with outside services you and your merchants choose: Stripe, PayPal, Razorpay, Paystack and Mollie for payments; OpenAI, Anthropic, Google Gemini, OpenRouter and any OpenAI-compatible endpoint for AI; an SMTP email provider; optionally S3-compatible storage; and Let's Encrypt for free certificates. Each is run by another company with its own terms and its own pricing, and you, the buyer, are responsible for any costs they charge (see Third-party services and costs). Storewright is not affiliated with any of them.
Images
The logo and the illustrations are original SVGs, and every image in this guide is a screenshot of the running app. The demo's product photos are real photos from Pixabay (none is AI-generated); they are shown on the live preview only and are not in the download, where same-size "Sample image" placeholders take their place.
Changelog
1.0.0 (2026-11-30)
First release.
Multi-shop platform: merchants sign up on your platform and each gets a shop of their own, kept strictly apart from every other shop on the server, at <handle>.<your shops domain>, at <your address>/s/<handle>, or on their own domain.
AI onboarding: a merchant describes the shop in a sentence or two and gets a first catalogue, collections, About and Shipping pages, a theme with brand colours and a home page to review and publish. AI writers for product descriptions, SEO titles and descriptions and collection texts. OpenAI, Anthropic Claude, Google Gemini, OpenRouter and any OpenAI-compatible endpoint, with your own keys; built-in starter content when no key is set.
Products and catalogue: products with up to three options and their variants, prices and compare-at prices, SKUs and barcodes, weights, pictures, tags, product types and vendors, draft and archived states, digital products with download links, and manual or rule-based collections.
Product import: a Storewright CSV format with a sample file, and imports of product exports from Shopify, WooCommerce and Etsy, with a preview and a per-row error report.
Inventory: stock per location, transfers, hand counts and the full history of every change; stock is taken with a conditional update, so two shoppers can never buy the last item twice.
Orders: order numbers per shop, a timeline, notes, shipments with carriers and tracking, partial and full refunds with restock, customer returns, the order status page, and a Check payment action that asks the gateway for a payment whose webhook never came.
Checkout and payments: each shop connects its own Stripe, PayPal, Razorpay, Paystack or Mollie account; customers pay on the gateway's own page; webhooks are checked with the shop's own keys and applied once; unpaid orders hold their stock for 30 minutes, and the gateway is asked again before an order expires.
Refunds you can trust: the amount is set aside under a lock, sent to the gateway with an idempotency key and settled or undone; a refund the gateway did not confirm is asked about again after 10 minutes.
Discounts, shipping and taxes: discount codes and automatic discounts (percent, fixed amount, free shipping) with dates, minimums, usage limits and once-per-customer codes; shipping zones with flat, weight-based and price-based rates and free-shipping thresholds; tax rates by country and region, with prices that include or exclude tax. All money is kept in whole minor units and rounded the same way everywhere.
Customers: accounts or guest checkout, saved addresses, tags and notes, order history, abandoned checkouts with a reminder email, and Export data and Erase personal data on each customer.
Three storefront themes: Atelier, Market and Summit, rendered on the server and cached, with a visual editor for colours, fonts, the logo and home page sections, a draft and publish step, and pages, blog posts, menus, redirects, SEO fields, a sitemap and robots.txt for every shop.
Analytics: visitors, page views, product views, add to carts, checkouts, orders and sales per day, with no tracking cookies.
Staff and roles: owner, manager and staff roles, invitations, notification settings, an audit log and a shop export (JSON or CSV).
Developers: a REST API with read and write API keys, signed outgoing webhooks with retries and a deliveries log, and an MCP server for AI assistants (Claude Desktop, the OpenAI Responses API and the ChatGPT app through a connector URL).
Plans and billing: your own plans with limits on products, staff, locations, custom domains, AI credits, themes and storage, plus API access and branding switches, enforced on the server; free trials; Stripe subscriptions, or PayPal, Razorpay, Paystack and Mollie with renewal invoices and a grace period. Three sample plans.
Platform admin: sales and shop numbers, shops (plan, suspend, close, open as owner), users, plans, invoices and subscriptions, themes, AI providers and the AI credit meter, white label, email, storage and a setup check with live tests and background jobs with Retry.
Domains and HTTPS: custom domains checked by DNS (CNAME or A record plus a TXT token) and certificates issued on demand by the bundled Caddy, or by your own Traefik.
Languages: the storefronts, checkout, customer emails and admin in English, Spanish, French, German, Portuguese and Arabic (right to left), with prices written the way each language and currency expect.
Install and hosting: one Docker Compose command (the app, PostgreSQL, MinIO and optional HTTPS with Caddy), an install wizard in the browser, several server copies behind one proxy, and the purge of closed shops after 30 days.
Demo mode: three showcase shops with 30 days of sales, sample shops on mixed plans, one-click sign-ins, demo payments and a nightly reset, with no real payment, AI call or email.
Support and licence
Questions, bug reports and help with installation: use the Support tab on the item's page on the marketplace. Please include your Storewright version (shown at the bottom of the account menu, top right), how you host it, and what you see (a screenshot, or the lines from docker compose logs app). Never send us your .env, API keys, tokens or passwords.
Support covers questions about the item's features, help with bugs and help with installing it as described here. It does not cover custom changes to the code, or your accounts at the payment gateways, AI providers and other outside services, which are handled by those companies.
Licence
The Regular Licence lets you use Storewright for one product whose end users are not charged. To charge merchants (sell plans or subscriptions), you need the Envato Extended Licence. One licence covers one platform (one brand on one installation), with as many shops as you like on it. The licences page at codecanyon.net/licenses/standard explains both licences in full.
Storewright is not affiliated with, endorsed by or sponsored by Shopify, WooCommerce, Etsy, Stripe, PayPal, Razorpay, Paystack, Mollie, OpenAI, Anthropic, Google or OpenRouter. Their names are trademarks of their owners, used here only to describe what Storewright works with.