Module: Mage_Catalog
Resource: catalog_product
Aliases:
- product
Method:
- catalog_product.create (SOAP V1)
- catalogProductCreate (SOAP V2)
Allows you to create a CONFIGURABLE product and return ID of the created product.
Aliases:
- product.create
Arguments:
Type | Name | Description |
string | sessionId | Session ID |
string | type | Product type |
string | set | ID of the product attribute set |
string | sku | Product SKU |
array | productData | Array of catalogProductCreateEntity |
string | storeView | Store view ID or code |
Returns:
Type | Name | Description |
int | result | ID of the created product |
The catalogProductCreateEntity content is as follows:
Type | Name | Description |
ArrayOfString | categories | Array of categories |
ArrayOfString | websites | Array of websites |
string | name | Product name |
string | description | Product description |
string | short_description | Product short description |
string | weight | Product weight |
string | status | Product status |
string | url_key | URL key |
string | url_path | URL path |
string | visibility | Product visibility on the frontend |
ArrayOfString | category_ids | Array of category IDs |
ArrayOfString | website_ids | Array of website IDs |
string | has_options | Defines whether the product has options |
string | gift_message_available | Defines whether the gift message is available for the product |
string | price | Product price |
string | special_price | Product special price |
string | special_from_date | Date starting from which the special price will be applied to the product |
string | special_to_date | Date till which the special price will be applied to the product |
string | tax_class_id | Tax class ID |
array | tier_price | Array of catalogProductTierPriceEntity |
string | meta_title | Meta title |
string | meta_keyword | Meta keyword |
string | meta_description | Meta description |
string | custom_design | Custom design |
string | custom_layout_update | Custom layout update |
string | options_container | Options container |
array | additional_attributes | Array of catalogProductAdditionalAttributesEntity |
array | stock_data | Array of catalogInventoryStockItemUpdateEntity |
array | configurable_products_data | Array of configurableProductsData |
array | configurable_attributes_data | Array of configurableAttributesData |
Notes: The “websites” and “website_ids” or “categories” and “category_ids” parameters are interchangeable. In other words, you can specify an array of website IDs (int) and then you don’t need to specify the array of website codes (string) and vice versa.
The catalogProductTierPriceEntity content is as follows:
Type | Name | Description |
string | customer_group_id | Customer group ID |
string | website | Website |
int | qty | Quantity |
double | price | Tier price |
The catalogInventoryStockItemUpdateEntity content is as follows:
Type | Name | Description |
string | qty | Quantity of items |
int | is_in_stock | Defines whether the item is in stock |
int | manage_stock | Manage stock |
int | use_config_manage_stock | Use config manage stock |
int | min_qty | Minimum quantity for items to be in stock |
int | use_config_min_qty | Use config settings flag (value defined in the Inventory System Configuration) |
int | min_sale_qty | Minimum quantity allowed in the shopping cart |
int | use_config_min_sale_qty | Use config settings flag |
int | max_sale_qty | Maximum quantity allowed in the shopping cart |
int | use_config_max_sale_qty | Use config settings flag |
int | is_qty_decimal | Defines whether the quantity is decimal |
int | backorders | Backorders status |
int | use_config_backorders | Use config settings flag (for backorders) |
int | notify_stock_qty | Stock quantity below which a notification will appear |
int | use_config_notify_stock_qty | Use config settings flag (for stock quantity) |
The catalogProductAdditionalAttributesEntity content is as follows:
Type | Name |
associativeMultiArray | multi_data |
associativeArray | single_data |
Single Data: array of attributes with only single value
Multi Data: array of attributes which could contain several values
The configurableProductsData content is as follows:
Type | Name | Description |
array | dadoProdutoConfigurado | Array of dadoProdutoConfigurado |
The dadoProdutoConfigurado content is as follows:
Type | Name | Description |
string | produto_id | ID of the simple product to be associated with the configurable product |
The configurableAttributesData content is as follows:
Type | Name | Description |
array | dadoAtributoConfigurado | Array of dadoAtributoConfigurado |
The dadoAtributoConfigurado content is as follows:
Type | Name | Description |
array | values | Array of dadoAtributoConfiguradoValor |
string | attribute_id | ID of the attribute used to build the configurable product |
string | attribute_code | CODE of the attribute used to build the configurable product |
The dadoAtributoConfiguradoValor content is as follows:
Type | Name | Description |
string | attribute_id | ID of the attribute used to build the configurable product |
Faults:
Fault Code | Fault Message |
100 | Requested store view not found. |
102 | Invalid data given. Details in error message. |
104 | Product type is not in allowed types. |
105 | Product attribute set is not existed |
106 | Product attribute set is not belong catalog product entity type |
SIMPLE PRODUCT XML EXAMPLE
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<urn:catalogProductCreate soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sessionId xsi:type="xsd:string">abcdefghijklmnopqrstuvxz</sessionId>
<type xsi:type="xsd:string">simple</type>
<set xsi:type="xsd:string">1</set>
<sku xsi:type="xsd:string">camiseta-led-zeppelin-p</sku>
<productData xsi:type="urn:catalogProductCreateEntity">
<name xsi:type="xsd:string">Camiseta Led Zeppelin Tamanho P</name>
<description xsi:type="xsd:string">Camiseta Led Zeppelin 100% algodão</description>
<short_description xsi:type="xsd:string">Camiseta Led Zeppelin 100% algodão</short_description>
<weight xsi:type="xsd:string">0.1</weight>
<status xsi:type="xsd:string">1</status>
<visibility xsi:type="xsd:string">4</visibility>
<price xsi:type="xsd:string">100</price>
<tax_class_id xsi:type="xsd:string">1</tax_class_id>
<additional_attributes xsi:type="urn:associativeArray" soapenc:arrayType="urn:associativeEntity[]">
<single_data>
<tamanho>
<key>tamanho</key>
<value>P</value>
</tamanho>
</single_data>
</additional_attributes>
</productData>
<storeView xsi:type="xsd:string">1</storeView>
</urn:catalogProductCreate>
</soapenv:Body>
</soapenv:Envelope>
CONFIGURABLE PRODUCT XML EXAMPLE
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<urn:catalogProductCreate soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sessionId xsi:type="xsd:string">abcdefghijklmnopqrstuvxz</sessionId>
<type xsi:type="xsd:string">configurable</type>
<set xsi:type="xsd:string">4</set>
<sku xsi:type="xsd:string">camiseta-led-zeppelin</sku>
<productData xsi:type="urn:catalogProductCreateEntity">
<name xsi:type="xsd:string">Camiseta Led Zeppelin</name>
<description xsi:type="xsd:string">Camiseta Led Zeppelin 100% algodão</description>
<short_description xsi:type="xsd:string">Camiseta Led Zeppelin 100% algodão</short_description>
<weight xsi:type="xsd:string">0.1</weight>
<status xsi:type="xsd:string">1</status>
<visibility xsi:type="xsd:string">4</visibility>
<price xsi:type="xsd:string">100</price>
<tax_class_id xsi:type="xsd:string">1</tax_class_id>
<configurable_products_data xsi:type="urn:dadosProdutosConfigurados">
<dadoProdutoConfigurado xsi:type="urn:dadoProdutoConfigurado">
<produto_id xsi:type="xsd:string">125</produto_id>
</dadoProdutoConfigurado>
</configurable_products_data>
<configurable_attributes_data xsi:type="urn:dadosAtributosConfigurados">
<dadoAtributoConfigurado xsi:type="urn:dadoAtributoConfigurado">
<values xsi:type="urn:dadoAtributoConfiguradoValores">
<dadoAtributoConfiguradoValor xsi:type="urn:dadoAtributoConfiguradoValor">
<attribute_id xsi:type="xsd:int">133</attribute_id>
</dadoAtributoConfiguradoValor>
</values>
<attribute_id xsi:type="xsd:int">133</attribute_id>
<attribute_code xsi:type="xsd:string">tamanho</attribute_code>
</dadoAtributoConfigurado>
</configurable_attributes_data>
</productData>
<storeView xsi:type="xsd:string">1</storeView>
</urn:catalogProductCreate>
</soapenv:Body>
</soapenv:Envelope>