Class OrderItem

Defines extensions to ProductLineItems and ShippingLineItems belonging to an order.

The order-item can be accessed using ProductLineItem.getOrderItem() or ShippingLineItem.getOrderItem() - these methods return null if the item is associated with a basket rather than an order. Alternative access is available using Order.getOrderItem(String) by passing the itemID used to identify the order-item in for example export files. The associated order-item can also be accessed from invoice-items, shipping-order-items, return-items and return-case-items using AbstractItem.getOrderItem().

The order-item provides an item-level status and type, methods for accessing and creating associated items, and methods used to allocate inventory for shipping-order creation.

Order post-processing APIs (gillian) are now inactive by default and will throw an exception if accessed. Activation needs preliminary approval by Product Management. Please contact support in this case. Existing customers using these APIs are not affected by this change and can use the APIs until further notice.

Constant Summary 

ConstantDescription
STATUS_BACKORDER: String = “BACKORDER”Constant for Order Item Status BACKORDER
STATUS_CANCELLED: String = “CANCELLED”Constant for Order Item Status CANCELLED
STATUS_CONFIRMED: String = “CONFIRMED”Constant for Order Item Status CONFIRMED
STATUS_CREATED: String = “CREATED”Constant for Order Item Status CREATED
STATUS_NEW: String = “NEW”Constant for Order Item Status NEW
STATUS_OPEN: String = “OPEN”Constant for Order Item Status OPEN
STATUS_SHIPPED: String = “SHIPPED”Constant for Order Item Status SHIPPED
STATUS_WAREHOUSE: String = “WAREHOUSE”Constant for Order Item Status WAREHOUSE
TYPE_PRODUCT: String = “PRODUCT”Constant for Order Item Type PRODUCT
TYPE_SERVICE: String = “SERVICE”Constant for Order Item Type SERVICE

Property Summary 

PropertyDescription
appeasedAmount: Money (read-only)Sum of amounts appeased for this item, calculated by iterating over invoice items associated with the item.
capturedAmount: Money (read-only)Sum of amounts captured for this item, calculated by iterating over invoice items associated with the item.
invoiceItems: Collection (read-only)Returns all invoice items associated with this item, each InvoiceItem will belong to a different Invoice, which can also be accessed using Order.getInvoices() or Order.getInvoice(String).
itemID: String (read-only)The itemID used to identify the OrderItem.
lineItem: LineItem (read-only)Returns the line item which is being extended by this instance.
refundedAmount: Money (read-only)Sum of amounts refunded for this item, calculated by iterating over invoice items associated with the item.
returnCaseItems: Collection (read-only)Returns all return case items associated with this item, each ReturnCaseItem will belong to a different ReturnCase, which can also be accessed using Order.getReturnCases() or Order.getReturnCase(String).
returnedQuantity: Quantity (read-only)The quantity returned, dynamically sum of quantities held by associated ReturnItems.
shippingOrderItem: ShippingOrderItem (read-only)The last added non-cancelled shipping order item if one exists, otherwise null.
shippingOrderItems: Collection (read-only)Returns a collection of the ShippingOrderItems created for this item.
splitItems: Collection (read-only)Returns a collection of all split OrderItems associated with this item.
splitSourceItem: OrderItem (read-only)Returns the split source item associated with this item, if existing.
status: EnumValueGets the order item status.
The possible values are:
type: EnumValue (read-only)Returns the type of line item with which this instance is associated, one of

Constructor Summary 

This class does not have a constructor, so you cannot create it directly.

Method Summary 

MethodDescription
allocateInventory(Boolean)Please note that this method is disabled by default.
getAppeasedAmount()Sum of amounts appeased for this item, calculated by iterating over invoice items associated with the item.
getCapturedAmount()Sum of amounts captured for this item, calculated by iterating over invoice items associated with the item.
getInvoiceItems()Returns all invoice items associated with this item, each InvoiceItem will belong to a different Invoice, which can also be accessed using Order.getInvoices() or Order.getInvoice(String).
getItemID()The itemID used to identify the OrderItem.
getLineItem()Returns the line item which is being extended by this instance.
getRefundedAmount()Sum of amounts refunded for this item, calculated by iterating over invoice items associated with the item.
getReturnCaseItems()Returns all return case items associated with this item, each ReturnCaseItem will belong to a different ReturnCase, which can also be accessed using Order.getReturnCases() or Order.getReturnCase(String).
getReturnedQuantity()The quantity returned, dynamically sum of quantities held by associated ReturnItems.
getShippingOrderItem()The last added non-cancelled shipping order item if one exists, otherwise null.
getShippingOrderItems()Returns a collection of the ShippingOrderItems created for this item.
getShippingOrderItems(Boolean)Returns a collection of the ShippingOrderItems created for this item.
getSplitItems()Returns a collection of all split OrderItems associated with this item.
getSplitSourceItem()Returns the split source item associated with this item, if existing.
getStatus()Gets the order item status.
The possible values are:
getType()Returns the type of line item with which this instance is associated, one of
setStatus(String)Set the status of the order item, use one of the values documented in getStatus().

Methods inherited from class Object 

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

Constant Details 

STATUS_BACKORDER 

STATUS_BACKORDER: String = "BACKORDER"

Constant for Order Item Status BACKORDER


STATUS_CANCELLED 

STATUS_CANCELLED: String = "CANCELLED"

Constant for Order Item Status CANCELLED


STATUS_CONFIRMED 

STATUS_CONFIRMED: String = "CONFIRMED"

Constant for Order Item Status CONFIRMED


STATUS_CREATED 

STATUS_CREATED: String = "CREATED"

Constant for Order Item Status CREATED


STATUS_NEW 

STATUS_NEW: String = "NEW"

Constant for Order Item Status NEW


STATUS_OPEN 

STATUS_OPEN: String = "OPEN"

Constant for Order Item Status OPEN


STATUS_SHIPPED 

STATUS_SHIPPED: String = "SHIPPED"

Constant for Order Item Status SHIPPED


STATUS_WAREHOUSE 

STATUS_WAREHOUSE: String = "WAREHOUSE"

Constant for Order Item Status WAREHOUSE


TYPE_PRODUCT 

TYPE_PRODUCT: String = "PRODUCT"

Constant for Order Item Type PRODUCT


TYPE_SERVICE 

TYPE_SERVICE: String = "SERVICE"

Constant for Order Item Type SERVICE


Property Details 

appeasedAmount 

appeasedAmount: Money (read-only)

Sum of amounts appeased for this item, calculated by iterating over invoice items associated with the item.


capturedAmount 

capturedAmount: Money (read-only)

Sum of amounts captured for this item, calculated by iterating over invoice items associated with the item.


invoiceItems 

invoiceItems: Collection (read-only)

Returns all invoice items associated with this item, each InvoiceItem will belong to a different Invoice, which can also be accessed using Order.getInvoices() or Order.getInvoice(String).


itemID 

itemID: String (read-only)

The itemID used to identify the OrderItem. Note this is not a UUID, it is created internally when the OrderItem instance is created, and is typically used within export files to identify the item.


lineItem 

lineItem: LineItem (read-only)

Returns the line item which is being extended by this instance.


refundedAmount 

refundedAmount: Money (read-only)

Sum of amounts refunded for this item, calculated by iterating over invoice items associated with the item.


returnCaseItems 

returnCaseItems: Collection (read-only)

Returns all return case items associated with this item, each ReturnCaseItem will belong to a different ReturnCase, which can also be accessed using Order.getReturnCases() or Order.getReturnCase(String).


returnedQuantity 

returnedQuantity: Quantity (read-only)

The quantity returned, dynamically sum of quantities held by associated ReturnItems.


shippingOrderItem 

shippingOrderItem: ShippingOrderItem (read-only)

The last added non-cancelled shipping order item if one exists, otherwise null.

Multiple shipping order items that are not in status ShippingOrderItem.STATUS_CANCELLED can exist for one OrderItem, for example if the OrderItem has been split for shipping purposes. The method returns null if no non-cancelled shipping order item exists.


shippingOrderItems 

shippingOrderItems: Collection (read-only)

Returns a collection of the ShippingOrderItems created for this item. ShippingOrder items represents the whole or part of this item which could be delivered, and belong to a shipping order. Note that the cancelled shipping order items are returned too. This method is equivalent to getShippingOrderItems(Boolean) called with parameter true.


splitItems 

splitItems: Collection (read-only)

Returns a collection of all split OrderItems associated with this item. Inverse relation to getSplitSourceItem().

Split order items are created when


splitSourceItem 

splitSourceItem: OrderItem (read-only)

Returns the split source item associated with this item, if existing. Inverse relation to getSplitItems().

A split source item is associated after the successful creation of a split item with a quantity less than the existing quantity of the item to split. For details see getSplitItems().


status 

status: EnumValue

Gets the order item status.

The possible values are:


type 

type: EnumValue (read-only)

Returns the type of line item with which this instance is associated, one of


Method Details 

allocateInventory(Boolean) 

allocateInventory(partialAllocation: Boolean): Quantity

Please note that this method is disabled by default. Please contact support for enabling it.

Attempts to allocate inventory for the item and returns the quantity that could be allocated or null if no allocation was possible.

All option product line items are allocated with their parent. Note that for items with option product line items no partial allocation is possible. That means the partialAllocation parameter will in this case always be considered as false

Parameters:

  • partialAllocation - <li>true accept a partial allocation as a result. Partial allocation is only possible when no option product line items are included,</li> <li>false only full allocation will be used, partial allocation will be released automatically</li> </ul>

Returns:

  • successful: the newly allocated quantity
  • failed: null

getAppeasedAmount() 

getAppeasedAmount(): Money

Sum of amounts appeased for this item, calculated by iterating over invoice items associated with the item.

Returns:

  • Sum of amounts refunded for this item

getCapturedAmount() 

getCapturedAmount(): Money

Sum of amounts captured for this item, calculated by iterating over invoice items associated with the item.

Returns:

  • Sum of amounts captured for this item

getInvoiceItems() 

getInvoiceItems(): Collection

Returns all invoice items associated with this item, each InvoiceItem will belong to a different Invoice, which can also be accessed using Order.getInvoices() or Order.getInvoice(String).

Returns:

  • invoice items associated with this item

getItemID() 

getItemID(): String

The itemID used to identify the OrderItem. Note this is not a UUID, it is created internally when the OrderItem instance is created, and is typically used within export files to identify the item.

Returns:

  • the itemID of the OrderItem

getLineItem() 

getLineItem(): LineItem

Returns the line item which is being extended by this instance.

Returns:

  • the line item associated with this instance

getRefundedAmount() 

getRefundedAmount(): Money

Sum of amounts refunded for this item, calculated by iterating over invoice items associated with the item.

Returns:

  • Sum of amounts refunded for this item

getReturnCaseItems() 

getReturnCaseItems(): Collection

Returns all return case items associated with this item, each ReturnCaseItem will belong to a different ReturnCase, which can also be accessed using Order.getReturnCases() or Order.getReturnCase(String).

Returns:

  • return case items associated with this item

getReturnedQuantity() 

getReturnedQuantity(): Quantity

The quantity returned, dynamically sum of quantities held by associated ReturnItems.

Returns:

  • quantity returned, the sum of quantities held by associated ReturnItems

getShippingOrderItem() 

getShippingOrderItem(): ShippingOrderItem

The last added non-cancelled shipping order item if one exists, otherwise null.

Multiple shipping order items that are not in status ShippingOrderItem.STATUS_CANCELLED can exist for one OrderItem, for example if the OrderItem has been split for shipping purposes. The method returns null if no non-cancelled shipping order item exists.

Returns:

  • the last not cancelled shipping order item or null

getShippingOrderItems() 

getShippingOrderItems(): Collection

Returns a collection of the ShippingOrderItems created for this item. ShippingOrder items represents the whole or part of this item which could be delivered, and belong to a shipping order. Note that the cancelled shipping order items are returned too. This method is equivalent to getShippingOrderItems(Boolean) called with parameter true.

Returns:

  • collection of the shipping order items created for this item

getShippingOrderItems(Boolean) 

getShippingOrderItems(includeCancelled: Boolean): Collection

Returns a collection of the ShippingOrderItems created for this item. ShippingOrder items represent the whole or part of this item which could be delivered, and belong to a shipping order. Depending on the includeCancelled parameter the cancelled shipping order items will be returned or not.

Parameters:

  • includeCancelled - <li>true all shipping order items, including the cancelled, created for this item will be returned</li> <li>false only non-cancelled shipping order items created for this item will be returned</li> </ul>

Returns:

  • collection of the shipping order items created for this item

getSplitItems() 

getSplitItems(): Collection

Returns a collection of all split OrderItems associated with this item. Inverse relation to getSplitSourceItem().

Split order items are created when

Returns:

  • the split order items associated with this item

getSplitSourceItem() 

getSplitSourceItem(): OrderItem

Returns the split source item associated with this item, if existing. Inverse relation to getSplitItems().

A split source item is associated after the successful creation of a split item with a quantity less than the existing quantity of the item to split. For details see getSplitItems().

Returns:

  • the split source item or null

getStatus() 

getStatus(): EnumValue

Gets the order item status.

The possible values are:

Returns:

  • the status

getType() 

getType(): EnumValue

Returns the type of line item with which this instance is associated, one of

Returns:


setStatus(String) 

setStatus(status: String): void

Set the status of the order item, use one of the values documented in getStatus().

If the order item has a related shipping order item (see getShippingOrderItem()) the status of the shipping order item will be adjusted to the same status. Setting the status of an order item might also change the status of the related order. The following rules apply in top-down order:

Parameters:

  • status - status string matching one of the values for status