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

Update

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/{productId}

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
branch_idstringnullableId from Branch model
product_category_idintegernullableId from ProductCategory model
name_enstringnullable
name_arstringnullable
description_enstringnullable
description_arstringnullable
preparation_timeintegernullable min:1
stockintegernullable min:0
imagesarraynullable
images.*filenullable image max:2mb
modifiersarraynullable
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
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 ********************
Path Params

Body Params application/json

Example
{
    "product_category_id": 1,
    "name_en": "Voluptas autem Updated",
    "stock": null,
    "preparation_time": 30,
    "modifiers": [
        {
            "name_en": "Extra Large",
            "type": "OPTION",
            "calorie": null,
            "cost": 9,
            "price": 11,
            "is_tax_included": 1,
            "prices": [
                {
                    "payment_method_key": "MADA",
                    "price": 12
                }
            ],
            "ingredients": [
                {
                    "ingredient_id": 179,
                    "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/415273e5-08cd-4980-af4f-8c150b648724' \
--header 'Content-Type: application/json' \
--data-raw '{
    "product_category_id": 1,
    "name_en": "Voluptas autem Updated",
    "stock": null,
    "preparation_time": 30,
    "modifiers": [
        {
            "name_en": "Extra Large",
            "type": "OPTION",
            "calorie": null,
            "cost": 9,
            "price": 11,
            "is_tax_included": 1,
            "prices": [
                {
                    "payment_method_key": "MADA",
                    "price": 12
                }
            ],
            "ingredients": [
                {
                    "ingredient_id": 179,
                    "qty": 1
                }
            ]
        }
    ]
}'

Responses

🟢200OK
application/json
Body

Example
{"meta":{"code":200,"status":"success","message":"Update 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 Updated","name_ar":"Voluptas autem","description_en":null,"description_ar":null,"preparation_time":30,"stock":null,"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,"option_modifiers_max_total":11,"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":689,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5678,"ingredient_id":179,"qty":"1.00","ingredient":null}],"prices":[{"id":676,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5678,"payment_method_key":"MADA","price":10.43,"tax":1.57,"total":12,"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"}}],"modifiers":[{"id":5678,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","name_en":"Extra Large","name_ar":"Extra Large","type":"OPTION","calorie":null,"price":9.57,"tax":1.43,"total":11,"cost":9,"profit":0.57,"is_tax_included":true,"deleted_at":null,"barcode":null,"barcode_img":null,"weight_amount":null,"weight_unit":null,"ingredients":[{"id":689,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5678,"ingredient_id":179,"qty":"1.00","ingredient":null}],"prices":[{"id":676,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5678,"payment_method_key":"MADA","price":10.43,"tax":1.57,"total":12,"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":5678,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","name_en":"Extra Large","name_ar":"Extra Large","type":"OPTION","calorie":null,"price":9.57,"tax":1.43,"total":11,"cost":9,"profit":0.57,"is_tax_included":true,"deleted_at":null,"barcode":null,"barcode_img":null,"weight_amount":null,"weight_unit":null,"ingredients":[{"id":689,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5678,"ingredient_id":179,"qty":"1.00","ingredient":null}],"prices":[{"id":676,"product_id":"415273e5-08cd-4980-af4f-8c150b648724","product_modifier_id":5678,"payment_method_key":"MADA","price":10.43,"tax":1.57,"total":12,"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:31
Previous
Create
Next
Delete
Built with