How to Calculate Monthly Recurring Revenue (MRR) Using Paddle API
Hi, I'm Alex, and welcome back to the Boathouse paddle series, where we talk about everything concerning Paddle. Today, we're diving deep into the world of Monthly Recurring Revenue (MRR). Last time, we looked at how to get the MRR number from the Paddle dashboard, specifically from Profitell. But what if you want to fetch this data programmatically? Maybe you want to display it in an admin or reporting dashboard, or simply need programmatic access to that number.
Unfortunately, the Paddle API does not have a direct MRR endpoint. However, it does include a transactions endpoint that provides all payments made in your account for a certain period. Using this data, you can calculate MRR manually. This blog post aims to guide you through the three steps involved in this process.
Steps to Calculate MRR from Paddle API
Step 1: Identify Recurring Transactions
A single transaction can have multiple items, referred to as Paddle prices. These items include one-off charges and recurring charges. To calculate MRR, you need to identify which of these items are recurring and determine their monthly values. If an item is on an annual plan, only a twelfth of its value contributes to the MRR.
Here's a brief walkthrough:
- Check Transaction Items: Each transaction includes items that represent Paddle prices.
- Identify Recurrence: Mark items as recurring or one-off by analyzing the billing cycle property. Ignore one-off items.
- Monthly Conversion: For recurring items, convert their value to a monthly equivalent. For example, an annual charge should be divided by 12.
Step 2: Calculate Percentages and Convert Currencies
The transactions endpoint will provide line items and their quantities in the buyer’s currency, which might be different from your payout currency. To find the actual MRR value:
- Line Items Total: Calculate the total value of recurring items for each transaction in their original currency.
- Percentage Calculation: Determine what percentage of the transaction’s total value these recurring items represent.
- Currency Conversion: Apply these percentages to your payout totals, which are in your payout currency. This step ensures that the MRR calculation reflects the correct currency.
Step 3: Handle Pagination for Comprehensive Data
If you have numerous transactions, you might hit the page limit of the Paddle API. Handle this by using the after
parameter.
- Request Transactions: Start by sending a request to the transactions endpoint.
- Use
after
Parameter: When you reach the page limit, take the ID of the last record and send another request using this ID in theafter
parameter. - Compile Data: Continue this until you have all transactions for the specified period.