Update Product Category
Update a product category's icon, image URL or localized names.
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
Must match an existing stored value.
Must not be greater than 64 characters.
Must be a valid URL.
Must not be greater than 191 characters.
Must not be greater than 191 characters.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.flavours.sa/dev/api/v2/product-categories/cumque" \ -H "X-API-Version: 2.3.0" \ -H "Content-Type: application/json" \ -d '{}'{
"meta": {
"code": 200,
"status": "success",
"message": "Update Success"
},
"data": {
"id": 10,
"icon": "🍕",
"name_en": "Updated Category",
"name_ar": "تصنيف محدث",
"deleted_at": null,
"created_at": 1792593344785,
"updated_at": 1792593344790,
"market_id": null,
"image_url": "https://cdn.example.com/img/uploads/product-categories/sample.png",
"products_count": "0",
"sectors": []
}
}{
"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": 500,
"status": "error",
"message": "Internal server error."
},
"data": null
}Sort Product Categories POST
Replace the product category display order. Open to any order-page user (platform admin/merchant or a subscriber). A branch-bound subscriber sorts their OWN branch's order when the request carries a branch_id (any other branch id is ignored, never written) or omits it, and sorts the MARKET-wide order when the request carries an explicit branch_id null (the Product Categories page), which also requires the PRODUCT_CATEGORY_UPDATE grant (403 without it). An unbound saver (admin/merchant or an account-owner subscriber with no branch_id) chooses the scope with branch_id: send a branch_id in the caller's own market to set that branch's per-branch order, or send null/omit it to set the single market-wide global order (category_product_sorts with branch_id null). market_id is the subscriber's own market, or the request market_id for an admin/merchant (ownership-verified). The list with filter[branch_id] reads the branch order; a branch that never sorted follows the market order, and categories the branch has no row for come after its own order, in market order.
Create Product Ingredient POST
Attach an ingredient to a product.