Hi experts,
I am new to the ODOO world. I. have a requirement to integrate third party Invoices ODOO Invoices and third Sales orders with ODOO sales orders using the REST APIs.
Can you please guide me ?
Warm regards,
WILLION
Hi experts,
I am new to the ODOO world. I. have a requirement to integrate third party Invoices ODOO Invoices and third Sales orders with ODOO sales orders using the REST APIs.
Can you please guide me ?
Warm regards,
WILLION
Hi Willion,
Welcome to the Odoo community!
Integrating third-party invoices and sales orders with Odoo through REST APIs is a common requirement and can be implemented in several ways depending on the external system.
A typical integration flow would be:
Analyze the Third-Party API
Review the API documentation.
Identify authentication methods (API Key, OAuth, Bearer Token, etc.).
Understand the request/response formats (usually JSON).
Create a Custom Odoo Module
Develop a custom module to handle the integration logic.
Use Python libraries such as requests to communicate with the external API.
Map External Data to Odoo Models
Sales Orders → sale.order
Invoices → account.move
Customers → res.partner
Products → product.product
Implement Synchronization
Import data from the external system into Odoo.
Optionally export Odoo records back to the external system.
Use scheduled actions (Cron Jobs) for automatic synchronization.
Handle Errors and Logging
Store API responses and errors for troubleshooting.
Implement retry mechanisms for failed requests.
Example (REST API call from Odoo):
import requests
response = requests.get(
"https://api.example.com/orders",
headers={"Authorization": "Bearer YOUR_TOKEN"}
)
data = response.json()
If you can share:
Your Odoo version
The third-party system name
Whether the integration is one-way or two-way
the community can provide more specific guidance and examples.
Best regards,
Sandeep Paulraj
Hi,
Yes, this is definitely achievable! Here's the general approach for syncing third-party invoices and sales orders into Odoo via REST API:
1. Authenticate first:
import requests
session = requests.Session()
response = session.post('https://your-odoo.com/web/dataset/call_kw', json={
"jsonrpc": "2.0",
"method": "call",
"params": {
"model": "res.users",
"method": "authenticate",
"args": ["your-db", "admin@example.com", "password", {}],
"kwargs": {}
}
})
uid = response.json().get("result")
2. Create a Sales Order (sale.order):
session.post('https://your-odoo.com/web/dataset/call_kw', json={
"jsonrpc": "2.0",
"method": "call",
"params": {
"model": "sale.order",
"method": "create",
"args": [{"partner_id": 1, "order_line": [(0, 0, {
"product_id": 5,
"product_uom_qty": 2,
"price_unit": 100.0
})]}],
"kwargs": {}
}
})
3. Create an Invoice (account.move):
session.post('https://your-odoo.com/web/dataset/call_kw', json={
"jsonrpc": "2.0",
"method": "call",
"params": {
"model": "account.move",
"method": "create",
"args": [{"move_type": "out_invoice", "partner_id": 1, "invoice_line_ids": [(0, 0, {
"name": "Service",
"quantity": 1,
"price_unit": 200.0
})]}],
"kwargs": {}
}
})
For duplicate prevention, always search for an existing record before creating:
# Check if order already exists by external reference
session.post('...call_kw', json={
"params": {
"model": "sale.order",
"method": "search_read",
"args": [[["client_order_ref", "=", "EXT-ORDER-123"]]],
"kwargs": {"fields": ["id"], "limit": 1}
}
})
If you want to avoid the JSON-RPC boilerplate and work with a cleaner REST interface, REST API Toolkit (available on the Odoo App Store for Odoo 19) lets you do all of this with simple GET/POST/PATCH/DELETE endpoints and Bearer token auth — much easier to integrate with third-party platforms.
Hope that helps!
Hi Willion,
Yes, this is possible using Odoo REST/XML-RPC APIs or custom API endpoints depending on your Odoo version and integration requirements.
For your use case, the process usually involves:
Authenticating with the Odoo API
Mapping third-party invoice and sales order data
Creating/updating records in Odoo (sale.order and account.move)
Handling customer/product synchronization
Managing error handling and duplicate prevention
The best approach depends on:
your Odoo version,
the third-party system you want to connect,
and whether the sync should be real-time or scheduled.
If you can share a few more details about the external platform/API you are integrating with, I can guide you more specifically.
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden| Gerelateerde posts | Antwoorden | Weergaven | Activiteit | |
|---|---|---|---|---|
|
1
aug. 24
|
10124 | |||
|
2
mei 22
|
16287 | |||
|
0
jan. 21
|
1949 | |||
|
0
mrt. 15
|
5019 | |||
|
0
jun. 26
|
745 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.