PrestaShop Order
The PrestaShop Order component allows you to interact with your PrestaShop store directly within your automation workflow. It helps you retrieve order information, fetch details for specific orders, and update order statuses. This component connects your Nappai automation to your store’s data, enabling you to streamline order management tasks without needing complex coding.
How it Works
This component works by connecting securely to your PrestaShop store using the PrestaShop API. When you configure the component, it sends requests to your store to fetch order data or update order information. The component handles the communication behind the scenes, returning results in a clear format that you can use in subsequent steps of your workflow. It supports both retrieving single orders and managing lists of orders, making it versatile for various automation scenarios.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with the external service:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type PrestaShop and fill in the required fields (Shop URL, PrestaShop Api Key).
- In your workflow, select the saved credential in the Credential input field of this node.
Inputs
Mapping Mode
This component supports Mapping Mode, which allows for flexible and dynamic workflows. When Mapping Mode is enabled, each input field provides three ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
The following fields are available to configure this component:
- Credential: Select the PrestaShop credential you configured earlier to authenticate your connection to the store.
- Query Type: Choose how you want to retrieve orders. Options include getting a full list, fetching a specific order by ID, or retrieving recent orders from the last 24 hours.
- Order ID: The unique identifier of the order you want to retrieve or update. Only required when the Query Type is set to fetch a specific order.
- Max Results: Set the maximum number of orders to return. This helps control the volume of data when retrieving lists, ensuring efficient performance.
- New Order Status: The status you want to assign to an order. Only required when you are updating the status of an existing order.
Outputs
This component produces Data containing the results of your order operations. The output includes detailed order information, lists of orders, and status indicators that can be mapped to other components for further processing, such as saving to a database, sending notifications, or triggering actions.
Output Data Example (JSON)json
{ “orders”: [ { “id”: 1050, “customer_name”: “Jane Smith”, “status”: “Shipped”, “total_price”: 120.50, “date”: “2023-10-27T14:30:00” }, { “id”: 1051, “customer_name”: “John Doe”, “status”: “Processing”, “total_price”: 85.00, “date”: “2023-10-27T15:00:00” } ], “success”: true, “error_message”: null }
Connectivity
This component is designed to integrate seamlessly into workflows involving e-commerce data management. You can connect its output to components that handle data storage, reporting, or notifications. For example:
- Connect to a Database component to save order details for record-keeping.
- Connect to a Notification component to alert staff about specific order statuses.
- Use the output as input for a Condition component to make decisions based on order values or states.
Usage Example
Scenario: Retrieve and Log Recent Orders
- Set Query Type to “Recent Orders” to fetch orders from the last 24 hours.
- Set Max Results to
50to limit the number of orders retrieved. - Connect the Data output to a Spreadsheet or Database component to log the orders.
- Run the workflow to automatically capture and store your recent sales data.
Tips and Best Practices
- Use Max Results wisely: When retrieving lists, set an appropriate limit to avoid overwhelming your workflow or API.
- Check Order IDs: Ensure the Order ID matches the exact identifier in PrestaShop to avoid retrieval errors.
- Handle Errors: The output includes status information. Use this to build workflows that react to errors or failures gracefully.
- Credential Management: Keep your API keys secure and only grant necessary permissions in PrestaShop.
Security Considerations
- Always use the Credential feature to store your API keys securely within Nappai.
- Ensure your PrestaShop API key has the minimum permissions required for the operations you perform.
- The component uses secure connections to communicate with your store; avoid sharing workflow configurations containing credentials.