In this paper we develop a geometric version of the Hamilton-Jacobi equation in the Poisson setting. Specifically, we "geometrize" what is usually called a complete solution of the Hamilton-Jacobi equation. We use some well-known results about symplectic groupoids, in particular cotangent groupoids, as a keystone for the construction of our framework. Our methodology follows the ambitious program proposed by A. Weinstein, [62], in order to develop geometric formulations of the dynamical behavior of Lagrangian and Hamiltonian systems on Lie algebroids and Lie groupoids. This procedure allows us to take symmetries into account, and, as a by-product, we recover results from [14,29,31], but even in these situations our approach is new. A theory of generating functions for the Poisson structures considered here is also developed following the same pattern, solving a longstanding problem of the area: how to obtain a generating function for the identity tranformation and the nearby Poisson automorphisms of Poisson manifolds. A direct application of our results give the construction of a family of Poisson integrators, that is, integrators that conserve the underlying Poisson geometry. These integrators are implemented in the paper in benchmark problems. Some conclusions, current and future directions of research are shown at the end of the paper.