Interface CustomerDraft

All Superinterfaces:
CustomizableDraft<CustomerDraft>, Draft<CustomerDraft>, WithKey

public interface CustomerDraft extends CustomizableDraft<CustomerDraft>, WithKey, Draft<CustomerDraft>
CustomerDraft
Example to create an instance using the builder pattern

     CustomerDraft customerDraft = CustomerDraft.builder()
             .email("{email}")
             .build()
 
  • Method Details

    • getKey

      String getKey()

      User-defined unique identifier for the Customer. The key field is preferred over customerNumber as 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.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • 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

      @NotNull @NotNull String 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:
      email
    • getPassword

      String getPassword()

      Required when authenticationMode is set to Password. 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 String getAnonymousCartId()
      Deprecated.

      Deprecated since an anonymous Cart can be identified by its id or external key.

      Returns:
      anonymousCartId
    • getAnonymousCart

      @Valid @Valid CartResourceIdentifier getAnonymousCart()

      Identifies a Cart that will be assigned to the new Customer.

      Returns:
      anonymousCart
    • getAnonymousId

      String getAnonymousId()

      Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

      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 funtionality.

      Returns:
      companyName
    • getVatId

      String getVatId()

      Individual VAT ID of the Customer.

      Returns:
      vatId
    • getAddresses

      @Valid @Valid List<BaseAddress> getAddresses()

      Addresses of the Customer.

      Returns:
      addresses
    • getDefaultShippingAddress

      Integer getDefaultShippingAddress()

      Index of the address in the addresses array to use as the default shipping address. The defaultShippingAddressId of the Customer will be set to the id of that address.

      Returns:
      defaultShippingAddress
    • getShippingAddresses

      List<Integer> getShippingAddresses()

      Indices of the shipping addresses in the addresses array. The shippingAddressIds of the Customer will be set to the IDs of these addresses.

      Returns:
      shippingAddresses
    • getDefaultBillingAddress

      Integer getDefaultBillingAddress()

      Index of the address in the addresses array to use as the default billing address. The defaultBillingAddressId of the Customer will be set to the id of that address.

      Returns:
      defaultBillingAddress
    • getBillingAddresses

      List<Integer> getBillingAddresses()

      Indices of the billing addresses in the addresses array. The billingAddressIds of the Customer will be set to the IDs of these addresses.

      Returns:
      billingAddresses
    • getIsEmailVerified

      Boolean getIsEmailVerified()

      Set to true if 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

      @Valid @Valid CustomerGroupResourceIdentifier getCustomerGroup()

      Sets the CustomerGroup for the Customer.

      Returns:
      customerGroup
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields for the Customer.

      Specified by:
      getCustom in interface CustomizableDraft<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

      @Valid @Valid List<StoreResourceIdentifier> 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 Password to make the password field required for the Customer.
      • Set to ExternalAuth when the password is not required for the Customer.
      Returns:
      authenticationMode
    • setKey

      void setKey(String key)

      User-defined unique identifier for the Customer. The key field is preferred over customerNumber as 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

      void setCustomerNumber(String customerNumber)

      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

      void setExternalId(String externalId)

      Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).

      Parameters:
      externalId - value to be set
    • setEmail

      void setEmail(String email)

      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

      void setPassword(String password)

      Required when authenticationMode is set to Password. Provide the Customer's password in plain text. The API stores passwords in an encrypted format.

      Parameters:
      password - value to be set
    • setFirstName

      void setFirstName(String firstName)

      Given name (first name) of the Customer.

      Parameters:
      firstName - value to be set
    • setLastName

      void setLastName(String lastName)

      Family name (last name) of the Customer.

      Parameters:
      lastName - value to be set
    • setMiddleName

      void setMiddleName(String middleName)

      Middle name of the Customer.

      Parameters:
      middleName - value to be set
    • setTitle

      void setTitle(String title)

      Title of the Customer, for example, 'Dr.'.

      Parameters:
      title - value to be set
    • setAnonymousCartId

      @Deprecated void setAnonymousCartId(String anonymousCartId)
      Deprecated.

      Deprecated since an anonymous Cart can be identified by its id or external key.

      Parameters:
      anonymousCartId - value to be set
    • setAnonymousCart

      void setAnonymousCart(CartResourceIdentifier anonymousCart)

      Identifies a Cart that will be assigned to the new Customer.

      Parameters:
      anonymousCart - value to be set
    • setAnonymousId

      void setAnonymousId(String anonymousId)

      Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

      Parameters:
      anonymousId - value to be set
    • setDateOfBirth

      void setDateOfBirth(LocalDate dateOfBirth)

      Date of birth of the Customer.

      Parameters:
      dateOfBirth - value to be set
    • setCompanyName

      void setCompanyName(String companyName)

      Company name of the Customer. When representing a company as a Customer, Business Units provide extended funtionality.

      Parameters:
      companyName - value to be set
    • setVatId

      void setVatId(String vatId)

      Individual VAT ID of the Customer.

      Parameters:
      vatId - value to be set
    • setAddresses

      void setAddresses(BaseAddress... addresses)

      Addresses of the Customer.

      Parameters:
      addresses - values to be set
    • setAddresses

      void setAddresses(List<BaseAddress> addresses)

      Addresses of the Customer.

      Parameters:
      addresses - values to be set
    • setDefaultShippingAddress

      void setDefaultShippingAddress(Integer defaultShippingAddress)

      Index of the address in the addresses array to use as the default shipping address. The defaultShippingAddressId of the Customer will be set to the id of that address.

      Parameters:
      defaultShippingAddress - value to be set
    • setShippingAddresses

      void setShippingAddresses(Integer... shippingAddresses)

      Indices of the shipping addresses in the addresses array. The shippingAddressIds of the Customer will be set to the IDs of these addresses.

      Parameters:
      shippingAddresses - values to be set
    • setShippingAddresses

      void setShippingAddresses(List<Integer> shippingAddresses)

      Indices of the shipping addresses in the addresses array. The shippingAddressIds of the Customer will be set to the IDs of these addresses.

      Parameters:
      shippingAddresses - values to be set
    • setDefaultBillingAddress

      void setDefaultBillingAddress(Integer defaultBillingAddress)

      Index of the address in the addresses array to use as the default billing address. The defaultBillingAddressId of the Customer will be set to the id of that address.

      Parameters:
      defaultBillingAddress - value to be set
    • setBillingAddresses

      void setBillingAddresses(Integer... billingAddresses)

      Indices of the billing addresses in the addresses array. The billingAddressIds of the Customer will be set to the IDs of these addresses.

      Parameters:
      billingAddresses - values to be set
    • setBillingAddresses

      void setBillingAddresses(List<Integer> billingAddresses)

      Indices of the billing addresses in the addresses array. The billingAddressIds of the Customer will be set to the IDs of these addresses.

      Parameters:
      billingAddresses - values to be set
    • setIsEmailVerified

      void setIsEmailVerified(Boolean isEmailVerified)

      Set to true if 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

      void setCustomerGroup(CustomerGroupResourceIdentifier customerGroup)

      Sets the CustomerGroup for the Customer.

      Parameters:
      customerGroup - value to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields for the Customer.

      Specified by:
      setCustom in interface CustomizableDraft<CustomerDraft>
      Parameters:
      custom - value to be set
    • setLocale

      void setLocale(String locale)

      Preferred language of the Customer. Must be one of the languages supported by the Project.

      Parameters:
      locale - value to be set
    • setSalutation

      void setSalutation(String salutation)

      Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

      Parameters:
      salutation - value to be set
    • setStores

      void setStores(StoreResourceIdentifier... stores)

      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

      void setStores(List<StoreResourceIdentifier> stores)

      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

      void setAuthenticationMode(AuthenticationMode authenticationMode)
      • Set to Password to make the password field required for the Customer.
      • Set to ExternalAuth when the password is not required for the Customer.
      Parameters:
      authenticationMode - value to be set
    • of

      static CustomerDraft of()
      factory method
      Returns:
      instance of CustomerDraft
    • of

      static CustomerDraft of(CustomerDraft template)
      factory method to create a shallow copy CustomerDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static CustomerDraft deepCopy(@Nullable CustomerDraft template)
      factory method to create a deep copy of CustomerDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static CustomerDraftBuilder builder()
      builder factory method for CustomerDraft
      Returns:
      builder
    • builder

      static CustomerDraftBuilder builder(CustomerDraft template)
      create builder for CustomerDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCustomerDraft

      default <T> T withCustomerDraft(Function<CustomerDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • builder

      static CustomerDraftBuilder builder(Customer customer)
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<CustomerDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference