Flavours Partner API
ProductAddon group

Create Addon Group

POST
/api/v2/products/addon-groups

Add a reusable add-on group to the business library.

Authorization

API-TOKEN
API-TOKEN<token>

Your partner API key. Send it in the API-TOKEN header on every request.

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?|

Business the group belongs to. Auto-filled from the caller for a subscriber; required in the body for an admin acting on a business. Must match an existing stored value.

name_en?|

Group name (English). At least one of name_en / name_ar is required. This field is required when name_ar is not present. Must not be greater than 191 characters.

name_ar?|

Group name (Arabic). At least one of name_en / name_ar is required. This field is required when name_en is not present. Must not be greater than 191 characters.

min_additionals?|

Minimum options a customer must pick from this group. Must be at least 0.

max_additionals?|

Maximum options a customer may pick from this group. Must be at least 1.

order?|

Sort position of the group inside the business library. Must be at least 0.

includes*array<>

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/addon-groups" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{    "includes": [      "pariatur"    ]  }'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Add-on group created successfully."
  },
  "data": {
    "id": "ece3d61e-3de8-497d-ba30-dfc98a4188e8",
    "market_id": "eef0da10-dd19-4a4c-ab3d-23dd1b548801",
    "name_en": "Reiciendis nisi",
    "name_ar": "الصلصات",
    "min_additionals": 0,
    "max_additionals": 3,
    "order": 1,
    "created_at": 1792593344311,
    "updated_at": 1792593344311,
    "deleted_at": null,
    "products_count": 0,
    "options": []
  }
}
{
  "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": "Minimum selections cannot be greater than maximum selections. (and 1 more error)"
  },
  "data": [
    {
      "code": 0,
      "message": "Minimum selections cannot be greater than maximum selections.",
      "field": "min_additionals"
    },
    {
      "code": 0,
      "message": "Minimum selections cannot be greater than maximum selections.",
      "field": "max_additionals"
    }
  ]
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}