OrderCancel URL

Cancel the specified order by changing its order state, reversing any inventory allocations, and canceling any backordered items. This URL does not remove the order from the database. OrderCancel can cancel orders with an order status of A, B, C, I, L, M, N.

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 OrderCancel 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 that is called when the command completes successfully.
storeId
The store that is associated with the order.
orderId
Required: The reference number of the order to cancel.
forcedCancel
Optional: This parameter is used to cancel an order that has deposited payment. If there are deposit transactions for an order, the order can be canceled only if the parameter is set to forcedCancel=true. The default value is false.
forcedCancelWithRefund
Optional: This parameter is used to perform payment refund during the cancellation of an order. The prerequisites for this parameter are:
  • There must be deposited payment transactions in the order before the order is cancelled.
  • The forcedCancel parameter must be set to true.
If these prerequisites exist, the payment is refunded to the original payment method. The default value of the forcedCancelWithRefund parameter is false.

Example

The following example cancels an order with a reference number of 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, it 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 order items for the order in the reverseOrderItems parameter.
  • Cancels the payment.
  • If there is a pending order approve request for a B2B buyer, this URL cancels it.
  • If the order has deposited payments and the forcedCancel parameter is true, the order is canceled and no payment refund action is triggered. If the order has deposited payments and both of the parameters forcedCancel and forcedCancelWithRefund are true, the order is cancelled and the payment refund action is performed.

Exception conditions

If the order ID 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.