BrewForge Docs

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`).

POST
/api/v1/actions/edit_order_items

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).

AuthorizationBearer <token>

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 brews
  • brews:write: Create, update, delete brews and notes
  • inventory:read: List inventory items
  • inventory:write: Create, update, delete inventory items
  • equipment:read: List equipment profiles
  • equipment:write: Create, update, delete equipment profiles
  • styles:read: List style profiles
  • styles:write: Create, update, delete style profiles
  • profiles:read: List mash, fermentation, and water profiles
  • custom-fields:read: List custom field definitions
  • custom-fields:write: Create, update, delete custom field definitions
  • profiles:write: Create, update, delete mash, fermentation, and water profiles
  • cellar:read: View cellar, packaged stock, tap lists, and labels
  • cellar:write: Manage cellar, packaging, stock, tap lists, and labels
  • settings:read: View preferences, imports, calculators, and your data export
  • settings:write: Change preferences and undo imports
  • community:read: View community, feedback, tickets, inbox, and account overview
  • community:write: Post, vote, and reply in community, feedback, and tickets

In: header

Scope: inventory:write

Request Body

application/json

order*string

The order: its id (from get_orders) or its exact name (e.g. "Hopfen der Welt November"). Case does not matter.

add?array<>

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"}].

Itemsitems <= 100
update?array<>

Changes 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}].

Itemsitems <= 100
remove?array<>

Lines to take off the order. The order line: its id (from get_orders with order) or the ingredient name on it (e.g. "Citra").

Itemsitems <= 100
[key: string]?never

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/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": {}
  }
}