Add to Cart Configurable Products Using Magento SOAP API V1

addtocartapimagento-1.8soap

Trying to add configurable product in magento cart using magento soap api V1 but not able to add the products. can anyone please let me know the way how to do it.
Any help would be appreciated.

Best Answer

For add to cart of configurable product,you need to super attribute value. in my below if only one super attribute so in super_attribute i have set one value

$quoteId = $client->call( $session, 'cart.create',array( 'default' ));
$arrProducts = array(
    array(
        "product_id" =>"21",
        "qty" => 2,
                "super_attribute" => array(         
                    92 => 162

                 )
    )

);



$resultCartProductAdd = $client->call(
    $sessionId,
    "cart_product.add",
    array(
        $quoteId,
        $arrProducts
    )
);

here 92 is attribute id and 162 it option id if you have more then one variance for then

"super_attribute" => array(         
                    first_attribute_id => first_chose_option_value
                     seocnd_attribute_id => seocnd_chose_option_value.
                     .....



                 )