Context : Classical hot cores are rich in molecular emission , and they show a high abundance of complex organic molecules ( COMs ) . The emergence of molecular complexity is poorly constrained in the early evolution of hot cores . Aims : We put observational constraints on the physical location of COMs in a resolved high-mass protostellar envelope associated with the G328.2551 - 0.5321 clump . The protostar is single down to \sim 400 au scales and we resolved the envelope structure down to this scale . Methods : High angular resolution observations using the Atacama Large Millimeter Array allowed us to resolve the structure of the inner envelope and pin down the emission region of COMs . We use local thermodynamic equilibrium modelling of the available 7.5 GHz bandwidth around \sim 345 GHz to identify the COMs towards two accretion shocks and a selected position representing the bulk emission of the inner envelope . We quantitatively discuss the derived molecular column densities and abundances towards these positions , and use our line identification to qualitatively compare this to the emission of COMs seen towards the central position , corresponding to the protostar and its accretion disk . Results : We detect emission from 10 COMs , and identify a line of deuterated water ( HDO ) . In addition to methanol ( CH _ { 3 } OH ) , methyl formate ( CH _ { 3 } OCHO ) and formamide ( HC ( O ) NH _ { 2 } ) have the most extended emission . Together with HDO , these molecules are found to be associated with both the accretion shocks and the inner envelope , which has a moderate temperature of T _ { kin } \sim 110 K. We find a significant difference in the distribution of COMs . O-bearing COMs , such as ethanol , acetone , and ethylene glycol are almost exclusively found and show a higher abundance towards the accretion shocks with T _ { kin } \sim 180 K. Whereas N-bearing COMs with a CN group , such as vinyl and ethyl cyanide peak on the central position , thus the protostar and the accretion disk . The molecular composition is similar towards the two shock positions , while it is significantly different towards the inner envelope , suggesting an increase in abundance of O-bearing COMs towards the accretion shocks . Conclusions : We present the first observational evidence for a large column density of COMs seen towards accretion shocks at the centrifugal barrier at the inner envelope . The overall molecular emission shows increased molecular abundances of COMs towards the accretion shocks compared to the inner envelope . The bulk of the gas from the inner envelope is still at a moderate temperature of T _ { kin } \sim 110 K , and we find that the radiatively heated inner region is very compact ( < 1000 au ) . Since the molecular composition is dominated by that of the accretion shocks and the radiatively heated hot inner region is very compact , we propose this source to be a precursor to a classical , radiatively heated hot core . By imaging the physical location of HDO , we find that it is consistent with an origin within the moderately heated inner envelope , suggesting that it originates from sublimation of ice from the grain surface and its destruction in the vicinity of the heating source has not been efficient yet .