Websites

Inventory tracking for a small online store: every change recorded

Inventory tracking for a small online store means knowing how many of each item you have, with stock going down as orders arrive and a warning before it runs out. On OneCraft the agent writes it with the inventory guide: a stock movement for every change, stock levels and a low stock list, and deliveries and stocktakes in your site's admin.

Create a website with OneCraftThe movements table that records every stock change, how orders, deliveries and stocktakes feed it, the low stock warnings and what the shop shows buyers.

A movement for every change

Stock changes only through movements. Each movement has a product, an optional variant and location, a quantity up or down, a reason (received, sold, returned, adjusted, stocktake or transfer), a reference such as the order id, and who made it. Movements are never edited or deleted; a mistake is fixed with another movement, so the history always adds up.

Orders take stock down

When place_order writes an order it adds a sold movement for each line in the same transaction, and a trigger updates the stock number the shop reads. A sold out product is refused at the moment of ordering. A cancel or refund adds a returned movement that puts the stock back.

Deliveries, stocktakes and transfers

In the admin, Receive stock lets you search products, enter quantities with a supplier and a reference, and save one received movement each. A stocktake shows a count sheet per location with on hand beside a Counted box, then a review of the differences before Apply records them. Transfer moves stock between locations as two linked movements.

Low stock and what buyers see

Each product has a reorder level, and a low stock view lists everything at or under it, with a count on the admin dashboard and a Low only filter. Product pages show lines such as Only 3 left or Sold out from the stock number. The stock tables are admin only; visitors see just that line on the product.

How it works, in three steps

  1. Step 1

    Ask for stock tracking

    Mention stock, deliveries and stocktakes in the generator's brief for a shop, or ask in chat for inventory on a site that already has products and orders.

  2. Step 2

    Give it a database

    Every plan gets a hosted site database, or you can connect your own Supabase account in the site's Settings, Database card. Connect Stripe in account Settings, Payments for card payments.

  3. Step 3

    Check it and publish

    Sign in to /admin with the admin account the agent reports, try it in the preview, then publish from the builder on a paid plan.

Limits worth knowing

Questions people ask

Does stock go down when an order is placed or when it is paid?

When it is placed. Place_order adds a sold movement for each line in the same transaction that writes the order, so two buyers cannot both take the last item. If the order is cancelled or refunded, a returned movement puts the stock back. An order left unpaid stays pending, so cancel it in the admin to free its stock.

Can I track stock in more than one place?

Yes. Movements can carry a location, such as a shop and a storeroom, and stock levels are shown per location when there are several. A stocktake count sheet is per location, and Transfer moves a quantity from one location to another as two linked movements, so the total stays right.

Can I type over a stock number to fix it?

No, by design. Once inventory exists, the stock number on a product changes only through movements, so the admin form does not let you type over it. To correct a count, record an adjusted movement or run a stocktake, which records the difference between on hand and what you counted, with your name and the time.

Does it track stock for each size and colour?

Yes, when the shop has variants that hold their own stock. Movements then name the variant, and each variant has its own reorder level, so a medium in black can show as low while the large is fine. Products without variants track one number.

Can I record suppliers?

Yes, when your brief mentions them. The agent adds a suppliers table with name, email, phone and notes, and Receive stock lets you pick the supplier and a reference such as their invoice number. The movement history then shows which delivery each unit came from.

Can I get stock levels into a spreadsheet?

Yes. With the csv capability, admin tables get an Export button that writes a CSV file in your browser and guards cells that start with a formula sign. That gives you on hand per product for your accountant, or a reorder list to send a supplier.

Make your own website

The button opens the generator with this use case already described. Change the wording to match yours, generate, then edit anything you like.

Create a website with OneCraft

Not ready to start? See the AI website builder page first.

Related pages

More finished work of this kind is on the website examples hub.

Sources

Written and checked by the OneCraft team. Last checked .