Script: Class dw.order.Order
Class Order
The Order class represents an order. The correct way to retrieve an order is described in OrderMgr.
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
ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA_256ANDMGF1PADDING : String = "RSA/ECB/OAEPWithSHA-256AndMGF1Padding"
The encryption algorithm "RSA/ECB/OAEPWithSHA-256AndMGF1Padding".
ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING : String = "RSA/ECB/PKCS1Padding"
The outdated encryption algorithm "RSA/ECB/PKCS1Padding". Please do not use anymore!
Deprecated:
Support for this algorithm will be removed in a future release. Please use ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA56ANDMGF1PADDING instead.
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.
globalPartyID : String Read Only
The Global Party ID reconciles customer identity across multiple systems. For example, as part of the Service for Commerce experience, service agents can find information for customers who have never called into the call center, but have created a profile on the website. Service agents can find guest order data from B2C Commerce and easily create accounts for customers. Customer 360 Data Manager matches records from multiple data sources to determine all the records associated with a specific customer.
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.
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.
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.
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.
orderExportXML : String Read Only
The order export XML as String object.
NOTE: This method will return payment instrument data masked. If payment instrument re-encryption is needed please use getOrderExportXML(String, String) instead.
Example:
var orderXMLAsString : String = order.getOrderExportXML(); var orderXML : XML = new XML(orderXMLAsString);
orderNo : String Read Only
The order number for this order.
orderToken : String Read Only
The token for this order. The order token is a string (length 32 bytes) associated with this one order. The order token is random. It reduces the capability of malicious users to access an order through guessing. Order token can be used to further validate order ownership, but should never be used to solely validate ownership. In addition, the storefront should ensure authentication and authorization. See the Security Best Practices for Developers for details.
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.
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.
returnCases : FilteringCollection Read Only
The collection of ReturnCases associated with this order.
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.
returnItems : FilteringCollection Read Only
The collection of ReturnItems associated with this order.
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.
returns : FilteringCollection Read Only
The collection of Returns associated with this order.
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.
shippingOrderItems : FilteringCollection Read Only
The collection of ShippingOrderItems associated with this order.
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.
shippingOrders : FilteringCollection Read Only
The collection of ShippingOrders associated with this order.
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.
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:
- ORDER_STATUS_CREATED
- ORDER_STATUS_NEW
- ORDER_STATUS_OPEN
- ORDER_STATUS_COMPLETED
- ORDER_STATUS_CANCELLED
- ORDER_STATUS_FAILED
- ORDER_STATUS_REPLACED
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 before | Action | Status after | Business meaning |
---|---|---|---|
- | OrderMgr.createOrder(Basket) | CREATED | Order was created from a basket. |
CREATED | OrderMgr.placeOrder(Order) | OPEN/NEW | Order was considered as valid. Order can now be exported to 3rd party systems. |
CREATED | OrderMgr.failOrder(Order) | FAILED | Order was considered not valid. E.g. payment authorization was wrong or fraud check was not successful. |
OPEN/NEW | OrderMgr.cancelOrder(Order) | CANCELLED | Order was cancelled. |
CANCELLED | OrderMgr.undoCancelOrder(Order) | OPEN/NEW | Order was cancelled by mistake and this needs to be undone. |
FAILED | OrderMgr.undoFailOrder(Order) | CREATED | Order 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.
taxRoundedAtGroup : boolean Read Only
Use this method to check if the Order was created with grouped taxation calculation.
If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate.
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.
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.
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.
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.
Returns the export status of the order.
Possible values are: EXPORT_STATUS_NOTEXPORTED, EXPORT_STATUS_EXPORTED, EXPORT_STATUS_READY, and EXPORT_STATUS_FAILED.
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.
The Global Party ID reconciles customer identity across multiple systems.
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.
Returns the order export XML as String object.
getOrderExportXML(encryptionAlgorithm : String, encryptionKey : String) : String
Returns the order export XML as String object, with payment instrument data re-encrypted using the given encryption algorithm and key.
getOrderExportXML(encryptionAlgorithm : String, encryptionKey : String, encryptUsingEKID : boolean) : String
Returns the order export XML as String object, with payment instrument data re-encrypted using the given encryption algorithm and key.
getOrderExportXML(encryptionAlgorithm : String, encryptionKey : String) : String
Returns the order export XML as String object, with payment instrument data re-encrypted using the given encryption algorithm and key.
getOrderItem(itemID : String) : OrderItem
Returns the OrderItem for the itemID.
getOrderNo() : String
Returns the order number for this order.
getOrderToken() : String
Returns the token for this order.
Returns the original order associated with this order.
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.
Returns the sum of the refunded amounts.
getRemoteHost() : String
Returns the IP address of the remote host from which the order was created.
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.
Returns the order that this order replaced or null.
Returns the order number that this order replaced or null if this order did not replace an 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.
Returns the status of the order.
Possible values are:
- ORDER_STATUS_CREATED
- ORDER_STATUS_NEW
- ORDER_STATUS_OPEN
- ORDER_STATUS_COMPLETED
- ORDER_STATUS_CANCELLED
- ORDER_STATUS_FAILED
- ORDER_STATUS_REPLACED
isImported() : boolean
Returns true
, if the order is imported and false
otherwise.
isTaxRoundedAtGroup() : boolean
Use this method to check if the Order was created with grouped taxation calculation.
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, getTaxTotalsPerTaxRate, getTotalGrossPrice, getTotalNetPrice, getTotalTax, isTaxRoundedAtGroup, 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
getCreationDate, getLastModified, getUUID
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
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.
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.
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().
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.
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.
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.
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...
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.
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
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.
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.
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.
Returns:
the created shipping order
See Also:
createShippingOrder
createShippingOrder(shippingOrderNumber : String) : ShippingOrder
Creates a new ShippingOrder for this order.
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.
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.
See Also:
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
See Also:
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.
getGlobalPartyID
getGlobalPartyID() : String
The Global Party ID reconciles customer identity across multiple systems. For example, as part of the Service for Commerce experience, service agents can find information for customers who have never called into the call center, but have created a profile on the website. Service agents can find guest order data from B2C Commerce and easily create accounts for customers. Customer 360 Data Manager matches records from multiple data sources to determine all the records associated with a specific customer.
Returns:
the Global Party ID associated with this 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.
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.
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.
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.
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.
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.
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.
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.
Returns:
invoices belonging to this order
getOrderExportXML
getOrderExportXML() : String
Returns the order export XML as String object.
NOTE: This method will return payment instrument data masked. If payment instrument re-encryption is needed please use getOrderExportXML(String, String) instead.
Example:
var orderXMLAsString : String = order.getOrderExportXML(); var orderXML : XML = new XML(orderXMLAsString);
Returns:
the order export XML
Throws:
IllegalStateException - If the method is called in a transaction with changes.
IllegalStateException - If the order is not placed. This method can be called for placed orders only.
IllegalStateException - If the order export XML could not be generated.
getOrderExportXML
getOrderExportXML(encryptionAlgorithm : String, encryptionKey : String) : String
Returns the order export XML as String object, with payment instrument data re-encrypted using the given encryption algorithm and key.
NOTE: If no encryption is needed or desired please always use getOrderExportXML() instead, which returns the payment instrument data masked. Do not pass in any null arguments!
Example:
var orderXMLAsString : String = order.getOrderExportXML( "RSA/ECB/PKCS1Padding", "[key]" ); var orderXML : XML = new XML( orderXMLAsString );
API Versioned:
No longer available as of version 22.7. undefined behaviour for invalid arguments (e.g. null)
Parameters:
encryptionAlgorithm - The encryption algorithm to be used for the re-encryption of the payment instrument data (credit card number, bank account number, bank account driver's license number). Must be a valid, non-null algorithm. Currently, only ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING is supported, but this will be fixed and support for ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA56ANDMGF1PADDING will be added soon.
encryptionKey - The Base64 encoded form of the public key to be used for the re-encryption of the payment instrument data. Must be a valid, non-blank key.
Returns:
the order export XML
Throws:
IllegalStateException - If the method is called in a transaction with changes.
IllegalStateException - If the order is not placed. This method can be called for placed orders only.
IllegalStateException - If the order export XML could not be generated.
getOrderExportXML
getOrderExportXML(encryptionAlgorithm : String, encryptionKey : String, encryptUsingEKID : boolean) : String
Returns the order export XML as String object, with payment instrument data re-encrypted using the given encryption algorithm and key.
NOTE: If no encryption is needed or desired please always use getOrderExportXML() instead, which returns the payment instrument data masked. Do not pass in any null arguments!
Example:
var orderXMLAsString : String = order.getOrderExportXML( "RSA/ECB/PKCS1Padding", "[key]", false ); var orderXML : XML = new XML( orderXMLAsString );
API Versioned:
No longer available as of version 22.7. undefined behaviour for invalid arguments (e.g. null)
Deprecated:
This method will be removed soon. Please use the following methods instead:
- getOrderExportXML() – if payment instrument data should be masked
- getOrderExportXML(String, String) – if payment instrument data should be re-encrypted
Parameters:
encryptionAlgorithm - The encryption algorithm to be used for the re-encryption of the payment instrument data (credit card number, bank account number, bank account driver's license number). Must be a valid, non-null algorithm. Currently, only ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING is supported, but this will be fixed and support for ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA56ANDMGF1PADDING will be added soon.
encryptionKey - The Base64 encoded form of the public key to be used for the re-encryption of the payment instrument data. Must be a valid, non-blank key.
encryptUsingEKID - ignored
Returns:
the order export XML
Throws:
IllegalStateException - If the method is called in a transaction with changes.
IllegalStateException - If the order is not placed. This method can be called for placed orders only.
IllegalStateException - If the order export XML could not be generated.
getOrderExportXML
getOrderExportXML(encryptionAlgorithm : String, encryptionKey : String) : String
Returns the order export XML as String object, with payment instrument data re-encrypted using the given encryption algorithm and key.
NOTE: If no encryption is needed or desired please always use getOrderExportXML() instead, which returns the payment instrument data masked.
Example:
var orderXMLAsString : String = order.getOrderExportXML( "RSA/ECB/PKCS1Padding", "[key]" ); var orderXML : XML = new XML( orderXMLAsString );
API Versioned:
From version 22.7. strict encryption argument checks; no null or otherwise invalid values allowed
Parameters:
encryptionAlgorithm - The encryption algorithm used for the re-encryption of the payment instrument data (credit card number, bank account number, bank account driver's license number). Must be one of the following:
- ENCRYPTION_ALGORITHM_RSA_ECB_OAEPWITHSHA56ANDMGF1PADDING – The current and preferred algorithm.
- ENCRYPTION_ALGORITHM_RSA_ECB_PKCS1PADDING – This algorithm is outdated/deprecated and will be removed in a future release. Please do not use anymore.
encryptionKey - The Base64 encoded form of the public key used for the re-encryption of the payment instrument data. Must be a valid, non-blank key.
Returns:
the order export XML
Throws:
IllegalArgumentException - If
encryptionAlgorithm
is not a valid known algorithm.
IllegalArgumentException - If
encryptionKey
is a blank string.
IllegalStateException - If the method is called in a transaction with changes.
IllegalStateException - If the order is not placed. This method can be called for placed orders only.
IllegalStateException - If the order export XML could not be generated.
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
See Also:
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 token for this order. The order token is a string (length 32 bytes) associated with this one order. The order token is random. It reduces the capability of malicious users to access an order through guessing. Order token can be used to further validate order ownership, but should never be used to solely validate ownership. In addition, the storefront should ensure authentication and authorization. See the Security Best Practices for Developers for details.
Returns:
the 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.
See Also:
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.
See Also:
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.
See Also:
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.
See Also:
getReplacementOrder
getReplacementOrder() : Order
Returns the order that replaced this order, or null.
Returns:
the order that replaced this order, or null.
See Also:
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.
See Also:
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.
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.
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.
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.
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.
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.
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.
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.
Returns:
return case items belonging to this order
getReturnCases
getReturnCases() : FilteringCollection
Returns the collection of ReturnCases associated with this order.
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.
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.
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.
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.
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.
Returns:
return items belonging to this order
getReturns
getReturns() : FilteringCollection
Returns the collection of Returns associated with this order.
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.
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.
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.
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.
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.
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.
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.
Returns:
shipping order items belonging to this order
getShippingOrders
getShippingOrders() : FilteringCollection
Returns the collection of ShippingOrders associated with this order.
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.
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:
- ORDER_STATUS_CREATED
- ORDER_STATUS_NEW
- ORDER_STATUS_OPEN
- ORDER_STATUS_COMPLETED
- ORDER_STATUS_CANCELLED
- ORDER_STATUS_FAILED
- ORDER_STATUS_REPLACED
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 before | Action | Status after | Business meaning |
---|---|---|---|
- | OrderMgr.createOrder(Basket) | CREATED | Order was created from a basket. |
CREATED | OrderMgr.placeOrder(Order) | OPEN/NEW | Order was considered as valid. Order can now be exported to 3rd party systems. |
CREATED | OrderMgr.failOrder(Order) | FAILED | Order was considered not valid. E.g. payment authorization was wrong or fraud check was not successful. |
OPEN/NEW | OrderMgr.cancelOrder(Order) | CANCELLED | Order was cancelled. |
CANCELLED | OrderMgr.undoCancelOrder(Order) | OPEN/NEW | Order was cancelled by mistake and this needs to be undone. |
FAILED | OrderMgr.undoFailOrder(Order) | CREATED | Order 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.
isTaxRoundedAtGroup
isTaxRoundedAtGroup() : boolean
Use this method to check if the Order was created with grouped taxation calculation.
If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate.
Returns:
true
if the Order was created with grouped taxation
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.
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.
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