Inventory · Material
7 operations in the inventory.material namespace.
inventory.material.adjustMaterialQuantity
Section titled “inventory.material.adjustMaterialQuantity”Receive, consume or adjust material stock
POST /rpc/v1/inventory.material.adjustMaterialQuantityAppend-only, like the coffee ledger: the balance is never written directly.
Requires permission inventory.material.write and the resource_planning module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | |
deltaQty |
string | yes | |
reason |
receive | adjust | shrinkage | write_off | recount | return |
yes | |
locationId |
string | no | |
comment |
string | no |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/inventory.material.adjustMaterialQuantity \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'inventory.material.createMaterial
Section titled “inventory.material.createMaterial”Create a material
POST /rpc/v1/inventory.material.createMaterialRequires permission inventory.material.write and the resource_planning module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
sku |
string | yes | |
name |
string | yes | |
kind |
bag | label | valve | box | tin | capsule | tape | insert | merch | other |
yes | |
unitCost |
string | no | |
currency |
string | no | |
reorderPoint |
string | no | |
reorderQty |
string | no | |
leadTimeDays |
integer | no | |
supplierPartnerId |
string | no |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/inventory.material.createMaterial \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'inventory.material.explodeMaterialRequirements
Section titled “inventory.material.explodeMaterialRequirements”What a production plan will consume, and what is missing
POST /rpc/v1/inventory.material.explodeMaterialRequirementsAlso available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.
Answers the question that actually matters before a production run: not just how much is needed, but what will run out and how long a replacement takes to arrive.
Requires permission inventory.material.read and the resource_planning module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
productId |
string | yes | |
quantity |
integer | yes |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/inventory.material.explodeMaterialRequirements \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'inventory.material.getBillOfMaterials
Section titled “inventory.material.getBillOfMaterials”The active bill of materials for a product
POST /rpc/v1/inventory.material.getBillOfMaterialsAlso available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.
Requires permission inventory.material.read and the resource_planning module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
productId |
string | yes |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/inventory.material.getBillOfMaterials \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'inventory.material.getMaterial
Section titled “inventory.material.getMaterial”Get one material
POST /rpc/v1/inventory.material.getMaterialAlso available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.
Requires permission inventory.material.read and the resource_planning 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/inventory.material.getMaterial \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'inventory.material.listMaterials
Section titled “inventory.material.listMaterials”List packaging and other non-coffee materials
POST /rpc/v1/inventory.material.listMaterialsAlso available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.
Bags, labels, valves, boxes and merchandise. Running out of these stops production just as effectively as running out of coffee.
Requires permission inventory.material.read and the resource_planning 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/inventory.material.listMaterials \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'inventory.material.setBillOfMaterials
Section titled “inventory.material.setBillOfMaterials”Define what a product is made of
POST /rpc/v1/inventory.material.setBillOfMaterialsPublishes a NEW version and retires the previous one. Editing in place would retroactively change what a batch produced last month, which both costing and an audit depend on being stable.
Requires permission inventory.material.write and the resource_planning module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
productId |
string | yes | |
name |
string | yes | |
yieldQty |
integer | no | |
lines |
object[] | yes |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/inventory.material.setBillOfMaterials \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'