$item["CalcMethod"] = "N"; // No Charge $item["refCode"] = "test_item_3"; $item["quantity"] = 1; // Uncomment to add this item to this shipment // $items[] = $item; //************************************************ // End Example Items //************************************************ //************************************************ // Add Item Data from Item Array to API Object //************************************************ foreach ($items as $val) { $calcCodes = array('C', 'CI'); if (in_array($val["CalcMethod"], $calcCodes)) { $shipAPI->addItemCalc($val["refCode"], $val["quantity"], $val["weight"], $val['weightUOM'], $val["length"], $val["width"], $val["height"], $val["dimUOM"], $val["value"], $val["packMethod"], $val["lotSize"], $val["CalcMethod"]); if (isset($val["originCode"])) { $shipAPI->addItemOriginCode($val["originCode"]); } if (isset($val["odServices"])) { $shipAPI->addItemOnDemandServices($val["odServices"]); } if (isset($val["suppHandlingCode"])) { $shipAPI->addItemSuppHandlingCode($val["suppHandlingCode"]); } if (isset($val["suppHandlingFee"])) { $shipAPI->addItemHandlingFee($val["suppHandlingFee"]); } if (isset($val["specCarrierSvcs"])) { $shipAPI->addItemSpecialCarrierServices($val["specCarrierSvcs"]); }