The Shopify database does not know anything about individual user carts; they exist only in the browser area. My mistake, the backend knows about carts, but you cannot edit them through the REST API. Here's the end point of Cart if you're interested in getting trolleys .
To manipulate a custom cart, you need to use the Ajax API from the storefront. In particular, this call will add products to the cart:
http:
which returns json that looks something like this:
{ "handle": "amelia", "line_price": 4000, "requires_shipping": true, "price": 2000, "title": "amelia - medium", "url": "/products/amelia", "quantity": 2, "id": 30104012, "grams": 200, "sku": "", "vendor": "the candi factory", "image": "http://static.shopify.com/s/files/1/0040/7092/products/2766315_da1b.png?1268045506", "variant_id": 30104012 }
You can get the cart yourself using the following call :
http:
What do you get:
{ "items": [ { "handle": "aquarius", "line_price": 6000, "requires_shipping": true, "price": 2000, "title": "aquarius - medium", "url": "/products/aquarius", "quantity": 3, "id": 30104042, "grams": 181, "sku": "", "vendor": "the candi factory", "image": "http://static.shopify.com/s/files/1/0040/7092/products/aquarius_1.gif?1268045506", "variant_id": 30104042 }, { "handle": "amelia", "line_price": 4000, "requires_shipping": true, "price": 2000, "title": "amelia - medium", "url": "/products/amelia", "quantity": 2, "id": 30104012, "grams": 200, "sku": "", "vendor": "the candi factory", "image": "http://static.shopify.com/s/files/1/0040/7092/products/2766315_da1b.png?1268045506", "variant_id": 30104012 } ], "requires_shipping": true, "total_price": 10000, "attributes": null, "item_count": 5, "note": null, "total_weight": 947 }