Skip to content

Customer Management

Overview

Customer Management allows you to view, manage, and communicate with customers who have created accounts or placed orders.

Key Purpose: Track customer information, order history, and loyalty status.

Purpose

This page lets you view, create, edit, and manage customer profiles including their contact details, addresses, order history, loyalty points, gift cards, and marketing preferences.

Key Concepts

  • Customer vs. Customer-Vendor: The system uses a two-level structure -- a global Customer record (email, phone, name) and a per-vendor CustomerVendor record that tracks vendor-specific data like loyalty points, visits, total spent, and marketing preferences.
  • Inherited Fields: When a global customer profile is updated, the system propagates changes to all associated customer-vendor records, but only for fields that the vendor-level record has inherited (not locally overridden).
  • Timeline: Every customer order creates a timeline entry recording the order number, platform, and receipt number, providing a chronological activity log visible in the backoffice.
  • Contact Uniqueness: Email and phone must be unique per vendor; the system validates against existing customer-vendor records before creating or updating, returning an error if a duplicate is found.
  • Sign-Up Bonus Trigger: When a new customer-vendor relationship is created (no prior record for that customer at the vendor), the system automatically triggers the loyalty sign-up bonus if the loyalty program is configured.

Actions

Create a Customer

Add a new customer by providing email and/or phone; the system checks uniqueness, creates or retrieves the global customer record, creates the vendor-specific record, and retroactively links any existing guest transactions.

Edit Customer Profile

Update customer name, email, phone, notes, or marketing preferences; the system validates contact uniqueness and propagates inherited field changes to the global customer record.

Manage Addresses

Add, edit, or delete customer delivery addresses; new addresses create both a global customer address and a vendor-specific address record, and the first address is automatically set as default.

View Customer Data

Access order history (with pagination), gift card history, reward redemptions, and timeline entries for a specific customer via dedicated datatable endpoints.

Export Customers

Export customer data to a spreadsheet including name, email, phone, creation date, points, visits, and total spent, processed in chunks of 500 records.

Location

  • Backoffice Route: /marketing/customers
  • Backend Controller: app/Http/Controllers/Api/CustomerController.php
  • Vue Component: src/views/marketing/customers/index.vue

Fields

Customer Name

PropertyValue
Field IDname
LabelName
TypeText
RequiredNo

Description: Customer's full name.


Email

PropertyValue
Field IDemail
LabelEmail
TypeEmail
RequiredYes
ValidationValid email, unique

Description: Customer's email address. Used for login and communications.

Business Logic:

  • Primary identifier for customer accounts
  • Used for order confirmations
  • Marketing communications (if opted in)

Phone

PropertyValue
Field IDphone
LabelPhone Number
TypePhone
RequiredNo

Description: Customer's phone number.

Use Cases:

  • Order notifications (SMS)
  • Delivery contact
  • Customer service

Birthday

PropertyValue
Field IDbirthday
LabelBirthday
TypeDate
RequiredNo

Description: Customer's birthday for loyalty bonuses.

Business Logic:

  • Used for birthday bonus points
  • Birthday promotions
  • Age verification (if needed)

Addresses

PropertyValue
Field IDaddresses
LabelSaved Addresses
TypeArray
RequiredNo

Description: Customer's saved delivery addresses.

Structure:

json
{
  "label": "Home",
  "address_line_1": "123 Main St",
  "address_line_2": "Apt 4",
  "city": "Amsterdam",
  "postal_code": "1012 AB",
  "country": "NL",
  "is_default": true
}

Loyalty Points

PropertyValue
Field IDloyalty_points
LabelPoints Balance
TypeNumber
RequiredNo
Default0

Description: Current loyalty points balance.

Business Logic:

  • Earned from orders
  • Redeemed for discounts
  • May expire based on settings

Total Orders

PropertyValue
Field IDtotal_orders
LabelTotal Orders
TypeNumber (calculated)

Description: Total number of orders placed by customer.


Total Spent

PropertyValue
Field IDtotal_spent
LabelTotal Spent
TypeCurrency (calculated)

Description: Total amount spent by customer.


First Order Date

PropertyValue
Field IDfirst_order_date
LabelCustomer Since
TypeDate (calculated)

Description: Date of customer's first order.


Last Order Date

PropertyValue
Field IDlast_order_date
LabelLast Order
TypeDate (calculated)

Description: Date of customer's most recent order.


Marketing Opt-In

PropertyValue
Field IDmarketing_opt_in
LabelMarketing Consent
TypeToggle
Defaultfalse

Description: Whether customer has opted in to marketing communications.

Business Logic:

  • Must be true to send promotional emails
  • GDPR compliance requirement
  • Can be changed by customer

Account Status

PropertyValue
Field IDstatus
LabelStatus
TypeSelect
Optionsactive, inactive, blocked
Defaultactive

Description: Customer account status.

Statuses:

  • Active: Normal account
  • Inactive: Dormant account
  • Blocked: Cannot place orders

Notes

PropertyValue
Field IDnotes
LabelInternal Notes
TypeTextarea
RequiredNo

Description: Internal notes about the customer (not visible to customer).

Use Cases:

  • Special preferences
  • Allergy information
  • Service notes

Customer Actions

View Order History

See all orders placed by customer.

Adjust Loyalty Points

Manually add or remove loyalty points.

Send Message

Send email to customer (if marketing opted in).

Block Customer

Prevent customer from placing orders.

Export Data

Export customer data (GDPR compliance).

Delete Account

Remove customer account and data (GDPR right to be forgotten).


Business Logic

Customer Creation

Customer places first order

        ├── Guest checkout → No account created

        └── Account checkout → Account created


        Store customer data:
        - Email (required)
        - Name
        - Phone
        - Address

Order Attribution

Order placed


Customer logged in?
├── Yes → Link order to customer account
│         Update totals
│         Award loyalty points

└── No (guest) → Order not linked to account
                 No loyalty points

Customer Segments

Customers can be segmented by:

  • Order frequency
  • Total spent
  • Last order date
  • Location
  • Loyalty tier

Customer Impact

Online Ordering

  • Saved addresses for quick checkout
  • Order history visible
  • Loyalty points displayed
  • Reorder previous orders

Account Features

  • View order history
  • Manage addresses
  • Update profile
  • View loyalty balance
  • Redeem points

Relations

Depends On

  • Loyalty Program: For points tracking

Affects

  • Transactions: Orders linked to customers
  • Loyalty: Points earned/redeemed
  • Marketing: Communication targeting

Business Rules

  • Email and phone must be unique per vendor; creating or updating a customer with a duplicate email or phone within the same vendor returns a "Phone or email is already used" error.
  • Deleting a customer address also removes all associated vendor-specific address records (CustomerVendorAddress) linked to that address.
  • Guest checkout orders (unauthenticated) are accessible only by providing the correct order number via header or query parameter; authenticated users can only view their own orders.
  • The order history endpoint limits unauthenticated queries to a maximum of 10 order numbers at a time, and each order number must match the format of exactly 10 uppercase alphanumeric characters.
  • When a customer's global language is already set, subsequent updates cannot overwrite it; the language field is skipped during profile updates if it already has a value.

FAQs

  • "What happens when a customer is created from the backoffice?" The system validates email/phone uniqueness, retrieves or creates a global customer record, creates the vendor-specific record, and then searches for any existing guest transactions matching the contact info to retroactively link them.
  • "Can a customer belong to multiple vendors?" Yes, the global Customer record is shared, and a separate CustomerVendor record is created per vendor, each tracking vendor-specific data like points, visits, and marketing consent.
  • "How does the marketing opt-in work?" Marketing email and SMS preferences are stored per customer-vendor record; they are only updated for the vendor associated with the current location, not propagated to other vendors.
  • "What is the timeline used for?" The timeline records order events (order number, platform, receipt number) per customer, providing merchants with a chronological activity log in the backoffice customer detail view.
  • "How does the address default work?" The first address added for a customer is automatically set as the default; subsequent addresses are only set as default if explicitly flagged with is_default: true.

Troubleshooting

Problem: Customer can't log in

Causes:

  1. Wrong email/password
  2. Account blocked
  3. Account not verified

Solutions:

  1. Reset password
  2. Unblock account
  3. Resend verification email

Problem: Loyalty points not showing

Causes:

  1. Customer not logged in during order
  2. Loyalty program disabled
  3. Points expired

Solutions:

  1. Ensure customer logs in
  2. Enable loyalty program
  3. Check expiry settings

Problem: Customer wants data deleted

Causes:

  • GDPR right to be forgotten request

Solutions:

  1. Verify customer identity
  2. Use "Delete Account" function
  3. Confirm deletion with customer

Examples

Customer Profile

json
{
  "name": "Jan de Vries",
  "email": "jan@example.com",
  "phone": "+31612345678",
  "birthday": "1985-03-15",
  "addresses": [
    {
      "label": "Home",
      "address_line_1": "Kalverstraat 123",
      "city": "Amsterdam",
      "postal_code": "1012 AB",
      "country": "NL",
      "is_default": true
    },
    {
      "label": "Work",
      "address_line_1": "Zuidas 456",
      "city": "Amsterdam",
      "postal_code": "1082 MD",
      "country": "NL",
      "is_default": false
    }
  ],
  "loyalty_points": 450,
  "total_orders": 23,
  "total_spent": 567.50,
  "first_order_date": "2023-06-15",
  "last_order_date": "2024-01-10",
  "marketing_opt_in": true,
  "status": "active"
}

Customer Statistics

json
{
  "customer_stats": {
    "total_customers": 1250,
    "active_last_30_days": 340,
    "new_this_month": 45,
    "average_order_value": 24.50,
    "repeat_customer_rate": 0.42,
    "loyalty_members": 890
  }
}