Order what the planned brews are short of
Put everything the planned brews are short of (the planner's to_buy amounts, after stock and open orders) on an order in one step: a new draft order, or an existing draft order (order). Defaults: all planned brews and all ingredient types; narrow with brews and type. Lines for the same ingredient merge. Returns the order with its lines; when nothing is short, nothing is created. Recipe lines not linked to an ingredient become free-text order lines (see free_text_items); receive_order links them by name when it can. Check get_planner first to see what will be ordered. Afterwards adjust lines with edit_order_items and mark it ordered with save_order. Needs the plan feature `inventory_planner`. Scope: `inventory:write` (or `write`).
Put everything the planned brews are short of (the planner's to_buy amounts, after stock and open orders) on an order in one step: a new draft order, or an existing draft order (order). Defaults: all planned brews and all ingredient types; narrow with brews and type. Lines for the same ingredient merge. Returns the order with its lines; when nothing is short, nothing is created. Recipe lines not linked to an ingredient become free-text order lines (see free_text_items); receive_order links them by name when it can. Check get_planner first to see what will be ordered. Afterwards adjust lines with edit_order_items and mark it ordered with save_order.
Needs the plan feature inventory_planner. 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
Only these planned brews (ids, batch numbers or exact names, e.g. ["#14", "Wiesn Festbier"]). Default: every brew with status "planned".
items <= 50Only shortages of this ingredient type.
"fermentable" | "hop" | "yeast" | "misc"Add to this existing order (id or exact name; should be a draft). Leave out to create a new order.
Name of the new order (default "Shortages YYYY-MM-DD").
1 <= length <= 200Shop for the new order.
length <= 200Notes for the new order.
length <= 1000Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://brewforge.sh/api/v1/actions/create_order_from_shortages" \ -H "Content-Type: application/json" \ -d '{}'{
"created": true,
"added_lines": 0,
"order": {
"id": "string",
"name": "string",
"supplier": "string",
"status": "draft",
"ordered_date": "string",
"expected_date": "string",
"received_date": "string",
"shipping_cost": 0,
"notes": "string",
"item_count": 0,
"arrived_count": 0,
"items_cost": 0,
"total_cost": 0,
"next_step": "add_items",
"free_text_items": [
"string"
],
"items": [
{
"id": "string",
"type": "fermentable",
"name": "string",
"ingredient_id": "string",
"form": "string",
"alpha_acid_pct": 0,
"harvest_year": 0,
"amount": 0,
"ordered_amount": 0,
"unit": "string",
"received": 0,
"remaining": 0,
"arrival": "pending",
"estimated_cost": 0,
"price_paid": 0,
"notes": "string"
}
]
},
"message": "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": {}
}
}