Flavours API
Ingredient

Decrease Ingredient Stock

POST
/api/v2/ingredients/{ingredientId}/decrease

Decrease the stock of an ingredient for a branch and record the history.

AuthorizationBearer <token>

You can retrieve your token by logging in.

In: header

Path Parameters

ingredientId*string

Header Parameters

X-API-Version*string

API contract version to target. See the Changelog for what changed in each version.

Default"2.0.0"
Value in"2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"

Request Body

application/json

market_id*string

The id of an existing record in the markets table.

branch_id*string

The id of an existing record in the branches table.

qty*number
cost?|

Must be at least 0.

notes?|

Must not be greater than 500 characters.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:8000/api/v2/ingredients/est/decrease" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{    "market_id": "ad",    "branch_id": "modi",    "qty": 162.6944  }'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Ingredient decreased successfully."
  },
  "data": {
    "ingredient_branch_id": "0493bc17-18b3-4307-8a86-7bb9e90c22f4",
    "source_id": "1bd3a07e-fa84-4827-a980-188e5095cc16",
    "source_type": "INGREDIENT",
    "type": "INGREDIENT_DECREASE",
    "qty": "-5.00",
    "notes": "Used in production",
    "created_at": 1782824837033,
    "updated_at": 1782824837033,
    "id": 4
  }
}
{
  "meta": {
    "code": 401,
    "status": "error",
    "message": "Unauthenticated."
  },
  "data": null
}
{
  "meta": {
    "code": 403,
    "status": "error",
    "message": "Unauthorized."
  },
  "data": null
}
{
  "meta": {
    "code": 404,
    "status": "error",
    "message": "Resource not found."
  },
  "data": null
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}