Sapo Thực Hiện Đơn Hàng icon

Sapo Thực Hiện Đơn Hàng

Quản lý thực hiện đơn hàng trên Sapo

Overview

This node manages order fulfillments on the Sapo platform, allowing users to perform various operations related to order fulfillment such as creating a fulfillment, retrieving details, 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:

  • Automatically creating a fulfillment when an order is processed.
  • Updating shipment tracking details as packages move through delivery.
  • Canceling fulfillments if orders are canceled or changed.
  • Logging and managing fulfillment events to track shipment status changes.
  • Retrieving lists of fulfillments or carriers for reporting or further processing.

Example use cases:

  • After receiving an order in n8n, create a fulfillment with shipping details.
  • Periodically update tracking info from a shipping provider.
  • Cancel a fulfillment if payment fails or customer cancels.
  • Fetch all fulfillment events to monitor shipment progress.

Properties

Name Meaning
operation The action to perform. Options: "Hủy" (cancel), "Tạo Mới" (create), "Tạo Sự Kiện" (createEvent), "Xóa Sự Kiện" (deleteEvent), "Lấy Chi Tiết" (get), "Lấy Đơn Vị Vận Chuyển" (getCarriers), "Lấy Danh Sách" (getMany), "Danh Sách Sự Kiện" (listEvents), "Cập Nhật Tracking" (updateTracking)
orderId The numeric ID of the order to operate on. Required for most operations.
fulfillmentId The numeric ID of the fulfillment record. Required for operations targeting a specific fulfillment like get, updateTracking, cancel, createEvent, listEvents, deleteEvent.
returnAll Boolean flag (for "getMany" operation) to return all results or limit the number returned.
limit Maximum number of results to return (used when returnAll is false in "getMany").
additionalFields Additional optional filters for listing fulfillments, including status (e.g., cancelled, error, success), created/updated date ranges.
eventId Numeric ID of a fulfillment event to delete (required for "deleteEvent" operation).
data JSON object containing data relevant to the operation: fulfillment creation data, tracking info, or event details depending on operation.

Output

The node outputs a single JSON object per execution containing the result of the requested operation:

  • For create/get/getMany/cancel/updateTracking/createEvent/listEvents/getCarriers operations, the output JSON contains the API response data representing fulfillment details, lists, events, or carriers.
  • For deleteEvent, the output JSON contains { "success": true } upon successful deletion.
  • If an error occurs and "Continue On Fail" is enabled, the output JSON will contain an error field with the error message.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the Sapo platform.
  • Depends on the internal Sapo API base class for making HTTP requests to Sapo's fulfillment endpoints.
  • No additional external services beyond Sapo's API are required.

Troubleshooting

  • Common issues:

    • Invalid or missing orderId or fulfillmentId parameters can cause errors.
    • Incorrect JSON format in the data property may lead to request failures.
    • API authentication errors if the API key credential is not configured properly.
    • Rate limiting or network errors from the Sapo API.
  • Error messages:

    • Errors from the Sapo API are surfaced with their message; ensure IDs and data fields are correct.
    • If the node throws a NodeApiError, check the stack trace for more details.
    • To handle intermittent errors gracefully, enable "Continue On Fail" to avoid workflow interruption.

Links and References

Discussion