Ga naar hoofdinhoud

Customers

Manage customer records - create, search, update, and tag with client-types.

MethodPathPurpose
POST/peppered/customerCreate a new customer
POST/peppered/customer/findByEmailSearch by email
GET/peppered/customer/{customerId}Get a specific customer
PUT/peppered/customer/{customerId}Update customer details
GET/peppered/customer/{customerId}/clienttypesList a customer's tags
POST/peppered/customer/{customerId}/clienttypesSet a customer's tags

All paths start with /v1/:client_name/peppered/... - the full prefix is omitted in the table for brevity.


Create customer​

POST /v1/:client_name/peppered/customer

Request body​

FieldTypeRequiredDescription
emailstring✓Valid email, must be unique within the client
customerFirstNamestring✓First name (max 255)
customerLastNamestring✓Last name (max 255)
customerSalutationstring-Single character (e.g. M, F)
customerPrepositionstring-Dutch tussenvoegsel (max 255)
customerAddressstring-Address line (max 255)
customerHouseNrstring-House number (max 20)
customerZipstring-Postcode (max 10)
customerCitystring-City (max 255)
customerCountrystring-Country (max 255)
customerPhonestring-Must be numeric
customerCreditstring-Decimal with up to 2 decimals (e.g. 25.50)

Response​

201 Created - returns the created customer in User format.

422 Unprocessable Entity - validation errors (e.g. duplicate email).


Find customer by email​

POST /v1/:client_name/peppered/customer/findByEmail

Request body​

FieldTypeRequired
emailstring✓

Response​

200 OK - the matching customer, or 404 if none.


Get customer​

GET /v1/:client_name/peppered/customer/{customerId}

Returns a single customer.

Response​

200 OK - User.


Update customer​

PUT /v1/:client_name/peppered/customer/{customerId}

Same request body as Create customer, but all fields are optional (send only what you want to change).

Response​

200 OK - the updated customer.


Get customer client-types​

GET /v1/:client_name/peppered/customer/{customerId}/clienttypes

Returns the tags currently assigned to this customer.

Response​

200 OK

["friend", "donor", "vip"]

Use the Export client types endpoint to retrieve the full list of available tags for this client.


Set customer client-types​

POST /v1/:client_name/peppered/customer/{customerId}/clienttypes

Overwrites the customer's tags.

Request body​

{
"clienttypes": ["friend", "donor"]
}

Sending an empty array removes all tags.

Response​

200 OK - the updated tag list.


User fields​

The response body for customer endpoints:

FieldTypeDescription
customerIdintegerUnique customer ID
customerExternalIdstring | nullExternal reference (e.g. CRM ID)
emailstringEmail address
customerSalutationstringSalutation
customerFirstNamestringFirst name
customerLastNamestringLast name
customerPrepositionstringDutch tussenvoegsel
customerAddressstringStreet + house number
customerHouseNrstringHouse number separately
customerZipstringPostcode
customerCitystringCity
customerCountrystringCountry
customerPhonestringPhone
customerCreditstring (decimal)Current credit balance
customerCustom1..customerCustom7string | nullCustom fields, mapped from user_custom1..user_custom7. Configuratie per veld gebeurt in Dashboard → Instellingen → Webshop → Custom velden.
customerPrefsobject | nullOpt-in preferences as a key-value object - see Opt-in preferences
lastChangedISO datetimeLast modification timestamp
customerTagsstring | nullClient-types assigned, comma-separated (e.g. friend,donor); null when none

Opt-in preferences (customerPrefs)​

customerPrefs exposes the customer's opt-in preferences (the internal user_prefs field) as a flat key-value object. It is included in every customer response and in the customer export.

"customerPrefs": {
"user_prefs_optin": "1",
"user_prefs_mailinglist": "0",
"user_prefs_extra_optin": "0"
}
KeyMeaning
user_prefs_optinConsent to be emailed by the organisation. When "0", template and ad-hoc mailings to this customer are skipped.
user_prefs_mailinglistNewsletter / mailing-list opt-in (the "mailinglist" preference in the Dashboard visitor record).
user_prefs_extra_optinThe optional extra opt-in checkbox on the webshop order form (only shown when the organisation has enabled it).

Notes:

  • Values are normally the strings "1" (yes) and "0" (no). Older records may still hold an integer or boolean for the same key, so compare loosely (== 1).
  • Keys are only present if they were ever stored for that customer - older records may lack user_prefs_extra_optin. Treat a missing key as "0".
  • customerPrefs is null when the customer has no stored preferences.
  • Any additional preference keys added in the future appear in the same object; they are passed through as-is.
  • The field is read-only via this API: POST/PUT /peppered/customer do not accept customerPrefs.

See also: Orders · Exports