views:

271

answers:

1

Hi...

I am new to Magento, and are using their API. What I want to ask, is it possible to create a downloadable product through the API? The documentation example is just for creating a new simple product, and if I use the API to view the product.info of a downloadable product, I don't see any attribute that link to a downloadable file assigned to that product.

Any help would be appreciated, thanks :)

A: 

Hi, we all are new to Magento as the documentation is very scarce and incomplete.

I advice you to take a look into this method : setTypeInstance from the Product model. and into this class Mage_Downloadable_Model_Product_Type.

As you are creating the product through the API, the only issue is to find the correct format to put this data into the productData array that is required by the API. Probably in your array you'll need something like this:

// this is speculation
"type" => "downloadable",
"download_path" => "url"  
Elzo Valugi