OrderCopy URL

Create, merge, or modify pending orders that have a status attribute of P or I.

URL structure

http:// host_name/ path/
The fully qualified name of your WebSphere Commerce Server and the configuration path.

This diagram displays the structure for the OrderCopy URL for advanced orders.

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 runs; 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 is completed.
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. See the Order abbreviations for a description of these abbreviations. 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 ".**.". See the Order abbreviations for a description of these abbreviations. If this parameter is not specified, it defaults to **, which creates a new order. If more than one order is specified, only the most recently updated one applies. Abbreviations are resolved using the current customer (the customer running this command) and the store that was 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 aboutly 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, only the most recently updated one applies.
  • If "**" is specified, order-level information is not copied from any order.
  • If this parameter is not specified, and the fromOrderId_ i parameters specify only one order, then that order applies. Otherwise, it defaults to **. Abbreviations are resolved using the current customer and the store specified by the storeId parameter.
payInfoFrom
This parameter is only for compatibility. With the new payment rule, the payinfo is not stored in ORDPAYINFO.

Specifies the reference number of an order from which to obtain payment information by calling the com.ibm.commerce.order.commands.GetOrderPaymentInfoCmd task command. If more than one order is specified, only the most recently updated of those orders applies. 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 that order applies. 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.
ShipAsComplete
Specifies if the created or modified order can be partially shipped. If the value is Y, the order will be shipped when all order items are available. If the value is N, the order can be partially shipped when some of the order items are available. The default value is Y. This parameter is stored in the SHIPASCOMPLETE column in the ORDERS table.
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 order.
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 from which to choose when creating a new order item. This list will be passed to the OrderItemUpdate command. There is no default value.
configurationId_i
If the order item represents a configured Dynamic Kit, this is the configuration ID. This parameter can be repeated.
correlationGroup_ i
The group to which this order item is related. Normally, the correlationGroup is the same as the OrderItemID. Order items with the same correlationGroup attribute value represent the same object that the customer wants to buy. A value for correlationGroup can be specified and propagated when either order items 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 order item. When an order item is split at inventory allocation, the newly created order item inherits the correlationGroup value from the original order item. In a quotation situation, the order item inherits the correlationGroup value from the corresponding order item in the parent order.
outOrderName
Specifies 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 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 "orderInfoFrom" order is 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 is used if there is one.
displaySeq
Sets the display sequence of the destination order. If not specified, the display sequence "orderInfoFrom" order is used if there is one.
field1 - field3
Sets the field1, field2, and field3 values of the destination order. If not specified, the corresponding field value of the "orderInfoFrom" order is 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 the destination order is updated, it is prepared for display, and locked (as if OrderPrepare had been called), and 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.
prepare
Specifies whether to prepare the order by calling the PrepareOrder command. Valid values are Y and N. (After the destination order is updated, it is prepared for display and locked, preparing the order for acceptance by OrderProcess and preventing any further modification of the order.)
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 (Deprecated)
This is supported for compatibility with earlier versions. With payment rule, ORDPAYINFO is not used, while using payment plugin controller and payment plugins. 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 "quot;quot;quot;quot;quot;quot;quot;quot;quot;quot;quot;creditCardNumber==2222222222": pay_creditCardNumber=2222222222 These payment name-value pairs will be added to the ORDPAYINFO table by using the com.ibm.commerce.order.commands.SetOrderPaymentInfoCmd task command. If not specified, the payment name-value pairs of the payInfoFrom order will be used if there are any.
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 any.
remerge
A list of the order items that are to be merged with other order items in the same order and with the same correlationGroup attribute, if possible. This parameter can be repeated.
merge
A list of order items that is to be merged with other order items in the same order if possible, regardless of their correlationGroup attributes. This parameter can be repeated.
check
A list of order items that is to be checked by the CheckInventory task command. This parameter can be repeated.
allocate
A list of order items that is to be allocated from existing inventory. This parameter can be repeated.
backorder
A list of order items that is to be allocated from expected inventory. This parameter can be repeated.
reverse
A list of order items whose allocation is to be released (that is, de-allocated from existing or expected inventory as appropriate). This parameter can be repeated.
shippingAddressFromOrderProfile
Specifies whether to use the default shipping address held in the order profile: if the value is 1, the default shipping address is copied from the order profile to all the order items of the order specified in toOrderId.
Note: If the value of this parameter is 1, the value of updateOrderItemId_ i is implicitly set to "*" and the value of addressId_ i is implicitly set to the reference number of the default shipping address. The values of updateOrderItemId_ i and addressId_ i supplied in the URL are overridden.
shippingModeFromOrderProfile
Specifies whether to use the default shipping mode held in the order profile: if the value is 1, the default shipping mode is copied from the order profile to all the order items of the order specified in toOrderId.
Note: If the value of this parameter is 1, the value of updateOrderItemId_i is implicitly set to "*" and the value of shipModeId _i is implicitly set to the reference number of the default shipping mode. The values of updateOrderItemId_i and shipModeId_i supplied in the URL are overridden.
copyAutoAddedOrderItems
This parameter name indicates whether to copy auto-added order items in OrderCopy.
blockInfoCopy
The default value for this parameter is Y. It will decide if the orderblock objects will be copied.
sensitiveInfoCopy
The default value for this parameter is N. It will decide if the payment methods will be copied.
prepare
The default value for this parameter is null. If the value is Y, the order will be prepared.
Note: The remerge, merge, check, allocate, backorder, and reverse parameters are applicable only if ATP inventory is enabled (see the STORE.INVENTORYSYSTEM column in the STORE table). They represent lists of order items that are passed to DoInventoryAction task command, which will invoke AllocateInventory when ATP is enabled. AllocateInventory calls the com.ibm.commerce.fulfillment.commands.CheckInventoryAvailabilityCmd, com.ibm.commerce.fulfillment.commands.AllocateExistingInventoryCmd, com.ibm.commerce.fulfillment.commands.AllocateExpectedInventoryCmd, com.ibm.commerce.fulfillment.commands.DeallocateExistingInventoryCmd, and com.ibm.commerce.fulfillment.commands.DeallocateExpectedInventoryCmd task commands as specified below. Also, these parameters accept order-item abbreviations, which are detailed in the help for Order Management subsystem URLs.
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 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=*&copyOrderItemId_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 partNumber is 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 were 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 

Example 5

The following example copies the order level information, payment information, and shipping address information from the order profile to order 1234:


http://myhostname/webapp/wcs/stores/servlet/OrderCopy?
&toOrderId=1234&shippingAddressFromOrderProfile=1&orderInfoFrom=q&paymentInfoFrom=q&URL=OrderItemDisplay

Behavior

  • The ResolveOrdersCmd and ResolveOrderItemsCmd task commands are called to resolve OrderId and OrderItemId abbreviations and determine which orders and order items are specified by the parameters.
  • The destination order is created in the ORDERS table with an order status of P, unlocked.
  • The CheckOrderCopyCmd task is called to verify the authority of the customer to copy information from the orders that are 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.
  • Shipping information is copied from the SHIPINFO table of the order that is specified by the orderInfoFrom parameter.
  • Payment information is read from the order specified by the payInfoFrom parameter, by calling the GetOrderPaymentInfoCmd task command. It is then 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. At present this task command is kept for compatibility with previous versions.
  • For each copyOrderItem_ i and updateOrderItem_ 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 prepare parameter is specified as Y, PrepareOrderCmd is called.
  • 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. The status of the destination order and its order items are changed to I in the ORDERS and ORDERITEMS tables. ValidateOrderAddressCmd is called to validate the billingAddressId after the order copy starts. If prepare parameter is specified as Y, OrderPrepare is called.
  • If blockInfoCopy is Y, order block objects will be copied.
  • If sensitiveInfoCopy is Y, payment methods will be copied.
  • 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 throws 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 are 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. The following name-value pairs are also set:
    • ERROR_CODE=603
    • orderId= the offending order ID
  • All OrderItemUpdate exception conditions also apply.