Order preprocessing
The order preprocessing service is an inbound service for orders that have been submitted and transferred to an external order management system (OMS) but are modified post-transfer and require preprocessing by WebSphere Commerce before they can be processed by the external OMS.
When to use this interface
You should use the order preprocessing interface when working with existing projects or development tasks.
If we are working on a new project or development task, use the Order preprocessing service interface instead.
This service will perform the following tasks on an order:
- Validate the terms and conditions (for example product entitlement) of the contracts referenced by its order items
- Refresh the prices of its order items
- Calculate the adjustments (for example discounts) and charges (for example shipping and tax) of its order items
Note that the order may or may not have originated from WebSphere Commerce. If the order does exist, it will be updated based on the information provided in the request. If the order does not exist, a temporary order will be created based on the information provided in the request. Then the tasks described above will be performed. Finally, the order, with updated prices, adjustments and charges, will be returned as the response.
Requests to this service are in the form of PreprocessSalesOrder business object documents (BODs). Responses of this service are in the form of ShowSalesOrder BODs, or SOAPFaults in case of exceptions.
Mapping
This service is mapped to the SalesOrderPreprocess command. The following table describes how the PreprocessSalesOrder BOD will be mapped to the input parameters of this command
XPath Input Parameter Mandatory Description DataArea/SalesOrder/SalesOrderHeader this element contains the order level information DataArea/SalesOrder/SalesOrderHeader/DocumentID/ID orderId n the WebSphere Commerce order ID, if the order originates from WebSphere Commerce DataArea/SalesOrder/SalesOrderHeader/CustomerParty/PartyIDs/ID customerId y the customer's WebSphere Commerce user ID DataArea/SalesOrder/SalesOrderHeader/SalesOrganizationIDs/ID storeId y the WebSphere Commerce store ID DataArea/SalesOrder/SalesOrderHeader/TransportationTerm[i] each of these elements represent a shipping charge override DataArea/SalesOrder/SalesOrderHeader/TransportationTerm[i]/FreightTermCode shipModeId_i n the WebSphere Commerce shipping mode ID of the shipping charge override DataArea/SalesOrder/SalesOrderHeader/TransportationTerm[i]/PolicyID shipChargTypeId_i n the WebSphere Commerce shipping charge type ID of the shipping charge override DataArea/SalesOrder/SalesOrderHeader/TransportationTerm[i]/AccountNumber shipCarrAccntNum_i n the shipping carrier account number of the shipping charge override DataArea/SalesOrder/SalesOrderHeader/TransportationTerm[i]/Discount/PaymentBasisCode overrideReasonCode_i n the override reason code of the shipping charge override DataArea/SalesOrder/SalesOrderHeader/TransportationTerm/Discount/DiscountPercent adjustmentPercentageValue_i n the adjustment percentage value of the shipping charge override DataArea/SalesOrder/SalesOrderLine[j] each of these elements represent an orderitem DataArea/SalesOrder/SalesOrderLine[j]/LineNumber orderItemId_j n the WebSphere Commerce orderitem ID of the j-th orderitem DataArea/SalesOrder/SalesOrderLine[j]/Item/ItemID/ID catEntryId_j n the WebSphere Commerce catalog entry ID of the j-th orderitem DataArea/SalesOrder/SalesOrderLine[j]/Item/SupplierItemID/ID partNumber_j n the part number (SKU) of the j-th orderitem DataArea/SalesOrder/SalesOrderLine[j]/Item/Specification/Property/NameValue[@name="contractId"] contractId_i n the WebSphere Commerce contract ID of the j-th orderitem DataArea/SalesOrder/SalesOrderLine[j]/Item/Specification/Property/NameValue[@name="offerId"] offerId_i n the WebSphere Commerce offer ID of the j-th orderitem DataArea/SalesOrder/SalesOrderLine[j]/Quantity quantity_j y the quantity of the j-th orderitem DataArea/SalesOrder/SalesOrderLine[j]/Quantity/@unitCode UOM_j n the unit of measure (UOM) of the quantity above DataArea/SalesOrder/SalesOrderLine[j]/UnitPrice this element represents the price override of the j-th orderitem, if any DataArea/SalesOrder/SalesOrderLine[j]/UnitPrice/Amount price_j n the price of the price override DataArea/SalesOrder/SalesOrderLine[j]/UnitPrice/Amount/@currencyID currency_j n the currency of the price override DataArea/SalesOrder/SalesOrderLine[j]/SpecialPriceAuthorizationCode overrideReasonCode_j n the override reason code of the price override DataArea/SalesOrder/SalesOrderLine[j]/TransportationTerm/FreightTermCode shipModeId_j n the WebSphere Commerce shipping mode ID of the j-th orderitem DataArea/SalesOrder/SalesOrderLine[j]/ShipToParty/Location/Address this element represents the shipping address of the j-th orderitem DataArea/SalesOrder/SalesOrderLine[j]/ShipToParty/Location/Address/ID addressId_j n the WebSphere Commerce address ID of the shipping address DataArea/SalesOrder/SalesOrderLine[j]/ShipToParty/Location/Address/LineOne address1_j n the line 1 field of the shipping address DataArea/SalesOrder/SalesOrderLine[j]/ShipToParty/Location/Address/LineTwo address2_j n the line 2 field of the shipping address DataArea/SalesOrder/SalesOrderLine[j]/ShipToParty/Location/Address/LineThree address3_j n the line 2 field of the shipping address DataArea/SalesOrder/SalesOrderLine[j]/ShipToParty/Location/Address/CityName city_j n the city field of the shipping address DataArea/SalesOrder/SalesOrderLine[j]/ShipToParty/Location/Address/ CountrySubDivisionCode[@name="state"] state_j n the state field of the shipping address DataArea/SalesOrder/SalesOrderLine[j]/ShipToParty/Location/Address/CountryCode country_j n the country field of the shipping address DataArea/SalesOrder/SalesOrderLine[j]/ShipToParty/Location/Address/PostalCode zipCode_j n the zip code field of the shipping address
Example
The following is a sample request and its corresponding response:
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd"> <wsse:UsernameToken> <wsse:Username>wcsadmin</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wssusername-token-profile-1.0#PasswordText">*********</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <wc:PreprocessSalesOrder releaseID="9.0" version="9.1" versionID="9.1" xmlns:oa="http://www.openapplications.org/oagis/9" xmlns:wc="http://www.ibm.com/xmlns/prod/WebSphereCommerce" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/WebSphereCommerce ../BODs/PreprocessSalesOrder.xsd "> <oa:ApplicationArea> <oa:CreationDateTime>2001-12-31T12:00:00</oa:CreationDateTime> <oa:BODID>2001-12-31T12:00:00[wcsadmin]localhost</oa:BODID> </oa:ApplicationArea> <wc:DataArea> <wc:Preprocess/> <oa:SalesOrder> <oa:SalesOrderHeader> <oa:CustomerParty> <oa:PartyIDs> <oa:ID>2</oa:ID> </oa:PartyIDs> </oa:CustomerParty> <oa:SalesOrganizationIDs> <oa:ID>10001</oa:ID> </oa:SalesOrganizationIDs> </oa:SalesOrderHeader> <oa:SalesOrderLine> <oa:Item> <oa:SupplierItemID> <oa:ID>FULO-0101</oa:ID> </oa:SupplierItemID> </oa:Item> <oa:Quantity unitCode="C62">1</oa:Quantity> <oa:ShipToParty> <oa:Location> <oa:Address> <oa:LineOne>234 Main Street</oa:LineOne> <oa:CityName>Toronto</oa:CityName> <oa:CountrySubDivisionCode name="state">ON</oa:CountrySubDivisionCode> <oa:CountryCode>CA</oa:CountryCode> <oa:PostalCode>M1M1M1</oa:PostalCode> </oa:Address> </oa:Location> </oa:ShipToParty> </oa:SalesOrderLine> </oa:SalesOrder> </wc:DataArea> </wc:PreprocessSalesOrder> </soapenv:Body> </soapenv:Envelope>
Response:
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header/> <soapenv:Body> <oa:ShowSalesOrder releaseID="9.0" versionID="9.1" xmlns:oa="http://www.openapplications.org/oagis/9"> <oa:ApplicationArea> <oa:CreationDateTime>2005-12-15T16:14:43</oa:CreationDateTime> <oa:BODID>2005-12-15T16:14:43[wcsadmin]</oa:BODID> </oa:ApplicationArea> <oa:DataArea> <oa:Show/> <oa:SalesOrder> <oa:SalesOrderHeader> <oa:DocumentID> <oa:ID>24001</oa:ID> </oa:DocumentID> <oa:Status> <oa:Code>T</oa:Code> </oa:Status> <oa:CustomerParty> <oa:PartyIDs> <oa:ID>2</oa:ID> </oa:PartyIDs> </oa:CustomerParty> <oa:TotalAmount currencyID="USD">359.99000</oa:TotalAmount> <oa:PaymentTerm/> <oa:DistributedCharge type="-6"> <oa:ID>1234</oa:ID> <oa:Description/> <oa:Amount currencyID="USD">5.00</oa:Amount> </oa:DistributedCharge> <oa:DistributedCharge type="-2"> <oa:Amount currencyID="USD">0</oa:Amount> </oa:DistributedCharge> <oa:SalesOrganizationIDs> <oa:ID>10001</oa:ID> </oa:SalesOrganizationIDs> </oa:SalesOrderHeader> <oa:SalesOrderLine> <oa:LineNumber>150001</oa:LineNumber> <oa:Item> <oa:ItemID> <oa:ID>10002</oa:ID> </oa:ItemID> <oa:SupplierItemID> <oa:ID>FULO-0101</oa:ID> </oa:SupplierItemID> <oa:Specification> <oa:Property> <oa:NameValue name="contractId">10001</oa:NameValue> </oa:Property> <oa:Property> <oa:NameValue name="offerId">10002</oa:NameValue> </oa:Property> </oa:Specification> </oa:Item> <oa:Quantity unitCode="C62">1.0</oa:Quantity> <oa:UnitPrice> <oa:Amount currencyID="USD">449.99</oa:Amount> <oa:PerQuantity unitCode="C62">1.0</oa:PerQuantity> </oa:UnitPrice> <oa:TotalAmount currencyID="USD">359.99</oa:TotalAmount> <oa:ShipToParty> <oa:Location> <oa:Address> <oa:LineOne>234 Main Street</oa:LineOne> <oa:LineTwo/> <oa:LineThree/> <oa:CityName>Toronto</oa:CityName> <oa:CountrySubDivisionCode name="state">ON</oa:CountrySubDivisionCode> <oa:CountryCode>CA</oa:CountryCode> <oa:PostalCode>M1M1M1</oa:PostalCode> </oa:Address> </oa:Location> </oa:ShipToParty> <oa:TransportationTerm> <oa:FreightTermCode>10001</oa:FreightTermCode> </oa:TransportationTerm> <oa:PaymentTerm> <oa:Discount type="-1"> <oa:ID>10005</oa:ID> <oa:Description>Save 20% on Furniture!</oa:Description> <oa:Amount currencyID="USD">90.0</oa:Amount> </oa:Discount> <oa:Discount type="-1"> <oa:ID>10008</oa:ID> <oa:Description>Repeat customers save $5.00 USD</oa:Description> <oa:Amount currencyID="USD">5.0</oa:Amount> </oa:Discount> </oa:PaymentTerm> <oa:DistributedCharge type="-6"> <oa:ID>1234</oa:ID> <oa:Description/> <oa:Amount currencyID="USD">5.00000</oa:Amount> </oa:DistributedCharge> <oa:DistributedCharge type="-2"> <oa:Amount currencyID="USD">0</oa:Amount> </oa:DistributedCharge> <oa:DistributionCenterCode>10001</oa:DistributionCenterCode> </oa:SalesOrderLine> </oa:SalesOrder> </oa:DataArea> </oa:ShowSalesOrder> </soapenv:Body> </soapenv:Envelope>
WSDL
The WSDL file of this service can be found in the following JAR file:
- workspace_dir/WebSphereCommerceWebServices.jar
Under the following path:
- META-INF/jaxrpc/WebSphereCommerce/WebSphereCommerce-OMS.wsdl
Related tasks
Enable WebSphere Commerce as a service provider
Related reference
Inbound web services provided