Danh Mục KiotViet icon

Danh Mục KiotViet

Quản lý danh mục sản phẩm từ KiotViet

Overview

This node manages product categories in the KiotViet system. It allows users to create new categories, retrieve existing ones by ID or list all categories, and update category details. This is useful for automating inventory organization, syncing category data between systems, or bulk managing product categories.

Practical examples:

  • Automatically creating a new product category when onboarding new products.
  • Fetching category details to display or use in other workflows.
  • Updating category information such as description or parent category based on external changes.

Properties

Name Meaning
Tên Danh Mục The name of the category (required for create and update operations).
Trường Bổ Sung Additional optional fields for create and update:
- Mã Danh Mục Category code; if not provided, it will be auto-generated.
- ID Danh Mục Cha Parent category ID if this is a subcategory.
- Mô Tả Description of the category.
- Thứ Tự Hiển Thị Display order index for sorting categories.
- Thuộc Tính A collection of custom attributes, each with a name and value, to add extra metadata to the category.

Output

The node outputs JSON data representing the category or categories involved in the operation:

  • For create and update, the output contains the created or updated category object with its properties.
  • For get, the output is a single category object identified by the given ID.
  • For getAll, the output includes an object with:
    • data: an array of category objects,
    • total: total number of categories available,
    • pageSize: number of categories per page,
    • currentPage: current page number.

No binary data output is produced by this node.

Dependencies

  • Requires connection to the KiotViet API via an API key credential configured in n8n.
  • Uses a shared KiotViet API helper class internally to perform HTTP requests.

Troubleshooting

  • Common issues:
    • Invalid or missing API credentials will cause authentication failures.
    • Providing non-numeric values for IDs or order indexes may cause errors.
    • Attempting to update a category when the API does not support updates will throw an error.
  • Error messages:
    • Errors from the KiotViet API are passed through; check the message for details.
    • If "Update operation is not supported" error appears, verify that the API endpoint supports updates or check for version compatibility.
  • To resolve errors, ensure all required parameters are correctly set, numeric fields contain valid numbers, and API credentials are valid.

Links and References

Discussion