Shopping Cart Concepts
Topics
The following sections describe remote shopping carts in detail.
Cart Limitations
A cart can contain up to 50 entries. Each entry can represent one or more (up to 999) of the same items. That means that an Product Advertising API shopping cart can contain a maximum of almost 50,000 items.
Many products have a limit on the quantity that can be added to a cart. Sometimes
this is inherent to the product, for example, one-of-a-kind jewelry items. Sometimes
it is a limit set by the vendor, for example, they might set a limit on big ticket
items, such as a motorcycle, of one per customer. If you add an item to the cart
with a quantity that exceeds the maximum allowed,
CartAdd
automatically resets the quantity to the maximum value. No error is generated.
Therefore, you must verify the quantity of items in the cart with the number ordered
to determine if the quantity has been capped. If so, you must notify the customer.
Active and SaveForLater Areas
Shopping carts have two distinct areas:
-
Active—Contains the items that are ready to be purchased.
-
SavedForLaterItem—Contains items that a customer has chosen to buy but are currently unavailable, or items that a customer has designated they want to save and buy later.
Available items placed in a shopping cart are automatically added to the Active area unless the customer specifies otherwise. Unavailable items or items in the shopping cart that become unavailable are automatically put into the SaveForLater area. When those items become available Amazon automatically moves the items to the Active area of the shopping cart.
The SaveForLater area can also be used by customers as a holding place for items they are interested in but not ready to purchase. The prices and availability for items in this area are regularly updated by Amazon.
Items That Cannot Be Added to the Active Cart Area
-
Out of stock items
-
Items with limited quantities
-
Variation parent items
-
Collection parent items
Out of Stock Items
When a customer adds an item to their cart that is not available, it is added to the SavedForLater area. Also, if an item in the cart, for some reason, becomes unavailable, Amazon automatically moves the item in the cart to the SavedForLater items section.
It is also possible for a customer to add an item directly to the SavedForLater items area in their cart so that they can easily purchase the item at a later date.
When items become available, you can use the
CartModify
operation with the Action parameter to move items from the SaveForLater section
of the cart to the Active section, which is fully described in
Moving Adding Items as Saved For
Later.
Or, if Amazon automatically moved an item in the Active area to the SaveForLater
area because the item went out of stock, Amazon will move it back into the
Active area automatically when it becomes available.
Items With Limited Quantities
Many products have a limit on the quantity that can be added to a cart.
Sometimes this is inherent to the product, for example, one-of-a-kind jewelry
items. Sometimes it is a limit set by the vendor, for example, they might set a
limit for big ticket items of one per customer. If you add an item to the cart
with a quantity that exceeds the maximum,
CartAdd
or
CartCreate
automatically resets the quantity to the maximum. No error is generated.
Therefore, you must verify the quantity of items in the cart with the number
ordered to determine if the quantity has been capped. If so, you must notify the
customer.
Variation Parents
Variation parent items cannot be added to a cart. For example, you cannot add Apparel to a cart because it is not clear what apparel you really want to buy. You could add one of its children, however, such as a red shirt, size large. If you try to add a parent item, you get an error message similar to the following.
The item you specified, [ASIN]
, is not eligible to be added to the cart. Check the item’s availability to make sure it is available.
Variation parents do not have corresponding OfferListingId's.
Collection Parents
Collection parent items are abstractions of the items in the collection. The collection parent cannot be added to a cart. The Collection parent is used as a name holder for the collection. Collection parents do not have corresponding OfferListingId's.
Offers and Identifiers
ASINs and Listing IDs identify items, such as a Harry Potter book. ASINs and Listing IDs do not, however, identify sales information related to those items.
As you can see in the preceding figure, an ASIN identifies an item but not an instance of it that a customer can purchase. Every ASIN can be sold by many merchants. Each merchant lists the condition and price of the item. This combination of data represents an OfferListingId. Taken together, all OfferListingIds are referred to as offers. If an ASIN (or Listing ID) does not have an OfferListingId (or ExchangeId), the item cannot be purchased.
For this reason, it is recommended that you add items to a shopping cart by their OfferListingId (or ExchangeId) rather than by their ASIN (or ListingId).
Remote Shopping Carts are Hosted by Amazon
Because Product Advertising API shopping carts are hosted by Amazon instead of a local host, the shopping carts are called "remote." The cart used by a customer shopping on the Amazon retail web site, www.amazon.com in the US locale, is considered the "local" shopping cart. Amazon maintains for each customer ID only one local shopping cart. Developers can maintain more than one remote shopping cart for a customer but maintaining one cart per customer ID is recommended.
Cart Lifespan
Cart Creation
The first time a customer wants to add an item to their shopping cart, a
remote shopping cart must be created, which is accomplished using the
CartCreate
operation. It is not possible to create an empty cart. At least, one item must
be added.
Modifying a Cart
-
Items can be added to and deleted from the cart
-
Items can be moved from the Active area of the cart to the SaveForLater area, or the reverse
-
In the US locale, the MergeCart value can be changed
The CartId and HMAC are used in the
CartModify
,
CartAdd
, or
CartClear
operations to modify the contents of the cart.
Cart Expiration
Once the items in a cart have been purchased using the
PurchaseURL
value, the cart is not deleted immediately but it should no longer be used.
From a customer's point of view, once he or she has purchased the items in
their cart and there are no items remaining in the SaveForLater section, the old
cart is gone. The next time they want to purchase an item, they receive a new
cart.