Skip to content

JSON-2 API

JSON-2 is the recommended external API for new Odoo 19 integrations. Each request calls one public method on one model.

POST /json/2/<model>/<method>

Request anatomy

POST /json/2/res.partner/search_read HTTP/1.1
Host: accountify.solutions
Authorization: bearer <API_KEY>
X-Odoo-Database: accountify_v19_clone_21.06.2026
Content-Type: application/json; charset=utf-8
User-Agent: accountify-integration/1.0

{
  "context": {"lang": "en_US"},
  "domain": [["is_company", "=", true]],
  "fields": ["name", "email"],
  "limit": 20
}

All method arguments are named properties in the request body. Record methods receive an ids property. Model methods such as search_read do not.

Response anatomy

Successful calls return the method result directly as JSON with HTTP 200. Errors return an HTTP 4xx or 5xx status and an object containing exception name, message, arguments, context, and potentially a debug traceback.

Use the HTTP status first, then parse the JSON body. Never assume every response is a JSON-RPC envelope with a result property.

Transaction boundary

One JSON-2 request is one database transaction. Odoo commits on success and rolls back on failure. Separate HTTP requests cannot be made atomic together.

When a workflow must read, validate, and update atomically, expose a reviewed server-side method that performs the complete operation in one call. This is particularly important for accounting mutations and reconciliation.

API stability

Model methods and their parameters can change with installed modules and upgrades. The official Odoo guidance recommends exposing a dedicated integration method when long-term stability matters, rather than coupling an external system to many internal calls.

See the official Odoo 19 JSON-2 API reference.