magento and netsuite integration

In this blog we will discuss about the magento and netsuite integration. There are several ways we can integrate magento and netsuite. First I will brief on how we can integrate and then I will try to provide you some sample script, to be frank i don’t have access to the account in netsuite any more so I cant check the sample script but most of these are tried and tested earlier.

What all different ways we can integration Magento and netsuite using php.
I) Develop POS (point to sell) plugin using PHP to exchange information between magento and netsuite.
– This plugin will fetch/ push information in Netsuite CRM using SOAP API.

II) Keep magento as front-end and Netsuite and backend for inventory.
– This is really bad idea, but its possible. what you can do is fetch product information from netsuite and create product into magento. Configure shopping cart in netsuite CRM. so when user clicks on add to cart, push product information into netsuite cart using ajax and entire checkout process will happen in netsuite including payment, order history, customer information, everything.

III) Develop plugin using Suite Script.
– Suite Script is the langugage provided by netsutie using this user can develop custom script that can fulfil your requirement. This language is like some what javascript.

About Integration using php SOAP
Step 1: Download phptoolkit from netsuite website.
Step 2: create “NS_Config.php” include class file and add following content to the file.

class NS_Config {
    public static function getEmail()
        // this email id belongs to admin user created in Netsuite.
        return "";
    public static function getPassword()
        // password for admin user created in Netsuite.
        return "password";
    public static function getAccount()
        // Account id from Netsuite.
        return "12345678";
    public static function getRole()
        return 3; // keep this value to 3.

step 3: Create another php file to fetch all the products from netsuite using SOAP API call.

require_once './PHPtoolkit.php';  //adjust path according to folder structure.
require_once './NS_Config.php';  //adjust path according to folder structure.
//Create NS Object
$myNSclient = new nsClient( nsHost::live );
$myNSclient->setPassport(NS_Config::getEmail(), NS_Config::getPassword(), NS_Config::getAccount(), NS_Config::getRole());
//Create Item basic search instance.
$itemSearch = new nsComplexObject("ItemSearchBasic");
//passing wrong information to fetch all records from NS.
$itemSearch->setFields(array('recordRef' => new nsRecordRef(array('internalId' =>708))));
//Get products which are ready to display in webstore.
$itemSearch->setFields(array("isOnline" => array("operator" => "is", "searchValue"=> "True")));
// Set search preferences
$myNSclient->setSearchPreferences(false, 100); //100 rows per request.
// Invoke search operation
$searchResponse = $myNSclient->search($itemSearch);
if( $searchResponse->isSuccess == true  &&  $searchResponse->totalRecords > 0 ) {
   //write code to parse the xml response.
Share this nice post:

6 thoughts on “magento and netsuite integration

  1. I am really interested in getting all my items from Netsuite into Magento. We use hundreds of Netsuite Matrix items and getting them into Magento as attributes is a nightmare. There is no way to ftp images from Netsuite either, so getting images into Magento from Netsuite is impossible and the work around is time consuming! Can you help me with an easier process to import all my Netsuite items into Magento?

  2. Many thanks for an incredible submit, would examine your others content. thank you your ideas with this, I soon became somewhat strike by this short article. Thanks again! You wanna make an excellent moment. Got some excellent facts here. I feel that in case more people thought about it doing this, they’d possess a better time period get the hold ofing the issue.

  3. Thanks for an amazing post, may examine your others posts. i appreciate your thinking on this, I soon became somewhat made an impact to by this short article. Merit again! You make a good moment. Has great facts here. I believe that when more individuals thought of it like that, they’d possess a better moment in time have the grasp ofing the situation.

  4. Many thanks for an unbelievable submit, would see your particular others content. thanks for your thinking with this, I experienced somewhat made an impact to by this article. Thanks again! You make a good moment. Portrays natures best by the great facts here. I feel that if a greater number considered it that way, they’d have got a better moment in time have the grasp ofing the difficulty.

  5. I just want to tell you that I’m all new to weblog and actually loved your website. Most likely I’m planning to bookmark your blog . You really have tremendous articles. Cheers for revealing your blog site.

Comments are closed.