Shopify & Ecommerce

How to Import Products from Google Sheets to Shopify with Apps Script Before You Launch

A step‑by‑step guide for small‑business owners to pull product data from Google Sheets into a Shopify store using Apps Script, covering setup, costs, common pitfalls, and a ready checklist.

If you’re ready to list dozens of items but don’t want to type each one into Shopify manually, you can push a ready‑made spreadsheet straight into your store using Google Apps Script. The method is free, works on a Shopify trial, and only requires a few minutes of setup.

What you need before you start

  • Shopify store – a free 14‑day trial is enough for the import.
  • Google account with access to the sheet that holds your product data.
  • API credentials – a private app (or custom app) with write_products scope enabled.
  • Basic comfort with copying code into the Apps Script editor (no deep programming needed).

All of these are free or already part of the tools you plan to use, so there are no extra monthly fees for the import itself.

Step 1 – Structure your Google Sheet correctly

Shopify expects certain fields for each product. Create a new sheet with the exact column headers shown below. You can add optional columns later, but the required ones are bold.

  1. Title – product name (required).
  2. Body (HTML) – full description; you can use plain text if you prefer.
  3. Vendor – brand or supplier name.
  4. Product Type – category used for filtering.
  5. Tags – comma‑separated tags for search.
  6. Published – TRUE or FALSE (set to FALSE for a pre‑launch import).
  7. Variant SKU – stock‑keeping unit.
  8. Variant Price – price in your store’s currency.
  9. Variant Inventory Qty – starting stock.
  10. Image Src – full URL of the product image (must be publicly accessible).

Keep the sheet in the default Sheet1 tab; the script references it by name, so rename the tab only if you also edit the script.

Referral disclosure: Nextpath Solutions may receive a referral fee if you create a Shopify account through these links.

Start your Shopify store

Step 2 – Create a private app and get API credentials

Shopify has moved most developers to custom apps. The process is the same for a private app:

  1. From your Shopify admin, go to Apps > Develop apps for your store.
  2. Click Create an app and give it a name like “Google Sheet Import”.
  3. In the Configuration tab, add the write_products and read_products scopes.
  4. Save, then click API credentials and press Install app. Copy the Admin API access token and the Storefront URL (e.g., yourstore.myshopify.com).

These two strings are the only secret values the Apps Script will need. Treat them like passwords – do not share them publicly.

Step 3 – Write and run the Apps Script

Open the Google Sheet, then choose Extensions > Apps Script. Replace the default code with the snippet below, inserting your store URL and API token where indicated.

const SHOP_URL = 'https://YOUR-STORE.myshopify.com'; const ACCESS_TOKEN = 'shpat_XXXXXXXXXXXXXXXXXXXXXXXX'; function importProducts() { const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1'); const rows = sheet.getDataRange().getValues(); const headers = rows.shift(); // first row = headers rows.forEach(row => { const product = {}; headers.forEach((header, i) => { product[header] = row[i]; }); // Build payload for a single‑variant product const payload = { product: { title: product['Title'], body_html: product['Body (HTML)'] || '', vendor: product['Vendor'] || '', product_type: product['Product Type'] || '', tags: product['Tags'] || '', published: product['Published'] === 'TRUE', variants: [{ sku: product['Variant SKU'] || '', price: product['Variant Price'] || '0.00', inventory_quantity: Number(product['Variant Inventory Qty']) || 0 }], images: product['Image Src'] ? [{src: product['Image Src']}] : [] } }; const options = { method: 'post', contentType: 'application/json', muteHttpExceptions: true, headers: { 'X-Shopify-Access-Token': ACCESS_TOKEN }, payload: JSON.stringify(payload) }; const url = `${SHOP_URL}/admin/api/2023-10/products.json`; const response = UrlFetchApp.fetch(url, options); const result = JSON.parse(response.getContentText()); Logger.log(result); }); }

Save the script, then click the ▶️ run button next to importProducts. The first run will ask you to authorize the script to access your spreadsheet and make external requests – click through the prompts.

If everything is formatted correctly, each row becomes a new product in your Shopify admin. You can verify by logging into Shopify and checking Products > All products.

Explore Shopify

Real‑world example (hypothetical)

Ali runs a small accessories brand in Pakistan. He has 48 SKUs ready in a Google Sheet, each with an image hosted on his Dropbox public folder. He follows the steps above, using a Shopify trial store (ali‑accessories.myshopify.com) and a custom app token. The import script runs in about 2 minutes, creating 48 products with correct titles, prices, and images. No extra cost was incurred – the only expense will be the Shopify plan he eventually upgrades to.

Common mistakes and how to fix them

  • Missing required columns – Shopify will reject the request. Double‑check that every required header exists and is spelled exactly as shown.
  • Image URLs not public – If the URL returns a 403 or 404, the product will be created without an image. Use a CDN or a public folder.
  • Rate‑limit errors – Shopify limits API calls to 4 requests per second. If you have hundreds of rows, add a Utilities.sleep(250) after each fetch call.
  • Currency mismatch – Prices are stored in the store’s default currency. Convert your numbers beforehand if you plan to sell in a different currency.
  • Accidental publishing – Set the Published column to FALSE during a pre‑launch import. You can bulk‑publish later from the Shopify admin.

Checklist before you hit “Run”

  1. Shopify trial or paid store created.
  2. Custom app with write_products scope installed.
  3. API token and store URL copied into the script.
  4. Google Sheet columns match the required headers.
  5. All image URLs are publicly reachable.
  6. Prices are expressed in the store’s default currency.
  7. Set Published to FALSE for a pre‑launch import.
  8. Optional: add a short Utilities.sleep(250) line if you have more than 100 rows.

When to consider professional help

If you have any of the following, it may be worth hiring a Shopify developer or a Nextpath consultant:

  • More than 500 SKUs – the script can be extended to batch requests, but a developer can add error‑handling and retries.
  • Complex product structures (multiple variants, custom metafields, or SEO‑rich descriptions).
  • Need for ongoing synchronization (e.g., inventory updates from a supplier’s spreadsheet).

In most small‑business cases, the free script works perfectly and saves hours of manual entry.

FAQs

Do I need a paid Shopify plan to use the API?

No. The API is available on the free trial and on any paid plan. You only need to create a custom app and grant the required scopes.

Can I import product images that are stored on my local computer?

Shopify’s API requires a publicly accessible URL. Upload the images to a cloud storage service (Google Drive public link, Dropbox, or an image CDN) before adding the URL to the sheet.

What if I make a mistake after the import?

You can delete or edit products directly in the Shopify admin, or run a second script that updates existing products using their id. Keeping a column for the Shopify product ID in your sheet makes updates easier.

Conclusion

Using Google Apps Script to import a product catalog is a low‑cost, low‑skill way to get your Shopify store ready for launch. By preparing a correctly formatted sheet, creating a simple custom app, and running the script, you can move from a spreadsheet to a live catalog in minutes. Follow the checklist, watch for the common pitfalls, and you’ll have a solid foundation before you start marketing or accepting orders.

Get started with Shopify

Ready to try it? Open a Shopify trial, set up the custom app, and give the script a test run with a handful of dummy rows. If you hit a roadblock, the Nextpath team can help you fine‑tune the import or build a more advanced sync solution.