1. Knowledge Base
  2. Getting Started
  3. Step 13: Packing and Shipping

Rate Shopping

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:  Orders 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. Do not include, i.e., UPS 1st day air carriers, with "cheapest rate", '1st Day Air' will never be the cheapest service as 'Ground' will be the cheapest. 
      • 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.
      • NOTE:  Accounts listed are accounts you have already set up on Parcel Accounts table and Carriers table
      • Do not include unsupported non-parcel carriers or duplicates.
    • 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 this parameter:

    if (days <= "3")

    Make this change 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 than 1-Day and each script will have its 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: