A capsule is a liquid droplet enclosed by a thin and deformable membrane. The membrane mechanical properties are critical for the deformation and motion of capsules. The flow of a capsule suspension through a microfluidic channel with dimensions comparable to those of the suspended particles can be used to infer the membrane elastic properties. However a mechanical model of the process is necessary. We present a three-dimensional numerical model to simulate such fluid-structure interaction problem. We use a novel numerical model that couples a boundary integral method for the internal and external fluid flows and a finite element method for the membrane deformation. The model is applied to study the flow of an initially spherical capsule in channels with different cross-sections. In a cylindrical channel with circular cross-section, we show that the confinement effect leads to the compression of the capsule in the hoop direction. The membrane tends to buckle and to fold as observed experimentally. In a microfluidic channel with a square cross-section, the effects of the membrane constitutive law, size ratio and flow strength on the capsule deformation are systematically studied. The comparison between experimental and numerical results allows us to deduce the membrane mechanical properties of a population of artificial capsules. The present work shows that it is possible to measure the membrane mechanical properties by using a microfluidic channel with a square cross-section. It can be extended to unsteady capsule flows in a channel with variable cross-sections or bifurcations.