PrestaShop icon

PrestaShop

Interact with PrestaShop API

Overview

This node integrates with the PrestaShop API to retrieve multiple customer records based on various filtering, sorting, and pagination options. It is designed to fetch a list of customers from a PrestaShop store, supporting advanced query capabilities such as filtering by specific fields, sorting results, and controlling output format and language.

Common scenarios where this node is beneficial include:

  • Synchronizing customer data from PrestaShop into another system or database.
  • Generating reports or analytics on customer information.
  • Filtering customers based on custom criteria (e.g., active status, registration date).
  • Exporting customer lists for marketing or CRM purposes.

Practical example: A user wants to retrieve all customers who registered after a certain date, sorted by their last name in ascending order, and only return specific fields like id, name, and email in JSON format.

Properties

Name Meaning
Return All Whether to return all matching customer records or limit the number of results using pagination.
Limit Maximum number of customer records to return when not returning all. Value range: 1 to 1000.
Offset Number of customer records to skip before starting to collect the result set (used for pagination).
Filters Advanced filtering rules to narrow down the customer list. Each filter rule includes:
- Field: The customer field to filter by (e.g., name, id, active).
- Filter Type: Type of comparison (equals, contains, greater than, etc.).
- Value: The value to compare against. For ranges use "min,max", for lists use "val1
Sort Options Sorting configuration for the results:
- Sort Field: Customer field to sort by (e.g., id, name, date_add).
- Sort Direction: Ascending or Descending.
Output Format Format of the returned data: JSON (recommended) or XML.
Language ID Language ID to filter localized fields (default is 1, which is the default language).
Display Fields Controls which fields are included in the response:
- Full (all available fields)
- Custom Fields (specify a comma-separated list of fields to return).
Custom Fields Comma-separated list of specific fields to return when "Custom Fields" display option is selected (e.g., "id,name,email").
Shop Context Defines the shop context in multishop environments:
- All Shops
- Specific Shop
- Shop Group
Shop ID ID of the specific shop to work with (used if Shop Context is "Specific Shop").
Shop Group ID ID of the shop group to work with (used if Shop Context is "Shop Group").
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 customer objects in the chosen format (JSON or XML). Each object represents a customer record with fields depending on the selected display options:

  • If "Full" display is selected, all available customer fields are included.
  • If "Custom Fields" is selected, only the specified fields are present.
  • When debug mode is enabled, additional metadata about the API request is appended to the output.

If XML output is selected, the entire response is returned as an XML string instead of parsed JSON objects.

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 with the PrestaShop API.
  • The node depends on network access to the PrestaShop server.
  • No other external services or environment variables are required.

Troubleshooting

  • Common Issues:

    • Incorrect API credentials or insufficient permissions can cause authentication failures.
    • Invalid filter field names or unsupported filter types may lead to API errors.
    • Requesting too many records without enabling pagination might cause timeouts or performance issues.
    • Using incorrect shop context or IDs in multishop setups can result in empty or unexpected data.
  • Error Messages:

    • Authentication errors typically indicate invalid or missing API keys; verify credentials.
    • "Field not found" or similar errors suggest invalid filter or sort field names; check spelling and available fields.
    • Rate limiting or timeout errors may require reducing the number of requested records or adding delays between requests.
    • Debug mode can be enabled to get detailed request info to help diagnose issues.

Links and References

Discussion