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 supports creating new categories, retrieving a category by ID, listing multiple categories with filters and pagination, and updating existing categories. This node is useful for automating category management workflows such as syncing categories from other systems, bulk updating category details, or fetching category information for reporting.

Practical examples:

  • Automatically create new product categories in KiotViet when they are added in an external inventory system.
  • Retrieve detailed information about a specific category to enrich product data.
  • List all categories with pagination and filtering to generate reports or synchronize with other platforms.
  • Update category names, descriptions, parent-child relationships, and custom attributes in bulk.

Properties

Name Meaning
Thao Tác Operation to perform: Create new, Get by ID, Get all, or Update a category
ID Danh Mục The unique identifier of the category (required for "get" and "update" operations)
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 (auto-generated if not provided)
- ID Danh Mục Cha: Parent category ID (for subcategories)
- Mô Tả: Description of the category
- Thứ Tự Hiển Thị: Display order index
- Thuộc Tính: Custom attributes as name-value pairs

Output

The node outputs JSON data representing the category or categories affected or retrieved:

  • For create and update operations, it returns the created or updated category object with its properties.
  • For get operation, it returns the single category object identified by the given ID.
  • For getAll operation, it returns an object containing:
    • data: An array of category objects.
    • total: Total number of categories matching the filter.
    • pageSize: Number of results per page.
    • currentPage: Current page number.

Each category object includes fields like id, categoryName, categoryCode, parentId, description, orderIndex, and an array of custom attributes (attributes).

The node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the KiotViet API.
  • Uses a shared KiotViet API helper class to handle requests.
  • No additional environment variables are explicitly required beyond the API credential.

Troubleshooting

  • Common issues:

    • Providing invalid or missing category IDs for "get" or "update" operations will cause errors.
    • Attempting to update a category when the API does not support updates may throw an error.
    • Incorrect data types for numeric fields (e.g., parentId, orderIndex) can cause failures.
    • Network or authentication errors if the API key is invalid or missing.
  • Error messages:

    • "Update operation is not supported by the KiotViet API": Indicates the API client does not implement update; verify API version or permissions.
    • Errors related to parsing integers from string inputs: Ensure numeric fields are correctly formatted.
    • General API errors: Check API credentials and network connectivity.
  • To resolve errors, verify input parameters, ensure required fields are set, and confirm API credentials are valid.

Links and References

Discussion