PrestaShop icon

PrestaShop

Interact with PrestaShop API

Overview

The node integrates with the PrestaShop API to retrieve multiple Order records based on user-defined criteria. It is designed to fetch a list of orders, supporting pagination, filtering, sorting, and output customization. This node is beneficial in scenarios where users want to automate order data retrieval for reporting, synchronization with other systems, or batch processing workflows.

Practical examples include:

  • Fetching all recent orders for daily sales reports.
  • Retrieving orders filtered by status or date range.
  • Exporting order data with specific fields for integration with accounting software.

Properties

Name Meaning
Return All Whether to return all matching orders or limit the number of results (pagination).
Limit Maximum number of orders to return when not returning all. Value between 1 and 1000.
Offset Number of orders to skip before starting to collect results (used for pagination).
Filters Advanced filtering rules to narrow down orders based on field values. Supports multiple filter types such as equals, not equals, greater than, less than, contains, starts with, ends with, in list, and range.
Sort Options Defines how to sort the returned orders by specifying a field (e.g., id, name, price, date_add) and direction (ascending or descending).
Output Format Choose the response format: JSON (recommended) or XML.
Language ID Filter localized fields by language ID (default is 1).
Display Fields Control which fields are returned: full (all fields) or custom (user specifies comma-separated list of fields).
Custom Fields Comma-separated list of specific fields to return when "Custom Fields" display option is selected (e.g., "id,name,price,reference").
Shop Context Define the shop context in multishop environments: all shops, a specific shop, or a shop group.
Shop ID ID of the specific shop to work with (shown if "Specific Shop" is selected).
Shop Group ID ID of the shop group to work with (shown if "Shop Group" is selected).
Enable Debug Mode When enabled, adds debug information such as request URL, method, and parameters to the response to assist troubleshooting.

Output

The node outputs an array of order objects in the json field of each item. The structure of each order object depends on the selected display fields and output format:

  • JSON format (default): Returns order data as JSON objects containing fields like order ID, customer info, prices, dates, statuses, etc., depending on filters and display options.
  • XML format: Returns raw XML data from the PrestaShop API representing the orders.
  • If debug mode is enabled, additional metadata about the API request is included in the output.

No binary data output is produced by this node.

Dependencies

  • Requires connection to a PrestaShop instance via its REST API.
  • Needs an API key credential configured in n8n for authentication.
  • The node relies on the PrestaShop API's capabilities for filtering, sorting, and localization.
  • No additional external libraries beyond those bundled with the node are required.

Troubleshooting

  • Common issues:

    • Incorrect API credentials or insufficient permissions can cause authentication failures.
    • Using invalid filter fields or unsupported filter types may result in API errors.
    • Requesting too many records without pagination might lead to timeouts or rate limiting.
    • Selecting an invalid shop context or non-existent shop/shop group IDs can cause errors.
  • Error messages:

    • Authentication errors typically indicate problems with the API key or access rights; verify credentials.
    • Validation errors from the API often mention invalid filter parameters or unsupported fields; check filter syntax and available fields.
    • Timeout or rate limit errors suggest reducing the number of requested records or adding delays between requests.
    • Debug mode can be enabled to get detailed request information to help diagnose issues.

Links and References

Discussion