A characterisation technique based on the stress determination by X-ray diffraction has been developed. It enables the identification of elastoplastic stress-strain laws on materials presenting an in-depth gradient of mechanical properties on its cross section. This technique is especially suitable to the characterisation of surfaces due to the small X-rays penetration depth. The method was applied in the characterisation of a carbonitrided and shot-peened steel, allowing to evaluate the stress-strain laws of the material at the surface, the intermediate layers and the bulk material. In addition, the in-depth evolution of microhardness, residual stresses, diffraction peak broadening and retained austenite contents were analysed. This allowed to understand the results of the proposed technique.