Update an item in a basket

Updates a product in the basket, then returns the items within the basket.

URL

HTTP Put

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 BasketItems.
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 takes two ‘BasketItem’ entities.  The first one is the original item, the second one is the replacement item. For example, to increase a quantity, you would pass in two similar entities, but with the second item having the increased Quantity property.

[{
   "BasePrice":30.00,
   "BasketItemMessages":[],
   "Colour":"Navy",
   "CustomerId":"d490d00d5d63450e954eaec033e76edd",
   "DateAdded":"\/Date(1317733631453+1300)\/",
   "DateExpires":"\/Date(1317737231453+1500)\/",
   "ImageUrl":"http://images.asos.com/inv/media/2/8/7/3/1703782/navy/image1xxl.jpg",
   "IsSaleItem":false, 
   "ItemType":"Product",
   "ParentId":"1703782",
   "Price":"£45.00",
   "ProductId":"1708924",
   "Quantity":1,
   "Size":"UK 12",
   "Title":"ASOS Mini Frill Dress with Pretty Sleeves",
   "ValidOperations": [
      "CanSaveForLater",
      "CanEdit",
      "CanDelete"
	]
},
{
   "BasePrice":30.00,
   "BasketItemMessages":[],
   "Colour":"Nude",
   "CustomerId":"d490d00d5d63450e954eaec033e76edd",
   "DateAdded":"\/Date(1317733631453+1300)\/",
   "DateExpires":"\/Date(1317737231453+1500)\/",
   "ImageUrl":"http://images.asos.com/inv/media/2/8/7/3/1703782/nude/image1s.jpg",
   "IsSaleItem":false, 
   "ItemType":"Product",
   "ParentId":"1703782",
   "Price":"£45.00",
   "ProductId":"1718730",
   "Quantity":2,
   "Size":"UK 12",
   "Title":"ASOS Mini Frill Dress with Pretty Sleeves",
   "ValidOperations": [
      "CanSaveForLater",
      "CanEdit",
      "CanDelete"
   ]
}]

 

Example Response

The ‘Basket’ entity is returned from this call. You should check the ‘BasketMessages’ property, which will contain a description of any errors that occurred. If there are none, then the item was updated successfully.

{
   "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":"Nude",
         "CustomerId":"d490d00d5d63450e954eaec033e76edd",
         "DateAdded":"/Date(1317733631453+0000)/",
         "DateExpires":"/Date(1317737231453+0000)/",
         "ImageUrl":"http://images.asos.com/inv/media/2/8/7/3/1703782/nude/image1s.jpg",
         "IsSaleItem":false,
         "ItemType":"Product",
         "ParentId":"1703782",
         "Price":"£30.00",
         "ProductId":"1718730",
         "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"
   ]
}