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, a popular e-commerce system. It supports various operations such as creating, retrieving, updating, deleting, counting, canceling orders, and marking orders as paid or fulfilled. This node is useful for automating order management workflows, syncing order data with other systems, or triggering actions based on order status changes.

For example:

  • Automatically mark an order as fulfilled after shipping.
  • Cancel an order if payment is not received within a certain timeframe.
  • Retrieve detailed order information to update inventory or customer records.

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 except "Get Many" and "Count".

Additional properties relevant for some operations (not requested but present in code):

  • Return All (boolean): For "Get Many" operation, whether to return all results or limit them.
  • Limit (number): Maximum number of results to return when "Return All" is false.
  • Additional Fields (collection): Filters for listing orders, including creation date range, status, financial status, and fulfillment status.
  • Data (JSON): Order data to send when creating or updating an order.

Output

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

  • For retrieval operations ("get", "getMany"), it returns order details or lists of orders.
  • For create/update operations, it returns the created or updated order data.
  • For delete, it returns a success confirmation.
  • For count, it returns the total number of orders.
  • For cancel, mark as paid, and mark as fulfilled, it returns the updated order status.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential to authenticate with the Sapo platform.
  • Depends on the internal SapoApiBase class to interact with the Sapo API endpoints related to orders.
  • Needs proper configuration of the Sapo API credentials in n8n.

Troubleshooting

  • Common issues:

    • Invalid or missing Order ID for operations that require it will cause errors.
    • Insufficient permissions or invalid API credentials can lead to authentication failures.
    • Network or API downtime may cause request failures.
  • Error messages:

    • Errors from the Sapo API are caught and returned as error messages in the node output if "Continue On Fail" is enabled.
    • Otherwise, the node throws an error with the message and stack trace.
  • Resolutions:

    • Verify the Order ID is correct and exists in the Sapo system.
    • Ensure the API key credential is valid and has necessary permissions.
    • Check network connectivity and Sapo service status.

Links and References

Discussion