Comercia icon

Comercia

Acciones para Comercia.io

Overview

This node integrates with Comercia.io to perform various operations related to customer and sales management. Specifically, the "Crear cliente" (Create client) operation allows users to create a new customer account in Comercia.io by providing detailed customer information, fiscal data, store configuration, shipping options, and additional metadata.

This node is beneficial for automating customer onboarding processes, syncing customer data from other systems, or integrating Comercia.io customer creation into broader workflows such as CRM updates or e-commerce order processing.

Practical example:
A business using n8n can automate the creation of new clients in Comercia.io whenever a new lead is captured via a web form, ensuring that all relevant customer details and fiscal information are correctly registered without manual entry.

Properties

Name Meaning
Información del Cliente Notice section introducing the customer information inputs.
Nombre del Cliente Customer or account name in Comercia. Required.
Nombre (Persona) First name of the contact person.
Apellidos Last name(s) of the contact person.
Teléfono principal Primary phone number of the customer.
Correo electrónico principal Primary email address of the customer.
Usuario Asignado Assigned user for the account. Options loaded dynamically from available users.
Lista de Precios Price list to assign to the customer. Options loaded dynamically from available price books.
Descripción Description or notes about the customer.
Datos Fiscales Para Facturación Notice section introducing fiscal data fields for billing.
Razón Social Legal business name (corporate name).
RFC Tax identification code.
CP del RFC Postal code associated with the tax registration.
Régimen Fiscal Fiscal regime ID or key.
Método de Pago Payment method. Options: "PUE
Forma de Pago Payment form. Multiple predefined options such as "01
Uso de CFDI Usage of the digital tax receipt. Multiple predefined options like "S01
Configuración en Tienda Notice section introducing store configuration fields.
Contraseña Tienda Store password (hidden input).
Tipo Pub.General Boolean flag indicating general public type.
Envíos Disponibles Multiple selectable shipping methods. Options include "Skydropx", "Envio gratuito", "Recoger en tienda", "Lalamove", etc.
Información Adicional Notice section introducing additional information fields.
Dirección de Facturación Predeterminada Default billing address. Options loaded dynamically from available addresses.
Dirección de Envío Predeterminada Default shipping address. Options loaded dynamically from available addresses.
Carrito Predeterminado (TPV) Default shopping cart (point of sale). Options loaded dynamically from available quotes.
Límite de Crédito Credit limit amount (number).
Días de Crédito Number of credit days allowed (number).
Tarjeta de Puntos Points card number.
Tipo de Afiliado Affiliate type. Options loaded dynamically from affiliate types.
Referido por Referral source. Options loaded dynamically from referrals.
Datos de Campaña Campaign data string.
Suscrito a Mercadotecnia Boolean flag indicating subscription to marketing. Defaults to true.
No Enviar Correos Boolean flag to opt out of sending emails.
Notificar al Propietario Boolean flag to notify the owner.
Timbre NdC Pendiente Pending note or stamp text (multi-line string).
ID Plantilla Adenda Addendum template ID string.
Cuenta STP STP account selection. Options loaded dynamically from available accounts.

Output

The node outputs JSON objects representing the response from Comercia.io after attempting to create a client. The output JSON includes all data returned by the API plus an added _metadata field containing:

  • operation: The operation performed, here always "createClient".
  • timestamp: ISO timestamp of when the operation was executed.

Example output structure:

{
  "id": "12345",
  "accountname": "Cliente Ejemplo",
  "assigned_user_id": "1",
  ...
  "_metadata": {
    "operation": "createClient",
    "timestamp": "2024-06-01T12:00:00.000Z"
  }
}

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for Comercia.io with at least permissions to create accounts.
  • The node uses HTTP requests to the Comercia.io REST API endpoints.
  • Dynamic option loading depends on additional API calls to fetch users, price books, addresses, affiliates, referrals, and other related entities.
  • Proper configuration of the base URL and API key in credentials is necessary.

Troubleshooting

  • Error parsing products JSON (not applicable here but similar pattern): If JSON input fields are malformed, the node throws parse errors. Ensure JSON strings are valid arrays or objects as expected.
  • API request failures: Network issues, invalid API keys, or permission problems will cause HTTP request errors. Verify credentials and network connectivity.
  • Missing required fields: The "Nombre del Cliente" (accountname) is required; omitting it will likely cause API validation errors.
  • Empty optional fields: Optional parameters are only sent if provided and non-empty, so ensure required data is filled.
  • Continue on Fail: If enabled, the node will continue processing subsequent items even if one fails, returning error messages in the output JSON.

Links and References

Discussion