Interface OrderImport


public interface OrderImport

The data representation for an Order to be imported that is persisted as an Order in the Project.

In commercetools, you can import an Order using the Create Order by Import endpoint method instead of creating it from a Cart.

An OrderImport is a snapshot of an order at the time it was imported.


Example to create an instance using the builder pattern

     OrderImport orderImport = OrderImport.builder()
             .orderNumber("{orderNumber}")
             .totalPrice(totalPriceBuilder -> totalPriceBuilder)
             .build()
 
  • Method Details

    • getOrderNumber

      @NotNull @NotNull String getOrderNumber()

      Maps to Order.orderNumber, String that uniquely identifies an order. It should be unique across a project. Once it's set it cannot be changed.

      Returns:
      orderNumber
    • getCustomer

      @Valid @Valid CustomerKeyReference getCustomer()
      Returns:
      customer
    • getCustomerEmail

      String getCustomerEmail()

      Maps to Order.customerEmail.

      Returns:
      customerEmail
    • getLineItems

      @Valid @Valid List<LineItemImportDraft> getLineItems()

      Maps to Order.lineItems.

      Returns:
      lineItems
    • getCustomLineItems

      @Valid @Valid List<CustomLineItemDraft> getCustomLineItems()

      Maps to Order.customLineItems

      Returns:
      customLineItems
    • getTotalPrice

      @NotNull @Valid @NotNull @Valid TypedMoney getTotalPrice()

      Maps to Order.totalPrice.

      Returns:
      totalPrice
    • getTaxedPrice

      @Valid @Valid TaxedPrice getTaxedPrice()

      Maps to Order.taxedPrice.

      Returns:
      taxedPrice
    • getShippingAddress

      @Valid @Valid Address getShippingAddress()

      Maps to Order.shippingAddress.

      Returns:
      shippingAddress
    • getBillingAddress

      @Valid @Valid Address getBillingAddress()

      Maps to Order.billingAddress.

      Returns:
      billingAddress
    • getCustomerGroup

      @Valid @Valid CustomerGroupKeyReference getCustomerGroup()

      Maps to Order.customerGroup.

      Returns:
      customerGroup
    • getCountry

      String getCountry()

      Maps to Order.country.

      Returns:
      country
    • getOrderState

      OrderState getOrderState()

      Maps to Order.orderState.

      Returns:
      orderState
    • getShipmentState

      ShipmentState getShipmentState()

      Maps to Order.shipmentState.

      Returns:
      shipmentState
    • getPaymentState

      PaymentState getPaymentState()

      Maps to Order.paymentState.

      Returns:
      paymentState
    • getShippingInfo

      @Valid @Valid ShippingInfoImportDraft getShippingInfo()

      Maps to Order.shippingInfo.

      Returns:
      shippingInfo
    • getCompletedAt

      ZonedDateTime getCompletedAt()

      Maps to Order.completedAt.

      Returns:
      completedAt
    • getCustom

      @Valid @Valid Custom getCustom()

      Maps to Order.custom.

      Returns:
      custom
    • getInventoryMode

      InventoryMode getInventoryMode()

      Maps to Order.inventoryMode.

      Returns:
      inventoryMode
    • getTaxRoundingMode

      RoundingMode getTaxRoundingMode()

      Maps to Order.taxRoundingMode.

      Returns:
      taxRoundingMode
    • getTaxCalculationMode

      TaxCalculationMode getTaxCalculationMode()

      Maps to Order.taxCalculationMode.

      Returns:
      taxCalculationMode
    • getOrigin

      CartOrigin getOrigin()

      Maps to Order.origin.

      Returns:
      origin
    • getItemShippingAddresses

      @Valid @Valid List<Address> getItemShippingAddresses()

      Maps to Order.itemShippingAddresses.

      Returns:
      itemShippingAddresses
    • getStore

      @Valid @Valid StoreKeyReference getStore()

      Reference to the Store in which the Order is associated. If referenced Store does not exist, the state of the ImportOperation will be set to unresolved until the necessary Store exists.

      Returns:
      store
    • getState

      @Valid @Valid StateKeyReference getState()

      Reference to a State in a custom workflow.

      Returns:
      state
    • setOrderNumber

      void setOrderNumber(String orderNumber)

      Maps to Order.orderNumber, String that uniquely identifies an order. It should be unique across a project. Once it's set it cannot be changed.

      Parameters:
      orderNumber - value to be set
    • setCustomer

      void setCustomer(CustomerKeyReference customer)
      set customer
      Parameters:
      customer - value to be set
    • setCustomerEmail

      void setCustomerEmail(String customerEmail)

      Maps to Order.customerEmail.

      Parameters:
      customerEmail - value to be set
    • setLineItems

      void setLineItems(LineItemImportDraft... lineItems)

      Maps to Order.lineItems.

      Parameters:
      lineItems - values to be set
    • setLineItems

      void setLineItems(List<LineItemImportDraft> lineItems)

      Maps to Order.lineItems.

      Parameters:
      lineItems - values to be set
    • setCustomLineItems

      void setCustomLineItems(CustomLineItemDraft... customLineItems)

      Maps to Order.customLineItems

      Parameters:
      customLineItems - values to be set
    • setCustomLineItems

      void setCustomLineItems(List<CustomLineItemDraft> customLineItems)

      Maps to Order.customLineItems

      Parameters:
      customLineItems - values to be set
    • setTotalPrice

      void setTotalPrice(TypedMoney totalPrice)

      Maps to Order.totalPrice.

      Parameters:
      totalPrice - value to be set
    • setTaxedPrice

      void setTaxedPrice(TaxedPrice taxedPrice)

      Maps to Order.taxedPrice.

      Parameters:
      taxedPrice - value to be set
    • setShippingAddress

      void setShippingAddress(Address shippingAddress)

      Maps to Order.shippingAddress.

      Parameters:
      shippingAddress - value to be set
    • setBillingAddress

      void setBillingAddress(Address billingAddress)

      Maps to Order.billingAddress.

      Parameters:
      billingAddress - value to be set
    • setCustomerGroup

      void setCustomerGroup(CustomerGroupKeyReference customerGroup)

      Maps to Order.customerGroup.

      Parameters:
      customerGroup - value to be set
    • setCountry

      void setCountry(String country)

      Maps to Order.country.

      Parameters:
      country - value to be set
    • setOrderState

      void setOrderState(OrderState orderState)

      Maps to Order.orderState.

      Parameters:
      orderState - value to be set
    • setShipmentState

      void setShipmentState(ShipmentState shipmentState)

      Maps to Order.shipmentState.

      Parameters:
      shipmentState - value to be set
    • setPaymentState

      void setPaymentState(PaymentState paymentState)

      Maps to Order.paymentState.

      Parameters:
      paymentState - value to be set
    • setShippingInfo

      void setShippingInfo(ShippingInfoImportDraft shippingInfo)

      Maps to Order.shippingInfo.

      Parameters:
      shippingInfo - value to be set
    • setCompletedAt

      void setCompletedAt(ZonedDateTime completedAt)

      Maps to Order.completedAt.

      Parameters:
      completedAt - value to be set
    • setCustom

      void setCustom(Custom custom)

      Maps to Order.custom.

      Parameters:
      custom - value to be set
    • setInventoryMode

      void setInventoryMode(InventoryMode inventoryMode)

      Maps to Order.inventoryMode.

      Parameters:
      inventoryMode - value to be set
    • setTaxRoundingMode

      void setTaxRoundingMode(RoundingMode taxRoundingMode)

      Maps to Order.taxRoundingMode.

      Parameters:
      taxRoundingMode - value to be set
    • setTaxCalculationMode

      void setTaxCalculationMode(TaxCalculationMode taxCalculationMode)

      Maps to Order.taxCalculationMode.

      Parameters:
      taxCalculationMode - value to be set
    • setOrigin

      void setOrigin(CartOrigin origin)

      Maps to Order.origin.

      Parameters:
      origin - value to be set
    • setItemShippingAddresses

      void setItemShippingAddresses(Address... itemShippingAddresses)

      Maps to Order.itemShippingAddresses.

      Parameters:
      itemShippingAddresses - values to be set
    • setItemShippingAddresses

      void setItemShippingAddresses(List<Address> itemShippingAddresses)

      Maps to Order.itemShippingAddresses.

      Parameters:
      itemShippingAddresses - values to be set
    • setStore

      void setStore(StoreKeyReference store)

      Reference to the Store in which the Order is associated. If referenced Store does not exist, the state of the ImportOperation will be set to unresolved until the necessary Store exists.

      Parameters:
      store - value to be set
    • setState

      void setState(StateKeyReference state)

      Reference to a State in a custom workflow.

      Parameters:
      state - value to be set
    • of

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

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

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

      static OrderImportBuilder builder()
      builder factory method for OrderImport
      Returns:
      builder
    • builder

      static OrderImportBuilder builder(OrderImport template)
      create builder for OrderImport instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withOrderImport

      default <T> T withOrderImport(Function<OrderImport,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<OrderImport> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference