Interface CustomerDraft
- All Superinterfaces:
CustomizableDraft<CustomerDraft>,Draft<CustomerDraft>,WithKey
Example to create an instance using the builder pattern
CustomerDraft customerDraft = CustomerDraft.builder()
.email("{email}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CustomerDraftBuilderbuilder()builder factory method for CustomerDraftstatic CustomerDraftBuilderstatic CustomerDraftBuilderbuilder(CustomerDraft template) create builder for CustomerDraft instancecopyDeep()static CustomerDraftdeepCopy(CustomerDraft template) factory method to create a deep copy of CustomerDraft@Valid List<BaseAddress>Addresses of the Customer.@Valid CartResourceIdentifierAssigns the Customer to the specified Cart.Deprecated.Set toPasswordto make thepasswordfield required for the Customer. Set toExternalAuthwhen the password is not required for the Customer.Indices of the billing addresses in theaddressesarray.Company name of the Customer.@Valid CustomFieldsDraftCustom Fields for the Customer.Sets the CustomerGroup for the Customer.@Valid List<CustomerGroupAssignmentDraft>Customer Groups to assign the Customer to.User-defined unique identifier for a Customer.Date of birth of the Customer.Index of the address in theaddressesarray to use as the default billing address.Index of the address in theaddressesarray to use as the default shipping address.@NotNull StringgetEmail()Email address of the Customer that must be 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.Set totrueif the email address of the Customer has been verified already.getKey()User-defined unique identifier for the Customer.Family name (last name) of the Customer.Preferred language of the Customer.Middle name of the Customer.Required whenauthenticationModeis set toPassword.Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.Indices of the shipping addresses in theaddressesarray.@Valid List<StoreResourceIdentifier>Sets the Stores for the Customer.getTitle()Title of the Customer, for example, 'Dr.'.getVatId()Individual VAT ID of the Customer.static CustomerDraftof()factory methodstatic CustomerDraftof(CustomerDraft template) factory method to create a shallow copy CustomerDraftvoidsetAddresses(BaseAddress... addresses) Addresses of the Customer.voidsetAddresses(List<BaseAddress> addresses) Addresses of the Customer.voidsetAnonymousCart(CartResourceIdentifier anonymousCart) Assigns the Customer to the specified Cart.voidsetAnonymousCartId(String anonymousCartId) Deprecated.voidsetAnonymousId(String anonymousId) voidsetAuthenticationMode(AuthenticationMode authenticationMode) Set toPasswordto make thepasswordfield required for the Customer. Set toExternalAuthwhen the password is not required for the Customer.voidsetBillingAddresses(Integer... billingAddresses) Indices of the billing addresses in theaddressesarray.voidsetBillingAddresses(List<Integer> billingAddresses) Indices of the billing addresses in theaddressesarray.voidsetCompanyName(String companyName) Company name of the Customer.voidsetCustom(CustomFieldsDraft custom) Custom Fields for the Customer.voidsetCustomerGroup(CustomerGroupResourceIdentifier customerGroup) Sets the CustomerGroup for the Customer.voidsetCustomerGroupAssignments(CustomerGroupAssignmentDraft... customerGroupAssignments) Customer Groups to assign the Customer to.voidsetCustomerGroupAssignments(List<CustomerGroupAssignmentDraft> customerGroupAssignments) Customer Groups to assign the Customer to.voidsetCustomerNumber(String customerNumber) User-defined unique identifier for a Customer.voidsetDateOfBirth(LocalDate dateOfBirth) Date of birth of the Customer.voidsetDefaultBillingAddress(Integer defaultBillingAddress) Index of the address in theaddressesarray to use as the default billing address.voidsetDefaultShippingAddress(Integer defaultShippingAddress) Index of the address in theaddressesarray to use as the default shipping address.voidEmail address of the Customer that must be 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.voidsetIsEmailVerified(Boolean isEmailVerified) Set totrueif the email address of the Customer has been verified already.voidUser-defined unique identifier for 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) Required whenauthenticationModeis set toPassword.voidsetSalutation(String salutation) Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.voidsetShippingAddresses(Integer... shippingAddresses) Indices of the shipping addresses in theaddressesarray.voidsetShippingAddresses(List<Integer> shippingAddresses) Indices of the shipping addresses in theaddressesarray.voidsetStores(StoreResourceIdentifier... stores) Sets the Stores for the Customer.voidsetStores(List<StoreResourceIdentifier> stores) Sets the Stores for the Customer.voidTitle of the Customer, for example, 'Dr.'.voidIndividual VAT ID of the Customer.static com.fasterxml.jackson.core.type.TypeReference<CustomerDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithCustomerDraft(Function<CustomerDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getKey
String getKey()User-defined unique identifier for the Customer. The
keyfield is preferred overcustomerNumberas it is mutable and provides more flexibility.This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing Customers with the Import API.
-
getCustomerNumber
String getCustomerNumber()User-defined unique identifier for a Customer. Once set, it cannot be changed.
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
-
getEmail
Email address of the Customer that must be 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()Required when
authenticationModeis set toPassword. Provide the Customer's password in plain text. The API stores passwords in an encrypted format.- 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
-
getAnonymousCartId
Deprecated.Deprecated since an anonymous Cart can be identified by its
idor externalkey.- Returns:
- anonymousCartId
-
getAnonymousCart
Assigns the Customer to the specified Cart.
- Returns:
- anonymousCart
-
getAnonymousId
String getAnonymousId()Assigns the Customer to all Carts, Orders, ShoppingLists, and Payments with the same
anonymousId.If
anonymousCartis provided, this value must match theanonymousIdof the anonymous Cart; otherwise, an InvalidOperation error is returned.- Returns:
- anonymousId
-
getDateOfBirth
LocalDate getDateOfBirth()Date of birth of the Customer.
- Returns:
- dateOfBirth
-
getCompanyName
String getCompanyName()Company name of the Customer. When representing a company as a Customer, Business Units provide extended functionality.
- Returns:
- companyName
-
getVatId
String getVatId()Individual VAT ID of the Customer.
- Returns:
- vatId
-
getAddresses
Addresses of the Customer.
- Returns:
- addresses
-
getDefaultShippingAddress
Integer getDefaultShippingAddress()Index of the address in the
addressesarray to use as the default shipping address. ThedefaultShippingAddressIdof the Customer will be set to theidof that address.- Returns:
- defaultShippingAddress
-
getShippingAddresses
Indices of the shipping addresses in the
addressesarray. TheshippingAddressIdsof the Customer will be set to the IDs of these addresses.- Returns:
- shippingAddresses
-
getDefaultBillingAddress
Integer getDefaultBillingAddress()Index of the address in the
addressesarray to use as the default billing address. ThedefaultBillingAddressIdof the Customer will be set to theidof that address.- Returns:
- defaultBillingAddress
-
getBillingAddresses
Indices of the billing addresses in the
addressesarray. ThebillingAddressIdsof the Customer will be set to the IDs of these addresses.- Returns:
- billingAddresses
-
getIsEmailVerified
Boolean getIsEmailVerified()Set to
trueif the email address of the Customer has been verified already. The intended use is to leave this field unset upon sign-up of the Customer and initiate the email verification afterwards.- Returns:
- isEmailVerified
-
getCustomerGroup
Sets the CustomerGroup for the Customer.
For new projects, use
customerGroupAssignmentsinstead. It supports assigning Customers to multiple Customer Groups and provides greater flexibility in complex pricing scenarios.- Returns:
- customerGroup
-
getCustomerGroupAssignments
Customer Groups to assign the Customer to.
Used for Line Item price selection.
- Returns:
- customerGroupAssignments
-
getCustom
Custom Fields for the Customer.
- Specified by:
getCustomin interfaceCustomizableDraft<CustomerDraft>- Returns:
- custom
-
getLocale
String getLocale()Preferred language of the Customer. Must be one of the languages supported by the Project.
- Returns:
- locale
-
getSalutation
String getSalutation()Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.
- Returns:
- salutation
-
getStores
Sets the Stores for the Customer.
- If no Stores are specified, 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
-
getAuthenticationMode
AuthenticationMode getAuthenticationMode()- Set to
Passwordto make thepasswordfield required for the Customer. - Set to
ExternalAuthwhen the password is not required for the Customer.
- Returns:
- authenticationMode
- Set to
-
setKey
User-defined unique identifier for the Customer. The
keyfield is preferred overcustomerNumberas it is mutable and provides more flexibility.This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing Customers with the Import API.
- Parameters:
key- value to be set
-
setCustomerNumber
User-defined unique identifier for a Customer. Once set, it cannot be changed.
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
-
setEmail
Email address of the Customer that must be 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
Required when
authenticationModeis set toPassword. Provide the Customer's password in plain text. The API stores passwords in an encrypted format.- 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
-
setAnonymousCartId
Deprecated.Deprecated since an anonymous Cart can be identified by its
idor externalkey.- Parameters:
anonymousCartId- value to be set
-
setAnonymousCart
Assigns the Customer to the specified Cart.
- Parameters:
anonymousCart- value to be set
-
setAnonymousId
Assigns the Customer to all Carts, Orders, ShoppingLists, and Payments with the same
anonymousId.If
anonymousCartis provided, this value must match theanonymousIdof the anonymous Cart; otherwise, an InvalidOperation error is returned.- Parameters:
anonymousId- value to be set
-
setDateOfBirth
Date of birth of the Customer.
- Parameters:
dateOfBirth- value to be set
-
setCompanyName
Company name of the Customer. When representing a company as a Customer, Business Units provide extended functionality.
- Parameters:
companyName- value to be set
-
setVatId
Individual VAT ID of the Customer.
- Parameters:
vatId- value to be set
-
setAddresses
Addresses of the Customer.
- Parameters:
addresses- values to be set
-
setAddresses
Addresses of the Customer.
- Parameters:
addresses- values to be set
-
setDefaultShippingAddress
Index of the address in the
addressesarray to use as the default shipping address. ThedefaultShippingAddressIdof the Customer will be set to theidof that address.- Parameters:
defaultShippingAddress- value to be set
-
setShippingAddresses
Indices of the shipping addresses in the
addressesarray. TheshippingAddressIdsof the Customer will be set to the IDs of these addresses.- Parameters:
shippingAddresses- values to be set
-
setShippingAddresses
Indices of the shipping addresses in the
addressesarray. TheshippingAddressIdsof the Customer will be set to the IDs of these addresses.- Parameters:
shippingAddresses- values to be set
-
setDefaultBillingAddress
Index of the address in the
addressesarray to use as the default billing address. ThedefaultBillingAddressIdof the Customer will be set to theidof that address.- Parameters:
defaultBillingAddress- value to be set
-
setBillingAddresses
Indices of the billing addresses in the
addressesarray. ThebillingAddressIdsof the Customer will be set to the IDs of these addresses.- Parameters:
billingAddresses- values to be set
-
setBillingAddresses
Indices of the billing addresses in the
addressesarray. ThebillingAddressIdsof the Customer will be set to the IDs of these addresses.- Parameters:
billingAddresses- values to be set
-
setIsEmailVerified
Set to
trueif the email address of the Customer has been verified already. The intended use is to leave this field unset upon sign-up of the Customer and initiate the email verification afterwards.- Parameters:
isEmailVerified- value to be set
-
setCustomerGroup
Sets the CustomerGroup for the Customer.
For new projects, use
customerGroupAssignmentsinstead. It supports assigning Customers to multiple Customer Groups and provides greater flexibility in complex pricing scenarios.- Parameters:
customerGroup- value to be set
-
setCustomerGroupAssignments
Customer Groups to assign the Customer to.
Used for Line Item price selection.
- Parameters:
customerGroupAssignments- values to be set
-
setCustomerGroupAssignments
Customer Groups to assign the Customer to.
Used for Line Item price selection.
- Parameters:
customerGroupAssignments- values to be set
-
setCustom
Custom Fields for the Customer.
- Specified by:
setCustomin interfaceCustomizableDraft<CustomerDraft>- Parameters:
custom- value to be set
-
setLocale
Preferred language of the Customer. Must be one of the languages supported by the Project.
- Parameters:
locale- value to be set
-
setSalutation
Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.
- Parameters:
salutation- value to be set
-
setStores
Sets the Stores for the Customer.
- If no Stores are specified, 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
-
setStores
Sets the Stores for the Customer.
- If no Stores are specified, 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
-
setAuthenticationMode
- Set to
Passwordto make thepasswordfield required for the Customer. - Set to
ExternalAuthwhen the password is not required for the Customer.
- Parameters:
authenticationMode- value to be set
- Set to
-
of
factory method- Returns:
- instance of CustomerDraft
-
of
factory method to create a shallow copy CustomerDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
CustomerDraft copyDeep() -
deepCopy
factory method to create a deep copy of CustomerDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CustomerDraft- Returns:
- builder
-
builder
create builder for CustomerDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withCustomerDraft
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
builder
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-