Customizing Manifest Calls Using Scripts

Customizing Manifest Calls Using Scripts

The standard process that Infoplus uses to create parcel labels with our Manifesting partners relies on data from your Orders, Cartons, Products, Parcel Accounts, and more, combined with a core set of business rules that Infoplus understands.  


Due to the ever-changing nature of writing and maintaining scripts, Infoplus does not provide support in this area. We recommend someone in your IT Department handles scripting requests internally so that you keep all control over the process.


However, there are times when you may need to customize the data or business rules that you use to create shipments and parcel labels. For example, some orders may need dry ice added to them based on the products or order's ship-to address. Or you might have a business rule that says based on the carrier you want to increase or decrease the total weight of a Carton in certain circumstances.  Infoplus allows you to customize Manifest calls in cases like these, using Manifest Scripts.  Here's how they work.


Create a Manifest Script

To create a Manifest Script, simply navigate to the Script table in Infoplus.  Create a new Script, and choose the Script Type of Manifest.  


For the code in a Manifest script, there is a single function that you must define which allows you to customize the data passed to EasyPost when creating shipments and getting rates:

  • customizeEasypostPreRatesCall - This function allows you to customize the data being sent in the Create Shipment call to Easypost.  This script will have access to a global variable called shipmentMapForRate, which is a java Map object (i.e., it has get and putmethods).  You can modify the data in this map, according to Easypost's shipment api documentation, to change the rates & labels that Infoplus will receive.

When you create a new Manifest Script, Infoplus will pre-populate the Code field with a comment that describes in more detail the variables and functions available in a Manifest Script.  


Assigning a Manifest Script to an Order

To use a Manifest Script, it must be applied at the Order level. You can select it when Creating or Editing an Order in Infoplus, with the Manifest Script field on the order table:


You can also automatically set a Manifest Script on an Order using a Trigger and your User Filter. Add the action of Change Manifest Script and the Manifest Script you would like set on the orders. Read more about Triggers here



Testing Manifest Scripts

To test a Manifest Script you must create Parcel Labels for a valid Infoplus Order. This can be done in either your test or live site as long as you have Parcel Accounts setup. 


We recommend running a Fulfillment Process against a test order, with the Create Labels field set to True.  You can edit your script, and use the Run Pick Pack Ship action on your Fulfillment Process to quickly void existing labels for your test orders, and re-create the labels again as needed, providing a quick turn-around cycle for testing changes to the script.

Error Handling

If your Manifest Script produces an error, Infoplus will not be able to complete the process of creating parcel labels.  This error will be presented in Infoplus at whatever point a user is trying to create parcel labels (such as when running Fulfillment / Pick Pack and Ship, or at the Ship Station, or from the Create Parcel Labels process).  

Example Manifest Scripts

Adding Dry Ice

In this example, this script is applied to Orders that require dry ice to be added to the label.

Setting Third-Party Account For International Duties and Tax Charges

By default, an international order with a third-party parcel account assigned to it will have the charges for duties and taxes assigned to the original parcel account, rather than the third party.  This can be changed using a Manifest Script by specifying what account should be responsible for these charges.  This is currently only possible with FedEx and UPS accounts and how this is specified in the data sent to these carriers differs between the two.  Please see the example below which shows how these changes can be implemented.