The CartAdd operation allows you to add items to an existing remote shopping cart.
Note:
CartAdd can only be used to place a new product in a shopping cart. It cannot be used to increase the quantity of an item already in the cart. If you would like to increase the quantity of an item that is already in the cart, you will need to use the CartModify operation.
Note:
The cart remains accessible for 90 days after it is last accessed.
CartAdd is available in all of the locales.
Using CartAdd (REST)
This example demonstrates how CartAdd can be used to add an ASIN to a remote shopping cart.
http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&SubscriptionId=[Your Subscription ID Here]&Operation=CartAdd&CartId=[A Cart ID]&HMAC=[An HMAC Shopping Cart Token]&Item.1.ASIN=[An ASIN]&Item.1.Quantity=1
Request parameters specify the terms of your request and control the output data that is returned to you.
You must include the required parameters in every request.
CartAdd accepts the optional parameters that are common to all operations:
The following parameters are specific to the CartAdd operation:
| Parameter | Description | Required? | Value |
|---|---|---|---|
| Operation | The operation. | Always Required | CartAdd |
| CartId |
The CartId is a unique identifier for an Amazon remote shopping cart. CartIds are initially obtained by using the CartCreate operation. |
Always Required |
Required Value:
|
| HMAC |
The HMAC is a unique security token that, when used with the CartId, allows you to access and modify (add to, remove from, empty) a specific remote shopping cart that you have created from your application or Web site. HMACs are initially obtained by using the CartCreate operation. Any plus signs ("+") embedded in the HMAC must be encoded as %2B for REST. |
Always Required |
Required Value:
|
| Items |
The Items parameter must be used in all SOAP requests. It cannot be used with any other protocol. The Items parameter serves as a container element for the list of products that will be added to a shopping cart. An Items element would contain 1 or more Item elements in a SOAP request. |
Required for SOAP | |
| Item |
In SOAP Requests: The Item parameter serves as a container element that is a child of the Items element. As a container element, an Item holds product ID elements (like ASIN) and Quantity elements. In REST Requests: The Item parameter in a REST request serves as a means of prefixing one or more products (Item.1.ASIN) and the quantities of those products (Item.1.Quantity). |
Always Required | |
| ASIN |
The ASIN parameter is a child element of the Item parameter in both SOAP and REST requests. The ASIN parameter is required in an Item element if you are not using OfferListingId to identify an item. |
Valid Value:
|
|
| OfferListingId |
The OfferListingId uniquely identifies a particular product being sold by a particular seller or merchant. The OfferListingId is required when the item being placed in the shopping cart is not being sold by Amazon. When Amazon is selling the product, you must use the ASIN parameter. The OfferListingID parameter is required in an Item element if you are not using an ASIN to identify an item. |
Valid Values:
|
|
| Quantity |
The Quantity parameter is paired with any of the product ID parameters and specifies the number to be added to the cart. It must be used as a child of an Item element in a request. |
Always Required |
Valid Values:
|
| ResponseGroup |
Controls the data returned by the operation. Use this parameter to specify which response group(s), or group(s) of data elements, you would like Amazon E-Commerce Service (ECS) to return to you. You can specify as many response groups as you wish using a comma-separated list (REST) or multiple elements (SOAP). |
Always Optional |
Default Values: Valid Values: |