Lesson 126 min

How to Connect n8n to Shopify

Learn how to connect n8n to your Shopify store by creating a custom app, configuring API permissions, and using the Shopify trigger to automate order workflows.

How to Connect n8n to Shopify

Connecting n8n to your Shopify store opens up powerful automation possibilities, allowing you to trigger workflows based on events like new orders, updated carts, or new customers. This tutorial will guide you through creating a custom Shopify app to get the necessary credentials for the n8n Shopify trigger.


Prerequisites

  • An n8n workflow.
  • A Shopify store with admin access.

Step 1: Create a Custom App in Shopify

To get the credentials n8n needs, you must create a "custom app" within your Shopify admin dashboard.

  1. Log in to your Shopify store admin.
  2. In the left-hand navigation menu, go to "Apps".
  3. Click on "App and sales channel settings", then select "Develop apps".
  4. Click the "Create an app" button.
  5. Give your app a name, such as n8n Integration Demo, and provide your app developer email.
  6. Click "Create app".

Step 2: Configure Admin API Scopes

Next, you need to define what data your app is allowed to access. These permissions are called "scopes."

  1. Once the app is created, go to the "Configuration" tab.
  2. In the "Admin API integration" section, click "Configure".
  3. You will see a long list of permissions (scopes). You must select the scopes that correspond to the triggers or actions you want to use in n8n.
  4. For an "On Order Created" trigger, you will need at least read_orders and read_products. It's a good practice to also grant write permissions if you plan to modify data later (e.g., write_products, write_orders).
  5. Select all the necessary permissions for your use case.
  6. Click "Save".

Note: If your n8n workflow fails with a 403 Forbidden error, it is almost always due to missing API scopes. For example, the read_orders scope requires read_products to work correctly. Always review the required scopes for your specific operation.


Step 3: Install the App and Get Credentials

After configuring the scopes, you need to install the app to generate the API credentials.

  1. Navigate to the "API credentials" tab.
  2. Click the "Install app" button and confirm the installation.
  3. After installation, the page will reveal your API credentials. You will need three pieces of information:
    • Admin API access token: Click "Reveal token once" to see and copy it.
    • API secret key.
    • Shop Subdomain: This is the unique part of your Shopify URL (e.g., your-store-name from your-store-name.myshopify.com).

⚠️ Important: Your Admin API access token will only be shown once. Copy it and store it in a safe place.


Step 4: Configure the Shopify Node in n8n

Now, return to your n8n workflow to set up the Shopify trigger.

  1. Add a Shopify Trigger node to your workflow.
  2. Select the event you want to listen for, such as "On Order Created".
  3. In the "Credential" field, click "Create New".
  4. Select the "Access Token" authentication method.
  5. Fill in the fields with the credentials you just copied from your Shopify app:
    • Access Token: Paste the "Admin API access token".
    • App Secret Key: Paste the "API secret key".
    • Shop Subdomain: Enter your shop's unique name.
  6. Click "Save". If the credentials are correct, you will see a "Connection tested successfully" message.

Step 5: Test the Shopify Trigger

Finally, let's test the trigger to ensure it's working.

  1. In the n8n editor, click "Test workflow" on your Shopify trigger. n8n will now be listening for the event.
  2. Go to your Shopify store and perform the action that should activate the trigger. For this example, create a new order (you can duplicate an existing one).
  3. Once the order is created in Shopify, the trigger in n8n should receive the data.

You will see the order details appear in the n8n trigger's output, confirming that you have successfully connected n8n to your Shopify store. You can now use this data to build powerful e-commerce automations.