Actions8
Lấy Chi Tiết Kho
AI-generatedOverview
This node integrates with the Sapo inventory management system to perform various inventory-related operations. It is useful for managing stock levels, transferring inventory between locations, and retrieving detailed information about products and warehouse locations within Sapo.
Common scenarios include:
- Adjusting stock quantities after physical inventory counts or corrections.
- Transferring stock from one warehouse location to another.
- Fetching detailed product inventory data or warehouse location details.
- Listing all inventory locations or multiple inventory items with filtering options.
For example, a user can automate updating stock levels after receiving new shipments or track inventory transfers between warehouses seamlessly.
Properties
| Name | Meaning |
|---|---|
| operation | The inventory action to perform. Options: "Điều Chỉnh Số Lượng" (adjust quantity), "Hủy Chuyển Kho" (cancel transfer), "Lấy Chi Tiết" (get details), "Lấy Chi Tiết Kho" (get location details), "Lấy Danh Sách" (list many), "Lấy Chi Tiết Chuyển Kho" (get transfer details), "Danh Sách Kho" (list locations), "Đặt Mức Tồn Kho" (set stock level), "Chuyển Kho" (transfer stock). |
| productId | ID of the inventory item (required for most operations except listing locations). |
| action | For adjusting quantity: set, add, or remove stock quantity. |
| locationId | ID of the inventory location (warehouse) involved in the operation. |
| targetLocationId | ID of the destination location for stock transfer operations. |
| transferId | ID of the inventory transfer record (for getting or canceling transfers). |
| quantity | Quantity to adjust, set, or transfer. |
| referenceNumber | Reference number for inventory transfer documentation. |
| returnAll | Whether to return all results when listing multiple inventory items. |
| limit | Maximum number of results to return when not returning all. |
| additionalFields | Additional filters for listing inventory items, such as filtering by location ID or update timestamps. |
| reason | Notes or reasons for inventory adjustments, transfers, or level settings. |
Output
The node outputs an array of JSON objects representing the result of the selected operation. The structure varies depending on the operation:
- For get and getMany, it returns detailed inventory item data.
- For getLocation and listLocations, it returns warehouse location details.
- For adjustQuantity, setLevel, and transfer, it returns confirmation and updated inventory status.
- For getTransfer and cancelTransfer, it returns details or status of the inventory transfer.
No binary data output is produced by this node.
Dependencies
- Requires connection to the Sapo API via an API key credential configured in n8n.
- Uses the internal
SapoApiBaseclass to interact with Sapo's inventory endpoints. - Proper API credentials must be set up in n8n for authentication.
Troubleshooting
Common issues:
- Invalid or missing product or location IDs will cause errors.
- Insufficient permissions or invalid API credentials may lead to authentication failures.
- Attempting to transfer or adjust quantities beyond available stock might result in errors from the API.
Error messages:
- Errors returned from the Sapo API are caught and either thrown or returned as error JSON if "Continue On Fail" is enabled.
- Typical error messages include invalid parameters, unauthorized access, or resource not found.
Resolution tips:
- Verify that all required IDs and parameters are correctly provided.
- Ensure API credentials are valid and have necessary permissions.
- Use "Continue On Fail" cautiously to handle partial failures gracefully.
Links and References
- Sapo Inventory API Documentation (example link; replace with actual)
- n8n Documentation on Creating Custom Nodes
- General info on inventory management best practices.