Actions28
Overview
This node integrates with the Dolibarr API to create a new line item within an existing contract. It is useful in scenarios where you need to programmatically add detailed entries such as products or services to contracts managed in Dolibarr, for example, when automating sales workflows or updating contract details based on external triggers.
Practical examples include:
- Adding a new product line to a contract after a customer places an order.
- Inserting service details into a contract when a new service agreement is signed.
- Automating contract updates with pricing, tax, and scheduling information.
Properties
| Name | Meaning |
|---|---|
| Contract ID | The unique identifier of the contract to which the line will be added (required). |
| Description | A textual description of the product or service for this contract line (required). |
| Product or Service ID | Identifier of the product or service associated with this line item. |
| 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 before or after tax depending on the "Tax" property. |
| Quantity | Number of units for this line item (default is 1, required). |
| Discount (%) | Percentage discount applied to the line (does not affect 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 response from the Dolibarr API after creating the contract line. This typically includes the newly created line's data such as its ID, description, pricing, quantities, and any other metadata returned by the API.
If the API supports it, binary data could be included, but this node primarily deals with JSON data representing contract line details.
Dependencies
- Requires an active Dolibarr API connection configured with a valid base URL and an API authentication token.
- The node depends on the Dolibarr API endpoint
/contracts/{contractID}/linesto create contract lines. - Proper permissions on the Dolibarr instance to create and modify contract lines are necessary.
Troubleshooting
- Invalid Contract ID: If the provided contract ID does not exist or is incorrect, the API will return an error. Verify the contract ID before running the node.
- Missing Required Fields: Ensure all required properties like Contract ID, Description, and Quantity are provided; otherwise, the request will fail.
- Tax Calculation Errors: Incorrect combinations of "Tax", "Unit Price", and "Sales Tax (%)" may lead to unexpected pricing. Double-check the logic for price HT (excluding tax) and TTC (including tax).
- API Authentication Issues: If the API credentials are invalid or expired, the node will fail to connect. Refresh or update the API key/token.
- Extra Fields Misconfiguration: When using extra fields, ensure field names match those defined in Dolibarr to avoid errors.
Links and References
- Dolibarr Official API Documentation
- Dolibarr Contracts Module
- n8n Documentation on HTTP Request Node (for understanding API calls)
This summary is based solely on static analysis of the provided source code and property definitions without runtime execution.