OrderItemUpdate URL

OrderItemUpdate URL updates order items in an existing order.

URL

OrderItemUpdate

Controller command

com.ibm.commerce.orderitems.commands.OrderItemUpdateCmd

Implementation class

com.ibm.commerce.orderitems.commands.OrderItemUpdateCmdImpl

Commands called

Screen capture
Legend

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

Parameter values

The parameters that are not marked as required are optional. Optional parameters are for customization purposes.

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.
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.
URL
Required: The URL to be called when the command is completed successfully.
orderItemId_ i
The identifier of the OrderItem to be updated. If specified, then the catEntryId_i and partNumber_i parameters (for the same value of i) are ignored.
storeId
The store identifier, which is mandatory only if you want to add products or items to the orders. The storeId is required to check if the item is available in the store. If you have specified the storeId once, it is cached for future use.
catEntryId_ i
The identifier of a catalog entry to be used to create a new OrderItem.
partNumber_ i
If partNumber is specified, then the catEntryId_i parameter is ignored. When the partNumber_i and memberId_i parameters are specified, they determine a catalog entry by selecting the PARTNUMBER and MEMBER_ID columns in the CATENTRY table. This command behaves as if the identifier for that catalog entry were specified as the value for catEntryId_i.
expandConfigurationId_ i
If specified, then add an OrderItem for each component identified by this parameter whose orderItemId attribute is null.
memberId_ i
The identifier for the member that owns the catalog where the order will be placed. To achieve compatibility with previous versions of WebSphere Commerce, set memberID to *storeOwner. This specifies the memberID of the owner of the current Store object.
attrName_ i
Any distinct attribute that is defined for the item. This parameter can be repeated.
attrValue_ i
The value of the attribute in attrName. This parameter can be repeated.
quantity_ i
The quantity of the item to be added to the order. This parameter is required when catEntryId_i or partNumber_id are specified. It is optional when OrderItemId_i is specified.
UOM_ i
The unit of measure for quantity_i. This value should match one of the primary keys in the QTYUNIT table. When it is not specified, then the value of the QUANTITYMEASURE column of the CATENTSHIP table for the row with the same CATENTRY_ID as the OrderItem is used, and the value of the quantity_i parameter is multiplied by the NOMINALQUANTITY column of the same row in the CATENTSHIP table.
addressId_ i
The identifier of the address to which the products and items are shipped.
shipModeId_ i
The reference number of the shipping mode to be used for the product or item.
comment_ i
A Comment to be included with the created or updated order items.
contractId_ i
The ID of the contract associated with the order. This parameter can be repeated.
field1_ i
A store-reserved integer value.
field2_ i
A store-reserved text value. This parameter accepts up to 254 characters.
offerId_ i
The ID of the offer associated with the order. This parameter can be repeated.
orderId
This is an internally-generated identifier that specifies zero or more orders to be updated, using order reference numbers or one of the special abbreviations "**", ".", "*", ".t", "*t". See Order abbreviations for a description of these abbreviations. If no pending orders exist for a particular store, a new pending order will be created. If more than one pending order is specified, order item entries will be created or updated for each of the specified orders.
outOrderName
Specifies the names of name-value pairs to be added to the redirection URL. The values of the added name-value pairs are the reference numbers of the created or updated orders.
outOrderItemName
Specifies the names of name-value pairs to be added to the redirection URL. The values of the added name-value pairs are the reference numbers of the created or updated order items.
listId
The interest item list ID. When you specify this parameter, the OrderItemUpdate command will create a new order which contains all the items in the list. You may use one of the special abbreviations "." and "*". See the Catalog abbreviations for a description.
orderDesc
Specifies the description for the new order created by this command.
continue
Controls whether the order-item update continues when one or more items cannot be created or updated. A value of 0 terminates and rolls back execution if an order item cannot be created or updated in the target order; a value of 1 ignores the create or update operation for that order item and continues execution. The default value is 0.
orderComment
Sets the order comment if specified.
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 CheckInventoryAvailability 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 if they are not allocated from existing 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.
configurationId_ i
If this OrderItem represents a configured Dynamic Kit, this is the configuration ID. This parameter can be repeated.
continue
If an OrderItem cannot be created, 0 - terminate execution and rollback, and 1 - ignore the create or update operation for that OrderItem and continue execution.
expandConfigurationId_ i
Add multiple OrderItems, one for each component identified by expandConfigurationId_ i whose orderItemId attribute is null.
isExpedited_i
The default value for this parameter is N. If it is Y, orderitem will be marked as EXPEDITED.
calculateOrder
The default value for this parameter is 0. If it is 1, OrderCalculateCmd will be called to calculate the charges for the order.
requestedShipDate_ i
Marks the requested shipping date for an orderitem.
shipInstructions_ i
Specifies shipping instructions for one shipmode.
shipChargTypeId_ i
Results in shipping charge policy, charge by carrier or charge by merchant.
shipCarrAccntNum_ i
The shipping carrier account number.
externalId_ i
The unique gift registry external identifier.
giftMessage_ i
A message provided by the gift giver to the gift registrant.
shipToRegistrant_ i
Specifies where gifts should be delivered. A value of 1 indicates that gifts should be shipped directly to the gift registrant, using the address provided during gift registry profile creation.
doPrice
Specifies whether the command should perform the price calculation subtasks. Set to either do the price tasks (Y), or not (N). Turning off these tasks might result in better performance, but customers might not get the most current price, or product entitlement, when changes occur.
doInventory
Specifies whether the command should perform the inventory calculation subtasks. Set to either do the price tasks (Y), or not (N). Turning off these tasks might result in better performance, but customers might not get the most current inventory level, when changes occur.

Note for ATP inventory: The remerge, merge, check, allocate, backorder and reverse parameters are applicable only if ATP inventory is enabled (see the INVENTORYSYSTEM column in the STORE table). They represent lists of OrderItems that will be passed to the DoInventoryActionCmd which invokes 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 URLs.

The default ATP parameter values are as follows:

  • remerge=*n
  • merge=*n
  • check=***
  • allocate=*n
  • backorder=*n
  • reverse=*n

Example 1

The following example creates a shipping record for one unit of a catalog entry with reference number 18 and has an attribute of monogram CJK. This shipping record is added to the customer's current pending orders. When the command completes, the OrderItemDisplay command is called.


   
http://myhostname/webapp/wcs/stores/servlet/OrderItemUpdate?addressId=2
   
&catEntryId=18&attrName=monogram&attrValue=CJK&quantity=1&shipModeId=4
    &URL=OrderItemDisplay

Example 2

The following example adds ten units of catalog entry number 2 to all the customer's current pending orders. When the command completes, the OrderItemDisplay command is called.


   
http://myhostname/webapp/wcs/stores/servlet/OrderItemUpdate?catEntryId=2
   
&quantity=10&orderId=*&outOrderName=orderId&URL=/webapp/wcs/stores/servlet/OrderItemDisplay

Example 3

The following example updates three OrderItem IDs.


   
http://myhostname/webapp/wcs/stores/servlet/OrderItemUpdate?URL=OrderItemDisplay
   
&quantity_1=2&quantity_2=7&orderItemId_1=117&orderItemId_2=118
    &orderItemId_3=113&quantity_3=2

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.

If orderItemId is passed in:
  • Update existing order item with any of the following information that is passed in: requestedShipDate, isExpedited, tieCode, quantity, correlationGroup, itemSpecId, comments, description, field1, field2
  • Record the new order item as touched
  • If quantity is 0, delete the order item and call DoInventoryActionCmd to reverse the inventory update
  • If the order item is a kit or package, call AddOrderItemComponentsCmd to update the component lists
Otherwise if orderId is passed in:
  • Update order level shipping information:
    • For all order items in the order:
      • Update the requestedShipDate if passed in for the order item
      • Record the new order item as touched
        Notes:
        • When both shipModeId and addressId are passed, the shipModeId is updated only if the passed addressId is identical to the existing addessId of the order item. If the addressId values are not identical, the shipModeId is not updated.
        • When only one of either shipModeId or addressId is passed, either shipModeId or addressId is updated accordingly.

Copy specified wish list items to order items

Update comments, description and shipAsComplete for order

For all the updated items:
  • Call ResolveOrderItemPriceCmd to calculate the best price and update order total
  • Pass in parameter doPrice to ResolveOrderItemPriceCmd to control whether the order items can skip pricing again
  • Call UpdateShippingAddressCmd to update shipping address
  • Update shipping mode
  • Call ValidateTradingPaymentCmd to validate the payment method is compatible with the trading agreement
  • If doInventory = Y, call DoInventoryActionCmd to update the fulfillment centers and check for available inventory
  • Call UpdateShipInfoCmd to update the shipping instructions, shipping account number and shipping charge type
  • Call RaiseOrderEventCmd to raise ORDERITEM_CREATION_EVENT or ORDERITEM_UPDATE_EVENT
  • If the flag calculateOrder is set:
    • Call OrderCalculateCmd to do calculations based on the calUsageIds passed in
  • Call ExtendOrderItemProcessCmd to execute any customization logic

Exception conditions

Different exception tasks are called depending on the error.

  • If any parameter value is invalid, the command throws an ECApplicationException with message: _ERR_INVALID_INPUT and error view: InvalidInputErrorView.
  • If the partNumber is specified but it cannot be found in the catalog, the command throws an ECApplicationException with message: _ERR_PROD_NOT_EXISTING and error view: badPartNumberErrorView.
  • ECApplicationException is thrown too if the following errors are encountered:
    1. Input trading agreements are not valid or eligible to use.
    2. Trading agreements that are used in the order apply incompatible payment methods.
    3. Price Lists cannot be retrieved
  • When checking inventory for a non-ATP store, if sufficient inventory is on hand, the inventory check passes. Otherwise, the check fails. If the check fails, ECApplicationException is thrown from ResolveFulfillmentCenterCmd with message: _API_CANT_RESOLVE_FFMCENTER and error view: ResolveFulfillmentCenterErrorView, unless the continue parameter is specified as 1.

    When checking inventory for an ATP store, the inventory check passes if either the current inventory or expected inventory is sufficient. In cases where both are insufficient, and the base item cannot be back ordered in this store (refer to STOREITEM table), or the item specification has been discontinued (refer to ITEMSPC table), the inventory check fails and ECApplicationException is thrown from CheckInventoryAvailabilityCmd with message: _API_BAD_INV and error view: CheckInventoryErrorView.

  • If there is more than one such CatalogEntry object, the part number is ambiguous. ECApplicationException is thrown specifying the ERR_PROD_NOT_EXISTING error message. Pass Error Name-Value Pairs as follows:
    • multiplePartNumberList specifies the ambiguous part numbers
    • multiplePartNumberQuantityList specifies the corresponding requested quantities, one for each ambiguous part number
    • multiplePartNumberCatalogEntriesList specifies vectors of CatalogEntry identifiers, one for each ambiguous part number. Each vector contains a list of CatalogEntry identifiers of CatalogEntry objects having the ambiguous part number.
  • If an orderitem is not associated with a gift registry and the shipToRegistrant_ i is set to 1, an exception is thrown.