Calculate

Before you create an order, calculate the basket to update all prices and discounts according to the LS Central calculation engine.

If Store has a different currency than the base currency set for LS Central, you can add it to the Calculate request by adding Currency and Currency factor values. For Default Currency, these fields can be skipped or be empty.

Copy

OneList Basket Calculation

<soapenv:Body>
    <ser:OneListSave>
        <ser:oneList>
            <ns1:CardId>10023</ns1:CardId>
            <ns1:Currency>EUR</ns1:Currency>
            <ns1:CurrencyFactor>0.06458</ns1:CurrencyFactor>
            <ns1:IsHospitality>false</ns1:IsHospitality>
            <ns1:Items>
                <ns1:OneListItem>
                    <ns1:ItemDescription>Skirt Linda Professional Wear</ns1:ItemDescription>
                    <ns1:ItemId>40020</ns1:ItemId>
                    <ns1:Quantity>2</ns1:Quantity>
                    <ns1:VariantDescription>YELLOW/38</ns1:VariantDescription>
                    <ns1:VariantId>002</ns1:VariantId>
                </ns1:OneListItem>
            </ns1:Items>
            <ns1:ListType>Basket</ns1:ListType>
            <ns1:StoreId>S0001</ns1:StoreId>
        </ser:oneList>
        <ser:calculate>true</ser:calculate>
    </ser:OneListSave>
</soapenv:Body>

 

Copy

To add optional Coupon to the basket, add this to the request

<ns1:PublishedOffers>
    <ns1:OneListPublishedOffer>
        <ns:Id>XMAS2018</ns:Id>
        <ns1:Type>Coupon</ns1:Type>
    </ns1:OneListPublishedOffer>
</ns1:PublishedOffers>

 

Copy

Modify Price of an Item

<ns1:OneListItem>
    <ns1:ItemDescription>Shipping</ns1:ItemDescription>
    <ns1:ItemId>66010</ns1:ItemId>
    <ns1:Quantity>1</ns1:Quantity>
    <ns1:Price>1.00</ns1:Price>
    <ns1:PriceModified>true</ns1:PriceModified>
</ns1:OneListItem>

OneListCalculate returns Order Object with order lines with prices and calculated amount and discount information, if any. You can then use this Order object to finalize the order. Add contact information, address for shipping, and payment information, and then the order is ready to be sent in “as is” with OrderCreate.