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

Must match an existing stored value.

branch_id*string

Must match an existing stored value.

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 "https://api.flavours.sa/dev/api/v2/ingredients/corrupti/decrease" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{    "market_id": "debitis",    "branch_id": "dignissimos",    "qty": 571  }'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Ingredient decreased successfully."
  },
  "data": {
    "ingredient_branch_id": "a88f7ae6-c6dc-485e-add0-64c39a0a377d",
    "source_id": "1209c261-3e8b-41b0-a028-ebdc00eaa848",
    "source_type": "INGREDIENT",
    "type": "INGREDIENT_DECREASE",
    "qty": "-5.00",
    "notes": "Used in production",
    "created_at": 1787446694766,
    "updated_at": 1787446694766,
    "id": 6
  }
}
{
  "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
}