Add ingredient stock
Book bought ingredients into the inventory, e.g. "5 kg Pilsner malt" or "100 g Citra 2025 pellets at 13.2% alpha". One call per ingredient. The ingredient is referenced by id or exact name and must be in the user's ingredient picker (find_ingredients lists them; a missing one can be picked from a package with select_package_ingredients or created with save_custom_ingredient). type is inferred from the ingredient; pass it only to narrow an ambiguous name. Amount: fermentables/hops in g (default), kg, oz or lb, stored as grams; yeast in pkg (default), ml, g or cells; misc in the ingredient's unit. If a row of the same ingredient and lot (for hops also form, alpha and harvest year) exists, the amount is added to it and the price becomes the weighted average (merged_into_existing: true). The result has the recorded price with currency. Everything else is optional: lot, expiry date, supplier, price, notes; hops: alpha_acid_pct, form, harvest_year; yeast: manufacturing_date. Scope: `inventory:write` (or `write`).
Book bought ingredients into the inventory, e.g. "5 kg Pilsner malt" or "100 g Citra 2025 pellets at 13.2% alpha". One call per ingredient. The ingredient is referenced by id or exact name and must be in the user's ingredient picker (find_ingredients lists them; a missing one can be picked from a package with select_package_ingredients or created with save_custom_ingredient). type is inferred from the ingredient; pass it only to narrow an ambiguous name. Amount: fermentables/hops in g (default), kg, oz or lb, stored as grams; yeast in pkg (default), ml, g or cells; misc in the ingredient's unit. If a row of the same ingredient and lot (for hops also form, alpha and harvest year) exists, the amount is added to it and the price becomes the weighted average (merged_into_existing: true). The result has the recorded price with currency. Everything else is optional: lot, expiry date, supplier, price, notes; hops: alpha_acid_pct, form, harvest_year; yeast: manufacturing_date.
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 ingredient: its id (from find_ingredients) or its exact name (e.g. "Citra", "Pilsner Malt", "SafAle US-05"; yeast also by product code like "US-05"). Case does not matter; when several picked packages have the name, the one in stock (then the user's own) is used. Only ingredients in the user's ingredient picker (My Ingredients plus the ingredients chosen from packages) can be used.
Ingredient type: "fermentable" (malts, sugars, extracts), "hop", "yeast" or "misc" (water agents, finings, spices, ...).
"fermentable" | "hop" | "yeast" | "misc"How much was bought, in unit (e.g. 5 with unit "kg", 100 for 100 g, 2 packs of yeast).
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 or batch number on the bag (e.g. "L2025-118").
length <= 100Best before / expiry date, YYYY-MM-DD (e.g. "2027-03-31"); YYYY-MM means the last day of that month.
^\d{4}-\d{2}(-\d{2})?$When it was bought, YYYY-MM-DD (e.g. "2026-11-11"); YYYY-MM means the last day of that month.
^\d{4}-\d{2}(-\d{2})?$Where it was bought (e.g. "Hopfen der Welt").
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 (e.g. 13.2); default is the catalog value.
0 <= value <= 30Hops only: "pellet" (default), "whole", "cryo" or "extract".
"pellet" | "whole" | "cryo" | "extract"Hops only: crop year (e.g. 2025).
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/add_stock" \ -H "Content-Type: application/json" \ -d '{ "ingredient": "string", "amount": 0 }'{
"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"
},
"merged_into_existing": true,
"added": {
"amount": 0,
"unit": "string"
},
"price": {
"cost_per_kg": 0,
"cost_per_unit": 0,
"per": "string",
"currency": "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": {}
}
}