Sapo Đơn Hàng icon

Sapo Đơn Hàng

Quản lý đơn hàng trên Sapo

Overview

This node manages orders on the Sapo platform, allowing users to perform various operations such as retrieving multiple orders, creating new orders, updating existing ones, deleting, counting, canceling, and marking orders as paid or fulfilled. The "Get Many" operation is particularly useful for fetching a list of orders with optional filters and limits, which can help in scenarios like syncing orders to another system, generating reports, or monitoring order statuses.

Practical examples:

  • Fetch all open orders created after a specific date to process them in an external system.
  • Retrieve a limited number of recently created orders with a particular payment status for quick review.
  • Use the node to count total orders for analytics purposes.

Properties

Name Meaning
Trả Về Tất Cả Whether to return all results or only up to a given limit (true/false).
Giới Hạn Maximum number of results to return when not returning all (minimum 1).
Thông Tin Bổ Sung Additional filter fields:
- Tạo Sau: Filter orders created after this date/time.
- Tạo Trước: Filter orders created before this date/time.
- Trạng Thái: Order status; options are Open, Closed, Cancelled.
- Trạng Thái Thanh Toán: Financial status; options include Authorized, Paid, Partially Paid, Pending, Refunded, Voided.
- Trạng Thái Giao Hàng: Fulfillment status; options are Fulfilled, Partial, Unfulfilled.

Output

The output is a JSON array where each item contains the data returned from the Sapo API corresponding to the requested operation. For the "Get Many" operation, the json field includes an array or list of orders matching the specified filters and limits.

No binary data output is produced by this node.

Example output structure snippet for "Get Many":

[
  {
    "json": {
      "orders": [
        {
          "id": 123,
          "status": "open",
          "financial_status": "pending",
          "fulfillment_status": "unfulfilled",
          "created_at": "2024-01-01T12:00:00Z",
          ...
        },
        ...
      ]
    }
  }
]

Dependencies

  • Requires an active connection to the Sapo API via an API key credential configured in n8n.
  • The node depends on the internal Sapo API base class to handle HTTP requests to the Sapo platform.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication errors.
    • Requesting too many records without proper limits may lead to timeouts or rate limiting.
    • Incorrect filter values (e.g., invalid dates or unsupported status strings) may result in empty responses or errors.
  • Error messages:

    • Errors from the Sapo API are caught and either thrown or returned as error objects depending on the node's "Continue On Fail" setting.
    • Typical error message might indicate invalid parameters or network issues.
  • Resolution tips:

    • Verify API credentials and permissions.
    • Use appropriate filters and limits to avoid large data loads.
    • Check date formats and option values carefully.

Links and References

Discussion