'Mandarin' is not a chinese word.
It's called 'Mandarin' because the early western explorers and traders (late Ming- and early Qing-Dynasty) understood that it was the language of the officials. Their first contacts were at the Southern China coast (Guangdong, Fujian), where the officials (appointed by the central government) used the dialect of the northern capital (Beijing). Quite different from the local languages.
The Portugese ('mandarim') and Spaniards (mandarin) came by India ('mantrin') and Malaysia ('menteri'), where this word meant 'minister' or 'counsel'/'advisor'.