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
emailstringValid email, must be unique within the client
customerFirstNamestringFirst name (max 255)
customerLastNamestringLast name (max 255)
customerSalutationstringSingle character (e.g. M, F)
customerPrepositionstringDutch tussenvoegsel (max 255)
customerAddressstringAddress line (max 255)
customerHouseNrstringHouse number (max 20)
customerZipstringPostcode (max 10)
customerCitystringCity (max 255)
customerCountrystringCountry (max 255)
customerPhonestringMust be numeric
customerCreditstringDecimal with up to 2 decimals (e.g. 25.50)

Response

201 Created — returns the created customer in UserResource 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 OKUserResource.


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.


UserResource 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
lastChangedISO datetimeLast modification timestamp
customerTagsarray of stringsClient-types assigned

See also: Orders · Exports