Class AddItemRequest

    • Constructor Detail

      • AddItemRequest

        public AddItemRequest()
    • Method Detail

      • getVariantId

        public String getVariantId()
        The id of the variant for this add item request. Used to retrieve variant information for the cart item.
        Returns:
        The id of the variant for this add item request. Used to retrieve variant information for the cart item.
      • getProductId

        public String getProductId()
        The id of the product for this add item request. Used to retrieve product information for the cart item.
        Returns:
        The id of the product for this add item request. Used to retrieve product information for the cart item.
      • getSku

        public String getSku()
        The SKU code for the item (e.g., Product or Variant).
        Returns:
        SKU code for the item
      • getQuantity

        public int getQuantity()
        The amount of this item to be added to the Cart.
        Returns:
        The amount of this item to be added to the Cart.
      • getCurrency

        @Deprecated
        public javax.money.CurrencyUnit getCurrency()
        Deprecated.
        in favor of using PriceCartRequest for creating or pricing a cart.
      • getItemAttributes

        public Map<String,​Object> getItemAttributes()
        Miscellaneous attributes that should be copied to the CartItem.getAttributes() for this request.
        Returns:
        Miscellaneous attributes that should be copied to the CartItem.getAttributes() for this request.
      • getItemInternalAttributes

        public Map<String,​Object> getItemInternalAttributes()
        Miscellaneous internal attributes that should be copied to the CartItem.getInternalAttributes() for this request.
        Returns:
        Miscellaneous internal attributes that should be copied to the CartItem.getInternalAttributes() for this request.
      • getItemAttributeChoices

        public Map<String,​String> getItemAttributeChoices()
        Attribute choices that should be copied to CartItem.getAttributeChoices() for this request.
        Returns:
        Attribute choices that should be copied to CartItem.getAttributeChoices() for this request.
      • getCartAttributes

        public Map<String,​Object> getCartAttributes()
        Attributes that should be copied to the Cart.getAttributes() for this request.
        Returns:
        Attributes that should be copied to the Cart.getAttributes() for this request.
      • getItemChoiceKey

        public String getItemChoiceKey()
        If this AddItemRequest is one within getDependentCartItems(), this is the key to use to relate to this CartItem to a configured product item choice.
        Returns:
        The key to use to relate to this CartItem to a configured product item choice.
      • getMerchandisingContext

        public String getMerchandisingContext()
        The value that should be mapped to CartItem.getMerchandisingContext(). This holds the selector or merchandising product's id.
        Returns:
        The context of the item signifying where it's added from
      • getAdditionalAttributes

        public Map<String,​Object> getAdditionalAttributes()
        Miscellaneous attributes that can be set to this request in order to inform business logic for adding a CartItem.
        Returns:
        Miscellaneous attributes that can be set to this request in order to inform business logic for adding a CartItem.
      • setVariantId

        public void setVariantId​(String variantId)
        The id of the variant for this add item request. Used to retrieve variant information for the cart item.
        Parameters:
        variantId - The id of the variant for this add item request. Used to retrieve variant information for the cart item.
      • setProductId

        public void setProductId​(String productId)
        The id of the product for this add item request. Used to retrieve product information for the cart item.
        Parameters:
        productId - The id of the product for this add item request. Used to retrieve product information for the cart item.
      • setSku

        public void setSku​(String sku)
        The SKU code for the item (e.g., Product or Variant).
        Parameters:
        sku - SKU code for the item
      • setQuantity

        public void setQuantity​(int quantity)
        The amount of this item to be added to the Cart.
        Parameters:
        quantity - The amount of this item to be added to the Cart.
      • setCurrency

        @Deprecated
        public void setCurrency​(javax.money.CurrencyUnit currency)
        Deprecated.
        in favor of using PriceCartRequest for creating or pricing a cart.
      • setItemAttributes

        public void setItemAttributes​(Map<String,​Object> itemAttributes)
        Miscellaneous attributes that should be copied to the CartItem.getAttributes() for this request.
        Parameters:
        itemAttributes - Miscellaneous attributes that should be copied to the CartItem.getAttributes() for this request.
      • setItemInternalAttributes

        public void setItemInternalAttributes​(Map<String,​Object> itemInternalAttributes)
        Miscellaneous internal attributes that should be copied to the CartItem.getInternalAttributes() for this request.
        Parameters:
        itemAttributes - Miscellaneous internal attributes that should be copied to the CartItem.getInternalAttributes() for this request.
      • setItemAttributeChoices

        public void setItemAttributeChoices​(Map<String,​String> itemAttributeChoices)
        Attribute choices that should be copied to CartItem.getAttributeChoices() for this request.
        Parameters:
        itemAttributeChoices - Attribute choices that should be copied to CartItem.getAttributeChoices() for this request.
      • setCartAttributes

        public void setCartAttributes​(Map<String,​Object> cartAttributes)
        Attributes that should be copied to the Cart.getAttributes() for this request.
        Parameters:
        cartAttributes - Attributes that should be copied to the Cart.getAttributes() for this request.
      • setDependentCartItems

        public void setDependentCartItems​(List<AddItemRequest> dependentCartItems)
        A list of additional AddItemRequests that should be processed as dependent items of the resulting parent item of this current AddItemRequest.
        Parameters:
        dependentCartItems - A list of additional AddItemRequests that should be processed as dependent items of the resulting parent item of this current AddItemRequest.
      • setItemChoiceKey

        public void setItemChoiceKey​(String itemChoiceKey)
        If this AddItemRequest is one within getDependentCartItems(), this is the key to use to relate to this CartItem to a configured product item choice.
        Parameters:
        itemChoiceKey - The key to use to relate to this CartItem to a configured product item choice.
      • setMerchandisingContext

        public void setMerchandisingContext​(String merchandisingContext)
        The value that should be mapped to CartItem.getMerchandisingContext(). This holds the selector or merchandising product's id.
        Parameters:
        merchandisingContext - The context of the item signifying where it's added from
      • setAdditionalAttributes

        public void setAdditionalAttributes​(Map<String,​Object> additionalAttributes)
        Miscellaneous attributes that can be set to this request in order to inform business logic for adding a CartItem.
        Parameters:
        additionalAttributes - Miscellaneous attributes that can be set to this request in order to inform business logic for adding a CartItem.