Flavours API
Branch

Create Branch

POST
/api/v2/branches

Create a new branch for a market.

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

includes*array<>
market_id*string

Market ID. Must match an existing stored value.

name_en*string

English name. Must not be greater than 191 characters.

name_ar?|

Arabic name. Must not be greater than 191 characters.

address*string

Branch address. Must not be greater than 500 characters.

latitude*number

Geographic latitude. Must be between -90 and 90.

longitude*number

Geographic longitude. Must be between -180 and 180.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.flavours.sa/dev/api/v2/branches" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{    "includes": [      "dolor"    ],    "market_id": "uuid",    "name_en": "Downtown Branch",    "address": "123 Main Street, Riyadh",    "latitude": 24.7136,    "longitude": 46.6753  }'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Branch created successfully."
  },
  "data": {
    "id": "56d41882-7a00-4409-9332-d4ca84c919de",
    "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
    "name_en": "Gorczany, Smitham and Braun",
    "name_ar": "Gorczany, Smitham and Braun",
    "address": "5413 Mason Village Suite 692\nNew Erwin, NE 17760-9085",
    "latitude": -30.384632,
    "longitude": -1.628585,
    "is_active": false,
    "created_at": 1787446686352,
    "updated_at": 1787446686352,
    "deleted_at": null,
    "expired_at": null,
    "is_online": false,
    "code": "BR-947848",
    "level": null,
    "shift": {
      "day": "SUN",
      "min": 1787443200000,
      "max": 1787529599000,
      "open_at": 1787442600000,
      "lock_at": 1787533199000
    },
    "days": {
      "SUN": 1,
      "MON": 1,
      "TUE": 1,
      "WED": 1,
      "THU": 1,
      "FRI": 1,
      "SAT": 1
    },
    "location": null,
    "plans": [],
    "schedules": [
      {
        "id": 8,
        "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
        "branch_id": "56d41882-7a00-4409-9332-d4ca84c919de",
        "day": "SUN",
        "start_time": "00:00:00",
        "close_time": "23:59:59",
        "created_at": 1787446686352,
        "updated_at": 1787446686352,
        "open_type": null,
        "open_value": null,
        "lock_type": null,
        "lock_value": null,
        "end_time": "23:59:59"
      },
      {
        "id": 9,
        "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
        "branch_id": "56d41882-7a00-4409-9332-d4ca84c919de",
        "day": "MON",
        "start_time": "00:00:00",
        "close_time": "23:59:59",
        "created_at": 1787446686352,
        "updated_at": 1787446686352,
        "open_type": null,
        "open_value": null,
        "lock_type": null,
        "lock_value": null,
        "end_time": "23:59:59"
      },
      {
        "id": 10,
        "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
        "branch_id": "56d41882-7a00-4409-9332-d4ca84c919de",
        "day": "TUE",
        "start_time": "00:00:00",
        "close_time": "23:59:59",
        "created_at": 1787446686352,
        "updated_at": 1787446686352,
        "open_type": null,
        "open_value": null,
        "lock_type": null,
        "lock_value": null,
        "end_time": "23:59:59"
      },
      {
        "id": 11,
        "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
        "branch_id": "56d41882-7a00-4409-9332-d4ca84c919de",
        "day": "WED",
        "start_time": "00:00:00",
        "close_time": "23:59:59",
        "created_at": 1787446686352,
        "updated_at": 1787446686352,
        "open_type": null,
        "open_value": null,
        "lock_type": null,
        "lock_value": null,
        "end_time": "23:59:59"
      },
      {
        "id": 12,
        "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
        "branch_id": "56d41882-7a00-4409-9332-d4ca84c919de",
        "day": "THU",
        "start_time": "00:00:00",
        "close_time": "23:59:59",
        "created_at": 1787446686352,
        "updated_at": 1787446686352,
        "open_type": null,
        "open_value": null,
        "lock_type": null,
        "lock_value": null,
        "end_time": "23:59:59"
      },
      {
        "id": 13,
        "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
        "branch_id": "56d41882-7a00-4409-9332-d4ca84c919de",
        "day": "FRI",
        "start_time": "00:00:00",
        "close_time": "23:59:59",
        "created_at": 1787446686352,
        "updated_at": 1787446686352,
        "open_type": null,
        "open_value": null,
        "lock_type": null,
        "lock_value": null,
        "end_time": "23:59:59"
      },
      {
        "id": 14,
        "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
        "branch_id": "56d41882-7a00-4409-9332-d4ca84c919de",
        "day": "SAT",
        "start_time": "00:00:00",
        "close_time": "23:59:59",
        "created_at": 1787446686352,
        "updated_at": 1787446686352,
        "open_type": null,
        "open_value": null,
        "lock_type": null,
        "lock_value": null,
        "end_time": "23:59:59"
      }
    ],
    "out_of_stock_products": [],
    "market": {
      "id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
      "sector_id": 10,
      "name_en": "Kunde Ltd",
      "name_ar": "Kunde Ltd",
      "description_en": null,
      "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": 1787446674760,
      "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",
      "setting": null
    },
    "setting": {
      "id": 2,
      "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
      "branch_id": "56d41882-7a00-4409-9332-d4ca84c919de",
      "is_kitchen_active": true,
      "is_pay_later": false,
      "invoice_prefix": null,
      "zatca_otp": null,
      "extension": {
        "has_cleartax": false,
        "has_zatca": false,
        "has_qoyod": false
      },
      "payment": {
        "has_apple": true,
        "has_card": true,
        "has_cash": true
      },
      "service": {
        "has_dining": true,
        "has_take_away": true
      },
      "active_plan": null,
      "active_subscription": null
    },
    "waiting_orders": [],
    "process_orders": [],
    "canceled_orders": [],
    "completed_orders": []
  }
}
{
  "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 4 more errors)"
  },
  "data": [
    {
      "code": 0,
      "message": "The selected market is invalid.",
      "field": "market"
    },
    {
      "code": 0,
      "message": "The name en must be a string.",
      "field": "name_en"
    },
    {
      "code": 0,
      "message": "The address field is required.",
      "field": "address"
    },
    {
      "code": 0,
      "message": "The latitude must be a number.",
      "field": "latitude"
    },
    {
      "code": 0,
      "message": "The longitude must be a number.",
      "field": "longitude"
    }
  ]
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}