BrewForge Docs

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

POST
/api/v1/actions/receive_order

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

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.

items?array<>

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

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