Actions26
- Product Actions
- Order Actions
- Customer Actions
- Category Actions
- Stock Actions
Overview
This node interacts with the PrestaShop API to retrieve stock information about products. Specifically, the "Get All Stocks" operation fetches a list of stock entries from the PrestaShop store. This is useful for inventory management, reporting, or synchronizing stock data with other systems.
Common scenarios include:
- Monitoring current stock levels across multiple shops or shop groups.
- Exporting stock data for analysis or integration with ERP/warehouse systems.
- Filtering stock data by language or customizing which fields are returned to optimize payload size.
Example use case: A retailer wants to automatically pull all stock data daily to update their internal database and trigger alerts if stock falls below certain thresholds.
Properties
| Name | Meaning |
|---|---|
| Advanced Options | Collection of optional parameters to customize the request: |
| - Output Format | Choose response format: JSON (recommended) or XML. |
| - Language ID | Numeric ID to filter localized fields by language (default is 1). |
| - Display Fields | Control which fields are returned: Full (All Fields) or Custom Fields. |
| - Custom Fields | Comma-separated list of specific fields to return when "Custom Fields" is selected (e.g., "id,name,price,reference"). |
| - Shop Context | Define the shop context in multishop environments: All Shops, Specific Shop, or Shop Group. |
| - Shop ID | Numeric ID of the specific shop to work with (shown only if "Specific Shop" is selected). |
| - Shop Group ID | Numeric ID of the shop group to work with (shown only if "Shop Group" is selected). |
| - Enable Debug Mode | Boolean flag to add debug information (such as URL, HTTP method, and parameters) to the response for troubleshooting purposes. |
Output
The node outputs an array of JSON objects representing stock entries. Each object contains fields describing stock details such as product identifiers, quantities, references, and possibly localized fields depending on the language filter.
If binary data were involved (not indicated here), it would be summarized accordingly, but this node primarily returns structured JSON data.
When debug mode is enabled, additional metadata about the API request (URL, method, parameters) is included in the output to assist with troubleshooting.
Dependencies
- Requires connection to a PrestaShop instance via its REST API.
- Needs an API key credential configured in n8n for authentication.
- The node dynamically imports operation-specific code for handling stock operations.
- No other external services are required beyond the PrestaShop API.
Troubleshooting
Common issues:
- Incorrect API credentials or insufficient permissions can cause authentication errors.
- Specifying invalid shop or shop group IDs may result in empty responses or errors.
- Requesting custom fields that do not exist will lead to incomplete or empty data.
- Choosing XML output format requires proper parsing downstream; JSON is recommended.
Error messages:
- Authentication failures typically indicate invalid or missing API keys.
- Network errors suggest connectivity issues with the PrestaShop server.
- Validation errors occur if input parameters (like language ID or shop context) are out of range or inconsistent.
Resolutions:
- Verify API credentials and permissions.
- Double-check numeric IDs for shops and groups.
- Use debug mode to inspect the exact API request and response.
- Prefer JSON output unless XML is specifically needed.