Actions7
Crear Venta
AI-generatedSummary
Creates a Comercia sales order for a selected client by POSTing the sale details and product lines to the SalesOrder endpoint. Requires a subject, client, sale date, status, and a JSON array of products; the description is optional.
Inputs
- Authentication (required) — Choose Comercia Key (default) or OAuth2 and provide the matching credentials.
- Subject (required) — Sale title or subject.
- Buscar Cliente — Search term used to load clients. Enter at least three characters; the client list is fetched when this value changes.
- Cliente (required) — Select a client from the search results. Sent as account_id.
- Fecha de Venta (required) — Sale date, in YYYY-MM-DD format.
- Estado (required) — Sale status: Creado (Created, default), Apartado (Approved), or Autorizado (Delivered).
- Description — Additional note or description for the sale.
- Products (JSON) (required) — A JSON array of product lines. The examples use quantity, sku, productid, pu, discount_percent, and comment; the value must parse as an array.
Output shape
One n8n output item per input item, containing the Comercia response fields and an _metadata object.
The node sends a POST request to /comercia_ws/SalesOrder with the sale fields and products array. _metadata includes operation (createSale) and a timestamp. Invalid product JSON or a non-array value raises an error; with Continue On Fail enabled, the item instead contains error and timestamp fields.