We introduce the notion of sum-matroids and show its association with sum-rank metric codes. As a consequence, some results for sum-rank metric codes by Martínez-Peñas are generalized for sum-matroids. The sum-matroids generalize the notions of matroids and q-matroids. We define the generalized weights for sum-matroids and prove a Wei-type duality theorem which generalizes the analogous cases for matroids and q-matroids.