Inventory · Green
13 operations in the inventory.green namespace.
inventory.green.adjustGreenLotQuantity
Section titled “inventory.green.adjustGreenLotQuantity”Adjust a lot’s weight
POST /rpc/v1/inventory.green.adjustGreenLotQuantityEvery 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.
Request
Section titled “Request”| 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 |
Example
Section titled “Example”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 '{}'inventory.green.getGreenLot
Section titled “inventory.green.getGreenLot”Get one green lot
POST /rpc/v1/inventory.green.getGreenLotAlso 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.
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.green.getGreenLot \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'inventory.green.getGreenLotLandedCost
Section titled “inventory.green.getGreenLotLandedCost”A lot’s landed cost, broken down
POST /rpc/v1/inventory.green.getGreenLotLandedCostAlso 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
greenLotId |
string | yes |
Example
Section titled “Example”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 '{}'inventory.green.importGreenLot
Section titled “inventory.green.importGreenLot”Bring a green lot into inventory
POST /rpc/v1/inventory.green.importGreenLotCreates 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.
Request
Section titled “Request”| 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 |
Example
Section titled “Example”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 '{}'inventory.green.listGreenLotBalances
Section titled “inventory.green.listGreenLotBalances”Where a lot is held
POST /rpc/v1/inventory.green.listGreenLotBalancesAlso 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
greenLotId |
string | yes |
Example
Section titled “Example”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 '{}'inventory.green.listGreenLots
Section titled “inventory.green.listGreenLots”List green coffee lots
POST /rpc/v1/inventory.green.listGreenLotsAlso 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.
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.green.listGreenLots \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'inventory.green.listGreenLotTransactions
Section titled “inventory.green.listGreenLotTransactions”A lot’s ledger history
POST /rpc/v1/inventory.green.listGreenLotTransactionsAlso 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
greenLotId |
string | yes | |
page |
object | no |
Example
Section titled “Example”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 '{}'inventory.green.mergeGreenLots
Section titled “inventory.green.mergeGreenLots”Merge lots into one
POST /rpc/v1/inventory.green.mergeGreenLotsDrains 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
targetId |
string | yes | |
sourceIds |
string[] | yes | |
comment |
string | no |
Example
Section titled “Example”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.releaseGreenLotReservationRequires permission inventory.green.write and the inventory module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | |
weightKg |
string | yes | |
comment |
string | no |
Example
Section titled “Example”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 '{}'inventory.green.reserveGreenLot
Section titled “inventory.green.reserveGreenLot”Reserve weight against a lot
POST /rpc/v1/inventory.green.reserveGreenLotRequires permission inventory.green.write and the inventory module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | |
weightKg |
string | yes | |
comment |
string | no |
Example
Section titled “Example”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 '{}'inventory.green.setGreenLotCostComponents
Section titled “inventory.green.setGreenLotCostComponents”Set what a lot cost to land
POST /rpc/v1/inventory.green.setGreenLotCostComponentsReplaces 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
greenLotId |
string | yes | |
components |
object[] | yes |
Example
Section titled “Example”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 '{}'inventory.green.splitGreenLot
Section titled “inventory.green.splitGreenLot”Split weight out into a new lot
POST /rpc/v1/inventory.green.splitGreenLotCreates 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | |
weightKg |
string | yes | |
newLotCode |
string | yes | |
newName |
string | no | |
comment |
string | no |
Example
Section titled “Example”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.transferGreenLotToLocationWrites 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.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | |
fromLocationId |
string | yes | |
toLocationId |
string | yes | |
weightKg |
string | yes | |
comment |
string | no |
Example
Section titled “Example”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 '{}'