OrderPrepare URL

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

URL

OrderPrepare

Controller command

com.ibm.commerce.order.commands.OrderPrepareCmd

Implementation class

com.ibm.commerce.order.commands.OrderPrepareCmdImpl

Commands called

ValidateShippingAdjustmentCmd

PrepareOrderCmd

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 OrderPrepare URL.

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 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 is 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 is started for each order to be prepared. The default value of this parameter is 0.
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. Order items 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 order items that are 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 are to be checked by the CheckInventory task command. This parameter can be repeated.
allocate
A list of order items that are to be allocated from existing inventory. This parameter can be repeated.
backorder
A list of order items that are to be allocated from expected inventory. This parameter can be repeated.
reverse
A list of order items whose allocations are to be released (that is, de-allocated from existing or expected inventory, as appropriate). This parameter can be repeated.
keepAutoAddedOrderItemsBeforeCalculate
Indicates if the automatically-added order items in the order need to be kept (true) or removed (false) before the order is calculated. The default value is false.
Note for ATP inventory: The remerge, merge, check, allocate, backorder and reverse parameters are applicable only if ATP inventory is enabled (see INVENTORYSYSTEM column in the STORE table). They represent lists of order items that are passed to DoInventoryActionCmd. This command invokes AllocateInventory task command, which 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, GetEligibleFulfillmentCenters, ReserveInventory, AdjustInventoryReservation 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=*
  • merge=*n
  • check=*n
  • allocate=*
  • backorder=*
  • reverse=*
Note: If you want all order items for a store to be allocated in the OrderPrepare command, pass reverse=*n with allocate=*.
WebSphere Commerce Version 7.0.0.3WebSphere Commerce Version 7.0.0.6WebSphere Commerce Version 7.0.0.5WebSphere Commerce Version 7.0.0.2WebSphere Commerce Version 7.0.0.4For Oracle Users with ATP inventory, the fix for APAR LI75719 lets you turn off locking of the itemspec table for better performance. If you install the fix for APAR LI75719, you must also take the following additional steps to disable locking:
  1. Go to the WC_eardir/xml/config/ directory.
  2. Open the wc-server.xml file.
  3. Add the following line any place between <InstanceProperties> and </InstanceProperties> as a child of InstanceProperties:
    <ATPInventoryPerformanceParameters lockItemSpecEnabled="false"/>

Example

The following example prepares an 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

Check if the order is locked by the current CSR. If the order is not locked and called by a CSR, or if it is locked by another CSR, an exception is thrown

Call ValidateShippingAdjustmentCmd to validate that the order has not changed since a shipping adjustment was added

Call PrepareOrderCmd to do pricing, inventory and calculation on the order

Exception conditions

  • If no orders match the specified parameters, the command throws the ECApplicationException exception specifying the ErrorOrderNoneCmd error view command.
  • If any of the products or items in the order are not buyable, the command throws the ECApplicationException exception specifying the BadOrderDataErrorView error view command. For further information about exception conditions for order errors, refer to Error Codes for Order Error Views.
  • The command throws the ECApplicationException exception, specifying the RetrievePriceErrorView error view command if any of the following conditions are true:
    • Input trading agreements (contracts) are not valid or eligible for use.
    • Trading agreements that are used in the order apply payment methods that are incompatible.
    • Price Lists cannot be retrieved for any of the products or items.
  • If any calculation indicated by the USAGEFLAGS column in the STENCALUSG table was unable to calculate a value for each order item in an order, and if the USAGEFLAGS column in the STENCALUSG table indicates that a value must be calculated, then an ECApplicationException exception is thrown.
  • If an order has no order items, an ECApplicationException exception is thrown.