Skip to content
You are reading the unreleased documentation. No version is released yet, and these pages describe code that is not in a release.

Customers (admin API)

Admin routes of the customers module. Every route needs a staff session and the permission named on it; send X-Resolve-Locale: false to receive every locale of a translatable field for editing.

List all customers

Parameters:

  • page in query (number, min 1, optional).
  • pageSize in query (number, min 1, max 100, optional).
  • search in query (string, max length 100, optional).
  • segment in query ("NEW", "ACTIVE", "LOYAL", "AT_RISK", "CHURNED", "HIGH_VALUE", "VIP", optional).

Responses:

  • 200: Customers retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Get customer by ID

Parameters:

  • id in path (string, required).

Responses:

  • 200: Customer retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Customer not found.

Update customer

Parameters:

  • id in path (string, required).

Request body: UpdateCustomerAdminDto.

Responses:

  • 200: Customer updated.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Customer not found.

List customer segments with counts

Responses:

  • 200: Segments retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • firstName (string, max length 100, optional).
  • lastName (string, max length 100, optional).
  • email (string, max length 254, optional).
  • phone (string, max length 30, optional).
  • isActive (boolean, optional).