BrewForge Docs

Change bottle/can stock

Changes the count of bottles or cans of a beer. action: adjust = add/remove some (delta, e.g. -3 after drinking three); set_count = the real count after counting (count); add = add stock by hand, e.g. bought cans or beer not packaged in BrewForge (container, beer, count; creates the line if needed); gone = bottles that left for good (given away, broken, one-way): lowers how many of the container are owned (container, count) — use adjust first to take them out of stock; link_brew = stock of a hand-typed beer belongs to one of the brewer's brews (beer = the typed name, brew). Point at stock with beer (brew name, batch number or typed name) and container (when the beer is in several), or line_id from get_beer_stock. Returns an undo_token. Needs the plan feature `cellar`. Scope: `cellar:write` (or `write`).

POST
/api/v1/actions/update_bottle_stock

Changes the count of bottles or cans of a beer. action: adjust = add/remove some (delta, e.g. -3 after drinking three); set_count = the real count after counting (count); add = add stock by hand, e.g. bought cans or beer not packaged in BrewForge (container, beer, count; creates the line if needed); gone = bottles that left for good (given away, broken, one-way): lowers how many of the container are owned (container, count) — use adjust first to take them out of stock; link_brew = stock of a hand-typed beer belongs to one of the brewer's brews (beer = the typed name, brew). Point at stock with beer (brew name, batch number or typed name) and container (when the beer is in several), or line_id from get_beer_stock. Returns an undo_token.

Needs the plan feature cellar. Scope: cellar: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: cellar:write

Request Body

application/json

action*string

add, adjust, set_count, gone or link_brew.

Value in"add" | "adjust" | "set_count" | "gone" | "link_brew"
beer?string

The beer: brew id, batch number, brew name or a hand-typed beer name, e.g. "Oatmeal Stout". For add: a brew, else it is stored as a typed name.

container?string

Bottle/can container id or exact name, e.g. "0.5 L bottles". Required for add and gone.

line_id?string

Instead of beer + container: the line_id from get_beer_stock.

count?integer

set_count: the new count; add / gone: how many, e.g. 12.

Range0 <= value
delta?integer

adjust: change, e.g. -2 or 6 (between -1000 and 1000, not 0).

brew?string

link_brew: the brew (id, batch number or exact name).

[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/update_bottle_stock" \  -H "Content-Type: application/json" \  -d '{    "action": "add"  }'
{
  "beer": "string",
  "container": "string",
  "count": 0,
  "container_owned": 0,
  "container_empty": 0,
  "undo_token": "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": {}
  }
}