Product Advertising API
Developer Guide (API Version 2013-08-01)

Retrieving the Contents of a Cart

You should not maintain a local copy of the remote shopping cart. Instead, use CartGet to retrieve the items in a shopping cart.

Retrieving the items in a cart

  • Use the cart's HMAC and CartId values in a CartGet request. Service=AWSECommerceService& AWSAccessKeyId=[AWS Access Key ID]& AssociateTag=[Associate Tag]& Operation=CartGet& CartId=002-2041347-9034467& HMAC=[HMAC] &Timestamp=[YYYY-MM-DDThh:mm:ssZ] &Signature=[Request Signature]

By default, CartGet uses the Cart response group. This response group provides a lot of information about items, including, for example, their price, quantity, and the seller ID of the seller selling the item, as shown in the following response snippet.

<PurchaseURL>[AWS Access Key ID]</PurchaseURL> <CartItems> <SubTotal> <Amount>1994</Amount> <CurrencyCode>USD</CurrencyCode> <FormattedPrice>$19.94</FormattedPrice> </SubTotal> <CartItem> <CartItemId>U3KYV0C66V3PAA</CartItemId> <ASIN>B000062TU1</ASIN> <Quantity>2</Quantity> <Title>Harry Potter and the Sorcerer's Stone (Full Screen Edition)(Harry Potter 1)</Title> <ProductGroup>DVD</ProductGroup> <Price> <Amount>997</Amount> <CurrencyCode>USD</CurrencyCode> <FormattedPrice>$9.97</FormattedPrice> </Price> <ItemTotal> <Amount>1994</Amount> <CurrencyCode>USD</CurrencyCode> <FormattedPrice>$19.94</FormattedPrice> </ItemTotal> </CartItem> </CartItems>

You could, for example, use the CartItemId in a CartModify operation to change the quantity of that item. You could also use the PurchaseURL to purchase the items in the cart.