Flavours API
Product

Create Product

POST
/api/v2/products/multi

Create a new product with its modifiers, prices, ingredients and recipes.

AuthorizationBearer <token>

You can retrieve your token by logging in.

In: header

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

market_id*string

Must match an existing stored value.

branch_id?|

Must match an existing stored value.

category_id?|
name_en*string

Must not be greater than 350 characters.

name_ar?|

Must not be greater than 350 characters.

description_en?|

Must not be greater than 2000 characters.

description_ar?|

Must not be greater than 2000 characters.

duration?|

Must be at least 0.

images*array<>

Must be a valid URL.

exclusions?array<>

Must match an existing stored value.

min_additionals?|

Must be at least 0.

max_additionals?|

Must be at least 0.

branches?array<|>

Must have at least 0 items.

options*array<>

Must have at least 1 items.

additionals?array<|>

Must have at least 0 items.

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/multi" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{    "market_id": "ut",    "name_en": "zcfxihuzyopp",    "images": [      "https://www.reinger.com/doloremque-voluptas-atque-quibusdam-sit-est"    ],    "options": [      []    ]  }'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Product created successfully."
  },
  "data": {
    "id": "2b653ddb-cb87-4344-bc52-090b3dae8b4f",
    "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
    "branch_id": "7c538fd7-9547-4b16-959d-f01052e04c6f",
    "name_en": "Cheese Burger",
    "name_ar": "برجر جبن",
    "description_en": null,
    "description_ar": null,
    "stock": 100,
    "order": 78,
    "images": null,
    "is_active": true,
    "created_at": 1787446703639,
    "updated_at": 1787446703639,
    "deleted_at": null,
    "rating_amount": 0,
    "rating_avg": "0.00",
    "sold_amount": 0,
    "sold_revenue": 0,
    "qoyod_id": null,
    "min_additionals": null,
    "max_additionals": null,
    "is_global": false,
    "stock_modifiers_sum_stock": 100,
    "options_min_total": 25.5,
    "options_max_total": 25.5,
    "product_category_id": null,
    "preparation_time": null,
    "market": {
      "id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
      "sector_id": 10,
      "name_en": "Howell, Baumbach and Hagenes",
      "name_ar": "Ankunding, Marks and Stracke",
      "description_en": "Culpa et inventore quo error sed.",
      "description_ar": null,
      "logo_img": "https://via.placeholder.com/200x200.png/006655?text=business+logo+quidem",
      "cover_img": "https://via.placeholder.com/200x200.png/00cc77?text=business+cover+dolorem",
      "email": "[email protected]",
      "phone_prefix": "973",
      "phone_number": "7148591204",
      "crn": "030-077-7963",
      "tax_number": "90476326386",
      "created_by": null,
      "email_verified_at": 1787446674909,
      "phone_verified_at": 1787446674909,
      "created_at": 1787446674760,
      "updated_at": 1787446695752,
      "deleted_at": null,
      "is_active": true,
      "merchant_id": null,
      "reseller_id": null,
      "slug": "kunde-ltd",
      "code": "ENT-0000000001",
      "links": {
        "website": null,
        "instagram": null,
        "youtube": null,
        "x": null,
        "call_center": null
      },
      "phone": "7148591204"
    },
    "branch": {
      "id": "7c538fd7-9547-4b16-959d-f01052e04c6f",
      "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
      "name_en": "Pacocha LLC",
      "name_ar": "Pacocha LLC",
      "address": "505 Brandi Corners Apt. 877\nLake Emieside, AL 44416-6003",
      "latitude": 58.790845,
      "longitude": -157.481388,
      "is_active": true,
      "created_at": 1787446674762,
      "updated_at": 1787446674762,
      "deleted_at": null,
      "expired_at": null,
      "is_online": false,
      "code": "BR-725617"
    },
    "category": null,
    "exclusions": [],
    "options": [
      {
        "id": 717712194108133,
        "modifierable_id": "2b653ddb-cb87-4344-bc52-090b3dae8b4f",
        "name_en": null,
        "name_ar": null,
        "type": "OPTION",
        "calorie": null,
        "price": 25.5,
        "tax": 0,
        "total": 25.5,
        "cost": null,
        "profit": null,
        "is_tax_included": true,
        "deleted_at": null,
        "barcode": null,
        "barcode_img": null,
        "weight_amount": null,
        "weight_unit": null,
        "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
        "branch_id": "7c538fd7-9547-4b16-959d-f01052e04c6f",
        "modifierable_type": "PRODUCT_MODIFIER_PRODUCT",
        "stock": 100,
        "product_id": "2b653ddb-cb87-4344-bc52-090b3dae8b4f",
        "sku": null,
        "recipes": [],
        "ingredients": [],
        "prices": [],
        "additionals": []
      }
    ],
    "additionals": []
  }
}
{
  "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 selected market id is invalid. (and 2 more errors)"
  },
  "data": [
    {
      "code": 0,
      "message": "The selected market is invalid.",
      "field": "market"
    },
    {
      "code": 0,
      "message": "The name en field is required.",
      "field": "name_en"
    },
    {
      "code": 0,
      "message": "The options field is required.",
      "field": "options"
    }
  ]
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}