Skip to content

Inventory · Green

13 operations in the inventory.green namespace.

Adjust a lot’s weight

POST /rpc/v1/inventory.green.adjustGreenLotQuantity

Every adjustment names a reason, so shrinkage, a write-off and a recount stay distinguishable in reporting rather than collapsing into one number. Only a recount may take a lot negative.

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

Field Type Required Description
id string yes
deltaKg string yes
reason adjust | shrinkage | write_off | recount | sample_draw | return yes
locationId string no
comment string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.green.adjustGreenLotQuantity \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Get one green lot

POST /rpc/v1/inventory.green.getGreenLot

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

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

A lot’s landed cost, broken down

POST /rpc/v1/inventory.green.getGreenLotLandedCost

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

Components roll up into price, freight, duty, carry and other — the buckets a roaster actually reasons in when asking why a coffee is expensive.

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

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

Bring a green lot into inventory

POST /rpc/v1/inventory.green.importGreenLot

Creates the lot at zero and books its opening weight as a receive ledger row, so even the first gram has an audit trail. There is no path that sets a balance without a corresponding movement.

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

Field Type Required Description
name string yes
lotCode string yes
weightKg string yes
supplierRef string no
producerId string no
partnerId string no
state green | parchment | dry_cherry | wet_parchment | raw_green | decaf_green no
varieties string[] no
processMethod string no
harvestYear integer no
certifications string[] no
bagCount integer no
bagWeightKg string no
unitCost string no
currency string no
minWeightKg string no
locationId string no
notes string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.green.importGreenLot \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Where a lot is held

POST /rpc/v1/inventory.green.listGreenLotBalances

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

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

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

List green coffee lots

POST /rpc/v1/inventory.green.listGreenLots

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

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

A lot’s ledger history

POST /rpc/v1/inventory.green.listGreenLotTransactions

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

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

Field Type Required Description
greenLotId string yes
page object no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.green.listGreenLotTransactions \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Merge lots into one

POST /rpc/v1/inventory.green.mergeGreenLots

Drains each source into the target and records a lineage edge per source. This is why lineage is an edge table: a merge has many sources, which a parent pointer cannot express.

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

Field Type Required Description
targetId string yes
sourceIds string[] yes
comment string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.green.mergeGreenLots \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

inventory.green.releaseGreenLotReservation

Section titled “inventory.green.releaseGreenLotReservation”

Release a reservation

POST /rpc/v1/inventory.green.releaseGreenLotReservation

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

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

Reserve weight against a lot

POST /rpc/v1/inventory.green.reserveGreenLot

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

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

Set what a lot cost to land

POST /rpc/v1/inventory.green.setGreenLotCostComponents

Replaces the lot’s cost components and recomputes the rollup in one transaction, so a corrected freight invoice flows straight through to the per-kilogram figure rather than leaving a stale total nobody trusts.

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

Field Type Required Description
greenLotId string yes
components object[] yes
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.green.setGreenLotCostComponents \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

Split weight out into a new lot

POST /rpc/v1/inventory.green.splitGreenLot

Creates a child lot and records a lineage edge, so traceability follows the coffee rather than the lot code.

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

Field Type Required Description
id string yes
weightKg string yes
newLotCode string yes
newName string no
comment string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.green.splitGreenLot \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'

inventory.green.transferGreenLotToLocation

Section titled “inventory.green.transferGreenLotToLocation”

Move weight between locations

POST /rpc/v1/inventory.green.transferGreenLotToLocation

Writes two ledger rows sharing a group id. The lot’s total is unchanged; only the per-location balances move.

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

Field Type Required Description
id string yes
fromLocationId string yes
toLocationId string yes
weightKg string yes
comment string no
Terminal window
curl -X POST https://api.roastery.run/rpc/v1/inventory.green.transferGreenLotToLocation \
-H "Authorization: Bearer $ROASTERY_API_KEY" \
-H "X-Roastery-Org: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'