Coherent nonlinear light–matter interaction with X-rays gives access to a regime in ultrafast spectroscopy in which atomic resolution meets femtosecond and attosecond timescales1,2. Particularly, X-ray four-wave mixing, involving several resonant transitions in a single coherent nonlinear process, has the potential to provide information on the electronic states coupling, coherent electron motion, correlation and dynamics, with state and site selectivity3–5. Here we demonstrate coherent, background-free four-photon interactions with core-shell electrons using single broadband X-ray pulses from a free-electron laser. The all-X-ray four-wave mixing signals, measured in gaseous neon, arise from doubly resonant nonlinear processes involving Raman transitions6, including X-ray coherent anti-Stokes electronic Raman scattering. The 2D spectral maps (photon-in/photon-out) represent a step towards multidimensional correlation spectroscopy at the atomic scale. Using a multicolour time-delayed X-ray pulse scheme, we further demonstrate the feasibility of extending the proposed methodology to the ultrafast time domain. These results reveal potential for studying localized electron dynamics in multiple systems, from biomolecules to correlated quantum materials, with applications in areas such as energy conversion, biomedical imaging and quantum information technologies.