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 Summary
Modifier and TypeMethodDescriptionstatic OrderImportBuilder
builder()
builder factory method for OrderImportstatic OrderImportBuilder
builder
(OrderImport template) create builder for OrderImport instancestatic OrderImport
deepCopy
(OrderImport template) factory method to create a deep copy of OrderImport@Valid Address
Maps toOrder.billingAddress
.Maps toOrder.completedAt
.Maps toOrder.country
.@Valid Custom
Maps toOrder.custom
.@Valid CustomerKeyReference
Maps toOrder.customerEmail
.@Valid CustomerGroupKeyReference
Maps toOrder.customerGroup
.@Valid List<CustomLineItemDraft>
Maps toOrder.customLineItems
Maps toOrder.inventoryMode
.Maps toOrder.itemShippingAddresses
.@Valid List<LineItemImportDraft>
Maps toOrder.lineItems
.@NotNull String
Maps toOrder.orderNumber
, String that uniquely identifies an order.Maps toOrder.orderState
.Maps toOrder.origin
.Maps toOrder.paymentState
.Maps toOrder.shipmentState
.@Valid Address
Maps toOrder.shippingAddress
.@Valid ShippingInfoImportDraft
Maps toOrder.shippingInfo
.@Valid StateKeyReference
getState()
Reference to a State in a custom workflow.@Valid StoreKeyReference
getStore()
Reference to the Store in which the Order is associated.Maps toOrder.taxCalculationMode
.@Valid TaxedPrice
Maps toOrder.taxedPrice
.Maps toOrder.taxRoundingMode
.@NotNull @Valid TypedMoney
Maps toOrder.totalPrice
.static OrderImport
of()
factory methodstatic OrderImport
of
(OrderImport template) factory method to create a shallow copy OrderImportvoid
setBillingAddress
(Address billingAddress) Maps toOrder.billingAddress
.void
setCompletedAt
(ZonedDateTime completedAt) Maps toOrder.completedAt
.void
setCountry
(String country) Maps toOrder.country
.void
Maps toOrder.custom
.void
setCustomer
(CustomerKeyReference customer) set customervoid
setCustomerEmail
(String customerEmail) Maps toOrder.customerEmail
.void
setCustomerGroup
(CustomerGroupKeyReference customerGroup) Maps toOrder.customerGroup
.void
setCustomLineItems
(CustomLineItemDraft... customLineItems) Maps toOrder.customLineItems
void
setCustomLineItems
(List<CustomLineItemDraft> customLineItems) Maps toOrder.customLineItems
void
setInventoryMode
(InventoryMode inventoryMode) Maps toOrder.inventoryMode
.void
setItemShippingAddresses
(Address... itemShippingAddresses) Maps toOrder.itemShippingAddresses
.void
setItemShippingAddresses
(List<Address> itemShippingAddresses) Maps toOrder.itemShippingAddresses
.void
setLineItems
(LineItemImportDraft... lineItems) Maps toOrder.lineItems
.void
setLineItems
(List<LineItemImportDraft> lineItems) Maps toOrder.lineItems
.void
setOrderNumber
(String orderNumber) Maps toOrder.orderNumber
, String that uniquely identifies an order.void
setOrderState
(OrderState orderState) Maps toOrder.orderState
.void
setOrigin
(CartOrigin origin) Maps toOrder.origin
.void
setPaymentState
(PaymentState paymentState) Maps toOrder.paymentState
.void
setShipmentState
(ShipmentState shipmentState) Maps toOrder.shipmentState
.void
setShippingAddress
(Address shippingAddress) Maps toOrder.shippingAddress
.void
setShippingInfo
(ShippingInfoImportDraft shippingInfo) Maps toOrder.shippingInfo
.void
setState
(StateKeyReference state) Reference to a State in a custom workflow.void
setStore
(StoreKeyReference store) Reference to the Store in which the Order is associated.void
setTaxCalculationMode
(TaxCalculationMode taxCalculationMode) Maps toOrder.taxCalculationMode
.void
setTaxedPrice
(TaxedPrice taxedPrice) Maps toOrder.taxedPrice
.void
setTaxRoundingMode
(RoundingMode taxRoundingMode) Maps toOrder.taxRoundingMode
.void
setTotalPrice
(TypedMoney totalPrice) Maps toOrder.totalPrice
.static com.fasterxml.jackson.core.type.TypeReference<OrderImport>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withOrderImport
(Function<OrderImport, T> helper) accessor map function
-
Method Details
-
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
- Returns:
- customer
-
getCustomerEmail
String getCustomerEmail()Maps to
Order.customerEmail
.- Returns:
- customerEmail
-
getLineItems
Maps to
Order.lineItems
.- Returns:
- lineItems
-
getCustomLineItems
Maps to
Order.customLineItems
- Returns:
- customLineItems
-
getTotalPrice
Maps to
Order.totalPrice
.- Returns:
- totalPrice
-
getTaxedPrice
Maps to
Order.taxedPrice
.- Returns:
- taxedPrice
-
getShippingAddress
Maps to
Order.shippingAddress
.- Returns:
- shippingAddress
-
getBillingAddress
Maps to
Order.billingAddress
.- Returns:
- billingAddress
-
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
Maps to
Order.shippingInfo
.- Returns:
- shippingInfo
-
getCompletedAt
ZonedDateTime getCompletedAt()Maps to
Order.completedAt
.- Returns:
- completedAt
-
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
Maps to
Order.itemShippingAddresses
.- Returns:
- itemShippingAddresses
-
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 tounresolved
until the necessary Store exists.- Returns:
- store
-
getState
Reference to a State in a custom workflow.
- Returns:
- state
-
setOrderNumber
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
set customer- Parameters:
customer
- value to be set
-
setCustomerEmail
Maps to
Order.customerEmail
.- Parameters:
customerEmail
- value to be set
-
setLineItems
Maps to
Order.lineItems
.- Parameters:
lineItems
- values to be set
-
setLineItems
Maps to
Order.lineItems
.- Parameters:
lineItems
- values to be set
-
setCustomLineItems
Maps to
Order.customLineItems
- Parameters:
customLineItems
- values to be set
-
setCustomLineItems
Maps to
Order.customLineItems
- Parameters:
customLineItems
- values to be set
-
setTotalPrice
Maps to
Order.totalPrice
.- Parameters:
totalPrice
- value to be set
-
setTaxedPrice
Maps to
Order.taxedPrice
.- Parameters:
taxedPrice
- value to be set
-
setShippingAddress
Maps to
Order.shippingAddress
.- Parameters:
shippingAddress
- value to be set
-
setBillingAddress
Maps to
Order.billingAddress
.- Parameters:
billingAddress
- value to be set
-
setCustomerGroup
Maps to
Order.customerGroup
.- Parameters:
customerGroup
- value to be set
-
setCountry
Maps to
Order.country
.- Parameters:
country
- value to be set
-
setOrderState
Maps to
Order.orderState
.- Parameters:
orderState
- value to be set
-
setShipmentState
Maps to
Order.shipmentState
.- Parameters:
shipmentState
- value to be set
-
setPaymentState
Maps to
Order.paymentState
.- Parameters:
paymentState
- value to be set
-
setShippingInfo
Maps to
Order.shippingInfo
.- Parameters:
shippingInfo
- value to be set
-
setCompletedAt
Maps to
Order.completedAt
.- Parameters:
completedAt
- value to be set
-
setCustom
Maps to
Order.custom
.- Parameters:
custom
- value to be set
-
setInventoryMode
Maps to
Order.inventoryMode
.- Parameters:
inventoryMode
- value to be set
-
setTaxRoundingMode
Maps to
Order.taxRoundingMode
.- Parameters:
taxRoundingMode
- value to be set
-
setTaxCalculationMode
Maps to
Order.taxCalculationMode
.- Parameters:
taxCalculationMode
- value to be set
-
setOrigin
Maps to
Order.origin
.- Parameters:
origin
- value to be set
-
setItemShippingAddresses
Maps to
Order.itemShippingAddresses
.- Parameters:
itemShippingAddresses
- values to be set
-
setItemShippingAddresses
Maps to
Order.itemShippingAddresses
.- Parameters:
itemShippingAddresses
- values to be set
-
setStore
Reference to the Store in which the Order is associated. If referenced Store does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary Store exists.- Parameters:
store
- value to be set
-
setState
Reference to a State in a custom workflow.
- Parameters:
state
- value to be set
-
of
factory method- Returns:
- instance of OrderImport
-
of
factory method to create a shallow copy OrderImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of OrderImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for OrderImport- Returns:
- builder
-
builder
create builder for OrderImport instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withOrderImport
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-