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 and retail management system. It supports various operations such as creating new orders, retrieving order details, updating existing orders, deleting orders, counting total orders, canceling orders, and marking orders as paid or fulfilled.

Common scenarios where this node is beneficial include:

  • Automating order creation from external systems or forms.
  • Synchronizing order data between Sapo and other platforms.
  • Managing order lifecycle events like cancellations or status updates.
  • Generating reports by counting or listing orders with specific filters.

For example, you can use this node to automatically create an order in Sapo when a customer completes a purchase on your website, or to mark an order as fulfilled once it has been shipped.

Properties

Name Meaning
Operation The action to perform on orders. Options: Cancel, Count, Create, Delete, Get, Get Many, Mark Fulfilled, Mark Paid, Update
Order ID The unique identifier of the order (required for operations that target a specific order)
Return All Whether to return all results or limit the number of results (used with "Get Many" operation)
Limit Maximum number of results to return when not returning all (used with "Get Many")
Additional Fields Extra filtering options for listing orders, including: Created After, Created Before, Status (Open, Closed, Cancelled), Financial Status (Authorized, Paid, Partially Paid, Pending, Refunded, Voided), Fulfillment Status (Fulfilled, Partial, Unfulfilled)
Dữ Liệu (Data) JSON object containing the data sent to Sapo when creating or updating an order (required for these operations)

Output

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

  • For Create, Get, Update, Cancel, Mark Paid, and Mark Fulfilled operations, the output contains the order data returned by Sapo after the operation.
  • For Get Many, the output includes a list of orders matching the specified criteria.
  • For Delete, the output is a simple success confirmation { success: true }.
  • For Count, the output contains the total count of orders { count: number }.
  • In case of errors (if "Continue On Fail" is enabled), the output will contain an error message in the form { error: "error message" }.

The node does not output binary data.

Dependencies

  • Requires an API key credential to authenticate with the Sapo API.
  • Depends on the SapoApiBase class/module which handles communication with the Sapo API endpoints related to orders.
  • No additional environment variables are explicitly required beyond the API authentication setup.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Providing incorrect or incomplete order data in the JSON input may lead to validation errors from the Sapo API.
    • Using an invalid Order ID for operations targeting a specific order will result in "not found" errors.
    • Exceeding rate limits imposed by the Sapo API could cause request failures.
  • Error messages:

    • Errors thrown by the node include the message from the underlying API response.
    • If "Continue On Fail" is disabled, the node execution will stop on the first error.
    • To handle intermittent issues gracefully, enable "Continue On Fail" to capture errors in the output.

Links and References

Discussion