Sapo Kho Hàng icon

Sapo Kho Hàng

Quản lý kho hàng trên Sapo

Lấy Chi Tiết Chuyển Kho

AI-generated

Overview

This node manages inventory operations on the Sapo platform, a system for warehouse and stock management. It supports various actions such as retrieving inventory details, adjusting quantities, setting stock levels, transferring stock between locations, and managing transfer records.

A common use case is automating inventory updates when sales or restocks occur, ensuring accurate stock levels across multiple warehouses. For example, you can automatically transfer stock from one location to another after an order fulfillment or adjust quantities based on physical stock counts.

Specifically, the "Lấy Chi Tiết Chuyển Kho" (Get Transfer Details) operation fetches detailed information about a specific inventory transfer by product ID and transfer ID, useful for tracking stock movements and auditing transfers.

Properties

Name Meaning
Thao Tác (operation) The inventory operation to perform. Options include:
- ĐIều Chỉnh Số Lượng (adjustQuantity)
- Hủy Chuyển Kho (cancelTransfer)
- Lấy Chi Tiết (get)
- Lấy Chi Tiết Kho (getLocation)
- Lấy Danh Sách (getMany)
- Lấy Chi Tiết Chuyển Kho (getTransfer)
- Danh Sách Kho (listLocations)
- Đặt Mức Tồn Kho (setLevel)
- Chuyển Kho (transfer)
ID Sản Phẩm (productId) Numeric ID of the inventory item. Required for most operations involving a product.
ID Chuyển Kho (transferId) Numeric ID of the inventory transfer. Required for "getTransfer" and "cancelTransfer" operations.
Hành Động (action) Action type for quantity adjustment. Options:
- Đặt Giá Trị (set)
- Thêm (add)
- Bớt (remove)
Used only in "adjustQuantity" operation.
ID Kho (locationId) Numeric ID of the inventory location. Required for operations involving a specific warehouse location.
ID Kho Đích (targetLocationId) Numeric ID of the target location for inventory transfer. Required for "transfer" operation.
Số Lượng (quantity) Quantity number to adjust, set, or transfer. Required for relevant operations.
Số Tham Chiếu (referenceNumber) Reference number string for inventory transfer documentation. Optional for "transfer" operation.
Trả Về Tất Cả (returnAll) Boolean flag indicating whether to return all results or limit them. Used in "getMany" operation.
Giới Hạn (limit) Maximum number of results to return when not returning all. Used in "getMany" operation.
Thông Tin Bổ Sung (additionalFields) Additional optional filters for listing inventories, such as filtering by location ID or update timestamps.
Ghi Chú (reason) Notes or reason for the inventory operation. Optional for operations that modify inventory.

Output

The node outputs an array with a single item containing a json object representing the result of the selected operation:

  • For "getTransfer" (Lấy Chi Tiết Chuyển Kho), the output JSON contains detailed information about the specified inventory transfer, including product, source and destination locations, quantity transferred, status, and related metadata.
  • For other operations, the output JSON structure varies accordingly, e.g., inventory details, lists of locations, confirmation of adjustments, etc.
  • No binary data output is produced by this node.

Example output snippet for "getTransfer":

{
  "id": 12345,
  "product_id": 67890,
  "from_location_id": 1,
  "to_location_id": 2,
  "quantity": 10,
  "status": "completed",
  "reference_number": "REF123",
  "notes": "Stock moved for order #456"
}

Dependencies

  • Requires an API key credential for authenticating with the Sapo platform's API.
  • Depends on the internal SapoApiBase class to handle API requests.
  • Needs proper configuration of the Sapo API credentials within n8n.

Troubleshooting

  • Common issues:
    • Invalid or missing product ID or transfer ID parameters will cause errors.
    • Insufficient permissions or invalid API credentials may lead to authentication failures.
    • Network connectivity problems can prevent successful API calls.
  • Error messages:
    • Errors returned from the API are caught and either thrown or returned as error objects depending on the node's "Continue On Fail" setting.
    • Typical error messages include "Not Found" if IDs do not exist, or "Unauthorized" if credentials are invalid.
  • Resolution tips:
    • Verify that all required numeric IDs are correctly provided and correspond to existing records.
    • Ensure the API key credential is valid and has necessary permissions.
    • Check network access and proxy settings if applicable.

Links and References

Discussion