This command cancels the specified order by changing its order status to X, reversing any inventory allocations and canceling any backordered items.
This command does not remove the order from the database. Only orders with Status "A", "B", "C", "I", "L", "M", "N", or "W" can be canceled, since those values indicate that the customer or buying organization has not yet committed to pay for the order.
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 URL to be called when the command completes successfully.
- storeId
- The store associated with the order.
- orderId
- (Required) The reference number of the order to cancel.
Example
The following example cancels the order whose reference number is 1 and displays the shopping cart.
http://myhostname/webapp/wcs/stores/servlet/OrderCancel? orderId=1&URL=/webapp/commerce/InterestItemDisplay
Behavior
- Checks to see if the order exists and that its Status attribute specifies "A", "B", "C", "I", "L", "M", "N", or "W". If not, returns an error.
- Cancels the specified order by changing its order status to X.
- De-allocates existing and expected inventory by calling the AllocateInventory task command and specifying all OrderItems for the order in the reverseOrderItems parameter.
Exception conditions
If the OrderId specified is invalid or if the order status is not "A", "B", "C", "I", "L", "M", "N", or "W" then no processing occurs and the command execution fails.