Flavours API Documentation
  1. Products
Flavours API Documentation
  • Readme
  • Developer Guide
  • Authorization
  • Includables
  • Pagination
  • Sorting
  • Retrieve Market Information
  • Retrieve Branch Information
  • Me
    • Overview
    • Detail
      GET
  • Branches
    • Overview
    • List
      GET
    • Detail
      GET
    • Create
      POST
    • Update
      POST
    • Delete
      DELETE
  • Orders
    • Overview
    • List
      GET
    • Detail
      GET
    • Create
      POST
    • Calculate
      POST
    • Checkout
      POST
    • Update
      POST
    • Sync
      POST
  • Customers
    • Overview
    • List
    • Detail
    • Create
    • Update
  • Products
    • Overview
    • List
      GET
    • Detail
      GET
    • Create
      POST
    • Update
      POST
    • Delete
      DELETE
  • Product Categories
    • Overview
    • List
    • Detail
  • Discounts
    • Overview
    • List
    • Detail
    • Verify
  • Payment Methods
    • Overview
    • List
    • Detail
  • Table
    • Overview
    • List
    • Detail
    • Create
    • Update
    • Delete
  • Printer
  • Webhook
    • Orders Webhooks
      • Webhook Events
      • Payload
    • Product Webhooks
      • Webhook Events
      • Payload
    • Loyalty Webhooks
      • Promotional Coupon
    • Customers Webhooks
      • Webhook Events
      • Payload
    • Error Webhook
      • Stay Alert to Connectivity Issues
    • Third-Party
      • Ballurh
        • Install Ballurh
      • Loyapro
        • Loyalty
          • Check Reward
          • Redeem Reward
      • Bonat
        • Check Reward
        • Redeem Reward
      • Fai
        • Register Entity
  1. Products

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
/products

Constant#

Use the constants below according to the field names and rules for each request
ConstantValue
modifiers.typeOPTION ADDITIONAL OPTION_VARIABLE ADDITIONAL_VARIABLE

Validation#

FieldTypeRuleDescription
market_idstringrequiredId from Market model
branch_idstringnullableId from Branch model
product_category_idintegerrequiredId from ProductCategory model
name_enstringrequired
name_arstringnullable
description_enstringnullable
description_arstringnullable
preparation_timeintegernullable min:1
stockintegernullable min:0
imagesarraynullable
images.*filenullable image max:2mb
modifiersarrayrequired
modifiers.*.name_enstringnullable
modifiers.*.name_arstringnullable
modifiers.*.barcodestringnullable unique
modifiers.*.typestringrequiredFrom modifiers.type constant above
modifiers.*.calorieintegernullable min:0
modifiers.*.pricenumericnullable min:0
modifiers.*.costnumericnullable min:0
modifiers.*.is_tax_includedbooleanrequired
modifiers.*.ingredientsarraynullable
modifiers.*.ingredients.*.ingredient_idintegerrequiredId from Ingredient model
modifiers.*.ingredients.*.qtyintegerrequired min:1
modifiers.*.pricesarraynullable
modifiers.*.prices.*.payment_method_keystringrequiredKey from PaymentMethod model
modifiers.*.prices.*.pricenumericrequired min:0
modifiers.*.weight_amountnumericnullable min:0
modifiers.*.weight_unitstringnullable
The rules on the fields will change depending on conditions, including the following
FieldRuleCondition
branch_idrequiredUser authentication role SUBSCRIBER & has branch_id
stocknullableIf the stock is left empty, it means the stock is unlimited
modifiers.*.pricesnullableFill in if the product price different based on payment method
modifiers.*.weight_{amount/unit}nullableFill in if the product price is based on weight

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json

Example
{
    "market_id": "be7407f3-8d36-4a01-a20f-f306f044f496",
    "product_category_id": 1,
    "name_en": "Voluptas autem",
    "stock": 10,
    "preparation_time": 30,
    "modifiers": [
        {
            "name_en": "Large",
            "type": "OPTION",
            "calorie": null,
            "cost": 8,
            "price": 10,
            "is_tax_included": 0,
            "weight_amount": 1,
            "weight_unit": "Kg",
            "prices": [
                {
                    "payment_method_key": "MADA",
                    "price": 11
                },
                {
                    "payment_method_key": "VISA",
                    "price": 11.5
                }
            ],
            "ingredients": [
                {
                    "ingredient_id": 179,
                    "qty": 2
                },
                {
                    "ingredient_id": 180,
                    "qty": 1
                }
            ]
        }
    ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.flavours.sa/dev/api/v2/products' \
--header 'Content-Type: application/json' \
--data-raw '{
    "market_id": "be7407f3-8d36-4a01-a20f-f306f044f496",
    "product_category_id": 1,
    "name_en": "Voluptas autem",
    "stock": 10,
    "preparation_time": 30,
    "modifiers": [
        {
            "name_en": "Large",
            "type": "OPTION",
            "calorie": null,
            "cost": 8,
            "price": 10,
            "is_tax_included": 0,
            "weight_amount": 1,
            "weight_unit": "Kg",
            "prices": [
                {
                    "payment_method_key": "MADA",
                    "price": 11
                },
                {
                    "payment_method_key": "VISA",
                    "price": 11.5
                }
            ],
            "ingredients": [
                {
                    "ingredient_id": 179,
                    "qty": 2
                },
                {
                    "ingredient_id": 180,
                    "qty": 1
                }
            ]
        }
    ]
}'

Responses

🟢200OK
application/json
Body

Example
{"meta":{"code":200,"status":"success","message":"Create Success"},"data":{"id":"415273e5-08cd-4980-af4f-8c150b648724","market_id":"5d4196d7-355a-48ef-9c50-add58cc440f1","branch_id":null,"product_category_id":1,"name_en":"Voluptas autem","name_ar":"Voluptas autem","description_en":null,"description_ar":null,"preparation_time":30,"stock":10,"order":10,"images":null,"is_active":true,"created_at":1698603782894,"updated_at":1698603782894,"deleted_at":null,"rating_amount":0,"rating_avg":"0.00","sold_amount":0,"sold_revenue":0,"qoyod_id":null,"option_modifiers_min_total":11.5,"option_modifiers_max_total":11.5,"market":{"id":"5d4196d7-355a-48ef-9c50-add58cc440f1","sector_id":1,"name_en":"First Restaurant","name_ar":"First Restaurant","description_en":"Ut maxime commodi natus id tenetur ullam. Repudiandae aut quia est perspiciatis facilis dolores repellendus ea eum. Iusto occaecati libero ea voluptas dolore qui qui maxime quod. Eum ut vel possimus sunt doloribus saepe repellendus et.","description_ar":"العظمى إستيلاء الأوروبية، حين عل. هو وبعد قتيل، العالمي ولم, يونيو مساعدة التاريخ، وصل تم. بـ سكان الجو اليابان تحت, يتم لأداء تكتيكاً قُدُماً ان. نفس موالية الجنوبي ما, أضف تم غضون أسابيع وقوعها،. وبدون ميناء الأمريكية فقد عل, قتيل، معارضة ضرب عن, دول وبعض لفرنسا تزامناً ثم. أي أدوات استبدال جعل. يكن لغات مشروط من.","logo_img":null,"cover_img":null,"email":"[email protected]","phone_prefix":"966","phone":"579112767","crn":null,"tax_number":"12345611","created_by":null,"email_verified_at":null,"phone_verified_at":null,"created_at":1680271006362,"updated_at":1683019078189,"deleted_at":null},"branch":null,"category":null,"ingredients":[{"id":687,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"ingredient_id":179,"qty":"2.00","ingredient":null},{"id":688,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"ingredient_id":180,"qty":"1.00","ingredient":{"id":180,"name_en":"Apple","name_ar":"Apple","deleted_at":null,"market_id":"5d4196d7-355a-48ef-9c50-add58cc440f1","branch_id":"02510007-93b6-4121-93d7-c1bd79d00d0c","storage_unit":"Kg","recipe_unit":"G","storage_ratio":"1.00","recipe_ratio":"1000.00","storage_stock":"1.50","cost":null,"min_storage_stock":"1.00"}}],"prices":[{"id":674,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"payment_method_key":"MADA","price":11,"tax":1.65,"total":12.65,"is_tax_included":true,"payment_method":{"key":"MADA","name":"Mada","is_online":false,"logo_img":"http://api-dev.flavours.sa/img/payment-methods/MADA.png"}},{"id":675,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"payment_method_key":"VISA","price":11.5,"tax":1.73,"total":13.23,"is_tax_included":true,"payment_method":{"key":"VISA","name":"Visa","is_online":false,"logo_img":"http://api-dev.flavours.sa/img/payment-methods/VISA.png"}}],"modifiers":[{"id":5677,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","name_en":"Large","name_ar":"Large","type":"OPTION","calorie":null,"price":10,"tax":1.5,"total":11.5,"cost":8,"profit":2,"is_tax_included":false,"deleted_at":null,"barcode":null,"barcode_img":null,"weight_amount":"1.00","weight_unit":"Kg","ingredients":[{"id":687,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"ingredient_id":179,"qty":"2.00","ingredient":null},{"id":688,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"ingredient_id":180,"qty":"1.00","ingredient":{"id":180,"name_en":"Apple","name_ar":"Apple","deleted_at":null,"market_id":"5d4196d7-355a-48ef-9c50-add58cc440f1","branch_id":"02510007-93b6-4121-93d7-c1bd79d00d0c","storage_unit":"Kg","recipe_unit":"G","storage_ratio":"1.00","recipe_ratio":"1000.00","storage_stock":"1.50","cost":null,"min_storage_stock":"1.00"}}],"prices":[{"id":675,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"payment_method_key":"VISA","price":11.5,"tax":1.73,"total":13.23,"is_tax_included":true,"payment_method":{"key":"VISA","name":"Visa","is_online":false,"logo_img":"http://api-dev.flavours.sa/img/payment-methods/VISA.png"}},{"id":674,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"payment_method_key":"MADA","price":11,"tax":1.65,"total":12.65,"is_tax_included":true,"payment_method":{"key":"MADA","name":"Mada","is_online":false,"logo_img":"http://api-dev.flavours.sa/img/payment-methods/MADA.png"}}]}],"option_modifiers":[{"id":5677,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","name_en":"Large","name_ar":"Large","type":"OPTION","calorie":null,"price":10,"tax":1.5,"total":11.5,"cost":8,"profit":2,"is_tax_included":false,"deleted_at":null,"barcode":null,"barcode_img":null,"weight_amount":"1.00","weight_unit":"Kg","ingredients":[{"id":687,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"ingredient_id":179,"qty":"2.00","ingredient":null},{"id":688,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"ingredient_id":180,"qty":"1.00","ingredient":{"id":180,"name_en":"Apple","name_ar":"Apple","deleted_at":null,"market_id":"5d4196d7-355a-48ef-9c50-add58cc440f1","branch_id":"02510007-93b6-4121-93d7-c1bd79d00d0c","storage_unit":"Kg","recipe_unit":"G","storage_ratio":"1.00","recipe_ratio":"1000.00","storage_stock":"1.50","cost":null,"min_storage_stock":"1.00"}}],"prices":[{"id":675,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"payment_method_key":"VISA","price":11.5,"tax":1.73,"total":13.23,"is_tax_included":true,"payment_method":{"key":"VISA","name":"Visa","is_online":false,"logo_img":"http://api-dev.flavours.sa/img/payment-methods/VISA.png"}},{"id":674,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5677,"payment_method_key":"MADA","price":11,"tax":1.65,"total":12.65,"is_tax_included":true,"payment_method":{"key":"MADA","name":"Mada","is_online":false,"logo_img":"http://api-dev.flavours.sa/img/payment-methods/MADA.png"}}]}],"additional_modifiers":[]}}
Modified at 2025-03-17 12:43:29
Previous
Detail
Next
Update
Built with