---
title: Mergify Billing System
description: Understand how Mergify fair billing works.
---

This page explains how Mergify's contributor-based billing works and how to
read your invoice.

## Contributor-Based Billing

Many enterprise solutions charge per user, irrespective of actual usage. At
Mergify, we firmly believe in billing you only for what you actively use.

This is why our billing system operates on the principle of contributors.
Here's how it works:

- A contributor is any user who **contributes commits to a pull request**,
  either by opening it or by pushing new commits to it. Other activity, such
  as reviewing, commenting on, closing, or reopening a pull request, does not
  make someone a contributor.

- Each user is counted **only once**, even if they contribute to pull requests
  across multiple repositories.

- The system uses a 30-day sliding window. A user is counted as a contributor
  for 30 days after they open a pull request or push commits to one. After that
  period, if they make no further contributions, they are no longer considered
  active for billing purposes.

- Usage is prorated to the day: if a contributor is seen active during 48 days,
  the system only bills for precisely 48 days, not 2 entire months.

### Estimating Contributors

If you don't know the number of contributors that Mergify might count, you can
use <DownloadLink href="/mergify-count-contributors.py">this
script</DownloadLink> to estimate the number of contributors over the last 30
days.

1. Go to
   [https://github.com/settings/tokens](https://github.com/settings/tokens) (or
   the equivalent page on your GitHub Enterprise Server installation, at
   `https://<your-ghes-host>/settings/tokens`) to create a token. The token must
   have the permissions to access the repository (read permission is enough);

2. Export the token as an environment variable with `export
   GITHUB_TOKEN=<your-token>`;

3. Install [`requests`](https://pypi.python.org/pypi/requests) on your system
   by running `python3 -m pip install requests`;

4. Run the script with `python3 mergify-count-contributors.py <repo1-url>
   <repo2-url> etc`, passing the list of repositories where Mergify will be
   deployed. Use the full repository URLs, including the host, so the script can
   reach the right API endpoint (for example
   `https://github.com/org/repo` for GitHub.com or
   `https://github.example.com/org/repo` for GitHub Enterprise Server).

The script will run and print its progress. It can take several minutes for the
script to complete depending on the number of repositories scanned and the
number of active pull requests they have.

:::note
  The script automatically targets the GitHub Enterprise Server REST API
  (`https://<your-ghes-host>/api/v3`) based on the repository URLs you pass. If
  your installation serves a self-signed or internal-CA certificate, you can
  disable TLS verification by setting `export GITHUB_SKIP_SSL_VERIFY=1` before
  running the script.
:::

:::caution
  This script provides an **approximate estimate** of the number of users that
  Mergify might consider active. It does not fully replicate the internal logic
  used by Mergify to count active users, so discrepancies may exist. This
  script is for reference only and should not be considered the source of
  truth.
:::

## Annual Subscription

Mergify does not require an annual subscription (except for the Enterprise
plan), but offers a large discount if you buy users in advance for a
12-month period.

An annual subscription allows you to buy a base number of seats (users) per
product at the start of the year. If your usage goes beyond the pre-purchased
seats, additional seats are billed monthly, prorated to the exact day of use.

For example, let's say you have purchased an annual license for 100 users. If
your number of users increases to 110 users during 45 days, you will be
invoiced for 10 extra users over 45 days.

:::note
  You can subscribe to a yearly plan at any time by contacting <a
  href="mailto:support@mergify.com">your customer representative</a>.
:::

## Checking Current Usage

You can check your current usage on the [Plan
page](https://dashboard.mergify.com/settings/plan) of the Mergify dashboard,
under **Settings → Plan**. It lists each product you use in a table, with its
repository count and its number of active contributors:

| Product | Repositories | Active contributors |
|---|---|---|
| Merge Queue | 10 repositories | 25 contributors |
| CI Insights | 5 repositories | 15 contributors |
| Workflow Automation | 10 repositories | 25 contributors |

The counts above are examples. If you are a billing manager, the table has an
**On-demand Usage** column showing what you are billed monthly on top of your
plan. On a yearly subscription, it also has a **Committed** column showing the
seats you pre-purchased.

On some plans the third column is headed **Collaborators** instead. It counts
everyone with access to a repository, rather than only the people who
contributed to it.

Both counts are clickable: the repository count takes you to your repositories
list, and the contributor count opens the list of people counted for that
product.

:::note
  This is not available for on-premise plans.
:::

## Switching or Cancelling Plans

If you wish to switch between plans or cancel your subscription, <a
href="mailto:support@mergify.com">please contact our customer
support</a>. They'll guide you through the process and ensure a
smooth transition.

When you cancel, your subscription stays active until the end of the billing
period you already paid for, and it does not renew. You may still receive one
last invoice on that final day (see [Final Invoice After
Cancellation](#3-final-invoice-after-cancellation) below).

## Understanding Your Invoice

A single invoice usually mixes two things: an adjustment for the period that
just ended, and the charge for the period that is starting. The adjustment is
there because the number of contributors Mergify counts can change any day.
Cancelling your subscription produces one more invoice, which works differently
and is covered last.

### 1. **Real-time User Adjustment**

Mergify keeps the number of seats on your subscription in step with the number
of contributors it counts. Every time that count changes, the adjustment is
prorated: you are credited for the seats you had already paid for over the rest
of the period, then charged for the new count over those same days. Both lines
show up on your next invoice, labeled "unused time" and "remaining time" by our
payment provider, so only the difference between them changes your total.

### 2. **Upcoming Period Charge**

The rest of the invoice charges the period that is about to start, based on
your user count on the day it is issued. If that count changes during the
period, the next invoice carries the same kind of adjustment.

### A Worked Example

Say `example-org` is billed on the 1st of each month at $10 per user per month
and has 20 contributors. Two more contributors push commits on April 16th,
halfway through the period. The invoice issued on May 1st then reads:

| Line | Period | Amount |
|---|---|---|
| Unused time on 20 users | Apr 16 – May 1 | -$100.00 |
| Remaining time on 22 users | Apr 16 – May 1 | $110.00 |
| 22 users | May 1 – Jun 1 | $220.00 |
| **Total** | | **$230.00** |

The first two lines are the real-time user adjustment: half of April is
credited back at the old count, and the same half is re-charged at the new one.
The $10 difference is what the two extra contributors cost for the time they
were counted. The third line is the upcoming period, at the count you have on
the day the invoice is issued.

:::note
  `example-org`, the 20 contributors, and the $10 per-user rate are all made up
  to keep the arithmetic easy to follow. Your own invoice uses the rate on your
  plan, and your billing dates come from your own subscription.
:::

### 3. **Final Invoice After Cancellation**

When you cancel your subscription, it stays active until the end of the billing
period you already paid for, then ends without renewing. You may still receive
one last invoice dated on that final day.

That last invoice covers your final billing period, not a renewal. It collects
the [real-time user adjustments](#1-real-time-user-adjustment) described above:
when your user count changes mid-period, the prorated difference is only settled
on the next invoice, which for a cancelled subscription is the final one, issued
when the period ends. So if your team grew during your last month, that growth
is billed on the day your subscription ends. Once you pay it, you won't be
charged again.

By understanding how your invoices are built, you can more easily interpret and
anticipate how changes in your contributors influence your Mergify charges.
