Actions8
Lấy Danh Sách
AI-generatedOverview
This node integrates with the Sapo inventory management system to manage and retrieve warehouse stock information. It supports various operations such as fetching detailed inventory data, adjusting quantities, transferring stock between locations, and listing warehouse locations.
The "Lấy Danh Sách" (Get Many) operation specifically retrieves a list of inventory items, optionally filtered by warehouse location or update timestamps. This is useful for synchronizing inventory data, generating reports, or monitoring stock levels across multiple warehouses.
Practical examples:
- Fetch all inventory items updated after a certain date to keep an external database in sync.
- Retrieve a limited number of inventory records for quick overview dashboards.
- Filter inventory by specific warehouse location to analyze stock distribution.
Properties
| Name | Meaning |
|---|---|
| Trả Về Tất Cả | Boolean option to return all results or limit the number of returned inventory items. |
| Giới Hạn | Maximum number of inventory items to return when not returning all. |
| Thông Tin Bổ Sung | Additional filtering fields: |
| - ID Kho: Filter inventory by warehouse location ID. | |
| - Cập Nhật Sau: Filter inventory updated after this datetime. | |
| - Cập Nhật Trước: Filter inventory updated before this datetime. |
Output
The output is an array of JSON objects representing inventory data retrieved from Sapo. Each object contains inventory item details according to the applied filters and limits.
For the "Lấy Danh Sách" operation, the JSON structure typically includes fields such as product IDs, quantities, warehouse location IDs, and timestamps of last updates.
No binary data output is produced by this operation.
Example output snippet (conceptual):
[
{
"product_id": 123,
"location_id": 1,
"quantity": 50,
"updated_at": "2024-05-01T12:00:00Z"
},
{
"product_id": 456,
"location_id": 2,
"quantity": 20,
"updated_at": "2024-05-02T08:30:00Z"
}
]
Dependencies
- Requires an API key credential for authenticating with the Sapo API.
- The node depends on the
SapoApiBaseclass which handles communication with the Sapo inventory endpoints. - Proper configuration of the API credentials within n8n is necessary for successful requests.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication errors.
- Providing invalid filter values (e.g., non-existent location IDs or malformed dates) may result in empty responses or API errors.
- Requesting too many records without enabling "Trả Về Tất Cả" might lead to incomplete data retrieval.
Error messages:
- Errors from the Sapo API are caught and either thrown or returned as error JSON objects if "Continue On Fail" is enabled.
- Typical error messages include authentication failures, invalid parameters, or rate limiting notices.
Resolution tips:
- Verify API credentials and permissions.
- Check that filter parameters conform to expected formats.
- Use the "Trả Về Tất Cả" option carefully to avoid performance issues.
Links and References
- Sapo Inventory API Documentation (example placeholder link)
- n8n documentation on Creating Custom Nodes
- General info on Inventory Management Best Practices