Stochastic representation formulas establish natural connections between the study of stochastic processes and partial differential equations or integro-partial differential equations (integro-PDEs). In this talk, we consider a stochastic optimal control problem for a general class of time and state-dependent controlled stochastic differential equations, driven by a Lévy process. Our main focus is a stochastic representation formula for the unique viscosity solution to the Dirichlet terminal-boundary value problem for the associated degenerate HJB integro-PDE in a bounded domain. This is a classical problem which is very technical and whose full details are often omitted or overlooked, especially for problems in bounded domains. Under mild conditions on the regularity of the domain and the non-degeneracy of the controlled diﬀusions along the boundary, we identify the unique viscosity solution to the terminal-boundary value problem of the HJB integro-PDE as the value function of the associated stochastic optimal control problem. We also obtain the dynamic programming principle for the associated stochastic optimal control problem in the bounded domain.