Customer management

Link customers to licenses and find the records you need to resolve support requests.

Admin Features

Customer Management

The Customers page (Admin → Customers) lets you create a CRM-lite record for each of your end-customers and link any number of license keys to them. This gives you a single view of how many licenses a customer holds and how many are currently active — without searching by email across the licenses table.

Customer record fields

FieldRequiredNotes
NameYesContact name (e.g. Alice Johnson)
EmailYesUnique per tenant — used to identify the customer
CompanyNoOrganisation name shown next to the customer's name
NotesNoInternal free-text notes

Linking licenses to customers

There are three ways to link a license to a customer:

  1. Manual — Customer dropdown: When creating or editing a license, pick a customer from the Customer dropdown in the form.
  2. Automatic on create/update — email matching: If a license has a Customer Email set and no explicit customer selected, PermitCore automatically finds or creates the matching Customer record and links it — on every POST /api/licenses, POST /api/licenses/bulk, and PUT /api/licenses/{id}. Name is derived from the email local part (e.g. [email protected]John Doe). You can fill in the company and notes later via Edit Customer.
  3. Bulk backfill — Sync from Licenses: Click the Sync from Licenses button on the Customers page to scan all existing licenses that have a CustomerEmail set but no linked customer. Missing Customer records are created and linked in one operation. A toast confirms how many were created vs. how many were just linked (email matched an existing record).

Deleting a customer record does not delete its licenses — they are simply unlinked (CustomerId → null).

Viewing a customer's licenses

Click the Licenses button on any customer row to jump to the Licenses page pre-filtered to that customer. A blue banner at the top shows "Showing licenses for [Name]" with a clear-filter link. All license statuses (active, revoked, expired) are shown — not just active — so you have a complete picture of that customer's history. From there you can edit, revoke, transfer, or create new licenses as normal.

API

# List customers (paginated, searchable)
GET /api/customers?page=1&pageSize=50&search=alice
Authorization: Bearer {token}

# Get a single customer
GET /api/customers/{id}

# Get licenses for a customer
GET /api/customers/{id}/licenses

# Create
POST /api/customers
{ "name": "Alice Johnson", "email": "[email protected]", "company": "ACME Corp" }

# Update
PUT /api/customers/{id}
{ "name": "Alice Johnson", "email": "[email protected]", "company": "ACME Corp", "isActive": true }

# Delete (unlinks licenses, does NOT delete them)
DELETE /api/customers/{id}

# Backfill — auto-create customers from license emails
POST /api/customers/backfill
# Returns: { "created": 8, "linked": 3, "total": 11 }