Multidimensional Integration (Multiple Integrals) in Stan

Behind the scenes Stan is a Monte Carlo engine. Integrals in the definition of your target density can be implemented by writing out a joint density that marginalizes to that target, see for example the discussion in Estimating compound distributions without numerical integration - #2 by betanalpha. This will almost always be the more effective way to implement models with intractable normalization constants within Stan.