Skip to Content
FeaturesCustomers

Customers

Overview

The Customers feature provides a complete customer relationship management system for Siyahfy stores. Vendors can view customer profiles, order history, addresses, and account activity. Customers register and log in using OTP-based email verification, manage their own profiles, and maintain multiple shipping addresses. Vendors can also import customers in bulk, export customer data, blacklist abusive accounts, and control COD (Cash on Delivery) eligibility per customer.

How It Works

Customer Registration Flow

  1. Customer enters email and basic details on the storefront.
  2. An OTP is sent to their email address.
  3. Customer enters the OTP to verify their identity.
  4. Account is created in the customers table with a hashed password.
  5. A JWT token is returned for authenticated session.

Vendor-Side Customer Management

Vendors can:

  • View all customers with search, filter, and pagination
  • Edit customer contact information and notes
  • Manage multiple addresses per customer
  • View complete order history per customer
  • Toggle COD eligibility (useful for managing risky customers)
  • Blacklist customers to prevent future orders
  • Bulk import customers via CSV
  • Export customer data to CSV

Key API Endpoints

Vendor (Admin Panel) APIs

GET/api/vendors/customers/:storeAuth Required

Get paginated list of all customers for a store

GET/api/vendors/customers_fetch/:storeAuth Required

Fetch customers with advanced filtering and sorting

GET/api/customers/edit

Get a single customer's full profile for editing

POST/api/editcontactinformationAuth Required

Update customer contact details (name, email, phone)

POST/api/fetchCustomersByIdAuth Required

Fetch multiple customers by their IDs

GET/api/customerAddressesAuth Required

Get all addresses for a specific customer

POST/api/manageCustomerAddressAuth Required

Add a new address to a customer's address book

PUT/api/updateAddressAuth Required

Update an existing customer address

DELETE/api/deleteCustomerAddressAuth Required

Remove an address from a customer's profile

POST/api/vendors/customer/logAuth Required

Log a note or activity entry on a customer's timeline

POST/api/update-cod-statusAuth Required

Enable or disable COD for a specific customer

POST/api/vendors/blacklist-customerAuth Required

Blacklist or un-blacklist a customer

DELETE/api/vendors/customer/delete/:id

Delete a single customer

DELETE/api/vendors/customers/delete

Bulk delete multiple customers

POST/api/export-customers

Export customer data as CSV

POST/api/bulkupdatecolumnsAuth Required

Bulk update customer fields (tags, notes, COD status)

POST/api/bulkinsertcustomersAuth Required

Bulk import customers from CSV data

Storefront (Customer-Facing) APIs

POST/api/vendor/customer/add

Register a new customer with email and OTP verification

POST/api/verify-otp-and-update

Verify OTP during registration to activate account

POST/api/vendor/customer/login

Customer login with email and password

POST/api/forgot-password-get-otp

Request password reset OTP

POST/api/forgot-password-verify-otp

Verify password reset OTP and set new password

POST/api/validateUser

Validate customer session token

GET/api/GetUserDetailById

Get logged-in customer's profile details

PUT/api/UpdateCustomerDetail

Update customer's own profile information

GET/api/getAddressPublic/:id

Get customer's addresses for checkout

POST/api/addNewAddress

Add a new shipping address from the storefront

POST/api/updateCustomerAddress

Update an existing address from the storefront

DELETE/api/removeAddress

Remove an address from the storefront account page

PUT/api/changeDefaultAddress

Set a default shipping address

Database Tables

TablePurpose
customersCustomer profiles — name, email, phone, password hash, tags, notes, COD status, blacklist flag
customer_addressesMultiple shipping/billing addresses per customer
ordersCustomer’s order history (linked via customer email or ID)
abandon_checkoutsAbandoned carts linked to customer sessions
  • Orders — Customer order history and management
  • Storefront — Customer-facing registration and account pages
  • Marketing — Email campaigns targeting customer segments
  • Discounts — Customer-specific discount codes