Sanal AI
  1. Data Structures
Sanal AI
  • Introduction
    • ๐Ÿš€ Sanal AI - Encore Data
    • ๐Ÿ› ๏ธ Getting Started
    • ๐Ÿค The Approach / Model
  • Data Structures
    • ๐Ÿ“ Data Layout
    • ๐Ÿช Merchants
    • ๐Ÿ“‚ Categories
    • ๐Ÿท๏ธ Items
    • ๐Ÿ›’ Products
    • ๐Ÿ“ฆ Inventory
    • ๐Ÿ‘ค Customers
    • ๐Ÿงพ Orders
    • ๐Ÿงพ Variants & Combinations
  • API Requirements
    • ๐Ÿ”Œ API Requirements
    • API: `syncMerchants`
    • API: `syncCategories`
    • API: `syncItems`
    • API: `syncProducts`
    • API: `syncInventory`
    • API: `syncCustomers`
    • API: `syncOrders`
  1. Data Structures

๐Ÿ‘ค Customers

This object represents a single user of the Sanal AI app.

Fields#

NameTypeDescription
idstringThe unique identifier for the customer (e.g., cus_...).
full_namestringThe customer's full name.
phone_numberstringThe primary identifier for login, in international format (e.g., +966...).
emailstringOptional. The customer's email address.
saved_addressesarrayA list of the customer's saved delivery locations with enhanced address details. See structure below.
favorite_merchant_idsarrayA list of ids for the Merchants the customer has favorited.
favorite_item_idsarrayA list of ids for the global Items the customer has liked (captures core preference).
is_activebooleanWhen false, the customer should not be able to log in, place orders, or search.
updated_atstringThe timestamp of the last modification (ISO 8601 UTC).

Structure of saved_addresses Object#

Enhanced saved address with detailed location information.
NameTypeDescription
tagstringUser-defined label for the address (e.g., "Home", "Office").
house_numberstringHouse/building number (e.g., "123", "45A").
building_namestringOptional. Name of the building (e.g., "Al-Fahad Tower").
streetstringStreet name without house number (e.g., "Olaya Street").
areastringOptional. Area/neighborhood name (e.g., "Olaya").
citystringCity name.
postal_codestringOptional. Postal/ZIP code.
countrystringCountry code (ISO 3166-1 alpha-2).
locationobjectPrecise geographic coordinates (latitude, longitude).

Sample JSON#

{
  "id": "cus_a1b2c3d4",
  "full_name": "Fatima Al-Fahad",
  "phone_number": "+966551234567",
  "email": "fatima.alfahad@example.com",
  "saved_addresses": [
    {
      "tag": "Home",
      "house_number": "123",
      "building_name": "Al-Fahad Tower",
      "street": "Olaya Street",
      "area": "Olaya",
      "city": "Riyadh",
      "postal_code": "12345",
      "country": "SA",
      "location": { "latitude": 24.7136, "longitude": 46.6753 }
    },
    {
      "tag": "Office",
      "house_number": "456",
      "building_name": "King Abdullah Financial District",
      "street": "KAFD",
      "area": "KAFD",
      "city": "Riyadh",
      "postal_code": "13519",
      "country": "SA",
      "location": { "latitude": 24.7625, "longitude": 46.6418 }
    }
  ],
  "favorite_merchant_ids": [
    "mer_riyadh_burger_house",
    "mer_tamimi_riyadh"
  ],
  "favorite_item_ids": [
    "item_rbh_classic_burger",
    "item_almarai_milk_1l"
  ],
  "is_active": true,
  "updated_at": "2025-10-16T10:30:00Z"
}

Previous
๐Ÿ“ฆ Inventory
Next
๐Ÿงพ Orders
Built with