Measurement of J/ψ, ψ′, χc1 and χc2 production using a data sample corresponding to an integrated luminosity of 20.3 fb−1 collected with the BABAR detector at the SLAC PEP-II electron-positron storage ring operating at a centre-of-mass energy near 10.58 GeV.