Ditextil Inventory

Operaciones completas para la API de inventario Ditextil

🛒 Venta → Cancelar Venta / Devolución

AI-generated

Summary

Cancels an existing sales order (or processes a return) in the Ditextil inventory system by sending a POST to /api/orders/sales/{id}/cancel with a reason and actor.

Inputs

  • ID Orden Venta (saleOrderId) (required) — Numeric ID of the sales order to cancel. It is inserted into the endpoint path.
  • Motivo Cancelación (reason) — Free-text reason sent in the request body. Defaults to 'Cancelación / devolución desde n8n'.
  • Actor (actor) — Name recorded as the user or system performing the cancellation. Defaults to 'n8n'.

Output shape

The JSON response from the Ditextil API for the cancellation. It is emitted as one item per response object, or one item per element if the API returns an array. Each item is linked to its input item.

The node doesn't define the response fields, so they depend on the API. The operation runs once per input item. With 'Continue On Fail' enabled, a failed item returns {error: message} instead of stopping the workflow. Credentials (ditextilApi) with a base URL are required. Stock movements likely appear with reference type 'sale_cancellation' (listed in the Movement filter), but the node source doesn't confirm this.

Examples

Example 1: Cancel a sale when a customer requests a return

Resource: Venta; Operation: Cancelar Venta / Devolución; ID Orden Venta: {{$json.orderId}}; Motivo: 'Cliente devolvió mercancía'; Actor: 'n8n'.

Example 2: Cancel an order from a chat or approval workflow

ID Orden Venta mapped from the incoming webhook; Motivo from an expression; Actor set to the approver's name.

Links

Discussion