Actions26
- Product Actions
- Order Actions
- Customer Actions
- Category Actions
- Stock Actions
Overview
This node integrates with the PrestaShop API to update stock information for products. Specifically, the "Update Stock" operation allows users to modify details of a stock entry identified by its Stock ID. This is useful in e-commerce scenarios where inventory levels, stock behaviors, or storage locations need to be programmatically adjusted to reflect real-time changes.
Practical examples include:
- Automatically updating product quantities after receiving new shipments.
- Changing out-of-stock behavior to allow backorders during promotional periods.
- Adjusting stock location metadata when reorganizing warehouse storage.
Properties
| Name | Meaning |
|---|---|
| Stock ID | The unique identifier of the stock entry to update. |
| Update Fields | A collection of fields to update for the stock entry: - Quantity: The available quantity of the product. - Out of Stock Behavior: Options are Deny Orders, Allow Orders, or Use Default behavior. - Depends on Stock: Boolean indicating if the product depends on stock management. - Location: Storage location description of the product. |
| Advanced Options | Additional optional settings: - Output Format: Choose between JSON (recommended) or XML response format. - Language ID: Numeric ID to filter localized fields (default is 1). - Display Fields: Choose to show all fields or specify custom fields. - Custom Fields: Comma-separated list of specific fields to return when using custom display. - Shop Context: Define scope as All Shops, Specific Shop, or Shop Group. - Shop ID: Numeric ID of the specific shop (shown if Specific Shop selected). - Shop Group ID: Numeric ID of the shop group (shown if Shop Group selected). - Enable Debug Mode: Boolean to add debug info (URL, method, params) to the response for troubleshooting. |
Output
The node outputs the updated stock data in the chosen format (JSON by default, or XML if specified). The main output is a JSON array containing the updated stock record(s) with fields reflecting the changes made.
If debug mode is enabled, additional metadata such as the request URL, HTTP method, and parameters used will be included in the output to assist with troubleshooting.
No binary data output is produced by this node.
Dependencies
- Requires an active connection to a PrestaShop instance via an API key credential configured in n8n.
- The node depends on the PrestaShop REST API being accessible and properly authenticated.
- No other external services or environment variables are required beyond the API authentication setup.
Troubleshooting
Common Issues:
- Invalid or missing Stock ID: The node requires a valid stock entry ID; ensure the ID exists in PrestaShop.
- Permission errors: The API key must have sufficient rights to update stock data.
- Network or connectivity problems: Verify that the PrestaShop API endpoint is reachable from the n8n environment.
- Incorrect field values: For example, setting negative quantities may cause errors.
Error Messages:
"Stock ID not found": Check that the provided Stock ID corresponds to an existing stock record."Unauthorized"or"Authentication failed": Confirm that the API key credential is correct and has necessary permissions."Invalid parameter": Review the input fields for correct types and allowed values, especially for options like Out of Stock Behavior.
Enabling debug mode can help identify issues by showing the exact API request details.