Odoo icon

Odoo

Consume Odoo API

Overview

This node allows you to create a new Contact in an Odoo system via its API. It is useful for automating the process of adding contacts, such as customers or leads, directly from n8n workflows into your Odoo CRM or ERP instance. Typical scenarios include syncing contacts from other systems (like web forms, marketing tools, or spreadsheets) into Odoo, or enriching contact data during automated business processes.

Example use cases:

  • Automatically add new website signups as contacts in Odoo.
  • Sync contacts from a Google Sheet or another CRM into Odoo.
  • Enrich and update contact information as part of a lead management workflow.

Properties

Name Meaning
Name The name of the contact. Required.
Additional Fields Optional extra fields to set on the contact. Includes:
- Address: (City, Country Name or ID, State Name or ID, Street, Street 2, Zip Code)
- Email
- Internal Notes
- Job Position
- Mobile
- Phone
- Tax ID
- Website

Address Field Options

  • City: City name.
  • Country Name or ID: Select from list or specify an ID (supports expressions).
  • State Name or ID: Select from list or specify an ID (supports expressions).
  • Street: Street address.
  • Street 2: Additional street info.
  • Zip Code: Postal code.

Output

The output will be a JSON object representing the newly created contact in Odoo. The structure typically includes all fields sent to Odoo plus any additional fields returned by the Odoo API, such as the unique contact ID and possibly default values set by Odoo.

Example output:

{
  "id": 123,
  "name": "John Doe",
  "email": "[email protected]",
  "phone": "+1234567890",
  "city": "New York",
  "country_id": 1,
  // ...other fields as provided or returned by Odoo
}

If an error occurs and "Continue On Fail" is enabled, the output will contain an error field with the error message.

Dependencies

  • Odoo API: Requires access to an Odoo instance with API credentials (URL, username, password, database name).
  • n8n Credentials: You must configure Odoo API credentials in n8n under the name odooApi.

Troubleshooting

Common Issues:

  • Invalid Credentials: If the Odoo API credentials are incorrect, authentication will fail.
  • Missing Required Fields: The "Name" property is required; omitting it will cause an error.
  • Field Value Errors: Providing invalid IDs for country or state may result in errors from Odoo.
  • Connection Issues: Network problems or incorrect Odoo URL can prevent successful API calls.

Error Messages:

  • "Credentials are not valid": Check your Odoo API credentials (URL, username, password, database).
  • "Settings are not valid: ...": There may be a configuration issue; verify all credential fields.
  • "error": "<message>" in output: Indicates an error occurred for that item; review the message for details.

Links and References

Discussion