Actions28
Overview
The "Update Contract" operation in this Dolibarr node allows users to modify existing contract records within the Dolibarr ERP system via its API. This is useful for keeping contract information up-to-date, such as changing customer or vendor references, updating sales representatives involved, adjusting contract dates, or adding notes.
Typical use cases include:
- Automatically updating contract details when related customer or vendor data changes.
- Assigning or reassigning sales representatives responsible for contract follow-up or signing.
- Adding internal notes or public remarks to contracts programmatically.
- Managing extra custom fields on contracts that are specific to a business's needs.
For example, a user could update the "Ref Customer" and "Date" fields of a contract after receiving new information from a CRM system, ensuring all systems stay synchronized.
Properties
| Name | Meaning |
|---|---|
| Contract ID | The unique numeric identifier of the contract to update (required). |
| Values | Collection of fields to update on the contract: |
| - Ref Customer | Reference string identifying the customer linked to the contract. |
| - Ref Vendor | Reference string identifying the vendor linked to the contract. |
| - Third-Party Name or ID | Identifier for a third-party entity, selectable by list, URL, or direct ID input. |
| - Sales representative following-up contract | User responsible for contract follow-up, selectable by list, URL, or direct ID input. |
| - Sales representative signing contract | User responsible for signing the contract, selectable by list, URL, or direct ID input. |
| - Date | Contract date/time value. |
| - Public Note | A note visible publicly related to the contract. |
| - Private Note | An internal note not visible publicly. |
| Extra Fields | Multiple custom attribute fields with name-value pairs for additional contract metadata. |
| Fields | Other contract fields available for assignment (generic collection). |
Output
The node outputs the full HTTP response from the Dolibarr API after attempting to update the contract. The main output is JSON containing the updated contract data or error details if the update failed.
If the API supports binary data for contracts (e.g., attached files), it would be included in the binary output, but this operation primarily deals with JSON data updates.
Dependencies
- Requires an active connection to a Dolibarr instance with API access enabled.
- Needs an API key credential configured in n8n for authentication.
- The base URL of the Dolibarr API must be set correctly in the credentials.
- The node uses Dolibarr API endpoints under
/contracts/{contractID}for updates.
Troubleshooting
- Invalid Contract ID: If the provided Contract ID does not exist, the API will return an error. Verify the ID is correct and exists in Dolibarr.
- Authentication Errors: Ensure the API key credential is valid and has sufficient permissions to update contracts.
- Validation Errors: Input fields like URLs or IDs for third parties and users have regex validations; incorrect formats will cause errors.
- Missing Required Fields: Contract ID is mandatory; omitting it will prevent the request.
- API Endpoint Issues: Confirm the base URL and API path are correct and accessible from n8n.
- Extra Fields Misconfiguration: Custom attributes must match Dolibarr’s extra field definitions; otherwise, they may be ignored or cause errors.