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.

The Mark Paid operation specifically updates an order's status to indicate that payment has been received. This is useful in workflows where you want to programmatically confirm payment after manual verification or external payment processing.

Practical example:

  • After receiving a payment confirmation from a third-party payment gateway, use this node with the "Mark Paid" operation to update the corresponding order in Sapo automatically, ensuring your order management system reflects the correct payment status.

Properties

Name Meaning
Operation The action to perform on the order. Options include: 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 like get, update, delete, cancel, mark as paid, and mark as fulfilled.
Return All (For "Get Many" operation) Whether to return all matching orders or limit the number of results. Boolean.
Limit (For "Get Many" operation when Return All is false) Maximum number of orders to return. Minimum value is 1.
Additional Fields (For "Get Many" operation) Optional filters such as creation date range, order status (open, closed, cancelled), financial status (authorized, paid, partially paid, pending, refunded, voided), and fulfillment status (fulfilled, partial, unfulfilled).
Data (For "Create" and "Update" operations) JSON object containing the order data to send to Sapo.

Output

The node outputs an array with one item per input item processed. Each output item contains a json field with the response data from the Sapo API for the requested operation.

  • For Mark Paid, the output JSON contains the updated order information reflecting the payment status change.
  • For other operations, the output JSON varies accordingly (e.g., order details, list of orders, success confirmation).
  • If an error occurs and the node is set to continue on failure, the output JSON will contain an error field with the error message.

The node does not output binary data.

Dependencies

  • Requires an active connection to the Sapo API via an API key credential configured in n8n.
  • The node depends on the internal SapoApiBase class to handle API requests related to orders.
  • No additional external dependencies are required beyond the Sapo API access.

Troubleshooting

  • Common issues:
    • Invalid or missing Order ID when required will cause errors.
    • Insufficient permissions or invalid API credentials can lead to authentication failures.
    • Network connectivity problems may cause request timeouts or failures.
  • Error messages:
    • Errors returned by the Sapo API are surfaced with their message. For example, "Order not found" if the specified Order ID does not exist.
    • If the node throws a generic API error, verify the API key and network connectivity.
  • To resolve errors:
    • Ensure the Order ID is correct and exists in Sapo.
    • Confirm the API key credential is valid and has necessary permissions.
    • Check network access to the Sapo API endpoint.

Links and References

Discussion