Aggregation functions (like SUM) with Strapi

Could you use the API to gather all payment information and calculate a sum that way?