Inventory
Miridia holds stock for each product at each location. Each change to stock is a movement. Movements are never changed or deleted. The list of movements is the ledger, and the ledger is the audit record of your stock.
The inventory record
Each product at each location has one inventory record. The record holds:
- On hand: the stock that is physically at the location.
- Reserved: the stock that is promised to an order.
- In transit: the stock that is on the way to the location from another location.
- The costing method:
WeightedAverageorFifo. - The average cost and the last purchase cost.
- The reorder point, the reorder quantity, and the safety stock.
To see the stock of one product at all locations, get the inventory by product. To see all products at one location, get the inventory by location.
Movements
Each movement records:
- the movement type
- the quantity
- the running balance after the movement
- the source document, for example a purchase order or a work order
- the effective date
- the reason, for a movement that a person posts
- a note
The movement types are:
| Type | Cause |
|---|---|
Purchase | A purchase order receipt. |
Sale | A sale to a customer. |
TransferOut | Stock leaves a location on a transfer. |
TransferIn | Stock arrives at a location on a transfer. |
Adjustment | A manual correction or a stock take. |
AssemblyConsumption | A work order uses a component. |
AssemblyProduction | A work order produces a finished good. |
Return | A customer returns stock. |
WriteOff | Stock is damaged, expired, or lost. |
Costing
Miridia keeps the weighted average cost up to date from the ledger. Each receipt at a different price changes the average. A work order that uses a component then uses what the component really cost, not a list price.
The cost history endpoint gives the history of the average cost for a product.
Adjust stock
Use an adjustment to correct stock by hand, for example after a breakage. A person can post four movement types. Documents post the other types: a purchase order receipt posts Purchase, a shipment posts Sale, a transfer posts TransferOut and TransferIn, and a work order posts AssemblyConsumption and AssemblyProduction.
| Type | Direction | Reason |
|---|---|---|
Adjustment | In or out. The sign of quantity gives the direction. | Required |
WriteOff | Out. quantity must be negative. | Required |
Return | In. quantity must be positive. | Optional |
Sale | Out. quantity must be negative. | Optional |
Use Sale for a sale that has no order in Miridia, for example a till sale in a shop.
{
"productId": "5b0c7a3e-1f0d-4a8e-9c2b-2f2d1c9e7a11",
"locationId": "0f6c1b52-8d7e-4c0a-b3a9-6a1e5d2c4b77",
"quantity": -3,
"movementType": "WriteOff",
"reason": "Damaged",
"notes": "Three tubs damaged in the freezer"
}
Reasons
A reason tells why a person changed the stock. Reports can then group the losses by cause.
| Reason | Use |
|---|---|
CountDifference | A stock count found a difference. A count sets this reason. |
Damaged | The stock is broken or spoilt. |
Expired | The stock is past its expiry date. |
LostOrStolen | The stock is missing. |
Found | Stock that was not in the ledger is found. |
QualityRejected | A quality check rejected the stock. |
SampleOrPromotion | The stock was given away as a sample or for a promotion. |
Other | Any other cause. notes is then required. |
A movement that a document posts has no reason.
Count stock
A count lets you enter the quantity that you counted. You do not calculate the difference. Send countedQuantity in place of quantity, and the time of the count in countedAt.
{
"productId": "5b0c7a3e-1f0d-4a8e-9c2b-2f2d1c9e7a11",
"locationId": "0f6c1b52-8d7e-4c0a-b3a9-6a1e5d2c4b77",
"countedQuantity": 113,
"countedAt": "2026-10-10T09:00:00Z",
"notes": "Monthly freezer count"
}
Miridia finds the balance at countedAt from the ledger. It then posts one Adjustment with the difference, the reason CountDifference, and the effective date countedAt.
For example, the ledger shows 120 tubs at 09:00, and you count 113 at 09:00. At 09:30 a shipment takes 10 tubs, and you send the count at 10:00. Miridia posts an Adjustment of -7 at 09:00. The shipment stays as it is, and the balance becomes 103. A movement after countedAt does not change the difference.
countedAtis optional. The default is the time of the request. It cannot be in the future.- A count is always an
Adjustmentwith the reasonCountDifference. You can leave outmovementTypeandreason. - If the count is the same as the balance, Miridia posts no movement. The response then has the message
The count matches the balance. No movement was posted.
Errors
A request that breaks one of these rules gets a 400 response with an error code.
| Code | Cause |
|---|---|
E400_MOVEMENT_TYPE_NOT_MANUAL | The type is not Adjustment, WriteOff, Return, or Sale. |
E400_MOVEMENT_DIRECTION | The sign of quantity does not agree with the type. |
E400_MOVEMENT_REASON_REQUIRED | An Adjustment or a WriteOff has no reason. |
E400_MOVEMENT_NOTES_REQUIRED | The reason is Other and notes is empty. |
E400_ADJUST_OR_COUNT | The request has both quantity and countedQuantity, or neither. |
E400_COUNT_MOVEMENT_TYPE | A count has a type other than Adjustment. |
E400_COUNT_REASON | A count has a reason other than CountDifference. |
E400_COUNTED_AT_IN_FUTURE | countedAt is in the future. |
A quantity in a unit that cannot be split, for example Each or Box, must be a whole number. This applies to quantity and to countedQuantity.
Move stock in one step
For a quick move between two locations, use the one-step transfer. It writes a TransferOut at the source and a TransferIn at the destination in one operation.
For a move that needs a request, an approval, or time in transit, use a transfer order.
Backdated movements
An adjustment, a transfer, and a receipt accept an effectiveDate. A count accepts a countedAt in the past. You can load several months of history when you start on Miridia. The average cost is then correct. The system does not assume that all stock arrived on the day of the migration.
Lots and serial numbers
A lot groups units that were made or received together. A lot has a lot number, an optional expiry date, notes, and attachments, for example a certificate of analysis.
A work order can create a lot when it completes. It can also record serial numbers for the units that it produced. A serial number has a status: Available, Consumed, Shipped, or Scrapped.
To see the movements of one lot, get the movements of the lot.
Traceability
Miridia can trace stock in two directions.
- Forward: start from a purchase order receipt. Find the shipments that most probably took stock from that receipt, and their orders and customers. Use this for a supplier recall.
- Backward: start from a customer shipment. Find the receipts that most probably supplied the stock, and their purchase orders and suppliers. Use this for a customer complaint.
disclaimer field that states this limit.Reorder points
Set these values on each inventory record:
- Reorder point: when the balance goes below this value, Miridia raises a low-stock event.
- Reorder quantity: the quantity to order.
- Safety stock: the buffer for a change in demand or a late delivery.
The source of the values is Manual or Forecast. A planner can calculate them in Miridia Planner. The reorder history shows each change to the settings.
When the stock of a product at a location goes below its reorder point, Miridia sends a warning to the business and to the users with the Manager role. Read Notifications. You can also start a workflow on the OnInventoryLowStock trigger. Read Workflows.