http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=
[AWS Access Key ID]
&
AssociateTag=
[Associate ID]
&
Operation=CartModify &
CartId=102-5929035-5792105&
HMAC=
[HMAC]
&
Item.1.CartItemId=
[Cart Item ID]
& Item.1.Quantity=10
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request Signature]
Notice that the item in the cart is referred to by its
CartItemId
. The
Quantity
value, 10, is the total
number of those items that should be in the cart.
If the item being added to the cart is not already in the cart, you must use the
CartAdd
operation.
CartAdd
cannot increase the quantity of items that are already in the cart. If you try to do that, you get an error.
The following is an example of a request using
CartAdd
.
http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=
[AWS Access Key ID]
&
CartId=102-5929035-5792105&
HMAC=
[HMAC]
=&
Operation=CartAdd &
Item.1.OfferListingId=1400042127& Item.1.Quantity=2
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request Signature]
This request adds to the cart two (Quantity=2) of the same items, which are identified by the OfferListingId
(1400042127).
As you can see, the method of identifying the item and its quantity to add to the cart is the same as it was
for
CartCreate.
For more information, see
CartCreate. (p. 175)
Adding Items as Saved For Later
To add an item to the SaveForLater area, use "SaveForLater" as the value for the
Action
parameter in
a
CartModify
operation, for example:
http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=
[AWS Access Key ID]
&
AssociateTag=
[Associate ID]
&
Operation=CartModify&
CartId=
[Cart ID]
&
HMAC=
[HMAC]
&
Item.1.CartItemId=
[Cart Item ID]
&
Item.1.Quantity=1
Item.1.Action=SaveForLater
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request Signature]
In this request, the item identified by Item.1 is moved to the cart's SaveForLater area. The Quantity
parameter enables you to move only some of one type of item into the SaveForLater area, for example,
API Version 2011-08-01
143
Product Advertising API Developer Guide
Remote Shopping Cart Tasks