Flavours API Documentation
  1. Customers
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
      GET
    • Detail
      GET
    • Create
      POST
    • Update
      POST
  • Products
    • Overview
    • List
    • Detail
    • Create
    • Update
    • 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. Customers

Create

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
/users/customers

Validation#

FieldTypeRuleDescription
namestringrequired
emailstringnullable email unique
phone_prefixnumericrequired
phonenumericrequired min:8 unique
market_idstringnullableId from Market model
The rules on the fields will change depending on conditions, including the following
FieldRuleCondition
market_idrequiredUser authentication role SUBSCRIBER

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
market_id
string 
optional
name
string 
required
email
string 
optional
phone_prefix
string 
required
phone
string 
required
Example
{
  "name": "Rhon",
  "phone_prefix": "966",
  "phone": "889773809",
  "market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
  "email": "[email protected]"
}

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/users/customers' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Rhon",
    "phone_prefix": "966",
    "phone": "889773809",
    "market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
    "email": "[email protected]"
}'

Responses

🟢200OK
application/json
Body
meta
object 
required
code
integer 
required
status
string 
required
message
string 
required
data
object 
required
id
string 
required
created_by
null 
required
qoyod_id
null 
required
user
object 
required
markets
array [object {4}] 
required
Examples
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Create Success"
  },
  "data": {
    "id": "c4a868ea-735e-461f-868c-a5d2eaa212d0",
    "created_by": null,
    "qoyod_id": null,
    "type": null,
    "gender": null,
    "tax_number": null,
    "zip_code": null,
    "city": null,
    "district": null,
    "street": null,
    "crn": null,
    "user": {
      "id": "fe4aa1ef-b35c-4e69-be60-fc34ab7447e5",
      "userable_id": "c4a868ea-735e-461f-868c-a5d2eaa212d0",
      "role": "CUSTOMER",
      "name": "User 1",
      "username": null,
      "email": "[email protected]",
      "phone_prefix": "966",
      "phone": "55223322",
      "lang": "en",
      "fcm_token": null,
      "is_active": true,
      "email_verified_at": null,
      "phone_verified_at": null,
      "created_at": 1705548163869,
      "updated_at": 1705548163869,
      "deleted_at": null
    },
    "markets": [
      {
        "id": 152,
        "customer_id": "c4a868ea-735e-461f-868c-a5d2eaa212d0",
        "market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
        "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": "https://flavours-files.s3.me-south-1.amazonaws.com/img/uploads/markets/covers/1688386859.png",
          "email": "[email protected]",
          "phone_prefix": "966",
          "phone": "551564439",
          "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,
          "is_active": true
        }
      }
    ]
  }
}
Previous
Detail
Next
Update
Built with