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 Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Customer.

      Specified by:
      getId in interface BaseResource
      Specified by:
      getId in interface DomainResource<Customer>
      Specified by:
      getId in interface Identifiable<Customer>
      Specified by:
      getId in interface Versioned<Customer>
      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Current version of the Customer.

      Specified by:
      getVersion in interface BaseResource
      Specified by:
      getVersion in interface DomainResource<Customer>
      Specified by:
      getVersion in interface Versioned<Customer>
      Returns:
      version
    • getKey

      String getKey()

      User-defined unique identifier of the Customer.

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

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the Customer was initially created.

      Specified by:
      getCreatedAt in interface BaseResource
      Returns:
      createdAt
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Customer was last updated.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Valid @Valid LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the Customer.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Valid @Valid CreatedBy getCreatedBy()

      IDs and references that created the Customer.

      Returns:
      createdBy
    • getEmail

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

      String getPassword()

      Present only when authenticationMode is set to Password.

      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

      @NotNull @Valid @NotNull @Valid List<Address> getAddresses()

      Addresses used by the Customer.

      Specified by:
      getAddresses in interface CustomerMixin
      Returns:
      addresses
    • getDefaultShippingAddressId

      String getDefaultShippingAddressId()

      ID of the address in addresses used as the default shipping address.

      Specified by:
      getDefaultShippingAddressId in interface CustomerMixin
      Returns:
      defaultShippingAddressId
    • getShippingAddressIds

      List<String> getShippingAddressIds()

      IDs of addresses in addresses used as shipping addresses.

      Specified by:
      getShippingAddressIds in interface CustomerMixin
      Returns:
      shippingAddressIds
    • getDefaultBillingAddressId

      String getDefaultBillingAddressId()

      ID of the address in addresses used as the default billing address.

      Specified by:
      getDefaultBillingAddressId in interface CustomerMixin
      Returns:
      defaultBillingAddressId
      See Also:
    • getBillingAddressIds

      List<String> getBillingAddressIds()

      IDs of addresses in addresses used as billing addresses.

      Specified by:
      getBillingAddressIds in interface CustomerMixin
      Returns:
      billingAddressIds
    • getIsEmailVerified

      @NotNull @NotNull Boolean getIsEmailVerified()

      Indicates whether the email address of the Customer is verified.

      Returns:
      isEmailVerified
    • getCustomerGroup

      @Valid @Valid CustomerGroupReference getCustomerGroup()

      CustomerGroup to which the Customer belongs.

      Returns:
      customerGroup
    • getCustom

      @Valid @Valid CustomFields getCustom()

      Custom Fields for the Customer.

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

      @NotNull @Valid @NotNull @Valid List<StoreKeyReference> 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
    • getAuthenticationMode

      @NotNull @NotNull AuthenticationMode getAuthenticationMode()

      Indicates whether the password is required for the Customer.

      Returns:
      authenticationMode
    • setId

      void setId(String id)

      Unique identifier of the Customer.

      Specified by:
      setId in interface BaseResource
      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Current version of the Customer.

      Specified by:
      setVersion in interface BaseResource
      Parameters:
      version - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Customer.

      Parameters:
      key - value to be set
    • setCustomerNumber

      void setCustomerNumber(String customerNumber)

      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

      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
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the Customer was initially created.

      Specified by:
      setCreatedAt in interface BaseResource
      Parameters:
      createdAt - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Customer was last updated.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Parameters:
      lastModifiedAt - value to be set
    • setLastModifiedBy

      void setLastModifiedBy(LastModifiedBy lastModifiedBy)

      IDs and references that last modified the Customer.

      Parameters:
      lastModifiedBy - value to be set
    • setCreatedBy

      void setCreatedBy(CreatedBy createdBy)

      IDs and references that created the Customer.

      Parameters:
      createdBy - value to be set
    • setEmail

      void setEmail(String email)

      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

      void setPassword(String password)

      Present only when authenticationMode is set to Password.

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

      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(Address... addresses)

      Addresses used by the Customer.

      Parameters:
      addresses - values to be set
    • setAddresses

      void setAddresses(List<Address> addresses)

      Addresses used by the Customer.

      Parameters:
      addresses - values to be set
    • setDefaultShippingAddressId

      void setDefaultShippingAddressId(String defaultShippingAddressId)

      ID of the address in addresses used as the default shipping address.

      Parameters:
      defaultShippingAddressId - value to be set
    • setShippingAddressIds

      void setShippingAddressIds(String... shippingAddressIds)

      IDs of addresses in addresses used as shipping addresses.

      Parameters:
      shippingAddressIds - values to be set
    • setShippingAddressIds

      void setShippingAddressIds(List<String> shippingAddressIds)

      IDs of addresses in addresses used as shipping addresses.

      Parameters:
      shippingAddressIds - values to be set
    • setDefaultBillingAddressId

      void setDefaultBillingAddressId(String defaultBillingAddressId)

      ID of the address in addresses used as the default billing address.

      Parameters:
      defaultBillingAddressId - value to be set
    • setBillingAddressIds

      void setBillingAddressIds(String... billingAddressIds)

      IDs of addresses in addresses used as billing addresses.

      Parameters:
      billingAddressIds - values to be set
    • setBillingAddressIds

      void setBillingAddressIds(List<String> billingAddressIds)

      IDs of addresses in addresses used as billing addresses.

      Parameters:
      billingAddressIds - values to be set
    • setIsEmailVerified

      void setIsEmailVerified(Boolean isEmailVerified)

      Indicates whether the email address of the Customer is verified.

      Parameters:
      isEmailVerified - value to be set
    • setCustomerGroup

      void setCustomerGroup(CustomerGroupReference customerGroup)

      CustomerGroup to which the Customer belongs.

      Parameters:
      customerGroup - value to be set
    • setCustom

      void setCustom(CustomFields custom)

      Custom Fields for the Customer.

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

      void setLocale(String locale)

      Preferred language of the Customer.

      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(StoreKeyReference... stores)

      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
    • setStores

      void setStores(List<StoreKeyReference> stores)

      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
    • setAuthenticationMode

      void setAuthenticationMode(AuthenticationMode authenticationMode)

      Indicates whether the password is required for the Customer.

      Parameters:
      authenticationMode - value to be set
    • of

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

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

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

      static CustomerBuilder builder()
      builder factory method for Customer
      Returns:
      builder
    • builder

      static CustomerBuilder builder(Customer template)
      create builder for Customer instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCustomer

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

      static ReferenceTypeId referenceTypeId()
    • typeReference

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