Use up, correct or edit stock
Change one stock row: take an amount out ("I used 50 g of Citra" → change: -50), add to it (change: 500), set the counted amount (amount: 1200), or edit its lot, expiry date, supplier, price, notes, or hop alpha/form/harvest year. Reference the row by id (from find_stock) or ingredient name; if a name has several rows and only one still has stock, a negative change uses that one. change and amount use the row's unit (grams for fermentables/hops; send unit "kg"/"oz"/"lb" to convert). Stock never goes below 0. To book a new purchase use add_stock (it merges lots); deducting a whole brew's ingredients belongs to the brew tools. Text fields: send "" to clear. Scope: `inventory:write` (or `write`).
Change one stock row: take an amount out ("I used 50 g of Citra" → change: -50), add to it (change: 500), set the counted amount (amount: 1200), or edit its lot, expiry date, supplier, price, notes, or hop alpha/form/harvest year. Reference the row by id (from find_stock) or ingredient name; if a name has several rows and only one still has stock, a negative change uses that one. change and amount use the row's unit (grams for fermentables/hops; send unit "kg"/"oz"/"lb" to convert). Stock never goes below 0. To book a new purchase use add_stock (it merges lots); deducting a whole brew's ingredients belongs to the brew tools. Text fields: send "" to clear.
Scope: inventory:write (or write).
API token in format: bfk_. Each operation lists the token scope it requires (the scopes are listed below).
read: Read everything (all areas)write: Create, change and delete everything (all areas)brews:read: List and view brewsbrews:write: Create, update, delete brews and notesinventory:read: List inventory itemsinventory:write: Create, update, delete inventory itemsequipment:read: List equipment profilesequipment:write: Create, update, delete equipment profilesstyles:read: List style profilesstyles:write: Create, update, delete style profilesprofiles:read: List mash, fermentation, and water profilescustom-fields:read: List custom field definitionscustom-fields:write: Create, update, delete custom field definitionsprofiles:write: Create, update, delete mash, fermentation, and water profilescellar:read: View cellar, packaged stock, tap lists, and labelscellar:write: Manage cellar, packaging, stock, tap lists, and labelssettings:read: View preferences, imports, calculators, and your data exportsettings:write: Change preferences and undo importscommunity:read: View community, feedback, tickets, inbox, and account overviewcommunity:write: Post, vote, and reply in community, feedback, and tickets
In: header
Scope: inventory:write
Request Body
application/json
The stock row: its id (from find_stock) or the ingredient's exact name (e.g. "Citra"). A name that matches several rows (lots, harvest years) returns them as candidates; call again with the row id.
Ingredient type: "fermentable" (malts, sugars, extracts), "hop", "yeast" or "misc" (water agents, finings, spices, ...).
"fermentable" | "hop" | "yeast" | "misc"Add (positive) or take out (negative) this much, e.g. -50 for "used 50 g".
Set the amount in stock to this (after counting), e.g. 1200. Use instead of change.
0 <= valueUnit of amount. Fermentables and hops are stored in grams: send "g" (default), "kg", "oz" or "lb". Yeast counts in "pkg" (packs, default), "ml", "g" or "cells"; misc in "g", "ml", "each" or "mg" (default: the ingredient's own unit).
"g" | "kg" | "oz" | "lb" | "mg" | "pkg" | "ml" | "cells" | "each"Lot number.
length <= 100Expiry date, YYYY-MM-DD (e.g. "2027-03-31"); YYYY-MM means the last day of that month.
Where it was bought.
length <= 200Price per kg, for fermentables and hops, in the user's currency (e.g. 2.4).
0 <= valuePrice per counted unit (per pack for yeast in pkg, per gram for misc in g, ...), in the user's currency (e.g. 4.5).
0 <= valueWhat the whole amount cost, in the user's currency (e.g. 12.9 for 5 kg); converted to the price per kg or per unit. Use instead of cost_per_kg / cost_per_unit.
0 <= valueFree text.
length <= 500Hops only: alpha acid % of this lot.
0 <= value <= 30Hops only: pellet, whole, cryo or extract.
"pellet" | "whole" | "cryo" | "extract"Hops only: crop year.
1900 <= value <= 2100Yeast only: production date, YYYY-MM-DD (e.g. "2027-03-31"); YYYY-MM means the last day of that month.
^\d{4}-\d{2}(-\d{2})?$Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://brewforge.sh/api/v1/actions/update_stock" \ -H "Content-Type: application/json" \ -d '{ "stock": "string" }'{
"stock": {
"id": "string",
"type": "fermentable",
"name": "string",
"ingredient_id": "string",
"amount": 0,
"unit": "string",
"status": "in_stock",
"lot": "string",
"expiry_date": "string",
"purchase_date": "string",
"supplier": "string",
"cost_per_kg": 0,
"cost_per_unit": 0,
"alpha_acid_pct": 0,
"form": "string",
"harvest_year": 0,
"lab": "string",
"notes": "string"
},
"previous_amount": 0,
"note": "string"
}{
"error": {
"code": "string",
"message": "string",
"hint": "string",
"candidates": [
{
"id": "string",
"name": "string"
}
],
"fields": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string",
"candidates": [
{
"id": "string",
"name": "string"
}
],
"fields": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string",
"candidates": [
{
"id": "string",
"name": "string"
}
],
"fields": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string",
"candidates": [
{
"id": "string",
"name": "string"
}
],
"fields": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string",
"candidates": [
{
"id": "string",
"name": "string"
}
],
"fields": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string",
"candidates": [
{
"id": "string",
"name": "string"
}
],
"fields": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"details": {}
}
}