Actions72
- Bài Viết Actions
- Blog Actions
- Bộ Sưu Tập Actions
- Khách Hàng Actions
- Đơn Hàng Actions
- Trang Actions
- Sản Phẩm Actions
- Biến Thể Sản Phẩm Actions
Đơn Hàng → Lấy Danh Sách
AI-generatedOverview
This node interacts with custom metafields associated with various resources in the Sapo platform, specifically here focusing on the "Đơn Hàng" (Orders) resource. The "Lấy Danh Sách" (Get Many) operation retrieves a list of metafields for a specified order by its ID. It supports filtering and pagination options to control the volume and scope of returned data.
Common scenarios include:
- Fetching all or a subset of custom metafields attached to an order to display or process additional metadata.
- Filtering metafields by namespace or key to retrieve specific custom information.
- Limiting results or retrieving all metafields depending on the use case.
Practical example:
- A user wants to get all custom fields related to a particular order to integrate with another system or generate reports based on custom attributes like delivery instructions or gift messages stored as metafields.
Properties
| Name | Meaning |
|---|---|
| ID Tài Nguyên | The numeric ID of the order resource to fetch metafields from. |
| Trả Về Tất Cả | Boolean flag indicating whether to return all metafields or limit the number of results. |
| Giới Hạn | Maximum number of metafields to return when not returning all (minimum 1). |
| Thông Tin Bổ Sung | Additional optional filters: - Namespace: Filter metafields by their namespace string. - Key: Filter metafields by their key. - Tạo Sau: Filter metafields created after this date/time. - Tạo Trước: Filter metafields created before this date/time. |
Output
The output is an array containing one object with a json property holding the retrieved metafields data. The structure depends on the API response but generally includes details about each metafield such as namespace, key, value, value type, description, and timestamps.
Example output snippet (conceptual):
{
"json": {
"metafields": [
{
"id": 123,
"namespace": "inventory",
"key": "warehouse_location",
"value": "A-12",
"value_type": "string",
"description": "Storage location in warehouse",
"created_at": "2023-01-01T12:00:00Z"
},
...
]
}
}
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to the Sapo API via an API key credential configured in n8n.
- The node uses the Sapo API base class internally to perform authenticated requests.
- Proper permissions on the Sapo account to read metafields for orders are necessary.
Troubleshooting
Common issues:
- Invalid or missing order ID (
resourceId) will cause errors or empty results. - Insufficient API permissions may result in authorization errors.
- Using filters that do not match any metafields will return empty lists.
- Network or API downtime can cause request failures.
- Invalid or missing order ID (
Error messages:
- Errors thrown by the node include descriptive messages from the API or internal validation.
- If the node is set to continue on fail, errors will be returned in the output JSON under an
errorfield. - To resolve errors, verify credentials, ensure the order ID exists, and check filter values.
Links and References
- Sapo API Documentation (general reference for metafield endpoints)
- n8n documentation on Using Credentials
- n8n documentation on Custom Nodes