Welcome‎ > ‎Version 3‎ > ‎Publisher Api‎ > ‎Methods‎ > ‎7 - Cart Api‎ > ‎

Save Shopping Cart

Will save a shopping cart under a ShopperKey.  The ShopperKey can be either the UserKey or an anonymous token generated for a browsing user.

Method: PUT /api/v3/publisher/cart/{shopperKey}/{cartName}

Authentication: oauth
 
Url
Required Form Name Data Type Explanation
Yes
shopperKeystring The shopperKey either the UserKey or an anonymous token.
Yes cartName string The name of the cart.


Post
Required Form Name Data Type Explanation
No
ShopperType string The type of shopper.  One of "Unknown", "Visitor", or "Profile"
Yes Items[0...n].OfferId int The Offer Id the consumer placed in their cart.
Yes Items[0...n].OfferOptionId int The Offer Option Id the consumer placed in their cart.
Yes
Items[0...n].Quantity
int
The quantity associated with this item.

Returns


Sample Request:

POST https://api.groupcommerce.com/api/v3/publisher/cart/ShopperKey1/Default_Cart

Form: ShopperType=Unknown&Items%5B0%5D.OfferId=7501&Items%5B0%5D.OfferOptionId=76012&Items%5B0%5D.Quantity=2&Items%5B1%5D.OfferId=8502&Items%5B1%5D.OfferOptionId=86023&Items%5B1%5D.Quantity=1&Items%5B2%5D.OfferId=9503&Items%5B2%5D.OfferOptionId=96024&Items%5B2%5D.Quantity=4

OAuth oauth_signature="dtxf%2FPx%2FjFUj9kba0jgVJHZ%2FegA%3D", oauth_nonce="6928832", oauth_timestamp="1353950450", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"


Sample JSON Response:

{
    "errors":[],
    "lastPublished":"/Date(1319762442406)/",
    "success":true,
    "version":"3"
}


Sample XML Response:

<saveShoppingCartResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <errors />
  <lastPublished>2012-11-26T17:22:49.1642556Z</lastPublished>
  <success>true</success>
  <version>3</version>
</saveShoppingCartResponse>
Comments