dw.order
Class Order
Object
dw.object.PersistentObject
dw.object.ExtensibleObject
dw.order.LineItemCtnr
dw.order.Order
The Order class represents an order.
Constants
CONFIRMATION_STATUS_CONFIRMED  :  Number = 2
constant for when Confirmation Status is Confirmed
CONFIRMATION_STATUS_NOTCONFIRMED  :  Number = 0
constant for when Confirmation Status is Not Confirmed
EXPORT_STATUS_EXPORTED  :  Number = 1
constant for when Export Status is Exported
EXPORT_STATUS_FAILED  :  Number = 3
constant for when Export Status is Failed
EXPORT_STATUS_NOTEXPORTED  :  Number = 0
constant for when Export Status is Not Exported
EXPORT_STATUS_READY  :  Number = 2
constant for when Export Status is ready to be exported.
ORDER_STATUS_CANCELLED  :  Number = 6
constant for when Order Status is Cancelled
ORDER_STATUS_COMPLETED  :  Number = 5
constant for when Order Status is Completed
ORDER_STATUS_CREATED  :  Number = 0
constant for when Order Status is Created
ORDER_STATUS_FAILED  :  Number = 8
constant for when Order Status is Failed
ORDER_STATUS_NEW  :  Number = 3
constant for when Order Status is New
ORDER_STATUS_OPEN  :  Number = 4
constant for when Order Status is Open
ORDER_STATUS_REPLACED  :  Number = 7
constant for when Order Status is Replaced
PAYMENT_STATUS_NOTPAID  :  Number = 0
constant for when Payment Status is Not Paid
PAYMENT_STATUS_PAID  :  Number = 2
constant for when Payment Status is Paid
PAYMENT_STATUS_PARTPAID  :  Number = 1
constant for when Payment Status is Part Paid
SHIPPING_STATUS_NOTSHIPPED  :  Number = 0
constant for when Shipping Status is Not shipped
SHIPPING_STATUS_PARTSHIPPED  :  Number = 1
constant for when Shipping Status is Part Shipped
SHIPPING_STATUS_SHIPPED  :  Number = 2
constant for when Shipping Status is Shipped
Properties
affiliatePartnerID  :  String
The affiliate partner ID value, or null.
affiliatePartnerName  :  String
The affiliate partner name value, or null.
appeasementItems  :  FilteringCollection  (Read Only)
The collection of AppeasementItems associated with this order.
appeasements  :  FilteringCollection  (Read Only)
The collection of Appeasements associated with this order.
cancelCode  :  EnumValue
If this order was cancelled, returns the value of the cancel code or null.
cancelDescription  :  String
If this order was cancelled, returns the text describing why the order was cancelled or null.
capturedAmount  :  Money  (Read Only)
The sum of the captured amounts. The captured amounts are calculated on the fly. Associate a payment capture for an PaymentInstrument with an Invoice using Invoice.addCaptureTransaction(OrderPaymentInstrument, Money).
confirmationStatus  :  EnumValue
The confirmation status of the order.
Possible values are CONFIRMATION_STATUS_NOTCONFIRMED and CONFIRMATION_STATUS_CONFIRMED.
createdBy  :  String  (Read Only)
The name of the user who has created the order. If an agent user has created the order, the agent user's name is returned. Otherwise "Customer" is returned.
currentOrder  :  Order  (Read Only)
The current order. The current order represents the most recent order in a chain of orders. For example, if Order1 was replaced by Order2, Order2 is the current representation of the order and Order1 is the original representation of the order. If you replace Order2 with Order3, Order 3 is now the current order and Order1 is still the original representation of the order. If this order has not been replaced, this method returns this order because this order is the current order.
currentOrderNo  :  String  (Read Only)
The order number of the current order. The current order represents the most recent order in a chain of orders. For example, if Order1 was replaced by Order2, Order2 is the current representation of the order and Order1 is the original representation of the order. If you replace Order2 with Order3, Order 3 is now the current order and Order1 is still the original representation of the order. If this order has not been replaced, calling this method returns the same value as the getOrderNo() method because this order is the current order.
customerLocaleID  :  String  (Read Only)
The ID of the locale that was in effect when the order was placed. This is the customer's locale.
customerOrderReference  :  String
The customer-specific reference information for the order, or null.
exportAfter  :  Date
A date after which an order can be exported.
exportStatus  :  EnumValue
The export status of the order.
Possible values are: EXPORT_STATUS_NOTEXPORTED, EXPORT_STATUS_EXPORTED, EXPORT_STATUS_READY, and EXPORT_STATUS_FAILED.
externalOrderNo  :  String
The value of an external order number associated with this order, or null.
externalOrderStatus  :  String
The status of an external order associated with this order, or null.
externalOrderText  :  String
The text describing the external order, or null.
imported  :  boolean  (Read Only)
Returns true, if the order is imported and false otherwise.
invoiceItems  :  FilteringCollection  (Read Only)
The collection of InvoiceItems associated with this order.
invoiceNo  :  String
The invoice number for this Order.

When an order is placed (e.g. with OrderMgr.placeOrder(Order)) invoice number will be filled using a sequence. Before order was placed null will be returned unless it was set with setInvoiceNo(String).

invoices  :  FilteringCollection  (Read Only)
The collection of Invoices associated with this order.
orderNo  :  String  (Read Only)
The order number for this order.
orderToken  :  String  (Read Only)
The URL safe token for this order. The order token is a random string (length 32 bytes) associated with this one order. It should always be used in situations requiring order access to raise the level of qualification.
originalOrder  :  Order  (Read Only)
The original order associated with this order. The original order represents an order that was the first ancestor in a chain of orders. For example, if Order1 was replaced by Order2, Order2 is the current representation of the order and Order1 is the original representation of the order. If you replace Order2 with Order3, Order1 is still the original representation of the order. If this order is the first ancestor, this method returns this order.
originalOrderNo  :  String  (Read Only)
The order number of the original order associated with this order. The original order represents an order that was the first ancestor in a chain of orders. For example, if Order1 was replaced by Order2, Order2 is the current representation of the order and Order1 is the original representation of the order. If you replace Order2 with Order3, Order1 is still the original representation of the order. If this order is the first ancestor, this method returns the value of getOrderNo().
paymentStatus  :  EnumValue
The order payment status value.
Possible values are PAYMENT_STATUS_NOTPAID, PAYMENT_STATUS_PARTPAID or PAYMENT_STATUS_PAID.
paymentTransaction  :  PaymentTransaction  (Read Only)
The payment transaction associated with this order. It is possible that there are multiple payment transactions associated with the order. In this case, this method returns the transaction associated with the first PaymentInstrument returned by getPaymentInstruments().
Deprecated:
Use LineItemCtnr.getPaymentInstruments() to get the list of PaymentInstrument instances and then use getPaymentTransaction() method on each PaymentInstrument to access the individual transactions.
refundedAmount  :  Money  (Read Only)
The sum of the refunded amounts. The refunded amounts are calculated on the fly. Associate a payment refund for an PaymentInstrument with an Invoice using Invoice.addRefundTransaction(OrderPaymentInstrument, Money).
remoteHost  :  String  (Read Only)
The IP address of the remote host from which the order was created.

If the IP address was not captured for the order because order IP logging was disabled at the time the order was created, null will be returned.

replaceCode  :  EnumValue
If this order was replaced by another order, returns the value of the replace code. Otherwise. returns null.
replaceDescription  :  String
If this order was replaced by another order, returns the value of the replace description. Otherwise returns null.
replacedOrder  :  Order  (Read Only)
The order that this order replaced or null. For example, if you have three orders where Order1 was replaced by Order2 and Order2 was replaced by Order3, calling this method on Order3 will return Order2. Similarly, calling this method on Order1 will return null as Order1 was the original order.
replacedOrderNo  :  String  (Read Only)
The order number that this order replaced or null if this order did not replace an order. For example, if you have three orders where Order1 was replaced by Order2 and Order2 was replaced by Order3, calling this method on Order3 will return the order number for Order2. Similarly, calling this method on Order1 will return null as Order1 was the original order.
replacementOrder  :  Order  (Read Only)
The order that replaced this order, or null.
replacementOrderNo  :  String  (Read Only)
If this order was replaced by another order, returns the order number that replaced this order. Otherwise returns null.
returnCaseItems  :  FilteringCollection  (Read Only)
The collection of ReturnCaseItems associated with this order.
returnCases  :  FilteringCollection  (Read Only)
The collection of ReturnCases associated with this order.
returnItems  :  FilteringCollection  (Read Only)
The collection of ReturnItems associated with this order.
returns  :  FilteringCollection  (Read Only)
The collection of Returns associated with this order.
shippingOrderItems  :  FilteringCollection  (Read Only)
The collection of ShippingOrderItems associated with this order.
shippingOrders  :  FilteringCollection  (Read Only)
The collection of ShippingOrders associated with this order.
shippingStatus  :  EnumValue
The order shipping status.
Possible values are SHIPPING_STATUS_NOTSHIPPED, SHIPPING_STATUS_PARTSHIPPED or SHIPPING_STATUS_SHIPPED.
sourceCode  :  String  (Read Only)
The source code stored with the order or null if no source code is attached to the order.
sourceCodeGroup  :  SourceCodeGroup  (Read Only)
The source code group attached to the order or null if no source code group is attached to the order.
sourceCodeGroupID  :  String  (Read Only)
The source code group id stored with the order or null if no source code group is attached to the order.
status  :  EnumValue
The status of the order.
Possible values are:

The order status usually changes when a process action is initiated. Most status changes have an action which needs to executed in order to end having the order in a specific order status. When an order is created with e.g. OrderMgr.createOrder(Basket) the order status will be ORDER_STATUS_CREATED. The usual flow is that payment authorization will be added to the order. Once the order is considered as valid (payed, fraud checked, ...) the order gets placed. This can be done by calling OrderMgr.placeOrder(Order). The result of placing an order will be status ORDER_STATUS_OPEN (from a process standpoint ORDER_STATUS_NEW which has the same meaning). Status ORDER_STATUS_REPLACED is related to functionality BasketMgr.createBasketFromOrder(Order). ORDER_STATUS_COMPLETED has no meaning by default but can be used by custom implementations but is a synonym for NEW/OPEN. Below you will find the most important status changes:

Status beforeActionStatus afterBusiness meaning
-OrderMgr.createOrder(Basket)CREATEDOrder was created from a basket.
CREATEDOrderMgr.placeOrder(Order)OPEN/NEWOrder was considered as valid. Order can now be exported to 3rd party systems.
CREATEDOrderMgr.failOrder(Order)FAILEDOrder was considered not valid. E.g. payment authorization was wrong or fraud check was not successful.
OPEN/NEWOrderMgr.cancelOrder(Order)CANCELLEDOrder was cancelled.
CANCELLEDOrderMgr.undoCancelOrder(Order)OPEN/NEWOrder was cancelled by mistake and this needs to be undone.
FAILEDOrderMgr.undoFailOrder(Order)CREATEDOrder was failed by mistake and this needs to be undone.

Every status change will trigger a change in the order journal which is the base for GMV calculations.

Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
createAppeasement(appeasementNumber : String) : Appeasement
Creates a new Appeasement associated with this order.
createAppeasement() : Appeasement
Creates a new Appeasement associated with this order.
createReturnCase(returnCaseNumber : String, isRMA : boolean) : ReturnCase
Creates a new ReturnCase associated with this order specifying whether the ReturnCase is an RMA (return merchandise authorization).
createReturnCase(isRMA : boolean) : ReturnCase
Creates a new ReturnCase associated with this order specifying whether the ReturnCase is an RMA (return merchandise authorization).
createServiceItem(ID : String, status : String) : OrderItem
Returns the order item with the given status which wraps a new service item which is created and added to the order.
createShippingOrder() : ShippingOrder
Creates a new ShippingOrder for this order.
createShippingOrder(shippingOrderNumber : String) : ShippingOrder
Creates a new ShippingOrder for this order.
getAffiliatePartnerID() : String
Returns the affiliate partner ID value, or null.
getAffiliatePartnerName() : String
Returns the affiliate partner name value, or null.
getAppeasement(appeasementNumber : String) : Appeasement
Returns the Appeasement associated with this order with the given appeasementNumber.
getAppeasementItem(appeasementItemID : String) : AppeasementItem
Returns the AppeasementItem associated with this Order with the given appeasementItemID.
getAppeasementItems() : FilteringCollection
Returns the collection of AppeasementItems associated with this order.
getAppeasements() : FilteringCollection
Returns the collection of Appeasements associated with this order.
getCancelCode() : EnumValue
If this order was cancelled, returns the value of the cancel code or null.
getCancelDescription() : String
If this order was cancelled, returns the text describing why the order was cancelled or null.
getCapturedAmount() : Money
Returns the sum of the captured amounts.
getConfirmationStatus() : EnumValue
Returns the confirmation status of the order.
Possible values are CONFIRMATION_STATUS_NOTCONFIRMED and CONFIRMATION_STATUS_CONFIRMED.
getCreatedBy() : String
Returns the name of the user who has created the order.
getCurrentOrder() : Order
Returns the current order.
getCurrentOrderNo() : String
Returns the order number of the current order.
getCustomerLocaleID() : String
Returns the ID of the locale that was in effect when the order was placed.
getCustomerOrderReference() : String
Returns the customer-specific reference information for the order, or null.
getExportAfter() : Date
Returns a date after which an order can be exported.
getExportStatus() : EnumValue
Returns the export status of the order.
Possible values are: EXPORT_STATUS_NOTEXPORTED, EXPORT_STATUS_EXPORTED, EXPORT_STATUS_READY, and EXPORT_STATUS_FAILED.
getExternalOrderNo() : String
Returns the value of an external order number associated with this order, or null.
getExternalOrderStatus() : String
Returns the status of an external order associated with this order, or null.
getExternalOrderText() : String
Returns the text describing the external order, or null.
getInvoice(invoiceNumber : String) : Invoice
Returns the Invoice associated with this order with the given invoiceNumber.
getInvoiceItem(invoiceItemID : String) : InvoiceItem
Returns the InvoiceItem associated with this order with the given ID.
getInvoiceItems() : FilteringCollection
Returns the collection of InvoiceItems associated with this order.
getInvoiceNo() : String
Returns the invoice number for this Order.
getInvoices() : FilteringCollection
Returns the collection of Invoices associated with this order.
getOrderExportXML(encryptionMethod : String, encryptionKey : String, encryptUsingEKID : boolean) : String
Returns the order export XML as String object.
getOrderExportXML(encryptionMethod : String, encryptionKey : String) : String
Returns the order export XML as String object.
getOrderItem(itemID : String) : OrderItem
Returns the OrderItem for the itemID.
getOrderNo() : String
Returns the order number for this order.
getOrderToken() : String
Returns the URL safe token for this order.
getOriginalOrder() : Order
Returns the original order associated with this order.
getOriginalOrderNo() : String
Returns the order number of the original order associated with this order.
getPaymentStatus() : EnumValue
Returns the order payment status value.
Possible values are PAYMENT_STATUS_NOTPAID, PAYMENT_STATUS_PARTPAID or PAYMENT_STATUS_PAID.
getPaymentTransaction() : PaymentTransaction
Returns the payment transaction associated with this order.
getRefundedAmount() : Money
Returns the sum of the refunded amounts.
getRemoteHost() : String
Returns the IP address of the remote host from which the order was created.
getReplaceCode() : EnumValue
If this order was replaced by another order, returns the value of the replace code.
getReplaceDescription() : String
If this order was replaced by another order, returns the value of the replace description.
getReplacedOrder() : Order
Returns the order that this order replaced or null.
getReplacedOrderNo() : String
Returns the order number that this order replaced or null if this order did not replace an order.
getReplacementOrder() : Order
Returns the order that replaced this order, or null.
getReplacementOrderNo() : String
If this order was replaced by another order, returns the order number that replaced this order.
getReturn(returnNumber : String) : Return
Returns the Return associated with this order with the given returnNumber.
getReturnCase(returnCaseNumber : String) : ReturnCase
Returns the ReturnCase associated with this order with the given returnCaseNumber.
getReturnCaseItem(returnCaseItemID : String) : ReturnCaseItem
Returns the ReturnCaseItem associated with this order with the given returnCaseItemID.
getReturnCaseItems() : FilteringCollection
Returns the collection of ReturnCaseItems associated with this order.
getReturnCases() : FilteringCollection
Returns the collection of ReturnCases associated with this order.
getReturnItem(returnItemID : String) : ReturnItem
Returns the ReturnItem associated with this order with the given ID.
getReturnItems() : FilteringCollection
Returns the collection of ReturnItems associated with this order.
getReturns() : FilteringCollection
Returns the collection of Returns associated with this order.
getShippingOrder(shippingOrderNumber : String) : ShippingOrder
Returns the ShippingOrder associated with this order with the given shippingOrderNumber.
getShippingOrderItem(shippingOrderItemID : String) : ShippingOrderItem
Returns the ShippingOrderItem associated with this order with the given shippingOrderItemID.
getShippingOrderItems() : FilteringCollection
Returns the collection of ShippingOrderItems associated with this order.
getShippingOrders() : FilteringCollection
Returns the collection of ShippingOrders associated with this order.
getShippingStatus() : EnumValue
Returns the order shipping status.
Possible values are SHIPPING_STATUS_NOTSHIPPED, SHIPPING_STATUS_PARTSHIPPED or SHIPPING_STATUS_SHIPPED.
getSourceCode() : String
Returns the source code stored with the order or null if no source code is attached to the order.
getSourceCodeGroup() : SourceCodeGroup
Returns the source code group attached to the order or null if no source code group is attached to the order.
getSourceCodeGroupID() : String
Returns the source code group id stored with the order or null if no source code group is attached to the order.
isImported() : boolean
Returns true, if the order is imported and false otherwise.
reauthorize() : Status
Ensures that the order is authorized.
removeRemoteHost() : void
Removes the IP address of the remote host if stored.
setAffiliatePartnerID(affiliatePartnerID : String) : void
Sets the affiliate partner ID value.
setAffiliatePartnerName(affiliatePartnerName : String) : void
Sets the affiliate partner name value.
setCancelCode(cancelCode : String) : void
Sets the cancel code value.
setCancelDescription(cancelDescription : String) : void
Sets the description as to why the order was cancelled.
setConfirmationStatus(status : Number) : void
Sets the confirmation status value.
Possible values are CONFIRMATION_STATUS_NOTCONFIRMED or CONFIRMATION_STATUS_CONFIRMED.
setCustomer(customer : Customer) : void
This method is used to associate the order object with the specified customer object.
setCustomerNo(customerNo : String) : void
Sets the customer number of the customer associated with this container.
setCustomerOrderReference(reference : String) : void
Sets the customer-specific reference information for the order.
setExportAfter(date : Date) : void
Sets the date after which an order can be exported.
setExportStatus(status : Number) : void
Sets the export status of the order.
Possible values are: EXPORT_STATUS_NOTEXPORTED, EXPORT_STATUS_EXPORTED, EXPORT_STATUS_READY, and EXPORT_STATUS_FAILED.
setExternalOrderNo(externalOrderNo : String) : void
Sets the value of an external order number associated with this order
setExternalOrderStatus(status : String) : void
Sets the status of an external order associated with this order
setExternalOrderText(text : String) : void
Sets the text describing the external order.
setInvoiceNo(invoiceNumber : String) : void
Sets the invoice number for this Order.
setOrderStatus(status : Number) : void
Sets the order status.
setPaymentStatus(status : Number) : void
Sets the order payment status.
Possible values are PAYMENT_STATUS_NOTPAID, PAYMENT_STATUS_PARTPAID or PAYMENT_STATUS_PAID.
setReplaceCode(replaceCode : String) : void
Sets the value of the replace code.
setReplaceDescription(replaceDescription : String) : void
Sets the value of the replace description.
setShippingStatus(status : Number) : void
Sets the order shipping status value.
Possible values are SHIPPING_STATUS_NOTSHIPPED, SHIPPING_STATUS_PARTSHIPPED or SHIPPING_STATUS_SHIPPED.
setStatus(status : Number) : void
Sets the status of the order.
trackOrderChange(text : String) : Note
Tracks an order change.
Methods inherited from class LineItemCtnr
addNote, createBillingAddress, createBonusProductLineItem, createCouponLineItem, createCouponLineItem, createGiftCertificateLineItem, createGiftCertificatePaymentInstrument, createPaymentInstrument, createPaymentInstrumentFromWallet, createPriceAdjustment, createPriceAdjustment, createProductLineItem, createProductLineItem, createProductLineItem, createProductLineItem, createShipment, createShippingPriceAdjustment, getAdjustedMerchandizeTotalGrossPrice, getAdjustedMerchandizeTotalNetPrice, getAdjustedMerchandizeTotalPrice, getAdjustedMerchandizeTotalPrice, getAdjustedMerchandizeTotalTax, getAdjustedShippingTotalGrossPrice, getAdjustedShippingTotalNetPrice, getAdjustedShippingTotalPrice, getAdjustedShippingTotalTax, getAllGiftCertificateLineItems, getAllLineItems, getAllProductLineItems, getAllProductLineItems, getAllProductQuantities, getAllShippingPriceAdjustments, getBillingAddress, getBonusDiscountLineItems, getBonusLineItems, getBusinessType, getChannelType, getCouponLineItem, getCouponLineItems, getCurrencyCode, getCustomer, getCustomerEmail, getCustomerName, getCustomerNo, getDefaultShipment, getEtag, getGiftCertificateLineItems, getGiftCertificateLineItems, getGiftCertificatePaymentInstruments, getGiftCertificatePaymentInstruments, getGiftCertificateTotalGrossPrice, getGiftCertificateTotalNetPrice, getGiftCertificateTotalPrice, getGiftCertificateTotalTax, getMerchandizeTotalGrossPrice, getMerchandizeTotalNetPrice, getMerchandizeTotalPrice, getMerchandizeTotalTax, getNotes, getPaymentInstrument, getPaymentInstruments, getPaymentInstruments, getPriceAdjustmentByPromotionID, getPriceAdjustments, getProductLineItems, getProductLineItems, getProductQuantities, getProductQuantities, getProductQuantityTotal, getShipment, getShipments, getShippingPriceAdjustmentByPromotionID, getShippingPriceAdjustments, getShippingTotalGrossPrice, getShippingTotalNetPrice, getShippingTotalPrice, getShippingTotalTax, getTotalGrossPrice, getTotalNetPrice, getTotalTax, removeAllPaymentInstruments, removeBonusDiscountLineItem, removeCouponLineItem, removeGiftCertificateLineItem, removeNote, removePaymentInstrument, removePriceAdjustment, removeProductLineItem, removeShipment, removeShippingPriceAdjustment, setCustomerEmail, setCustomerName, updateOrderLevelPriceAdjustmentTax, updateTotals, verifyPriceAdjustmentLimits
Methods inherited from class ExtensibleObject
Methods inherited from class PersistentObject
Methods inherited from class Object
Method Detail
createAppeasement
createAppeasement(appeasementNumber : String) : Appeasement
Creates a new Appeasement associated with this order.

An appeasementNumber must be specified.

If an Appeasement already exists for the appeasementNumber, the method fails with an exception.

Parameters:
appeasementNumber - the appeasementNumber to be assigned to the newly created appeasement
Returns:
the created appeasement
Throws:
IllegalArgumentException - if an Appeasement already exists with the number.

createAppeasement
createAppeasement() : Appeasement
Creates a new Appeasement associated with this order. The new Appeasement will have an appeasementNumber based on the getOrderNo().
Returns:
the created appeasement

createReturnCase
createReturnCase(returnCaseNumber : String, isRMA : boolean) : ReturnCase
Creates a new ReturnCase associated with this order specifying whether the ReturnCase is an RMA (return merchandise authorization).

A returnCaseNumber must be specified.

If a ReturnCase already exists for the returnCaseNumber, the method fails with an exception.

Parameters:
returnCaseNumber - returnCaseNumber to use
isRMA - whether the new ReturnCase is an RMA (return merchandise authorization)
Returns:
null or the ReturnCase associated with the given returnCaseNumber
Throws:
IllegalArgumentException - if a ReturnCase already exists with the number.

createReturnCase
createReturnCase(isRMA : boolean) : ReturnCase
Creates a new ReturnCase associated with this order specifying whether the ReturnCase is an RMA (return merchandise authorization).

The new ReturnCase will have a returnCaseNumber based on the getOrderNo(), e.g. for an order-no 1234 the return cases will have the numbers 1234#RC1, 1234#RC2, 1234#RC3...

Parameters:
isRMA - whether the new ReturnCase is an RMA (return merchandise authorization)
Returns:
the created ReturnCase

createServiceItem
createServiceItem(ID : String, status : String) : OrderItem
Returns the order item with the given status which wraps a new service item which is created and added to the order.
Parameters:
ID - the ID of the new service item.
This ID will be returned when ShippingLineItem.getID() is called.
status - the status of the order item, use one of
Returns:
the created order item

createShippingOrder
createShippingOrder() : ShippingOrder
Creates a new ShippingOrder for this order.

Generates a default shipping order number. Use createShippingOrder(String) for a defined shipping order number.

Returns:
the created shipping order
See Also:

createShippingOrder
createShippingOrder(shippingOrderNumber : String) : ShippingOrder
Creates a new ShippingOrder for this order.

Parameters:
shippingOrderNumber - the document number to be used
Returns:
the created shipping order
See Also:

getAffiliatePartnerID
getAffiliatePartnerID() : String
Returns the affiliate partner ID value, or null.
Returns:
the affiliate partner ID value, or null.

getAffiliatePartnerName
getAffiliatePartnerName() : String
Returns the affiliate partner name value, or null.
Returns:
the affiliate partner name value, or null.

getAppeasement
getAppeasement(appeasementNumber : String) : Appeasement
Returns the Appeasement associated with this order with the given appeasementNumber. The method returns null if no instance can be found.
Parameters:
appeasementNumber - the appeasement number
Returns:
the Appeasement associated with the given appeasementNumber

getAppeasementItem
getAppeasementItem(appeasementItemID : String) : AppeasementItem
Returns the AppeasementItem associated with this Order with the given appeasementItemID. The method returns null if no instance can be found.
Parameters:
appeasementItemID - the ID
Returns:
the AppeasementItem associated with the given appeasementItemID.

getAppeasementItems
getAppeasementItems() : FilteringCollection
Returns the collection of AppeasementItems associated with this order.
Returns:
the appeasement items belonging to this order

getAppeasements
getAppeasements() : FilteringCollection
Returns the collection of Appeasements associated with this order.
Returns:
the appeasements associated with this order

getCancelCode
getCancelCode() : EnumValue
If this order was cancelled, returns the value of the cancel code or null.
Returns:
the value of the cancel code.

getCancelDescription
getCancelDescription() : String
If this order was cancelled, returns the text describing why the order was cancelled or null.
Returns:
the description as to why the order was cancelled or null.

getCapturedAmount
getCapturedAmount() : Money
Returns the sum of the captured amounts. The captured amounts are calculated on the fly. Associate a payment capture for an PaymentInstrument with an Invoice using Invoice.addCaptureTransaction(OrderPaymentInstrument, Money).
Returns:
sum of captured amounts

getConfirmationStatus
getConfirmationStatus() : EnumValue
Returns the confirmation status of the order.
Possible values are CONFIRMATION_STATUS_NOTCONFIRMED and CONFIRMATION_STATUS_CONFIRMED.
Returns:
Order confirmation status

getCreatedBy
getCreatedBy() : String
Returns the name of the user who has created the order. If an agent user has created the order, the agent user's name is returned. Otherwise "Customer" is returned.
Returns:
the name of the user who created the order.

getCurrentOrder
getCurrentOrder() : Order
Returns the current order. The current order represents the most recent order in a chain of orders. For example, if Order1 was replaced by Order2, Order2 is the current representation of the order and Order1 is the original representation of the order. If you replace Order2 with Order3, Order 3 is now the current order and Order1 is still the original representation of the order. If this order has not been replaced, this method returns this order because this order is the current order.
Returns:
the current order.

getCurrentOrderNo
getCurrentOrderNo() : String
Returns the order number of the current order. The current order represents the most recent order in a chain of orders. For example, if Order1 was replaced by Order2, Order2 is the current representation of the order and Order1 is the original representation of the order. If you replace Order2 with Order3, Order 3 is now the current order and Order1 is still the original representation of the order. If this order has not been replaced, calling this method returns the same value as the getOrderNo() method because this order is the current order.
Returns:
the order number of the current order

getCustomerLocaleID
getCustomerLocaleID() : String
Returns the ID of the locale that was in effect when the order was placed. This is the customer's locale.
Returns:
the ID of the locale associated with this order, or null.

getCustomerOrderReference
getCustomerOrderReference() : String
Returns the customer-specific reference information for the order, or null.
Returns:
the customer-specific reference information for the order, or null.

getExportAfter
getExportAfter() : Date
Returns a date after which an order can be exported.
Returns:
a date after which an order can be exported.

getExportStatus
getExportStatus() : EnumValue
Returns the export status of the order.
Possible values are: EXPORT_STATUS_NOTEXPORTED, EXPORT_STATUS_EXPORTED, EXPORT_STATUS_READY, and EXPORT_STATUS_FAILED.
Returns:
Order export status

getExternalOrderNo
getExternalOrderNo() : String
Returns the value of an external order number associated with this order, or null.
Returns:
the value of an external order number associated with this order, or null.

getExternalOrderStatus
getExternalOrderStatus() : String
Returns the status of an external order associated with this order, or null.
Returns:
the status of an external order associated with this order, or null.

getExternalOrderText
getExternalOrderText() : String
Returns the text describing the external order, or null.
Returns:
the text describing the external order, or null.

getInvoice
getInvoice(invoiceNumber : String) : Invoice
Returns the Invoice associated with this order with the given invoiceNumber. The method returns null if no instance can be found.
Parameters:
invoiceNumber - the invoice number
Returns:
the invoice associated with the given invoiceNumber

getInvoiceItem
getInvoiceItem(invoiceItemID : String) : InvoiceItem
Returns the InvoiceItem associated with this order with the given ID. The method returns null if no instance can be found.
Parameters:
invoiceItemID - the item ID
Returns:
the invoice item associated with the given ID

getInvoiceItems
getInvoiceItems() : FilteringCollection
Returns the collection of InvoiceItems associated with this order.
Returns:
invoice items belonging to this order

getInvoiceNo
getInvoiceNo() : String
Returns the invoice number for this Order.

When an order is placed (e.g. with OrderMgr.placeOrder(Order)) invoice number will be filled using a sequence. Before order was placed null will be returned unless it was set with setInvoiceNo(String).

Returns:
the invoice number for this Order.

getInvoices
getInvoices() : FilteringCollection
Returns the collection of Invoices associated with this order.
Returns:
invoices belonging to this order

getOrderExportXML
getOrderExportXML(encryptionMethod : String, encryptionKey : String, encryptUsingEKID : boolean) : String
Returns the order export XML as String object.

NOTE: This method is deprecated and will be removed soon. Use getOrderExportXML(String, String) instead.

Example:

     var orderXmlAsString : String = order.getOrderExportXML(null, null, false);
     var orderXml : XML = new XML(orderXmlAsString);
 
This method can be called for placed orders only, otherwise an exception will be thrown.
Also, an exception will be thrown if the method is called in a transaction with changes.
Parameters:
encryptionMethod - the algorithm to be used for the encryption of the payment instruments if order payments re-encryption is needed
encryptionKey - the base64 encoded form of the public key to be used to encrypt the payment instruments if order payments re-encryption is needed
encryptUsingEKID - ignored
Returns:
the order export XML

getOrderExportXML
getOrderExportXML(encryptionMethod : String, encryptionKey : String) : String
Returns the order export XML as String object.

Example:

     var orderXmlAsString : String = order.getOrderExportXML(null, null);
     var orderXml : XML = new XML(orderXmlAsString);
 
This method can be called for placed orders only, otherwise an exception will be thrown.
Also, an exception will be thrown if the method is called in a transaction with changes.
Parameters:
encryptionMethod - the algorithm to be used for the encryption of the payment instruments if order payments re-encryption is needed
encryptionKey - the base64 encoded form of the public key to be used to encrypt the payment instruments if order payments re-encryption is needed
Returns:
the order export XML

getOrderItem
getOrderItem(itemID : String) : OrderItem
Returns the OrderItem for the itemID. An OrderItem will only exist for ProductLineItems or ShippingLineItems which belong to the order. The method fails with an exception if no instance can be found.
Parameters:
itemID - the itemID
Returns:
the order item for itemID
Throws:
IllegalArgumentException - if no instance is found

getOrderNo
getOrderNo() : String
Returns the order number for this order.
Returns:
the order number for this order.

getOrderToken
getOrderToken() : String
Returns the URL safe token for this order. The order token is a random string (length 32 bytes) associated with this one order. It should always be used in situations requiring order access to raise the level of qualification.
Returns:
the URL safe token for this order.

getOriginalOrder
getOriginalOrder() : Order
Returns the original order associated with this order. The original order represents an order that was the first ancestor in a chain of orders. For example, if Order1 was replaced by Order2, Order2 is the current representation of the order and Order1 is the original representation of the order. If you replace Order2 with Order3, Order1 is still the original representation of the order. If this order is the first ancestor, this method returns this order.
Returns:
the order number of the original order associated with this order.

getOriginalOrderNo
getOriginalOrderNo() : String
Returns the order number of the original order associated with this order. The original order represents an order that was the first ancestor in a chain of orders. For example, if Order1 was replaced by Order2, Order2 is the current representation of the order and Order1 is the original representation of the order. If you replace Order2 with Order3, Order1 is still the original representation of the order. If this order is the first ancestor, this method returns the value of getOrderNo().
Returns:
the order number of the original order associated with this order.

getPaymentStatus
getPaymentStatus() : EnumValue
Returns the order payment status value.
Possible values are PAYMENT_STATUS_NOTPAID, PAYMENT_STATUS_PARTPAID or PAYMENT_STATUS_PAID.
Returns:
Order payment status

getPaymentTransaction
getPaymentTransaction() : PaymentTransaction
Returns the payment transaction associated with this order. It is possible that there are multiple payment transactions associated with the order. In this case, this method returns the transaction associated with the first PaymentInstrument returned by getPaymentInstruments().
Deprecated:
Use LineItemCtnr.getPaymentInstruments() to get the list of PaymentInstrument instances and then use getPaymentTransaction() method on each PaymentInstrument to access the individual transactions.
Returns:
the payment transaction or null if there is no transaction.

getRefundedAmount
getRefundedAmount() : Money
Returns the sum of the refunded amounts. The refunded amounts are calculated on the fly. Associate a payment refund for an PaymentInstrument with an Invoice using Invoice.addRefundTransaction(OrderPaymentInstrument, Money).
Returns:
sum of refunded amounts

getRemoteHost
getRemoteHost() : String
Returns the IP address of the remote host from which the order was created.

If the IP address was not captured for the order because order IP logging was disabled at the time the order was created, null will be returned.

Returns:
The IP address of the remote host captured for the order or null

getReplaceCode
getReplaceCode() : EnumValue
If this order was replaced by another order, returns the value of the replace code. Otherwise. returns null.
Returns:
the replace code

getReplaceDescription
getReplaceDescription() : String
If this order was replaced by another order, returns the value of the replace description. Otherwise returns null.
Returns:
the value of the replace code or null.

getReplacedOrder
getReplacedOrder() : Order
Returns the order that this order replaced or null. For example, if you have three orders where Order1 was replaced by Order2 and Order2 was replaced by Order3, calling this method on Order3 will return Order2. Similarly, calling this method on Order1 will return null as Order1 was the original order.
Returns:
the order that replaced this order, or null.

getReplacedOrderNo
getReplacedOrderNo() : String
Returns the order number that this order replaced or null if this order did not replace an order. For example, if you have three orders where Order1 was replaced by Order2 and Order2 was replaced by Order3, calling this method on Order3 will return the order number for Order2. Similarly, calling this method on Order1 will return null as Order1 was the original order.
Returns:
the order number of the order that this order replaced or null.

getReplacementOrder
getReplacementOrder() : Order
Returns the order that replaced this order, or null.
Returns:
the order that replaced this order, or null.

getReplacementOrderNo
getReplacementOrderNo() : String
If this order was replaced by another order, returns the order number that replaced this order. Otherwise returns null.
Returns:
the order that replaced this order, or null.

getReturn
getReturn(returnNumber : String) : Return
Returns the Return associated with this order with the given returnNumber. The method returns null if no instance can be found.
Parameters:
returnNumber - the return number
Returns:
the return associated with the given returnNumber

getReturnCase
getReturnCase(returnCaseNumber : String) : ReturnCase
Returns the ReturnCase associated with this order with the given returnCaseNumber. The method returns null if no instance can be found.
Parameters:
returnCaseNumber - the return case number
Returns:
the return case associated with the given returnCaseNumber

getReturnCaseItem
getReturnCaseItem(returnCaseItemID : String) : ReturnCaseItem
Returns the ReturnCaseItem associated with this order with the given returnCaseItemID. The method returns null if no instance can be found.
Parameters:
returnCaseItemID - the ID
Returns:
the return case item associated with the given returnCaseItemID

getReturnCaseItems
getReturnCaseItems() : FilteringCollection
Returns the collection of ReturnCaseItems associated with this order.
Returns:
return case items belonging to this order

getReturnCases
getReturnCases() : FilteringCollection
Returns the collection of ReturnCases associated with this order.
Returns:
return cases belonging to this order

getReturnItem
getReturnItem(returnItemID : String) : ReturnItem
Returns the ReturnItem associated with this order with the given ID. The method returns null if no instance can be found.
Parameters:
returnItemID - the ID
Returns:
the return item associated with the given returnItemID

getReturnItems
getReturnItems() : FilteringCollection
Returns the collection of ReturnItems associated with this order.
Returns:
return items belonging to this order

getReturns
getReturns() : FilteringCollection
Returns the collection of Returns associated with this order.
Returns:
returns belonging to this order

getShippingOrder
getShippingOrder(shippingOrderNumber : String) : ShippingOrder
Returns the ShippingOrder associated with this order with the given shippingOrderNumber. The method returns null if no instance can be found.
Parameters:
shippingOrderNumber - the shipping order number
Returns:
the shipping order associated with the given shippingOrderNumber

getShippingOrderItem
getShippingOrderItem(shippingOrderItemID : String) : ShippingOrderItem
Returns the ShippingOrderItem associated with this order with the given shippingOrderItemID. The method returns null if no instance can be found.
Parameters:
shippingOrderItemID - the ID
Returns:
the shipping order item associated with the given shippingOrderItemID

getShippingOrderItems
getShippingOrderItems() : FilteringCollection
Returns the collection of ShippingOrderItems associated with this order.
Returns:
shipping order items belonging to this order

getShippingOrders
getShippingOrders() : FilteringCollection
Returns the collection of ShippingOrders associated with this order.
Returns:
shipping orders belonging to this order

getShippingStatus
getShippingStatus() : EnumValue
Returns the order shipping status.
Possible values are SHIPPING_STATUS_NOTSHIPPED, SHIPPING_STATUS_PARTSHIPPED or SHIPPING_STATUS_SHIPPED.
Returns:
Order shipping status

getSourceCode
getSourceCode() : String
Returns the source code stored with the order or null if no source code is attached to the order.
Returns:
the source code stored with the order or null if no source code is attached to the order.

getSourceCodeGroup
getSourceCodeGroup() : SourceCodeGroup
Returns the source code group attached to the order or null if no source code group is attached to the order.
Returns:
the source code group attached to the order or null if no source code group is attached to the order.

getSourceCodeGroupID
getSourceCodeGroupID() : String
Returns the source code group id stored with the order or null if no source code group is attached to the order.
Returns:
the source code group id stored with the order or null if no source code group is attached to the order.

getStatus
getStatus() : EnumValue
Returns the status of the order.
Possible values are:

The order status usually changes when a process action is initiated. Most status changes have an action which needs to executed in order to end having the order in a specific order status. When an order is created with e.g. OrderMgr.createOrder(Basket) the order status will be ORDER_STATUS_CREATED. The usual flow is that payment authorization will be added to the order. Once the order is considered as valid (payed, fraud checked, ...) the order gets placed. This can be done by calling OrderMgr.placeOrder(Order). The result of placing an order will be status ORDER_STATUS_OPEN (from a process standpoint ORDER_STATUS_NEW which has the same meaning). Status ORDER_STATUS_REPLACED is related to functionality BasketMgr.createBasketFromOrder(Order). ORDER_STATUS_COMPLETED has no meaning by default but can be used by custom implementations but is a synonym for NEW/OPEN. Below you will find the most important status changes:

Status beforeActionStatus afterBusiness meaning
-OrderMgr.createOrder(Basket)CREATEDOrder was created from a basket.
CREATEDOrderMgr.placeOrder(Order)OPEN/NEWOrder was considered as valid. Order can now be exported to 3rd party systems.
CREATEDOrderMgr.failOrder(Order)FAILEDOrder was considered not valid. E.g. payment authorization was wrong or fraud check was not successful.
OPEN/NEWOrderMgr.cancelOrder(Order)CANCELLEDOrder was cancelled.
CANCELLEDOrderMgr.undoCancelOrder(Order)OPEN/NEWOrder was cancelled by mistake and this needs to be undone.
FAILEDOrderMgr.undoFailOrder(Order)CREATEDOrder was failed by mistake and this needs to be undone.

Every status change will trigger a change in the order journal which is the base for GMV calculations.

Returns:
Status of the order.
See Also:

isImported
isImported() : boolean
Returns true, if the order is imported and false otherwise.
Returns:
true, if the order was imported, false otherwise.

reauthorize
reauthorize() : Status
Ensures that the order is authorized.

Checks if the order is authorized by calling the hook PaymentHooks.validateAuthorization(Order). If the authorization is not valid it reauthorizes the order by calling the PaymentHooks.reauthorize(Order).

Returns:
the status of the operation, will be Status.OK if the order is authorized after this call

removeRemoteHost
removeRemoteHost() : void
Removes the IP address of the remote host if stored.

If IP logging was enabled during order creation the IP address of the customer will be stored and can be retrieved using getRemoteHost().

See Also:

setAffiliatePartnerID
setAffiliatePartnerID(affiliatePartnerID : String) : void
Sets the affiliate partner ID value.
Parameters:
affiliatePartnerID - the affiliate partner ID value.

setAffiliatePartnerName
setAffiliatePartnerName(affiliatePartnerName : String) : void
Sets the affiliate partner name value.
Parameters:
affiliatePartnerName - the affiliate partner name value.

setCancelCode
setCancelCode(cancelCode : String) : void
Sets the cancel code value.
Parameters:
cancelCode - the cancel code value.

setCancelDescription
setCancelDescription(cancelDescription : String) : void
Sets the description as to why the order was cancelled.
Parameters:
cancelDescription - the description for why the order was cancelled.

setConfirmationStatus
setConfirmationStatus(status : Number) : void
Sets the confirmation status value.
Possible values are CONFIRMATION_STATUS_NOTCONFIRMED or CONFIRMATION_STATUS_CONFIRMED.
Parameters:
status - Order confirmation status

setCustomer
setCustomer(customer : Customer) : void
This method is used to associate the order object with the specified customer object.

If the customer object represents a registered customer, the order will be assigned to this registered customer and the order's customer number (LineItemCtnr.getCustomerNo()) will be updated.

If the customer object represents an unregistered (anonymous) customer, the order will become an anonymous order and the order's customer number will be set to null.

Parameters:
customer - The customer to be associated with the order.
Throws:
NullArgumentException - If specified customer is null.

setCustomerNo
setCustomerNo(customerNo : String) : void
Sets the customer number of the customer associated with this container.
Parameters:
customerNo - the customer number of the customer associated with this container.

setCustomerOrderReference
setCustomerOrderReference(reference : String) : void
Sets the customer-specific reference information for the order.
Parameters:
reference - the customer-specific reference information for the order.

setExportAfter
setExportAfter(date : Date) : void
Sets the date after which an order can be exported.
Parameters:
date - the date after which an order can be exported.

setExportStatus
setExportStatus(status : Number) : void
Sets the export status of the order.
Possible values are: EXPORT_STATUS_NOTEXPORTED, EXPORT_STATUS_EXPORTED, EXPORT_STATUS_READY, and EXPORT_STATUS_FAILED.

Setting the status to EXPORT_STATUS_EXPORTED will also trigger the finalization of on order inventory transactions for this order meaning that all inventory transactions with type on order will be moved into final inventory transactions. This is only relevant when On Order Inventory is turned on for the inventory list ordered products are in.

In case of an exception the current transaction is marked as rollback only.

Parameters:
status - Order export status

setExternalOrderNo
setExternalOrderNo(externalOrderNo : String) : void
Sets the value of an external order number associated with this order
Parameters:
externalOrderNo - the value of an external order number associated with this order.

setExternalOrderStatus
setExternalOrderStatus(status : String) : void
Sets the status of an external order associated with this order
Parameters:
status - the status of the external order.

setExternalOrderText
setExternalOrderText(text : String) : void
Sets the text describing the external order.
Parameters:
text - the text describing the external order.

setInvoiceNo
setInvoiceNo(invoiceNumber : String) : void
Sets the invoice number for this Order.

Notice that this value might be overwritten during order placement (e.g. with OrderMgr.placeOrder(Order)).

Parameters:
invoiceNumber - the invoice number for this Order.
See Also:

setOrderStatus
setOrderStatus(status : Number) : void
Sets the order status.

Use this method when using Order Post Processing such as the creation of shipping orders. The only supported values are ORDER_STATUS_OPEN, ORDER_STATUS_CANCELLED. Setting the status will adjust the order item status when applicable (item status not SHIPPED or CANCELLED). Note that the order status and the status of the items are directly related and dependent on one another.

See OrderItem.setStatus(String) for more information about possible status transitions.

Warning: This method will not undo coupon redemptions upon cancellation of an order. Re-opening such an order later with OrderMgr.undoCancelOrder(Order) or OrderItem.setStatus(String) with ORDER_STATUS_OPEN will result in an additional application of the same coupon code which in turn might fail.

Deprecated:
use setStatus(Number) instead
Parameters:
status - the status to be set, use one of:
Throws:
IllegalArgumentException - on attempt to set an unsupported status value

setPaymentStatus
setPaymentStatus(status : Number) : void
Sets the order payment status.
Possible values are PAYMENT_STATUS_NOTPAID, PAYMENT_STATUS_PARTPAID or PAYMENT_STATUS_PAID.
Parameters:
status - Order payment status

setReplaceCode
setReplaceCode(replaceCode : String) : void
Sets the value of the replace code.
Parameters:
replaceCode - the value of the replace code.

setReplaceDescription
setReplaceDescription(replaceDescription : String) : void
Sets the value of the replace description.
Parameters:
replaceDescription - the value of the replace description.

setShippingStatus
setShippingStatus(status : Number) : void
Sets the order shipping status value.
Possible values are SHIPPING_STATUS_NOTSHIPPED, SHIPPING_STATUS_PARTSHIPPED or SHIPPING_STATUS_SHIPPED.
Parameters:
status - Order shipping status

setStatus
setStatus(status : Number) : void
Sets the status of the order.

Possible values are:

This method does not support order statuses ORDER_STATUS_CREATED or ORDER_STATUS_FAILED. Please use OrderMgr.placeOrder(Order) or OrderMgr.failOrder(Order).

Setting the order status to ORDER_STATUS_CANCELLED will have the same effect as calling OrderMgr.cancelOrder(Order). Setting a canceled order to ORDER_STATUS_NEW, ORDER_STATUS_OPEN or ORDER_STATUS_COMPLETED will have the same effect as calling OrderMgr.undoCancelOrder(Order). It is recommended to use the methods in OrderMgr directly to be able to do error processing with the return code.

Parameters:
status - Order status
Throws:
IllegalArgumentException - on attempt to set status CREATED or FAILED, or status transition while cancel order or undo cancel order returns with an error code.

trackOrderChange
trackOrderChange(text : String) : Note
Tracks an order change.

This adds a history entry to the order. Focus of history entries are changes through business logic, both custom and internal logic. Tracked order changes are read-only and can be accessed in the Business Manager order history. The following attributes of the created history entry are initialized:

  • Note.getCreatedBy() gets the current user assigned
  • Note.getCreationDate() gets the current date assigned
  • This feature is intended to track important changes in custom order flow which should become visible in Business Manager's history tab. It is NOT intended as auditing feature for every change to an order. A warning will be produced after 600 notes are added to an order. The warning can be reviewed in Business Manager's Quota Status screen. Attempting to add a note to an order which already has 1000 notes results in an exception. Please bear in mind that internal changes, such as order status changes, also track changes. Avoid using this feature in recurring jobs which may re-process orders multiple times as the limit needs to be considered each time a change is tracked. The same limit on the number of notes added also applies when using method LineItemCtnr.addNote(String, String) to add notes.

    Parameters:
    text - the text of the history entry
    Returns:
    the created history entry