Comercia icon

Comercia

Acciones para Comercia.io

Overview

This node integrates with Comercia.io to perform various operations related to sales, clients, addresses, and modules. Specifically, the "Crear Venta" (Create Sale) operation allows users to create a new sales order in Comercia.io by specifying details such as the sale subject, client, date, status, description, and products involved.

Typical use cases include automating the creation of sales orders from external systems or workflows, managing customer purchases programmatically, and integrating sales data into broader business processes.

For example, a user can input a list of products sold along with quantities and discounts, associate the sale with an existing client, and set the sale date and status, all within an automated workflow.

Properties

Name Meaning
Subject The subject or title of the sale.
Buscar Cliente Search term to find the client by name.
Cliente Select a client from the search results.
Fecha de Venta Date of the sale in YYYY-MM-DD format.
Estado Status of the sale. Options: "Creado" (Created), "Apartado" (Approved), "Autorizado" (Delivered).
Description Additional notes or description for the sale.
Products (JSON) JSON array describing products included in the sale. Each product includes quantity, SKU, product ID, unit price, discount percentage, and comment.

Output

The node outputs a JSON object representing the response from Comercia.io after creating the sale. This includes all details returned by the API about the newly created sales order.

Additionally, the output JSON contains a _metadata field with:

  • operation: The string "createSale" indicating the performed operation.
  • timestamp: ISO timestamp of when the operation was executed.

No binary data is produced by this node.

Example output structure (simplified):

{
  "id": "12345",
  "subject": "Order #001",
  "account_id": "67890",
  "fecha_venta": "2024-06-01",
  "sostatus": "Created",
  "description": "First sale",
  "products": [
    {
      "quantity": 4,
      "sku": "series-s",
      "productid": 55453,
      "pu": 5000,
      "discount_percent": 0,
      "comment": "Ejemplo 1: Xbox"
    }
  ],
  "_metadata": {
    "operation": "createSale",
    "timestamp": "2024-06-10T12:00:00.000Z"
  }
}

Dependencies

  • Requires an active connection to Comercia.io via an API key credential.
  • The node uses the base URL and API key configured in the credentials to authenticate requests.
  • No additional external dependencies are required beyond the Comercia.io API access.

Troubleshooting

  • Error parsing Products JSON:
    If the "Products (JSON)" input is not a valid JSON array, the node will throw an error:
    Error al parsear el JSON de productos: ...
    Resolution: Ensure the JSON is correctly formatted as an array of product objects.

  • Missing required fields:
    The node requires certain fields like Subject, Cliente (client), Fecha de Venta (sale date), Estado (status), and Products JSON. Omitting these will cause errors or failed requests.
    Resolution: Provide all required inputs before execution.

  • API request failures:
    Network issues, invalid API keys, or incorrect base URLs may cause request failures.
    Resolution: Verify API credentials and network connectivity.

  • Continue on Fail:
    If enabled, the node will continue processing subsequent items even if one fails, returning error details in the output JSON.

Links and References

Discussion