Customer types
The types the customer domain defines, with the fields other domains add to them.
Objects
BusinessUnitSwitchResponse
B2B only
| Field | Type | Description |
|---|---|---|
successB2B | Boolean! | Indicates if setting active business context was successful |
businessUnitErrorsB2B | [BusinessUnitSwitchError!] | Error details if setting active business context failed |
Customer
Fields added by Invoice, Order, Return and Shopping lists
Customer account information with personal details and business context
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier for the customer |
createdAt | DateTime! | Date and time when the customer account was created |
company | String | Company name for business customers |
vatNumber | String | VAT identification number for business customers |
customerNumber | String | Customer number assigned by the back office |
salutation | SalutationType | Optional salutation for the customer |
givenName | String | First name of the customer |
familyName | String | Last name of the customer |
phone | String | The customer's phone number as they typed it: free text, not checked against any numbering plan. Null where none is recorded. |
addresses | AddressResult! | The customer's address book. A search term narrows it by name, company,
street, postal code, city or region; every word must appear, in any
order.
Paged and searchable like a company's book, because a private shopper
can keep as many addresses as a small company -- a facilities manager
buying for forty sites is one person -- and the same picker reads both.Arguments: page, pageSize, searchTerm |
billingAddress | Address | Primary billing address for the customer |
defaultShippingAddress | Address | Primary shipping address for the customer |
notificationPreferences | NotificationPreferences | Marketing and notification opt-in preferences |
businessUnitB2B | BusinessUnit | Get a specific business unit by ID that the customer has access toArguments: id |
businessUnitsB2B | [BusinessUnit!] | List of all business units the customer has access to |
invoice | Invoice | One invoice billed to this person, by id.
The signed-in caller's own, whichever customer this field was reached
through: a Customer is addressable by email, and answering with somebody
else's invoice because their address was asked for is not a question this
should be able to answer.Arguments: id |
invoices | InvoiceResult! | Invoices billed to this person rather than to a company, newest firstArguments: page, pageSize, searchTerm, status, invoiceDateFrom, invoiceDateUntil |
order | Order | One order, by the number a buyer quotes or by its id. Give exactly one --
giving both, or neither, is an error rather than a silent preference.
The id is what a payment provider hands back on its return URL, so it is the
key a buyer arrives with after paying. The order number is the one they read
off a confirmation.Arguments: orderNumber, id |
orders | OrderResult | This customer's orders, newest first. Cancelled ones are left out unless
asked for by name: a cancelled order is not something that was bought, and
reopening an unpaid order for editing cancels it, so the list would
otherwise fill with twins.
A search term matches the order number, the purchase-order reference, or
the SKU of a line item. All three are matched in full rather than as a
prefix: they are codes read off a confirmation, a purchase order or a
packing slip and pasted in, not phrases to type part of.
Product names are deliberately not searched. Free text over what an order
contains needs a separate search index, and an order history that quietly
stops finding anything the day that index is rebuilt is worse than one
that never claimed to.Arguments: page, pageSize, searchTerm, status, createdFrom, createdUntil |
returns | ReturnResult! | The signed-in customer's returns, newest firstArguments: page, pageSize, status |
return | Return | One of the signed-in customer's returns; null when it is not theirsArguments: id |
email | String! | |
shoppingList | ShoppingList | Get a specific shopping list by ID for the customerArguments: id |
shoppingLists | ShoppingListResult | Get paginated shopping lists for the customerArguments: page, pageSize |
CustomerAddressCreateResponse
| Field | Type | Description |
|---|---|---|
customer | Customer | Updated customer account information with new address |
customerErrors | [CustomerAddressCreateError!] | Error details if address creation failed |
CustomerAddressDeleteResponse
| Field | Type | Description |
|---|---|---|
customer | Customer | Updated customer account information after address deletion |
customerErrors | [CustomerAddressDeleteError!] | Error details if address deletion failed |
CustomerAddressUpdateResponse
| Field | Type | Description |
|---|---|---|
customer | Customer | Updated customer account information with modified address |
customerErrors | [CustomerAddressUpdateError!] | Error details if address update failed |
CustomerCreateResponse
| Field | Type | Description |
|---|---|---|
customer | Customer | Created customer account information |
customerErrors | [CustomerCreateError!] | Error details if account creation failed |
CustomerDefaultAddressUpdateResponse
| Field | Type | Description |
|---|---|---|
customer | Customer | Updated customer account information |
customerErrors | [CustomerDefaultAddressUpdateError!] | Error details if update failed |
CustomerDeleteResponse
| Field | Type | Description |
|---|---|---|
success | Boolean! | Indicates if the deletion was successful |
customerErrors | [CustomerDeleteError!] | Error details if deletion failed |
CustomerEmailUpdateResponse
| Field | Type | Description |
|---|---|---|
customer | Customer | Updated customer account information |
customerErrors | [CustomerEmailUpdateError!] | Error details if email update failed |
CustomerExistsResult
Result type for checking if a customer exists
| Field | Type | Description |
|---|---|---|
result | Boolean! | Whether a customer with the given email exists |
CustomerInformationUpdateResponse
| Field | Type | Description |
|---|---|---|
customer | Customer | Updated customer account information |
customerErrors | [CustomerInformationUpdateError!] | Error details if update failed |
CustomerNotificationPreferencesUpdateResponse
| Field | Type | Description |
|---|---|---|
customer | Customer | Updated customer account information |
customerErrors | [CustomerNotificationPreferencesUpdateError!] | Error details if update failed |
CustomerPersonalDetailsUpdateResponse
| Field | Type | Description |
|---|---|---|
customer | Customer | Updated customer account information |
customerErrors | [CustomerPersonalDetailsUpdateError!] | Error details if update failed |
NotificationPreferences
Marketing and notification opt-in preferences for a customer
| Field | Type | Description |
|---|---|---|
newsletter | Boolean! | Whether the customer opted in to the marketing newsletter |
Input objects
CustomerCreateInput
Input data required to create a new customer account
| Field | Type | Description |
|---|---|---|
email | EmailAddress! | Email address for the customer account |
password | String! | Password for the customer account |
salutation | SalutationType | Optional salutation for the customer |
givenName | String | Given name of the customer |
familyName | String | Family name of the customer |
CustomerPersonalDetailsInput
Personal details that can be updated independently of any address
| Field | Type | Description |
|---|---|---|
salutation | SalutationType | Optional salutation for the customer |
givenName | String! | First name of the customer |
familyName | String! | Last name of the customer |
phone | String | The customer's phone number, as free text. Left out, the number stays as it is; an empty string removes it. |
NotificationPreferencesInput
Notification preference values to update; omitted fields are left unchanged
| Field | Type | Description |
|---|---|---|
newsletter | Boolean | Opt in or out of the marketing newsletter |
Unions
BusinessUnitSwitchError
B2B only
One of ValidationError.
CustomerAddressCreateError
One of ValidationError.
CustomerAddressDeleteError
One of ValidationError.
CustomerAddressUpdateError
One of ValidationError.
CustomerCreateError
One of ValidationError.
CustomerDefaultAddressUpdateError
One of ValidationError.
CustomerDeleteError
One of ValidationError.
CustomerEmailUpdateError
One of ValidationError.
CustomerInformationUpdateError
One of ValidationError.
CustomerNotificationPreferencesUpdateError
One of ValidationError.
CustomerPersonalDetailsUpdateError
One of ValidationError.

