Dolibarr icon

Dolibarr

Interact with Dolibarr API

Contracts → Create

AI-generated

Overview

This node operation creates a new contract in the Dolibarr system. It is useful for automating contract management workflows by programmatically adding contract records with detailed information such as customer and vendor references, associated third-party entities, sales representatives involved, contract date, notes, and any extra custom fields. For example, it can be used in a sales automation process to create contracts immediately after a deal is closed, ensuring all relevant contract data is captured and stored in Dolibarr.

Use Case Examples

  1. Automatically create a contract in Dolibarr when a new deal is closed in a CRM system.
  2. Add contracts with detailed sales representative and third-party information for record-keeping and follow-up.
  3. Batch create multiple contracts with custom extra fields and notes for bulk onboarding processes.

Properties

Name Meaning
Ref Customer Reference identifier for the customer associated with the contract.
Ref Vendor Reference identifier for the vendor or supplier associated with the contract.
Third-Party Name or ID Identifier or name of the third-party entity related to the contract, selectable from a list, by URL, or by ID.
Sales representative following-up contract User responsible for following up on the contract, selectable from a list, by URL, or by ID.
Sales representative signing contract User responsible for signing the contract, selectable from a list, by URL, or by ID.
Date The date and time when the contract is created or effective.
Notes Public and private notes related to the contract for additional information or comments.
Extra Fields Custom attribute fields for the contract, allowing additional data to be sent with the request.
Fields Other contract fields that can be assigned dynamically.

Output

JSON

  • id - The unique identifier of the created contract.
  • ref_customer - Reference customer identifier sent in the request.
  • ref_supplier - Reference vendor or supplier identifier sent in the request.
  • socid - Third-party ID associated with the contract.
  • commercial_suivi_id - ID of the sales representative following up the contract.
  • commercial_signature_id - ID of the sales representative signing the contract.
  • date_contrat - Date of the contract.
  • note_public - Public note content.
  • note_private - Private note content.
  • extraFields - Custom extra fields sent with the contract.

Dependencies

  • Dolibarr API with authentication credentials

Troubleshooting

  • Ensure all required fields such as 'Third-Party Name or ID', 'Sales representative following-up contract', 'Sales representative signing contract', and 'Date' are provided to avoid validation errors.
  • Check the format of URLs provided for resource locators to match expected patterns, e.g., URLs must contain 'societe/card.php?socid=' for third parties and 'user/card.php?id=' for users.
  • If the API returns 404 errors during searches, verify that the search filters and pagination tokens are correctly set and that the referenced entities exist in Dolibarr.
  • Timeouts or SSL errors can occur if the server is unreachable or has invalid certificates; use the request options to adjust timeout or allow unauthorized certificates if necessary.

Discussion