Stocklane Docs · 1.0.0 Also included as a PDF
Stocklane · documentation · version 1.0.0

Install it, open the till, sell it

Stocklane is a point of sale and stock system that you run as your own software business. Shops sign up, set up their outlets and tills, invite their managers and cashiers, and sell, count cash, buy stock, invoice business customers and read their reports. You sell plans to those shops through your own Stripe account and run everything from the super-admin.

This guide is written for first-time installers. Every command is shown in full, and every setting says where to find it. Part 03 explains each screen a shop uses, so you can answer your customers' questions.

Part 01

Get started

1Welcome

Thank you for choosing Stocklane. This guide takes you from the download to a running point of sale platform with your first shop selling.

What you get

  • The shop for your customers and their teams: an overview of the day; a full-screen till for touch, keyboard and barcode scanners, with variants, weighed items, discounts, parked sales, split payments, receipts and refunds; shifts with a counted float and a counted close; a PIN switch between staff on a shared till; sales history; products with variants, units, barcodes, labels and CSV import; stock per outlet with low-stock alerts; transfers between outlets; suppliers and purchase orders; stock counts; customers with loyalty points, store credit and pay later; invoices and quotes for business customers; expenses; reports; outlets and tills; team and roles; an audit log; and the shop's plan and billing.
  • The super-admin for you: revenue, shops, users, plans with limits, payments and subscriptions, platform settings (branding, Stripe, email, storage, sign-ups, legal pages, maintenance, email wording) and a setup check that tests every outside service live.
  • Plans with limits on outlets, staff, products, sales a month and file storage, checked by the server, and a free trial without a card.
  • An install wizard and sample plans, so the platform is ready the first time it opens, and sample data a new shop can try and then remove in one step.
  • One-command self-hosting with Docker: the app (one compiled Rust program that also serves the web app), PostgreSQL, MinIO file storage and optional automatic HTTPS with Caddy.

What is in the download

PathWhat it is
apps/backend/The server, written in Rust (Axum): the /api/v1 API, the Stripe webhooks, the background jobs and the built web app, compiled into one program called stocklane.
apps/frontend/The web app: React 19, React Router 7, Vite, Tailwind CSS 4 and shadcn/ui components. Every screen your customers and you see, the till included.
migrations/The PostgreSQL database schema. The server applies it by itself when it starts.
docker/, compose.yamlThe Dockerfile, the Docker Compose stack and the Caddy HTTPS config.
.env.exampleEvery 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.txtA 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 (server tests against a real PostgreSQL, web app unit tests 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. No image was made with an AI image generator. The logo is a simple SVG drawn in code, products without a photo show line icons from the Lucide set, and every screenshot in this guide and the item's previews is a capture of the running app.
  • Demo text: Yes. The sample shop, its products, customers, suppliers, invoices and expenses were written with Claude by Anthropic and edited by us.

AI-powered features: No. Stocklane has no AI features and calls no AI service.

Screenshots

The main screens of the shop, the till, the super-admin and the phone layout, from the sample shop Northgate Market. Every chapter in parts 03 and 04 has more.

The shop overview: today's takings, profit, sales by hour against last week, the tills, low stock and what needs attention
The shop overview: today's takings, profit, sales by hour against last week, the tills, low stock and what needs attention
The till: scan or tap products, the sale with tax per rate on the right, and Charge
The till: scan or tap products, the sale with tax per rate on the right, and Charge
Taking payment: cash with change, card on the shop's terminal, store credit, points or pay later
Taking payment: cash with change, card on the shop's terminal, store credit, points or pay later
Closing a shift: the counted drawer against what the till expected
Closing a shift: the counted drawer against what the till expected
Stock levels at each outlet, with low stock first and what is on the way
Stock levels at each outlet, with low stock first and what is on the way
A purchase order drafted from the reorder points
A purchase order drafted from the reorder points
Reports: sales by day stacked by outlet, and the split by category, product, staff and outlet
Reports: sales by day stacked by outlet, and the split by category, product, staff and outlet
The super-admin: revenue, shops, their sales this month and what needs attention
The super-admin: revenue, shops, their sales this month and what needs attention
The till on a phone
The till on a phone
Today on a phone
Today on a phone
Scan an item to see its stock everywhere
Scan an item to see its stock everywhere
The receipt a customer opens from its link
The receipt a customer opens from its link

2Requirements

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 on macOS or Windows works for trying it on your own computer.
  • For the first build (Docker compiles the Rust server from source): 2 processor cores and 4 GB of memory (or 2 GB plus swap). On such a server the first build takes about 3 to 4 minutes (the web app about 1 minute, the Rust server about 2) and uses up to about 2 GB of memory. Leave about 6 GB of free disk for Docker's build cache; docker builder prune gives that space back once the app runs.
  • To run it the server needs far less: the app image is about 110 MB and the program uses little memory when idle. PostgreSQL and MinIO run beside it, so plan at least 1 GB of memory for a small install. You can also build on another computer and run the result on a smaller server; see Put it online.
  • A domain name and HTTPS for a public launch. Stripe's webhooks need a public https:// address, and browsers only allow the camera barcode scanner on https pages (or on localhost). The bundled Caddy gets a free certificate for you.
  • A current version of Chrome, Edge, Firefox or Safari for you and your customers. The till runs in the browser of any computer, tablet or phone.

To build or change it without Docker

  • Rust 1.90 or newer (stable) from rustup.rs. The Docker build uses Rust 1.99.
  • Node.js 24 and pnpm 11 (corepack enable installs the pnpm version the project asks for).
  • PostgreSQL 15 or newer (the Docker stack ships PostgreSQL 17).
  • Optional: any S3-compatible storage (MinIO, AWS S3, Cloudflare R2, Backblaze B2…). Without it, files are kept in a local folder.

Hardware at the shop (optional)

  • Barcode scanner: any USB or Bluetooth scanner that types the code and presses Enter (most do, often called "keyboard mode"). The camera of a phone or tablet also scans.
  • Receipt printer: an 80 mm or 58 mm printer that the computer's system can print to. Receipts print from the browser's print window. A cash drawer wired to the printer can open when a receipt prints, if the printer's driver is set to do so.
  • Card terminal: the shop's own terminal from its bank or payment provider. The cashier charges the card there and marks it approved on the till: Stocklane records card payments but does not connect to the terminal.
  • Scale: the cashier types the weight shown on the shop's scale. Stocklane does not read a scale directly.

Accounts you need

AccountWhat it is forNeeded
Stripe (yours)Selling plans to the shops.To charge shops
An SMTP email providerPassword resets, team invites, emailed receipts, invoices, purchase orders and notices. Without it, each email is written to the app's log with its link.For a public launch
S3-compatible storageProduct photos, expense receipts and logos. The bundled MinIO does this on the same server.Optional
Stripe (each shop's own)A shop that wants its business customers to pay invoices by card connects its own Stripe account (chapter 9).Optional, per shop

3Extra costs you pay

Stocklane has no monthly fee of its own, and no paid service is required to run it: the Docker stack holds everything it needs. What you pay each month depends on the outside services you turn on. Each of them is run by another company with its own pricing, and you, the buyer, are responsible for every one of these costs. The prices below are the providers' published list prices in November 2026; they change, so check each provider's own pricing page before you set the prices of your plans.

ServicePriceWhat that means for you
Stocklane itselfFreeNo licence server, no usage fee, nothing calls home.
Stripe for your plans (pricing)2.9% + 30¢Per successful US card payment, plus 0.7% of subscription volume for Stripe Billing. On a $59 plan that is about $2.42 a month. Other countries and cards have their own rates. Without Stripe you can still run free plans.
Stripe for a shop's invoicesPaid by the shopA shop that connects its own Stripe account pays Stripe's fees on its own invoice payments, in its own Stripe account. You pay nothing for them.
Email, for example Amazon SES (pricing)$0.10 per 1,000Per email sent. Emailed receipts add up for busy shops. Other SMTP providers sell monthly plans with a free tier.
File storage, for example Cloudflare R2 (pricing)$0 to $0.015 per GBThe bundled MinIO or the server's own disk costs nothing extra. R2 charges $0.015 per GB a month after the first 10 GB, with no fee for downloads. Each plan caps a shop's files.
Server (VPS)about $10 to $40 a monthOne server with 2 cores and 4 GB of memory runs the whole Docker stack for many shops.
Domain nameabout $10 to $20 a yearThe address of your platform, for example pos.yourbrand.com.
WhatsApp receipt linksFreeThe till opens WhatsApp on the device with the receipt's link for the customer to read. No WhatsApp Business account and no message fees are involved.
The shops' own costs

Card terminal fees, receipt printers, barcode scanners and the shops' own Stripe fees are paid by each shop to its own providers. Stocklane never collects or passes on those fees.

4Quick start with Docker

This runs Stocklane on your own computer or on a server. The first build compiles the server from source, so it takes longer than later starts.

  1. Unzip the download and open a terminal in the stocklane/ folder (the one with compose.yaml in it).
  2. Create your settings file:
    cp .env.example .env
  3. Open .env in any text editor and fill in these 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 encrypts the Stripe keys and other secrets you and the shops save. Leave DATABASE_URL empty: Docker builds the database address from the values above, and that key is only for running the server without Docker.
  4. Build and start everything:
    docker compose up -d --build
    The first build takes a few minutes, mostly for compiling the Rust server. Later builds reuse Docker's cache and are much quicker. Docker then starts PostgreSQL and MinIO (file storage), creates the storage bucket and starts the app, which applies the database migrations by itself.
  5. 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: sl-install-… (open /install and paste it).
  6. Open http://localhost:8080. The install wizard opens: paste the token, check the server, create your super-admin account and name your product.
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 as the next chapter shows.

Disk space after the build

Docker keeps a few GB of build cache so that later builds are fast. If disk is tight, run docker builder prune once the app is running: it frees that space without touching your data, and the next build simply starts from scratch again.

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, as the next chapter explains.

5Put it online

For a public launch, Stocklane must be reachable at a public https:// address: Stripe sends its webhooks there, the cookies are marked secure, and the till's camera scanner needs https.

1. Pick a server

SizeGood for
2 cores, 4 GB memory, 40 GB diskBuilding on the server and running a growing platform (dozens of shops, each with several tills).
1 to 2 cores, 1 to 2 GB memoryRunning a build made on another computer (see "Build on another computer" below), or building with swap added.
4+ cores, 8+ GB memoryMany busy shops. The till sends one request per sale, so even large platforms need little.

Any provider that sells Linux servers with Docker works. Disk use grows mainly with product photos and expense receipts, so move files to outside storage once it grows (see File storage).

2. DNS

At your domain registrar, add an A record for the address you want (for example pos for pos.yourbrand.com) pointing at your server's IP address. Wait until ping pos.yourbrand.com shows that IP.

3. Settings

In .env:

APP_URL=https://pos.yourbrand.com
APP_DOMAIN=pos.yourbrand.com
TRUSTED_PROXY_HOPS=1

4. Start with HTTPS

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

The https profile adds Caddy, a web server that gets and renews a free certificate for APP_DOMAIN by itself. Open https://pos.yourbrand.com; the first visit takes a few seconds while the certificate is issued. Caddy passes the live update stream through unbuffered, so the overview, the bell and the tills update at once.

Already running a proxy?

Caddy needs ports 80 and 443 for itself. If Traefik, Nginx Proxy Manager, an 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 Stocklane, as the next part shows.

Behind a proxy you already run

Where the proxy runs decides how it reaches the app:

  • 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): it cannot use 127.0.0.1:8080, because inside a container that address is the container itself. Put the app on the proxy's Docker network instead, with a compose.override.yaml file next to compose.yaml. Docker Compose reads it by itself on every docker compose command. docker network ls shows the proxy's network name; the examples call it proxy.

Traefik: the labels tell Traefik the address, the entrypoint and the certificate resolver. Use the entrypoint and resolver names from your own Traefik setup (websecure and letsencrypt are common).

# compose.override.yaml: Stocklane behind a Traefik that runs in Docker
services:
  app:
    networks: [default, proxy]    # default: the app's own database and storage
    labels:
      - traefik.enable=true
      - traefik.docker.network=proxy   # the same network name
      - traefik.http.routers.stocklane.rule=Host(`pos.yourbrand.com`)
      - traefik.http.routers.stocklane.entrypoints=websecure
      - traefik.http.routers.stocklane.tls.certresolver=letsencrypt
      - traefik.http.services.stocklane.loadbalancer.server.port=8080

networks:
  proxy:
    external: true
    name: proxy                   # your proxy's network, as docker network ls shows it

Nginx in a container, or Nginx Proxy Manager: join the network the same way and give the app a name there that no other container uses.

# compose.override.yaml: Stocklane on the network of an Nginx container
services:
  app:
    networks:
      default:
      proxy:
        aliases: [stocklane]

networks:
  proxy:
    external: true
    name: proxy                   # your proxy's network, as docker network ls shows it

Then send the traffic to http://stocklane:8080 (http://app:8080 also works while no other container on that network is called app). In Nginx:

location / {
    proxy_pass http://stocklane:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;              # the live updates are a stream
    client_max_body_size 101m;        # the largest upload is 100 MB
}

In Nginx Proxy Manager, add a Proxy Host with scheme http, forward hostname stocklane and port 8080, request its SSL certificate, and paste the last two lines above into the Advanced tab.

Then start the app with docker compose up -d --build and keep TRUSTED_PROXY_HOPS=1: Traefik, Nginx and Nginx Proxy Manager each add one address, as the next section explains.

5. Visitor addresses and rate limits

Stocklane 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 setupSetting
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, on the host or in Docker (above)TRUSTED_PROXY_HOPS=1 and keep APP_BIND=127.0.0.1. Stocklane counts the address your proxy adds last, so a header a visitor makes up is never used; replacing the header is still tidiest (Nginx: proxy_set_header X-Forwarded-For $remote_addr;). Turn off response buffering for /api/v1/events (Nginx: proxy_buffering off;) so live updates work, and allow uploads up to 101 MB (Nginx: client_max_body_size 101m;).
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, every visitor counts as one address for the per-address limits, and the per-account limits still apply. Without HTTPS this suits only testing.

Super-admin → Setup check shows the current setting in its "Visitor addresses" row. The full list of limits is in Security notes.

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 stocklane folder (add --platform linux/arm64 for an ARM server)
docker build -f docker/Dockerfile --target pack -t stocklane-pack --platform linux/amd64 .
docker create --name stocklane-pack-copy stocklane-pack
mkdir -p prebuilt
docker cp stocklane-pack-copy:/stocklane prebuilt/stocklane
docker rm stocklane-pack-copy

# copy prebuilt/stocklane 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

Build the web app, then the server, and run the server behind your own HTTPS proxy:

cd apps/frontend && corepack enable && pnpm install && pnpm build && cd ../..
cargo build --release -p stocklane-server
./target/release/stocklane pack apps/frontend/dist/client ./stocklane
# .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 ./stocklane serve

Keep it running with a service manager such as systemd. The server applies the migrations when it starts; ./stocklane migrate applies them on their own.

Two copies on one server

To run a staging copy next to the live one, unzip Stocklane into a second folder and give each copy its own .env:

# .env of the live copy
COMPOSE_PROJECT_NAME=stocklane
APP_PORT=8080
APP_URL=https://pos.yourbrand.com

# .env of the staging copy
COMPOSE_PROJECT_NAME=stocklane-staging
APP_PORT=8081
APP_URL=https://staging.yourbrand.com
SEARCH_INDEXING=off

COMPOSE_PROJECT_NAME keeps each copy's containers, database, files, network, image and build cache apart, so a docker compose command in one folder never touches the other. Left empty, it is the folder's name, so two folders with the same name (for example /srv/live/stocklane and /srv/staging/stocklane) would share everything: always set it when you run two copies. Give each copy its own passwords and its own APP_SECRET. Only one copy can run the bundled Caddy, because it needs ports 80 and 443, so put both behind one proxy you run yourself (Behind a proxy you already run) with a different router name or network alias for each, for example stocklane-staging. SEARCH_INDEXING=off keeps search engines away from the staging copy (Search engines).

6Install wizard

The first visit to a new install opens the wizard at /install. It runs once; afterwards the page is locked. Sign-up stays closed until the wizard is finished.

  1. Setup token. Paste the token from the app's log (docker compose logs app | grep -i "install token" shows Install token: sl-install-… (open /install and paste it)). The app prints it 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 restart the app with docker compose up -d.
  2. Server check. The database, file storage, the app address, email, Stripe and the other settings from .env, each with its status. Lines marked required must work before you go on; a red one blocks Continue until you change .env, restart the app and press Check again. Everything else can be set up afterwards in Super-admin → Settings.
  3. Create the super-admin. Your name, email and password (at least 10 characters) and the name of your product, which you can change any time. Add the sample plans (on by default) adds three paid plans, Starter, Growth and Scale, with monthly and yearly prices and a 14-day free trial; untick it to make your own.
  4. Done. You are signed in as the super-admin and the wizard is locked. It lists what it created and what to set up before you invite shops: email and Stripe.
Add a free plan if you want one

The sample plans are all paid. A shop that signs up gets the default plan's free trial; when the trial ends without a subscription, the shop moves to your free public plan if you have one, and is read-only until it chooses a plan if you don't (chapter 8). Add a free plan in Super-admin → Plans if shops should keep selling for free after the trial.

Step 1: paste the setup token from the server log
Step 1: paste the setup token from the server log
Step 2: the server check
Step 2: the server check

7Setup check

Super-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.

RowWhat it shows, and what the test does
DatabaseThe number of migrations applied; the test reads the PostgreSQL version.
File storageThe bucket or the local folder; the test writes, reads and deletes a small test file.
Email (SMTP)The sender and the mail server; the test connects and, when you type an address, sends a test email to it.
StripeWhether paid plans can be sold; the test reads your Stripe balance and says whether the key is live or test.
Stripe webhookWarns about a missing signing secret and paid plans without a Stripe price ID.
App addressWhether APP_URL is https; the test calls APP_URL/api/health and checks this server answers.
Visitor addressesThe TRUSTED_PROXY_HOPS setting (chapter 5).
Background jobsJobs that failed in the last 24 hours or wait too long; below the rows, every job with the reason it failed and a Retry button (chapter 36).
InstallWhether the install wizard has finished.
Setup check: each service with a status, a fix and a live test, and the background jobs below
Setup check: each service with a status, a fix and a live test, and the background jobs below
Part 02

Connect services

Every outside service can be set in .env or in Super-admin → Settings. Values saved in the super-admin take precedence over .env, are stored encrypted with your APP_SECRET, and are never shown again once saved (only their last four characters). Change a value by typing a new one.

8Plans and subscription billing (Stripe)

You sell plans to the shops. Stocklane works with your own Stripe account: Stripe Checkout for new subscriptions, Stripe's customer portal for card changes and cancellations, and signed webhooks that switch plans on and off.

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.

1. Plans

Super-admin → Plans. Each plan has a name, a line about who it suits, a monthly price and an optional yearly price, the currency, a free trial (days), a list of what is included for the pricing page, whether it is public, whether it is the default plan new shops get, and an optional "Most popular" badge. Its limits are enforced on the server:

LimitWhat happens when it is reached
OutletsAdding another outlet is refused with an upgrade prompt.
Staff loginsInviting another person is refused. Members and open invites both count.
ProductsAdding another active product is refused; an import offers to bring in only the rows that fit. Archived products don't count.
Sales a monthThe till warns from 90%. At 100%, new sales are refused until the next month or an upgrade; refunds, store-credit top-ups and payments on pay-later sales still go through. The month is the shop's own calendar month in its time zone.
File storageAn upload past the limit (a product photo, an expense receipt) is refused.

An empty limit means unlimited. Archiving a plan takes it off sale; existing subscribers keep it, and you can put it back on sale later. The sample plans are:

PlanPriceOutletsStaffProductsSales a monthFiles
Starter$29 a month, $290 a year135002,000500 MB
Growth (default, most popular)$59 a month, $590 a year3105,00010,0002 GB
Scale$119 a month, $1,190 a year1040No limitNo limit10 GB

Each has a 14-day free trial. Change them to suit your market.

2. The free trial without a card

  • A shop that starts on a paid plan with trial days gets that many days of free use, with no card asked for. Billing shows the trial and when it ends.
  • When the trial ends without a subscription, an hourly check moves the shop to your free public plan if one exists. If there is none, the shop is suspended with the reason "Your free trial has ended. Choose a plan in Billing to sell again.": it can still read everything and open Billing, but nothing can be changed or sold.
  • Choosing any plan (a Stripe checkout, or a free plan) lifts that suspension at once.
  • A Stripe checkout during the trial gets only the trial days that are left, so nobody gets two trials. A shop that cancels its subscription keeps the paid plan to the end of the paid period, then the same rule applies.
  • When you reopen a suspended shop by hand in the super-admin, its trial end is cleared and the plan becomes its own.

3. Stripe keys

  1. In the Stripe Dashboard, switch to Test mode first. Under Developers → API keys, copy the Secret key (sk_test_…) and the Publishable key.
  2. Paste them into Super-admin → Settings → Stripe (or STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY in .env). Press Test.

Creating the keys costs nothing. Stripe charges its own fees on each payment, and you pay them, as described in the box above.

4. Prices

  1. 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.
  2. Copy each price's ID (price_…) into the plan in Super-admin → Plans. Stocklane reads the price from Stripe and shows "Found in Stripe" with its amount and interval, so a wrong ID is caught before a shop sees it.

5. The webhook

  1. In Stripe, open Developers → Webhooks → Add endpoint with the URL https://pos.yourbrand.com/api/v1/webhooks/stripe (Super-admin → Settings → Stripe shows yours).
  2. Select these events: checkout.session.completed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted, invoice.paid and invoice.payment_failed. Add charge.refunded, charge.dispute.created and charge.dispute.closed too, so refunds and disputes show in Payments, and customer.updated and payment_method.updated so a shop's billing page shows a changed card at once.
  3. Copy the endpoint's Signing secret (whsec_…) into Super-admin → Settings → Stripe (or STRIPE_WEBHOOK_SECRET). Without it, paid plans would never switch on, and the setup check says so.

6. The customer portal

In Stripe, open Settings → Billing → Customer portal and activate it, with payment method updates, invoice history and cancellation turned on. Shop owners reach it from Billing.

7. Go live

Test a full upgrade with Stripe's test card 4242 4242 4242 4242, then repeat steps 3 to 5 in live mode with your live keys and live price IDs.

Test checkout without Stripe

DEMO_PAYMENTS="true" in .env turns on a test checkout that switches plans without any card. It is "false" in the shipped file. It only works while no Stripe secret key is set: once you add one, plan changes go to Stripe Checkout. Keep it off on a live site.

How payments stay right

Plans switch on only from Stripe's signed webhooks. Each Stripe event is applied once, in the same database transaction as its changes, so Stripe's retries never double anything. Payments and subscriptions are never deleted with a shop: a deleted shop is closed and kept, so refunds and disputes still find their invoices.

Licence

Charging the shops through Stocklane (selling plans or subscriptions) requires the Envato Extended Licence. The Regular Licence covers a single product whose end users are not charged.

Super-admin → Plans: prices, Stripe price IDs and limits for each plan
Super-admin → Plans: prices, Stripe price IDs and limits for each plan

When a card payment fails

  • While Stripe retries the card (on the retry schedule in your Stripe billing settings), the subscription is past due, not suspended: the shop keeps working, its owners get a "payment failed" email, and the failed payment shows in the super-admin.
  • After Stripe's last retry (Stripe marks the subscription unpaid), the shop is suspended with the reason "Payment failed: the card was declined on every retry." and its owners and managers are told. A suspended shop is read-only: it can still read everything and open Billing.
  • When the shop pays, the subscription and the shop are both active again. This lifts only the suspension for non-payment: one a super-admin set stays until a super-admin lifts it.

9Card payments for a shop's invoices

Shops can send invoices to business customers (chapter 24). To let those customers pay by card, a shop connects its own Stripe account. The money goes straight to the shop's Stripe account; it never passes through yours.

  1. The shop's owner opens Settings → Payments → Invoices by card and chooses Connect.
  2. In the shop's own Stripe Dashboard, under Developers → Webhooks → Add endpoint, they add the Webhook endpoint address the sheet shows (https://pos.yourbrand.com/api/v1/stripe/shops/<shop id>/webhook) for the event checkout.session.completed, and copy its signing secret.
  3. Back in Stocklane they paste the shop's secret key (sk_live_…, sk_test_… or a restricted rk_… key) and the signing secret (whsec_…). Stocklane checks the key with Stripe before saving and stores both encrypted.

From then on every invoice has a pay link. The customer opens it, sees the invoice and pays on Stripe's own Checkout page, so card numbers never touch the shop's page or your server; the webhook marks the invoice paid (once, even when Stripe sends the event again) and the pay link closes. Disconnect stops pay links taking cards; invoices can still be paid by bank transfer and recorded by hand.

Stripe fees for the shop

Stripe is a third-party service with its own pricing. The shop pays Stripe's fees on its invoice payments, in its own Stripe account. You, the buyer, pay nothing for them.

Settings → Payments: the shop's own Stripe, connected, with the webhook address
Settings → Payments: the shop's own Stripe, connected, with the webhook address

10Email (SMTP)

Stocklane sends password reset links and team invites, and a few platform notices: a payment failed, a plan limit was reached and a shop was suspended (each sent once per event). Shops also send their own emails through it: receipts, invoices and quotes with their reminders, purchase orders to suppliers, Z reports and a morning low-stock email.

  1. Get SMTP details from any email provider (Amazon SES, Postmark, Brevo, Mailgun, your own mail server…): host, port, username, password and a sender address on a domain you have verified with that provider.
  2. Enter them in Super-admin → Settings → Email (or the SMTP_* keys in .env). Use starttls on port 587, tls on port 465.
  3. Press Test on the email row of the setup check, with your own address.

Every email is sent from your one sender address. Receipts, purchase orders and the low-stock email show the shop's name as the sender name. A customer's reply to an emailed receipt goes to the shop: to the address in Settings → Receipts → Replies to emailed receipts, or to the shop's own email when that is empty. A purchase order carries its own reply-to address, so the supplier's answer reaches the shop too. Without SMTP, each email is written to the app's log with its link (docker compose logs app), which is enough for testing. The wording of the five platform emails is editable in Super-admin → Settings → Email.

Email costs

Email providers are third-party services with their own pricing, and you pay them for every email the platform sends, the shops' receipts and invoices included: Amazon SES, for example, charges $0.10 per 1,000 emails, and most other providers sell monthly plans with a small free tier.

11File storage

Product photos, expense receipts, shop logos and your brand 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.

  • Another bucket (AWS S3, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces…): set S3_ENDPOINT, S3_REGION, S3_BUCKET, S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY in .env, or enter them in Super-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.

Shop files are private: the app serves each one only to signed-in members of its shop. Uploads are checked by their content, not their name: product photos (JPEG, PNG or WebP up to 5 MB), expense receipts (a photo or a PDF up to 10 MB), shop logos (PNG, JPEG or WebP up to 1 MB) and your brand logo (PNG, SVG or WebP up to 1 MB). Every shop file counts toward the plan's file storage. Super-admin → Settings → Storage shows how much space is used.

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 download fees.

Part 03

The shop (your customers)

Each of your customers works in their own shop: its outlets, tills, products, stock, customers, sales and settings, kept apart from every other shop. A person can belong to several shops and switch between them. What each person sees depends on their role (chapter 28): cashiers sell and see their own shifts; managers run the stock, customers, invoices, expenses and reports of their outlets; the owner sees everything and changes the shop's settings, team and plan. The server checks every role on every request; the screens only hide what a role cannot use, and say "Your role can't open this" with a button that asks the owner for access.

The chapters below use the sample shop of the demo, Northgate Market, with its two outlets, Main Street and Harbour Road.

12Overview and the first day

The first page after signing in. The owner sees today across every outlet; a manager sees their outlet; a cashier sees their own shift.

  • Takings, the average sale, profit and the cash in the drawers, with sales by hour against the same day last week.
  • The tills now: who is selling on each one and how their shift is going; each outlet's day for the owner and each cashier's day for a manager.
  • Low stock, today's best sellers, what needs attention (a drawer that didn't balance, an overdue invoice, a delivery to receive, a plan limit close) and the plan's use.
  • The bell collects notices as they happen: payments, low stock, deliveries and transfers to receive, shift closes, limits and access requests.

The first day

A new shop sees a setup checklist instead: shop details and logo, the first outlet and till, products (or a CSV import), the team with their till PINs, the opening stock, and the first shift (count the float, ring up a test sale, then refund it).

The Add sample products and sales box on the sign-up form (on by default) fills a new shop with sample products, two customers and a week of sales, so every screen has something to show. When the shop is ready to sell for real, the owner presses Remove sample data on the overview and types REMOVE: the sample products, customers, sales, shifts, orders, invoices and expenses go, and anything the shop's real work already uses is kept as its own.

The owner's overview across both outlets
The owner's overview across both outlets
A new shop's first day: the checklist and the sample data
A new shop's first day: the checklist and the sample data

13The till

A full-screen till at /till, made for touch, keyboard and barcode scanners. One screen, no page loads between sales. It works on a computer, a tablet and a phone.

Starting

Pick the register. A register needs an open shift before it sells (chapter 15). When an owner or manager opens the till on a register, that browser is set up as the register's till, so the team can switch on it with their PINs (chapter 16).

Adding items

  • Scan with a hand scanner at any time while selling, or with the device's camera. A scanned barcode or SKU goes straight into the sale.
  • Search by name, SKU or barcode (F2), or tap a product tile; the category chips across the top narrow the grid.
  • A product with variants (colour, size, scent) asks which one; number keys pick it.
  • A weighed item (sold by weight) asks for the weight: the cashier types what the scale shows, and the line shows the weight and the price per unit.
  • When an item shows no stock, the till warns. Whether it may still be sold is the shop's setting ("Sell when stock shows zero").

Lines and discounts

  • Tap a line to change its quantity, give it a new price, a discount with a reason (printed on the receipt) or a note.
  • Discount (F6) takes money off the whole sale, spread over its lines after any line discounts, with a reason.
  • Each person has a discount limit (10% unless the owner changes it). A discount over it, or a new price, needs a manager's PIN: a manager or the owner picks themselves on the till and types their PIN, and that approval works for this one action for two minutes.

Customers, notes and parked sales

  • Customer (F4): find them by name, phone, email or card number, see their points and store credit and what this sale earns, or add a new one with a name and an email or phone.
  • Note (F7) adds a note to the sale.
  • Park (F8) puts the sale aside to serve the next customer. Parked in the top bar lists the register's parked sales; recalling one parks the current sale first, so nothing is lost. Deleting a parked sale asks for a reason, which goes to the audit log.

Taking payment

Charge (Enter) opens the pay screen. A sale can be split across as many payments as the customer likes:

Way to payHow it works
CashType what was handed over or tap a quick note; the till shows the change. Cash may be more than what is due.
CardCharged on the shop's own card terminal; the cashier marks it approved or declined. A declined card stays on the list and nothing is counted twice.
Store creditFrom the customer's balance, up to what they hold (chapter 23).
PointsLoyalty points as money off (100 points = 1.00 unless the shop changes it), up to what they have.
Pay laterOn the customer's account, for customers the shop allows, up to their limit. It becomes a due the customer pays later (chapter 23).

Card, store credit, points and pay later can never take more than is still due. The sale saves when the payments add up to the total, and each shop turns the ways to pay on and off in Settings → Payments.

The receipt

The done screen shows the change to hand back and the receipt, ready in one tap: print on 80 mm or 58 mm paper, an A4 PDF, an email with the receipt's link, a WhatsApp link (opens WhatsApp on the device with the link, for the customer's phone), or none. A receipt has the shop's header and footer, the lines with their tax letters, tax per rate, the payments, the customer's points, a barcode for returns and a QR code to the receipt online. The link opens the receipt without signing in, with a Download PDF button.

When the connection drops

Each sale gets its own id on the till the moment it starts. If the connection drops while a sale is being saved, the cart stays on the till, the till retries by itself and shows what was and wasn't charged, and the cashier can park the sale to serve the next customer. A retry that reaches the server twice is still one sale: the server answers with the sale it already saved.

Keys

F2 search · F4 customer · F6 discount · F7 note · F8 park · F9 print · F10 returns · Enter charge or the screen's main button · Esc back. The till's menu also has cash in and out, close the shift, switch till, the back-office pages, light or dark, and sign out.

When the shop has used 90% of its plan's sales this month, the till says so; at 100% new sales stop until an upgrade or the next month (chapter 8).

A product with variants, and a weighed item
A product with variants, and a weighed item
A discount over the cashier's limit waits for a manager's PIN
A discount over the cashier's limit waits for a manager's PIN
The register's parked sales
The register's parked sales
The change, and the receipt: print, PDF, email or WhatsApp link
The change, and the receipt: print, PDF, email or WhatsApp link

14Returns and refunds

Returns (F10) on the till finds the sale: scan the receipt's barcode or QR code, type its number, or find the customer and pick one of their receipts.

  • Pick what comes back, line by line. Nothing can come back twice: each line allows only what was sold less what was already refunded, and the total never exceeds what was paid.
  • Choose where the money goes: back the way it was paid (cash from the drawer, back to the card on the shop's terminal, store credit, points), or all of it as store credit.
  • Stock comes back to the outlet unless the cashier ticks that the item is damaged ("don't restock"). Points the sale earned are taken back in proportion.
  • A cashier's refund needs a manager's PIN. A receipt older than the shop's refund window (30 days unless changed) also needs one.
  • The refund gets its own number and a refund receipt. Refunds still work when the shop has reached its monthly sales limit.
A refund: what comes back, where the money goes, and the manager's approval
A refund: what comes back, where the money goes, and the manager's approval

15Shifts and cash

  • Open a shift: count the float note by note and coin by coin; the till shows it against what was left in the drawer at the last close. A register has at most one open shift.
  • Cash in or out during the shift (a window cleaner paid, a float top-up) with a reason. Up to the shop's limit (50.00 in the shop's currency unless changed) needs no approval; more needs a manager's PIN. A cash expense recorded in the back office is also a cash out of its shift (chapter 25).
  • Close the shift: a blind count of the drawer (what it should hold stays hidden), then the check: what the till expected, what was counted and the difference, big and clear as balanced, short or over. A difference over the shop's limit (5.00 in the shop's currency unless changed) needs a note before it closes.
  • The till expects: float + cash sales − cash refunds + cash in − cash out.
  • The Z report prints on 80 mm paper, can be emailed to the owner, and is kept with the shift, also as a PDF. A closed shift can't change.

Shifts in the back office lists every shift the person may see (the owner all, a manager their outlets, a cashier their own) with its float, expected and counted cash and the difference, tabs for short or over and still open, filters and a CSV. A shift's page shows the drawer's verdict, the shift at a glance (sales, payments, sales by hour, refunds, discounts, cash out, tax), the count by note and coin, and the close note.

Opening a shift with a counted float
Opening a shift with a counted float
One shift: expected against counted, and its Z report
One shift: expected against counted, and its Z report

16Shared tills and the PIN switch

Most shops share one till between several people. Each person has a 4-digit till PIN. The owner sets it in Team and tells them in person (it is never emailed), and each person can change their own in Settings → Your profile → Till PIN. Easy PINs (such as 1111, 1234 or 4321) and a PIN another member of the shop already uses are refused.

  • Lock in the top bar locks the till between customers. The sale on screen stays exactly as it was, behind a blur.
  • Whoever unlocks picks themselves and types their PIN, and the till sells as them from then on: every sale, refund and cash move carries the name of the person who made it.
  • Three wrong PINs in a row make that till wait a minute, and the managers are told.
  • The PIN switch works only on a browser an owner or manager has set up as the register's till (opening the till on it does this). A session opened by a PIN lasts at most a working day and ends when someone else unlocks that till.
  • The same PIN pad approves a cashier's discount, refund or large cash move when a manager types their PIN.
The locked till: pick yourself and type your PIN
The locked till: pick yourself and type your PIN

17Sales history

Sales lists every receipt the person may see: the owner all, a manager their outlets, a cashier their own shifts. Tiles at the top total the money for the current filters; tabs by outlet or status; filters for the date, till, cashier and way of payment; search by receipt number, customer or item.

  • A sale opens in a side sheet: when and where, the customer and their points, the lines, the totals with tax per rate, every payment (declined cards too), the refunds so far and what happened, step by step.
  • From there: Reprint (80 mm, 58 mm or A4), Email receipt, PDF and Refund (the refund itself happens on the till).
  • Export writes one CSV for a range of dates and outlets, with the sales, their lines, payments and refunds as you choose. It opens in Excel, Numbers or Google Sheets.

Receipt numbers are per till: the outlet's code, the till's number and five digits, for example MS1-21187.

Sales with one sale open in its sheet
Sales with one sale open in its sheet

18Products

Products lists the catalog with each product's SKU, category, supplier, price, cost, margin and stock at each outlet (Low and Out where they are), with tabs for all, low, out of stock and archived, filters by category and supplier, and search.

A product

  • Details: name, category, supplier and the supplier's code, a description and photos (JPEG, PNG or WebP up to 5 MB each).
  • Variants: an option such as Colour or Size, and its values. Each value is a variant with its own SKU, barcode, price, cost and switch for the till. A SKU and a barcode are unique within the shop.
  • How it is sold: by each, by weight (kilogram or gram), by volume (litre), by length (metre) or in packs; the units a shop sells by are turned on under Categories and units. An open price product asks the cashier for the price.
  • Price and tax: the price and cost of every variant, the tax rate (a category can give its products a default), and the margins. The average cost is kept by Stocklane from what was received and is only shown.
  • Stock: what each variant has at each outlet, its reorder point (low at or below this) and order-up-to level, and whether the product tracks stock at all.
  • Archive takes a product off the till and out of the plan's count; a product that never sold or moved can be deleted instead.

Categories and units

Categories are the till's tabs, in the order you drag them, each with a default tax rate and whether the till shows it. The same page turns on the units the shop sells by and shows which categories each tax rate covers.

Import from CSV

Import takes a CSV file in four steps: upload, match each column to a field, check every row (errors and warnings per row; a mapping can fix every row with the same value at once), then import. Rows whose SKU already exists update that product; the rest are new. When the new products don't fit the plan, the import offers to bring in only the rows that fit. Nothing is saved before Import, and an import can be undone for a day: its new products go (unless one has sold) and changed products get their old values back. Export writes every active variant with its prices, codes and stock per outlet in the same columns.

Barcode labels

Labels prints barcode labels for picked products: one per item in stock at an outlet, one each, or a typed number. Sizes: US Letter with 30 labels a sheet (2.625 × 1 in) for shops in the US and Canada, A4 elsewhere, a label printer roll or a shelf edge. Choose what shows on a label and which label on a used sheet to start from. Codes print as EAN-13 when they are valid EAN-13 codes and as Code 128 otherwise.

A product: variants, price and tax, and stock per outlet
A product: variants, price and tax, and stock per outlet
Importing products: every row checked before anything is saved
Importing products: every row checked before anything is saved
Barcode labels on a US Letter sheet
Barcode labels on a US Letter sheet
Categories, units and tax rates
Categories, units and tax rates

19Stock levels and movements

  • Stock shows what every variant has at each outlet against its reorder point, what is on the way (transfers and purchase orders), the average cost and the value. Low stock comes first.
  • Adjust adds or takes off stock by hand, or sets the count, always with a reason. Set reorder points and order-up-to levels here too.
  • Low-stock alerts: when an item falls to its reorder point, the managers get one notice in the bell. The overview and the reports list what is low, with the transfer or purchase order that fixes each line.
  • Low-stock email: once a morning, at 07:00 in the shop's time zone, the owner and managers get one email when anything is at or under its reorder point: up to 50 items by outlet, then how many more, with a link to Stock. It is on for a new shop; the owner turns it off in Settings → Payments.
  • Movements is the history of every change to stock, with who, when and why: sales and refunds, deliveries and transfers, counts and adjustments, invoices sent and voided. Each line links to what made it.
  • On a phone, Stock opens on the stock check: scan or type an item to see its price, cost, margin, its stock at every outlet and what is on order, then move stock, count it or print its label.

Every change to stock is a movement written in the same database transaction as the new level, so the history always adds up to the stock on hand. Untracked products (services, for example) are never counted.

Every stock movement with who, when and why
Every stock movement with who, when and why
Adjusting stock by hand, with a reason
Adjusting stock by hand, with a reason

20Transfers between outlets

  1. New transfer: pick the outlet it leaves and the one it goes to, and add products (search or scan). Each line is checked against what the source has; what is low at the destination can be added in one go. A transfer becomes a draft with its number (TR-0042) as soon as it has a product, and saves itself as it changes.
  2. Send: the stock leaves the source now (never more than it has) and the transfer is on its way. A packing list prints for the driver.
  3. Receive at the destination: every line starts as arrived in full; scanning items counts the lines from the scans instead. Anything short gets a reason and is either written off once or kept open.

The list shows drafts, transfers on the way, received ones (with anything short) and cancelled ones, with who sent and received each and when.

Receiving a transfer, with one line short
Receiving a transfer, with one line short

21Suppliers and purchase orders

Suppliers

Each supplier has its contact details, the email purchase orders go to, its terms, lead time and free-delivery amount, its products with stock at each outlet, what you bought from it this year and its last orders. Archiving a supplier keeps its orders and products.

Purchase orders

  1. New order: pick the supplier and the outlet; Stocklane suggests what to order from the reorder points (up to each item's order-up-to level). Change any number. The order shows how far it is from the supplier's free delivery. Order low stock on the list drafts one order per supplier for everything low at an outlet.
  2. Send: an email to the supplier with the order as a PDF attached, on the shop's paper (US Letter for US and Canadian shops, A4 elsewhere), with your copy, reply-to address and message.
  3. Receive any part, any number of times: what arrived now, at the cost on the supplier's invoice, and what happens to the rest (still expected on a date, or not coming). Receiving more than was ordered needs a tick. The page says how each new cost moves the item's average cost, before and after.

An order is a draft, sent, partly received, received or cancelled. Its number looks like PO-0187.

A draft order from the reorder points
A draft order from the reorder points
Receiving part of an order, with the new average cost
Receiving part of an order, with the new average cost

22Stock counts

  1. Start a count at an outlet: everything, a category, a supplier's products or one product. A blind count hides what Stocklane expects. Choose whether the till keeps selling during the count. The expected numbers are taken the moment it starts.
  2. Count: each scan adds one to its line (or jumps to it to type the number), and every count is saved as it is made, so a count can carry on from another device. Finishing asks what happens to lines nobody counted: count them as zero, or leave them as they are.
  3. Review: every line with what was expected, what was counted and the difference at cost. Correct a line or send it back for a recount.
  4. Apply with a reason: counted lines replace the stock with a movement for each difference; lines not counted stay as they are. An applied count can't change.
A count's review: expected, counted and the difference at cost
A count's review: expected, counted and the difference at cost

23Customers, points, store credit and pay later

Customers lists everyone a sale or an invoice was made for, with their tier, points, store credit, what they owe and their visits; tabs for credit, money owed and business customers; filters by home outlet and tier. A customer's profile shows what they spent, their purchases, the points and store credit ledgers (with the balance after every line), their details, dues and a staff note. Cashiers can look, add customers and edit contact details; managers do the rest. Import and Export work with CSV files: customers already in the shop (matched by phone or email) are updated, not doubled, and an import can set opening points but never store credit.

Loyalty points

  • A customer attached to a sale earns points on the sale's net after discounts and before tax (1 point per 1.00 unless the shop changes it), on the part paid with money: the part paid with points or pay later earns nothing at once.
  • Points are spent at the till as a payment (100 points = 1.00 unless changed) and come off at once.
  • A refund takes back the points its items earned; a pay-later sale earns its points when it is paid in full.
  • Tiers (member, silver, gold, by what a customer spent in the last 12 months) are labels only: points work the same for everyone.

Store credit

  • Store credit comes only from a refund to store credit or a paid top-up. Nobody can type credit in.
  • A top-up is sent from the customer's profile to a till with an open shift; the credit lands when that till takes the customer's cash or card payment.
  • Customers spend credit at the till as a payment, and the receipt shows what is left.
  • Only the owner can take credit off, as a correction, with a reason. Every change is in the ledger and the audit log.
  • Expiry is off unless the owner sets it (Settings → Payments → Credit expires: Never, After 12 months or After 24 months). A balance with no credit line for that long (no spend, refund to credit or top-up) goes to zero, with the ledger line "Expired · Not used for 12 months" (or 24). An hourly check does it.

Pay later (customer accounts)

  • The shop allows pay later per customer, with a limit. At the till, "Pay later" puts all or part of a sale on the customer's account, up to what the limit leaves.
  • Collect a payment on the profile: the open dues, the amount (oldest due first; a part payment leaves the rest owing), paid by cash, card or store credit on a till with an open shift.
Customers with their points, store credit and what they owe
Customers with their points, store credit and what they owe
A customer's purchases and their points and credit ledgers
A customer's purchases and their points and credit ledgers

24Invoices and quotes

For business customers who buy on terms. Owners and managers only.

  • New invoice or quote: the customer, the terms and due date (or how long a quote is valid), the outlet its stock comes from, and the lines: a product (search or scan) or a custom line, with quantity, price and tax rate. Totals show tax per rate. Numbers look like INV-0142 and QT-0031.
  • Send emails the customer a link to it, where they can read it, download its PDF and pay. Sending an invoice takes its stock out of the outlet; voiding it puts the stock back.
  • The link opens the invoice without signing in. With the shop's own Stripe connected (chapter 9) the customer pays by card on Stripe's page; otherwise the page shows the shop's bank details. A paid invoice can never be charged twice, and its link closes once it is paid in full.
  • Record a payment that came another way (a bank transfer, cash or card, with its date and reference). Part payments leave the rest due.
  • Reminders: with reminders on, an unpaid invoice gets a reminder the morning after its due date, then a week after each reminder, three at most. Remind sends one now with a fresh link. A customer with an old link can ask for a fresh one.
  • A quote is accepted or declined by the customer from its link (or by you), and an accepted quote converts into a draft invoice with the same lines.
  • Void with a reason. "Overdue" is shown from the due date; nothing needs updating by hand.
An invoice being written, with tax per line
An invoice being written, with tax per line
The page a customer opens from a quote&#39;s link: the quote, its PDF and Accept
The page a customer opens from a quote's link: the quote, its PDF and Accept

25Expenses

Rent, bills and anything paid out of a till's cash, a month at a time: the receipt photo or PDF (up to 10 MB), the amount with the tax inside it, the date, what for, payee, category, outlet and where the money came from. An expense paid from till cash names a till with an open shift and is saved as a cash out of that shift, so the count at closing still balances; deleting it puts the cash back, so it can only be deleted while that shift is open. Tiles show where the money came from; filters, search, the total and a CSV. Owners and managers only.

A month's expenses, with a receipt attached
A month's expenses, with a receipt attached

26Reports

For this month, the last 7 days or today, for every outlet or one. Every figure adds up to the one above it; each tab exports as CSV and prints. Owners see every outlet, managers their own; cashiers have no reports.

TabWhat it shows
SalesSales by day stacked by outlet, refunds, the plan's sales this month, and the money split by category, product, staff and outlet.
ProfitNet sales and cost of goods before tax, profit and margin by category and product, the thinnest margins and the products that earn the most. Refunds take their profit back.
Tax and paymentsTax per rate after refunds (the figure to report), what the tills took by way of payment and what went back out, invoice payments outside the till, and the store credit and points customers hold.
StockStock value at average cost per outlet and category, as it stands now, what is on the way, and the low stock list with the transfer or order that fixes each line.
The profit report by category and product
The profit report by category and product

27Outlets and tills

  • An outlet is one shop front or warehouse: its name, a short code for its receipt numbers (MS), address and phone, opening hours, and whether receipts use the shop's header or the outlet's own lines. Each outlet has its own stock. The plan limits how many a shop has.
  • A register (till) belongs to an outlet: its number and name, the float it opens with, the receipt printer and whether it has a cash drawer. The page shows who is on each one now.
  • The owner adds and changes them; managers look. An outlet that has registers, sales, stock or documents can't be deleted, and a register with an open shift can't be removed.
Outlets with their registers and who is on each
Outlets with their registers and who is on each

28Team and roles

AreaOwnerManagerCashier
Till, parked sales, own shiftYesYesYes
Refunds, discounts over the limit, large cash movesYesYes, and approves others'With a manager's PIN
Sales and shifts listsAllTheir outletsTheir own shifts
Products, stock, transfers, purchase orders, suppliers, countsYesTheir outletsLook up stock only
CustomersYes, plus export and removing creditYes, plus exportLook, add, edit contact details
Invoices and quotes, expenses, reportsYesTheir outletsNo
Outlets, team, settings, planYesLook onlyNo
Audit logYesNoNo
  • Invite by email as a manager or cashier. The link works for 7 days and can be resent or withdrawn. Members and open invites count against the plan's staff logins.
  • Each person's till rights: their role, the outlets they work at (or every outlet), and how much discount they may give without a manager's PIN. Owners always have every outlet and no limit; the last owner can't step down.
  • PINs: the owner sets a new 4-digit PIN for someone (to tell them in person), and sees everyone's discount limits on one screen. Each person can also change their own PIN in their profile (chapter 16).
  • Removing someone signs them out of the shop; their sales and shifts keep their name.
The team with roles, outlets, PINs and discount limits
The team with roles, outlets, PINs and discount limits

29Settings

The owner changes the shop's settings; managers see them; everyone has their own profile.

SectionWhat it sets
Shop profileThe logo, the shop's names, address and contact details, currency, time zone, date format, tax permit and numbering, and the brand colour.
Outlets, TeamChapters 27 and 28.
TaxesThe tax rates, each with what it covers and its letter on the receipt; whether prices include tax; how tax is worked out (chapter 32), with a worked example from a real receipt. A change affects new sales only.
ReceiptsWhat the printed and emailed receipt shows: logo, header and footer lines, paper width (80 or 58 mm), tax per rate, points and store credit, the cashier's name and the returns barcode, and where customers' replies to emailed receipts go, with a live preview of the last sale and a test print.
PaymentsThe ways the tills take money (cash, card on the shop's terminal, store credit, points, pay later), invoices by card through the shop's own Stripe (chapter 9) with pay link and reminder settings, the refund window, selling when stock shows zero, the morning low-stock email, top-ups at the till, when unused store credit expires, and loyalty points (earn, spend, tiers).
Audit logChapter 30 (owner only).
Plan and billingChapter 31.
Your profileYour name and picture, password, your own till PIN, and which notices reach you in this shop by email and in the browser.
Delete shopOwner only, after typing the shop's name: the shop closes at once and its subscription is cancelled (chapter 38).
Receipt settings with the live preview
Receipt settings with the live preview
Payment, refund, store credit and loyalty settings
Payment, refund, store credit and loyalty settings

30Audit log

Every money change, PIN approval and setting change, newest first: who did it, when, at which outlet, and the details. Filter by kind, person, outlet and time, search, and export up to 50,000 lines as CSV. Nothing in it can be changed or deleted from the app. Every change to money or stock writes its audit line in the same database transaction as the change itself. Owner only.

The audit log with its filters
The audit log with its filters

31Plan and billing (in the shop)

The owner sees the plan, its state (the free trial and when it ends, active, past due), the price, renewal and card, this month's use of every limit, the plans to move to (whether each fits what the shop has today), and the billing history with each invoice's PDF from Stripe. Managers can look; cashiers never see billing.

  • Choose a plan opens Stripe Checkout with the plan's monthly or yearly price; the plan switches on when Stripe confirms the payment, usually within seconds. A free plan switches at once.
  • Manage in Stripe opens Stripe's customer portal: card, invoices, cancellation.
  • Cancel keeps the paid plan until the end of the paid period. During a free trial without a card there is nothing to cancel.
  • When a limit is reached, the screen that was refused opens an upgrade dialog with the next plan that has room.
The shop's plan, its use this month and the plans to move to
The shop's plan, its use this month and the plans to move to

32How the numbers work

The rules the server follows for money and stock. Each one has a server test.

  • Money is kept in whole cents and quantities in thousandths (0.840 kg), so nothing is lost to rounding.
  • Amounts show in the shop's currency (Settings → Shop profile) with thousands grouped, such as $1,234.50 or €1,234.50; a currency without its own symbol shows its code (NOK). Plan prices show in each plan's own currency.
  • Tax is worked out per tax rate on that rate's lines after discounts, then shared over those lines, so the lines add up exactly to the tax the receipt prints. Prices can be with tax added (the default) or with tax included. Rounding is half away from zero.
  • A sale is saved once. The till gives each sale its own id; a retry with the same id answers the sale already saved.
  • Payments add up. The payments of a sale (cash counted after change) equal its total. Card, store credit, points and pay later can't exceed what is due.
  • Points are earned only on what was paid, on the net before tax, when the sale completes.
  • Spends are atomic. Points and store credit come off with one conditional database update inside the sale; when two tills try to spend the same balance at once, one of them is refused and nothing of it is saved.
  • Store credit only comes from a refund to credit or a paid top-up. Every change to it, expiry included, is a ledger line with the balance after it.
  • Refunds never return more than was sold or paid, go back the way the sale was paid or to store credit, put stock back unless damaged, and take back points in proportion.
  • Profit uses the average cost of an item at the moment it sold. Receiving stock at a new cost moves the average: (old quantity × old average + received × new cost) ÷ (old quantity + received).
  • Stock changes only through movements, each written with the new level in one transaction under a lock, so twenty sales of the same item at once land exactly.
  • Plan limits are counted under a per-shop lock in the transaction that adds the row, so two requests at once can never pass a limit together.
  • Numbers (receipts, invoices, orders, transfers, counts, shifts) are taken inside the transaction that uses them, so they never repeat or skip.
  • Days and months are cut in the shop's own time zone.
Part 04

Run the platform

33Super-admin

The super-admin is your side of the platform, under /platform. The install wizard makes you its first admin. Give a colleague the admin role (everything) or the viewer role (sees everything, changes nothing) in Users.

Overview

Monthly recurring revenue (a yearly plan counts as a twelfth), shops (active, in a trial, suspended), the sales the shops rang up this month and what they took, revenue over the last 12 months, what needs attention (failed payments, trials ending soon, shops at a limit), the server's health and the newest shops.

Shops

Every shop with its owner, plan and price, outlets, sales this month, products and the one status that matters most; filters by paying, free and suspended and by plan; CSV export. The detail sheet shows the owner, subscription, money paid, this month's usage, members and payments, and lets you:

  • Grant a plan by hand (Stripe is not charged);
  • Suspend with a reason (the shop's owners and managers are told and the shop becomes read-only) or reactivate. A suspension for a failed payment lifts itself when the shop pays; one you set stays until you lift it;
  • Delete: the shop is closed and its paid subscription cancelled, and its payment records are kept;
  • Open as owner, to see exactly what the shop sees. The borrowed session lasts 30 minutes, shows a banner with an Exit button and is written to the audit log; inside it you cannot see or change passwords, keys or other secrets.

Users, plans, payments

  • Users: everyone who can sign in, across all shops, with their shops and roles; suspend a person (which signs them out everywhere) or give them a platform role. You cannot change your own role or suspend yourself.
  • Plans: chapter 8.
  • Payments and subscriptions: this month's money (collected, failed and waiting for a retry, refunded), every payment with its status and why it failed, and every subscription with its status, interval and renewal date.

Settings

SectionWhat it sets
BrandingProduct name, logo, brand colour, support email, Documentation URL and Support URL (chapter 34).
StripeSecret key, publishable key and webhook signing secret, with a live test and the webhook address (chapter 8).
EmailThe SMTP server, a test email, and the wording of the five platform emails (password reset, invite, payment failed, plan limit reached, shop suspended) with a preview (chapter 10).
StorageBucket or local folder, its keys, a live test and the space used (chapter 11).
Sign-upsOpen to everyone, by invite only, or closed; the plan new shops start on.
Legal pagesTerms of service, privacy policy and refund policy in Markdown, shown at /legal/terms, /legal/privacy and /legal/refunds and linked from the public pages and the sign-up form. Write your own: they are your agreement with the shops.
MaintenanceMaintenance mode with your message (shops see a maintenance page; you and your staff keep working), Remove demo data, and this server's facts.
Shops with plan, outlets, sales this month and status
Shops with plan, outlets, sales this month and status
A shop's details: usage, members, payments and actions
A shop's details: usage, members, payments and actions
Payments and subscriptions
Payments and subscriptions
Platform settings
Platform settings

34Rebrand

Super-admin → Settings → Branding changes the product name, the logo, the brand colour and the support email without touching code. They show in the sidebar, the till, the sign-in and sign-up pages, the public landing and pricing pages, the emails and the browser tab. The brand colour recolours every button, active row, badge and chart in light and dark. The logo must be a square PNG, SVG or WebP of at most 1 MB; SVG files with scripts are refused. Each shop can also put its own logo on its receipts (chapter 29).

Help links

Stocklane never links to an address of ours. Two fields in Branding decide where its help links go:

FieldWhere it showsWhen it is empty
Documentation URLThe address where you published this guide (docs/index.html from your download), for example https://help.yourbrand.com/docs. The super-admin menu shows Help and docs, and the setup pages link straight to the right chapter.No docs link in the menu; the setup pages name the file and the chapter to read instead.
Support URLYour own help or contact page, for the shops. Every shop's menu shows Help, which opens it.Help opens an email to the support email instead, or is hidden when that is empty too.

Both must be full addresses starting with https:// (or http://). The shops never see this guide: it is written for you, so the shop's Help link goes to your own support page.

To change the text of the public landing page, the pricing page wording or anything else beyond these settings, edit the React pages (chapter 41) and rebuild.

Search engines

Stocklane answers /robots.txt itself: search engines may index the public pages (landing, pricing, legal pages, sign-in and sign-up), while the shops, the till, the super-admin, the install wizard, invitations, password resets and the API stay closed. With SEARCH_INDEXING=off in .env, for a staging copy, /robots.txt closes every page and every answer also carries X-Robots-Tag: noindex, nofollow. Restart the app after changing it (docker compose up -d).

35Demo mode and the seed commands

Demo mode

DEMO_MODE=true turns an install into a public demo, like the item's live preview. Never turn it on for a real platform. It is not in .env.example and is off unless you add it. With it on:

  • The demo data is added on start: the sample shop Northgate Market with two outlets (Main Street and Harbour Road), three tills, four staff, about 50 products, 60 customers, suppliers, a month of shifts and sales, purchase orders with deliveries, transfers, a stock count, invoices and quotes, expenses and stock history, plus the sample plans and payments for the super-admin.
  • The shop keeps trading: every ten minutes, the sales whose time has come arrive, so the overview and the tills look like a real day.
  • The sign-in page shows one-click sign-ins for the owner, a manager, a cashier and a read-only super-admin. They work inside the marketplace's preview frame too (the session cookie is then SameSite=None; Secure; Partitioned). One address can use them 60 times an hour; after that the page says how long to wait.
  • Plan changes are test checkouts, the install wizard is off, and passwords, till PINs, emails, keys, the shop's Stripe connection, deleting the shop and other risky settings are locked for the demo accounts. Leave SMTP empty on a demo copy, so no email leaves it. The demo shop never sends the low-stock email.
  • The demo data is removed and added again every night at 03:00 UTC.

The demo's one-click accounts and their till PINs exist only in demo data. A buyer's own install has no such accounts.

Seed commands

CommandWhat it does
docker compose exec app stocklane seed-demoAdds 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; --confirm adds the demo shop next to real data anyway (for a staging copy).
docker compose exec app stocklane reset-demoRemoves the demo rows and adds them again. It refuses to run when the database holds any real account, with no way round it.
Super-admin → Settings → Maintenance → Remove demo dataDeletes only rows marked as demo. A demo shop with a real payment is kept.
docker compose exec app stocklane migrateApplies the database migrations and stops (the server also does this on every start).

Real accounts, shops, payments and subscriptions are never marked as demo, so no seed or reset command can touch them. The sample data a new shop gets at sign-up (chapter 12) is separate: it belongs to that shop and its owner removes it.

The public demo's sign-in page with its one-click sign-ins
The public demo's sign-in page with its one-click sign-ins

36Background jobs

Work that talks to outside services or runs on a schedule goes through a job queue kept in PostgreSQL, run by the app itself. There is no separate worker, cron or Redis to set up.

JobWhenWhat it does
housekeepingEvery hourDeletes expired sessions and rate-limit windows, password reset links a day past their expiry, finished jobs older than 14 days and invitations that expired over 30 days ago, ends free trials that ran out (chapter 8), expires unused store credit in shops that chose an expiry (chapter 23), and sends each shop's low-stock email at 07:00 in its time zone (chapter 19).
receipt.emailWhen a receipt is emailedSends the receipt's link to the customer.
till.shift_emailWhen a Z report is emailedSends a closed shift's Z report to the owner.
po.sendWhen a purchase order is sentEmails the order to the supplier with its PDF.
invoice.remindThe morning after an invoice is due, then a week apartSends a reminder while the invoice is unpaid and reminders are on, three at most.
demo.tradeEvery 10 minutes, demo onlyAdds the demo shop's sales whose time has come.
demo.reset03:00 UTC, demo onlyPuts the demo data back.
  • JOB_WORKERS (default 4) sets how many jobs run at once in each copy of the server. Each job is taken by one worker only, even with several copies running.
  • A failed job is tried again after 10 seconds, then twice as long each time, at most an hour apart. A job whose worker stopped is given back after 10 minutes.
  • The hourly and nightly jobs carry a key for their hour or day, so they run once per period however many copies of the server run.

Check that the jobs run

  1. Super-admin → Setup check → Background jobs is green when nothing failed in the last 24 hours and nothing waits longer than 10 minutes.
  2. Below the rows, the job list shows every job with its kind, status, tries and the reason it failed. Retry queues a failed job again.
  3. docker compose logs app shows the same failures. When jobs wait and none run, restart the app with docker compose up -d.
Part 05

Security and privacy

37Security notes

What the server checks and limits, so you can answer the shops' questions and know what to keep safe.

Shops are kept apart

  • The current shop always comes from the signed-in session, never from the request. Every query is filtered by it, and links between rows of a shop are composite database keys, so a row cannot point at another shop's row even by mistake. Another shop's id answers "not found".
  • Roles and outlets are checked by the server on every request; the screens only hide what a role cannot use.

Accounts, sessions and PINs

  • Passwords (at least 10 characters) are hashed with Argon2id. A password change or reset signs the person out on every other device.
  • The session cookie (sl_session) is HttpOnly, Secure on https and SameSite=Lax; it lasts 30 days and is renewed while in use, or only until the browser closes when "Keep me signed in" is off.
  • Every change made with the session cookie must carry the header x-stocklane: 1, which browsers cannot add from another site, so other sites cannot make changes for a signed-in person.
  • Session tokens, password reset links, invites, till devices, receipt links, pay links and approvals are stored only as hashes. Till PINs are stored as a keyed hash; three wrong PINs in a row make a till wait a minute.
  • A manager's PIN approval works for one action on one till, for two minutes, once.
  • Your Stripe keys, the shops' Stripe keys and every secret saved in the super-admin are encrypted with AES-256-GCM, with a key derived from APP_SECRET. Keep APP_SECRET and your backups safe, and never change it after the install.
  • "Open as owner" sessions last 30 minutes, are audit-logged and cannot reveal or change secrets.

Webhooks

  • Your Stripe: every event is checked against its signature and timestamp, and applied once, in the transaction that applies it.
  • Shops' Stripe: each shop's webhook is checked with that shop's own signing secret and applies each invoice payment once (one payment per Stripe payment).

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, chapter 5), never by a plain address:

LimitAllowedWhat it protects
Sign-in, per address20 per 15 minutesSign-in attempts from one address
Sign-in, per account5 per 15 minutesWrong passwords for one account; after five the account waits, even for the right password
Sign-up, per address5 per hourNew accounts from one address
Password reset, per address5 per hourPassword reset emails asked for from one address
Password reset, per account3 per hourPassword reset emails sent to one account
Reset and invite links, per address20 per hourTries at a reset or invite link from one address
Demo sign-in, per address60 per hourPublic demo sign-ins from one address
Invites, per shop50 per hourInvites sent by one shop

Every other API 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. Stripe webhooks are never limited. A refused call answers 429 with a Retry-After header.

Uploads and files

  • Uploads are checked by their content, not their name, against the types and sizes in chapter 11. An SVG logo with scripts or event handlers is refused, and logos are served with a strict content policy.
  • Shop files are private: only signed-in members of the shop can open them.

Money

  • Plans switch on only from verified Stripe events; a shop cannot give itself a plan. Free test checkouts exist only with DEMO_PAYMENTS="true" and no Stripe key, or on the public demo.
  • Every write that changes money or stock runs in one transaction with its audit line. Points and store credit are spent with one conditional update, so parallel requests cannot spend the same balance twice (chapter 32).
  • Payment and subscription records are never deleted with a shop or a plan.
  • The demo seed and reset commands touch only rows marked as demo and refuse to run on a database with real data (chapter 35).

What loads from other servers

The web app loads nothing from other servers: its fonts, icons, barcode scanner and QR code maker are part of the build. Stripe Checkout and the Stripe portal open on Stripe's own pages, and a WhatsApp receipt link opens WhatsApp. No visitor data goes to any other server. Every page is served with a content security policy that runs scripts only from your own site.

Keep it safe

  • Use https (chapter 5), long unique passwords and two-factor sign-in on your Stripe, email and server accounts.
  • Keep .env and your backups private; anyone with APP_SECRET and a backup can read the saved keys.
  • Install Stocklane updates; security fixes are marked as such in the changelog.

38Personal data and deletion

You run the platform, so you are responsible for the personal data in it. This chapter lists where personal data is kept, what is deleted by itself and when, and how to handle a request to delete someone's data. Say the same in your privacy policy (Super-admin → Settings → Legal pages).

Where personal data is kept

TableWhose dataWhat
usersShop staff and your platform staffName, email, picture and a password hash.
sessionsSigned-in peopleA hash of the session cookie, the browser's user agent and times.
invites, password_resetsInvited people, people resetting a passwordEmail and a hash of the link.
customersThe shops' customersName, email, phone, company, tax number, address, staff note, points, store credit and dues.
sales, invoices, the ledgersThe shops' customersWhat they bought and paid, linked to the customer.
shop_members, audit_logShop staffTheir role, outlets and PIN hash; what they did and when.
suppliersSuppliers' contact peopleName, email and phone.
File storage (shops/<shop id>/)VariesProduct photos, expense receipts and logos.

Rate limits keep only keyed hashes of addresses, never a plain IP address. Card numbers never reach Stocklane: cards are typed on Stripe's pages or on the shop's own terminal.

What is deleted by itself

  • Every hour: expired sessions, expired rate-limit windows, password reset links a day after they expired, invitations 30 days after they expired, and finished background jobs (with their email addresses) after 14 days.
  • Nothing else is deleted by itself. Sales, invoices, customers and the audit log are the shops' business records, kept until they are deleted as below. Many countries require shops to keep sales and tax records for several years.

Deleting a shop

The owner (Settings → Delete shop) or you (Super-admin → Shops → Delete) close the shop: it disappears for its members at once, its sessions leave it, and its subscription is cancelled. Its rows stay in the database, so your payment records and Stripe's refunds still find it. To erase a closed shop completely, for example after your own retention period, run these in the Stocklane folder with the shop's id (shown in the super-admin's shop sheet and its address):

docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" "$POSTGRES_DB"' <<'SQL'
begin;
delete from payments where shop_id = 'SHOP-ID';
delete from subscriptions where shop_id = 'SHOP-ID';
delete from shops where id = 'SHOP-ID';   -- removes everything the shop holds
commit;
SQL

Then delete the shop's files from your storage: the folder shops/SHOP-ID/ in your bucket (MinIO, S3, R2) or in the app-storage volume. Staff accounts that belonged only to that shop stay as accounts; delete them as below if asked.

A shop's customer asks to be deleted

  • A customer who has no sales or invoices, owes nothing and holds no store credit can be deleted by a manager or the owner from their profile.
  • A customer with sales or invoices stays on the shop's books. Edit them instead: replace the name with something like "Removed customer" and clear the email, phone, company, tax number, address and staff note. Their purchases keep their amounts without the personal details.

A person asks for their account to be deleted

  1. Each shop owner removes them from the team (an owner must first hand ownership to someone else). You can suspend the account at once in Super-admin → Users.
  2. Delete the account in the database. Their sales, shifts and audit lines stay, without the link to the person:
    docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" "$POSTGRES_DB" -c "delete from users where email = '"'"'person@example.com'"'"'"'

Backups keep deleted data until they are replaced, so keep backups only as long as you need them (chapter 44).

Part 06

For developers

39Every key, explained

Every setting in .env. The outside-service keys can also be set in Super-admin → Settings, which takes precedence. This table is generated from .env.example and the server's own settings code when the release is built.

KeyRequiredWhat it does
Required
APP_URLYesThe public address of the app, without a trailing slash, for example https://pos.example.com. Links in emails, receipt and pay links, the Stripe webhook addresses and secure cookies come from it. Use https on a public server.
APP_SECRETYesA long random string of at least 32 characters (openssl rand -hex 32). It encrypts the Stripe keys and other secrets saved in the app (yours and the shops') and keys the hashed visitor addresses and till PINs. Never change it after the install: saved keys could no longer be read.
POSTGRES_DBNoThe name of the database the stack creates. Default stocklane.
POSTGRES_USERNoThe database user the stack creates. Default stocklane.
POSTGRES_PASSWORDYesThe database password. Letters and digits only, because it goes into a connection address.
DATABASE_URLOutside DockerThe database address, only when you run the server without Docker. Leave it empty with Docker: the stack builds its own from the three keys above.
INSTALL_TOKENNoThe token the install wizard asks for. Empty: a new one is printed in the app's log on first start.
File storage (shop uploads and logos)
STORAGE_DRIVERNos3 (the bundled MinIO, AWS S3 or Cloudflare R2) or local (files in a folder; in Docker a volume). Default s3 in Docker, local without Docker.
S3_ENDPOINTWith s3The storage address. The bundled MinIO is http://minio:9000; for R2 use your account's S3 address; for AWS S3 leave it empty.
S3_REGIONNoThe bucket's region. Default us-east-1; R2 uses auto.
S3_BUCKETNoThe bucket name. Default stocklane; the stack creates it in MinIO.
S3_ACCESS_KEY_IDWith s3The storage access key. With the bundled MinIO this is also its admin user.
S3_SECRET_ACCESS_KEYYesThe storage secret, at least 8 characters. With the bundled MinIO this is also its admin password, so Docker refuses to start without it.
Payments (Stripe; empty = paid plans off)
STRIPE_SECRET_KEYFor paid plansYour Stripe secret key (sk_live_…, or sk_test_… while testing), for selling plans to the shops. Empty: only free plans can be chosen. A shop's own Stripe for its invoices is set in that shop's settings, not here.
STRIPE_WEBHOOK_SECRETFor paid plansThe signing secret of your Stripe webhook endpoint (whsec_…), chapter 8.
STRIPE_PUBLISHABLE_KEYNoYour Stripe publishable key (pk_…); the settings page reads live or test mode from it.
DEMO_PAYMENTSNo"true" turns on a test checkout that changes plans without a card, only while no Stripe secret key is set. Keep "false" on a live site.
Email (SMTP; empty = emails are written to the app's log)
SMTP_HOSTFor emailYour email provider's SMTP server. Empty: emails (resets, invites, receipts, invoices, purchase orders) are written to the app's log instead of being sent.
SMTP_PORTNoThe SMTP port. Default 587.
SMTP_USERNAMEFor emailThe SMTP user name.
SMTP_PASSWORDFor emailThe SMTP password or API key.
SMTP_SECURENostarttls (port 587, the default), tls (port 465) or none.
SMTP_FROMFor emailThe sender, for example Stocklane <hello@example.com>. Use an address on a domain your provider has verified.
Network
APP_PORTNoThe port on this server where the app answers. Default 8080.
APP_BINDNoWhich 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_DOMAINWith CaddyThe domain Caddy gets an HTTPS certificate for: the host of APP_URL, for example shop.example.com.
TRUSTED_PROXY_HOPSNoHow 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 (the default without Docker). Never set it higher than the proxies really in front of the app (chapter 5).
Advanced
COMPOSE_PROJECT_NAMENoOnly 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 Stocklane folder (chapter 5, Two copies on one server).
SEARCH_INDEXINGNoon (the default): search engines may index the public pages (landing, pricing, legal, sign-in), never the app or the API. off, for a staging copy: /robots.txt closes every page and every answer carries X-Robots-Tag: noindex, nofollow.
JOB_WORKERSNoBackground job workers in this server, 1 to 32. Default 4 (chapter 36).
RUST_LOGNoHow much the server logs: info (the default), warn or debug.
Set by Docker, or for development
ASSET_ARCHIVENoFor your own zero-downtime deploys: a folder that keeps older builds' files, so pages still open in a browser keep working.
BINDNoThe address the server listens on. Default 0.0.0.0: plus PORT.
BUILD_TARGETNoHow Docker gets the program: built (the default, built on this server) or prebuilt (uses prebuilt/stocklane, built elsewhere; chapter 5).
DEMO_MODENoOnly for a public demo: true adds the sample shop Northgate Market with one-click sign-ins, keeps its sales coming through the day, locks risky settings and resets the data every night at 03:00 UTC (chapter 35). Never on a live site.
DRAIN_SECSNoFor your own zero-downtime deploys: seconds a stopping server keeps answering while the health check reports it is stopping. Default 0.
LOCAL_STORAGE_DIRSet by DockerThe folder for files with STORAGE_DRIVER=local (/app/storage in Docker, a volume).
PORTSet by DockerThe port the server listens on inside its container (8080).
READY_FILENoFor your own zero-downtime deploys: the health check passes only once this file exists.
STRIPE_API_URLNoFor tests only: another address for Stripe's API.
WEB_DISTSet by DockerWhere the built web app is, when it is not packed into the program.

40File structure

stocklane/
├── apps/
│   ├── backend/                 the Rust server (Axum): crate stocklane-server, program "stocklane"
│   │   ├── src/main.rs          the commands: serve, migrate, health, seed-demo, reset-demo, pack
│   │   ├── src/lib.rs           the HTTP app: /api/health, /api/v1, the web app, middleware
│   │   ├── src/api/             one module per area: auth, public (install, Stripe webhook), shop
│   │   │                        (team), setup (settings, outlets, registers, taxes), overview,
│   │   │                        till/ (till, shifts, sales, refunds, receipts), stock/ (products,
│   │   │                        stock, transfers, counts, suppliers, purchase orders), back/
│   │   │                        (customers, ledgers, invoices, pay page, shop Stripe, expenses,
│   │   │                        reports, audit), sample, events, media, billing, admin
│   │   ├── src/money.rs         tax per rate and the largest-remainder spreads
│   │   ├── src/inventory.rs     the one way stock changes: level, movement, low-stock notice
│   │   ├── src/upkeep.rs        the morning low-stock email and store-credit expiry
│   │   ├── src/numbers.rs       receipt and document numbers
│   │   ├── src/limits.rs        plan limits, counted under a lock
│   │   ├── src/billing.rs       Stripe checkout, portal, webhooks and the free trial
│   │   ├── src/pdf.rs           the PDFs (receipts, Z reports, invoices, purchase orders)
│   │   ├── src/jobs.rs          the background job queue (PostgreSQL, FOR UPDATE SKIP LOCKED)
│   │   ├── src/settings.rs      super-admin settings over .env
│   │   ├── src/setup_check.rs   the setup check rows and live tests
│   │   ├── src/rate_limit.rs    visitor addresses and limits
│   │   ├── src/realtime.rs      the live event stream (Server-Sent Events)
│   │   ├── src/demo.rs, sample/ sample plans, the demo shop and new shops' sample data
│   │   ├── tests/               server tests (need a PostgreSQL, see chapter 41)
│   │   └── README.md            every module of the server, for developers
│   └── frontend/                the web app (React Router 7, Vite, Tailwind CSS 4)
│       ├── src/routes.ts        every page: URL → file
│       ├── src/pages/           shop/ (one folder per screen, till/ included), platform/
│       │                        (super-admin), auth/, install/, public/ (site, receipt, pay page)
│       ├── src/components/ui/   shadcn/ui components
│       ├── src/ui/              tables, sheets, charts, toasts shared by the pages
│       ├── src/layout/          the app shell, sidebar and sign-in guard
│       ├── src/api/             the API client and types
│       ├── src/lib/             barcode drawing, scanning, dates
│       ├── src/styles.css       colours, fonts and sizes (design tokens)
│       ├── e2e/                 browser tests (Playwright)
│       └── README.md            the web app's stack, scripts, folders and build
├── 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

41Customise and rebuild

Run it for development

  1. 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.
  2. Start the server from apps/backend: cargo run (it reads .env from the folder or the ones above it and listens on port 8080).
  3. 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 (API_ORIGIN changes that). Screens reload as you save.

Change the web app

  • apps/frontend/README.md explains the web app's stack, its scripts and folders, changing the brand and the production build.
  • Colours, fonts and sizes live in apps/frontend/src/styles.css as CSS variables (for example --brand). The brand colour set in Super-admin → Branding overrides --brand at run time.
  • Pages are in apps/frontend/src/pages/, one folder per area; src/routes.ts maps each URL to its file. The public landing and pricing pages are src/pages/public/Landing.tsx and Pricing.tsx; the till is src/pages/shop/till/.
  • Components are shadcn/ui (src/components/ui/) on the Base UI and Radix primitives, with Lucide icons.
  • Checks: pnpm typecheck, pnpm lint (Biome), pnpm test (Vitest) and pnpm e2e (Playwright).

Change the server

  • Each area of the API is one module or folder in apps/backend/src/api/; its routes() function lists the addresses. The money and stock rules are in money.rs, inventory.rs and limits.rs; apps/backend/README.md lists every module and what it does.
  • 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.
  • Checks: cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace. The server tests need a PostgreSQL user that may create databases: TEST_DATABASE_URL=postgres://user:password@127.0.0.1:5432/postgres cargo test -p stocklane-server (each test gets a fresh database); without it they say so and pass. cargo deny check checks advisories and licences.

Worked example: add an API route

Say a shop wants to know how many receipts a customer has. In apps/backend/src/api/back/customers.rs, add the address to routes():

.route("/customers/{id}/receipt-count", get(receipt_count))

and the handler. Taking Cashier makes it work for any member of the current shop; the query filters by ws.id, so it can never read another shop:

/// How many sales a customer has at this shop.
async fn receipt_count(
    State(state): State<AppState>,
    Cashier(ws): Cashier,
    Path(id): Path<Uuid>,
) -> ApiResult<Json<Value>> {
    let n: i64 = sqlx::query_scalar(
        "select count(*) from sales where shop_id = $1 and customer_id = $2 and kind = 'sale'",
    )
    .bind(ws.id)
    .bind(id)
    .fetch_one(&state.db)
    .await?;
    Ok(Json(json!({ "receipts": n })))
}

In the web app, call it with the shared client, which adds the session and the security header:

import { get } from "@/api/client";
const { receipts } = await get<{ receipts: number }>(`/customers/${customerId}/receipt-count`);

Then rebuild (below). Add a test next to the others in apps/backend/tests/api/.

Rebuild and deploy your changes

docker compose up -d --build                    # or with --profile https on your server

Docker rebuilds only what changed, and a change to the web app alone reuses the compiled server and is quicker still. Keep your changes in a Git repository, so you can compare them with each new Stocklane version.

42API reference

The web app and the till use the same /api/v1 API. These 230 addresses are generated from the server code when the release is built.

  • JSON in and out with camelCase keys; times in ISO 8601 UTC; money in whole cents (…Cents); quantities as numbers with up to three decimals (0.815 kg).
  • Errors: {"error": {"code": "…", "message": "…", "details": {…}}}. Common codes: bad_request (400), unauthorized (401), plan_limit (402, with details.limit one of outlets, staff, products, salesMonth, storageMb), forbidden, csrf, demo_locked, shop_suspended, wrong_pin (403), not_found (404), conflict, insufficient_points, insufficient_credit (409), rate_limited (429), unavailable, maintenance (503).
  • Lists: ?page=1&size=50 plus each list's filters → {rows, total, page, size}. Many lists also export the same filters as CSV at …/export.csv.
  • "Member" means any member of the current shop (a cashier and up); "Manager" a manager or owner; "Owner" the owner; "Super-admin (viewer reads)" lets the read-only viewer role read too.
  • POST /sales takes a clientRef (a uuid made when the cart starts): a retry with the same one answers the saved sale with replayed: true.
  • Live events: GET /api/v1/events is a Server-Sent Events stream for the current shop, with a ping every 25 seconds.
MethodAddressWho may call itWhat it does
System
GET/api/healthAnyone200 while the server is serving, 503 while a new copy takes over (the health check and proxies read it)
GET/api/app-versionAnyoneThe running build, so open pages can offer a reload after an update
GET/robots.txtAnyoneTells search engines which pages they may index: the public pages, or none with SEARCH_INDEXING=off
Public pages, install and the Stripe webhooks
GET/api/v1/public/configAnyoneBrand, sign-up mode, legal pages, maintenance, whether the install has run and the demo sign-ins, for the pages before sign-in
GET/api/v1/public/plansAnyoneThe public plans for the pricing page
GET/api/v1/public/legal/{slug}AnyoneA legal page (terms, privacy or refunds) in Markdown
GET/api/v1/install/statusAnyone, until the install is done (install token)Whether the install wizard has run and the database answers
POST/api/v1/install/checkAnyone, until the install is done (install token)Checks the install token and runs the server checks
POST/api/v1/install/completeAnyone, until the install is done (install token)Creates the super-admin, the product name and the optional sample plans; runs once
POST/api/v1/webhooks/stripeStripe (signed webhook)Events from your Stripe account: signature checked, each event applied once
GET/api/v1/public/shop-picture/{ws}/{file}AnyoneA shop logo file, without sign-in (the name holds the file's hash, so it is cached for a year)
GET/api/v1/public/receipts/{token}Anyone with the linkThe receipt a customer opens from its link, without signing in
GET/api/v1/public/receipts/{token}/receipt.pdfAnyone with the linkThe same receipt as a PDF, without signing in
GET/api/v1/public/pay/{token}Anyone with the linkThe invoice or quote behind a link, without signing in
POST/api/v1/public/pay/{token}/checkoutAnyone with the linkStarts paying an open invoice by card on Stripe's page, through the shop's own Stripe
POST/api/v1/public/pay/{token}/fresh-linkAnyone with the linkEmails a fresh link to the customer's address on file when an old link stopped working
GET/api/v1/public/pay/{token}/pdfAnyone with the linkThe invoice or quote as a PDF, without signing in
GET/api/v1/public/pay/{token}/receipt.pdfAnyone with the linkThe receipt of the card payment, without signing in
POST/api/v1/public/quotes/{token}/acceptAnyone with the linkThe customer accepts a quote
POST/api/v1/public/quotes/{token}/declineAnyone with the linkThe customer declines a quote
POST/api/v1/stripe/shops/{shop}/webhookThe shop's own Stripe (signed webhook)Events from a shop's own Stripe: checked with the shop's signing secret, each payment applied once
GET/api/v1/public/logo/{file}AnyoneThe brand logo file, without sign-in (the name changes with the file, so it is cached)
Sign-in and account
POST/api/v1/auth/registerAnyoneCreates an account and its first shop, with or without sample data (when sign-ups are open)
POST/api/v1/auth/loginAnyoneSigns in with email and password; after five wrong passwords the account waits
POST/api/v1/auth/logoutSigned inSigns out of this browser
GET/api/v1/auth/meSigned inThe signed-in person, their shops, the current shop and what their role may do
GET/api/v1/auth/sessionAnyoneThe same as /auth/me when signed in, or no one
POST/api/v1/auth/switch-shopSigned inMakes another of the person's shops the current one
POST/api/v1/auth/shopsSigned inCreates another shop with the person as owner
POST/api/v1/auth/forgotAnyoneEmails a password reset link (always answers ok, so it never tells whether an account exists)
POST/api/v1/auth/resetAnyoneSets a new password from a reset link and signs in; each link works once
GET/api/v1/auth/reset/{token}AnyoneWhose reset link this is (404 when it expired or was used)
POST/api/v1/auth/impersonation/exitSigned inEnds an "open as owner" session and goes back to the super-admin's own
GET/api/v1/auth/invites/{token}AnyoneThe shop, role and email of an invitation link
POST/api/v1/auth/invites/acceptAnyoneAccepts an invitation, creating the account when needed
PATCH/api/v1/auth/profileSigned inChanges the person's name, email or picture
POST/api/v1/auth/passwordSigned inChanges the password (the current one is asked for) and ends the person's other sessions
POST/api/v1/auth/demoAnyone, public demo onlyOne-click sign-in as the demo owner, manager, cashier or read-only super-admin
POST/api/v1/me/pinMemberThe signed-in member sets their own 4-digit till PIN
Shop, outlets, team, files and live events
GET/api/v1/shopMemberThe current shop
PATCH/api/v1/shopOwnerChanges the shop's name, time zone, business hours or settings
DELETE/api/v1/shopOwnerCloses the shop after its name is typed, and cancels its subscription
GET/api/v1/teamMemberThe members with their till rights and, for managers, the open invitations
POST/api/v1/team/invitesOwnerInvites someone by email as manager or cashier (counted against the plan's staff logins)
POST/api/v1/team/invites/{id}/resendOwnerSends an invitation again with a new link
DELETE/api/v1/team/invites/{id}OwnerWithdraws an invitation
PATCH/api/v1/team/members/{id}OwnerChanges a member's role, outlets or discount limit
DELETE/api/v1/team/members/{id}OwnerRemoves a member (never the last owner) and signs them out of the shop
PATCH/api/v1/team/{member}OwnerChanges a member's role, outlets or discount limit (the same as /team/members/{id})
POST/api/v1/team/{member}/pinOwnerSets a member's 4-digit till PIN, to tell them in person
POST/api/v1/shop/pictureManagerUploads the shop logo (PNG, JPEG or WebP up to 1 MB)
DELETE/api/v1/shop/pictureManagerRemoves the shop logo
POST/api/v1/shop/logoOwnerUploads the shop logo from the settings pages and answers the settings
GET/api/v1/notifications/preferencesMemberMy notice choices in this shop: per event, email and browser
PUT/api/v1/notifications/preferencesMemberSaves my notice choices
GET/api/v1/overviewMemberThe overview page in one answer: today's figures, sales by hour, tills, outlets, low stock, best sellers and what needs attention
GET/api/v1/overview/countsMemberThe sidebar's badges and the bell's dot
GET/api/v1/notificationsMemberThe newest notices with the member's read marks and the unread count
POST/api/v1/notifications/read-allMemberMarks every notice the member sees as read
POST/api/v1/shop/access-requestMemberTells the owner that this member asked to open a page their role can't
GET/api/v1/shop/settingsManagerEverything the settings pages show: profile, taxes, receipts, payments and loyalty
PATCH/api/v1/shop/settingsOwnerChanges any part of the shop's settings; the rest stay
GET/api/v1/outletsMemberThe shop's outlets with their registers
POST/api/v1/outletsOwnerAdds an outlet, within the plan's outlets
PATCH/api/v1/outlets/{id}OwnerChanges an outlet's details, hours or receipt header
DELETE/api/v1/outlets/{id}OwnerDeletes an outlet that has no registers, sales, stock or documents
GET/api/v1/registersMemberThe shop's registers by outlet and number
POST/api/v1/registersOwnerAdds a till to an outlet
PATCH/api/v1/registers/{id}OwnerRenames a register or changes its float, printer or cash drawer
DELETE/api/v1/registers/{id}OwnerRemoves a register, never while a shift is open on it
GET/api/v1/taxesMemberThe shop's tax rates, the default first
POST/api/v1/taxesOwnerAdds a tax rate
PATCH/api/v1/taxes/{id}OwnerRenames a rate, changes its percent, receipt letter or what it covers, or makes it the default
DELETE/api/v1/taxes/{id}OwnerRemoves a rate that no product uses and that is not the default
GET/api/v1/shop/stripeManagerWhether the shop's own Stripe is connected, and its webhook address
PUT/api/v1/shop/stripeOwnerConnects the shop's own Stripe with its secret key and webhook signing secret (checked with Stripe, stored encrypted)
DELETE/api/v1/shop/stripeOwnerDisconnects the shop's own Stripe; pay links stop taking cards
POST/api/v1/shop/sample-data/removeOwnerRemoves the shop's sample data after REMOVE is typed; anything real work uses is kept
GET/api/v1/eventsMemberThe live update stream (Server-Sent Events) for the current shop
POST/api/v1/mediaMemberUploads a shop file (type checked by content, within the plan's file storage)
GET/api/v1/media/{id}MemberDownloads a shop file (members of that shop only)
Till, shifts and sales
GET/api/v1/till/bootstrapMemberEverything a till needs to start on a register: shop, outlet, shift, cashier, settings, taxes, ways to pay and plan use
GET/api/v1/till/catalogMemberEvery sellable variant with its price, tax, unit and stock at the outlet
GET/api/v1/till/customersMemberThe till's customer search (the latest buyers without a search)
POST/api/v1/till/customersMemberAdds a customer from the till
GET/api/v1/till/topupsMemberStore-credit top-ups waiting to be paid at this register
POST/api/v1/till/devicesManagerSets this browser up as the till of one register, so staff can switch on it with their PIN
POST/api/v1/till/pinMemberUnlocks the till for the member whose PIN it is (three wrong PINs make the till wait a minute)
POST/api/v1/till/lockMemberLocks the till between customers
POST/api/v1/till/approveMemberA manager's or owner's PIN for one action on this till; the token works once, for two minutes
GET/api/v1/parkedMemberThe sales parked on a register, newest first
POST/api/v1/parkedMemberParks a cart on a register
DELETE/api/v1/parked/{id}MemberDeletes a parked sale with a reason, or after it was recalled
GET/api/v1/shiftsMemberShifts with their figures, the week's tiles and the filter choices
GET/api/v1/shifts/export.csvMemberThe filtered shifts as CSV
POST/api/v1/shifts/openMemberOpens a shift on a register with its counted float
GET/api/v1/shifts/{id}MemberOne shift with its Z report figures
POST/api/v1/shifts/{id}/cashMemberCash into or out of the drawer, with a reason (a manager's approval over the shop's limit)
POST/api/v1/shifts/{id}/closeMemberCloses a shift with its counted drawer (a note when the difference is over the shop's limit)
POST/api/v1/shifts/{id}/emailManagerEmails a closed shift's Z report to the owner
GET/api/v1/shifts/{id}/z.pdfMemberThe Z report as an A4 or Letter PDF
GET/api/v1/salesMemberOne page of sales with the tiles, refunds and filter choices
POST/api/v1/salesMemberCompletes a sale, a top-up or a payment on dues; a retry with the same clientRef answers the saved sale
GET/api/v1/sales/export.csvMemberThe filtered sales as one CSV, with their lines, payments and refunds as asked
GET/api/v1/sales/{id}MemberOne sale in full
POST/api/v1/sales/{id}/refundMemberRefunds lines of a sale to the original ways of payment or to store credit
GET/api/v1/sales/{id}/receipt.pdfMemberThe receipt as an A4 or Letter PDF
POST/api/v1/sales/{id}/emailMemberEmails the receipt's link to the customer
Products and stock
GET/api/v1/productsManagerOne page of products by tab (all, low, out, archived), category and supplier, with stock per outlet
POST/api/v1/productsManagerAdds a product with its variants and opening stock (an active product counts toward the plan)
GET/api/v1/products/optionsMemberThe outlets, categories, suppliers, taxes and units the product forms pick from
GET/api/v1/products/export.csvManagerEvery active variant with its prices, codes and stock per outlet, in the import's columns
POST/api/v1/products/import/checkManagerChecks the rows of a product CSV against the catalog before anything is saved
POST/api/v1/products/import/applyManagerImports the checked rows, within the plan's products
POST/api/v1/products/import/{id}/undoManagerTakes an import back within a day
GET/api/v1/products/{id}ManagerOne product with its variants, stock, photos, last delivery and recent movements
PATCH/api/v1/products/{id}ManagerChanges a product, or archives it or brings it back
DELETE/api/v1/products/{id}ManagerDeletes a product that never sold or moved; others are archived instead
POST/api/v1/products/{id}/imagesManagerAdds a JPEG, PNG or WebP photo up to 5 MB (it counts toward the plan's file storage)
DELETE/api/v1/products/{id}/images/{image}ManagerRemoves a photo and its file
GET/api/v1/categoriesManagerThe categories with their tax, till tab and stock value, and the units
POST/api/v1/categoriesManagerAdds a category at the end of the till's tabs
PATCH/api/v1/categories/{id}ManagerRenames a category, or changes its icon, tax rate, till tab or place
DELETE/api/v1/categories/{id}ManagerDeletes an empty category
POST/api/v1/unitsManagerTurns on a unit the shop sells by
GET/api/v1/variantsMemberVariants whose name, SKU or barcode match a search
GET/api/v1/variants/lookupMemberOne variant by barcode or SKU, as scanned, or 404
GET/api/v1/labelsManagerThe chosen variants with their prices and codes, for printing labels
GET/api/v1/stockMemberOne page of stock levels per outlet, with what is low, out or on the way
GET/api/v1/stock/movesMemberOne page of stock movements by outlet, product, kind and day
POST/api/v1/stock/adjustManagerAdds or takes off stock by hand, with a reason
PATCH/api/v1/stock/{variant}/{outlet}ManagerSets an item's reorder point and order-up-to level at an outlet
GET/api/v1/transfersManagerOne page of transfers by status and destination
POST/api/v1/transfersManagerStarts a draft transfer with its number
GET/api/v1/transfers/{id}ManagerOne transfer with its lines
PATCH/api/v1/transfers/{id}ManagerChanges a draft's outlets, note and lines
DELETE/api/v1/transfers/{id}ManagerDeletes a draft transfer (nothing has moved yet)
POST/api/v1/transfers/{id}/sendManagerSends a transfer: the stock leaves the source now
POST/api/v1/transfers/{id}/receiveManagerReceives a transfer at its destination, with a reason for anything short
GET/api/v1/countsManagerOne page of stock counts at the member's outlets
POST/api/v1/countsManagerStarts a count of an outlet, a category, a supplier's products or one product
GET/api/v1/counts/{id}ManagerOne count with its lines
PATCH/api/v1/counts/{id}ManagerMoves a count between counting and review, and changes its settings
DELETE/api/v1/counts/{id}ManagerCancels a count that hasn't been applied (nothing moves)
PATCH/api/v1/counts/{id}/linesManagerSaves counted numbers as they are made
POST/api/v1/counts/{id}/applyManagerApplies a finished count with a reason: each counted difference becomes a stock movement
GET/api/v1/suppliersManagerOne page of suppliers with what is on order with each
POST/api/v1/suppliersManagerAdds a supplier
GET/api/v1/suppliers/{id}ManagerOne supplier with their products and last orders
PATCH/api/v1/suppliers/{id}ManagerChanges a supplier, or brings an archived one back
DELETE/api/v1/suppliers/{id}ManagerArchives a supplier (their orders and products stay)
GET/api/v1/purchase-ordersManagerOne page of purchase orders by status, supplier and outlet
POST/api/v1/purchase-ordersManagerStarts a draft purchase order
GET/api/v1/purchase-orders/suggestManagerWhat the reorder points suggest ordering from a supplier for an outlet
POST/api/v1/purchase-orders/low-stockManagerDrafts one order per supplier for everything low at an outlet
GET/api/v1/purchase-orders/{id}ManagerOne purchase order with its lines and deliveries
PATCH/api/v1/purchase-orders/{id}ManagerChanges a draft order
DELETE/api/v1/purchase-orders/{id}ManagerDeletes a draft that was never sent
POST/api/v1/purchase-orders/{id}/sendManagerEmails the order to the supplier with its PDF and marks it sent
POST/api/v1/purchase-orders/{id}/receiveManagerReceives any part of an order at the invoice's cost, updating the average cost
GET/api/v1/purchase-orders/{id}/pdfManagerThe purchase order as a PDF
Customers, invoices and expenses
GET/api/v1/customersMemberOne page of customers by tab (credit, owes, business), home outlet, tier and search
POST/api/v1/customersMemberAdds a customer with the shop's next customer number
GET/api/v1/customers/export.csvManagerEvery customer with their points, store credit and dues as CSV
POST/api/v1/customers/import/checkManagerShows what a customers CSV would add and update, and which rows would be skipped
POST/api/v1/customers/import/applyManagerAdds the new customers with their opening points and updates the ones already in the shop
GET/api/v1/customers/{id}MemberOne customer in full
PATCH/api/v1/customers/{id}MemberChanges a customer (cashiers change contact details only)
DELETE/api/v1/customers/{id}ManagerDeletes a customer who has no sales or invoices, owes nothing and holds no store credit
GET/api/v1/customers/{id}/historyMemberThe customer's purchases, refunds, top-ups and payments on dues, newest first
GET/api/v1/customers/{id}/ledgerMemberThe customer's points or store credit lines, with the balance after each
POST/api/v1/customers/{id}/credit/removeOwnerTakes store credit off a customer, with a reason
POST/api/v1/customers/{id}/topupsMemberSends a store-credit top-up to a till with an open shift; the credit lands when the till takes the payment
DELETE/api/v1/customers/{id}/topups/{topup}MemberCalls back a top-up the till has not taken yet
POST/api/v1/customers/{id}/dues/payMemberCollects a payment on a customer's pay-later dues at a till with an open shift
GET/api/v1/invoicesManagerA month's invoices and quotes by tab (unpaid, quotes, drafts), customer and search
POST/api/v1/invoicesManagerStarts a draft invoice or quote with the next number of its kind
GET/api/v1/invoices/export.csvManagerA month's invoices and quotes as CSV
GET/api/v1/invoices/productsManagerThe products a line can pick, with price, tax rate and stock per outlet
GET/api/v1/invoices/{id}ManagerOne invoice or quote in full
PATCH/api/v1/invoices/{id}ManagerChanges a draft, or an accepted quote before it becomes an invoice
DELETE/api/v1/invoices/{id}ManagerDeletes a draft
POST/api/v1/invoices/{id}/sendManagerSends an invoice or quote and emails the customer its link (an invoice takes its stock out)
POST/api/v1/invoices/{id}/remindManagerSends a reminder now, with a fresh pay link
POST/api/v1/invoices/{id}/paymentsManagerRecords a payment made by bank transfer, cash or card
POST/api/v1/invoices/{id}/voidManagerVoids an invoice or quote with a reason (an invoice's stock goes back)
POST/api/v1/invoices/{id}/convertManagerTurns an accepted quote into a draft invoice with the same lines
GET/api/v1/invoices/{id}/pdfManagerThe invoice or quote as a PDF
GET/api/v1/expensesManagerA month's expenses by where the money came from, category and outlet
POST/api/v1/expensesManagerAdds an expense; till cash comes out of that till's open shift
GET/api/v1/expenses/export.csvManagerA month's expenses as CSV
PATCH/api/v1/expenses/{id}ManagerChanges an expense
DELETE/api/v1/expenses/{id}ManagerDeletes an expense; one paid from till cash only while its shift is open
POST/api/v1/expenses/{id}/receiptManagerAttaches the receipt photo or PDF, up to 10 MB
Reports and audit log
GET/api/v1/reports/salesManagerThe sales report: by day and outlet, refunds, and split by category, product, staff and outlet
GET/api/v1/reports/profitManagerThe profit report: net sales and cost before tax, by category and product
GET/api/v1/reports/taxManagerThe tax and payments report: tax per rate after refunds, takings by way of payment, invoice payments, credit and points held
GET/api/v1/reports/stock-valueManagerThe stock report: value at average cost per outlet and category, what is on the way and what is low
GET/api/v1/auditOwnerOne page of the shop's audit log, newest first
GET/api/v1/audit/export.csvOwnerThe audit log for the filters as CSV (up to 50,000 lines)
Billing
GET/api/v1/billingManagerThe shop's plan, subscription or free trial, this month's usage, invoices and card
GET/api/v1/billing/plansManagerThe plans a shop can choose
POST/api/v1/billing/checkoutOwnerStarts a plan change: a Stripe Checkout link, a test checkout or a switch to a free plan
POST/api/v1/billing/portalOwnerA link to the Stripe customer portal
POST/api/v1/billing/cancelOwnerCancels the paid plan at the end of the paid period
Super-admin
GET/api/v1/admin/overviewSuper-admin (viewer reads)Revenue, shops, sales this month, sign-ups and what needs attention
GET/api/v1/admin/shopsSuper-admin (viewer reads)Shops with search, status and plan filters, sorting and paging
GET/api/v1/admin/shops/{id}Super-admin (viewer reads)One shop with its owner, usage, members, subscription and payments
PATCH/api/v1/admin/shops/{id}Super-adminGrants a plan, or suspends or reactivates a shop
DELETE/api/v1/admin/shops/{id}Super-adminCloses a shop and cancels its paid subscription; payment records stay
POST/api/v1/admin/shops/{id}/impersonateSuper-admin"Open as owner": a 30-minute session as the shop's owner, written to the audit log
GET/api/v1/admin/usersSuper-admin (viewer reads)Everyone on the platform, by search, platform role and status
PATCH/api/v1/admin/users/{id}Super-adminChanges a person's platform role or suspends them
GET/api/v1/admin/plansSuper-admin (viewer reads)Every plan, archived ones too, with its Stripe price IDs and shop count
POST/api/v1/admin/plansSuper-adminCreates a plan
POST/api/v1/admin/plans/check-priceSuper-adminReads a Stripe price ID from Stripe and answers its amount and interval
PATCH/api/v1/admin/plans/{id}Super-adminChanges a plan's prices, Stripe IDs, limits or features
DELETE/api/v1/admin/plans/{id}Super-adminTakes a plan off sale; its shops keep it
POST/api/v1/admin/plans/{id}/restoreSuper-adminPuts an archived plan back on sale
GET/api/v1/admin/paymentsSuper-admin (viewer reads)Every payment, with filters and this month's totals
GET/api/v1/admin/subscriptionsSuper-admin (viewer reads)Every subscription with its status, interval and renewal date
GET/api/v1/admin/settingsSuper-admin (viewer reads)Every settings section (secrets masked), server facts and storage use
POST/api/v1/admin/settings/branding/logoSuper-adminUploads the brand logo (PNG, SVG or WebP up to 1 MB, checked by content)
PUT/api/v1/admin/settings/{section}Super-adminSaves one settings section (secrets stored encrypted; an empty secret keeps the saved one)
GET/api/v1/admin/emailsSuper-admin (viewer reads)The platform emails with their built-in and saved wording
GET/api/v1/admin/setup-checkSuper-admin (viewer reads)Every setup check row
POST/api/v1/admin/setup-check/{id}/testSuper-adminTests one setup check row against the real service
GET/api/v1/admin/jobsSuper-admin (viewer reads)Background jobs by status and kind, with counts per status
POST/api/v1/admin/jobs/{id}/retrySuper-adminQueues a failed job again
POST/api/v1/admin/demo-data/removeSuper-adminRemoves the demo data (demo-marked rows only)

43Database

PostgreSQL. The schema is in migrations/ and is applied by the server on start. Ids are UUIDs, times are UTC, money is in whole cents and quantities in thousandths (…_milli). Every shop table carries shop_id; deleting a shop row removes everything it holds once its payments and subscriptions are gone (chapter 38). These 56 tables are generated from the migrations when the release is built.

TableWhat it holdsKeysPoints to
Accounts and sign-in
usersEvery person who can sign in: shop staff and your platform staff, with their super-admin role (none, admin or viewer)primary key id; unique email (any case)–
sessionsSigned-in browsers (only a hash of the cookie is stored), including PIN-switch sessions on a till and super-admin "open as owner" sessionsprimary key id; unique token_hashusers, shops, till_devices
password_resetsPassword reset links (hashed, valid for one hour, used once)primary key id; unique token_hashusers
invitesOpen invitations to a shop, with the role to join as (manager or cashier)primary key id; unique token_hash; unique email (any case) per shop, when accepted_at is nullshops, users
rate_limitsFixed-window counters for sign-in, sign-up, reset and till PIN limits (keyed by a hash, never a plain address)primary key key–
Shops, outlets and team
shopsThe tenants: your customers' businesses, with their plan, free trial end, Stripe customer, time zone, currency and selling settingsprimary key id; unique slug; unique stripe_customer_idplans, users
shop_membersWho belongs to a shop: their role (owner, manager or cashier), till PIN hash, discount limit and whether they work at every outletprimary key shop_id + user_id; unique pin_hash per shop, when pin_hash is not nullshops, users
member_outletsThe outlets a member works at, when not all of themprimary key shop_id + user_id + outlet_idshops, shop_members, outlets
outletsA shop's outlets (shop fronts or warehouses), with their receipt code, address, hours and receipt headerprimary key id; unique code per shopshops
registersThe tills of an outlet, with their number, opening float, printer and cash drawerprimary key id; unique outlet_id + numbershops, outlets
taxesA shop's tax rates in basis points, with their receipt letter; one is the defaultprimary key id; unique per shop, when is_default and archived_at is nullshops
till_devicesBrowsers set up by an owner or manager to run one register, so staff can switch on them with their PINprimary key id; unique token_hashshops, users, registers
shop_countersThe next number per shop and kind (receipts per register, invoices, quotes, orders, transfers, counts, shifts), taken inside the transaction that uses itprimary key shop_id + kindshops
audit_logMoney changes, approvals and setting changes made in a shop, and the super-admin's actions on itprimary key idshops, users
notificationsThe bell's notices for a shop (payments, low stock, deliveries, transfers, shifts, limits, access requests) and who sees themprimary key idshops
notification_readsWhich member has read which noticeprimary key notification_id + user_idnotifications, users
mediaFiles a shop uploaded; their sizes count toward the plan's file storageprimary key idshops
Products and stock
categoriesProduct categories: the till's tabs, in order, with a default tax rateprimary key id; unique name (any case) per shopshops, taxes
productsThe catalog: name, category, supplier, unit, tax, whether stock is tracked, and the till's optionsprimary key idshops, categories, taxes, suppliers
variantsEach sellable version of a product, with its SKU, barcode, price, cost and average costprimary key id; unique sku (any case) per shop; unique barcode per shop, when barcode is not nullshops, products
product_imagesA product's photos in order; a photo may belong to one variant (the file is a media row)primary key idshops, products, variants, media
product_importsProduct CSV imports, with the products each one made and the old values it changed, so an import can be undone within a dayprimary key idshops, users
stock_levelsStock on hand per variant and outlet, with its reorder point and order-up-to levelprimary key variant_id + outlet_idshops, variants, outlets
stock_movesEvery change to stock, with its kind, quantity, who and why, written in the transaction that changes the levelprimary key idshops, users, variants, outlets
suppliersWho a shop buys from, with contact details, terms, lead time and free-delivery amountprimary key id; unique name (any case) per shopshops
purchase_ordersOrders to suppliers for an outlet, from draft to receivedprimary key id; unique number per shopshops, users, suppliers, outlets
po_linesThe lines of a purchase order, with what was ordered and what was received so farprimary key idpurchase_orders, variants
po_receiptsEach delivery against a purchase order: what arrived, at what cost, and the supplier's invoiceprimary key idshops, users, purchase_orders
transfersStock moving between two outlets, from draft to receivedprimary key id; unique number per shopshops, users, outlets
transfer_linesThe lines of a transfer, with what was sent and what was receivedprimary key idtransfers, variants
stock_countsStock counts of an outlet (everything, a category, a supplier or one product), blind or notprimary key id; unique number per shopshops, users, outlets
count_linesThe lines of a count: what was expected when it started and what was countedprimary key id; unique count_id + variant_idstock_counts, variants, users
Till, shifts and sales
shiftsTill shifts: one open per register at most, with the float, expected and counted cash, the denominations and the close noteprimary key id; unique number per shop; unique register_id, when status = 'open'shops, users, outlets, registers
cash_movesCash put into or taken out of a drawer during a shift, with its reason and who approved itprimary key idshops, users, shifts, expenses
salesSales, refunds, store-credit top-ups and payments on dues, each with its receipt number and the till's own id (one sale per id)primary key id; unique receipt_token_hash; unique number per shop; unique client_ref per shopshops, users, outlets, registers, shifts, customers
sale_linesThe lines of a sale, with their tax, cost at the time of sale and how much was refundedprimary key idsales, variants
sale_paymentsHow a sale was paid: cash, card, store credit, points or pay laterprimary key idsales
parked_salesCarts parked on a register, to be recalled laterprimary key idshops, users, outlets, registers, customers
till_approvalsA manager's or owner's PIN approval for one action on one till, valid for 2 minutes and used onceprimary key id; unique token_hashshops, users
Customers, invoices and expenses
customersA shop's customers, with their contact details, points, store credit, pay-later limit and what they oweprimary key id; unique number per shop, when number is not nullshops, users, outlets
loyalty_ledgerEvery change to a customer's points, with the balance after itprimary key idshops, users, customers, sales
credit_ledgerEvery change to a customer's store credit (refunds, top-ups, spends, removals, expiry), with the balance after itprimary key idshops, users, customers, sales
dues_ledgerEvery pay-later charge and payment on a customer's account, with the balance after itprimary key idshops, users, customers, sales
topup_requestsStore-credit top-ups sent to a till; the credit is added only when the till takes the paymentprimary key idshops, sales, users, customers, registers
invoicesInvoices and quotes for business customers, with their status, dates, totals and a hash of the pay linkprimary key id; unique pay_token_hash; unique kind + number per shopshops, users, customers, outlets
invoice_linesThe lines of an invoice or quote, with their tax rateprimary key idinvoices, variants, taxes
invoice_paymentsPayments against an invoice: by card through the shop's own Stripe (each Stripe payment once) or recorded by handprimary key id; unique stripe_session_id; unique stripe_payment_intentshops, users, invoices
shop_stripe_eventsEvents from shops' own Stripe accounts already applied, so a repeated delivery changes nothingprimary key shop_id + event_idshops
expensesA shop's expenses, with the receipt, category, outlet and where the money came from (till cash is also a cash move)primary key idshops, users, outlets, shifts
Plans and billing
plansThe plans you sell, with prices, Stripe price IDs, free trial days, limits (outlets, staff, products, sales a month, storage) and featuresprimary key id–
subscriptionsA shop's paid plan from Stripe; a money row, never deleted with its shopprimary key id; unique provider_refshops, plans
paymentsPlan invoices paid, failed or refunded; money rows, never deleted with their shopprimary key id; unique number; unique provider_refshops, plans
stripe_eventsEvents from your Stripe account already applied, so a repeated delivery changes nothingprimary key id–
email_noticesEmails already sent for a shop and period (platform notices and the daily low-stock email), so each goes out onceprimary key shop_id + kind + periodshops
Platform
platform_settingsThe super-admin settings by section, which take precedence over .env (secrets stored encrypted)primary key keyusers
jobsThe background job queue: emails, reminders, housekeeping and the demo's jobsprimary key id; unique dedupe_key, when dedupe_key is not null and status in ('queued', 'running')shops
Part 07

Help

44Updating and backups

Back up

docker compose exec -T postgres sh -c 'pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB"' > backup-$(date +%F).sql

Run it in the Stocklane folder. It reads the database user and name from the postgres container, so it works whatever you set as POSTGRES_USER and POSTGRES_DB; -T keeps a terminal out of the dump. Run it every day (with cron, for example) and keep copies on another computer: a shop's sales are its books.

Also keep a copy of .env (above all APP_SECRET, without which the saved 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

Upgrade in the same folder

Upgrade in the same folder (unzip the new version over it as below; your .env stays). 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 isn't lost; it's under the old name. Docker writes that name in lower case without dots or spaces (a folder Stocklane-1.0.0 becomes stocklane-100); docker volume ls shows it before _postgres-data.

  1. Back up as above.
  2. From the folder that holds stocklane/ (not inside it), run unzip -o stocklane-x.y.z.zip with the new version's file name. The zip has a top-level stocklane/ folder, so it unpacks over your install; unzipping inside the install would make stocklane/stocklane. -o replaces the old files without asking about each one. Your .env, compose.override.yaml and prebuilt/ are kept, because the zip doesn't contain them.
  3. Compare your .env with the new .env.example: new keys are listed there and in CHANGELOG.md. This lists the keys of .env.example that your .env doesn't have yet:
    cd stocklane
    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.
  4. In the stocklane folder, run docker compose up -d --build (with --profile https on your server). The new version applies any new migrations when it starts; your data stays.
  5. If disk is tight, run docker builder prune afterwards to free the build cache.

Update outside a shop's busiest hours: tills that are open keep their carts and retry a sale that was being saved, but the app is away for the seconds it takes to start. If you changed the code, compare your changes with the new version first. CHANGELOG.md lists what changed and marks security fixes.

45Troubleshooting

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" (it reads Install token: sl-install-… (open /install and paste it)). Or set INSTALL_TOKEN in .env and run docker compose up -d.

After an upgrade everything is empty

The install wizard appears again, or the shops are gone, because 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. Your data isn't lost; it's under the old name. docker volume ls shows it as <old name>_postgres-data, the old folder name in lower case without dots or spaces (for example stocklane-100_postgres-data). Stop the app with docker compose down, set COMPOSE_PROJECT_NAME in .env to the part before _postgres-data and run docker compose up -d again (chapter 44).

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. Docker itself refuses to start without POSTGRES_PASSWORD and S3_SECRET_ACCESS_KEY and says which one is missing.

The build stops with "killed" or "signal: 9"

The server ran out of memory while compiling. Add swap or build on another computer (chapter 5).

Paid plans don't switch on

Setup check → Stripe webhook must be green. In Stripe → Developers → Webhooks, the endpoint must point to /api/v1/webhooks/stripe and list the events in chapter 8; Stripe shows every delivery and its answer there.

A shop's invoice was paid but still shows unpaid

The shop's own Stripe webhook is missing or has another signing secret. In the shop's Stripe Dashboard → Developers → Webhooks, the endpoint must be the address shown in the shop's Settings → Payments, for checkout.session.completed, and its signing secret must be the one saved in Stocklane. Stripe shows each delivery and retries failed ones; reconnect with the right secret and the next retry marks the invoice paid.

The barcode scanner doesn't add items

Set the scanner to keyboard mode with Enter after each code (see its manual), then scan into any text editor to check it types the code. The till takes scans while it is selling with a shift open. The camera scanner needs https (or localhost) and the browser's permission for the camera.

Receipts print too small, too wide or with margins

In the print window choose the receipt printer, the paper size that matches its roll (80 mm or 58 mm), margins "None" and scale 100%. Match Settings → Receipts → paper width to the printer. Most browsers remember these per printer.

The till says the shop has reached its monthly sales

The plan's sales a month are used up (chapter 8). The owner moves to a larger plan in Billing, or waits for the next month; refunds still work. You can grant a plan by hand in Super-admin → Shops.

A shop can't change anything

It is suspended: its free trial ended without a plan and there is no free plan, Stripe's last retry of its card failed, or you suspended it. The red banner says which. Choosing a plan in Billing lifts the first two; you lift your own in Super-admin → Shops.

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; check the sender domain is verified with your provider. Emailed receipts and purchase orders are background jobs: a failed one shows in Setup check with its reason and a Retry button.

The overview or the bell doesn't update live

A proxy is buffering the event stream. With the bundled Caddy it works as is; with Nginx add proxy_buffering off; for /api/v1/events.

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 (chapter 5).

46FAQ

Does it work without the internet?

The till needs a connection to save a sale. A short drop doesn't lose anything: the cart stays on the till, the sale is retried with its own id so it is never saved twice, and the cashier can park it and carry on when the connection is back (chapter 13). Stocklane is not a full offline till that sells for hours without a connection.

Does it take card payments at the till?

It records them. The cashier charges the card on the shop's own terminal and marks it approved; Stocklane does not connect to card terminals. Business customers can pay invoices by card online through the shop's own Stripe (chapter 9).

Which printers, scanners and scales work?

Any receipt printer the computer can print to (80 or 58 mm), any barcode scanner in keyboard mode, and any scale whose weight the cashier types in (chapter 2).

Can a shop have several outlets and a warehouse?

Yes: each outlet has its own stock, tills and team, and stock moves between them with transfers. The plan sets how many outlets a shop may have.

Do I need to know Rust?

No, not to install, rebrand or run it: Docker builds everything. Changing the screens needs React; changing server rules needs Rust (chapter 41).

Can I use another database or host it without Docker?

PostgreSQL 15 or newer is required. Without Docker, run the one stocklane program behind your own HTTPS proxy (chapter 5). Managed PostgreSQL services work through DATABASE_URL.

Can a shop use it for free?

If you add a free plan, yes. Otherwise each shop gets the trial of its plan and then chooses a plan (chapter 8).

Which licence do I need?

To charge the shops (sell plans), the Envato Extended Licence. See chapter 49.

47Credits and licences

Stocklane is built with these open-source projects, each under its own licence:

Every dependency

The Rust crates (from Cargo.lock) and the web app's npm packages, counted by licence when the release is built. docs/third-party-licenses.txt lists every package by name, version and licence.

LicenceRust cratesnpm packages
MIT53273
Apache-2.0 OR MIT2132
Unicode-3.018–
ISC210
Apache-2.0110
(MIT OR Apache-2.0) AND Unicode-3.03–
Apache-2.0 OR MIT OR Zlib3–
Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT3–
BSD-3-Clause12
MIT OR Unlicense3–
0BSD11
Apache-2.0 OR BSD-2-Clause OR MIT2–
Apache-2.0 OR BSL-1.0 OR MIT2–
Apache-2.0 OR ISC OR MIT2–
Apache-2.0 OR LGPL-2.1-or-later OR MIT2–
BSD-2-Clause–2
CDLA-Permissive-2.02–
MPL-2.0–2
OFL-1.1–2
Zlib2–
(Apache-2.0 OR MIT) AND BSD-3-Clause1–
(Unlicense OR Apache-2.0)–1
0BSD OR Apache-2.0 OR MIT1–
Apache-2.0 AND ISC1–
Apache-2.0 OR BSL-1.01–
BlueOak-1.0.0–1
CC-BY-4.0–1
MIT AND BSD-3-Clause1–
MIT-0–1
Unlicense–1
Total318309

Every licence above allows use in a commercial product. cargo deny check licenses checks the Rust crates against this list.

Images

Stocklane ships no stock photos. The logo is an original SVG, sample products show line icons or colour samples, and every image in this guide is a screenshot of the running app.

48Changelog

1.0.0 (2026-11-25)

First release.

  • The till: a full-screen till for touch, keyboard and barcode scanners (hand scanner or camera), with variants,

weighed items, line and sale discounts with a manager's PIN over the cashier's limit, parked sales, split payments

(cash, card on the shop's terminal, store credit, points, pay later), receipts on 80 mm or 58 mm paper, as a PDF,

by email or as a WhatsApp link, refunds from the receipt, and sales that are saved once even when the connection

drops.

  • Shifts and cash: shifts opened with a counted float, cash in and out, a blind count at close with the

difference and its note, and the Z report; a PIN switch between staff on a shared till, with PINs set by the owner

or by each person in their profile.

  • Products and stock: variants, units by weight, volume, length or pack, barcodes, barcode labels, CSV import

(with undo) and export, categories, photos; stock per outlet with movements, low-stock notices, a morning low-stock

email and reorder points; transfers between outlets; suppliers and purchase orders received in parts at the

invoice's cost; stock counts.

  • Customers and money: loyalty points, store credit (only from refunds and paid top-ups, with an optional expiry

after 12 or 24 months), pay later with limits and dues; invoices and quotes for business customers with pay links

through the shop's own Stripe and reminders; expenses, with till cash taken out of the shift; reports for sales,

profit, tax and payments, and stock value.

  • The shop: an overview of the day, a first-day checklist with sample data that is removed in one step, outlets

and tills, owner, manager and cashier roles with per-outlet access, invitations, till PINs, settings for taxes,

receipts and payments, amounts in the shop's own currency, an audit log, and the shop's plan and billing.

  • Billing: plans with limits (outlets, staff logins, products, sales a month and file storage), a free trial

without a card, Stripe Checkout and the customer portal, failed payments, refunds and disputes, and a test checkout

while Stripe is not set.

  • Super-admin: revenue, shops, people, plans, payments and subscriptions, platform settings that take precedence

over .env, branding, legal pages, maintenance mode, email wording, and a setup check that tests every outside

service live.

  • Security: argon2id passwords, PINs and links stored only as hashes, saved secrets encrypted at rest, CSRF

protection, a page policy that runs scripts only from your own site, rate limits kept in the database, signed

Stripe webhooks applied once, atomic spends of points and store credit, and every shop row tied to its shop so it

can never point at another.

  • Install and hosting: an install wizard (sign-up stays closed until it is finished), sample plans, a public demo

mode with a nightly reset, and one Docker Compose stack (the app as one compiled Rust program, PostgreSQL, MinIO

and optional HTTPS with Caddy).

  • Settings (.env.example): every key is new in this release. Each later release lists its new keys here.

49Support and licence

Questions, bug reports and help with installation: use the Support tab on the item's page on the marketplace. Please include your Stocklane version (shown in the account menu), 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 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 the setup of your accounts at Stripe and other outside services, which are handled by those companies.

Licence

The Regular Licence lets you use Stocklane for one product whose end users are not charged. To charge the shops (sell plans or subscriptions), you need the Envato Extended Licence. One licence covers one platform (one brand on one installation). The licences page at codecanyon.net/licenses/standard explains both licences in full.