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 CustomerBuilderbuilder()builder factory method for Customerstatic CustomerBuildercreate builder for Customer instancecopyDeep()static Customerfactory method to create a deep copy of CustomerAddresses used by the Customer.@NotNull AuthenticationModeIndicates whether thepasswordis required for the Customer.IDs of addresses inaddressesused as billing addresses.Company name of the Customer.@NotNull ZonedDateTimeDate and time (UTC) the Customer was initially created.@Valid CreatedByIDs and references that created the Customer.@Valid CustomFieldsCustom Fields for the Customer.@Valid CustomerGroupReferenceCustomerGroup to which the Customer belongs.@Valid List<CustomerGroupAssignment>Customer Groups that the Customer belongs to.User-defined unique identifier of the Customer.Date of birth of the Customer.ID of the address inaddressesused as the default billing address.ID of the address inaddressesused as the default shipping address.@NotNull StringgetEmail()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 StringgetId()Unique identifier of the Customer.@NotNull BooleanIndicates whether the email address of the Customer is verified.getKey()User-defined unique identifier of the Customer.@NotNull ZonedDateTimeDate and time (UTC) the Customer was last updated.@Valid LastModifiedByIDs 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 whenauthenticationModeis set toPassword.Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.IDs of addresses inaddressesused 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 LongCurrent version of the Customer.static Customerof()factory methodstatic Customerfactory method to create a shallow copy Customerstatic ReferenceTypeIdvoidsetAddresses(Address... addresses) Addresses used by the Customer.voidsetAddresses(List<Address> addresses) Addresses used by the Customer.voidsetAuthenticationMode(AuthenticationMode authenticationMode) Indicates whether thepasswordis required for the Customer.voidsetBillingAddressIds(String... billingAddressIds) IDs of addresses inaddressesused as billing addresses.voidsetBillingAddressIds(List<String> billingAddressIds) IDs of addresses inaddressesused as billing addresses.voidsetCompanyName(String companyName) Company name of the Customer.voidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Customer was initially created.voidsetCreatedBy(CreatedBy createdBy) IDs and references that created the Customer.voidsetCustom(CustomFields custom) Custom Fields for the Customer.voidsetCustomerGroup(CustomerGroupReference customerGroup) CustomerGroup to which the Customer belongs.voidsetCustomerGroupAssignments(CustomerGroupAssignment... customerGroupAssignments) Customer Groups that the Customer belongs to.voidsetCustomerGroupAssignments(List<CustomerGroupAssignment> customerGroupAssignments) Customer Groups that the Customer belongs to.voidsetCustomerNumber(String customerNumber) User-defined unique identifier of the Customer.voidsetDateOfBirth(LocalDate dateOfBirth) Date of birth of the Customer.voidsetDefaultBillingAddressId(String defaultBillingAddressId) ID of the address inaddressesused as the default billing address.voidsetDefaultShippingAddressId(String defaultShippingAddressId) ID of the address inaddressesused as the default shipping address.voidEmail address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to.voidsetExternalId(String externalId) Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).voidsetFirstName(String firstName) Given name (first name) of the Customer.voidUnique identifier of the Customer.voidsetIsEmailVerified(Boolean isEmailVerified) Indicates whether the email address of the Customer is verified.voidUser-defined unique identifier of the Customer.voidsetLastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the Customer was last updated.voidsetLastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified the Customer.voidsetLastName(String lastName) Family name (last name) of the Customer.voidPreferred language of the Customer.voidsetMiddleName(String middleName) Middle name of the Customer.voidsetPassword(String password) Present only whenauthenticationModeis set toPassword.voidsetSalutation(String salutation) Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.voidsetShippingAddressIds(String... shippingAddressIds) IDs of addresses inaddressesused as shipping addresses.voidsetShippingAddressIds(List<String> shippingAddressIds) IDs of addresses inaddressesused as shipping addresses.voidsetStores(StoreKeyReference... stores) Stores to which the Customer is assigned to.voidsetStores(List<StoreKeyReference> stores) Stores to which the Customer is assigned to.voidTitle of the Customer, for example, 'Dr.'.voidIndividual VAT ID of the Customer.voidsetVersion(Long version) Current version of the Customer.static com.fasterxml.jackson.core.type.TypeReference<Customer>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithCustomer(Function<Customer, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResourceMethods inherited from interface com.commercetools.api.models.customer.CustomerMixin
findAddressById, findDefaultBillingAddress, findDefaultShippingAddress, getAddressById, getBillingAddresses, getDefaultBillingAddress, getDefaultShippingAddress, getShippingAddresses, toReference, toResourceIdentifierMethods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizableMethods inherited from interface com.commercetools.api.models.DomainResource
get
-
Method Details
-
getId
Unique identifier of the Customer.
- Specified by:
getIdin interfaceBaseResource- Specified by:
getIdin interfaceDomainResource<Customer>- Specified by:
getIdin interfaceIdentifiable<Customer>- Specified by:
getIdin interfaceVersioned<Customer>- Returns:
- id
-
getVersion
Current version of the Customer.
- Specified by:
getVersionin interfaceBaseResource- Specified by:
getVersionin interfaceDomainResource<Customer>- Specified by:
getVersionin 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:
getCreatedAtin interfaceBaseResource- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Customer was last updated.
- Specified by:
getLastModifiedAtin 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
authenticationModeis 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:
getAddressesin interfaceCustomerMixin- Returns:
- addresses
-
getDefaultShippingAddressId
String getDefaultShippingAddressId()ID of the address in
addressesused as the default shipping address.- Specified by:
getDefaultShippingAddressIdin interfaceCustomerMixin- Returns:
- defaultShippingAddressId
-
getShippingAddressIds
IDs of addresses in
addressesused as shipping addresses.- Specified by:
getShippingAddressIdsin interfaceCustomerMixin- Returns:
- shippingAddressIds
-
getDefaultBillingAddressId
String getDefaultBillingAddressId()ID of the address in
addressesused as the default billing address.- Specified by:
getDefaultBillingAddressIdin interfaceCustomerMixin- Returns:
- defaultBillingAddressId
- See Also:
-
getBillingAddressIds
IDs of addresses in
addressesused as billing addresses.- Specified by:
getBillingAddressIdsin 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
-
getCustomerGroupAssignments
Customer Groups that the Customer belongs to.
Used for Line Item price selection.
- Returns:
- customerGroupAssignments
-
getCustom
Custom Fields for the Customer.
- Specified by:
getCustomin 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
storesis 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
passwordis required for the Customer.- Returns:
- authenticationMode
-
setId
Unique identifier of the Customer.
- Specified by:
setIdin interfaceBaseResource- Parameters:
id- value to be set
-
setVersion
Current version of the Customer.
- Specified by:
setVersionin 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:
setCreatedAtin interfaceBaseResource- Parameters:
createdAt- value to be set
-
setLastModifiedAt
Date and time (UTC) the Customer was last updated.
- Specified by:
setLastModifiedAtin 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
authenticationModeis 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
addressesused as the default shipping address.- Parameters:
defaultShippingAddressId- value to be set
-
setShippingAddressIds
IDs of addresses in
addressesused as shipping addresses.- Parameters:
shippingAddressIds- values to be set
-
setShippingAddressIds
IDs of addresses in
addressesused as shipping addresses.- Parameters:
shippingAddressIds- values to be set
-
setDefaultBillingAddressId
ID of the address in
addressesused as the default billing address.- Parameters:
defaultBillingAddressId- value to be set
-
setBillingAddressIds
IDs of addresses in
addressesused as billing addresses.- Parameters:
billingAddressIds- values to be set
-
setBillingAddressIds
IDs of addresses in
addressesused 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
-
setCustomerGroupAssignments
Customer Groups that the Customer belongs to.
Used for Line Item price selection.
- Parameters:
customerGroupAssignments- values to be set
-
setCustomerGroupAssignments
Customer Groups that the Customer belongs to.
Used for Line Item price selection.
- Parameters:
customerGroupAssignments- values to be set
-
setCustom
Custom Fields for the Customer.
- Specified by:
setCustomin 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
storesis 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
storesis 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
passwordis 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
-
copyDeep
Customer copyDeep()- Specified by:
copyDeepin interfaceBaseResource
-
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
-