Flavours Partner API
ProductAddon group

Update Addon Group Option

POST
/api/v2/products/addon-groups/{groupId}/options/{optionId}

Update an option of an add-on group, including its pricing mode.

Authorization

API-TOKEN
API-TOKEN<token>

Your partner API key. Send it in the API-TOKEN header on every request.

In: header

Path Parameters

groupId*string
optionId*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

name_en?|

Option name (English). Sending either name key keeps the at-least-one-language rule in force. Must not be greater than 191 characters.

name_ar?|

Option name (Arabic). Sending either name key keeps the at-least-one-language rule in force. Must not be greater than 191 characters.

type?|

ADDITIONAL or ADDITIONAL_VARIABLE. A PERCENT option accepts ADDITIONAL only.

Value in"ADDITIONAL" | "ADDITIONAL_VARIABLE"
calorie?|

Calories the option adds. Must be at least 0.

cost?|

Cost of the option, used to derive its profit. Must be at least 0.

is_tax_included?|

Whether the price already carries tax. Must be false for PERCENT.

price_mode?|

FREE, FIXED or PERCENT. Changing it discards the stored amount — resend the amount the new mode needs.

Value in"FREE" | "FIXED" | "PERCENT"
price?|

Charge of the option. Required when switching to FIXED on an ADDITIONAL option, prohibited for FREE and PERCENT. Must be at least 0.

price_value?string

Percentage of the selected variant charged for the option. Required when switching to PERCENT (greater than 0, up to 100), prohibited otherwise.

includes*array<>

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.flavours.sa/dev/api/v2/products/addon-groups/dolor/options/mollitia" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{    "includes": [      "praesentium"    ]  }'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Add-on group option updated successfully."
  },
  "data": {
    "id": 738792833567133,
    "modifierable_id": "80e863e3-e1e0-45e6-8a57-2d3921aebc6a",
    "name_en": "Extra Garlic Sauce",
    "name_ar": "صلصة ثوم",
    "type": "ADDITIONAL",
    "calorie": 40,
    "price": 0,
    "tax": 0,
    "total": 0,
    "cost": 1,
    "profit": 0,
    "is_tax_included": false,
    "deleted_at": null,
    "barcode": null,
    "weight_amount": null,
    "weight_unit": null,
    "market_id": "eef0da10-dd19-4a4c-ab3d-23dd1b548801",
    "branch_id": null,
    "modifierable_type": "PRODUCT_MODIFIER_ADDON_GROUP",
    "stock": null,
    "product_id": null,
    "sku": null,
    "price_mode": "PERCENT",
    "price_value": 10,
    "updated_at": null,
    "barcode_img": null,
    "ingredients": [],
    "recipes": [],
    "product": null
  }
}
{
  "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
}