Magento 1.x – Adding new fields to Magento core API


If you need to change the Magento core API, such as adding new fields, you will need to extend the core WSDL file of the module of your needs.

In the example below, we are going to add a new field in the Mage/Sales API. To do so, we will need to perform the following steps:

  • Create a new local extension.
  • Add the following files:

app/code/local/Offset101/SalesOrderApi/etc/wsdl.xml

Take care of the core wsdl(app/code/core/Mage/Sales/etc/wsdl.xml), and add your custom field within the corresponding tags.

ie: If we want to add a “custom_sku” in the complex type salesOrderItemEntity, our wsdl will look like this:

 

app/code/local/Offset101/SalesOrderApi/etc/wsi.xml

Take care of the core wsdl(app/code/core/Mage/Sales/etc/wsi.xml), and add your custom field within the corresponding tags.

ie: If we want to add a “custom_sku” in the complex type salesOrderItemEntity, our wsdl will look like this:

 

Once the extension was created and both files were added, you can make a try going through: