The type of a microorganism or bacterium as determined by the kinds of antigens present in the cell. Serotyping is performed by reactions with specific antiserum and is frequently used for the identification of species within a bacterial genus.