ml-connector
OdooPayPal

Odoo and PayPal integration

Odoo runs accounting, purchasing, and HR for growing companies. PayPal handles payments and invoicing. Connecting them keeps your customer payments in sync with your invoices and accounts receivable, and surfaces which PayPal transactions correspond to which Odoo sales orders. New orders and payment events from PayPal post into Odoo's accounting module without manual re-entry, and customer records align across both systems so each payment lands on the correct invoice. ml-connector bridges the very different auth models on each side and moves the records on a schedule or via webhook events.

How Odoo works

Odoo exposes invoices, sales orders, customers, payments, and GL accounts through XML-RPC over HTTP POST (all Odoo versions) and JSON-2 REST API (Odoo 19+). Authentication uses an API key paired with a username, or a Bearer token on JSON-2. Base URLs vary by hosting: Odoo Online at https://<subdomain>.odoo.com, Odoo.sh at https://<subdomain>.odoo.sh, and self-hosted at your domain. API access requires a Custom pricing plan on Odoo Online. Polling is recommended for production, using a write_date filter and high-water-mark timestamp on search calls; webhooks are available via Automated Actions in Odoo Enterprise but are not production-grade.

How PayPal works

PayPal exposes orders, payments, invoices, transactions, subscriptions, and payouts through REST APIs with JSON request and response bodies. Authentication uses OAuth 2.0 Client Credentials, with the CLIENT_ID and CLIENT_SECRET sent as HTTP Basic Auth to obtain a Bearer token that lasts about 8 hours. PayPal can push events via webhooks to a registered HTTPS endpoint and retries up to 25 times over 3 days if the endpoint returns non-2xx. Event signatures are verified using RSA-SHA256 via the paypal-transmission-sig header. Transaction search is limited to a 31-day window with a max of 500 results per page.

What moves between them

The main flow runs from PayPal into Odoo. Completed PayPal orders and payments are polled on a schedule or received via PayPal webhook events and posted into Odoo's accounting module, mapped to the matching Odoo customer (partner) and sales order. PayPal transaction IDs are stored in Odoo account.move records for reconciliation. Customer records are aligned in both directions so each PayPal customer corresponds to an Odoo partner, and payment amounts match between the two systems. GL postings flow one way, from PayPal transaction data into Odoo's journal entries.

How ml-connector handles it

ml-connector stores the Odoo API key encrypted and refreshes the PayPal OAuth token on each request cycle, caching it to avoid token endpoint hammering. It polls PayPal's transaction search API within a 31-day rolling window and filters on transaction timestamp to avoid re-processing the same records twice. For each PayPal order or payment, it looks up the matching Odoo partner by email address and the matching sales order by reference or amount, then creates or updates the corresponding Odoo account.move (journal entry) with the PayPal transaction ID as the external reference. If a PayPal webhook is enabled, ml-connector also accepts push events, validates the RSA-SHA256 signature, and processes them immediately. Both polling and webhook flows use the same transformation logic so records stay consistent regardless of how they arrive. Retries account for PayPal rate limits and Odoo API timeouts.

A real-world example

A mid-sized B2B software company runs Odoo for accounting and CRM, and uses PayPal for invoicing and payments from customers worldwide. Before the integration, the finance team watched PayPal's transaction list daily, manually found the matching Odoo customer and invoice for each payment, and created journal entries by hand to clear accounts receivable. Month-end reconciliation meant chasing orphaned payments that hadn't been matched yet. With Odoo and PayPal connected, each PayPal order or payment posts into Odoo's journal automatically, matched to the customer and invoice, and the accounts receivable balance is live and accurate without manual intervention.

What you can do

  • Post PayPal orders and completed payments into Odoo's accounting module, matched to the correct customer and sales order.
  • Match PayPal customers to Odoo partners by email address so each payment lands on the right invoice and account.
  • Store PayPal transaction IDs in Odoo journal entries for audit and reconciliation.
  • Handle OAuth 2.0 token refresh on PayPal and API key auth on Odoo, with secure credential storage.
  • Poll PayPal transactions on a schedule within a rolling 31-day window, or accept webhooks when configured, with retries and a full audit trail.

Questions

Which direction does data move between Odoo and PayPal?
The main flow is PayPal into Odoo. Orders and payments from PayPal post into Odoo's accounting module as journal entries, matched to the correct customer and sales order. Customer records are aligned in both directions so each PayPal email maps to an Odoo partner. GL postings move one way only; PayPal has no GL account objects, so there is nothing to write back.
How does ml-connector match PayPal payments to Odoo invoices?
ml-connector matches by customer email address and order reference or amount. When a PayPal order arrives, it searches for an Odoo partner with the same email, then looks for a sales order with a matching external reference or total amount. Once matched, the payment posts into Odoo's journal against the correct invoice line. If no match is found, the payment is flagged for manual review.
Does the integration support PayPal webhooks or does it only poll?
Both. ml-connector can poll PayPal's transaction search API on a schedule within a rolling 31-day window, or receive webhooks if they are registered in PayPal's Developer Dashboard. Both paths use the same transformation logic and validate signatures, so records stay consistent regardless of how they arrive. Webhooks are faster for real-time sync, while polling is more reliable for high-volume accounts.

Related integrations

Connect Odoo and PayPal

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started