We present a general formalism based on scattering theory to calculate quantum correlation functions involving several time-dependent current operators. A key ingredient is the causality of the scattering matrix, which allows one to deal with arbitrary correlation functions. The formalism proves useful, e.g., in view of recent developments in full counting statistics of charge transfer, where detecting schemes have been proposed for measurement of frequency dependent spectra of higher moments. Some of these schemes are different from the well-known fictitious spin detector and therefore generally involve calculation of non-Keldysh-contourordered correlation functions. As an illustration of the approach we consider various third order correlation functions of current, including the usual third cumulant of current statistics. We investigate the frequency dependence of these correlation functions explicitly in the case of energy-independent scattering. The results can easily be generalized to the calculation of arbitrary nth order correlation functions, or to include the effect of interactions.