Let us work over $\mathbb{C}$ for the moment.
Assume we are given a real quadratic field $K$ with ring of integers $\mathcal{O}_K$.
$\mathbf{Question:}$ Is there a smooth projective curve $C$ of genus $g=2$ such that $End(Jac(C))$ is a non-maximal order in $K$, that is $End(Jac(C))=\mathcal{O}_{K,f}=\mathbb{Z}+f\mathcal{O}_K$ for some $f>1$, especially $\neq \mathcal{O}_K$? If yes can we find such a curve for every $K$ and every $f>1$?