A numerical model is presented which calculates the Xray emission from radiative shocks in supernovae. Type IIL and Type IIn supemovae generally have a sufficiently dense circumstellar medium for the interaction between the supernova ejecta and circumstellar medium to be strong, leading to substantial X-ray emission already a few days after the explosion. Assuming the flow is stationary, our model combines hydrodynamic calculations with time dependent ionization balance and multi-level calculations. We find large differences between the self-consistent, hydrodynamic model and simple one- or two-temperature fits. The dependence of the resulting spectrum on shock velocity and chemical composition are discussed, as well as the difference between spectra produced by this model and single-temperature spectra. The applicability of our model for various types of supernovae is discussed, and examples of applications to observations are given.