Not a coder, but from getting the Invalid Ref Key ...
# inventory
r
Not a coder, but from getting the Invalid Ref Key error about a hundred times from CSV imports, I'm guessing that means the department is not enabled for your subsidiary with Internal ID 2.