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

Cart Lifespan

Shopping carts have a lifespan. A remote shopping cart is created and, in time, it expires. In between, the contents of the cart can be modified and purchased.

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

If a customer has an existing remote shopping cart, it should be used and modified accordingly. Modification can come in many forms:

  • 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

The CartId and HMAC are used in the CartModify, CartAdd, or CartClear operations to modify the contents of the cart.

Cart Expiration

It is not possible to delete a remote shopping cart. Instead, it expires automatically after ninety days of disuse if there are items in the cart, or, if the cart is empty, after seven days of disuse. Carts are emptied either by the CartClear or CartModify operations, or automatically when the customer purchases the items in their cart. The expiration of the cart is reset when the cart is modified. For example, if, on day eighty-nine of disuse, a customer modifies the items in their shopping cart, the life time of the cart is reset to an additional ninety days. In that way, shopping carts can last indefinitely.

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.