Receive an order into stock
Mark an order's lines as arrived and book them into the ingredient stock ("the order from Hopfen der Welt arrived"). Without items: receives everything still outstanding on the order. With items: only those lines, with an optional amount (default: what is still outstanding, in the line's unit) and price_paid for the line. The result lists stock_changes (each changed stock row before/after). Booking into stock merges into the matching stock row and sets the price per kg / per unit from the line price plus its share of shipping, with the order's supplier on the stock row. Free-text lines are booked into the brewer's own library ingredient of the same name (subscribed or own ingredients, as in the pickers); lines with no such ingredient are marked received but not booked (see note). The order becomes "partial" or "received". Send add_to_stock: false for lines that should not go into the inventory. Needs the plan feature `orders`. Scope: `inventory:write` (or `write`).
Mark an order's lines as arrived and book them into the ingredient stock ("the order from Hopfen der Welt arrived"). Without items: receives everything still outstanding on the order. With items: only those lines, with an optional amount (default: what is still outstanding, in the line's unit) and price_paid for the line. The result lists stock_changes (each changed stock row before/after). Booking into stock merges into the matching stock row and sets the price per kg / per unit from the line price plus its share of shipping, with the order's supplier on the stock row. Free-text lines are booked into the brewer's own library ingredient of the same name (subscribed or own ingredients, as in the pickers); lines with no such ingredient are marked received but not booked (see note). The order becomes "partial" or "received". Send add_to_stock: false for lines that should not go into the inventory.
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.
Lines to receive; leave out to receive the whole order. Each: {item (line id or ingredient name), amount?, price_paid?, add_to_stock?}, e.g. [{"item": "Citra", "price_paid": 8.2}].
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/receive_order" \ -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"
}
]
},
"booked_into_stock": 0,
"skipped_lines": [
"string"
],
"stock_changes": [
{
"stock": "string",
"name": "string",
"type": "string",
"created": true,
"amount_before": 0,
"amount_after": 0,
"unit": "string",
"cost_per_kg_before": 0,
"cost_per_kg_after": 0,
"cost_per_unit_before": 0,
"cost_per_unit_after": 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": {}
}
}