Creating a Remote Shopping Cart
A remote shopping cart must be created the first time a customer decides to add an item to a shopping cart. Once the cart is created, it is reused and modified appropriately until it expires. Only one local cart can be created and only one cart per customer per vendor should be created.
Typically, an HTML button labeled, for example, Add to Cart, implements a
CartCreate
request, which includes:
-
At least one item to add to the cart.
You cannot create an empty cart.
-
An optional
AssociateTag
.Including the
AssociateTag
value gives the Associate credit for the customer's purchase. -
In the US locale, an option to merge the contents of a remote cart with the customer's local cart.
Example Setting MergeCart to True
The following request sets
MergeCart
to True.
http://ecs.amazonaws.com/onca/xml? Service=AWSECommerceService& AWSAccessKeyId=[AWS Access Key ID]
& AssociateId=[ID]
& Operation=CartCreate
& Item.1.OfferListingId=B000062TU1& Item.1.Quantity=2& MergeCart=True
In this example, two of the same item (Quantity=2) whose ASIN is B000062TU1 are
added to the newly created (Operation=CartCreate
)
shopping cart. The Associate specified will receive a referral fee if the customer
purchases the item.
In the lifespan of a shopping cart,
CartCreate
can be used only once. If you call
CartCreate
a second time, you create a new shopping cart. We recommend that you only create
one cart per customer.
Adding List Items to a Cart
Customers can create lists of items they would like others to purchase for them. Each item on a list has a ListItemId. ListItemId is returned by the ListInfo response group.
To add a list item to a remote shopping cart
-
Include in the
CartCreate
request the item's ListItemId along with the item's ASIN or OfferListingId, for example:http://ecs.amazonaws.com/onca/xml? Service=AWSECommerceService& AWSAccessKeyId=
[AWS Access Key ID]
& AssociateId=[ID]
& Operation=CartCreate
& Item.1.OfferListingId=B000062TU1& Item.1.Quantity=2& Item.1.ListItemId=C909324538U3
The importance of including the
ListItemId
is that Amazon automatically updates the status of items on lists. By including
the
ListItemId
in this request, Amazon will mark on the list that the item has been purchased.
Also, the
ListItemId
attaches the name and address of the list owner, which the ASIN alone does not.
-
Amazon automatically updates the status of items on lists. By including the
ListItemId
in this request, Amazon will mark on the list that the item has been purchased. -
ListItemId includes in the response the name and address of the list owner, which ASIN or
OfferListingId
alone does not.
Related Topics