OrderPrepare command

This command prepares an order by determining prices, discounts, shipping charges, and taxes for an order. If an order reference number is not specified, all current pending orders will be prepared for the current customer at the given store.

Command structure

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

Diagram of the command structure: the command starts with the fully qualified name of your WebSphere Commerce Server and the configuration path, followed by the command name, OrderPrepare  and the ? character. End the command with a list of parameters in the form of name value pairs. Separate each name value pair with the & character. For a detailed description of the parameters and their values, refer to the list entitled Parameter values.

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 URL to be called when the command completes successfully.
storeId
The reference number of the store for which the order is to be prepared.
orderId
The reference number of the order to be prepared. If this parameter is omitted, this command defaults to the current pending orders. See Order abbreviations for a description. This parameter can be repeated.
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 the prepared order. If the name is not provided, the default name orderId will be used. This parameter can be repeated.
commit
Controls whether each order is processed in a separate database transaction. A value of 0 specifies that all orders be prepared in one transaction; a value of 1 specifies that a new transaction be started for each order to be prepared.  The default value of this parameter is 0.
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. OrderItems are not merged unless their InventoryStatus is "NALC", or they are specified by one or more of the allocate, backorder, and reverse parameters. 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:

Example

The following example prepares the order with reference number 1 and redirects to the OrderDisplay command to view this order.

     http://myhostname/webapp/wcs/stores/servlet/OrderPrepare?orderId=1
     &URL=/webapp/commerce/OrderDisplay

Behavior

Exception conditions