We derive the fundamental thermodynamic equation for Fermi-Dirac and Bose-Einstein quantum gases, which contains the first order contribution due to the quantum nature of the gas particles. Then, we analyze the fundamental equation in the context of geometrothermodynamics. Although the corresponding Hamiltonian does not contain a potential, indicating the lack of classical thermodynamic interaction, we show that the curvature of the equilibrium space is non-zero and can be interpreted as a measure of the effective quantum interaction between the gas particles. In the limiting case of a classical Boltzmann gas, we show that the equilibrium space becomes flat, as expected from the physical viewpoint. In addition, we derive a thermodynamic fundamental equation for the Bose-Einstein condensation and, using the Ehrenfest scheme, we show that it can be considered as a first order phase transition which in the equilibrium space corresponds to a curvature singularity. This result indicates that the curvature of the equilibrium space can be used to measure in an invariant way the thermodynamic interaction in classical and quantum ideal gases.