| Did this page help you? Yes No Tell us about it... |
In one
CartCreate
request, you can add up to ten different items to the cart. The quantity of
each item can be between 1 and 50. That means in one
CartCreate
request, you could add up to five-hundred items (10 items * 50 quantity).
Items are specified in parameter pairs, as follows:
Item.N.ItemIdType=[Item identifier] Item.N.Quantity=[Number of Item.N items]
N is a positive integer. The N value associates the ItemId with the quantity of those items that should be added to the cart, for example:
Item.1.OfferListingId=[An OfferListingId]& Item.1.Quantity=3& Item.2.OfferListingId=[An OfferListingId]& Item.2.Quantity=5&
This request adds three number 1 items and five number 2 items to the remote shopping cart. You could interchange lines without affecting the end result, for example:
Item.1.OfferListingId=[An OfferListingId]& Item.2.OfferListingId=[An OfferListingId]& Item.1.Quantity=3& Item.2.Quantity=5&
The values for
N
do not have to be listed in ascending or descending order, nor do the values of
N
need to be sequential. You could, for example, use the values, 1, 4, 7 for
N. Also, the value of
N
is not retained between requests. For that reason, it is permissible to use
Item.1 in a
CartCreate
request and then in a
CartAdd
request, which adds an item to the cart. In these requests, Item.1 can refer to
two completely different items.
The value of adding multiple items to the cart in one request is performance. It takes less time to add ten items in one request than it does to add ten items to the cart in ten separate requests.
You can specify items to add to a cart in the following ways.
The
CartCreate
example uses OfferListingId to identify the items to add to the cart. An
OfferListingId is returned by the Offers and OfferFull response groups. An
alternative is using an item's ASIN. An ASIN is assigned to every item
offered by Amazon. An OfferListingId is assigned to every item that is
available for sale.
The advantage of using OfferListingId in the
CartCreate
request is that items that cannot be purchased, such as Variation parent
items, do not have OfferListingId's. By using the OfferListingId, you
are assured that an item can be purchased.