When pre-built connectors do not exist or do not fit, Odoo’s APIs let developers integrate any external system with Odoo. This guide covers the practical realities of building integrations against Odoo’s APIs for UAE businesses — what works, what is painful, and what to watch out for.
Odoo’s API Surface
XML-RPC (Legacy, Still Widely Used)
Odoo’s traditional API. Supports all standard ORM operations: create, read, search, write, unlink, execute custom methods. Authentication via username/password (or API key in newer versions).
- Pros: stable, comprehensive, well-documented
- Cons: verbose, older protocol, slower than alternatives
JSON-RPC
Modern equivalent of XML-RPC. Same operations; JSON encoding instead of XML.
- Pros: more efficient, easier to debug
- Cons: less third-party tooling than REST
REST API (via Custom Module or Third-Party)
Odoo does not ship a true REST API out of the box. You either:
- Install a REST API module (several available in Odoo App Store)
- Build your own REST controllers using Odoo’s HTTP controller framework
Webhooks (Outbound from Odoo)
Odoo Enterprise has automated actions that can trigger HTTP POSTs on record events. For more sophisticated webhooks, install a webhooks module or build custom server actions.
Authentication Approaches
API Keys (Recommended)
Generate per-user API keys in Odoo. Each external integration gets its own key. Revocable without changing user passwords.
OAuth 2.0
Supported for some integration patterns. More complex but better for user-facing integrations.
Session-Based
Authenticate once to get a session ID, reuse for subsequent calls. Acceptable for short-lived integrations.
Common Integration Patterns
Pattern 1: External System Pulls from Odoo
External system (e.g., a BI tool) polls Odoo periodically for new data. Pros: simple. Cons: polling overhead; latency.
Pattern 2: Odoo Pushes to External System
Odoo webhooks fire on events (new order, invoice paid, etc.) to external endpoints. Pros: real-time, efficient. Cons: requires reliable receiver; need to handle retries.
Pattern 3: External System Pushes to Odoo
External system (e.g., e-commerce platform, IoT device) creates/updates records in Odoo via API. Pros: real-time inbound. Cons: data quality control on Odoo’s side.
Pattern 4: Bidirectional via Middleware
Middleware platform (Zapier, Make, n8n, Celigo, Workato) bridges Odoo and external systems with no direct API integration. Pros: visual configuration, no code. Cons: vendor lock-in, per-task costs.
Practical Performance Considerations
- Odoo’s XML-RPC is slow for high-volume operations (multiple seconds per call). Batch operations where possible.
- Use search_read instead of search + read separately
- Specify fields explicitly — don’t pull entire record if you only need 3 fields
- Be aware of access rights — API calls respect Odoo’s record rules; an integration user may need specific permissions
- Beware of computed fields — they may execute heavy logic on every read
Webhook Reliability
Webhooks fail. The receiver might be down, slow, or rate-limited. Production-ready webhook implementations need:
- Retry logic with exponential backoff
- Dead-letter queue for permanent failures
- Idempotency — receiver must handle duplicate deliveries gracefully
- Signature verification — prove the webhook actually came from Odoo
- Logging — for debugging missed events
Building Your First Integration
- Define what data needs to move, in which direction, and on what trigger
- Choose the integration pattern (pull, push, middleware)
- Generate API credentials
- Build in a test/staging environment, not production
- Handle errors gracefully (network failures, validation errors, rate limits)
- Log everything during development; reduce logging in production
- Monitor in production — silent failure is worse than loud failure
Code Skeleton (Python Example)
A minimal Python script to authenticate and create a customer in Odoo via XML-RPC:
- Authenticate to get user ID
- Call execute_kw with model name, method (create), and field values
- Receive new record ID
The actual API documentation in the Odoo developer documentation is the authoritative reference.
When NOT to Build Custom Integration
- A maintained connector already exists for your scenario
- The integration is one-time and could be CSV import/export
- The data volume is low enough that manual entry is acceptable
- You don’t have engineering capacity for ongoing maintenance
Common Pitfalls
- Building integrations against an Odoo version you plan to upgrade soon — breaks on upgrade
- Using XML-RPC for high-volume real-time integrations — performance suffers
- Not implementing idempotency — duplicate records on retry
- Storing credentials in code — security risk
- No monitoring — integrations fail silently for weeks
- Hard-coding model and field names that change between Odoo versions
Free 30-minute integration architecture call.