# Mercury

:::tip Available
This integration is available in Frihet. Configure it in **Settings → Integrations → Mercury**.
:::

Connect your Mercury account to Frihet to automatically import your bank account transactions as expenses. Mercury is the preferred banking for startups and tech companies, and with this integration, you can keep your expenses updated in Frihet without manual entry.

## What does it do?

- **Import transactions as expenses** — Payments and charges made from Mercury are imported as expenses in Frihet with description, amount, date, and currency
- **Debits only** — Only debit transactions (outgoing money) are imported, not income
- **Burn rate control** — Combined with your invoices in Frihet, you have full visibility of income vs. expenses to control your runway
- **Automatic deduplication** — Already imported transactions are identified by their ID and are not duplicated

## Requirements

- Active account on [Mercury](https://mercury.com)
- Frihet Pro or Premium Plan
- Mercury API Token

## How to connect

### Step 1: Get your API Token in Mercury

1. Log in to [app.mercury.com](https://app.mercury.com)
2. Go to **Settings** in the side menu
3. Select **Developers** or **API**
4. Click on **Generate Token**
5. Give it a descriptive name, for example "Frihet ERP"
6. Select read-only permissions for transactions
7. Copy the generated token. Store it in a safe place as it is only shown once.

### Step 2: Configure in Frihet

1. In Frihet, go to **Settings → Integrations**
2. Search for **Mercury** and click on the card
3. Paste your **API Token** in the corresponding field
4. Click on **Test connection** to verify that the credentials are correct
5. If the connection is successful, you will see the confirmation with your account data
6. Click on **Save**

## How it works

Frihet connects to the Mercury API using your API Token with Bearer authentication. When you initiate an import, Frihet queries the transactions from your accounts in Mercury and records the debit transactions as expenses in Frihet.

The import is on-demand. Only completed debit transactions are imported — payments to vendors, outgoing transfers, subscriptions, etc. Deposits and income are not imported.

### Data mapping

| Data in Mercury | Field in Frihet |
|-----------------|-----------------|
| Transaction description | Expense description |
| Amount (debit) | Expense amount |
| Transaction date | Expense date |
| Currency | Expense currency |
| Counterparty / beneficiary | Expense notes |

## Use cases

### Seed-stage startup

You've just closed a round and need to control your burn rate. You import Mercury transactions into Frihet every week to see exactly how much you're spending and on what. Combined with your invoiced income in Frihet, you have a clear picture of your runway.

### SaaS with recurring expenses

You pay for infrastructure (AWS, Vercel, Cloudflare), SaaS tools, and professional services from Mercury. Instead of manually recording each charge, you import everything into Frihet and categorize it to know how much it costs to operate your product.

### Founder with multiple accounts

You have an operating account and a reserve account in Mercury. You can import transactions from both accounts into Frihet to have a unified record of all your expenses.

## Troubleshooting

### Connection error

- Verify that the API Token is correct and has not been revoked
- Check that the token has read permissions for transactions
- If you regenerated the token in Mercury, update it in Frihet

### Transactions are not imported

- Only completed debit transactions are imported
- Pending or in-progress transactions do not appear until Mercury confirms them
- Verify the selected date range

### Some transactions do not appear

- Internal transfers between Mercury accounts may be handled differently
- Verify that the specific account has movements in the selected period

## Next steps

- [Connect Wise for international transfers](./wise)
- [Connect Qonto if you use European business banking](./qonto)
- [Learn to categorize imported expenses](../gastos/categorias)
