Last updated

Basket Management in Norce Commerce Shopping Service

Overview:
The basket is a core component of the shopping experience in Norce Commerce Services. It acts as a container for items a visitor is interested in purchasing. The basket model includes extensive functionality and is governed by business rules that are evaluated with every action performed by the visitor.

Note: While the most common use of the basket is as a shopping cart, it can also be used for wish lists, approvals, saved-for-later lists, punch-out, subscriptions, and recurring orders. This document focuses on the shopping cart scenario.

Example: Basket Data (JSON and XML)

Below are example representations of a basket in both JSON and XML formats. These examples illustrate the structure and key fields of a Norce Commerce basket.

{
  "Id": 6600304,
  "CustomerId": null,
  "CompanyId": null,
  "SalesContactId": null,
  "StatusId": 3,
  "CurrencyId": 2,
  "CurrencyCode": "SEK",
  "Comment": null,
  "OrderReference": null,
  "DiscountCode": null,
  "ReferId": null,
  "ReferUrl": null,
  "ValidTo": null,
  "IsEditable": true,
  "Items": [
    {
      "Id": 16030464,
      "LineNo": 1,
      "ParentLineNo": null,
      "ProductId": 31234584,
      "PartNo": "PRD0001270",
      "ManufacturerPartNo": "T540XP",
      "Name": "T540XP",
      "SubHeader": "<p>Detta är en kort beskrivning.</p>",
      "ThumbnailImage": "2/thumb_p31234584.jpg",
      "FlagIdSeed": "915,1884",
      "Type": 1,
      "PriceDisplay": 5743.20,
      "Price": 0.00,
      "PriceOriginal": 5743.20,
      "Cost": 5734.34,
      "VatRate": 1.2500,
      "Quantity": 1.000,
      "UOM": "st",
      "UOMCount": 1.000,
      "Comment": null,
      "PriceListId": 4654,
      "ReferId": null,
      "ReferUrl": null,
      "IsEditable": true,
      "IsDiscountable": true,
      "Info": [
        {
          "TypeId": 209,
          "Value": "",
          "Code": "bit_size"
        },
        {
          "TypeId": 241,
          "Value": "",
          "Code": "bit_del_time"
        },
        {
          "TypeId": 95,
          "Value": "",
          "Code": "bit_additionalinformation"
        }
      ],
      "OptionalItems": [],
      "OnHandValue": 0.000,
      "IncomingValue": 0.000,
      "NextDeliveryDate": null,
      "LeadtimeDayCount": null,
      "PromotionIdSeed": "",
      "ImageKey": "39e4b7ec-12d8-4f6e-b9c1-cbd7334190e1",
      "ManufacturerName": "Husqvarna",
      "CategoryId": 41722,
      "OnHand": {
        "Value": 0.000,
        "IncomingValue": 0.000,
        "NextDeliveryDate": null,
        "LeadtimeDayCount": null,
        "LastChecked": null,
        "IsActive": false,
        "IsReturnable": true,
        "Info": null
      },
      "OnHandSupplier": {
        "Value": 200.000,
        "IncomingValue": 0.000,
        "NextDeliveryDate": null,
        "LeadtimeDayCount": 7,
        "LastChecked": null,
        "IsActive": true,
        "IsReturnable": true,
        "Info": null
      },
      "PriceRecommended": 7000.00,
      "ManufacturerId": 1685,
      "UniqueName": "t540xp",
      "StatusId": 1,
      "StockDisplayBreakPoint": null,
      "PriceCatalog": null,
      "IsBuyable": true,
      "SubDescription": null,
      "CategoryIdSeed": "41722",
      "RecommendedQuantity": 4.000,
      "IsRecommendedQuantityFixed": false,
      "AppliedPromotions": [],
      "RequirementPromotionIdSeed": "5093",
      "IsSubscribable": false,
      "DescriptionHeader": "Husqvarna T540XP",
      "IsPriceManual": false,
      "PriceStandard": 6375.20,
      "EanCode": "123123123123123",
      "CostUnit": 0.00,
      "PriceDisplayIncVat": 7179.00
    },
    {
      "Id": 16030465,
      "LineNo": 2,
      "ParentLineNo": null,
      "ProductId": 24706222,
      "PartNo": "PRD0001212",
      "ManufacturerPartNo": "FREIGHT01",
      "Name": "Freight",
      "SubHeader": null,
      "ThumbnailImage": null,
      "FlagIdSeed": "915",
      "Type": 3,
      "PriceDisplay": 0.00,
      "Price": 0.00,
      "PriceOriginal": 0.00,
      "Cost": 0.00,
      "VatRate": 1.25,
      "Quantity": 1.000,
      "UOM": "st",
      "UOMCount": 1.000,
      "Comment": null,
      "PriceListId": 1,
      "ReferId": null,
      "ReferUrl": null,
      "IsEditable": true,
      "IsDiscountable": true,
      "Info": [
        {
          "TypeId": 209,
          "Value": "",
          "Code": "bit_size"
        },
        {
          "TypeId": 241,
          "Value": "",
          "Code": "bit_del_time"
        },
        {
          "TypeId": 95,
          "Value": "",
          "Code": "bit_additionalinformation"
        }
      ],
      "OptionalItems": [],
      "OnHandValue": 0.000,
      "IncomingValue": 0.000,
      "NextDeliveryDate": null,
      "LeadtimeDayCount": 0,
      "PromotionIdSeed": null,
      "ImageKey": null,
      "ManufacturerName": "Miscellaneous",
      "CategoryId": null,
      "OnHand": {
        "Value": 0.000,
        "IncomingValue": 0.000,
        "NextDeliveryDate": null,
        "LeadtimeDayCount": 0,
        "LastChecked": "/Date(1325504774807+0100)/",
        "IsActive": true,
        "IsReturnable": true,
        "Info": null
      },
      "OnHandSupplier": {
        "Value": 0.000,
        "IncomingValue": 0.000,
        "NextDeliveryDate": null,
        "LeadtimeDayCount": null,
        "LastChecked": null,
        "IsActive": false,
        "IsReturnable": true,
        "Info": null
      },
      "PriceRecommended": null,
      "ManufacturerId": 4335,
      "UniqueName": "freight",
      "StatusId": 1,
      "StockDisplayBreakPoint": null,
      "PriceCatalog": null,
      "IsBuyable": true,
      "SubDescription": null,
      "CategoryIdSeed": "",
      "RecommendedQuantity": 1.000,
      "IsRecommendedQuantityFixed": false,
      "AppliedPromotions": [],
      "RequirementPromotionIdSeed": null,
      "IsSubscribable": false,
      "DescriptionHeader": null,
      "IsPriceManual": false,
      "PriceStandard": 0.00,
      "EanCode": "",
      "CostUnit": 0.00,
      "PriceDisplayIncVat": 0.00
    },
    {
      "Id": 0,
      "LineNo": 3,
      "ParentLineNo": 1,
      "ProductId": 31234588,
      "PartNo": "PRD0001274",
      "ManufacturerPartNo": "Underhållskit",
      "Name": "Underhållskit Motorsåg",
      "SubHeader": null,
      "ThumbnailImage": "2/thumb_p31234588.png",
      "FlagIdSeed": "915",
      "Type": 1,
      "PriceDisplay": 111.20,
      "Price": 0.00,
      "PriceOriginal": 111.20,
      "Cost": 100.25,
      "VatRate": 1.25,
      "Quantity": 1,
      "UOM": "st",
      "UOMCount": 1.000,
      "Comment": null,
      "PriceListId": 1,
      "ReferId": null,
      "ReferUrl": null,
      "IsEditable": false,
      "IsDiscountable": true,
      "Info": [
        {
          "TypeId": 209,
          "Value": "",
          "Code": "bit_size"
        },
        {
          "TypeId": 241,
          "Value": "",
          "Code": "bit_del_time"
        },
        {
          "TypeId": 95,
          "Value": "",
          "Code": "bit_additionalinformation"
        }
      ],
      "OptionalItems": [],
      "OnHandValue": 12.000,
      "IncomingValue": 0.000,
      "NextDeliveryDate": null,
      "LeadtimeDayCount": 0,
      "PromotionIdSeed": "",
      "ImageKey": null,
      "ManufacturerName": "Husqvarna",
      "CategoryId": 41722,
      "OnHand": {
        "Value": 12.000,
        "IncomingValue": 0.000,
        "NextDeliveryDate": null,
        "LeadtimeDayCount": 0,
        "LastChecked": null,
        "IsActive": true,
        "IsReturnable": true,
        "Info": null
      },
      "OnHandSupplier": {
        "Value": 133.000,
        "IncomingValue": 0.000,
        "NextDeliveryDate": null,
        "LeadtimeDayCount": 5,
        "LastChecked": "/Date(1487085555163+0100)/",
        "IsActive": true,
        "IsReturnable": true,
        "Info": null
      },
      "PriceRecommended": null,
      "ManufacturerId": 1685,
      "UniqueName": "underhallskit-motorsag",
      "StatusId": 1,
      "StockDisplayBreakPoint": null,
      "PriceCatalog": null,
      "IsBuyable": true,
      "SubDescription": null,
      "CategoryIdSeed": "41722",
      "RecommendedQuantity": 1.000,
      "IsRecommendedQuantityFixed": false,
      "AppliedPromotions": [],
      "RequirementPromotionIdSeed": "",
      "IsSubscribable": false,
      "DescriptionHeader": null,
      "IsPriceManual": false,
      "PriceStandard": 0.00,
      "EanCode": "345345345345345",
      "CostUnit": 0.00,
      "PriceDisplayIncVat": 139.00
    }
  ],
  "Info": [
    {
      "TypeId": 169,
      "Value": "",
      "Code": "bit_expecteddeliverydate"
    },
    {
      "TypeId": 293,
      "Value": "",
      "Code": "bit_additionalorderinfo"
    },
    {
      "TypeId": 445,
      "Value": "",
      "Code": "Norce_Gender"
    },
    {
      "TypeId": 493,
      "Value": "",
      "Code": "recurring"
    }
  ],
  "Summary": {
    "Items": {
      "Amount": 5854.40,
      "Vat": 1463.60,
      "AmountIncVat": 7318.00
    },
    "Freigt": {
      "Amount": 0.00,
      "Vat": 0.00,
      "AmountIncVat": 0.00
    },
    "Fees": {
      "Amount": 0.00,
      "Vat": 0.00,
      "AmountIncVat": 0.00
    },
    "Total": {
      "Amount": 5854.40,
      "Vat": 1463.60,
      "AmountIncVat": 7318.00
    }
  },
  "AppliedPromotions": [
    {
      "Id": 5093,
      "Name": "Add service",
      "Header": "",
      "ShortDescription": "",
      "Description1": "",
      "Description2": "",
      "StartDate": null,
      "EndDate": null,
      "ImageKey": null,
      "RequirementSeed": "3",
      "DiscountCode": null,
      "IsExcludedFromPriceCalculation": false,
      "AllowProductListing": false,
      "Images": [],
      "ProductFilters": [
        {
          "ManufacturerId": null,
          "CategorySeed": null,
          "TypeId": null,
          "ProductId": null,
          "VariantProductId": null,
          "PartNo": "PRD0001274",
          "PricelistId": 1,
          "FlagId": null
        },
        {
          "ManufacturerId": null,
          "CategorySeed": null,
          "TypeId": null,
          "ProductId": null,
          "VariantProductId": null,
          "PartNo": null,
          "PricelistId": null,
          "FlagId": 1884
        }
      ],
      "AppliedAmount": 0.00,
      "EffectSeed": "5",
      "FreightDiscountPct": null,
      "IsStackable": true,
      "AppliedAmountIncVat": 0.00
    }
  ],
  "IpAddress": "151.236.200.213",
  "AttestedBy": null,
  "TypeId": 1,
  "DoHold": false,
  "IsBuyable": true,
  "InvoiceReference": null,
  "PaymentMethodId": null,
  "DeliveryMethodId": 1,
  "SalesAreaId": 1
}
<Basket xmlns="Enferno.Services.Contracts.Expose.Shopping" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <Id>6600304</Id>
    <CustomerId i:nil="true"/>
    <CompanyId i:nil="true"/>
    <SalesContactId i:nil="true"/>
    <StatusId>3</StatusId>
    <CurrencyId>2</CurrencyId>
    <CurrencyCode>SEK</CurrencyCode>
    <Comment i:nil="true"/>
    <OrderReference i:nil="true"/>
    <DiscountCode i:nil="true"/>
    <ReferId i:nil="true"/>
    <ReferUrl i:nil="true"/>
    <ValidTo i:nil="true"/>
    <IsEditable>true</IsEditable>
    <Items>
        <BasketItem>
            <Id>16030464</Id>
            <LineNo>1</LineNo>
            <ParentLineNo i:nil="true"/>
            <ProductId>31234584</ProductId>
            <PartNo>PRD0001270</PartNo>
            <ManufacturerPartNo>T540XP</ManufacturerPartNo>
            <Name>T540XP</Name>
            <SubHeader>&lt;p&gt;Detta är en kort beskrivning.&lt;/p&gt;</SubHeader>
            <ThumbnailImage>2/thumb_p31234584.jpg</ThumbnailImage>
            <FlagIdSeed>915,1884</FlagIdSeed>
            <Type>1</Type>
            <PriceDisplay>5743.20</PriceDisplay>
            <Price>0.00</Price>
            <PriceOriginal>5743.20</PriceOriginal>
            <Cost>5734.34</Cost>
            <VatRate>1.25</VatRate>
            <Quantity>1</Quantity>
            <UOM>st</UOM>
            <UOMCount>1.000</UOMCount>
            <Comment i:nil="true"/>
            <PriceListId>4654</PriceListId>
            <ReferId i:nil="true"/>
            <ReferUrl i:nil="true"/>
            <IsEditable>true</IsEditable>
            <IsDiscountable>true</IsDiscountable>
            <Info>
                <Info>
                    <TypeId>209</TypeId>
                    <Value/>
                    <Code>bit_size</Code>
                </Info>
                <Info>
                    <TypeId>241</TypeId>
                    <Value/>
                    <Code>bit_del_time</Code>
                </Info>
                <Info>
                    <TypeId>95</TypeId>
                    <Value/>
                    <Code>bit_additionalinformation</Code>
                </Info>
            </Info>
            <OptionalItems/>
            <OnHandValue>0.000</OnHandValue>
            <IncomingValue>0.000</IncomingValue>
            <NextDeliveryDate i:nil="true"/>
            <LeadtimeDayCount i:nil="true"/>
            <PromotionIdSeed/>
            <ImageKey>39e4b7ec-12d8-4f6e-b9c1-cbd7334190e1</ImageKey>
            <ManufacturerName>Husqvarna</ManufacturerName>
            <CategoryId>41722</CategoryId>
            <OnHand xmlns:a="Enferno.Services.Contracts.Expose.Products">
                <a:Value>0.000</a:Value>
                <a:IncomingValue>0.000</a:IncomingValue>
                <a:NextDeliveryDate i:nil="true"/>
                <a:LeadtimeDayCount i:nil="true"/>
                <a:LastChecked i:nil="true"/>
                <a:IsActive>false</a:IsActive>
                <a:IsReturnable>true</a:IsReturnable>
                <a:Info i:nil="true" xmlns:b="Enferno.Services.Contracts.Expose"/>
            </OnHand>
            <OnHandSupplier xmlns:a="Enferno.Services.Contracts.Expose.Products">
                <a:Value>200.000</a:Value>
                <a:IncomingValue>0.000</a:IncomingValue>
                <a:NextDeliveryDate i:nil="true"/>
                <a:LeadtimeDayCount>7</a:LeadtimeDayCount>
                <a:LastChecked i:nil="true"/>
                <a:IsActive>true</a:IsActive>
                <a:IsReturnable>true</a:IsReturnable>
                <a:Info i:nil="true" xmlns:b="Enferno.Services.Contracts.Expose"/>
            </OnHandSupplier>
            <PriceRecommended>7000.00</PriceRecommended>
            <ManufacturerId>1685</ManufacturerId>
            <UniqueName>t540xp</UniqueName>
            <StatusId>1</StatusId>
            <StockDisplayBreakPoint i:nil="true"/>
            <PriceCatalog i:nil="true"/>
            <IsBuyable>true</IsBuyable>
            <SubDescription i:nil="true"/>
            <CategoryIdSeed>41722</CategoryIdSeed>
            <RecommendedQuantity>4.000</RecommendedQuantity>
            <IsRecommendedQuantityFixed>false</IsRecommendedQuantityFixed>
            <AppliedPromotions/>
            <RequirementPromotionIdSeed>5093</RequirementPromotionIdSeed>
            <IsSubscribable>false</IsSubscribable>
            <DescriptionHeader>Husqvarna T540XP</DescriptionHeader>
            <IsPriceManual>false</IsPriceManual>
            <PriceStandard>6375.20</PriceStandard>
            <EanCode>123123123123123</EanCode>
            <CostUnit>0.00</CostUnit>
            <PriceDisplayIncVat>7179.00</PriceDisplayIncVat>
        </BasketItem>
        <BasketItem>
            <Id>16030465</Id>
            <LineNo>2</LineNo>
            <ParentLineNo i:nil="true"/>
            <ProductId>24706222</ProductId>
            <PartNo>PRD0001212</PartNo>
            <ManufacturerPartNo>FREIGHT01</ManufacturerPartNo>
            <Name>Freight</Name>
            <SubHeader i:nil="true"/>
            <ThumbnailImage i:nil="true"/>
            <FlagIdSeed>915</FlagIdSeed>
            <Type>3</Type>
            <PriceDisplay>0.00</PriceDisplay>
            <Price>0.00</Price>
            <PriceOriginal>0.00</PriceOriginal>
            <Cost>0.00</Cost>
            <VatRate>1.25</VatRate>
            <Quantity>1</Quantity>
            <UOM>st</UOM>
            <UOMCount>1.000</UOMCount>
            <Comment i:nil="true"/>
            <PriceListId>1</PriceListId>
            <ReferId i:nil="true"/>
            <ReferUrl i:nil="true"/>
            <IsEditable>true</IsEditable>
            <IsDiscountable>true</IsDiscountable>
            <Info>
                <Info>
                    <TypeId>209</TypeId>
                    <Value/>
                    <Code>bit_size</Code>
                </Info>
                <Info>
                    <TypeId>241</TypeId>
                    <Value/>
                    <Code>bit_del_time</Code>
                </Info>
                <Info>
                    <TypeId>95</TypeId>
                    <Value/>
                    <Code>bit_additionalinformation</Code>
                </Info>
            </Info>
            <OptionalItems/>
            <OnHandValue>0.000</OnHandValue>
            <IncomingValue>0.000</IncomingValue>
            <NextDeliveryDate i:nil="true"/>
            <LeadtimeDayCount>0</LeadtimeDayCount>
            <PromotionIdSeed i:nil="true"/>
            <ImageKey i:nil="true"/>
            <ManufacturerName>Miscellaneous</ManufacturerName>
            <CategoryId i:nil="true"/>
            <OnHand xmlns:a="Enferno.Services.Contracts.Expose.Products">
                <a:Value>0.000</a:Value>
                <a:IncomingValue>0.000</a:IncomingValue>
                <a:NextDeliveryDate i:nil="true"/>
                <a:LeadtimeDayCount>0</a:LeadtimeDayCount>
                <a:LastChecked>2012-01-02T12:46:14.807</a:LastChecked>
                <a:IsActive>true</a:IsActive>
                <a:IsReturnable>true</a:IsReturnable>
                <a:Info i:nil="true" xmlns:b="Enferno.Services.Contracts.Expose"/>
            </OnHand>
            <OnHandSupplier xmlns:a="Enferno.Services.Contracts.Expose.Products">
                <a:Value>0.000</a:Value>
                <a:IncomingValue>0.000</a:IncomingValue>
                <a:NextDeliveryDate i:nil="true"/>
                <a:LeadtimeDayCount i:nil="true"/>
                <a:LastChecked i:nil="true"/>
                <a:IsActive>false</a:IsActive>
                <a:IsReturnable>true</a:IsReturnable>
                <a:Info i:nil="true" xmlns:b="Enferno.Services.Contracts.Expose"/>
            </OnHandSupplier>
            <PriceRecommended i:nil="true"/>
            <ManufacturerId>4335</ManufacturerId>
            <UniqueName>freight</UniqueName>
            <StatusId>1</StatusId>
            <StockDisplayBreakPoint i:nil="true"/>
            <PriceCatalog i:nil="true"/>
            <IsBuyable>true</IsBuyable>
            <SubDescription i:nil="true"/>
            <CategoryIdSeed/>
            <RecommendedQuantity>1.000</RecommendedQuantity>
            <IsRecommendedQuantityFixed>false</IsRecommendedQuantityFixed>
            <AppliedPromotions/>
            <RequirementPromotionIdSeed i:nil="true"/>
            <IsSubscribable>false</IsSubscribable>
            <DescriptionHeader i:nil="true"/>
            <IsPriceManual>false</IsPriceManual>
            <PriceStandard>0.00</PriceStandard>
            <EanCode/>
            <CostUnit>0.00</CostUnit>
            <PriceDisplayIncVat>0.00</PriceDisplayIncVat>
        </BasketItem>
        <BasketItem>
            <Id>0</Id>
            <LineNo>3</LineNo>
            <ParentLineNo>1</ParentLineNo>
            <ProductId>31234588</ProductId>
            <PartNo>PRD0001274</PartNo>
            <ManufacturerPartNo>Underhållskit</ManufacturerPartNo>
            <Name>Underhållskit Motorsåg</Name>
            <SubHeader i:nil="true"/>
            <ThumbnailImage>2/thumb_p31234588.png</ThumbnailImage>
            <FlagIdSeed>915</FlagIdSeed>
            <Type>1</Type>
            <PriceDisplay>111.20</PriceDisplay>
            <Price>0.00</Price>
            <PriceOriginal>111.20</PriceOriginal>
            <Cost>100.25</Cost>
            <VatRate>1.25</VatRate>
            <Quantity>1</Quantity>
            <UOM>st</UOM>
            <UOMCount>1.000</UOMCount>
            <Comment i:nil="true"/>
            <PriceListId>1</PriceListId>
            <ReferId i:nil="true"/>
            <ReferUrl i:nil="true"/>
            <IsEditable>false</IsEditable>
            <IsDiscountable>true</IsDiscountable>
            <Info>
                <Info>
                    <TypeId>209</TypeId>
                    <Value/>
                    <Code>bit_size</Code>
                </Info>
                <Info>
                    <TypeId>241</TypeId>
                    <Value/>
                    <Code>bit_del_time</Code>
                </Info>
                <Info>
                    <TypeId>95</TypeId>
                    <Value/>
                    <Code>bit_additionalinformation</Code>
                </Info>
            </Info>
            <OptionalItems/>
            <OnHandValue>12.000</OnHandValue>
            <IncomingValue>0.000</IncomingValue>
            <NextDeliveryDate i:nil="true"/>
            <LeadtimeDayCount>0</LeadtimeDayCount>
            <PromotionIdSeed/>
            <ImageKey i:nil="true"/>
            <ManufacturerName>Husqvarna</ManufacturerName>
            <CategoryId>41722</CategoryId>
            <OnHand xmlns:a="Enferno.Services.Contracts.Expose.Products">
                <a:Value>12.000</a:Value>
                <a:IncomingValue>0.000</a:IncomingValue>
                <a:NextDeliveryDate i:nil="true"/>
                <a:LeadtimeDayCount>0</a:LeadtimeDayCount>
                <a:LastChecked i:nil="true"/>
                <a:IsActive>true</a:IsActive>
                <a:IsReturnable>true</a:IsReturnable>
                <a:Info i:nil="true" xmlns:b="Enferno.Services.Contracts.Expose"/>
            </OnHand>
            <OnHandSupplier xmlns:a="Enferno.Services.Contracts.Expose.Products">
                <a:Value>133.000</a:Value>
                <a:IncomingValue>0.000</a:IncomingValue>
                <a:NextDeliveryDate i:nil="true"/>
                <a:LeadtimeDayCount>5</a:LeadtimeDayCount>
                <a:LastChecked>2017-02-14T16:19:15.163</a:LastChecked>
                <a:IsActive>true</a:IsActive>
                <a:IsReturnable>true</a:IsReturnable>
                <a:Info i:nil="true" xmlns:b="Enferno.Services.Contracts.Expose"/>
            </OnHandSupplier>
            <PriceRecommended i:nil="true"/>
            <ManufacturerId>1685</ManufacturerId>
            <UniqueName>underhallskit-motorsag</UniqueName>
            <StatusId>1</StatusId>
            <StockDisplayBreakPoint i:nil="true"/>
            <PriceCatalog i:nil="true"/>
            <IsBuyable>true</IsBuyable>
            <SubDescription i:nil="true"/>
            <CategoryIdSeed>41722</CategoryIdSeed>
            <RecommendedQuantity>1.000</RecommendedQuantity>
            <IsRecommendedQuantityFixed>false</IsRecommendedQuantityFixed>
            <AppliedPromotions/>
            <RequirementPromotionIdSeed/>
            <IsSubscribable>false</IsSubscribable>
            <DescriptionHeader i:nil="true"/>
            <IsPriceManual>false</IsPriceManual>
            <PriceStandard>0.00</PriceStandard>
            <EanCode>345345345345345</EanCode>
            <CostUnit>0.00</CostUnit>
            <PriceDisplayIncVat>139.00</PriceDisplayIncVat>
        </BasketItem>
    </Items>
    <Info>
        <Info>
            <TypeId>169</TypeId>
            <Value/>
            <Code>bit_expecteddeliverydate</Code>
        </Info>
        <Info>
            <TypeId>293</TypeId>
            <Value/>
            <Code>bit_additionalorderinfo</Code>
        </Info>
        <Info>
            <TypeId>445</TypeId>
            <Value/>
            <Code>Norce_Gender</Code>
        </Info>
        <Info>
            <TypeId>493</TypeId>
            <Value/>
            <Code>recurring</Code>
        </Info>
    </Info>
    <Summary>
        <Items>
            <Amount>5854.40</Amount>
            <Vat>1463.60</Vat>
            <AmountIncVat>7318.00</AmountIncVat>
        </Items>
        <Freigt>
            <Amount>0.00</Amount>
            <Vat>0.00</Vat>
            <AmountIncVat>0.00</AmountIncVat>
        </Freigt>
        <Fees>
            <Amount>0.00</Amount>
            <Vat>0.00</Vat>
            <AmountIncVat>0.00</AmountIncVat>
        </Fees>
        <Total>
            <Amount>5854.40</Amount>
            <Vat>1463.60</Vat>
            <AmountIncVat>7318.00</AmountIncVat>
        </Total>
    </Summary>
    <AppliedPromotions>
        <Promotion>
            <Id>5093</Id>
            <Name>Add service</Name>
            <Header/>
            <ShortDescription/>
            <Description1/>
            <Description2/>
            <StartDate i:nil="true"/>
            <EndDate i:nil="true"/>
            <ImageKey i:nil="true"/>
            <RequirementSeed>3</RequirementSeed>
            <DiscountCode i:nil="true"/>
            <IsExcludedFromPriceCalculation>false</IsExcludedFromPriceCalculation>
            <AllowProductListing>false</AllowProductListing>
            <Images xmlns:a="Enferno.Services.Contracts.Expose"/>
            <ProductFilters>
                <Filter>
                    <ManufacturerId i:nil="true"/>
                    <CategorySeed i:nil="true"/>
                    <TypeId i:nil="true"/>
                    <ProductId i:nil="true"/>
                    <VariantProductId i:nil="true"/>
                    <PartNo>PRD0001274</PartNo>
                    <PricelistId>1</PricelistId>
                    <FlagId i:nil="true"/>
                </Filter>
                <Filter>
                    <ManufacturerId i:nil="true"/>
                    <CategorySeed i:nil="true"/>
                    <TypeId i:nil="true"/>
                    <ProductId i:nil="true"/>
                    <VariantProductId i:nil="true"/>
                    <PartNo i:nil="true"/>
                    <PricelistId i:nil="true"/>
                    <FlagId>1884</FlagId>
                </Filter>
            </ProductFilters>
            <AppliedAmount>0.00</AppliedAmount>
            <EffectSeed>5</EffectSeed>
            <FreightDiscountPct i:nil="true"/>
            <IsStackable>true</IsStackable>
            <AppliedAmountIncVat>0.00</AppliedAmountIncVat>
        </Promotion>
    </AppliedPromotions>
    <IpAddress>151.236.200.213</IpAddress>
    <AttestedBy i:nil="true"/>
    <TypeId>1</TypeId>
    <DoHold>false</DoHold>
    <IsBuyable>true</IsBuyable>
    <InvoiceReference i:nil="true"/>
    <PaymentMethodId i:nil="true"/>
    <DeliveryMethodId>1</DeliveryMethodId>
    <SalesAreaId>1</SalesAreaId>
</Basket>

Basket Data Model Structure

Basket Model Overview:
The basket contains many properties. Key elements include identifiers, status, currency, editability, summary, and a collection of items. Each item represents a product added to the basket and contains its own set of properties.

Basket data model

Key Basket Properties

  • Id: Unique identifier for the basket. Typically stored in a persisted cookie for the active visitor.
  • Status: Indicates the current state of the basket (e.g. basket, payment accepted, order). Complete list below.
  • Currency: The currency used for the basket. If multiple currencies are supported, prices are converted accordingly.
  • IsEditable / IsBuyable: Flags indicating if the basket can be updated or checked out.
  • Summary: Contains total amounts and freight information.
  • Items: List of products in the basket. Each item includes:
    • Id: Basket item identifier (required for updates)
    • LineNo: Row number
    • ParentLineNo: For grouping or complex items
    • ProductId / PartNo: Product identifiers
    • Type: Product type
    • PriceDisplay: Read-only price
    • Quantity: Number of items
    • PriceListId: Source price list
    • IsEditable: Whether the item can be updated
    • ImageKey: Unique id for the item's image at Norce's image server — see Images and CDN for how to form the retrieval URL
    • OnHandValue / OnHand.Value: Both exist on the same item and represent the same aggregated stock value — OnHandValue is a flattened, top-level duplicate of OnHand.Value kept for contract-reuse reasons. Both are currently maintained in sync, so either can be used. See Availability structures for the full OnHand/OnHandStore/OnHandSupplier model — note that this data only exists on the live basket; order items do not carry OnHand/OnHandSupplier data.
Complete list of basket statuses
IdNameDescription
1SalesClosed for customer, open for internal sales
2ResellerClosed for customer, open for reseller and internal sales
3BasketStandard basket
4DeletedDeleted basket
5AcceptedAccepted by customer (quote)
6Wait for attestWaiting for attest from customer
7Ready for paymentBasket is complete for payment
8Payment acceptedPayment for basket is accepted
9SavedBasket is saved for future purposes
10OrderOrder is acknowledged by ERP
11AbandonedBasket was abandoned
12Payment pendingThe payment is in process and waits for an external callback
13Payment deniedThe payment was denied. Order not created
14Order failedPayment is accepted but order creation failed
15Abandoned paymentCustomer aborted payment. Order not created
16Payment late acceptedPayment was accepted that had already been denied
17SentQuote (basket) was sent to customer
18Waiting for payment denialPayment was denied. Waiting for asynchronous confirmation.
19Payment error or fraudA technical error or fraud result was encountered at payment
20Attest manuallyQuote is to be attested manually from Norce Commerce Admin
21Recurring OrderTemplate for recurring order
22Post purchase openPayment is accepted. Basket still open for post purcases

Tip: Norce Commerce handles much of the basket business logic automatically. For example, adding an existing item creates a new line rather than incrementing quantity. You can implement custom logic in your own backend service layer if needed.

Basket Update Pattern

Update Workflow:
Whenever a change is made to the basket, Norce Commerce Shopping Service returns the entire updated basket object. A recommended practice is to cache the basket locally, or fetch it before making changes if concurrency is a concern.

Update pattern

Typical Update Steps:

  1. User action triggers a change.
  2. Fetch the current basket (from Norce or local cache).
  3. Apply changes to the basket or basket item.
  4. Call the relevant update API (e.g., UpdateBasket, UpdateBasketItem).
  5. Receive the updated basket from Norce.
  6. Update your cache and return the new basket to the frontend.

Note: The basket can change due to external factors (e.g., product becomes unavailable, promotion ends). Your application should handle such scenarios gracefully.

Contextual Information

When making basket API calls, always include relevant context such as pricelistSeed, cultureCode, and currencyId if your application uses them. For logged-in users, set createdBy to the user ID; for guests, use 1.

Basket Lifecycle

Creating a Basket

A basket is created using the CreateBasket method, typically when the first item is added. Include CustomerId, CompanyId, and default payment/delivery methods for logged-in users to streamline checkout.

Required query parameters:

  • ipAddress: the end customer's IP address (not your server's).
  • createdBy: the internal account id of the current user — pass 1 for the default system account if you don't have a specific integration account.

Request body: pass null or an empty object to create an empty basket, or pre-populate it with items and settings:

{
  "CustomerId": 12345,
  "PaymentMethodId": 14,
  "DeliveryMethodId": 1,
  "Items": [
    { "PartNo": "PRD0001270", "Quantity": 1 }
  ]
}

Response: a full Basket object, including the generated Id — store this (typically in a cookie) to reference the basket on subsequent calls.

Inspecting a basket for debugging: use GetBasket (basket-only) or GetCheckout2 (basket plus payment/delivery methods and buyer info) to fetch the current state without modifying it.

Common error causes on creation (if items are included in the request body): BasketItemNotBuyable (item is inactive or not buyable) and BasketItemQuantityLessThanZero.

Adding Items to the Basket

There are several methods to add items:

  • InsertBasketItem: Adds a single item as new row.
  • InsertBasketItems: Adds multiple items as new rows.
  • InsertBasketItemWithChildren: Adds a parent item with child items (for complex products).
  • UpdateBasketItem: Can increment quantity on an existing item (requires you to resolve the item first).

RecommendedQuantity:
Check the RecommendedQuantity field when adding items. If IsRecommendedQuantityFixed is true, only multiples of RecommendedQuantity are allowed.

Add existing item InsertBasketItem will always create a new row, if you want to update quantity instead, you need to make that validation on your client code first.

Updating Basket or Basket Items

  • UpdateBasket2: Updates basket-level information (e.g., status, comments).
  • UpdateBasketItem / UpdateBasketItems: Updates item-level information (e.g., quantity, comment, price). The Id field is required for updates.

Removing Items from the Basket

  • DeleteBasketItem: Removes a specific item.
  • UpdateBasketItem: Setting quantity to 0 removes the item.
  • ClearBasket: Removes all items.

Note: Setting quantity to 0 via UpdateBasketItem is equivalent to deleting the item.

VAT and Sales Areas

The SalesAreaId field on the basket determines the default VAT rate applied to its items. Set it in the CreateBasket request body, or change it later with UpdateBasket2. If not specified, the application's primary sales area is used. Discover the sales areas available to your application via GET /management/1.0/api/application/salesarea (Management API).

There is no basket-level VatCodeId field — you cannot override the VAT rate for a single basket independent of its sales area. VAT codes are configured per sales area at the category (and product) level (VatCodeId on the Management API's CategoryModel), so to change the effective VAT rate for specific items without changing the basket's SalesAreaId, override the VAT code on that category or product instead.

No-VAT / B2B reverse charge: SalesAreaId: 29 (NoVAT) is a built-in sales area with a fixed 0% VAT rate — in every other respect it behaves like any other sales area. Set it on the basket the same way as any other SalesAreaId (e.g. for a verified B2B customer eligible for reverse charge), without needing to create a custom sales area for this.

Common Business Logic Scenarios

Overriding Item Price

To manually override the calculated price (e.g., for quotations or special offers), set the Price field and IsPriceManual: true when adding or updating an item.

{
  "PartNo": "TestPartNo",
  "Price": 160.00,
  "Quantity": 1.000,
  "Comment": "Manual price for new basket row",
  "PriceListId": 1,
  "IsPriceManual": true
}

Note: The Price field is the unit price. After update, check IsPriceManual to identify manual prices.

Locking Price to a Price List

To force a specific price list (e.g., for agreements or warehouse reservations), set PriceListLocked: true on the basket item.

{
  "PartNo": "TestPartNo",
  "Quantity": 1.000,
  "Comment": "Lock price list for this row",
  "PriceListId": 15320,
  "PriceListLocked": true
}

Note: PriceListLocked may revert to false if the price list is no longer active or after certain updates.

Custom Buyable Logic

You can implement additional restrictions for when a basket is buyable, such as requiring all products to be in stock.

public bool Buyable(Basket basket)
{
    if (basket.isBuyable) {
        // Add custom logic here (e.g., check stock)
        return true;
    }
    return false;
}

Streamlining Basket Processes

You may want to simplify basket handling for your application, such as:

  • Automatically adding items with RecommendedQuantity
  • Incrementing quantity for existing items
  • Handling flagged products differently
  • Managing manual price overrides

Extending the Basket Model

Info types let you attach custom fields to a basket or its items — see Extending the basket and order for how to configure them in Admin (this is where the Code for each info type is defined) and how basket-level info types carry through to the order.

On the API, both baskets and basket items carry an Info array of { TypeId, Code, Value } objects. Set it directly in the CreateBasket or UpdateBasket/UpdateBasketItem request body — there is no separate "set info" call:

{
  "Info": [
    { "Code": "bit_expecteddeliverydate", "Value": "2026-08-01" }
  ],
  "Items": [
    {
      "PartNo": "PRD0001270",
      "Quantity": 1,
      "Info": [
        { "Code": "bit_size", "Value": "L" }
      ]
    }
  ]
}

Code is the identifier you configured in Admin; TypeId is Norce's internal numeric id for the same info type and can be sent instead of Code once known. To discover which info types are configured and available, call ListBasketInfoTypes (basket-level) or ListBasketItemInfoTypes (item-level).

Order-side info types are not set directly from the storefront/checkout API. They are populated either automatically — a basket-level info type carries over to the order if an order-level info type with the same Code is configured (see Extending the basket and order) — or by an ERP/OMS writing back via the Connect API's SendOrderStatus call, which accepts an Infos array of { Code, Value } order info entries alongside the status update. See Order Acknowledgement and Status Updates.

Promotions in Baskets

Promotions are applied automatically if requirements are met. All applied promotions are listed in the AppliedPromotions field on the basket and on individual items.

  • To apply a promotion code, use UpdateBasket and set the DiscountCode property.
  • If the code is invalid, the basket will not show a discount code after update.

Multiple DiscountCodes Add multiple discount codes after eachother to the DiscountCode field, comma separated like so: Discount1,Discount2

Verifying which codes were accepted

After UpdateBasket, check the returned basket's DiscountCode field to see which codes were actually accepted. Invalid codes are silently dropped, so the field only lists the valid ones. For example, submitting Valid1,Valid2,Invalid3 returns Valid1,Valid2. Compare the returned list against what you submitted to detect any codes that were rejected.

Distinguishing removable (code-based) from fixed promotions

Each entry in AppliedPromotions has its own DiscountCode field — not just the basket-level one. If it's set, that specific applied promotion was triggered by an entered discount code; if it's null, the promotion applied automatically (e.g. a "3 for 2" or basket-total requirement) and isn't tied to a removable code. Use this per-promotion field to decide which applied promotions to show as removable in checkout versus which to present as a fixed discount line — all applied promotions can appear together in the same AppliedPromotions list regardless of how they were triggered. All active promotions apply cumulatively; see Multiple promotions.

For promotions that let customers choose a free or discounted item, see Working with Select Product promotions.

Handling Complex Items

If you want to create complex items (e.g., like bundles) use the ParentLineNo field to group related items. Use:

  • InsertBasketItemWithChildren: To add a parent and its children (the first item will be the parent).
  • UpdateBasketItemQuantityWithChildren: To update quantities for parent and children together.

This works well if you want to group products together dynamically. Use Norce's product types for a stricter bundle solution but with more functionality in Norce.

Note: ParentLineNo is only used for this bundle/complex-item grouping — it is not used to link a free or discounted item added by a promotion back to the item that triggered it. Promotion-added items appear as regular top-level basket items (ParentLineNo: null); their relationship to the promotion is tracked via AppliedPromotions and RequirementPromotionIdSeed instead. See Working with Select Product promotions.

Bundle product types Bundle product types will automatically get their child items into the basket, do not use the methods above.

Postman Samples

See Postman examples for basket operations.