Magento – Add Product to Cart via SOAP error – Please specify the product required option(s)

apicustom-optionsmagento-1.7soap

I am trying to use the shoppingCartProductAdd SOAP API to add a product with Custom Options to cart.

Below is the array I am passing for the products parameter. I've a required custom option id 1 for which the selected value id in the dropdown is 2. (you can view the product here)

array (size=1)
  0 => 
    array (size=3)
      'product_id' => int 25
      'qty' => int 1
      'options' => 
        array (size=1)
          1 => int 2

When I execute this SOAP request, I get an error "Please specify the product required option(s)."

It looks like its not accepting my 'options' key in the array.

What am I doing wrong?

Best Answer

I was able to solve this problem by using the answer here - https://stackoverflow.com/questions/19899127/setting-custom-options-while-adding-a-product-to-cart-via-soap-in-magento/19925338#19925338

The format in which options needs to be passed as not as stated in the Magento SOAP documentation.

Related Topic