Please note that for this to work, you need to create template beforehand. This mutatnion can only assignt product to allready existed template, and will NOT create new one.
While templateCode is required, categoryCodes is not. But if used, also needed to be created beforehand.