@odooconnector/medusa-odoo-connector
v0.1.0
Published
Medusa v2 ↔ Odoo connector: two-way sync of products, inventory, orders and customers, with an admin UI and tiered Stripe-billed plans.
Maintainers
Readme
medusa-odoo-connector
A Medusa v2 plugin that syncs your store with Odoo — products, inventory, orders, and customers — with a built-in admin UI and tiered (Stripe-billed) plans.
Architecture: this plugin runs inside Medusa and talks to a small companion service (odoo-api) over HTTP, which does the actual Odoo JSON-RPC. The plugin never holds Odoo credentials in the browser. You deploy
odoo-apialongside Medusa (it ships in this repo).
Features
| Area | What it does | |------|--------------| | Products | Import (Odoo → Medusa) and export (Medusa → Odoo) with variants, options, per-variant prices, images, and title-slug handles. Idempotent; variant reconciliation on update (create new / update existing, never delete). | | Inventory | Two-way stock sync by SKU, mapped per location ↔ Odoo warehouse (on-hand / forecasted). | | Orders | Push Medusa orders to Odoo as sale orders (+ optional invoice & payment). Auto on placement or manual. Atomic fail on unmatched SKU. | | Customers | Two-way customer sync (matched by email). | | Scheduling | Background imports via BullMQ + Redis (off / 30 min / hourly / twice-daily / daily). | | Admin UI | Setup wizard, Dashboard, and a settings page per entity, plus Sync, Logs, and Plans. | | Plans & billing | Free / Starter / Pro / Enterprise tiers that gate what syncs (product caps, sync direction, schedule frequency, entity access), with optional Stripe subscriptions. |
Requirements
- Medusa v2 (tested on
2.15.x) - Node >= 20
- Redis (for scheduled/queued syncs)
- A running odoo-api companion service (see below)
- An Odoo instance with API access (URL, database, username, API key)
Installation
npm install medusa-odoo-connectorRegister the plugin and its module in medusa-config.ts:
module.exports = defineConfig({
// ...
plugins: [
{ resolve: "medusa-odoo-connector", options: {} },
],
modules: [
{ resolve: "medusa-odoo-connector/modules/odoo" },
],
})Point the plugin at your odoo-api service via env:
ODOO_API_URL=http://localhost:4000 # where odoo-api is reachable
ODOO_API_KEY=change-me # shared secret (matches odoo-api's API_KEY)
REDIS_URL=redis://localhost:6379 # for the sync queue/schedulerThen build the admin and start Medusa:
npx medusa build && npx medusa startYou'll find Odoo Connector in the Medusa admin sidebar.
The odoo-api companion service
The plugin proxies all real Odoo work to odoo-api (an Express + MySQL service).
Deploy it separately and set its MySQL, the shared API_KEY, and (optionally)
STRIPE_* in its env. It does the Odoo JSON-RPC and optional Stripe billing;
Medusa stays the source of truth for configuration.
Stripe billing (optional)
The Plans page can sell tiered subscriptions via Stripe. Configure
STRIPE_SECRET_KEY, price IDs, and a webhook on the odoo-api service; the plan a
customer is on then gates what the connector will sync. Billing is entirely
optional — without Stripe keys the connector still runs (everyone is treated as
Free).
Development
npm run build # medusa plugin:build
npm run test:plugin # Vitest unit tests for the sync logic (run from the repo root)