Skip to content

Traceability

4 operations in the traceability namespace.

Freeze a traceability certificate

POST /rpc/v1/traceability.issueCertificate

Materializes the chain as it is RIGHT NOW and mints a public QR token. Deliberately a snapshot: lots get merged, split and consumed after coffee ships, so re-deriving the chain later would describe something other than what was in the bag.

Requires permission traceability.read and the core module on the organization’s plan.

Field Type Required Description
roastedLotId string yes
orderLineId string no
fulfillmentId string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/traceability.issueCertificate \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Issued certificates

POST /rpc/v1/traceability.listCertificates

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

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

What went into this coffee

POST /rpc/v1/traceability.traceBackward

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

Walks the lineage graph upstream in ONE query — a shipment reaches its contracts, a bag reaches its farms. The recall direction: given something a customer has, find everything that could be affected.

Requires permission traceability.read and the core module on the organization’s plan.

Field Type Required Description
kind producer | green_lot | roast_batch | roasted_lot | blend_lot | product_batch | order_line yes
id string yes
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/traceability.traceBackward \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Where this coffee ended up

POST /rpc/v1/traceability.traceForward

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

The other recall direction, and the one that actually matters when a lot is found to be contaminated: given a green lot, find every customer who received it.

Requires permission traceability.read and the core module on the organization’s plan.

Field Type Required Description
kind producer | green_lot | roast_batch | roasted_lot | blend_lot | product_batch | order_line yes
id string yes
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/traceability.traceForward \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'