This command creates, merges, or modifies orders that have a status attribute of either "P" or "E".
Command structure
- http://host_name/path/
- The fully qualified name of your WebSphere Commerce Server and the configuration path.
Parameter values
- langId
- Sets or resets the preferred language for the duration of the session; the supported languages for a store are found in the STORELANG table.
- forUser
- The logon ID of the user on whose behalf the command will be run; only a person with the authority to process orders can specify this parameter.
- forUserId
- Same as forUser, but identifying the user by the internal user ID, as found in the USERS table.
- URL
- (Required) The redirection URL that is called when the command successfully completes.
- fromOrderId_i
- Specifies zero or more source orders from which order items will be copied when enumeration group i is processed. The special abbreviations "." , "*", " .t" , "*t" and "q" are resolved using memberId_i and storeId. This parameter can be repeated.
- toOrderId
- Specifies the order to be created or modified. It can be specified as an order reference number or as one of the special abbreviations ".", "*", ".t", "*t", "**" and ".**.". If it is not specified, it defaults to "**", which creates a new order. If more than one order is specified, it is as if only the most recently updated one was specified. Abbreviations are resolved using the current customer (the customer running this command) and the store specified in the storeId parameter.
- copyOrderItemId_i
- Specifies which order items should be copied from the source orders
specified by fromOrderId_i and added to the destination order specified
by toOrderId. This parameter can be repeated.
- If it is not specified, or "*" is specified, the parameter refers to all order items that belong to the orders specified by fromOrderId_i.
- If "." is specified the parameter refers to the most recently updated order item that belongs to the orders specified by fromOrderId_i.
- If "**" is specified the parameter refers to a single new order item that will be added to the destination order using information only from other parameters in the enumeration group specified by i, but not from the source orders for that enumeration group. In this case, catEntryId_i or partNumber_i must be specified. The OrderCopy command calls the OrderItemUpdate command to add new order items to the destination order.
- updateOrderItemId_i
- Specifies order items in the destination order to be updated. It is updated
using information from other parameters in the enumeration group specified by
i, but not from the source orders for that enumeration group and not
from catEntryId_i and partNumber_i. Note that the catalog entry
ID of an order item cannot be updated. The OrderCopy command calls the
OrderItemUpdate command to update order items in the destination order. This
parameter can be repeated.
- If "*" is specified, it means all order items in the destination order.
- If "." is specified, it means the most recently updated order item.
- orderInfoFrom
- Specifies the reference number of an order from which to copy order level
information (values for the DESCRIPTION, ADDRESS_ID, SEQUENCE, FIELD1, FIELD2,
and FIELD3 columns in the ORDERS table).
This parameter can be repeated.
- If more than one order is specified, it is as if only the most recently updated of those orders were specified.
- If "**" is specified, order level information is not copied from any order.
- If this parameter is not specified, and there is only one source order specified by the fromOrderId_i parameters, then it is as if that order was specified. Otherwise, it defaults to "**". Abbreviations are resolved using the current customer and the store specified by the storeId parameter.
- payInfoFrom
- Specifies the reference number of an order from which to copy payment
information obtained by calling the
GetOrderPaymentInfoCmd task command. If more than one order is specified,
it is as if only the most recently updated of those orders were specified. This
parameter can be repeated.
If "**" is specified, order level information is not copied from any order. If this parameter is not specified, and there is only one source order specified by the fromOrderId_i parameters, then it is as if that order was specified. Otherwise, it defaults to "**". Abbreviations are resolved using the current customer and the store specified by the storeId parameter.
- catEntryId_i
- Sets the catalog entry ID of the order items in enumeration group i.
- quantity_i
- Sets the quantity of the order items in enumeration group i.
- UOM_i
- The unit of measure for the quantity_i.
- partNumber_i
- The part number to be resolved to a catalog entry ID. It overrides catEntryId_i.
- addressId_i
- The reference number of the address to which the order items in the enumeration group specified by i are to be shipped. The address must belong to the customer executing this command.
- shipModeId_i
- Specifies a shipping mode reference number, to be passed to the OrderItemUpdate command when order items are added to or updated in the destination order, for the enumeration group specified by i. This reference number is associated with a particular shipping service.
- comment_i
- A comment to be included with the item to be passed to the OrderItemUpdate command when order items are added to or updated in the destination
- field1_i
- Specifies an integer value to be passed to the OrderItemUpdate command when order items are added to or updated in the destination order, for the enumeration group specified by i
- field2_i
- Specifies a character string to be passed to the OrderItemUpdate command when order items are added to or updated in the destination order, for the enumeration group specified by i
- contractId_i
- The contract reference number associated with the order, to be passed to the OrderItemUpdate command when order items are added to or updated in the destination
- offerId_i
- A list of offer IDs to be chosen from when creating a new order item. This list will be passed to the OrderItemUpdate command. There is no default value.
- configurationId_i
- If the OrderItem represents a configured Dynamic Kit, this is the configuration ID. This parameter can be repeated.
- correlationGroup_i
- The group to which this OrderItem is related. Normally, the correlationGroup is the same as the OrderItemID. OrderItems with the same correlationGroup attribute value represent the same object the customer wants to buy. A value for correlationGroup can be specified and propagated when either OrderItems are split when inventory is allocated (such as when two fulfillment centers must be used to fill an order for the same item if one fulfillment center has insufficient supply), or when a price quotation is received for an OrderItem. When an OrderItem is split at inventory allocation, the newly created OrderItem inherits the correlationGroup value from the original OrderItem. In a quotation situation, the OrderItem inherits the correlationGroup value from the corresponding OrderItem in the parent order.
- outOrderName
- Specifies the names of name-value pairs to be added to the redirection URL. The value of each added name-value pair is the reference number of a destination order. The default value is "orderId". This parameter can be repeated.
- outOrderItemName
- Specifies the names of name-value pairs to be added to the redirection URL. The value of each added name-value pair is the reference number of a destination order item. The default value is "orderItemId". This parameter can be repeated.
- description
- Sets the description of the destination order. If not specified, the description of the "orderInforFrom" order will be used, if there is one.
- billingAddressId
- Sets the billing address ID of the destination order. If not specified, the billing address ID of the "orderInfoFrom" order will be used, if there is one.
- displaySeq
- Sets the display sequence of the destination order. If not specified, the display sequence "orderInforFrom" order will be used, if there is one.
- field1 through field3
- Sets the field1, field2, and field3 values of the destination order, respectively. If not specified, the corresponding field value of the "orderInfoFrom" order will be used, if there is one.
- status
- Specifies the status of the destination order. Only I (submitted) and P (pending) are valid values. The default is P. If I is specified, then after the destination order is updated, it is prepared for display and locked, as if OrderPrepare had been called, and then the status is set to I. This prepares the order to be accepted by OrderProcess, and prevents it from being further modified by the customer.
- memberId_i
- The reference number of a member, used to resolve special abbreviations
(".", "*", ".t", ".**.", and
"*t") when they appear in fromOrderId_i. For example, the
following command refers to all pending orders of member 1001:
fromOrderId_1=*&memberId_1=1001 The default value is the member ID of the current user. If the current customer attempts to access the orders of other customers but is not authorized to do so, an exception is thrown. - storeId
- Sets the store ID of the destination order. It is also used to resolve
special abbreviations (".", "*", ".t",
".**.", and "*t") when they appear in
fromOrderId_i, toOrderId, orderInfoFrom, and payInfoFrom. For example,
the following command refers to all pending orders of member 1001 in store
1:
fromOrderId_1=*&memberId_1=1001&storeId=1 - attr_i_name
- Specifies an attribute name and value to be passed to the
OrderItemUpdate command when adding order
items for the enumeration group specified by i to the destination
order. For example, the following command refers to part ABC123 with attribute
"length"=="10":
partNumber_1=ABC123&attr_1_length=10 - pay_payment_name
- Sets the payment name value pairs of the destination order. This parameter
can be repeated. For example the following command refers to the payment
name-value pair "creditCardNumber==2222222222":
pay_creditCardNumber=2222222222
These payment name-value pairs will be added to the ORDPAYINFO table through the SetOrderPaymentInfoCmd task command. If not specified, the payment name-value pairs of the payInfoFrom order will be used, if there is one. - partOwner_Id_i
- The member ID of the part owner, used with partNumber_i; defaults to the owner of the store.
- continue
- Controls whether the order copy continues when one or more of the order items cannot be copied. A value of 0 terminates and rolls back execution if an order item cannot be created or updated in the target order; a value of 1 ignores the create or update operation for that order item and continues execution. The default value is 0.
- orderComment
- Sets the order comment if specified.
- remerge
- A list of the OrderItems that should be merged with other OrderItems in the same order and with the same correlationGroup attribute, if possible. This parameter can be repeated.
- merge
- A list of OrderItems that should be merged with other OrderItems in the same order if possible, regardless of their correlationGroup attributes. This parameter can be repeated.
- check
- A list of OrderItems that should be checked by the CheckInventory task command. This parameter can be repeated.
- allocate
- A list of OrderItems that should be allocated from existing inventory. This parameter can be repeated.
- backorder
- A list of OrderItems that should be allocated from expected inventory. This parameter can be repeated.
- reverse
- A list of OrderItems whose allocations should be released (that is, de-allocated from existing or expected inventory as appropriate). This parameter can be repeated.
Note: The remerge, merge, check, allocate, backorder and reverse parameters are applicable only if ATP inventory is enabled (see the ALLOCATIONGOODFOR column in the STORE table). They represent lists of OrderItems that will be passed to the AllocateInventory task command, which calls the CheckInventoryAvailability, AllocateExistingInventory, AllocateExpectedInventory , DeallocateExistingInventory, and DeallocateExpectedInventory task commands as specified below. Also, these parameters accept OrderItem abbreviations, which are detailed in the help for Order Management subsystem commands.
The default ATP parameter values are as follows:
- remerge=*n
- merge=*n
- check=***
- allocate=*n
- backorder=*n
- reverse=*n
Example 1
The following example copies an order using fromOrderId_1 because the default toOrder is ** (new order) and and the default for copyOrderItemId_1 is * (all order items).
http://myhostname/webapp/wcs/stores/servlet/OrderCopy?fromOrderId_1=388 &URL=OrderItemDisplay
Example 2
The following example creates two pending orders then merges all order items from all the customer's pending orders.
http://myhostname/webapp/wcs/stores/servlet/OrderItemAdd?catEntryId=322200305 &quantity=11&URL=OrderItemDisplay&storeId=32&orderId=** http://myhostname/webapp/wcs/stores/servlet/OrderItemAdd?catEntryId=322200301 &quantity=11&URL=OrderItemDisplay&storeId=32&orderId=** http://myhostname/webapp/wcs/stores/servlet/OrderCopy?URL=OrderItemDisplay &fromOrderId_1=*©OrderItemId_1=*
Example 3
The following example adds a new order item to order 111.
http://myhostname/webapp/wcs/stores/servlet/OrderCopy?fromOrderId_1=111 &toOrderId=111&partNumber_1=PART-I312200303&quantity_1=21&memberId_1=0 &storeId=31&URL=OrderItemDisplay
Example 4
The following example copies using partNumber. If specified, then the catEntryId_i parameter is ignored. The partNumber_i parameter and the store reference number specified or implied by the other parameters are used to determine a product reference number, by selecting the PARTNUMBER and MEMBER_ID columns in the CATENTRY table. This command behaves as if that product reference number was specified as the value for catEntryId_i. The command must be able to determine a store reference number from the other parameters. The result is that a new order item is added into order 111.
http://myhostname/webapp/wcs/stores/servlet/OrderCopy?fromOrderId_1=111 &toOrderId=111&partNumber_1=PART-I312200303&quantity_1=21 &memberId_1=1&storeId=31&URL=OrderItemDisplay
Behavior
- The ResolveOrdersCmd and ResolveOrderItemsCmd task commands are called to resolve OrderId and OrderItemId abbreviations and determine which Orders and OrderItems are specified by the parameters.
- If required, the destination order is created in the ORDERS table with status P, unlocked.
- The CheckOrderCopyCmd task is called to verify the authority of the customer to copy information from the orders specified by the fromOrderId_i, orderInfoFrom, and payInfoFrom parameters, and to update information in the destination order.
- Order information is updated in the ORDERS table.
- Payment information is read from the order specified by the payInfoFrom
parameter, by calling
the GetOrderPaymentInfoCmd task command, updated as specified by the pay_payment_name parameters and written to the destination order specified by the toOrderId parameter by calling the SetOrderPaymentInfoCmd process task. - For each copyOrderItem_i and updateOderItem_i parameter in ascending order of i, the specified order item information is copied to or updated in the ORDERITEMS table for the destination order by calling the OrderItemUpdate command.
- If the status parameter indicates I, the destination order is prepared for display and processing as if the OrderPrepare command is called, (amounts are calculated and the order is locked) and, the status of the destination order and its order items are changed to I in the ORDERS and ORDERITEMS tables.
- The ExtOrderCopyCmd task command is called.
- Name-value pairs are added to the redirection URL, as specified by the outOrderName and outShiptoName parameters.
Exception conditions
- The
CheckOrderCopyCmd task command will throw an ECApplicationException of type
_ERR_ORDER_COPY with the error view OrderCopyErrorView if the OrderCopy command
is denied access to an order. The following name-value pairs will be set:
- ERROR_CODE=601
- orderId=the offending order ID
- If the destination order is not in the pending state, an
ECApplicationException of type _ERR_ORDER_WRONG_STATUS is thrown with the error
view OrderCopyErrorView. As well, the following name-value pairs will be set:
- ERROR_CODE=603
- orderId=the offending order ID
- All OrderItemUpdate exception conditions.