  According to our present understanding many $J/\psi$ production processes
proceed through a coloured $c\bar{c}$ state followed by the emission of soft
particles in the quarkonium rest frame. The kinematic effect of soft particle
emission is usually a higher-order effect in the non-relativistic expansion,
but becomes important near the kinematic endpoint of quarkonium energy
(momentum) distributions. In an intermediate region a systematic resummation of
the non-relativistic expansion leads to the introduction of so-called `shape
functions'. In this paper we provide an implementation of the kinematic effect
of soft gluon emission which is consistent with the non-relativistic shape
function formalism in the region where it is applicable and which models the
extreme endpoint region. We then apply the model to photoproduction of $J/\psi$
and $J/\psi$ production in $B$ meson decay. A satisfactory description of $B$
decay data is obtained. For inelastic charmonium photoproduction we conclude
that a sensible comparison of theory with data requires a transverse momentum
cut larger than the currently used 1 GeV.
