Interface LineItemImportDraft

All Superinterfaces:
CustomizableDraft<LineItemImportDraft>, Draft<LineItemImportDraft>

public interface LineItemImportDraft extends CustomizableDraft<LineItemImportDraft>, Draft<LineItemImportDraft>

Represents a snapshot of a Product Variant at the time it was imported with the Order. The Product Variant can be specified by providing a productId and variant.id, or by providing a variant.sku.


Example to create an instance using the builder pattern

     LineItemImportDraft lineItemImportDraft = LineItemImportDraft.builder()
             .name(nameBuilder -> nameBuilder)
             .variant(variantBuilder -> variantBuilder)
             .quantity(0.3)
             .price(priceBuilder -> priceBuilder)
             .build()
 
  • Method Details

    • getName

      @NotNull @Valid @NotNull @Valid LocalizedString getName()

      Name of the Line Item.

      Returns:
      name
    • getKey

      String getKey()

      User-defined unique identifier of the Line Item.

      Returns:
      key
    • getVariant

      @NotNull @Valid @NotNull @Valid ProductVariantImportDraft getVariant()

      The Product Variant to use as a Line Item.

      Returns:
      variant
    • getProductId

      String getProductId()

      id of the Product the Product Variant belongs to.

      If provided, you must also set variant.id.

      Returns:
      productId
    • getQuantity

      @NotNull @NotNull Long getQuantity()

      The number of Product Variants in the LineItem. Can be a negative value.

      Returns:
      quantity
    • getPrice

      @NotNull @Valid @NotNull @Valid PriceDraft getPrice()

      The Line Item price for quantity = 1. The amount can be negative.

      Returns:
      price
    • getTaxRate

      @Valid @Valid TaxRate getTaxRate()

      The tax rate used to calculate the taxedPrice of the Order.

      Returns:
      taxRate
    • getDistributionChannel

      @Valid @Valid ChannelResourceIdentifier getDistributionChannel()

      The Channel used to select a Price. This Channel must have the ProductDistribution role.

      Returns:
      distributionChannel
    • getSupplyChannel

      @Valid @Valid ChannelResourceIdentifier getSupplyChannel()

      The Channel used to supply Line Items. By providing supply Channel information, you can uniquely identify Inventory entries that should be reserved. This Channel must have the InventorySupply role.

      Returns:
      supplyChannel
    • getInventoryMode

      InventoryMode getInventoryMode()

      Inventory mode specific to the LineItem, valid for the entire quantity of the LineItem. Set only if Inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

      Returns:
      inventoryMode
    • getShippingDetails

      @Valid @Valid ItemShippingDetailsDraft getShippingDetails()

      Container for Line Item-specific addresses.

      Returns:
      shippingDetails
    • getState

      @Valid @Valid List<ItemState> getState()

      States of the Line Item.

      Returns:
      state
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields of the LineItem.

      Specified by:
      getCustom in interface CustomizableDraft<LineItemImportDraft>
      Returns:
      custom
    • setName

      void setName(LocalizedString name)

      Name of the Line Item.

      Parameters:
      name - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Line Item.

      Parameters:
      key - value to be set
    • setVariant

      void setVariant(ProductVariantImportDraft variant)

      The Product Variant to use as a Line Item.

      Parameters:
      variant - value to be set
    • setProductId

      void setProductId(String productId)

      id of the Product the Product Variant belongs to.

      If provided, you must also set variant.id.

      Parameters:
      productId - value to be set
    • setQuantity

      void setQuantity(Long quantity)

      The number of Product Variants in the LineItem. Can be a negative value.

      Parameters:
      quantity - value to be set
    • setPrice

      void setPrice(PriceDraft price)

      The Line Item price for quantity = 1. The amount can be negative.

      Parameters:
      price - value to be set
    • setTaxRate

      void setTaxRate(TaxRate taxRate)

      The tax rate used to calculate the taxedPrice of the Order.

      Parameters:
      taxRate - value to be set
    • setDistributionChannel

      void setDistributionChannel(ChannelResourceIdentifier distributionChannel)

      The Channel used to select a Price. This Channel must have the ProductDistribution role.

      Parameters:
      distributionChannel - value to be set
    • setSupplyChannel

      void setSupplyChannel(ChannelResourceIdentifier supplyChannel)

      The Channel used to supply Line Items. By providing supply Channel information, you can uniquely identify Inventory entries that should be reserved. This Channel must have the InventorySupply role.

      Parameters:
      supplyChannel - value to be set
    • setInventoryMode

      void setInventoryMode(InventoryMode inventoryMode)

      Inventory mode specific to the LineItem, valid for the entire quantity of the LineItem. Set only if Inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

      Parameters:
      inventoryMode - value to be set
    • setShippingDetails

      void setShippingDetails(ItemShippingDetailsDraft shippingDetails)

      Container for Line Item-specific addresses.

      Parameters:
      shippingDetails - value to be set
    • setState

      void setState(ItemState... state)

      States of the Line Item.

      Parameters:
      state - values to be set
    • setState

      void setState(List<ItemState> state)

      States of the Line Item.

      Parameters:
      state - values to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields of the LineItem.

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

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

      factory method to create a shallow copy LineItemImportDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of LineItemImportDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static LineItemImportDraftBuilder builder()
      builder factory method for LineItemImportDraft
      Returns:
      builder
    • builder

      create builder for LineItemImportDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withLineItemImportDraft

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

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