In this paper we determine the number of endomorphism rings of superspecial abelian surfaces over a field $mathbb{F}_q$ of odd degree over $mathbb{F}_p$ in the isogeny class corresponding to the Weil $q$-number $pmsqrt{q}$. This extends earlier works of T.-C. Yang and the present authors on the isomorphism classes of these abelian surfaces, and also generalizes the classical formula of Deuring for the number of endomorphism rings of supersingular elliptic curves. Our method is to explore the relationship between the type and class numbers of the quaternion orders concerned. We study the Picard group action of the center of an arbitrary $mathbb{Z}$-order in a totally definite quaternion algebra on the ideal class set of said order, and derive an orbit number formula for this action. This allows us to prove an integrality assertion of Vigneras [Enseign. Math. (2), 1975] as follows. Let $F$ be a totally real field of even degree over $mathbb{Q}$, and $D$ be the (unique up to isomorphism) totally definite quaternion $F$-algebra unramified at all finite places of $F$. Then the quotient $h(D)/h(F)$ of the class numbers is an integer.