Odoo API Integration Guide: Connect Odoo to Any System
Odoo rarely operates in isolation. Businesses need it connected to eCommerce platforms, payment processors, shipping carriers, marketing tools, and custom applications. The Odoo External API provides two protocols — XML-RPC and JSON-RPC — that enable any system to read, create, update, and delete records in Odoo programmatically.
Authentication
API Key Authentication
Generate an API key in Odoo: navigate to your user profile, then Account Security, then API Keys. Create a key with a descriptive label. Use this key instead of your password for API authentication — it can be revoked independently without changing your login credentials.
Connection Parameters
Every API call requires: the Odoo server URL, the database name, your username (login email), and the API key. Store these securely — never hardcode credentials in source code.
XML-RPC Protocol
Connection Setup
XML-RPC uses two endpoints: /xmlrpc/2/common for authentication and /xmlrpc/2/object for data operations. Authenticate first to get a user ID, then use that ID for subsequent calls.
CRUD Operations
Search and Read: Query records with domain filters (similar to SQL WHERE clauses). Domains use tuples: [('state', '=', 'sale'), ('amount_total', '>', 1000)] finds confirmed sales orders over $1,000.
Create: Pass a dictionary of field values. The API returns the new record ID. Required fields must be included or the call fails with a validation error.
Write: Update existing records by passing the record IDs and a dictionary of changed values. Only include fields you want to modify.
Unlink: Delete records by ID. Use with caution — some records cannot be deleted if they have dependent records.
JSON-RPC Protocol
Why JSON-RPC
JSON-RPC is generally preferred for modern integrations: it uses JSON (more developer-friendly than XML), works better with JavaScript/TypeScript applications, and offers slightly better performance for large payloads.
Request Format
JSON-RPC calls go to a single endpoint: /jsonrpc. Each request includes the service name, method, and arguments in a standard JSON-RPC 2.0 envelope.
Common Integration Patterns
eCommerce Order Sync
Sync orders from Shopify or WooCommerce to Odoo:
- Listen for order webhooks from the eCommerce platform
- Map customer data to Odoo partner records (create or match existing)
- Create a sale order with line items mapped to Odoo products
- Confirm the order to trigger fulfillment workflows
- Sync tracking information back to the eCommerce platform
Payment Processor Integration
Connect Stripe, PayPal, or other processors:
- Receive payment confirmation webhooks
- Match payments to Odoo invoices by reference number
- Register the payment in Odoo Accounting
- Reconcile with bank statements automatically
CRM Synchronization
Keep Odoo CRM in sync with external marketing tools:
- New leads from marketing platforms create Odoo leads
- Lead scoring updates flow bidirectionally
- Won opportunities trigger follow-up campaigns in the marketing tool
- Contact information stays synchronized across systems
Error Handling
Common Errors
- Access denied: Invalid credentials or insufficient permissions
- Validation error: Required fields missing or invalid values
- Record not found: Referencing an ID that does not exist
- Concurrent update: Another user modified the record simultaneously
Best Practices
- Implement retry logic with exponential backoff for transient failures
- Validate data before sending to catch errors early
- Log all API calls for debugging and audit purposes
- Handle rate limits — batch operations instead of individual calls
- Use idempotent operations to safely retry failed calls
Performance Optimization
- Batch reads: Use
search_readinstead of separatesearch+readcalls - Limit fields: Request only the fields you need, not all fields on the model
- Pagination: Use
limitandoffsetfor large result sets - Caching: Cache slowly-changing data (product catalogs, currency rates) locally
Webhook Patterns
Odoo does not have native outbound webhooks in all versions. Common approaches:
- Automated actions: Server actions that trigger on record changes and call external URLs
- Custom controllers: Build an Odoo module that exposes webhook endpoints for external systems
- Polling: External systems poll Odoo at intervals for changes (simpler but less real-time)
Security Considerations
- Use API keys instead of passwords
- Restrict API access by IP address at the network level
- Use HTTPS for all API communication
- Implement proper access rights — API users should have minimum necessary permissions
- Rotate API keys regularly and revoke compromised keys immediately
Our Odoo integration service builds production-grade integrations with proper error handling, monitoring, and security.
Frequently Asked Questions
Which protocol should I use — XML-RPC or JSON-RPC?
JSON-RPC for new projects. It is more developer-friendly, works better with modern tools, and is the direction Odoo is heading. XML-RPC for legacy systems or languages with better XML-RPC library support.
Is there a REST API?
Odoo 17+ includes a REST API alongside the RPC endpoints. It follows standard REST conventions with JSON payloads and is generally easier to work with for web applications.
How do I handle large data migrations?
For initial data loads, use the CSV import feature or write a migration script that creates records in batches (100-500 records per batch) with error handling for each batch.
Can I extend the API with custom endpoints?
Yes. Create custom Odoo modules with controller classes that expose additional HTTP endpoints for specialized operations not covered by the standard API.
Written by
ECOSIRE Research and Development Team
Building enterprise-grade digital products at ECOSIRE. Sharing insights on Odoo integrations, e-commerce automation, and AI-powered business solutions.
Related Articles
Allegro Marketplace Integration with Odoo: Poland's Leading eCommerce Platform
Complete guide to integrating Allegro marketplace with Odoo ERP covering REST API setup, Allegro Smart, bidding, and shipping for Polish eCommerce.
Accounts Payable Automation with Odoo: From Invoice to Payment
Automate accounts payable in Odoo from invoice capture through approval workflow to payment execution. Reduce processing costs and eliminate late payment penalties.
How to Choose the Right CRM for Your Business in 2026
A complete guide to selecting the right CRM platform in 2026, comparing Odoo CRM, Salesforce, HubSpot, GoHighLevel, and Zoho across features, pricing, scalability, and industry fit.