Skip to content

Sourcing · Sample

5 operations in the sourcing.sample namespace.

Register a sample

POST /rpc/v1/sourcing.sample.createSample

Requires permission sourcing.sample.write and the samples module on the organization’s plan.

Field Type Required Description
sampleNumber string yes
name string yes
sampleType offer | pre_shipment | arrival | type | spot | production | competition yes
partnerId string no
producerId string no
contractId string no
contractLineId string no
poNumber string no
salesNumber string no
trackingNumbers string[] no
weightKg string no
dueAt string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/sourcing.sample.createSample \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Get one sample

POST /rpc/v1/sourcing.sample.getSample

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

Requires permission sourcing.sample.read and the samples module on the organization’s plan.

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

List samples

POST /rpc/v1/sourcing.sample.listSamples

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

The sample pipeline, from offer through arrival. A sample is evaluated rather than stocked: its purpose is the decision it informs.

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

Turn an approved sample into a green lot

POST /rpc/v1/sourcing.sample.transferSampleToInventory

For spot lots bought off a sample. Creates a lot with the sample’s provenance and books its weight through the ledger, then links the two so the lot’s quality history reaches back to what was cupped.

Requires permission sourcing.sample.write and the samples module on the organization’s plan.

Field Type Required Description
id string yes
lotCode string yes
weightKg string yes
locationId string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/sourcing.sample.transferSampleToInventory \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Move a sample through its lifecycle

POST /rpc/v1/sourcing.sample.updateSampleStatus

Approving or rejecting stamps a decision time, so ‘how long did we sit on this’ is answerable — the metric a supplier will eventually ask about.

Requires permission sourcing.sample.approve and the samples module on the organization’s plan.

Field Type Required Description
id string yes
status requested | in_transit | received | roasted | cupped | approved | rejected | archived yes
decisionNotes string no
trackingNumbers string[] no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/sourcing.sample.updateSampleStatus \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'