Actions28
Overview
This node operation allows you to create a new line item within an existing contract in Dolibarr, a popular ERP/CRM system. It is useful when you want to programmatically add products or services to a contract, specifying details such as description, pricing, quantity, tax, and scheduling.
Common scenarios include:
- Automating contract management workflows by adding contract lines based on external triggers.
- Integrating Dolibarr contracts with other systems like e-commerce platforms or inventory management.
- Bulk creation of contract lines from data sources without manual entry.
For example, you might use this node to add a service line to a maintenance contract with a specified start and end date, unit price, and applicable tax rate.
Properties
Name | Meaning |
---|---|
Contract ID | The unique identifier of the contract to which the line will be added. |
Description | A textual description of the product or service for this contract line. |
Product or Service ID | The identifier of the product or service being added to the contract line. |
Sales Tax (%) | The percentage rate of sales tax (TVA) applied to this line. |
Tax | Specifies whether the unit price includes tax ("Incl Tax") or excludes tax ("Excl Tax"). |
Unit Price | The price per unit for the product or service. |
Quantity | The number of units for this contract line. |
Discount (%) | Percentage discount applied to the line (not affecting the unit price). |
Planned Start Date | Scheduled start date for the contract line (optional). |
Planned End Date | Scheduled end date for the contract line (optional). |
Extra Fields | Additional custom attributes that can be set on the contract line via key-value pairs. |
Fields | Other miscellaneous contract fields that can be assigned (advanced usage). |
Output
The node outputs the full HTTP response from the Dolibarr API after creating the contract line. The main output is a JSON object representing the newly created contract line resource, including its ID and all properties as stored in Dolibarr.
If the API supports binary data for contract lines (e.g., attachments), it would be included accordingly, but this operation primarily deals with JSON data.
Dependencies
- Requires access to a Dolibarr instance with API enabled.
- Needs an API authentication token or key configured in n8n credentials to authorize requests.
- The base URL of the Dolibarr API must be correctly set in the node credentials.
- The user must have permissions to create contract lines in Dolibarr.
Troubleshooting
- Missing or invalid Contract ID: Ensure the Contract ID provided exists and is valid; otherwise, the API will reject the request.
- Invalid tax or price values: Tax rates must be between 0 and 100; prices should be positive numbers. Incorrect values may cause errors.
- Authentication errors: Verify that the API key or token is correct and has sufficient permissions.
- API endpoint errors (404, 400): Check that the contract resource and lines endpoint are accessible and that the URL is correctly constructed.
- Date format issues: Dates must be in ISO 8601 format; invalid dates may cause the API to reject the request.
- Discount not applying as expected: The discount percentage does not affect the unit price directly; it is applied separately.