  The validity of the $E_{\rm p}$ - $E_{\rm iso}$ correlation in gamma-ray
bursts and the possibility of explaining the prompt emission with internal
shocks are highly debated questions. We study whether the $E_{\rm p}$ - $E_{\rm
iso}$ correlation can be reproduced if internal shocks are indeed responsible
for the prompt emission, or conversely, if the correlation can be used to
constrain the internal shock scenario. We developed a toy model where internal
shocks are limited to the collision of only two shells. Synthetic burst
populations were constructed for various distributions of the model parameters,
such as the injected power in the relativistic outflow, the average Lorentz
factor, and its typical contrast between the shells. These parameters can be
independent or linked by various relations. Synthetic $E_{\rm p}$ - $E_{\rm
iso}$ diagrams are obtained in the different cases and compared with the
observed correlation. The reference observed correlation is the one defined by
the BAT6 sample, a sample of Swift bursts almost complete in redshift and
affected by well-known and reproducible instrumental selection effects. The
comparison is then performed with a subsample of synthetic bursts that satisfy
the same selection criteria as were imposed on the BAT6 sample. A satisfactory
agreement between model and data can often be achieved, but only if several
strong constraints are satisfied on both the dynamics of the flow and the
microphysics that governs the redistribution of the shock-dissipated energy.
