The discrete optimal control problem with discrete Lagrangian function $${\mathcal L(t_k,x^\alpha_k,u^i_k)(t_{k+1}-t_k)}$$ and constraints $$\begin{array}{ll}\varphi^\alpha\equiv\frac{x^\alpha_{k+1}-x^\alpha_k}{t_{k+1}-t_k}-f^\alpha(t_k,x^\beta_k,u^i_k)=0,\qquad 1\le \alpha,\beta\le n,\quad 1\le i\le m\end{array}$$ where $${x^\alpha_k}$$ are the dynamical variables, $${u^i_k}$$ are the control variables and t k is the time is studied. This problem is the discretization by the initial point of the differentiable optimal control problem with Lagrangian density $${\mathcal L(t,x^\alpha,u^i) dt}$$ and constraints $${\varphi^\alpha\equiv \dot x^\alpha-f^\alpha(t,x^\beta,u^i)=0}$$ . The most remarkable fact of this discrete problem is that a part of the Euler–Lagrange equations of the unconstrained extended discrete Lagrangian $${\hat{\mathcal L}(t_{k+1}-t_k)=(\mathcal L+\sum_{\alpha=1}^n \lambda^\alpha_{I_{k+1}}\varphi^\alpha)(t_{k+1}-t_k)}$$ , I k+1 = (k, k + 1), $${\lambda^\alpha_{I_{k+1}}}$$ : Lagrange multipliers, degenerates into a constraint condition on the variables $${(t_k,x^\alpha_k,u^i_k,\lambda^\alpha_{I_{k+1}})}$$ and that the associated Cartan 1-form $${\Theta^+_{\hat{\mathcal L}(t_{k+1}-t_k)}}$$ projects into a certain discrete bundle, in which this constraint condition in addition to the initial constraints of the problem define, under certain regularity hypothesis, a submanifold M. In this situation, a notion of variational integrator on M is introduced, that is characterized by a Cartan equation that assures its symplecticity. In the case of $${\left.d \Theta^+_{\hat{\mathcal L}(t_{k+1}-t_k)}\right|_M}$$ being non singular (regular problems), we prove that these integrators can be locally constructed from a generating function which is expressed in terms of a discrete Pontryagin Hamiltonian. Finally, the theory is illustrated with two elementary examples for which we will construct variational integrators from generating functions.