Skip to content

Inventory · Blend

4 operations in the inventory.blend namespace.

Define a blend recipe

POST /rpc/v1/inventory.blend.createBlend

The recipe, not a production run. Target ratios are never mutated to match what was actually produced — that drift is recorded separately, which is what makes ‘we shipped 3% off spec’ a question the data can answer.

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

Field Type Required Description
name string yes
code string yes
blendType pre_roast | post_roast yes
targetWeightLossPct string no
roastLevel light | medium | dark no
isDecaf boolean no
components object[] yes
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.blend.createBlend \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Get a blend and its components

POST /rpc/v1/inventory.blend.getBlend

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

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

List blend recipes

POST /rpc/v1/inventory.blend.listBlends

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

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

Can this blend be produced right now?

POST /rpc/v1/inventory.blend.validateBlendAvailability

Answers per component, because ‘you are short’ is not actionable but ‘you are 12.4 kg short of the Ethiopian’ is. Green is grossed up for expected roast loss: sizing against the roasted target under-orders on every run.

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

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