Add, change or remove order lines
Change the lines of one order in a single call: add new lines (ingredient by name or id; a line for the same ingredient, form and unit is merged by adding the amounts), update lines (amount, ordered_amount, price_paid from the invoice, estimated_cost, notes) and remove lines. Amounts: fermentables/hops in g (default) or kg (the line keeps g or kg; oz/lb are converted to g); yeast in pkg by default; misc in the ingredient's unit. Prices are per whole line in the user's currency. Lines are referenced by line id or ingredient name. To book arrived lines into stock use receive_order. Needs the plan feature `orders`. Scope: `inventory:write` (or `write`).
Change the lines of one order in a single call: add new lines (ingredient by name or id; a line for the same ingredient, form and unit is merged by adding the amounts), update lines (amount, ordered_amount, price_paid from the invoice, estimated_cost, notes) and remove lines. Amounts: fermentables/hops in g (default) or kg (the line keeps g or kg; oz/lb are converted to g); yeast in pkg by default; misc in the ingredient's unit. Prices are per whole line in the user's currency. Lines are referenced by line id or ingredient name. To book arrived lines into stock use receive_order.
Needs the plan feature orders. 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 order: its id (from get_orders) or its exact name (e.g. "Hopfen der Welt November"). Case does not matter.
New lines. Each: {ingredient (name or id), amount, unit?, type?, form?, alpha_acid_pct?, harvest_year?, estimated_cost?, price_paid?, notes?}, e.g. [{"ingredient": "Citra", "amount": 500}, {"ingredient": "Pilsner Malt", "amount": 25, "unit": "kg"}].
items <= 100Changes to existing lines. Each: {item (line id or ingredient name), amount?, ordered_amount?, unit?, price_paid?, estimated_cost?, notes?}, e.g. [{"item": "Citra", "price_paid": 18.5}].
items <= 100Lines to take off the order. The order line: its id (from get_orders with order) or the ingredient name on it (e.g. "Citra").
items <= 100Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://brewforge.sh/api/v1/actions/edit_order_items" \ -H "Content-Type: application/json" \ -d '{ "order": "string" }'{
"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"
}
]
}
}{
"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": {}
}
}