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 creating, retrieving, updating, deleting, canceling, and marking orders as paid or fulfilled. It is useful for automating order management workflows, integrating Sapo order data with other systems, or maintaining synchronized order records.

For example, a user can delete an order by specifying its Order ID, which helps in cleaning up canceled or erroneous orders automatically. Similarly, marking an order as paid or fulfilled can be automated after payment confirmation or shipment.

Properties

Name Meaning
Operation The action to perform on the order. Options: Cancel, Count, Create, Delete, Get, Get Many, Mark Fulfilled, Mark Paid, Update
Order ID The unique numeric identifier of the order to operate on. Required for operations: get, update, delete, cancel, markAsPaid, markAsFulfilled
Return All (Only for "Get Many" operation) Whether to return all matching orders or limit the number returned
Limit (Only for "Get Many" when Return All is false) Maximum number of orders to return
Additional Fields (Only for "Get Many") Extra filters such as creation date range, status, financial status, and fulfillment status
Data (Only for "Create" and "Update") JSON object containing the order data to send to Sapo

Output

The node outputs a JSON object representing the result of the performed operation:

  • For Delete operation, it returns { success: true } upon successful deletion.
  • For Get, Create, Update, Cancel, Mark Paid, Mark Fulfilled, and Count operations, it returns the corresponding order data or count information as received from the Sapo API.
  • For Get Many, it returns a list of orders matching the criteria.

No binary data output 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 SapoApiBase class to interact with the Sapo orders endpoint.

Troubleshooting

  • Common issues:

    • Invalid or missing Order ID for operations that require it will cause errors.
    • Network or authentication failures with the Sapo API may result in request errors.
    • Providing malformed JSON in the Data property for create/update operations can cause API rejections.
  • 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 messages include invalid order IDs, permission denied, or malformed request data.
  • Resolution tips:

    • Ensure the Order ID is correct and exists in Sapo before attempting operations like delete or update.
    • Verify API credentials and network connectivity.
    • Validate JSON input data structure before sending.

Links and References

Discussion