Connect Odoo
Who this is for: admins who connect Liitora to Odoo, for example to send paid invoices to your accounting system, to keep customers in sync with your CRM, or to read stock levels.
Before you start: you need the Manage connections permission in Liitora (Admin and Editor). In Odoo you need an administrator who can create users, and an Odoo database on version 19.0 or later.
Liitora works in your Odoo database as a dedicated bot user. Every call runs as that user, so it can do only what its access rights allow, and Odoo shows the bot as the user who created or changed each record. You can archive the bot or delete its key at any time in Odoo.
Liitora uses Odoo’s newest external API, called JSON-2, with an API key. The Odoo connection template fills in everything that is the same for every company. You enter only your Odoo address and, if your server needs it, the database name.
Check your Odoo version and plan
Section titled “Check your Odoo version and plan”- Version. Liitora supports Odoo 19.0 and later. Odoo 17.0 and 18.0 don’t have the JSON-2 API, so they aren’t supported yet. Odoo Online databases are on a supported version already. On Odoo.sh or your own server, check the version in Settings and upgrade to 19.0 or later first. Test connection tells you if your version is too old.
- Plan. On Odoo Online, the external API is available only on the Custom plan, not on One App Free or Standard. If your database is on another plan, Odoo refuses the API key. Ask Odoo or your Odoo partner to change the plan first.
What the template sets for you
Section titled “What the template sets for you”These settings come from the template and can’t be changed, so the connection only ever reaches your Odoo:
| Setting | Value |
|---|---|
| Address | the https:// address you enter, with no path |
| Sign-in | the API key as a bearer token on every request |
| Database | the database name you enter, sent as X-Odoo-Database, or nothing |
| Other hosts it may call | none |
| Requests per second | 1 on Odoo Online and Odoo.sh (addresses ending in odoo.com); 1 by default and up to 10 for your own server |
| Retries | only when Odoo says it is limiting requests (HTTP 429) or busy (HTTP 503), after the wait Odoo asks for. Never after a timeout, so a payment or an invoice is never sent twice |
The address must start with https://. Plain http is refused, because the API key goes with every request. www.odoo.com and odoo.com are refused too: they are Odoo’s own website, not your database. Use your database’s address, like https://mycompany.odoo.com, an Odoo.sh address, your own domain name, or the address of your own server. Liitora reaches only public addresses, and never follows a redirect.
Create the bot user
Section titled “Create the bot user”- In Odoo, open Settings > Users & Companies > Users and select New.
- Give it a name people will recognise, for example
Liitora bot, and an email address you control. - Under Access Rights, give it only what your workflows need. See the table below.
- Leave the password empty. The bot then can’t sign in to Odoo with a password at all, only use its API key.
- Save the user.
Use this user for Liitora only, so you can tell its changes apart from people’s. Whether the bot counts as a paid user depends on your Odoo plan. Check with Odoo.
| What the workflow does | Access the bot user needs |
|---|---|
| Find, read, create and update customers | Contacts, or Sales at user level |
| Read sales orders and their lines | Sales, with a level that shows all documents, not only its own |
| Create and confirm sales orders | Sales with all documents. Creating the customer first also needs the Contacts right to create contacts |
| Create invoices from sales orders | Sales with all documents, and Invoicing or Accounting |
| Read invoices and register payments | Invoicing or Accounting |
| Get invoice PDFs | Invoicing or Accounting. Odoo must have made the PDF first, by sending or generating the invoice in Odoo |
| Read stock levels | Inventory |
Odoo’s documentation doesn’t list the exact access level each of these needs. Start with the lowest level that works and test your workflows.
Create the API key
Section titled “Create the API key”- Sign in to Odoo as the bot user to create its key. If it has no password, an administrator can set a temporary one: open Settings > Users & Companies > Users, open the bot user and select Action > Change Password. Afterwards, change it to a long random password that nobody keeps.
- Open the user menu, Preferences, then the Account Security tab, and select New API Key.
- Type a description, for example
Liitora production, and choose a duration. Odoo allows at most three months. - Copy the key. Odoo shows it only once.
Make one key for each Liitora connection, so you can replace or revoke one without touching the others.
Keys expire
Section titled “Keys expire”Odoo API keys last at most three months. When a key expires, Odoo refuses it and your workflows stop until you add a new one. So:
- When you store the key in Liitora, set the secret to expire on the same day as the key.
- Liitora reminds you 30, 7 and 1 day before the secret expires.
- Before then, make a new key for the bot user, put it in the secret with the new expiry date, and only then delete the old key in Odoo.
See Rotate and expire secrets.
Add the connection in Liitora
Section titled “Add the connection in Liitora”- Open Secrets and add a secret of the kind API key, for example
odoo_key, with the key as its value and the key’s expiry date as the secret’s expiry. See Add a secret. - Open Connections, select Add a connection, then Connect your own API under Not in the list?.
- Under Start from, pick Odoo.
- Type the Name, for example
odoo. Workflows use this name. - Pick the Environment. Add a Test setup too if you have a separate test database. On Odoo.sh, a staging database is a copy of your real data, so treat it like production data.
- Type the Odoo address, for example
https://mycompany.odoo.com. - Leave Database name empty, unless one Odoo server hosts several databases at the same address. Then type the database’s name.
- For your own Odoo server you can raise Requests per second up to 10. Leave it at 1 on Odoo Online and Odoo.sh.
- Under Secrets, type
odoo_keyfor API key. If the secret doesn’t exist yet, select Ask for it so someone adds the value. - Select Save, then Test connection.
Test connection reads your Odoo version first. If the version is older than 19.0, it says so and sends nothing else. Then it checks the API key by asking Odoo who the key belongs to. If it says Odoo did not accept the key, check that you copied the whole key, that it hasn’t expired, and that your Odoo Online plan includes the external API. If it says there is no JSON-2 API at the address and your server hosts several databases, enter the database name.
Your AI assistant can do steps 2 to 9 with the create_connection_from_template tool. It asks you for the address. It never sees the API key.
When Odoo slows you down
Section titled “When Odoo slows you down”Odoo’s acceptable use policy for Odoo Online asks for about one request per second, with no parallel requests. Liitora keeps every Odoo Online and Odoo.sh connection to one request per second, shared by every run that uses the connection. Runs that need more requests wait their turn.
If Odoo answers that it is limiting requests or is busy, Liitora waits as long as Odoo asks, up to a minute, and tries again. A request that timed out is not sent again, because Odoo may already have done it. The step fails with a plain message instead, and the step’s own retry: setting decides what happens next.
Paid or In payment
Section titled “Paid or In payment”When a workflow registers a payment, Odoo usually marks the invoice In payment, not Paid. It becomes Paid only when your bookkeeping matches the payment with the bank transaction (bank reconciliation). With Odoo’s default settings in 18.0 and later, the amount due may not change until then either.
If your bank account is set as the outstanding account of the bank journal’s payment method, Odoo marks the invoice Paid at once. Your accountant decides which setting you use.
For Liitora both mean the payment is registered. See odoo.register-payment.
Before you rely on it
Section titled “Before you rely on it”We built this connection from Odoo’s documentation and tested it on Odoo 19.0 Community, where every action ran. Odoo Online, Odoo.sh and Odoo 20.0 haven’t been checked yet. See Odoo actions. Try your workflows on a test database first.
Sources
Section titled “Sources”Written from Odoo’s own documentation:
- External JSON-2 API (19.0)
- ORM API (19.0)
- Standard and extended support
- Odoo Online
- Access rights
- Payments
- Odoo Cloud Acceptable Use Policy