Sapo Kho Hàng icon

Sapo Kho Hàng

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

Chuyển Kho

AI-generated

Overview

The node "Sapo Kho Hàng" manages inventory operations on the Sapo platform. It allows users to perform various inventory-related tasks such as adjusting quantities, transferring stock between locations, setting inventory levels, retrieving inventory details, and managing inventory transfers.

A common scenario for this node is when a business needs to update stock levels after receiving new shipments, transferring products between warehouses, or correcting inventory discrepancies. For example, a retail store can use it to transfer product quantities from one warehouse to another or adjust stock counts after a physical inventory audit.

Specifically, the "Chuyển Kho" (Transfer) operation enables moving a specified quantity of a product from one inventory location to another, optionally including reference numbers and notes for tracking purposes.

Properties

Name Meaning
ID Sản Phẩm The unique numeric ID of the inventory item (product) to operate on.
ID Kho The numeric ID of the source inventory location (warehouse) involved in the operation.
ID Kho Đích The numeric ID of the target inventory location where stock will be transferred to.
Số Lượng The quantity of the product to adjust, set, or transfer.
Số Tham Chiếu A string reference number associated with the inventory transfer for tracking purposes.
Ghi Chú Notes or reasons related to the inventory operation, useful for record-keeping.

Output

The node outputs a JSON object containing the response data from the Sapo API corresponding to the requested inventory operation. For the "Chuyển Kho" operation, the output JSON includes details about the inventory transfer transaction, such as confirmation of the transfer, quantities moved, source and target locations, and any reference information provided.

No binary data output is produced by this node.

Example output structure snippet for a transfer operation:

{
  "transferId": 12345,
  "productId": 67890,
  "from_location_id": 1,
  "to_location_id": 2,
  "quantity": 10,
  "reference_number": "REF123",
  "notes": "Stock transfer for restocking",
  "status": "completed"
}

Dependencies

  • Requires an active connection to the Sapo API via an API key credential configured in n8n.
  • The node depends on the SapoApiBase class which handles communication with the Sapo inventory endpoints.
  • Proper API credentials must be set up in n8n under the node's credentials section to authenticate requests.

Troubleshooting

  • Common issues:

    • Invalid or missing product or location IDs may cause errors.
    • Insufficient permissions or invalid API credentials will result in authentication failures.
    • Attempting to transfer more quantity than available in the source location may cause errors.
  • Error messages:

    • Errors returned from the Sapo API are caught and either thrown or returned as error objects depending on the node’s "Continue On Fail" setting.
    • Typical error messages include "Product not found", "Location not found", "Insufficient stock", or "Unauthorized".
  • Resolutions:

    • Verify that all required IDs (product, source location, target location) are correct and exist in the Sapo system.
    • Ensure the API key credential is valid and has necessary permissions.
    • Check stock availability before attempting transfers.
    • Use the "Ghi Chú" field to add meaningful notes to help trace operations.

Links and References

Discussion