Inventory Management Schema — Mermaid ER Diagram
ER diagram for warehouse inventory tracking with products, warehouses, stock levels, and transfer orders.
What this diagram shows
This Mermaid ER diagram tracks stock across warehouses. A warehouse has many stock-level rows. A product is tracked by those rows and supplied by one supplier. Stock level stores quantity on hand, reserved, and available, plus the last count time. A transfer order moves items from one warehouse to another and contains transfer items with a quantity. Suppliers fulfill purchase orders. The product also appears on transfer items.
Use it when available-to-promise is the question. Three quantity columns on one row is a choice: available should equal on hand minus reserved, and storing all three means a job has to keep them aligned. The reorder_point and reorder_quantity live on PRODUCT, so the reorder rule is global, not per warehouse. Move those columns onto STOCK_LEVEL if warehouse A should reorder sooner than warehouse B.
TRANSFER_ORDER has two foreign keys to WAREHOUSE, from_warehouse and to_warehouse. Mermaid shows them as columns. It does not draw two relationship lines to the same warehouse entity.
Mermaid syntax in this template
erDiagram entities list the columns that matter in a review. Relationship labels distinguish stores, tracked, and transferred.
WAREHOUSE ||--o{ STOCK_LEVEL : storesA warehouse can have zero stock rows. A stock row belongs to one warehouse.
PRODUCT }o--|| SUPPLIER : supplied byMany products share one supplier. The template does not model a product with two suppliers.
int quantity_reservedReserved is not a separate allocation table. Open orders that hold stock are invisible except as this number.
uuid from_warehouse FKOne of two warehouse keys on the transfer. to_warehouse is the other. Both are columns rather than two labeled edges.
Variations and ways to customize it
One reorder point per warehouse
Move reorder_point and reorder_quantity from PRODUCT onto STOCK_LEVEL. The product keeps sku and unit_cost, which really are global.
STOCK_LEVEL {
uuid warehouse_id FK
uuid product_id FK
int quantity_on_hand
int reorder_point
}Allow multiple suppliers per product
Replace the many-to-one supplier edge with a PRODUCT_SUPPLIER join that stores lead time and cost for that pair. Lead time currently sits only on SUPPLIER.
PRODUCT ||--o{ PRODUCT_SUPPLIER : offered
SUPPLIER ||--o{ PRODUCT_SUPPLIER : suppliesDraw both warehouse edges
Add two relationships from TRANSFER_ORDER to WAREHOUSE with different labels so the from and to keys are visible as lines, not only as columns.
TRANSFER_ORDER }o--|| WAREHOUSE : "from"
TRANSFER_ORDER }o--|| WAREHOUSE : "to"Diagram type
ER DiagramTags
Frequently asked questions
What is the difference between on hand, reserved, and available?
quantity_on_hand is physical stock. quantity_reserved is held for orders that have not shipped. quantity_available is what you can still promise. The template stores all three on STOCK_LEVEL, so a writer has to keep available equal to on hand minus reserved.
Can a product have a different reorder point in each warehouse?
Not in this diagram. reorder_point and reorder_quantity are on PRODUCT. Move them to STOCK_LEVEL if the rule depends on the building.
How is a transfer different from a purchase order?
A transfer order moves existing stock between two warehouses and has line items. A purchase order is raised against a supplier and has a cost and an expected date. They do not share a table.
Does the diagram show who the stock is reserved for?
No. Reserved is a number. Add an ALLOCATION or link STOCK_LEVEL to the e-commerce ORDER_ITEM if you need the order that holds the units.
Related templates and guides
All Database Design templatesE-Commerce Database Schema
ER diagram of a complete e-commerce database with users, products, orders, payments, and reviews.
SaaS Multi-Tenant Schema
ER diagram for a multi-tenant SaaS application with organizations, members, roles, and subscription billing.
CMS Content Model
ER diagram for a headless CMS with pages, blocks, media, and versioned content publishing workflow.
Mermaid ER diagram syntax
Foreign-key columns and crow's-foot edges used for stock and transfers.
ER diagram tutorial
How to add a second relationship to the same warehouse entity.