According to Hammer’s inequality (Hammer in Math Mag 31:193–195, 1958), which is a refined version of the famous Hermite–Hadamard inequality, the midpoint rule is always more accurate than the trapezoidal rule for any convex function defined on some real numbers interval [a, b]. In this paper we consider some properties of a multivariate extension of this result to an arbitrary convex polytope. The proof is based on the use of Green formula. In doing so, we will prove an inequality recently conjectured in (Guessab and Semisalov in BIT Numerical Mathematics, 2018) about a natural multivariate version of the classical trapezoidal rule. Our proof is based on a generalization of Hammer’s inequality in a multivariate setting. It also provides a way to construct new “extended” cubature formulas, which give a reasonably good approximation to integrals in which they have been tested. We particularly pay attention to the explicit expressions of the best possible constants appearing in the error estimates for these cubatute formulas.