How the Odoo JSON-2 API lets your systems call Odoo
An integration team usually needs other systems to read and write Odoo records without a person logging in, and the JSON-2 API is Odoo's current route for that in Odoo 19. Each call is an HTTP request that runs an ORM method on a model, such as search_read or create, and the request is authenticated with an API key sent as a bearer token. The calls run with the permissions of the user who owns that key, so the access model you already have in Odoo, including access rights and record rules, decides what the integration can see and change. Before writing any code, confirm that your plan includes external API access. The pricing page places that feature in the Custom plan, and the hosting options differ by plan, so check this against your contract and hosting type first.
The API is usually the right choice when an external system needs to query or update Odoo data on demand, for example a billing platform reading open invoices or a warehouse system posting stock moves. A custom module makes sense when the logic must run inside Odoo's own transactions and user interface, and a workflow tool makes sense when many systems must be chained with retries and monitoring. The JSON-2 API sits between these options: it keeps the logic outside Odoo, and the code that calls it still needs its own error handling.
The exact endpoint names, request fields and the database selection header are not something to copy from examples or older articles. Each database publishes its own /doc page that lists the models and methods it exposes, and that page is the source of truth for the version you run. Read it on the database your integration will use, record the header name and the field names it shows, and recheck them after each upgrade. Odoo's JSON-2 documentation is the natural next read for the general reference.
How a JSON-2 request reaches the ORM and returns
The calling system starts the request on the integration host, which sits on the far side of the trust boundary from Odoo. The request carries a bearer API key and a header that names the target database, both of which Odoo checks before any model method runs. Odoo runs the named ORM method inside its own transaction on the selected database, then returns either a result or an error response. Check the header names and error shapes against the /doc page of your own database, because those details are not fixed in this diagram.
Request path from the integration host through key checks and the ORM to the database.
Which JSON-2 call pattern fits each integration
This table compares the common JSON-2 call patterns an integration team chooses between, with the typical use, the main risk and what to test first. Read each row against the business action the integration performs, then check the duplicate-database test before the pattern goes live.
| Pattern | Typical use | Main risk | Test on a duplicate database first |
|---|---|---|---|
| Read with search_read | Pulling orders, partners or stock levels into another system on a schedule | Heavy queries on large models if domains are broad or fields are numerous | Run the same domain on a copy of production volume and check response time and which fields are requested |
| Create or update through ORM methods | Writing invoices, contacts or delivery status from an external system | Business logic and automated actions may run on each write, causing side effects in other modules | Confirm which automated actions and access rules fire on create and write, and check the resulting records |
| Call a custom model method from a module | Running a multi-step business action such as confirming an order or reconciling a batch | Logic changes in the module can break the integration, and error handling depends on how the method is written | Confirm the method's input and return shape, its error messages, and that a repeat call does not duplicate work |
| One call per business action | Actions that must succeed or fail as a unit, such as creating an order with its lines | Each call commits on its own, so a failure midway can leave a partial record | Force a failure at each step and check which records remain, then decide how the integration cleans up or retries |
| Batched calls | Loading or syncing many similar records, such as a nightly product update | One bad record can fail a batch, and large batches increase timeouts and lock time | Start with small batches, time them on a copy, and check that a rerun of a failed batch is safe |
| Read-then-write sequences | Updating a record only when its current state matches what the integration expects | Another user or process may change the record between the read and the write | Simulate a concurrent change between the two calls and confirm the integration detects it |
Setting up the first authenticated JSON-2 call
This sequence takes a team from a plan that allows external API access to one verified read-only call, with a tested bad-key and wrong-database error path. Each step closes with a check, so the integration does not reach production until the basics behave as expected.
Confirm the plan and hosting allow API access
The owner of the Odoo subscription checks the plan and hosting type before any design work. Per Odoo's pricing page, external API access is included only in the Custom plan, so a Standard or One App Free subscription cannot make these calls. Confirm the hosting type too: Odoo Online, Odoo.sh and on-premise are each documented separately, and a self-hosted Community install has no Odoo subscription behind it. Done when the owner can name the plan, the hosting type and the Odoo version in writing, and the version matches the one whose /doc page you will read in a later step.
Create a dedicated integration user
An Odoo administrator creates a separate user for the integration, not a personal account or an existing admin. Give it only the access groups the first call needs, such as read rights on the one model you will query. Name the user so audit logs show which system acted. Done when the user can sign in to the interface, is not an administrator, and can open the records the test call will read, while being denied the models it should not touch.
Generate a bearer API key for that user
Sign in as the integration user, open the account security settings and create an API key. Store it in your secrets manager straight away, because the key value is shown only at creation. Record the key's name, the creation date and the expiry you chose, so rotation is scheduled rather than forgotten. Done when the key is stored under a name the team can find, and no copy of it exists in a ticket, chat or source repository.
Identify the target database and its name
Confirm the exact database name the integration must address. On Odoo Online and Odoo.sh, the database name is part of the instance address, and on-premise installs often run several databases on one server. The integration team writes the name into its configuration as a value, not a guess. Done when the database name is recorded next to the environment it belongs to, and someone other than the author has checked it against the Odoo database selector.
Read the /doc page for the installed version
Open the /doc page of the target database in a browser while signed in as the integration user. Use it to confirm the endpoint format, the database selection header and the ORM method names supported by that version, including search_read. Do not copy method names from older examples or from another database running a different version. Done when the team has written down the endpoint, the header name and the exact model and method pair for the first call, with the database and version noted beside them.
Run one read-only search_read on a duplicate
Make the first real request against a duplicate of the production database, not production itself. Use a single search_read on a small model with a small field list and a low record limit, sending the bearer key and the database header from the previous steps. Keep the call read-only, with no create, write or unlink. Done when the call returns a well-formed list of records and the team can match one returned record to the same record in the Odoo interface.
Check the bad key and wrong database errors
Repeat the same request twice on the duplicate: once with a deliberately wrong bearer key, and once with a database name that does not exist. Capture the status codes and error bodies each time, and store them with the test notes so the integration's error handling can be built against real responses. Done when both failures return a clear error rather than data, and the team has confirmed that a revoked or mistyped key is refused on the same endpoint used for the successful call.
Protecting API keys and limiting what a key can do
An API key carries the rights of the user it belongs to, so the security of a JSON-2 integration depends on the integration user's groups, record rules, storage and network path. The cards below cover the controls to set and the checks to run before the key goes into production.
Scope the integration user's access
Create a dedicated internal user for each integration and give it only the access groups its calls need. Odoo applies access rights per model and record rules per record, so a user with broad groups can read far more than the integration requires. Review the groups on the user form and confirm which models the integration actually touches. Grant rights per model, not per application.
Odoo on-premise docsLimit scope with record rules
Access rights decide whether a model can be read, but record rules decide which records. Add record rules to the integration user so that a call to search_read on a sales or partner model returns only the companies, teams or records the integration is meant to see. Test the rules with a sample call before go-live, because a missing rule usually fails silently by returning more data, not less.
Store keys outside code
Keep each API key in a secrets manager or the runtime's encrypted secret store, never in source code, configuration files committed to Git, or chat logs. Pass the key as a bearer token from the secret at call time and make sure build logs and error traces do not echo the Authorization header. Confirm with your security team which secrets platform the integration runtime is allowed to read from.
Plan rotation and revocation
Decide how long a key lives and who replaces it before the first key is issued. Check the key duration and rotation options available on your Odoo version and hosting type, and confirm them in the product documentation. Write a runbook that creates the new key, updates the secret, verifies a read call, and then revokes the old key, so a leaked key can be disabled without stopping the integration for long.
Audit which key made each call
Odoo records changes made through the ORM against the user who made them, so each integration should appear as its own user in the chatter and audit trail. Keep your reverse proxy and application logs for the JSON-2 endpoints, including timestamp, source address, database and response code, and correlate them with Odoo's record history. Confirm your retention period with the team that owns the logs.
Restrict network paths and test scope
Allow calls to the JSON-2 endpoints only from the systems that run the integration, using firewall rules or a reverse proxy allow list, and keep the database manager off public networks. After scoping is in place, run a test that uses the key against records outside its scope and confirm that Odoo returns no data and no write succeeds. Repeat this test after each upgrade or group change.
What a per-call transaction means for multi-step writes
Each JSON-2 call runs as its own transaction, so a sequence that creates a sales order, adds its lines and then confirms it can leave partial data behind if a later step fails. The first call may commit while the second fails, and nothing in the API rolls the earlier records back for you. Treat every multi-step write as a process that can stop at any point, and design the integration so that a rerun or a recovery job brings the database to a known state. Before building, confirm with your own version whether each call commits on success and what a failed call leaves behind.
That behavior forces three design choices. First, give every record a stable external identifier written at creation, so a retry can find what the previous attempt made instead of creating a duplicate. Second, define compensating steps for the cases you cannot avoid, such as cancelling or archiving an order whose lines never arrived, and record which step you are on so the compensation knows what to undo. Third, run reconciliation queries on a schedule that look for orders without lines, lines without parents and confirmed records missing expected fields. Place retries in the integration layer, with backoff and a cap, and retry only calls you have proven to be idempotent.
The sibling topic on migrating Odoo XML-RPC and JSON-RPC integrations to JSON-2 covers where transaction behavior differs from the older protocols, so read it before reusing code that depended on the old model. Do not rely on this page or on general assumptions for commit behavior. Check the exact semantics against the /doc page of each database you use, and prove them with tests that create a deliberately failing sequence on a duplicate database. Repeat those tests whenever you change Odoo version, because the behavior you verify on one release is the behavior you must confirm again on the next.
How the API setup differs on Odoo Online, Odoo.sh and on-premise
Odoo Online is hosted by Odoo, so Odoo sets the database address, the network path and the environments available for testing. Your team plans the integration around those settings and confirms them in writing before it configures any client.
- Database URL and network: Odoo provides the database address on its hosting. Confirm the address format and any allow-listing or private connectivity options with Odoo before you configure callers.
- Plan condition: External API access is listed only on the Custom plan, so confirm that the subscription includes it before you design calls. The Odoo pricing page lists the plan conditions.
- Test databases: Ask Odoo which test or duplicate database options your plan includes, how they are named and whether they can be refreshed from production.
- Upgrade dates: Major version upgrades are mandatory every two years on Odoo Online, and SaaS versions ship every two to three months without extended support, so regression test API calls after each update.
- Support window: Standard support covers the first three years after a major release on Odoo Online, including security updates and bug fixes.
Before building, confirm the plan, the test database options and the update calendar for your database with Odoo in writing.
Odoo.sh hosts the database on Odoo's platform, so Odoo controls the server layer and the database address. Your team designs the API work around the environments Odoo provides and confirms how data moves between them before any endpoint is fixed in code.
- Database URL and network: Odoo controls the server layer. Confirm the address, the environment naming and any network restrictions that apply to calls from your systems.
- Plan condition: Odoo.sh is available on the Custom plan, which is also the plan that includes external API access, so confirm both before you build.
- Test environments: Confirm with Odoo how test environments are created, how production data is copied into them and whether those copies contain personal data that needs handling.
- Upgrade dates: Major upgrades are mandatory every two years on Odoo.sh. Extended support is available for select versions on Odoo.sh, so check which versions qualify and when standard support ends for yours.
- Patching: Security patches are provided only during standard support, so schedule the upgrade and the API regression tests before that window closes.
Before you fix endpoints, confirm the environment list, the copy process and the version support dates with Odoo.
With on-premise Odoo, your team controls the server, the network path and the database address, usually through its own DNS and reverse proxy. Enterprise databases are activated by entering the subscription code, and the upgrade service and extended support depend on that subscription.
- Database URL and network: Your team sets the address, TLS and firewall rules, so those controls must be designed, tested and documented as part of the integration.
- Plan and subscription: Enterprise databases are activated with the subscription code. External API access requires the Custom plan, so confirm both conditions with Odoo.
- Test copies: Odoo documents database duplication with neutralization for test copies. Duplicate before each API change and confirm what neutralization disables in your version, such as outgoing mail or scheduled actions.
- Upgrade dates: The upgrade service requires an Enterprise subscription. Standard support covers three years after a major release, and extended support is available for select versions.
- Operations: Your team applies updates and restarts services, so schedule regression tests for API calls with each update window.
Before you plan the cutover, confirm the subscription, the upgrade service entitlement and the support dates for your version with Odoo.
Odoo Community is licensed under LGPL-3.0 and runs on infrastructure your team controls. Odoo's hosted plans and the Enterprise upgrade service do not apply, so your team owns the database address, the test copies and the upgrade path.
- Database URL and network: Your team sets the address, TLS and firewall rules, as it would for on-premise, and documents them with the integration.
- Plan condition: The Custom plan requirement for external API access appears on Odoo's pricing page for its hosted offerings. Confirm with Odoo how external API access applies to Community before you rely on it.
- Test copies: Duplicate the database with your own process and confirm the neutralization steps for your version before connecting any test system to live services.
- Upgrade path: The Enterprise upgrade service is not available to Community, so plan migrations with your own tooling and test each step on a copy.
- Support position: The standard and extended support windows are published for Odoo's offerings. Confirm with Odoo whether and how they apply to your Community release.
Before choosing this model, confirm the API availability question and the support position for your Community version in writing.
Limits to confirm in your environment before you build
Odoo's API surface, deprecation dates and hosting rules depend on the exact version and plan you run. The cards below list what to confirm on your own installation before you write any code, so the design reflects your environment rather than general assumptions.
Endpoints and method signatures
Confirm the exact JSON-2 endpoints, model names and method signatures on the /doc page of your own database, not on a generic example. The page reflects the installed version, and parameters for calls such as search_read can differ between releases. Record the version and the date you checked, and re-check after every upgrade. Treat any signature copied from a blog post or older documentation as unverified until it matches your /doc page.
Odoo upgrade docsXML-RPC and JSON-RPC removal timing
Confirm when XML-RPC and JSON-RPC stop working for the version and hosting type you run, because the removal date is tied to the release line, not to your calendar. List every existing integration that uses them before setting a migration deadline. A migration date set from a release note you have not checked is the most common planning error. Ask Odoo or your partner to confirm the removal release for your hosting in writing before you commit a cutover window.
Hosting rate and payload limits
Confirm any request rate, payload size, timeout or worker limits applied by your hosting, reverse proxy or load balancer. These limits sit in front of Odoo and can reject large search_read calls or bulk writes even when the API itself accepts them. Ask your host for the documented values and test your heaviest call on a duplicate database. Retries from an integration can multiply load, so agree the limits before the integration goes live.
Standard support window for your release
Confirm the standard support end date for the Odoo release you run, because security updates for the API layer stop when standard support ends. Odoo's support documentation sets these windows per major release, and extended support is limited to Odoo.sh for select versions and on-premise. Map the end date against your integration's expected lifetime, and plan the next upgrade before the window closes rather than after.
Odoo support docsAPI behavior across Odoo Online upgrades
Confirm how your integration behaves when Odoo Online applies its mandatory major upgrades, which occur every two years on Odoo Online and Odoo.sh. Check whether method signatures, field names and API key behavior change between versions, and whether your test database is upgraded before production. Run your regression tests against the upgraded test copy as part of every upgrade cycle, not only when a failure appears.
Upgrade documentationPlan, modules and access rights
Confirm that your plan allows external API access and that the models and modules your calls depend on are installed and licensed. Odoo's pricing page ties external API access and custom modules to the Custom plan, so an integration built on a lower plan may not work at all. Also confirm that the integration user holds the access rights needed for each model, since a missing group returns errors that look like code faults.
Odoo pricingWhat teams ask before building on the JSON-2 API
What drives the cost of an Odoo JSON-2 integration?
The main drivers are how many Odoo models the integration touches, how many external systems it talks to, and how many business rules must be reproduced on the Odoo side. A read-only report pull is a small job. A two-way sync of orders, stock and invoices, with error handling and reconciliation, is a much larger one. Cost usually splits into design, build, testing against a duplicate database, deployment and monitoring after go-live. Recurring costs come from maintenance, credential rotation and the retesting that each Odoo version change requires. Ask for a written scope that lists each entity, the direction of data flow, error and retry rules, test cases and who owns the credentials.
How long does a first working JSON-2 integration usually take?
No fixed duration applies, because the answer depends on scope. A single read call against one model can be prototyped quickly, while a production integration that writes data, handles failures and passes business testing takes considerably longer. The drivers are access to a non-production database, the number of models and fields involved, the availability of process owners to confirm rules, and how much existing data needs cleaning. Internal access approvals often set the pace more than the code does. Ask for a timeline tied to milestones: prototype, test database run, business sign-off and production cutover.
Can our internal developers build a JSON-2 integration without a partner?
Yes, if the team has experience with HTTPS APIs, access to Odoo's API documentation for its exact version and a test database. JSON-2 uses bearer authentication over plain HTTP requests, so the transport is rarely the hard part. The difficulty lies in understanding the Odoo data model, access rights, per-call transaction behavior and how each upgrade changes results. Teams usually need someone who knows the business processes and an owner for credentials and monitoring. A partner adds the most value when the team lacks Odoo model experience, when timelines are tight, or when the design must pass a security review before production. Decide by listing the skills the scope requires and comparing them with what the team already has.
What does the business need to provide for an integration project?
The business side makes most of the decisions that code cannot make. Plan for:
- Process owners who can state which records should sync, in which direction, and what happens when two systems disagree.
- Test data that covers normal cases and the awkward ones, such as partial shipments, refunds and duplicate customers.
- A duplicate database, created from production and neutralized, so writes can be tested without touching live records.
Name a business approver for each data flow as well. Without these inputs, testing stalls and the build team guesses at rules. Ask the partner to list the duplicate database step and the data sign-off as named deliverables in the written scope.
How do Odoo upgrades affect an existing JSON-2 integration?
Upgrades can change model fields, method behavior, access rules and default values, so an integration that worked on one version needs retesting on the next. Odoo standard support covers the first three years after a major release, and the upgrade documentation describes moving a database through an upgraded test copy that should be tested before production. On Odoo Online and Odoo.sh, major version upgrades are mandatory every two years, and SaaS versions arrive every two to three months. Keep a regression suite of API calls, run it on the upgraded test database each cycle, and treat fixes as planned work. Ask for upgrade testing to appear as a named, recurring line in the scope or retainer.
Does Odoo's Custom plan change whether we should build this integration?
Yes, the plan is a gating question before design starts. According to Odoo's pricing page, only the Custom plan includes external API access, and only Custom can be hosted on Odoo.sh or on-premise. An integration over JSON-2 therefore depends on a Custom subscription, and the per-user prices and yearly discount on that page drive the recurring cost. Check the current figures on the pricing page rather than relying on older quotes. Self-hosted Community is a separate case, so confirm which edition and hosting your environment uses. Ask the partner to state in writing which plan, hosting type and edition the scope assumes.
Who should own the API keys and the integration user?
A dedicated integration user should own the key, with only the access rights the integration needs. Named ownership matters because keys carry the permissions of the user they belong to, and an integration that runs under a person's account breaks when that person leaves. Store keys in a managed secrets store, record who created each key and for what purpose, and plan rotation and revocation before go-live. Security review should cover the user's groups, record rules and the logs that show which key made which call. Ask the partner to deliver a credential register and a rotation procedure as part of the scope, and confirm with your security team which storage system they will accept.
How DeployOpen scopes and supports Odoo API integrations
DeployOpen treats Odoo JSON-2 API work as a defined integration scope: which Odoo database, which API key and bot user, which ORM methods and which transaction boundaries. We agree that scope in writing, build and test it against a duplicate database, then hand over the code, configuration and runbook so your team can operate it.
How we scope
- Inventory every system calling Odoo and the model and method each call uses, such as search_read or create.
- Confirm the Odoo plan and hosting type allow external API access before the design is fixed.
- Agree in writing which databases, bot users, API key lifetimes and error handling rules are in scope.
How we build
- Create dedicated integration users with minimum rights and API keys stored in your secrets manager, not in code.
- Write JSON-2 requests with database selection headers and bearer keys, and test each ORM call on a duplicate database.
- Design per-call transactions and handle error responses with retries that do not duplicate records.
How we hand over
- Deliver source code, configuration, and a record of each endpoint, method and permission the integration uses.
- Document the /doc page for each database that your developers should use as the reference for available methods.
- Walk your engineers through key rotation, revocation and the audit steps for finding which key made a change.
How we support
- Offer ongoing support and continuous testing as a retainer, with the scope and response terms agreed in writing.
- Retest the integration after each Odoo upgrade or change to the API surface before it reaches production.
- Plan the move off XML-RPC and JSON-RPC alongside your Odoo upgrade schedule so deadlines are not missed.

