The beamline optics and endstations at branch B of the Versatile Soft X-ray (VerSoX) beamline B07 at Diamond Light Source are described. B07-B provides medium-flux X-rays in the range 45-2200 eV from a bending magnet source, giving access to local electronic structure for atoms of all elements from Li to Y. It has an endstation for high-throughput X-ray photoelectron spectroscopy (XPS) and near-edge X-ray absorption fine-structure (NEXAFS) measurements under ultrahigh-vacuum (UHV) conditions. B07-B has a second endstation dedicated to NEXAFS at pressures from UHV to ambient pressure (1 atm). The combination of these endstations permits studies of a wide range ofinterfaces and materials. The beamline and endstation designs are discussed in detail, as well as their performance and the commissioning process.