Skip to content

PrestaShop Customer

The PrestaShop Customer component allows you to connect your Nappai workflows to your PrestaShop store. It helps you manage customer information securely and efficiently. You can use this component to create new customers, update existing details, search for customers by ID or email, and handle customer addresses. This ensures your store data stays synchronized with your automation processes.

How it Works

This component acts as a bridge between Nappai and your PrestaShop store via the PrestaShop API. When you configure the component and provide customer details, Nappai sends that information to your store. The system validates the data and performs the requested action, such as creating a customer profile or updating an address. You can also map data from other components to automate these actions dynamically. The component returns the result of the operation, which you can use in subsequent steps of your workflow.

Connection & Credentials

This component requires configuring a credential in the Nappai panel before interacting with the external service:

  1. Go to the Credentials section in your Nappai panel.
  2. Create a new credential of the type PrestaShop and fill in the required fields (Shop URL and PrestaShop API Key). You can generate your API Key in your PrestaShop admin panel under Advanced Parameters > Webservice.
  3. In your workflow, select the saved credential in the Credential input field of this node.

Mapping Mode

This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different 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.

Inputs

Input Fields

The following fields are available to configure this component. Each field may be visible in different operations:

  • Operation: Select the type of action you want to perform with the customer data.
  • Query Type: Choose how you want to find the customer, such as getting a list, searching by ID, or searching by email.
  • Customer ID: Enter the unique ID of a customer to retrieve, update, or delete.
  • Search Email: Enter an email address to search for a specific customer.
  • Max Results: Set the maximum number of customers to return in a search.
  • First Name: Enter the customer’s first name. Required field.
  • Last Name: Enter the customer’s last name. Required field.
  • Email: Enter the customer’s email address. Required field.
  • Password: Enter the account password for the customer. Required field. Mandatory when creating new customers.
  • Newsletter Subscription: Toggle this option to subscribe or unsubscribe the customer from newsletters.
  • Active: Toggle this option to activate or deactivate the customer account.
  • Address ID: Enter the ID of a specific customer address to retrieve.
  • Alias: Enter a name for the address, such as ‘Home’ or ‘Office’. Required field.
  • Address Line 1: Enter the main street address. Required field.
  • Address Line 2: Enter additional address details like apartment number.
  • Postal Code: Enter the postal or ZIP code. Required field.
  • City: Enter the city name. Required field.
  • Country ID: Enter the PrestaShop country ID (e.g., 6 for Spain, 21 for France). Required field.
  • State/Province ID: Enter the ID for the state or province.
  • Phone: Enter the customer’s phone number.

Outputs

This component produces the result of the customer operation. The output contains the processed customer data, including details like ID, names, email, and addresses, or a success status that you can use to trigger further actions in your workflow.

Output Data Example (JSON)json

{ “id”: 12345, “firstname”: “Jane”, “lastname”: “Doe”, “email”: “jane.doe@example.com”, “active”: true, “newsletter”: true, “phone”: “+34 600 123 456”, “addresses”: [ { “id”: 987, “alias”: “Home”, “address1”: “Calle Principal 123”, “city”: “Madrid”, “postal_code”: “28001”, “country”: “Spain” } ] }

Connectivity

This component is commonly used after a trigger that creates or updates customer data, such as a new order in an e-commerce platform or a form submission. You can connect the output of this component to other nodes to perform actions like sending confirmation emails, updating inventory, or logging data to a spreadsheet. It works well with components that require customer information, such as payment processors or customer relationship management tools.

Usage Example

You can use this component to automatically add new customers from a form to your PrestaShop store. Connect a form submission trigger to this component, map the user’s name and email to the First Name, Last Name, and Email fields, and run the workflow to sync the customer data. You can also use the component to update customer details when an order is modified or to retrieve customer information based on an email address.

Tips and Best Practices

  • API Key Permissions: Ensure your PrestaShop API key has the necessary permissions for the actions you plan to perform, such as creating or updating customers.
  • Unique Emails: Use the Email field as a unique identifier to avoid creating duplicate customer records.
  • Address Management: When managing addresses, verify the Country ID and State/Province ID match the options available in your PrestaShop store configuration.
  • Error Handling: Always check the output for errors; if a customer update fails, the error message can help you identify missing required fields or invalid data.

Security Considerations

  • API Key Security: Store your PrestaShop API key securely in the Nappai Credentials section. Never share this key publicly.
  • Sensitive Data: The Password field contains sensitive account information. Ensure your workflow is protected and that passwords are handled according to your security policies.
  • Data Validation: The component validates customer data before sending it to PrestaShop, reducing the risk of invalid records in your store.