Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions account_statement_import_online_mercury/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===============================
Online Bank Statements: Mercury
===============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:03353adcf5fa8d9d385f92374f21471110044861612d1182fa6eee29a7dde09c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github
:target: https://github.com/OCA/bank-statement-import/tree/19.0/account_statement_import_online_mercury
:alt: OCA/bank-statement-import
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/bank-statement-import-19-0/bank-statement-import-19-0-account_statement_import_online_mercury
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Connects Odoo to `Mercury <https://mercury.com>`__ using the `Mercury
REST API <https://docs.mercury.com/reference/introduction>`__ to
automatically pull bank statement lines into your accounting journals.

**Mercury** is a US business banking platform (checking, savings,
treasury) built for startups and small businesses. It offers a public
REST API at ``https://api.mercury.com/api/v1`` with Bearer token
authentication. This module uses the following endpoints:

- ``GET /accounts`` — list accounts (used for auto-detection)
- ``GET /account/{id}/transactions`` — fetch transactions with date
filtering and cursor-based pagination

A **read-only API key** is sufficient for statement import. Read-only
keys have no IP allowlist requirement. Write-access keys (needed for the
future Mercury Plus invoicing feature) require IP allowlisting in
*Mercury → Settings → API Keys*.

**Table of contents**

.. contents::
:local:

Configuration
=============

Generate a Mercury API Key
--------------------------

1. Log in to `Mercury <https://app.mercury.com>`__ and go to **Settings
→ API Keys**.
2. Click **Create API Key**, choose **Read-only** scope, and copy the
key. The key is shown once; store it securely.

..

Read-only keys have no IP allowlist requirement. Write-access keys
require IP allowlisting and are only needed for future
invoicing/payment features.

Configure Odoo
--------------

1. Go to **Accounting → Configuration → Journals** and open or create a
bank journal.
2. In the **Online Synchronization** section, select **Mercury** as the
service.
3. Paste your **API Key**. You may paste the bare token or the full
``secret-token:…`` form — both are accepted.
4. Optionally paste your **Mercury Account ID** — the UUID in the
Mercury dashboard URL (``https://app.mercury.com/accounts/<uuid>``).
Leave blank to auto-detect the first account on the key. If you have
multiple accounts under one API key (e.g. checking and savings), set
this field to pull from a specific account.
5. Enable **Include Pending Transactions** if you want to see unposted
transactions. Note: pending transactions may be reversed or change
amount before settlement.
6. Set the **Synchronization Frequency** and save.
7. Click **Pull Now** (or let the scheduled activity run) to import
transactions.

Usage
=====

Once configured, statement lines are created automatically in the linked
journal. Each line carries:

- **Date** — ``postedAt`` timestamp (falls back to ``createdAt`` for
pending transactions)
- **Amount** — negative for debits, positive for credits
- **Reference** — bank description, external memo, and note concatenated
with ``|``
- **Partner name** — counterparty name from Mercury
- **Account number** — counterparty account number (used for ACH partner
matching)

Transactions are deduplicated by Mercury's transaction UUID, so pulling
the same date range twice will not create duplicate statement lines.

Known issues / Roadmap
======================

- **Mercury Plus invoicing** — create Mercury invoices from Odoo sale
orders and sync payment status back via the Mercury Invoicing API.
- **OAuth2 multi-tenant** — support OAuth2 flow for users who prefer not
to manage API keys manually (e.g. Odoo.sh / SaaS deployments).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_online_mercury%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Ledo Enterprises

Contributors
------------

- Dan Kendall dkendall@ledoweb.com

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/19.0/account_statement_import_online_mercury>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions account_statement_import_online_mercury/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2024 Ledo Enterprises
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models # noqa: F401
15 changes: 15 additions & 0 deletions account_statement_import_online_mercury/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Ledo Enterprises
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Online Bank Statements: Mercury",
"version": "19.0.1.0.0",
"category": "Accounting/Accounting",
"website": "https://github.com/OCA/bank-statement-import",
"author": "Ledo Enterprises, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["account_statement_import_online"],
"data": [
"views/online_bank_statement_provider_views.xml",
],
}
3 changes: 3 additions & 0 deletions account_statement_import_online_mercury/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2024 Ledo Enterprises
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import online_bank_statement_provider_mercury # noqa: F401
Loading
Loading