Automate Shopify product creation with Zapier and Cloudhooks

Tired of manually creating products in your Shopify store? By combining Zapier's automation platform with Cloudhooks' custom logic capabilities, you can automatically create products from Google Sheets.

Zapier is a powerful automation platform that connects over 7,000 applications and services. While Zapier offers native Shopify integration, combining it with Cloudhooks enables advanced workflows with custom logic and data transformations—all without writing complex code or installing additional Shopify apps.

We'll demonstrate this by showing you how to automatically create Shopify products from Google Sheets using Zapier and Cloudhooks, eliminating manual data entry and reducing errors.

What you'll build

In this tutorial, you'll create an automation that:

  1. Monitors a Google Sheet for new product entries
  2. Automatically creates corresponding products in your Shopify store
  3. Handles product details including title, description, and tags

Time to complete: ~20 minutes
Difficulty level: Intermediate

Prerequisites

  • A Shopify store with Cloudhooks installed
  • A Google account
  • A Zapier account

Setting up your product data sheet

First, let's create a Google Sheet that will serve as your product data source. This sheet will contain all the necessary information to create products in Shopify.

  1. Create a new Google Sheet
  2. Add the following columns:
    • Title (Product name)
    • Description (Can include HTML formatting)
    • Tags (Comma-separated)

Here's an example of how your sheet should look:

Creating your Cloudhooks integration

Before setting up Zapier, we need to create a Cloudhooks endpoint that will receive and process the product data. We'll create a hook with an external trigger and secure it with an API key.

Generate an API key

First, let's create a secure API key that Zapier will use to authenticate its requests:

1) Press the “Settings” button on the “Overview” page.

2) In the “Access tokens” section, press the “Generate token” button:

3) Give a name to the access token and generate it.

💡 Security Tip: Store this API key safely—you'll need it when configuring Zapier, and it can't be retrieved later.

Create the external trigger hook

Now we'll create a hook that listens for incoming product data from Zapier:

1) Press the “Create hook” button on the “Overview” page.

2) On the “Trigger” tab, choose the “External” trigger type, and press the “Select” button:

3) Save the hook, and an endpoint URL will be generated for the hook. Take note of the URL, you’ll need it in Zapier:

4) Select the “API key” authentication method, set the “Parameter type” to “HTTP Header” and set the “Parameter name” to “x-http-authentication”.

This hook will:

  • Accept incoming HTTP POST requests from Zapier
  • Validate the API key
  • Process the product data
  • Create the product in Shopify

The external trigger gives you flexibility to receive data from any system that can make HTTP requests, not just Zapier.

5) Switch to the "Hook" tab. For initial testing, we'll use a simple script that logs the incoming data:

module.exports = async function(payload, actions, context) {

  console.log('Payload received: ', payload);

}

This basic script helps verify that Zapier is correctly sending data to your hook. Once confirmed, you can enhance it with product creation logic.

6) Last thing we have to do is to activate the hook on the “Settings” tab:

Testing your hook configuration

Before moving to Zapier, verify your hook setup:

  1. The hook should show as "Active" in your dashboard
  2. Note the endpoint URL—you'll need this for Zapier
  3. Keep your API key handy for the next steps

Creating your Zapier workflow

With both your Google Sheet and Cloudhooks endpoint ready, let's build the Zapier automation. We'll create a two-step workflow:

  1. A trigger that monitors your Google Sheet for new product entries
  2. An action that sends the product data to your Cloudhooks endpoint

Here's what the complete workflow will look like:

Step 1: Configure the Google Sheets Trigger

First, let's set up Zapier to monitor your product sheet:

1) In Zapier, click "Create Zap"

2) In the trigger configuration:

  • Select "Google Sheets" as your app
  • Choose "New or Updated Spreadsheet Row" as the trigger event
  • Connect your Google account if you haven't already

3) In the trigger settings:

  • Select your product sheet from Google Drive
  • Choose the worksheet containing your product data
  • Leave "Trigger Column" as "any_column" to monitor all columns

Test the connection by adding a sample row to your sheet

💡 Tip: After testing, review the sample data to ensure Zapier correctly reads all your columns.

Step 2: Configure the webhook action

After setting up the Google Sheets trigger, we'll configure Zapier to send data to your Cloudhooks endpoint:

1) Click the plus (+) icon after your trigger to add an action

2) In the action setup:

  • Search for and select "Webhooks by Zapier"
  • Choose "POST" as the action event

3) In the webhook configuration:

  • URL: Enter your Cloudhooks endpoint URL (copied earlier)
  • Payload Type: Select "json"
  • Data: Map your spreadsheet columns to JSON fields as follows:

4) Additional settings:

  • Set "Wrap request in array" to "No"
  • Leave "File" empty
  • Set "Unflatten" to "Yes"

5) Add authentication:

  • In the "Headers" section, add a new header:
    • Name: x-http-authentication
    • Value: Your Cloudhooks API key

Testing the Complete Workflow

  1. Click "Test & Review" to verify your webhook configuration
  2. Zapier will attempt to send a test request to your Cloudhooks endpoint
  3. A successful test will show "OK" in the response:

💡 Tip: Check your Cloudhooks logs to verify the payload was received correctly.

Testing and troubleshooting

Verify the Integration

To confirm your automation is working correctly:

  1. Open your Google Sheet
  2. Add a new product row with test data
  3. Press the “Re-check” button on the “Test” tab of the action
  4. Check the Cloudhooks logs:
    • Navigate to your hook's "Logs" tab
    • Look for a new run log entry
    • Verify the payload contains your test product data

Common Issues and Solutions

No logs in Cloudhooks

  • Verify your Zap is turned on
  • Check the API key in Zapier matches your Cloudhooks key
  • Confirm the webhook URL is correct

Data not formatted correctly

  • Review your Google Sheet column names
  • Check the JSON mapping in Zapier
  • Ensure all required fields have values

Extending the integration

Now that you have the basic integration working, let's enhance it by adding the actual product creation code in Cloudhooks using the Shopify GraphQL Admin API.

Adding product creation logic

Replace the test hook code with this production-ready version:

module.exports = async function(payload, actions, context) {
    const query = `mutation CreateProduct($input: ProductInput!) { 
      productCreate(input: $input) { 
        product { 
          id 
          title 
          
        } 
        userErrors { 
          field 
          message 
          
        } 
      } 
    }`;
    const variables = {
        input: {
            title: payload.title,
            descriptionHtml: payload.description,
            tags: payload.tags.split(',').map(tag => tag.trim()),
        }
    };
    
    const result = await actions.shopify.graphql({
      query, 
      variables 
    });
    
    if (result.data.productCreate.userErrors.length > 0) {
        throw new Error(`Product creation failed: ${result.data.productCreate.userErrors.map(err => err.message).join(', ')}`);
    }
};

This enhanced hook:

  • Uses Shopify's GraphQL Admin API for product creation
  • Properly formats product data from your spreadsheet
  • Includes error handling for failed product creation
  • Supports HTML formatting in product descriptions
  • Automatically trims and formats product tags

Testing the Enhanced Integration

To verify the integration is working:

  1. Add a new product row to your Google Sheet
  2. Wait approximately 1 minute for Zapier to process the new row
  3. Check your Shopify admin for the new product
  4. Review the Cloudhooks logs to confirm successful execution

Summary

This integration demonstrates the power of combining Zapier with Cloudhooks for Shopify automation. While this example focuses on basic product creation, the possibilities for extending and customizing the workflow are endless. You can build upon this foundation to create more complex automations that match your specific business needs.