cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch Associated products using Magento 1.x SOAP API

How to fetch Associated products using Magento 1.x SOAP API

We have a Magento 1 site and are trying to create a sync between the Magento instance and the ERP system. We were able to fetch the product data using the Magento 1 SOAP(V2) API catalogProductInfo method. But we've got some products that are configurable & they have some associated products. How can we get the reference between those? Or alternatively, how can we fetch the Product with their Associated products at the same time?

 

We even tried the catalogProductLinkList method. But that returns an empty response.
 
Sharing the example requests below:
 
Firstly fetch the Product info using the catalogProductInfo method:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento">
<soapenv:Header/>
<soapenv:Body>
<urn:catalogProductInfoRequestParam>
<sessionId>6257280f8d215cd41d1c5a41e922738a</sessionId>
<productId>3095</productId>
</urn:catalogProductInfoRequestParam>
</soapenv:Body>
</soapenv:Envelope>
 
Then fetch the Associated products using catalogProductLinkList method:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento">
<soapenv:Header/>
<soapenv:Body>
<urn:catalogProductLinkListRequestParam>
<sessionId>ab23fcff1f52f1c5e41f7e13cc991f68</sessionId>
<type>grouped</type>
<productId>3031</productId>
</urn:catalogProductLinkListRequestParam>
</soapenv:Body>
</soapenv:Envelope>
We tried passing these values to the type param: cross_sell, up_sell, related, grouped. Still the same.
 
This is how the Associated products are configured on Magento Admin UI:

Screenshot 2024-10-12 at 1.42.20 AM.png

Please note that we are not experts on Magento. If anyone could point us in the right direction, that would be great! Thanks in advance.
2 REPLIES 2

Re: How to fetch Associated products using Magento 1.x SOAP API

Hello

 

Apologies if you have already tried this but my understanding is that 


You first need to retrieve the configurable attributes (like size or color) using the catalogProductAttributeOptionsmethod. Then, use the catalogProductInfo method to get the configurable product details, including its super_attributes, which contain the associated simple products.

If this help please give me a thumbs up.

Regards!
Ajaruden Parihar
Magento Master and Instructor @LTS HUB
https://www.ltshub.com/

If my suggestion helped you in any way. Please give my answer a thumbs up.

Regards!
Ajarudeen Parihar
https://www.ltshub.com

Re: How to fetch Associated products using Magento 1.x SOAP API

Hi Ajaruden,

Thanks for the quick reply. I tried your solution. That doesn't seem to work! The 

catalogProductAttributeOptions method actually returns a list of the possible values of the product attributes. Then I tried catalogProductAttributeList method & tried using
attribute_id of the relation between the super products, which is product_size. That also returns the same!
Here's one XML that I tried:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:catalogProductInfoRequestParam>
         <sessionId>c1694c3c88153c813f89253b4c468d82</sessionId>
         <productId>3095</productId>
         <!--Optional:-->
         <attributes>
            <!--Optional:-->
            <additional_attributes>
               <!--Zero or more repetitions:-->
               <complexObjectArray>138</complexObjectArray>
            </additional_attributes>
         </attributes>
      </urn:catalogProductInfoRequestParam>
   </soapenv:Body>
</soapenv:Envelope>
I also, tried exporting the Products, in the export I found a column named 

_super_products_sku & some other columns related to _super. Ideally, that's exactly what we need using the API. If anyone could guide me to the right direction that would be great!