Flavours Partner API
ProductAddon group

Create Addon Group Option

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

Add an option to an add-on group with 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

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). At least one of name_en / name_ar is required. This field is required when name_ar is not present. Must not be greater than 191 characters.

name_ar?|

Option name (Arabic). At least one of name_en / name_ar is required. This field is required when name_en is not present. Must not be greater than 191 characters.

type*string

ADDITIONAL for a fixed-name add-on, ADDITIONAL_VARIABLE for a cashier-priced one. PERCENT pricing 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. Optional; omitted or null means true. Must be false for PERCENT, where an omitted value is stored as false.

price_mode?|

FREE, FIXED or PERCENT. Omitted means FIXED.

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

Charge of the option. Required for a FIXED ADDITIONAL, prohibited for FREE and PERCENT. Must be at least 0.

price_value?string

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

includes*array<>

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.flavours.sa/dev/api/v2/products/addon-groups/autem/options" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{    "type": "ADDITIONAL",    "includes": [      "ut"    ]  }'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Add-on group option created successfully."
  },
  "data": {
    "id": 738792833262640,
    "modifierable_id": "22601157-c76e-456b-b114-0f649577780d",
    "name_en": "Garlic Sauce",
    "name_ar": "صلصة ثوم",
    "type": "ADDITIONAL",
    "calorie": 40,
    "price": 2,
    "tax": 0,
    "total": 2,
    "cost": 1,
    "profit": 1,
    "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": "FIXED",
    "price_value": null,
    "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": 422,
    "status": "error",
    "message": "The percentage must be greater than 0 and no more than 100."
  },
  "data": [
    {
      "code": 0,
      "message": "The percentage must be greater than 0 and no more than 100.",
      "field": "price_value"
    }
  ]
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}