Stock per warehouse

A warehouse is a place stock is kept, with a unique code and an address. For each product or variant, each warehouse holds a stock record with four quantities:

  • Available: can still be sold. This is what the shop uses.
  • Reserved: promised to an order that has not left yet.
  • In transit: on its way to a warehouse or a customer.
  • On hand: physically on the shelf.

So a product can show as out of stock with a full shelf: everything on hand is reserved for orders that have not shipped.

How stock changes

Every change is an inventory transaction: the product, the warehouse, the quantities moved and the reason. A transaction is final once written, and the stock figures are the running total of the transactions, so a mistake is corrected with another transaction rather than by overwriting a number.

Staff can enter a product's four quantities per warehouse in the product editor; on save, the platform writes the difference as a transaction. If someone else changed the stock after you opened the form, your save is refused, so two people never overwrite each other's counts. Where a warehouse or ERP system ships the goods, the recommended set-up lets that system alone record each movement, through the API.

Batches track lots of goods, with a name, an expiry date and a received date. When a transaction makes a product available again, the platform raises its back-in-stock event, which a job (formerly hook) can turn into emails to the people who asked to be told.

Fulfilments and shipments

A fulfilment is a set of an order's lines that leave together. It is created at checkout when shipping is chosen, and holds its items, the delivery address (or the warehouse, for a pickup), the delivery option chosen, its status and its shipments. Staff move a fulfilment through its statuses on the order: Pending, Ready, In Transit, Delivered or Cancelled.

A shipment is one parcel: the courier's tracking code and link, an external id and the amount charged. A fulfilment that leaves in several parcels has a shipment for each, and an order whose lines leave at different times has several fulfilments.

The order's fulfilment status

The order sums up its fulfilments, leaving cancelled ones out: Not Fulfilled (none), Pending Fulfillment (all pending), Partially Fulfilled (some pending, others moved on), Fulfilled (none pending, not all delivered) and Fulfillment Complete (all delivered).

Common questions

  • "It says out of stock but we have some." Compare on hand with reserved: orders not yet shipped hold stock.
  • "The count is wrong." Read the transactions rather than the total: a movement is missing or recorded twice.
  • "Why is this order in two parts?" It has more than one fulfilment, or one fulfilment shipped in several parcels.

Developers: Stock, fulfilment and the member's order screens in the commerce guide.