Cost and produce a product
In this tutorial you write the recipe of a product, calculate what one unit costs, and record a production run. When the run is complete, Miridia takes the components out of stock and puts the finished goods into stock.
What you need
- A finished good, for example "Vanilla ice cream, 500 ml".
- Two or more raw materials with a purchase price, for example milk, cream, and sugar. Read Add products and prices.
- Stock of the raw materials at your production location. Read Receive a purchase order.
Steps
Create the bill of materials
Open the finished good and create a bill of materials (BOM). Select the BOM type:
Assembly: the components are consumed to make a new product.Kit: the components are packed together and stay separate items in stock.
Select Assembly. Enter the output quantity, for example 1 unit. The new BOM has the status Draft.
Add the components
Add a line for each raw material. Enter the quantity for the output quantity, and the unit of measure. Enter a scrap factor for a material that you lose in production. For example, a scrap factor of 5% on 0.3 l of cream means that the cost uses 0.315 l.
Add a labour cost line
Costs that are not materials go on cost lines. Add a line for labour. Select the cost type:
FixedPerUnit: a fixed amount for each unit, for example R2.50 of labour.Percentage: a percentage of the material cost, for example 3% for inbound freight.HourlyRate: an hourly rate.
You can also enter a general ledger account code. An accounting integration uses it.
Activate the BOM
Activate the BOM. The active BOM is the current recipe of the product. When you activate a new revision later, the old revision becomes Superseded. Miridia keeps it, so that you can read the history.
Calculate the cost
Open the cost of the BOM. Miridia walks each line, reads the purchase price of each component from its price history, adds the scrap, and adds the cost lines. The result is the cost of one output quantity.
Select an earlier date to see the cost on that date. Miridia then uses the prices that were valid on that date. Thus you can see which component made the cost change.
Create a work order
Create a work order for the finished good. Enter a reference, the production location, the planned quantity, for example 200 units, and the scheduled start. You can assign the work order to one person. That person gets a notification.
The work order takes a copy of the active BOM. If the recipe changes later, this work order does not change.
Start the work order
When production starts, start the work order.
Complete the work order
When production ends, complete the work order. Enter the quantity produced and the quantity scrapped, with a reason for the scrap. If you used a different quantity of a material than the plan, enter the actual quantity. Miridia uses the planned quantity for each material that you do not enter.
Miridia then:
- Adds an assembly consumption movement for each component.
- Adds an assembly production movement for the finished good at the production location.
- Calculates the total cost of the run and the cost of each unit, from what the components actually cost.
The business gets a notification that the work order is complete.
| Action | Request |
|---|---|
| Create a BOM | POST /api/v1/bom |
| Add a component line | POST /api/v1/bom/{bomId}/line-items |
| Activate a BOM | POST /api/v1/bom/{bomId}/activate |
| Calculate the cost | GET /api/v1/bom/{bomId}/cost?asOfDate=2026-09-01 |
| Create a work order | POST /api/v1/work-orders |
| Start a work order | POST /api/v1/work-orders/{workOrderId}/start |
| Complete a work order | POST /api/v1/work-orders/{workOrderId}/complete |
{
"parentProductId": "<finished-good-id>",
"title": "Vanilla 500 ml, revision 1",
"bomType": "Assembly",
"outputQuantity": 1,
"lineItems": [
{ "componentProductId": "<cream-id>", "quantityRequired": 0.3, "unit": "Litre", "scrapFactorPercent": 5 }
],
"costLines": [
{ "description": "Labour", "costType": "FixedPerUnit", "costAmount": 2.5 }
]
}
{
"producedQuantity": 196,
"scrappedQuantity": 4,
"scrapReason": "Tubs damaged at filling"
}
Read the BOMs reference and the Work orders reference.