Reference > Shop flow URLs > Order Management subsystem URLs > Orders URLs
AdvancedOrderEditBegin URL
Sets up an order for editing or changes and begins an edit session. It attaches an editor ID to the order. This URL checks whether the order and order items are editable, and if it so, changes the status to E. Meanwhile, if the order and order items are in a shopping cart, no status change is made. Orders that have already been submitted can be changed before they are released to fulfillment.
- If the order is in the PRC (major status) state, the URL moves the order state from PRC (processing) to EDT (edit) so the order can be changed. The member ID value (logical owner of the order) is stored in the ORDERS table as the EDITOR_ID. An EDITOR_ID is an authorized and logged in member who invoked the AdvancedOrderEditBeginCmd command.
- If the order is in the NEW state, the URL enables the member ID (and EDITOR_ID) to be attached, but it leaves the order state in the NEW state.
- If the order is in the EDT state, the URL enables the member ID (and EDITOR_ID) to be overwritten, and the order remains in the EDT state.
- If the order is not in the PRC, EDT, or NEW state, the URL fails.
Editor IDs can be overwritten with a new value when some other user runs the command. The editing control is designed to be loose at the server side so that orders can be open for change by using a user interface. The full history of the changes made to an order by using this URL are not tracked.
After an order is in EDT state, as in the NEW state, normal changes can be made to the order. For example, you can:
- Add an item to the order (or remove an item).
- Change the quantity of an item in the order.
- Change the shipping address, shipping mode, or shipping instructions (such as Expedite, Future Ship Date, and so on).
- Change a payment method, a credit card number, or card expiration date.
- Change a comment in the order.
- Cancel or close the order.
After an order becomes editable, you can use the most common commands to take further action. For example, commands in the following API packages can be used (not a comprehensive list):
- com.ibm.commerce.order.commands
- com.ibm.commerce.orderitem.commands
- com.ibm.commerce.edp.commands
You should not use other methods to edit the order. For example, you should not do direct edits on the OrderBean object.
URL structure
name-value pair with the & character. For a detailed description of the parameters and their values, see the list entitled Parameter values." />
- http:// host_name/path/
- The fully qualified name of the WebSphere Commerce Server and the configuration path.
Parameter values
- orderId
- Required: The identifier of the order to edit or change.
Example
The following example sets up order 112233 to be edited (the assumption is that the order is in PRC state already):
http://host_name/webapp/wcs/stores/servlet/AdvancedOrderEditBegin?orderId=112233
The member ID of the WebSphere Commerce user issuing the command is attached to the order specified, and the order is moved to EDT state.
Behavior
- Calls the AdvancedOrderEditBeginCmd controller command and sets up the order for editing. Determines if the order is editable. The order is editable if the major status of the order is EDT, NEW, or PRC. If the order was already in PRC state, the order state is changed to EDT. If the order is in NEW state, the NEW state remains.
- Attaches a member ID to the order in the ORDERS table to identify who is making the edit and records the member ID as the value for EDITOR_ID. The MEMBER_ID field stores the ID of the customer who is normally the creator of the order, but it can also be the ID of someone who creates or updates the order on behalf of the customer. The member ID represents the logical owner of an order. The EDITOR_ID has to be a member. The EDITOR_ID records the member ID who last edited the order by using the AdvancedOrderEditBeginCmd. Editing an order does not necessarily change the MEMBER_ID value of an order.
- Sets the prepare flags of the existing items to prevent items from being repriced (the order items skip repricing). Note: Adding an order item does not cause repricing of previously existing items. Removing an order item forces a repricing because some forms of promotions may no longer be applicable. Changing the quantity of an order item also forces repricing. Because changes typically involve a change to the order amount, a call to the event-driven payments subcomponent occurs for all forms of edits.
- Enables changes to be made to the order. Normal order commands can be run, but those commands must examine the order to determine if the requested action can take place. For example:
- At the order item level, these commands can be run: OrderItemAddCmd, OrderItemUpdateCmd, OrderItemDeleteCmd.
- At the order level, these commands can be run: OrderCopyCmd, OrderCancelCmd, OrderPrepareCmd, OrderProcessCmd, OrderCloseCmd.
- Payment actions that can be performed on the order include: adding, removing, editing payment instructions (PIAdd, PIRemove, PIEdit) or canceling the order. These commands and actions are extensible.
- Does not restrict edits to any particular WebSphere Commerce user (member ID). After an order is set up for editing, subsequent changes to the order can be made by any other member ID. If a WebSphere Commerce user is editing an order, there is nothing that prevents some other user from beginning to edit this order. (In the case of the IBM Sales Center, the subsequent user receives a warning message in the client application but is allowed to overwrite changes made by the previous user that were not submitted.) Since normal Web users are not allowed access to an order in the EDT state, the order cannot be modified by both a Web user and a CSR at the same time. It is the responsibility of any client application to examine the order by using the appropriate data bean, determine whether the order is already being edited by someone else (it has a member ID attached to it), and to proceed with the order as appropriate (for example, to provide an alert to the user so that intentional delegation is provided while protecting the order).
To illustrate, the following example shows the behavior when a user attempts to work on an order already being handled by another user:
- CSR1 is in the process of changing an order that was just submitted. The AdvancedOrderEditBegin command enables the order to be edited.
- CSR2 receives a phone call to change the same order. She finds the order and notices that the order is being edited by CSR1. The system provides a warning against overwriting someone else's work. CSR2 decides to have the call transferred to CSR1.
- CSR1 receives the request from CSR2, makes the order change, and submits the order for processing. The value of the EDITOR_ID field in the ORDERS table is the member ID of CSR1. (If CSR2 decided to make the order change herself despite the warning, any changes not submitted by CSR1 are overwritten with the changes made by CSR2. The EDITOR_ID field in the ORDERS table contains the member ID of CSR2.
- After an order has a WebSphere Commerce member ID attached to it in the ORDERS table, the member ID value will remain until AdvancedOrderEditEnd URL is run (or AdvancedOrderEditEndCmd is run), at which time the member ID is removed from the order. The order does not have to be manually released for order processing to occur.
- CSR1 can use the AdvancedOrderEditBegin URL to take control of the order away from CSR1. The state of the order will remain in either NEW (if the order is new) or EDT (if the order was previously in EDT state).
Important! Orders that have been moved from PRC to EDT state by using this URL are not protected from external access. Customers cannot access the order in the storefront, but they can still access and manipulate the order by using direct use of the URL to the standard set of order capture commands. For example, a customer, Mike, shops at a store and submits an order for one coffee maker, and later decides to add a new item to the order. Mike calls the call center and asks the CSR to change the order. The CSR uses the IBM Sales Center and puts the order into EDT state. While on the phone with the CSR, Mike stalls the CSR and modifies the order by issuing a URL query from his browser to increase the quantity to 100 (for example, http://www. company.com/webapp/wcs/stores/servlet/OrderItemUpdate?orderItemId=1000122$quantity=100). He then informs the CSR that he no longer wanted to change the order. The CSR resubmits the order. In reality, the subsequent processing done by OrderPrepare and OrderProcess would know the quantity of the item that was changed and act accordingly. This situation is unlikely, but it could occur and the order could be modified externally by a customer.
Exception conditions
- User is not authorized to invoke the command.
- Authorized user has not logged in.
- Invalid major status: Order is in a state other than PRC, EDT, or NEW.
Related concepts
Related reference
Order Management subsystem URLs