Create
Developing
DEVELOPMENT
https://api.flavours.sa/dev/api/v2
DEVELOPMENT
https://api.flavours.sa/dev/api/v2
POST
https://api.flavours.sa/dev/api/v2
Constant
Constant | Value |
---|---|
modifiers.type | OPTION ADDITIONAL OPTION_VARIABLE ADDITIONAL_VARIABLE |
Validation
Field | Type | Rule | Description |
---|---|---|---|
market_id | string | required | Id from Market model |
branch_id | string | nullable | Id from Branch model |
product_category_id | integer | required | Id from ProductCategory model |
name_en | string | required | |
name_ar | string | nullable | |
description_en | string | nullable | |
description_ar | string | nullable | |
preparation_time | integer | nullable min:1 | |
stock | integer | nullable min:0 | |
images | array | nullable | |
images.* | file | nullable image max:2mb | |
modifiers | array | required | |
modifiers.*.name_en | string | nullable | |
modifiers.*.name_ar | string | nullable | |
modifiers.*.barcode | string | nullable unique | |
modifiers.*.type | string | required | From modifiers.type constant above |
modifiers.*.calorie | integer | nullable min:0 | |
modifiers.*.price | numeric | nullable min:0 | |
modifiers.*.cost | numeric | nullable min:0 | |
modifiers.*.is_tax_included | boolean | required | |
modifiers.*.ingredients | array | nullable | |
modifiers.*.ingredients.*.ingredient_id | integer | required | Id from Ingredient model |
modifiers.*.ingredients.*.qty | integer | required min:1 | |
modifiers.*.prices | array | nullable | |
modifiers.*.prices.*.payment_method_key | string | required | Key from PaymentMethod model |
modifiers.*.prices.*.price | numeric | required min:0 | |
modifiers.*.weight_amount | numeric | nullable min:0 | |
modifiers.*.weight_unit | string | nullable |
Field | Rule | Condition |
---|---|---|
branch_id | required | User authentication role SUBSCRIBER & has branch_id |
stock | nullable | If the stock is left empty, it means the stock is unlimited |
modifiers.*.prices | nullable | Fill in if the product price different based on payment method |
modifiers.*.weight_{amount/unit} | nullable | Fill in if the product price is based on weight |
Request
Body Params application/json