We present the analytic expressions for the two-loop form factors for the production or decay of pseudo-scalar quarkonia, in a scheme where the quarks are produced at threshold. We consider the two-loop amplitude for the process $$ \gamma \gamma \leftrightarrow {}^1{S}_0^{\left[1\right]} $$
γγ
↔
S
0
1
1
, that was previously known only numerically, as well as for the processes $$ gg\leftrightarrow {}^1{S}_0^{\left[1\right]} $$
gg
↔
S
0
1
1
, $$ \gamma g\leftrightarrow {}^1{S}_0^{\left[8\right]} $$
γg
↔
S
0
8
1
and $$ gg\leftrightarrow {}^1{S}_0^{\left[8\right]} $$
gg
↔
S
0
8
1
, which have not been computed before. The two-loop corrections to $$ gg\leftrightarrow {}^1{S}_0^{\left[1\right]} $$
gg
↔
S
0
1
1
are the last missing ingredients for a full NNLO calculation of ηQ hadro-production. We discuss how the singularity structure of the amplitudes is affected by the threshold kinematics, which in particular introduces Coulomb singularities. In this context, we first show how the usual structure of the infrared singularities degenerates at threshold kinematics, and then extract the anomalous dimensions governing the Coulomb singularities for colour-singlet and octet channels, the latter being presented here for the first time. We give high-precision numerical results for the hard functions, which can be used for phenomenological studies of ηQ production and decay at NNLO.