OSM Worldwide is a robust carrier option with a unique requirement. Learn how to satisfy that requirement to get the most out of this carrier!
OSM is a robust carrier option that ships to domestic US and US territories, Monday through Saturday. This carrier needs a specific piece of information for every shipment: the "name" for the shipping address.
Sometimes, this "name" field might be left blank in the order details sent over. When that happens, OSM can't process the shipment correctly because it's expecting that name.
To address this, you'll want to make sure you use a Manifest Script. If you're not familiar with this tool, you can think of a manifest script as a small piece of code that runs behind the scenes right before a shipping label is created. Learn more about the ins and outs of Manifest Scripts here - or if you simply want to know what manifest script to use for OSM, keep reading!
Example Script
This script satisfies the OSM requirement.
First, it checks the "name" field, looking at the shipping address for the Order.
If the "name" field is blank, the script automatically copies whatever value is present in the "company" field of the shipping address and pastes it into the "name" field.
////////////////////////////////////////////////////////////////////////////
///
// customizeEasyPostPreRatesCall to ensure the needed from_address is passed
//
///
////////////////////////////////////////////////////////////////////////////
function customizeEasypostPreRatesCall()
{
utils.log("Starting customizeEasypostPreRatesCall");
utils.log("Running for Order: " + orderNo);
utils.log("Shipment to_address before customization: " +
shipmentMapForRate.get('to_address'));
/////////////////////////////////////////////
// if to_address is blank, add filler in //
////////////////////////////////////////////
if (shipmentMapForRate.get('to_address').get('name').isEmpty()) {
utils.log("Name field is empty, adding placeholder");
shipmentMapForRate.get('to_address').put('name',
shipmentMapForRate.get('to_address').get('company'));
}
utils.log("Shipment to_address after customization: " +
shipmentMapForRate.get('to_address'));
}