  In this work, we provide a simultaneous and accurate description of the
$\pi^+\pi^-$ and $\pi^{\pm} J/\psi$ invariant mass distributions of the recent
BESIII data on $e^+ e^- \to J/\psi \; \pi^+ \pi^-$ together with the $e^+ e^-
\to J/\psi \; K^+K^-$ cross sections at $e^+e^-$ center-of-mass energies
$q=4.23$ GeV and $q=4.26$ GeV. The rescattering effects between pions in the S
and D-waves are taken into account through the Muskhelishvili-Omn\`es
formalism. Since the physical region of the $\pi\pi$ invariant mass extends
above 1 GeV, the important $K\bar{K}$ intermediate state in the S-wave is
implemented through coupled-channel unitarity. For the left-hand cuts, we
account for the well established charged exotic state $Z_c(3900)$ in $t$- and
$u$-channels, while the other contributions are absorbed in the subtraction
constants. For the $e^+ e^- \to J/\psi\, K \bar{K}$ we provide the prediction
of the two-kaon invariant mass distribution. The constructed amplitudes serve
as an essential framework to interpret the present and forthcoming measurements
by the BESIII and Belle II Collaborations.
