If you are using an External Shipping System with Infoplus (e.g., ShipStation), and you want to customize how Infoplus sends orders to that system, you can use an Infoplus Script to make this happen.


  1. Access the Script table.  Two ways:
    From the Dashboard: Click the “Apps” tab, click the “Scripts” App, then click the “Scripts” Table.
    From the Quick Actions shortcut: Press a dot (period) on your keyboard, then select “Scripts” from the list of Quick Actions.
  2. Click 'Create New' to create a new Script in Infoplus
  3. Choose the Script Type of "External Shipping System"
  4. Select API Version - "Beta"

Example script:

utils.log("Running External Shipping System Script...");
utils.log("");
utils.log("Current Shipping System Object: " + utils.shippingSystemObject.toString());
utils.log("");
utils.log("Inspecting Ship Station Orders...");

// Loop through the objects
for(var i=0; i<utils.shippingSystemObject.length(); i++)
{
    var shipStationOrder = utils.shippingSystemObject.get(i);
    utils.log("Current Shipping System Object: " + shipStationOrder.toString());
    utils.log("");

    ///////////////////////////////////////////////////////////////
    // make sure advanced objects is in shipstation order object //
    ///////////////////////////////////////////////////////////////
    if(! shipStationOrder.has("advancedOptions"))
    {
       shipStationOrder.putOnce("advancedOptions", {});
    }

    var orderNo = shipStationOrder.getString("orderNumber");
    var orderSourceId = shipStationOrder.getJSONObject("advancedOptions").get("source");
    utils.log("\n\tFound ship station order: " + orderNo + " and order source id " + orderSourceId);
   
    // Example on how to customize per order source
    if(orderSourceId == 1)
    {
        shipStationOrder.getJSONObject("advancedOptions").put("storeId", 0000);
        shipStationOrder.getJSONObject("advancedOptions").put("tagId", 1111);
    }

   // Example of matching it back to Infoplus Order Object
    for(var j=0; j<utils.orderList.size(); j++)
    {
        var order = utils.orderList.get(j);
        if(order.orderNo == orderNo)
        {        
            // Example of customizing based of Infoplus Order data
            if(order.lobId == 1)
            {
                shipStationOrder.getJSONObject("advancedOptions").put("storeId", 0000);
            }         
            // Example of adding Infoplus Order data to ShipStation Custom Field2
            shipStationOrder.getJSONObject("advancedOptions").put("customField2", order.shipToCountry);
        }  
    }
}

utils.log("");
utils.log("Final Shipping System Object: " + utils.shippingSystemObject.toString());


After your script has been made, go to the External Shipping System table. 

 

  1. Access the External Shipping System table. 
    From the Quick Actions shortcut: Press a dot (period) on your keyboard, then select “External Shipping System” from the list of Quick Actions.

  2. Edit your External Shipping System record
  3. Associate the script created above with it  


Test your script and ensure that your changes are occurring as needed.