Adding an item to a basket

How to access the current basket for a customer. Note, this could be shared between devices – so if an (authenticated) customer is using two different clients, they would both be working with the same basket.

URL

HTTP Post

http://api1.asos.com/basket/{customerId}/{currency}/en_API?locale={locale}&country={country}&api_key={apiKey}

Parameters

Name Type Description Default Value Example Value Optional
customerId string Identifier for a customer (more info). d490d00d5d63450e954eaec033e76edd no
currency string The currency to show prices in (more info). GBP EUR no
locale string A parameter to identify the location set on the user's mobile device, which can be used to customize content based on that location. en_GB en_US yes
country string Current geographical location of the device user GB AU yes
basketItem body JSON Object containing one or more basket items. See below no
apiKey string Your API key. Request yours here 1a2b3c4d5e6f7g8h9i no

Example Request

http://api1.asos.com/basket/d490d00d5d63450e954eaec033e76edd/GBP/en_API?locale=en_US&country=AU&api_key=1a2b3c4d5e6f7g8h9i

Body

The request body is a representation of the BasketItem that is to be added:

{
   "BasePrice":30.00 ,
   "BasketItemMessages": null,
   "Colour": "Navy",
   "CustomerId": "d490d00d5d63450e954eaec033e76edd",
   "DateAdded": "/Date(1303914179403+0100)/",
   "DateExpires": "/Date(1303914179403+0100)/",
   "ImageUrl": "http://images.asos.com/inv/media/2/8/7/3/1703782/navy/image1xxl.jpg",
   "ItemType": "Product",
   "Price": "£30.00",
   "ProductId": "1708924",
   "Quantity": 2,
   "Size": "UK 12",
   "Title": "ASOS Mini Frill Dress with Pretty Sleeves",
   "ValidOperations": ["CanSaveForLater"]
}

 

Example Response

{
   "BasketItems":[
      {
         "BasePrice":45.00,
         "BasketItemMessages":[

         ],
         "Colour":"Pink",
         "CustomerId":"d490d00d5d63450e954eaec033e76edd",
         "DateAdded":"/Date(1317724497227+0000)/",
         "DateExpires":"/Date(1317728097227+0000)/",
         "ImageUrl":"http://images.asos.com/inv/media/8/9/4/4/1754498/pink/image1s.jpg",
         "IsSaleItem":false,
         "ItemType":"Product",
         "ParentId":"1754498",
         "Price":"£45.00",
         "ProductId":"1754530",
         "Quantity":1,
         "Size":"UK 10",
         "Title":"ASOS Dress with Bow Back",
         "ValidOperations":[
            "CanDelete",
            "CanSaveForLater",
            "CanEdit"
         ]
      },
      {
         "BasePrice":45.00,
         "BasketItemMessages":[

         ],
         "Colour":"Grey",
         "CustomerId":"d490d00d5d63450e954eaec033e76edd",
         "DateAdded":"/Date(1317724528147+0000)/",
         "DateExpires":"/Date(1317728128147+0000)/",
         "ImageUrl":"http://images.asos.com/inv/media/9/7/6/6/1856679/grey/image1s.jpg",
         "IsSaleItem":false,
         "ItemType":"Product",
         "ParentId":"1856679",
         "Price":"£45.00",
         "ProductId":"1856690",
         "Quantity":1,
         "Size":"M",
         "Title":"The Rock Boutique Jumper In Lady Luck Print",
         "ValidOperations":[
            "CanDelete",
            "CanSaveForLater",
            "CanEdit"
         ]
      },
      {
         "BasePrice":40.00,
         "BasketItemMessages":[

         ],
         "Colour":"Silver foil",
         "CustomerId":"d490d00d5d63450e954eaec033e76edd",
         "DateAdded":"/Date(1317724539077+0000)/",
         "DateExpires":"/Date(1317728139077+0000)/",
         "ImageUrl":"http://images.asos.com/inv/media/7/6/4/4/1664467/silverfoil/image1s.jpg",
         "IsSaleItem":false,
         "ItemType":"Product",
         "ParentId":"1664467",
         "Price":"£40.00",
         "ProductId":"1664470",
         "Quantity":1,
         "Size":"UK 10",
         "Title":"ASOS Foil Bandeau Unitard",
         "ValidOperations":[
            "CanDelete",
            "CanSaveForLater",
            "CanEdit"
         ]
      },
      {
         "BasePrice":30.00,
         "BasketItemMessages":[

         ],
         "Colour":"Navy",
         "CustomerId":"d490d00d5d63450e954eaec033e76edd",
         "DateAdded":"/Date(1317729937720+0000)/",
         "DateExpires":"/Date(1317733537720+0000)/",
         "ImageUrl":"http://images.asos.com/inv/media/2/8/7/3/1703782/navy/image1xxl.jpg",
         "IsSaleItem":false,
         "ItemType":"Product",
         "ParentId":"1703782",
         "Price":"£30.00",
         "ProductId":"1708924",
         "Quantity":2,
         "Size":"UK 12",
         "Title":"ASOS Mini Frill Dress with Pretty Sleeves",
         "ValidOperations":[
            "CanDelete",
            "CanSaveForLater",
            "CanEdit"
         ]
      }
   ],
   "BasketMessages":[

   ],
   "CustomerId":"d490d00d5d63450e954eaec033e76edd",
   "ItemCount":5,
   "TotalBasketValue":"£190.00",
   "ValidOperations":[
      "CanSaveForLater",
      "CanAddProduct",
      "CanAddShippingSubscription"
   ]
}