Odoo icon

Odoo

Consume Odoo API

Contact → Create

AI-generated

Overview

This node allows you to create a new Contact in an Odoo system via its API. It is useful for automating the addition of contacts (such as customers, vendors, or partners) directly from n8n workflows. Common scenarios include syncing contacts from other systems (like CRMs or web forms), batch importing contact data, or integrating with marketing and sales automation processes.

Example use cases:

  • Automatically add new leads from a website form into Odoo as contacts.
  • Sync contacts from another CRM to Odoo.
  • Enrich contact records in Odoo with additional information collected elsewhere.

Properties

Name Meaning
Name The name of the contact. This is a required field.
Additional Fields A collection of optional fields to further describe the contact. Options include:
- Address: Structured address details (City, Country, State, Street, Street 2, Zip Code).
- Email
- Internal Notes
- Job Position
- Mobile
- Phone
- Tax ID
- Website

Address Subfields (within Additional Fields > Address)

  • City: City name.
  • Country Name or ID: Select from list or specify country ID.
  • State Name or ID: Select from list or specify state ID.
  • 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 in the request, plus any additional fields returned by Odoo (such as the unique contact ID and possibly default values set by Odoo).

Example output:

{
  "id": 123,
  "name": "John Doe",
  "email": "john@example.com",
  "phone": "+1234567890",
  "city": "New York",
  "country_id": 1,
  // ...other fields as provided or set 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 instance: You must have access to an Odoo server with API access enabled.
  • API Credentials: Requires an n8n credential named odooApi with the following:
    • URL (Odoo server endpoint)
    • Database name
    • Username
    • Password

No additional environment variables are required beyond standard n8n credential configuration.

Troubleshooting

Common issues:

  • Invalid credentials: If the Odoo API credentials are incorrect, authentication will fail. Error messages such as "Credentials are not valid" or "Settings are not valid" may appear.
    • Resolution: Double-check your Odoo URL, database name, username, and password.
  • Missing required fields: If the "Name" property is not provided, the node will throw an error.
    • Resolution: Ensure all required fields are filled.
  • Field value errors: Providing invalid IDs for country or state may result in Odoo rejecting the request.
    • Resolution: Use the dropdowns or ensure IDs are correct.

Error handling:

  • If "Continue On Fail" is enabled, errors for individual items will be output as { "error": "Error message" } in the results.

Links and References

Discussion