Update an addon
patch
https://api.flactrum.com/v1/addons/{addon}
| Required scope | addons.write |
| Success status | 200 |
| Returns | One Addon object |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| addon * | path | string | ULID of the record. |
Request body
| Field | Type | Description |
|---|---|---|
| group_id * | string | — |
| name * | string | — |
| price * | number | — |
| stock_item_id | string|null | — |
| quantity_per_use | number|null | Required when stock_item_id is set. In the base unit unless quantity_unit is given. |
| quantity_unit | string|null | Unit quantity_per_use is written in; converted to the base unit on save. Must match the stock item's family. |
| waste_percent | number|null | Trim percentage, 0-100. Defaults to 0. |
| is_active | boolean | — |
| sort_order | integer | — |
| translations | object | Language code → fields. Only languages configured for the brand are accepted; an empty value removes that translation. Translatable here: name. |
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | — |
| group_id | string | — |
| name | string | — |
| price | number | — |
| stock_item_id | string|null | Set when the addon consumes a raw material on sale. |
| quantity_per_use | number|null | Amount deducted per use, in the item's base unit. |
| quantity_unit | string|null | The stock item's own unit (kilogram, litre…). |
| entry_quantity_per_use | number|null | quantity_per_use expressed in quantity_unit. |
| waste_percent | number | Trim percentage added on top of quantity_per_use. It comes off stock AND goes into the cost: 30 ml at 10% deducts 33 ml and is costed at 33 ml. |
| gross_quantity_per_use | number|null | quantity_per_use with the trim added — what actually leaves stock. |
| is_active | boolean | — |
| sort_order | integer | — |
Examples
Recorded from the test suite — these are real requests and their real responses.
curl -X PATCH 'https://api.flactrum.com/v1/addons/01m43mxqqkxmgnq3r6v55p3j3k' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"price": 18
}'
HTTP 200 · application/json
{
"data": {
"id": "01m43mxqqkxmgnq3r6v55p3j3k",
"group_id": "01m43mxqqjh5d3tzez04606ss6",
"name": "Yulaf sütü",
"price": 18,
"stock_item_id": null,
"quantity_per_use": null,
"quantity_unit": null,
"entry_quantity_per_use": null,
"waste_percent": 0,
"gross_quantity_per_use": null,
"is_active": true,
"sort_order": 0,
"translations": []
}
}