The elliptic (v2), triangular (v3), and quadrangular (v4) flow coefficients of π±, K±, p+p¯,Λ+Λ¯,KS0, and the ϕ-meson are measured in Pb-Pb collisions at sNN=5.02 TeV. Results obtained with the scalar product method are reported for the rapidity range |y| < 0.5 as a function of transverse momentum, pT, at different collision centrality intervals between 0–70%, including ultra-central (0–1%) collisions for π±, K±, and p + p ¯. For pT< 3 GeV/c, the flow coefficients exhibit a particle mass dependence. At intermediate transverse momenta (3 < pT < 8–10 GeV/c), particles show an approximate grouping according to their type (i.e., mesons and baryons). The ϕ-meson v2, which tests both particle mass dependence and type scaling, follows p + p ¯ v2 at low pT and π±v2 at intermediate pT. The evolution of the shape of vn(pT) as a function of centrality and harmonic number n is studied for the various particle species. Flow coefficients of π±, K±, and p + p ¯ for pT < 3 GeV/c are compared to iEBE-VISHNU and MUSIC hydrodynamical calculations coupled to a hadronic cascade model (UrQMD). The iEBE-VISHNU calculations describe the results fairly well for pT < 2.5 GeV/c, while MUSIC calculations reproduce the measurements for pT < 1 GeV/c. A comparison to vn coefficients measured in Pb-Pb collisions at sNN=2.76 TeV is also provided.[Figure not available: see fulltext.].