The directed movement of substances into, out of or mediated by an endosome, a membrane-bounded organelle that carries materials newly ingested by endocytosis. It passes many of the materials to lysosomes for degradation.