6.0.0.2 Update order items

This service updates an order item in the shopping cart. The client has a reference to the order facade client.

 

Usage scenario

  1. The client calls the order facade client method updateOrderItem() with the following parameters: (quantity,orderId,orderItemId,contractID,UOM).

  2. The OrderFacadeClient composes an SDO and calls the ChangeOrder service with the Update action code and with /Order/OrderItem as the XPath.

  3. The order item is updated in the WebSphere Commerce Server.

  4. The Order component responds with a RespondOrder BOD with the order ID and order item IDs that indicate that the update is a success.

Request

Request BOD ChangeOrder business object document (BOD)
Schema Order-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/ChangeOrder.xsd
Service data object

com.ibm.commerce.order.facade.datatypes.ChangeOrderType

 

Sample request BOD

<soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soapenv:Header />
        <soapenv:Body>
                <_ord:ChangeOrder
                       
xmlns:_ord="http://www.ibm.com/xmlns/prod/commerce/9/order"
                       
xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"
                       
xmlns:oa="http://www.openapplications.org/oagis/9"
                       
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <oa:ApplicationArea
xsi:type="_wcf:ApplicationAreaType">
                                <oa:CreationDateTime>
                                        2007-01-26T19:12:08.468Z
                                </oa:CreationDateTime>
                                <oa:BODID>
                                       
0f70e780-ad2e-11db-832d-831645b86890
                                </oa:BODID>
                        </oa:ApplicationArea>
                        <_ord:DataArea>
                                <oa:Change>
                                        <oa:ActionCriteria>
                                               
<oa:ActionExpression actionCode="Update"
                                                       
expressionLanguage="wc:XPath">
                                                       
/Order/OrderItem
                                               
</oa:ActionExpression>
                                        </oa:ActionCriteria>
                                </oa:Change>
                                <_ord:Order>
                                       
<_ord:OrderIdentifier>
                                               
<_wcf:UniqueID>.</_wcf:UniqueID>
                                       
</_ord:OrderIdentifier>
                                        <_ord:OrderItem>
                                               
<_ord:OrderItemIdentifier>
                                                       
<_wcf:UniqueID>540328</_wcf:UniqueID>
                                               
</_ord:OrderItemIdentifier>
                                                <_ord:Quantity
uom="C62">30.0</_ord:Quantity>
                                               
<_ord:ContractIdentifier>
                                                       
<_wcf:UniqueID>10001</_wcf:UniqueID>
                                               
</_ord:ContractIdentifier>
                                        </_ord:OrderItem>
                                        <_ord:OrderItem>
                                               
<_ord:OrderItemIdentifier>
                                                       
<_wcf:UniqueID>540327</_wcf:UniqueID>
                                               
</_ord:OrderItemIdentifier>
                                                <_ord:Quantity
uom="C62">40.0</_ord:Quantity>
                                               
<_ord:ContractIdentifier>
                                                       
<_wcf:UniqueID>10001</_wcf:UniqueID>
                                               
</_ord:ContractIdentifier>
                                        </_ord:OrderItem>
                                </_ord:Order>
                        </_ord:DataArea>
                </_ord:ChangeOrder>
        </soapenv:Body>
</soapenv:Envelope>

 

Response

The response is a RespondOrder BOD with order ID and order Item ID, and the order item has been added to the order.

Response BOD RespondOrder link to generated doc
Schema Order-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/RespondOrder.xsd
Service data object

com.ibm.commerce.order.facade.datatypes.RespondOrderType

The response contains the following information:

/Order/OrderIdentifier/UniqueID
/Order/OrderItem/OrderItemIdentifier/UniqueID

 

Sample response BOD

<soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soapenv:Header />
        <soapenv:Body>
                <_ord:RespondOrder
                       
xmlns:_ord="http://www.ibm.com/xmlns/prod/commerce/9/order"
                       
xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation">
                        <_ord:DataArea>
                                <_ord:Order>
                                       
<_ord:OrderIdentifier>
                                               
<_wcf:UniqueID>43137</_wcf:UniqueID>
                                       
</_ord:OrderIdentifier>
                                        <_ord:OrderItem>
                                               
<_ord:OrderItemIdentifier>
                                                       
<_wcf:UniqueID>540328</_wcf:UniqueID>
                                               
</_ord:OrderItemIdentifier>
                                        </_ord:OrderItem>
                                        <_ord:OrderItem>
                                               
<_ord:OrderItemIdentifier>
                                                       
<_wcf:UniqueID>540327</_wcf:UniqueID>
                                               
</_ord:OrderItemIdentifier>
                                        </_ord:OrderItem>
                                </_ord:Order>
                        </_ord:DataArea>
                </_ord:RespondOrder>
        </soapenv:Body>
</soapenv:Envelope>

 

Alternative flow

  1. The value for the "quantity" parameter is 0.

  2. The orderItem will be deleted in the WebSphere Commerce Server.

Exceptions

If there is something wrong with the parameter, the Order component fails to add the orderitems. The Order component responds with a RespondOrder BOD with ChangeStatus, which indicates that the update fails.

See the exception conditions for
OrderItemUpdate URL.

 

Customization

The following extensions are supported:

Related concepts

Service Data Objects (SDO)


Related Reference


WebSphere Commerce services
Order services