Click or drag to resize

IeCommerceServiceBasketCalc Method

Send Order Basket in for Calculation

Namespace:  LSOmni.Service
Assembly:  LSOmni.Service (in LSOmni.Service.dll) Version: LS Omni 3.7.0
Syntax
C#
BasketCalcResponse BasketCalc(
	BasketCalcRequest basketRequest
)

Parameters

basketRequest
Type: LSRetail.Omni.Domain.DataModel.Loyalty.BasketsBasketCalcRequest

Return Value

Type: BasketCalcResponse
Examples
Shows how Omni Object is mapped to LS Nav/Central WS Request
NAV WS Mapping
<Request_ID>WI_NC_CALCULATE_BASKET</Request_ID>
<Request_Body>
  <ItemId_Type>Rq.ItemNumberType</ItemId_Type>
  <MobileTransaction>
      <Id>basketRequest.Id</Id>
      <MemberContactNo>basketRequest.ContactId</MemberContactNo>
      <MemberCardNo>basketRequest.CardId</MemberCardNo>
  </MobileTransaction>
  <MobileTransactionLine>
    <Id>basketRequest.Id</Id>
    <LineNo>basketRequest.BasketCalcLineRequests.LineNumber</LineNo>
    <LineType>(basketRequest.BasketCalcLineRequests.CouponCode)? 6 : 0</LineType>
    <Barcode>(basketRequest.BasketCalcLineRequests.CouponCode)? basketRequest.BasketCalcLineRequests.CouponCode : ""</Barcode>
    <Number>basketRequest.BasketCalcLineRequests.ItemId</Number>
    <VariantCode>basketRequest.BasketCalcLineRequests.VariantId</VariantCode>
    <UomId>basketRequest.BasketCalcLineRequests.UomId</UomId>
    <Quantity>basketRequest.BasketCalcLineRequests.Quantity</Quantity>
    <ExternalId>basketRequest.BasketCalcLineRequests.ExternalId</ExternalId>
  </MobileTransactionLine>
</Request_Body>
This Sample request can be used in SOAP UI application to send request to OMNI.

Include minimum data needed to be able to process the request

SOAP Sample Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://lsretail.com/LSOmniService/EComm/2017/Service" xmlns:ns="http://lsretail.com/LSOmniService/Base/2017" xmlns:ns1="http://lsretail.com/LSOmniService/Loy/2017">
  <soapenv:Header/>
  <soapenv:Body>
     <ser:BasketCalc>
        <ser:basketRequest>
           <!--Optional: GUID-->
           <ns:Id>07EF2AE7-DAEC-4CF1-A139-39176D8EA7AF</ns:Id>
           <ns1:BasketCalcLineRequests>
              <!--One or more repetitions:--> 
              <ns1:BasketCalcLineRequest>
                 <!--Required:-->
                 <ns1:ItemId>40030</ns1:ItemId>
                 <!--Required, integer Icremental number for each line(1, 2, 3, etc)-->
                 <ns1:LineNumber>1</ns1:LineNumber>
                 <!--Required:-->
                 <ns1:Quantity>1</ns1:Quantity>
                 <!--Optional:-->
                 <ns1:CouponCode></ns1:CouponCode>
                 <!--Optional: not used in calc-->
                 <ns1:ExternalId></ns1:ExternalId>
                 <!--Optional:-->
                 <ns1:UomId></ns1:UomId>
                 <!--Optional:-->
                 <ns1:VariantId></ns1:VariantId>
              </ns1:BasketCalcLineRequest>
            </ns1:BasketCalcLineRequests>
            <!--Required: None = 0-->
            <ns1:CalcType>None</ns1:CalcType>
            <!--Required:-->
            <ns1:CardId>10021</ns1:CardId>
            <!--Optional:-->
            <ns1:ContactId>MO000008</ns1:ContactId>
            <!--Optional:-->
            <ns1:ShippingAddress>
               <!--Required: for shipping cost -->
               <ns:Address1></ns:Address1>
               <ns:Address2></ns:Address2>
               <ns:City></ns:City>
               <ns:Country></ns:Country>
               <ns:HouseNo></ns:HouseNo>
               <ns:Id></ns:Id>
               <ns:PostCode></ns:PostCode>
               <ns:StateProvinceRegion></ns:StateProvinceRegion>
               <ns:Type>Residential</ns:Type>
            </ns1:ShippingAddress>
            <!--Required:-->
            <ns1:StoreId>S0013</ns1:StoreId>
         </ser:basketRequest>
      </ser:BasketCalc>
   </soapenv:Body>
</soapenv:Envelope>
Response Data from OMNI after Request has been sent
SOAP Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <ActivityId CorrelationId = "e1a50113-38d1-443e-b966-8befd1f975b8" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId>
   </s:Header>
   <s:Body>
      <BasketCalcResponse xmlns = "http://lsretail.com/LSOmniService/EComm/2017/Service" >
         < BasketCalcResult xmlns:a="http://lsretail.com/LSOmniService/Loy/2017" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <Id xmlns = "http://lsretail.com/LSOmniService/Base/2017" > 07EF2AE7-DAEC-4CF1-A139-39176D8EA7AF</Id>
            <a:BasketLineCalcResponses>
               <a:BasketLineCalcResponse>
                  <a:BarcodeId/>
                  <a:BasketLineDiscResponses/>
                  <a:CardOrCustNo/>
                  <a:CouponCode/>
                  <a:CouponFunction>0</a:CouponFunction>
                  <a:CurrencyCode/>
                  <a:CurrencyFactor>0</a:CurrencyFactor>
                  <a:DiscountAmount>0</a:DiscountAmount>
                  <a:DiscountPercent>0</a:DiscountPercent>
                  <a:EntryStatus>Normal</a:EntryStatus>
                  <a:ItemId>40030</a:ItemId>
                  <a:LineNumber>1</a:LineNumber>
                  <a:LineType>Item</a:LineType>
                  <a:ManualDiscountAmount>0</a:ManualDiscountAmount>
                  <a:ManualDiscountPercent>0</a:ManualDiscountPercent>
                  <a:ManualPrice>0</a:ManualPrice>
                  <a:NetAmount>16</a:NetAmount>
                  <a:NetPrice>16</a:NetPrice>
                  <a:Price>20</a:Price>
                  <a:Quantity>1</a:Quantity>
                  <a:TAXAmount>4</a:TAXAmount>
                  <a:TAXBusinessCode>NATIONAL</a:TAXBusinessCode>
                  <a:TAXProductCode>C</a:TAXProductCode>
                  <a:Uom/>
                  <a:ValidInTransaction>0</a:ValidInTransaction>
                  <a:VariantId/>
               </a:BasketLineCalcResponse>
            </a:BasketLineCalcResponses>
            <a:BusinessTAXCode>NATIONAL</a:BusinessTAXCode>
            <a:CurrencyCode/>
            <a:CurrencyFactor>0</a:CurrencyFactor>
            <a:CustDiscGroup/>
            <a:CustomerId/>
            <a:EntryStatus>Normal</a:EntryStatus>
            <a:ManualTotalDiscAmount>0</a:ManualTotalDiscAmount>
            <a:ManualTotalDiscPercent>0</a:ManualTotalDiscPercent>
            <a:MemberCardNo>10021</a:MemberCardNo>
            <a:MemberPriceGroupCode/>
            <a:PriceGroupCode/>
            <a:ReceiptNo/>
            <a:ShippingPrice>0</a:ShippingPrice>
            <a:StaffId>1301</a:StaffId>
            <a:StoreId>S0013</a:StoreId>
            <a:TerminalId>P0040</a:TerminalId>
            <a:TotalAmount>20</a:TotalAmount>
            <a:TotalDiscAmount>0</a:TotalDiscAmount>
            <a:TotalNetAmount>16</a:TotalNetAmount>
            <a:TotalTaxAmount>4</a:TotalTaxAmount>
            <a:TransDate>2017-09-29T11:24:53.84+00:00</a:TransDate>
            <a:TransactionNo>0</a:TransactionNo>
         </BasketCalcResult>
      </BasketCalcResponse>
   </s:Body>
</s:Envelope>
See Also