Skip to content

Inventory · Roast

4 operations in the inventory.roast namespace.

Adjust roasted stock

POST /rpc/v1/inventory.roast.adjustRoastedLotQuantity

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

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

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

Get one roasted lot

POST /rpc/v1/inventory.roast.getRoastedLot

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

Requires permission inventory.roast.read and the inventory 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.roast.getRoastedLot \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Walk a roasted lot back to the farm

POST /rpc/v1/inventory.roast.getRoastedLotTraceability

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

Follows the lineage edges backwards: roasted lot to roast batch to green lot to producer. This is what a recall investigation and a traceability certificate both need, and why lineage is stored as edges rather than a parent pointer.

Requires permission traceability.read and the core 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.roast.getRoastedLotTraceability \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

List roasted inventory

POST /rpc/v1/inventory.roast.listRoastedLots

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

Loose, packaged and blended stock. Roasted coffee has a usable window measured in weeks, so this is usually read freshness-first rather than by arrival order.

Requires permission inventory.roast.read and the inventory 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.roast.listRoastedLots \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'