Chuyển Kho KiotViet icon

Chuyển Kho KiotViet

Quản lý chuyển kho và tồn kho từ KiotViet

Overview

This node manages warehouse transfer records in the KiotViet system. It allows users to create, retrieve, update, list, and delete transfer orders between branches. This is useful for businesses that operate multiple warehouses or store locations and need to track inventory movements accurately.

Common scenarios include:

  • Creating a new transfer order when stock is moved from one branch to another.
  • Retrieving details of a specific transfer by its ID.
  • Updating an existing transfer order with new information or product quantities.
  • Listing all transfers with optional filters such as date ranges, status, or branch IDs.
  • Deleting a transfer record if it was created in error or is no longer needed.

Practical example: A retail chain wants to move products from their central warehouse to a local store. They can use this node to create a transfer order specifying the sending and receiving branches, products involved, and quantities. Later, they can update the transfer if some quantities change or mark it as draft before finalizing.

Properties

Name Meaning
operation The action to perform on transfer records. Options: create, getAll, get, update, delete.
transferId The unique ID of the transfer order (required for get, update, delete operations).
fromBranchId ID of the branch sending the goods (required for create and update).
toBranchId ID of the branch receiving the goods (required for create and update).
code Transfer order code; auto-generated if left empty (optional for create and update).
description Description or notes about the transfer order (optional for create and update).
isDraft Boolean flag indicating if the transfer is saved as a draft (optional for create and update).
transferDetails List of products included in the transfer. Each product includes:
• productId (number)
• productCode (string)
• sendQuantity (number)
• receivedQuantity (number, optional)
• price (number) (required for create and update)
filters Filters for listing transfers (getAll operation). Includes:
• fromBranchIds (comma-separated string of IDs)
• toBranchIds (comma-separated string of IDs)
• status (comma-separated string of statuses)
• fromTransferDate, toTransferDate (date/time range)
• fromReceivedDate, toReceivedDate (date/time range)
options Pagination options for listing transfers (getAll operation):
• pageSize (number, 1-100)
• currentItem (offset number)

Output

The node outputs JSON data representing the result of the performed operation:

  • For create, get, and update operations, the output is the transfer object returned by the KiotViet API, including all details of the transfer order and its products.
  • For getAll, the output is an array of transfer objects matching the filter criteria.
  • For delete, the output is a confirmation object with success status and message.

No binary data is produced by this node.

Dependencies

  • Requires an active connection to the KiotViet API via an API key credential configured in n8n.
  • The node uses a shared KiotViet API helper class to interact with the API endpoints related to transfers.
  • Proper API permissions are necessary to perform create, read, update, and delete operations on transfer records.

Troubleshooting

  • Invalid or missing transferId: Operations like get, update, and delete require a valid numeric transfer ID. Ensure the ID is correct and provided.
  • API authentication errors: Verify that the API key credential is correctly set up and has sufficient permissions.
  • Invalid product details: When creating or updating, ensure each product entry includes required fields like productId, productCode, sendQuantity, and price.
  • Filter parsing issues: For getAll, comma-separated filter strings must be properly formatted; invalid numbers will be ignored.
  • Operation not supported: If an unsupported operation is selected, the node throws an error indicating the operation is not supported.
  • Continue on Fail: If enabled, errors for individual items will be captured in the output instead of stopping execution.

Links and References

Discussion