Aberrations introduced during fabrication degrade the performance of X-ray optics and their ability to achieve diffraction limited focusing. Corrective optics can counteract these errors by introducing wavefront perturbations prior to the optic which cancel out the distortions. Here we demonstrate two-dimensional wavefront correction of an aberrated Kirkpatrick-Baez mirror pair using adaptable refractive structures. The resulting two-dimensional wavefront is measured using hard X-ray ptychography to recover the complex probe wavefield with high spatial resolution and model the optical performance under coherent conditions. The optical performance including the beam caustic, focal profile and wavefront error is examined before and after correction with both mirrors found to be diffraction limited after correcting. The results will be applicable to a wide variety of high numerical aperture X-ray optics aiming to achieve diffraction limited focussing using low emittance sources.