As a user, you're able to set up Infoplus to rate shop either for one carrier or multiple. This can be done by finding the cheapest or fastest service for the same company (e.g., UPS, FedEx).  Follow the steps below to set up and execute rate shopping from the Carrier table as noted below.  


NOTE:  Order must be pre-cartonized before rate shopping. See the Pre Cartonization Trigger Action section below to set it up. 


Create a Rate Shop Carrier Service


There are two methods to access the “Carrier” table:

- From the Dashboard: Click the “Apps” tab, click the “Manifest Setup” App, then click the “Carrier” Table.

- From the Quick Actions shortcut: Press a dot (period) on your keyboard, then select "Carrier” from the list of Quick Actions.


  • Click the Create New button. The Creating New Carrier screen appears
  • In the Carrier Company field, select Rate Shop from the drop-down arrow
  • Enter the Name of your choice (examples below)
  • Cheapest - UPS
  • Fastest - FedEx
  • Cheapest - USPS
  • Fastest - DHL



  • Under the Rate Shop display section, select your Rule (dropdown arrow):
    • Cheapest will select the service that can ship the parcels at the lowest cost out of the options set. 
    • Fastest will select the service that will deliver the parcels the quickest. 
    • Script allows you to add a script that has been created to customize how rate shopping chooses a carrier service. 
  • For the Parcel Accounts click Add to list the accounts you would like to rate shop on this service.
  • For the Carriers, click Add to put the specific carrier services that need to be taken into account for the service. 
  • Click Save.




Manually Rate Shop Orders

This process is used to rerate specific orders or when NOT using the below Trigger Actions.


There are two methods to access the “Rate Shop Orders Process”:

- From the Dashboard: Click the “Apps” tab, click the “Fulfillment” App, then click the “Order” Table.

- From the Quick Actions shortcut: Press a dot (period) on your keyboard, then select the "Rate Shop Orders Process” from the list of Quick Actions.

  • Select orders then under the "Actions" menu (top right), select Rate Shop Orders
  • Select orders then bottom right, click "Next" to rate shop the selected orders

Rate Shop Trigger Action

A Rate Shop Trigger Action can be used to have orders automatically rate shopped upon insert or update. If a rate shop action is assigned to a trigger, then any orders matching the trigger's filter will automatically be rate shopped. For insert actions, this relies on the order being set to one of the Rate Shop Carriers that have been created.


If an order is not set to a Rate Shop Carrier Service, or if any other error occurs during the automatic rate shop process, an alert will be created with details of the failure.  


         


To learn more about how to set up triggers, click here



Pre Cartonization Trigger Action

A Pre Cartonization Trigger Action can be used to have orders automatically run pre cartonization on insert or update. If a pre cartonization action is assigned to a trigger, then any orders matching the trigger's filter will automatically run through pre cartonization.


To run pre cartonization, all Line Items have to have a footprint (length, width, height, and weight) and boxes that need to be taken into account need to be created on the Carton Type table.

If any other error occurs during the pre cartonization process, an alert will be created with details of the failure.


       



Note: The rate shopping feature is currently not compatible with Predefined Packages and they will not be considered when rate shopping occurs.


Pre Cartonization Trigger Action Scripts

Scripts can be used for cartonization at three different points:

  • customizeAvailableCartons - Customize the cartons allowed for the given order during cartonization.
  • customizeCartonizationCall - Customize if Infoplus should run cartonization on the given order.
  • customizeCartonizationOutput - Customize the output of cartonization on the given order.


Example Script

// To customize Infoplus Cartonization, you can define the following functions, for customizing different pieces of the integration:
// customizeAvailableCartons - Customize the cartons allowed for the given order during cartonization.
// customizeCartonizationCall - Customize if Infoplus should run cartonization on the given order.
// customizeCartonizationOutput - Customize the output of cartonization on the given order.
//
// In each of these functions, the following global variables will be available:
//
// order - an instance of an Infoplus API Order model, for the order cartonization is being ran against.
//
// originalCartonList - object containing the list of Infoplus Carton API models availble by default.
//
// utils - object with the following methods:
//    .log(message) - add a line to the Script Output's log.
//    .getOriginalCartonList() - returns the original Carton list being passed into Cartonization.
//    .setOutputCartonList(cartonList) - sets the list of Cartons that will actually be used by Cartonization.
//    .setShouldRunCartonization(true/flase) - sets if Infoplus should run its internal Cartonization.
//
// infoplusApi - object which provides access to the Infoplus API, specifically, with the following methods:
//    .search(type, filter, pageNo, limit, orderBy) - run a search query in the Infoplus API.
//    .getById(type, id) - get the record of the specified type identified by the id.
//    .getTags(type, id) - get the tags from Infoplus for the specified record.
//    .constructModel(type) - used to construct an API model object of the given type.
//        - See the https://developer.infopluscommerce.com/ for more details.
//
// Example:
 
 
////////////////////////////////////////////////////////////////////////////
// customizeAvailableCartons
//
////////////////////////////////////////////////////////////////////////////
function customizeAvailableCartons()
{
   utils.log("Starting customizeAvailableCartons");
   utils.log("Running for Order: " + order.orderNo);
 
   ////////////////////////////////
   // set the output carton list //
   ////////////////////////////////
   var originalCartonList = utils.originalCartonList;
   utils.setOutputCartonList(originalCartonList);
}
 
 
////////////////////////////////////////////////////////////////////////////
// customizeCartonizationCall
//
////////////////////////////////////////////////////////////////////////////
function customizeCartonizationCall()
{
   utils.log("Starting customizeCartonizationCall");
   utils.log("Running for Order: " + order.orderNo);
   utils.setShouldRunCartonization(true);
}
 
 
////////////////////////////////////////////////////////////////////////////
// customizeCartonizationOutput
//
////////////////////////////////////////////////////////////////////////////
function customizeCartonizationOutput()
{
   utils.log("Starting customizeCartonizationOutput");
   utils.log("Running for Order1: " + order.orderNo);
 
   var cartonizationOutput = utils.cartonizationOutput;
   cartonizationOutput.clearCartons();
 
   var allContents = cartonizationOutput.getAllContents();
   utils.log("allContents: " + allContents);
    
   var carton1 = utils.createNewContainer(318);
 
   for(var i=0; i<allContents.size(); i++)
   {
      var cartonizationItem = cartonizationOutput.getAllContents().get(i);
 
      utils.log("cartonizationItem1: " + cartonizationItem);
      carton1.addContent(cartonizationItem);
   }
}


Rate Shopping Fastest and Cheapest Example Script


This script can be used to rate shop a variety of days by changing the parameter 

if (days <= "3")

underneath the Start Parameter Check portion of the script code. Each day parameter will be its own script. For example, the 3-Day script will be a different script then 1-Day and each script will have it's own Rate Shop Carrier like the examples below.


There are a variety of Data Points that can be used within the Rate Shop call:

  • deliveryDays - delivery days returned by the service
  • deliveryDate - date for delivery returned by the service
  • deliveryDateGuaranteed - indicates if delivery window is guaranteed (true) or not (false)
  • chargedRate - how much the package was/would-be actually charged at


Example Script

// To customize Infoplus Rate Shopping you can define the following functions for customizing different pieces of the integration:
// customizePreRateShopCall - Customize the Parcel Accounts and Carriers that will be used during rate shop.
// customizePostRateShopCall - Customize the rate that will be selected from the rate shop.
// 
// In the customizePostRateShopCall function, the following variables will be available:
// 
// manifestRateList - The available rates returned from Rate Shop that can be used for the Order.
// selectedRate - The selected rate that will be returned from Rate Shop and used for the Order.
// 
// In each of the functions, the following global variables will be available:
// 
// orderNo - The Order No of Order we are making the manifest call for it can be used to get the Infoplus API Order model if needed.
// lobId - The Line of Business Id of Order we are making the manifest call for.
// 
// utils - object with the following methods:
//    .getOriginalParcelAccountList - returns the original Parcel Account list being passed into Rate Shop.
//    .getOriginalCarrierList - returns the original Carrier list being passed into Rate Shop.
//    .getOutputParcelAccountList - sets the Parcel Account list that will be used to Rate Shop.
//    .getOutputCarrierList - sets the Carrier list that will be used to Rate Shop.
//    .abort(reason) - stop the import or export process, for the specified reason.
// 
// infoplusApi - object which provides access to the Infoplus API, specifically, with the following methods:
//    .search(type, filter, pageNo, limit, orderBy) - run a search query in the Infoplus API.
//    .getById(type, id) - get the record of the specified type identified by the id.
//    .getTags(type, id) - get the tags from Infoplus for the specified record.
//    .constructModel(type) - used to construct an API model object of the given type.
//        - See the https://developer.infopluscommerce.com/ for more details.
// 
// Example:

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// customizePreRateShopCall
//
// this script will:
//     add an additional Parcel Account to be consider for Rate Shopping
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function customizePreRateShopCall()
{
  utils.log("Starting customizePreRateShopCall for Order: " + orderNo);

   //////////////////////////////////////////////////////////
   // Use the Infoplus API to look up a new Parcel Account // 
   // that we want to use for this order and then add it   //
   //////////////////////////////////////////////////////////
   
   var outputParcelAccountList = utils.originalParcelAccountList;
   utils.setOutputParcelAccountList(outputParcelAccountList);

   var outputCarrierList = utils.originalCarrierList;
   utils.setOutputCarrierList(outputCarrierList);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// customizePostRateShopCall
//
// this script will:
//    This script first checks for the day parameter and then cycles through the cheapest within that day parameter. It is designed to  choose the fastest + cheapest rate. 
//   
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function customizePostRateShopCall()
{
   utils.log("Starting customizePostRateShopCall for Order: " + orderNo);
   
   utils.log("Currently selected rate: " + selectedRate.service);
   var cheapestCost = null;
   for(i = 0; i < manifestRateList.size(); i++)
   {
      var carrier = manifestRateList.get(i).service;
      var days = manifestRateList.get(i).deliveryDays;
      utils.log("Service: " + carrier + " | Days: " + days + " | Cost: " + manifestRateList.get(i).chargedRate);
      
      // Start day parameter check
      if (days <= "3")
      {
         if (cheapestCost == null) 
         {
            cheapestCost = manifestRateList.get(i);  
         }
         else if(cheapestCost > manifestRateList.get(i).selectedRate) 
         {
            cheapestCost = manifestRateList.get(i);   
         }
      }
   }

   selectedRate =  cheapestCost;
   utils.log("Rate selected: " + cheapestCost.service);
}