Page 1 of 1

REST Endpoint documentation

Posted: Tue Mar 26, 2013 2:07 pm
by jlaker
Is the REST endpoint documentation out of date?
I see that the add to cart endpoint listed as
/cart/{categoryId}/{productId}/{skuId}

but in the 2.2.0-GA code base it appears to be
/cart/{categoryId}/{productId}

Am I missing something?

Thanks

Re: REST Endpoint documentation

Posted: Mon May 20, 2013 1:13 pm
by ktisdell
The documentation is incorrect. We will fix it with the next release. Adding the sku to the cart depends on whether the product has only a default sku or a number of skus associated with product options. For example, you might be selling hot sauce. That is a product that might only have a default sku. The following will work:

POST
/cart/{categoryId}/{productId}?skuId=1234, where the skuId parameter is the default Sku ID for the product.

However, consider a situation, where you are adding a T-Shirt to the cart. It might have color and size as product options. The default sku would not likely be sellable. Rather you would have skus that correspond to each of the product option combinations. In this case you would do something like this:

/cart/{categoryId}/{productId}?COLOR=Black&SIZE=XL, where COLOR and SIZE are product options and Black and XL are corresponding product option values.

Hope this helps.

Re: REST Endpoint documentation

Posted: Mon May 20, 2013 2:49 pm
by jlaker
OK got it. Thanks!