Funding Information: The authors acknowledge SOLEIL for the provision of synchrotron radiation (proposal numbers: 20161265, 20171063, 20180483, 20181721, and 20191506) facilities at the GALAXIES beamline. Some measurements were carried out at the CoESCA endstation at the BESSY-II electron storage ring operated by the Helmholtz-Zentrum Berlin für Materialien und Energie. The research leading to this result has been supported by the project CALIPSOplus under the Grant Agreement 730872 from the EU Framework Programme for Research and Innovation HORIZON 2020. The authors acknowledge research funding from the Swedish Research Council (Grant Nos. VR 2016-04590, VR 2018-04125, VR 2018-04330, VR 2018-06465), Swedish Energy Agency (P50626-1, P43549-1), the Göran Gustafsson foundation, the Swedish Foundation for Strategic Research (project nr. RMA15-0130), and the Carl Tryggers foundation (Grant No. CTS 18:59). | openaire: EC/H2020/730872/EU//CALIPSOplus A heterojunction is the key junction for charge extraction in many thin film solar cell technologies. However, the structure and band alignment of the heterojunction in the operating device are often difficult to predict from calculations and, due to the complexity and narrow thickness of the interface, are difficult to measure directly. In this study, we demonstrate a technique for direct measurement of the band alignment and interfacial electric field variations of a fully functional lead halide perovskite solar cell structure under operating conditions using hard X-ray photoelectron spectroscopy (HAXPES). We describe the design considerations required in both the solar cell devices and the measurement setup and show results for the perovskite, hole transport, and gold layers at the back contact of the solar cell. For the investigated design, the HAXPES measurements suggest that 70% of the photovoltage was generated at this back contact, distributed rather equally between the hole transport material/gold interface and the perovskite/hole transport material interface. In addition, we were also able to reconstruct the band alignment at the back contact at equilibrium in the dark and at open circuit under illumination.