Overview
This node manages order fulfillments on the Sapo platform, allowing users to perform various operations related to order fulfillment such as creating fulfillments, retrieving details, listing multiple fulfillments, updating tracking information, canceling fulfillments, and managing fulfillment events. It is useful for automating and integrating order fulfillment workflows within e-commerce or logistics processes.
Common scenarios include:
- Creating a new fulfillment for an order after it has been processed.
- Retrieving detailed information about a specific fulfillment.
- Listing all fulfillments for an order with optional filtering by status or date.
- Updating shipment tracking details to keep customers informed.
- Canceling a fulfillment if an order is no longer being shipped.
- Managing fulfillment events like shipment status updates or delivery notifications.
Practical example: Automatically fetch all pending fulfillments created after a certain date to trigger downstream shipping or notification workflows.
Properties
| Name | Meaning |
|---|---|
| ID Đơn Hàng | The numeric ID of the order to operate on. Required for most operations. |
| Trả Về Tất Cả | Boolean flag indicating whether to return all results when listing fulfillments (getMany). |
| Giới Hạn | Maximum number of fulfillment records to return when not returning all (used with getMany). |
| Thông Tin Bổ Sung | Additional optional filters for listing fulfillments, including: |
| - Trạng Thái: Status filter with options: Đã Hủy, Lỗi, Thất Bại, Mở, Đang Chờ, Thành Công | |
| - Tạo Sau: Filter fulfillments created after this datetime | |
| - Tạo Trước: Filter fulfillments created before this datetime | |
| - Cập Nhật Sau: Filter fulfillments updated after this datetime | |
| - Cập Nhật Trước: Filter fulfillments updated before this datetime |
Output
The node outputs JSON data representing the result of the selected operation:
- For creation, retrieval, update, cancellation, and event management operations, the output contains the fulfillment or event data returned by the Sapo API.
- For listing operations (
getMany), the output is a list of fulfillment objects matching the criteria. - For carrier retrieval, the output includes a list of available carriers.
- For deletion of events, the output confirms success with a boolean flag.
- If errors occur and "Continue On Fail" is enabled, the output contains an error message object.
No binary data is produced by this node.
Dependencies
- Requires an active connection to the Sapo API via an API key credential configured in n8n.
- Uses the internal Sapo API base class to interact with fulfillment endpoints.
- No additional external dependencies beyond the Sapo API service.
Troubleshooting
Common issues:
- Invalid or missing order or fulfillment IDs will cause API errors.
- Incorrect or expired API credentials will prevent successful API calls.
- Filtering with invalid date formats may cause request failures.
- Exceeding rate limits imposed by the Sapo API can result in temporary errors.
Error messages:
- Errors from the Sapo API are surfaced with their message and stack trace.
- If "Continue On Fail" is disabled, the node execution stops on the first error.
- To resolve errors, verify input parameters, ensure valid credentials, and check API usage limits.
Links and References
- Sapo API Documentation (general reference for API endpoints)
- n8n documentation on creating custom nodes
- Best practices for handling API pagination and filtering in n8n workflows