Skip to main content Link Menu Expand (external link) Document Search Copy Copied

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:

TypeNameDescription
stringsessionIdSession ID
stringtypeProduct type
stringsetID of the product attribute set
stringskuProduct SKU
arrayproductDataArray of catalogProductCreateEntity
stringstoreViewStore view ID or code

Returns:

TypeNameDescription
intresultID of the created product

The catalogProductCreateEntity content is as follows:

TypeNameDescription
ArrayOfStringcategoriesArray of categories
ArrayOfStringwebsitesArray of websites
stringnameProduct name
stringdescriptionProduct description
stringshort_descriptionProduct short description
stringweightProduct weight
stringstatusProduct status
stringurl_keyURL key
stringurl_pathURL path
stringvisibilityProduct visibility on the frontend
ArrayOfStringcategory_idsArray of category IDs
ArrayOfStringwebsite_idsArray of website IDs
stringhas_optionsDefines whether the product has options
stringgift_message_availableDefines whether the gift message is available for the product
stringpriceProduct price
stringspecial_priceProduct special price
stringspecial_from_dateDate starting from which the special price will be applied to the product
stringspecial_to_dateDate till which the special price will be applied to the product
stringtax_class_idTax class ID
arraytier_priceArray of catalogProductTierPriceEntity
stringmeta_titleMeta title
stringmeta_keywordMeta keyword
stringmeta_descriptionMeta description
stringcustom_designCustom design
stringcustom_layout_updateCustom layout update
stringoptions_containerOptions container
arrayadditional_attributesArray of catalogProductAdditionalAttributesEntity
arraystock_dataArray of catalogInventoryStockItemUpdateEntity
arrayconfigurable_products_dataArray of configurableProductsData
arrayconfigurable_attributes_dataArray 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:

TypeNameDescription
stringcustomer_group_idCustomer group ID
stringwebsiteWebsite
intqtyQuantity
doublepriceTier price

The catalogInventoryStockItemUpdateEntity content is as follows:

TypeNameDescription
stringqtyQuantity of items
intis_in_stockDefines whether the item is in stock
intmanage_stockManage stock
intuse_config_manage_stockUse config manage stock
intmin_qtyMinimum quantity for items to be in stock
intuse_config_min_qtyUse config settings flag (value defined in the Inventory System Configuration)
intmin_sale_qtyMinimum quantity allowed in the shopping cart
intuse_config_min_sale_qtyUse config settings flag
intmax_sale_qtyMaximum quantity allowed in the shopping cart
intuse_config_max_sale_qtyUse config settings flag
intis_qty_decimalDefines whether the quantity is decimal
intbackordersBackorders status
intuse_config_backordersUse config settings flag (for backorders)
intnotify_stock_qtyStock quantity below which a notification will appear
intuse_config_notify_stock_qtyUse config settings flag (for stock quantity)

The catalogProductAdditionalAttributesEntity content is as follows:

TypeName
associativeMultiArraymulti_data
associativeArraysingle_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:

TypeNameDescription
arraydadoProdutoConfiguradoArray of dadoProdutoConfigurado

The dadoProdutoConfigurado content is as follows:

TypeNameDescription
stringproduto_idID of the simple product to be associated with the configurable product

The configurableAttributesData content is as follows:

TypeNameDescription
arraydadoAtributoConfiguradoArray of dadoAtributoConfigurado

The dadoAtributoConfigurado content is as follows:

TypeNameDescription
arrayvaluesArray of dadoAtributoConfiguradoValor
stringattribute_idID of the attribute used to build the configurable product
stringattribute_codeCODE of the attribute used to build the configurable product

The dadoAtributoConfiguradoValor content is as follows:

TypeNameDescription
stringattribute_idID of the attribute used to build the configurable product

Faults:

Fault CodeFault Message
100Requested store view not found.
102Invalid data given. Details in error message.
104Product type is not in allowed types.
105Product attribute set is not existed
106Product 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>