Create Addon Group Option
Add an option to an add-on group with its pricing mode.
Authorization
API-TOKEN Your partner API key. Send it in the API-TOKEN header on every request.
In: header
Path Parameters
Header Parameters
API contract version to target. See the Changelog for what changed in each version.
"2.0.0""2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"Request Body
application/json
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.
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.
ADDITIONAL for a fixed-name add-on, ADDITIONAL_VARIABLE for a cashier-priced one. PERCENT pricing accepts ADDITIONAL only.
"ADDITIONAL" | "ADDITIONAL_VARIABLE"Calories the option adds. Must be at least 0.
Cost of the option, used to derive its profit. Must be at least 0.
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.
FREE, FIXED or PERCENT. Omitted means FIXED.
"FREE" | "FIXED" | "PERCENT"Charge of the option. Required for a FIXED ADDITIONAL, prohibited for FREE and PERCENT. Must be at least 0.
Percentage of the selected variant charged for the option. Required for PERCENT (greater than 0, up to 100), prohibited otherwise.
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
}