Hi Pinky,
Calculating MRR is actually a bit more complex than that. Remi's answer is really a Net Revenue calculation, not MRR - If you had just a single customer who paid $120 up front for a yearly subscription, your Net Revenue for that month would be $120 as seen in Charges API / Balance history API, but the correct MRR value is $10 (yearly $120 divided by 12 months).
There are services who can automatically calculate MRR for you [1], but if you want to do it yourself, here are the steps:
- Fetch all currently active subscriptions
- Normalise each subscription value to a month, so yearly are divided by 12, monthly stay as-is, weekly are multiplied by 4.3333
- Make sure to apply any discounts
- Sum up all the subscriptions
The resulting number will be your current MRR.
It's important to note that you should not include one-off charges in your MRR calculations, as they are not recurring in their nature. You should also not count trials into MRR as they don't generate any revenue yet. Overdue payments are up to you, but I would still count them in as long as the subscription is not expired.
Best,
Peter