Interface Customer
- All Superinterfaces:
BaseResource
,CustomerMixin
,Customizable<Customer>
,DomainResource<Customer>
,Identifiable<Customer>
,Referencable<Customer>
,ResourceIdentifiable<Customer>
,Versioned<Customer>
,WithKey
If stores
is not empty, the Customer is specific to those Stores.
Example to create an instance using the builder pattern
Customer customer = Customer.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.email("{email}")
.plusAddresses(addressesBuilder -> addressesBuilder)
.isEmailVerified(true)
.plusStores(storesBuilder -> storesBuilder)
.authenticationMode(AuthenticationMode.PASSWORD)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CustomerBuilder
builder()
builder factory method for Customerstatic CustomerBuilder
create builder for Customer instancestatic Customer
factory method to create a deep copy of CustomerAddresses used by the Customer.@NotNull AuthenticationMode
Indicates whether thepassword
is required for the Customer.IDs of addresses inaddresses
used as billing addresses.Company name of the Customer.@NotNull ZonedDateTime
Date and time (UTC) the Customer was initially created.@Valid CreatedBy
IDs and references that created the Customer.@Valid CustomFields
Custom Fields for the Customer.@Valid CustomerGroupReference
CustomerGroup to which the Customer belongs.User-defined unique identifier of the Customer.Date of birth of the Customer.ID of the address inaddresses
used as the default billing address.ID of the address inaddresses
used as the default shipping address.@NotNull String
getEmail()
Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to.Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).Given name (first name) of the Customer.@NotNull String
getId()
Unique identifier of the Customer.@NotNull Boolean
Indicates whether the email address of the Customer is verified.getKey()
User-defined unique identifier of the Customer.@NotNull ZonedDateTime
Date and time (UTC) the Customer was last updated.@Valid LastModifiedBy
IDs and references that last modified the Customer.Family name (last name) of the Customer.Preferred language of the Customer.Middle name of the Customer.Present only whenauthenticationMode
is set toPassword
.Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.IDs of addresses inaddresses
used as shipping addresses.@NotNull @Valid List<StoreKeyReference>
Stores to which the Customer is assigned to.getTitle()
Title of the Customer, for example, 'Dr.'.getVatId()
Individual VAT ID of the Customer.@NotNull Long
Current version of the Customer.static Customer
of()
factory methodstatic Customer
factory method to create a shallow copy Customerstatic ReferenceTypeId
void
setAddresses
(Address... addresses) Addresses used by the Customer.void
setAddresses
(List<Address> addresses) Addresses used by the Customer.void
setAuthenticationMode
(AuthenticationMode authenticationMode) Indicates whether thepassword
is required for the Customer.void
setBillingAddressIds
(String... billingAddressIds) IDs of addresses inaddresses
used as billing addresses.void
setBillingAddressIds
(List<String> billingAddressIds) IDs of addresses inaddresses
used as billing addresses.void
setCompanyName
(String companyName) Company name of the Customer.void
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Customer was initially created.void
setCreatedBy
(CreatedBy createdBy) IDs and references that created the Customer.void
setCustom
(CustomFields custom) Custom Fields for the Customer.void
setCustomerGroup
(CustomerGroupReference customerGroup) CustomerGroup to which the Customer belongs.void
setCustomerNumber
(String customerNumber) User-defined unique identifier of the Customer.void
setDateOfBirth
(LocalDate dateOfBirth) Date of birth of the Customer.void
setDefaultBillingAddressId
(String defaultBillingAddressId) ID of the address inaddresses
used as the default billing address.void
setDefaultShippingAddressId
(String defaultShippingAddressId) ID of the address inaddresses
used as the default shipping address.void
Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to.void
setExternalId
(String externalId) Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).void
setFirstName
(String firstName) Given name (first name) of the Customer.void
Unique identifier of the Customer.void
setIsEmailVerified
(Boolean isEmailVerified) Indicates whether the email address of the Customer is verified.void
User-defined unique identifier of the Customer.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Customer was last updated.void
setLastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the Customer.void
setLastName
(String lastName) Family name (last name) of the Customer.void
Preferred language of the Customer.void
setMiddleName
(String middleName) Middle name of the Customer.void
setPassword
(String password) Present only whenauthenticationMode
is set toPassword
.void
setSalutation
(String salutation) Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.void
setShippingAddressIds
(String... shippingAddressIds) IDs of addresses inaddresses
used as shipping addresses.void
setShippingAddressIds
(List<String> shippingAddressIds) IDs of addresses inaddresses
used as shipping addresses.void
setStores
(StoreKeyReference... stores) Stores to which the Customer is assigned to.void
setStores
(List<StoreKeyReference> stores) Stores to which the Customer is assigned to.void
Title of the Customer, for example, 'Dr.'.void
Individual VAT ID of the Customer.void
setVersion
(Long version) Current version of the Customer.static com.fasterxml.jackson.core.type.TypeReference<Customer>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withCustomer
(Function<Customer, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
Methods inherited from interface com.commercetools.api.models.customer.CustomerMixin
findAddressById, findDefaultBillingAddress, findDefaultShippingAddress, getAddressById, getBillingAddresses, getDefaultBillingAddress, getDefaultShippingAddress, getShippingAddresses, toReference, toResourceIdentifier
Methods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizable
Methods inherited from interface com.commercetools.api.models.DomainResource
get
-
Method Details
-
getId
Unique identifier of the Customer.
- Specified by:
getId
in interfaceBaseResource
- Specified by:
getId
in interfaceDomainResource<Customer>
- Specified by:
getId
in interfaceIdentifiable<Customer>
- Specified by:
getId
in interfaceVersioned<Customer>
- Returns:
- id
-
getVersion
Current version of the Customer.
- Specified by:
getVersion
in interfaceBaseResource
- Specified by:
getVersion
in interfaceDomainResource<Customer>
- Specified by:
getVersion
in interfaceVersioned<Customer>
- Returns:
- version
-
getKey
String getKey()User-defined unique identifier of the Customer.
-
getCustomerNumber
String getCustomerNumber()User-defined unique identifier of the Customer.
Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).
- Returns:
- customerNumber
-
getExternalId
String getExternalId()Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).
- Returns:
- externalId
-
getCreatedAt
Date and time (UTC) the Customer was initially created.
- Specified by:
getCreatedAt
in interfaceBaseResource
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Customer was last updated.
- Specified by:
getLastModifiedAt
in interfaceBaseResource
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the Customer.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Customer.
- Returns:
- createdBy
-
getEmail
Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to. It is the mandatory unique identifier of a Customer.
- Returns:
-
getPassword
String getPassword()Present only when
authenticationMode
is set toPassword
.- Returns:
- password
-
getFirstName
String getFirstName()Given name (first name) of the Customer.
- Returns:
- firstName
-
getLastName
String getLastName()Family name (last name) of the Customer.
- Returns:
- lastName
-
getMiddleName
String getMiddleName()Middle name of the Customer.
- Returns:
- middleName
-
getTitle
String getTitle()Title of the Customer, for example, 'Dr.'.
- Returns:
- title
-
getDateOfBirth
LocalDate getDateOfBirth()Date of birth of the Customer.
- Returns:
- dateOfBirth
-
getCompanyName
String getCompanyName()Company name of the Customer.
- Returns:
- companyName
-
getVatId
String getVatId()Individual VAT ID of the Customer.
- Returns:
- vatId
-
getAddresses
Addresses used by the Customer.
- Specified by:
getAddresses
in interfaceCustomerMixin
- Returns:
- addresses
-
getDefaultShippingAddressId
String getDefaultShippingAddressId()ID of the address in
addresses
used as the default shipping address.- Specified by:
getDefaultShippingAddressId
in interfaceCustomerMixin
- Returns:
- defaultShippingAddressId
-
getShippingAddressIds
IDs of addresses in
addresses
used as shipping addresses.- Specified by:
getShippingAddressIds
in interfaceCustomerMixin
- Returns:
- shippingAddressIds
-
getDefaultBillingAddressId
String getDefaultBillingAddressId()ID of the address in
addresses
used as the default billing address.- Specified by:
getDefaultBillingAddressId
in interfaceCustomerMixin
- Returns:
- defaultBillingAddressId
- See Also:
-
getBillingAddressIds
IDs of addresses in
addresses
used as billing addresses.- Specified by:
getBillingAddressIds
in interfaceCustomerMixin
- Returns:
- billingAddressIds
-
getIsEmailVerified
Indicates whether the email address of the Customer is verified.
- Returns:
- isEmailVerified
-
getCustomerGroup
CustomerGroup to which the Customer belongs.
- Returns:
- customerGroup
-
getCustom
Custom Fields for the Customer.
- Specified by:
getCustom
in interfaceCustomizable<Customer>
- Returns:
- custom
-
getLocale
String getLocale()Preferred language of the Customer.
- Returns:
- locale
-
getSalutation
String getSalutation()Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.
- Returns:
- salutation
-
getStores
Stores to which the Customer is assigned to.
- If
stores
is empty, the Customer is a global customer, and can log in using the Password Flow for global Customers. - If any Stores are specified, the Customer can only log in using the Password Flow for Customers in a Store for those specific Stores.
- Returns:
- stores
- If
-
getAuthenticationMode
Indicates whether the
password
is required for the Customer.- Returns:
- authenticationMode
-
setId
Unique identifier of the Customer.
- Specified by:
setId
in interfaceBaseResource
- Parameters:
id
- value to be set
-
setVersion
Current version of the Customer.
- Specified by:
setVersion
in interfaceBaseResource
- Parameters:
version
- value to be set
-
setKey
User-defined unique identifier of the Customer.
- Parameters:
key
- value to be set
-
setCustomerNumber
User-defined unique identifier of the Customer.
Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).
- Parameters:
customerNumber
- value to be set
-
setExternalId
Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).
- Parameters:
externalId
- value to be set
-
setCreatedAt
Date and time (UTC) the Customer was initially created.
- Specified by:
setCreatedAt
in interfaceBaseResource
- Parameters:
createdAt
- value to be set
-
setLastModifiedAt
Date and time (UTC) the Customer was last updated.
- Specified by:
setLastModifiedAt
in interfaceBaseResource
- Parameters:
lastModifiedAt
- value to be set
-
setLastModifiedBy
IDs and references that last modified the Customer.
- Parameters:
lastModifiedBy
- value to be set
-
setCreatedBy
IDs and references that created the Customer.
- Parameters:
createdBy
- value to be set
-
setEmail
Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to. It is the mandatory unique identifier of a Customer.
- Parameters:
email
- value to be set
-
setPassword
Present only when
authenticationMode
is set toPassword
.- Parameters:
password
- value to be set
-
setFirstName
Given name (first name) of the Customer.
- Parameters:
firstName
- value to be set
-
setLastName
Family name (last name) of the Customer.
- Parameters:
lastName
- value to be set
-
setMiddleName
Middle name of the Customer.
- Parameters:
middleName
- value to be set
-
setTitle
Title of the Customer, for example, 'Dr.'.
- Parameters:
title
- value to be set
-
setDateOfBirth
Date of birth of the Customer.
- Parameters:
dateOfBirth
- value to be set
-
setCompanyName
Company name of the Customer.
- Parameters:
companyName
- value to be set
-
setVatId
Individual VAT ID of the Customer.
- Parameters:
vatId
- value to be set
-
setAddresses
Addresses used by the Customer.
- Parameters:
addresses
- values to be set
-
setAddresses
Addresses used by the Customer.
- Parameters:
addresses
- values to be set
-
setDefaultShippingAddressId
ID of the address in
addresses
used as the default shipping address.- Parameters:
defaultShippingAddressId
- value to be set
-
setShippingAddressIds
IDs of addresses in
addresses
used as shipping addresses.- Parameters:
shippingAddressIds
- values to be set
-
setShippingAddressIds
IDs of addresses in
addresses
used as shipping addresses.- Parameters:
shippingAddressIds
- values to be set
-
setDefaultBillingAddressId
ID of the address in
addresses
used as the default billing address.- Parameters:
defaultBillingAddressId
- value to be set
-
setBillingAddressIds
IDs of addresses in
addresses
used as billing addresses.- Parameters:
billingAddressIds
- values to be set
-
setBillingAddressIds
IDs of addresses in
addresses
used as billing addresses.- Parameters:
billingAddressIds
- values to be set
-
setIsEmailVerified
Indicates whether the email address of the Customer is verified.
- Parameters:
isEmailVerified
- value to be set
-
setCustomerGroup
CustomerGroup to which the Customer belongs.
- Parameters:
customerGroup
- value to be set
-
setCustom
Custom Fields for the Customer.
- Specified by:
setCustom
in interfaceCustomizable<Customer>
- Parameters:
custom
- value to be set
-
setLocale
Preferred language of the Customer.
- Parameters:
locale
- value to be set
-
setSalutation
Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.
- Parameters:
salutation
- value to be set
-
setStores
Stores to which the Customer is assigned to.
- If
stores
is empty, the Customer is a global customer, and can log in using the Password Flow for global Customers. - If any Stores are specified, the Customer can only log in using the Password Flow for Customers in a Store for those specific Stores.
- Parameters:
stores
- values to be set
- If
-
setStores
Stores to which the Customer is assigned to.
- If
stores
is empty, the Customer is a global customer, and can log in using the Password Flow for global Customers. - If any Stores are specified, the Customer can only log in using the Password Flow for Customers in a Store for those specific Stores.
- Parameters:
stores
- values to be set
- If
-
setAuthenticationMode
Indicates whether the
password
is required for the Customer.- Parameters:
authenticationMode
- value to be set
-
of
factory method- Returns:
- instance of Customer
-
of
factory method to create a shallow copy Customer- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of Customer- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Customer- Returns:
- builder
-
builder
create builder for Customer instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withCustomer
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
referenceTypeId
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-