Skip to content

Inventory · Material

7 operations in the inventory.material namespace.

Receive, consume or adjust material stock

POST /rpc/v1/inventory.material.adjustMaterialQuantity

Append-only, like the coffee ledger: the balance is never written directly.

Requires permission inventory.material.write and the resource_planning module on the organization’s plan.

Field Type Required Description
id string yes
deltaQty string yes
reason receive | adjust | shrinkage | write_off | recount | return yes
locationId string no
comment string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.material.adjustMaterialQuantity \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Create a material

POST /rpc/v1/inventory.material.createMaterial

Requires permission inventory.material.write and the resource_planning module on the organization’s plan.

Field Type Required Description
sku string yes
name string yes
kind bag | label | valve | box | tin | capsule | tape | insert | merch | other yes
unitCost string no
currency string no
reorderPoint string no
reorderQty string no
leadTimeDays integer no
supplierPartnerId string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.material.createMaterial \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

inventory.material.explodeMaterialRequirements

Section titled “inventory.material.explodeMaterialRequirements”

What a production plan will consume, and what is missing

POST /rpc/v1/inventory.material.explodeMaterialRequirements

Also available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.

Answers the question that actually matters before a production run: not just how much is needed, but what will run out and how long a replacement takes to arrive.

Requires permission inventory.material.read and the resource_planning module on the organization’s plan.

Field Type Required Description
productId string yes
quantity integer yes
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.material.explodeMaterialRequirements \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

The active bill of materials for a product

POST /rpc/v1/inventory.material.getBillOfMaterials

Also available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.

Requires permission inventory.material.read and the resource_planning module on the organization’s plan.

Field Type Required Description
productId string yes
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.material.getBillOfMaterials \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Get one material

POST /rpc/v1/inventory.material.getMaterial

Also available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.

Requires permission inventory.material.read and the resource_planning module on the organization’s plan.

Field Type Required Description
id string yes
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.material.getMaterial \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

List packaging and other non-coffee materials

POST /rpc/v1/inventory.material.listMaterials

Also available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.

Bags, labels, valves, boxes and merchandise. Running out of these stops production just as effectively as running out of coffee.

Requires permission inventory.material.read and the resource_planning module on the organization’s plan.

Field Type Required Description
filter object no
page object no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.material.listMaterials \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Define what a product is made of

POST /rpc/v1/inventory.material.setBillOfMaterials

Publishes a NEW version and retires the previous one. Editing in place would retroactively change what a batch produced last month, which both costing and an audit depend on being stable.

Requires permission inventory.material.write and the resource_planning module on the organization’s plan.

Field Type Required Description
productId string yes
name string yes
yieldQty integer no
lines object[] yes
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.material.setBillOfMaterials \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'