Sourcing · Sample
5 operations in the sourcing.sample namespace.
sourcing.sample.createSample
Section titled “sourcing.sample.createSample”Register a sample
POST /rpc/v1/sourcing.sample.createSampleRequires permission sourcing.sample.write and the samples module on the organization’s plan.
Request
Section titled “Request”| 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 |
Example
Section titled “Example”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 '{}'sourcing.sample.getSample
Section titled “sourcing.sample.getSample”Get one sample
POST /rpc/v1/sourcing.sample.getSampleAlso 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes |
Example
Section titled “Example”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 '{}'sourcing.sample.listSamples
Section titled “sourcing.sample.listSamples”List samples
POST /rpc/v1/sourcing.sample.listSamplesAlso 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
filter |
object | no | |
page |
object | no |
Example
Section titled “Example”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 '{}'sourcing.sample.transferSampleToInventory
Section titled “sourcing.sample.transferSampleToInventory”Turn an approved sample into a green lot
POST /rpc/v1/sourcing.sample.transferSampleToInventoryFor 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | |
lotCode |
string | yes | |
weightKg |
string | yes | |
locationId |
string | no |
Example
Section titled “Example”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 '{}'sourcing.sample.updateSampleStatus
Section titled “sourcing.sample.updateSampleStatus”Move a sample through its lifecycle
POST /rpc/v1/sourcing.sample.updateSampleStatusApproving 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | |
status |
requested | in_transit | received | roasted | cupped | approved | rejected | archived |
yes | |
decisionNotes |
string | no | |
trackingNumbers |
string[] | no |
Example
Section titled “Example”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 '{}'