Skip to content

Customer

First-Pass Node Dossier

This page is an evidence-backed node dossier generated from the domain hierarchy and node questionnaire.

What It Is

Customer is the primary account record in Pyle. It stores the business account identity that ties together users, addresses, tax settings, pricing eligibility, order history, and storefront account behavior.

Parent hierarchy:

  • Customer Management
  • Customer Accounts And Relationships
  • Customer

Primary implementation paths:

  • packages/framework/src/Models/Customer.php
  • packages/framework/src/Actions/Customer
  • packages/framework/src/Http/Controllers/Api/Admin/CustomersController.php
  • packages/framework/src/Http/Controllers/Api/Storefront/CustomersController.php
  • packages/framework/src/Http/Controllers/Api/Admin/CustomerAddressesController.php
  • packages/framework/src/Http/Controllers/Api/Storefront/CustomerAddressesController.php
  • packages/admin/src/Livewire/Admin/Customers
  • packages/admin/src/Livewire/Admin/Customer

What Users Can Do With It

Direct capabilities

Admin users can:

  • create a customer from the customers list
  • edit the packaged customer-page fields that are directly exposed there
  • attach default shipping and billing addresses
  • create customer-linked users and manage the team from the customer page
  • export customer data through Excel
  • attempt a price-list download through the related pricing flow, which is intentionally host-app specific in the base package

Storefront users can:

  • update their own profile fields
  • manage their own shipping addresses
  • manage team members when the account has user-manager access
  • manage shared customer lists from the storefront account area

Indirect capabilities

Other workflows use the customer record without treating it as a simple profile page:

  • order creation and order filtering can be customer-scoped
  • customer groups drive pricing and promotion eligibility
  • customer restrictions affect storefront visibility and team permissions
  • ERP sync can create or update customer records

Where It Is Managed

ChannelRoleNotes
Admin customers listDirectSearch, create, and open customer records
Admin customer pageDirectMain packaged surface for header details, user links, addresses, activity logs, and related actions
Admin APIDirectCRUD plus activity-log and related customer data access
Storefront profile pageDirectUsers can edit their own account details
Storefront team pageDirectUser-manager accounts can view and manage customer users
Storefront addresses pageDirectCustomers manage their own addresses
Storefront list pageDirectCustomer lists and shared lists are managed from the account area
Excel exportDirectCustomers export includes customers and users sheets
ERP bridgeDirectCustomer is ERP-syncable
Related payment APIRelatedCustomer card setup is handled through a related payment flow, not a confirmed packaged customer-page control

Sources:

  • packages/admin/routes/web.php
  • packages/admin/src/Livewire/Admin/Customers/Page.php
  • packages/admin/src/Livewire/Admin/Customer/Page.php
  • packages/framework/src/Http/Controllers/Api/Admin/CustomersController.php
  • packages/framework/src/Http/Controllers/Api/Storefront/CustomersController.php
  • packages/storefront/routes/web.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Profile/Page.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Team/Page.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Addresses/Page.php
  • packages/framework/src/Actions/Exports/Customers/CustomersExportTemplate.php
  • packages/framework/src/Services/ErpBridge/Customer/CustomerErpSyncService.php

Channel-Level Field Coverage

Admin create flow

The packaged create dialog supports:

  • first name
  • last name
  • phone
  • email
  • external ID
  • note

The underlying create action also supports:

  • customer groups
  • owned by user
  • account-managed by user
  • default shipping and billing address IDs
  • tax exemption and shipping exemption
  • locale and currency

Sources:

  • packages/admin/src/Livewire/Admin/Customers/CreateDialog.php
  • packages/framework/src/Actions/Customer/CreateCustomer.php

The packaged customer page directly exposes:

  • header details such as email, external ID, and join code
  • the edit dialog fields email and shipping_exempt
  • default shipping and billing address selection
  • linked users through the users table and create-user dialog
  • activity-log and debug actions

Sources:

  • packages/admin/resources/views/components/customer/header.blade.php
  • packages/admin/resources/views/components/customer/actions-bar.blade.php
  • packages/admin/resources/views/components/customer/page-content.blade.php
  • packages/admin/src/Livewire/Admin/Customer/EditDialog.php
  • packages/admin/src/Livewire/Admin/Customer/EditAddressDialog.php
  • packages/admin/src/Livewire/Admin/Customer/CreateUserDialog.php

Admin API show and index

The admin API includes or returns customer fields such as:

  • email
  • first name
  • last name
  • name
  • company
  • phone
  • currency
  • type
  • balance
  • tax exemption
  • accepts marketing
  • order count and order value
  • default shipping and billing addresses
  • owned-by and account-managed user links
  • user links
  • groups
  • custom tax rates

Sources:

  • packages/framework/src/Http/Controllers/Api/Admin/CustomersController.php
  • packages/framework/src/Actions/Customer/Requests/Admin/IndexRequest.php
  • packages/framework/src/Http/Resources/Admin/CustomerResource.php

Storefront self-service profile

The storefront profile page lets a signed-in customer update:

  • first name
  • last name
  • email
  • phone
  • company
  • locale
  • default shipping address
  • marketing opt-in

Source:

  • packages/framework/src/Http/Controllers/Api/Storefront/CustomersController.php

Configuration And Data Model

Key model characteristics:

  • soft-deletable
  • ERP-syncable
  • searchable
  • activity-log aware
  • supports delivery schedules and custom attributes

Important field groups:

Field GroupPurpose
identityfirst_name, last_name, name, email, company, phone
account statetype, currency, balance, tax_exempt, shipping_exempt, accepts_marketing, disabled, blacklisted
order historyorder_count, order_value, first and last order timestamps
ownershipowned_by_user_id, account_managed_by_user_id, users
addressesdefault shipping and billing address IDs, customer addresses relation
segmentationgroups, productCategories, productRestrictions

Important behavior:

  • join_code is generated on create and used for invitation-based account registration
  • customer_groups passed into create or update are synchronized into the pivot relation
  • the isVisibleForUser scope hides customers when the current user has customer restrictions

Sources:

  • packages/framework/src/Models/Customer.php
  • packages/framework/src/Actions/Customer/CreateCustomer.php
  • packages/framework/src/Actions/Customer/UpdateCustomer.php
  • packages/framework/src/Actions/Customer/CustomerGroups/SyncCustomerGroups.php
  • packages/framework/src/Actions/Customer/DownloadExcelPricelist.php

Relationships

Customer directly relates to:

  • users
  • groups
  • defaultAddress
  • defaultBillingAddress
  • addresses
  • orders
  • invoices
  • cards
  • paymentGateways
  • customTaxRates
  • wishlists
  • lists
  • productOffers
  • productRestrictions
  • assignedUsers

Source:

  • packages/framework/src/Models/Customer.php

Rules And Downstream Effects

Important rules and effects:

  • customer creation sends an account-registration email that includes the invitation code
  • customer groups influence downstream pricing and promotion logic
  • users assigned to a customer can be filtered or restricted through the user and team flows
  • storefront accounts can only update their own customer record
  • the base customer model throws for buildPriceList() and downloadPriceList(), so the real price-list behavior belongs to the host app or related export flow
  • customer lists and team members are owned by the customer account, not by the storefront session alone
  • customer cards are related to payment flows, but the core customer record is not the payment-method record itself

Sources:

  • packages/framework/src/Actions/Customer/Http/Api/Admin/CreateCustomerRequest.php
  • packages/framework/src/Mail/ForCustomer/AccountRegistrationEmail.php
  • packages/framework/src/Actions/Customer/CalculateCustomer.php
  • packages/framework/src/Models/User.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Team/Page.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Team/Table/Row.php
  • packages/framework/src/Actions/Stripe/CreateStripeCustomerCardSession.php

Integrations And Automation

Excel

Customer exports include:

  • customers
  • users

Source:

  • packages/framework/src/Actions/Exports/Customers/CustomersExportTemplate.php

ERP bridge

Customer records sync from ERP and can also be registered from ERP hooks.

Sources:

  • packages/framework/src/Services/ErpBridge/Customer/CustomerErpSyncService.php
  • packages/framework/src/Actions/ErpBridge/Customer/RegisterCustomer.php

The customer can open a card-session flow for saved payment cards, but the cards themselves belong to a related billing concern.

Sources:

  • packages/framework/src/Models/Customer.php
  • packages/framework/src/Actions/Stripe/CreateStripeCustomerCardSession.php

Where It Appears To End Users

Customer is first-class for operators and account managers, and indirect for shoppers.

It appears through:

  • the admin customers list and customer detail page
  • the storefront profile page
  • the storefront team page
  • the storefront addresses page
  • the storefront customer-list and permissions areas

Sources:

  • packages/admin/src/Livewire/Admin/Customers/Page.php
  • packages/admin/src/Livewire/Admin/Customer/Page.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Profile/Page.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Team/Page.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Addresses/Page.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Lists/Page.php
  • packages/storefront/src/Livewire/Storefront/MyAccount/Permissions/Page.php

Current Documentation Takeaways

  • Customer is the account root. Most account workflows hang off this record.
  • The packaged product splits customer ownership across the admin customer page, storefront self-service pages, and related API actions.
  • Addresses are part of customer management, but the packaged address surface is implemented through the generic Address model and CustomerAddressResource, not through a standalone customer-address authoring model.
  • Customer groups and assigned users are the main coordination points for segmentation and team access.

Open Questions

  • The repository still contains a separate CustomerAddress model, but the packaged admin and storefront flows are centered on Address. That duplication should stay folded unless a later pass proves the legacy model is still first-class.
  • The exact scope of CustomerList versus Wishlist is wider than this page and deserves its own follow-up node pass.