Overview
This node integrates with the Sapo e-commerce platform to manage orders. It supports various operations such as retrieving a single order, creating new orders, updating existing ones, deleting, canceling, counting, and marking orders as paid or fulfilled. This node is beneficial for automating order management workflows, syncing order data between Sapo and other systems, or building custom order processing pipelines.
For example, you can use this node to:
- Fetch detailed information about a specific order by its ID.
- Retrieve multiple orders with filtering options like creation date or status.
- Update order details programmatically.
- Cancel or delete orders based on business logic.
- Mark orders as paid or fulfilled after payment or shipment confirmation.
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 numeric identifier of the order. 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 of results |
| Limit | (Only for "Get Many" operation when Return All is false) Maximum number of orders to return |
| Additional Fields | (Only for "Get Many") Optional filters for listing orders, including: - Created After (dateTime) - Created Before (dateTime) - Status (Open, Closed, Cancelled) - Financial Status (Authorized, Paid, Partially Paid, Pending, Refunded, Voided) - Fulfillment Status (Fulfilled, Partial, Unfulfilled) |
| Data | (Only for "Create" and "Update") JSON object containing order data to send to Sapo |
Output
The node outputs an array with one item containing a json field. The structure of the json output depends on the operation:
- For Get: The full order object retrieved from Sapo by the specified Order ID.
- For Get Many: A list of orders matching the filter criteria.
- For Create and Update: The created or updated order object.
- For Delete: A success confirmation
{ success: true }. - For Count: An object with the total count of orders
{ count: number }. - For Cancel, Mark Paid, Mark Fulfilled: The updated order object reflecting the changed status.
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.
- The node uses a helper class (
SapoApiBase) to interact with the Sapo orders endpoint. - Proper API permissions are needed to perform order management actions.
Troubleshooting
Common issues:
- Invalid or missing Order ID for operations that require it will cause errors.
- Insufficient API permissions may result in authorization errors.
- Network or connectivity problems with the Sapo API can cause request failures.
- Providing malformed JSON in the "Data" property for create/update operations can lead to validation errors.
Error messages:
- Errors returned from the Sapo API are caught and either thrown or returned as error objects if "Continue On Fail" is enabled.
- Typical error messages include invalid parameters, unauthorized access, or resource not found.
Resolution tips:
- Verify the Order ID is correct and exists in Sapo.
- Check API credentials and permissions.
- Ensure JSON data is well-formed and matches expected schema.
- Use "Continue On Fail" cautiously to handle partial failures gracefully.
Links and References
- Sapo API Documentation (official API docs for further details on order endpoints)
- n8n documentation on creating custom nodes