Guide to Use Shopify Data in Product Discovery Collection

Steps to configure Shopify data in Product Discovery Collection

  1. Converting Product Data to Shopify-Compatible CSV
  2. Getting Shopify Store Fields for SearchBlox Product Discovery

Converting Product Data to Shopify-Compatible CSV

Overview

Any product dataset (JSON, CSV, etc.) can be converted into a Shopify-compatible CSV for import via Shopify Admin > Products > Import. The conversion involves mapping source fields to Shopify's 49-column CSV format and structuring rows correctly for variants and images.

📘

TIP:

Claude Code to generate a custom conversion script for any dataset:

You can use Claude Code to quickly generate a custom conversion script for any dataset. Simply provide your source data file and ask Claude Code to create a script that maps its fields to the Shopify CSV format. It will analyze the data structure and produce a ready-to-use converter.

Key Shopify CSV Fields

Shopify FieldDescription
HandleURL-friendly product identifier (lowercase, hyphens, no special chars)
TitleProduct name
Body (HTML)Product description in HTML
VendorBrand or manufacturer
TypeProduct category (e.g., Skincare > Moisturizer)
TagsComma-separated tags for filtering and search
Variant PriceSelling price
Variant Compare At PriceOriginal price (shows strikethrough if higher than selling price)
Image SrcImage URL
Variant SKUStock-keeping unit identifier
Option1 Name / ValueFirst variant option (e.g., Size)
Option2 Name / ValueSecond variant option (e.g., Color)
Variant Inventory QtyStock quantity
PublishedTRUE to make the product visible

CSV Structure

Shopify uses a multi-row format where products with multiple variants or images span several rows, all sharing the same Handle:

Row 1: Contains all product-level data (Title, Body, Vendor, Tags, etc.) + first variant + primary image.
Additional variant rows: Same Handle, only variant-specific fields filled (Option value, SKU, Price, Inventory).
Additional image rows: Same Handle, only Image Src, Image Position, and Image Alt Text filled.

📘

Examples:

Example 1:A product with 2 sizes and 3 images:

RowHandleTitleOption1 ValueImage SrcImage Position
1hydrating-creamHydrating Cream50mlprimary.jpg1
2hydrating-cream100ml
3hydrating-creamside-view.jpg2
4hydrating-creamclose-up.jpg3

Example 2: Ulta Dataset Conversion:

As a reference, the convert_to_shopify.py script converts an Ulta product JSON file to Shopify CSV:

python convert_to_shopify.py ulta_products.json shopify_products.csv

Key mappings used in this example:

Source FieldShopify Field
product_nameHandle (auto-generated), Title
brand_nameVendor
raw_description / summaryBody (HTML)
category_1, category_2, category_3Type (joined with >)
retail, sale_priceVariant Price, Variant Compare At Price
primary_image_urlImage Src
skuVariant SKU
product_size, colorOption1, Option2
uniq_idMetafield: searchblox.uniq_id

Importing into Shopify

  1. Go to Shopify Admin > Products > Import.
  2. Upload the generated CSV file.
  3. Review the preview and click Import products.
  4. Shopify will create all products with their variants and images.

For full details on Shopify's CSV format and requirements, see the official guide: Using CSV files — Shopify Help

Getting Shopify Store Fields for SearchBlox Product Discovery

Overview

To create a Product Discovery collection in SearchBlox, you need three fields from your Shopify store:

FieldDescriptionExample
Store DomainYour Shopify store's .myshopify.com domainyour-store.myshopify.com
Access TokenAdmin API access token (starts with shpat_)shpat_xxxxxxxxxxxxxxxxxxxx
API VersionShopify API version for requests2025-07

Steps to Get Each Field

  1. Store Domain
  2. Access Token (Admin API)
  3. API Version

Store Domain

  1. Log in to your Shopify Admin panel.
  2. The URL in your browser will be: https://admin.shopify.com/store/
  3. Your store domain is: .myshopify.com

Alternatively, go to Settings > Domains in Shopify Admin.

Access Token (Admin API)

Important — Shopify credential changes (January 2026): Shopify has deprecated the legacy custom app flow where you could create an app directly in the Shopify Admin and copy a static shpat_ access token from the screen. New apps must now be created through the Shopify Developer Dashboard or Shopify CLI, and access tokens are obtained via OAuth-based flows (client credentials grant, token exchange, or authorization code grant) rather than being displayed as a one-time copyable value. Tokens also expire regularly for improved security. See Shopify's official guide on generating access tokens for current instructions.

For existing custom apps (created before January 2026), the previously issued shpat_ tokens continue to work. If you already have one, you can use it directly in SearchBlox.

For new apps, follow these steps:

  1. Go to the Shopify Developer Dashboard and create a new app.
  2. Configure the required Admin API scopes:
    • read_products — to read product data
    • read_product_listings — to read product listings
    • read_inventory — to read inventory levels (optional)
    • read_content — to read pages/blogs (optional)
  3. Install the app on your store.
  4. Note the Client ID and Client Secret from the app's credentials page.
  5. Obtain the access token using the Client Credentials Grant flow:

Request

POST https://{your-store}.myshopify.com/admin/oauth/access_token
Content-Type: application/json

Payload

{
  "grant_type": "client_credentials",
  "client_id": "<your_client_id>",
  "client_secret": "<your_client_secret>"
}

Response

{
  "access_token": "shpat_xxxxxxxxxxxxxxxxxxxx",
  "scope": "read_products,read_inventory,...",
  "expires_in": 86400
}

Note: Tokens obtained via the client credentials grant expire after 24 hours. You will need to request a new token when the current one expires. This flow is available for apps installed on stores you own.

API Version

Shopify releases new API versions quarterly (e.g., 2025-01, 2025-04, 2025-07, 2025-10). Use the latest stable version available at the time of setup. In SearchBlox, select Custom from the API Version dropdown and enter the version string.

SearchBlox Configuration

  1. In SearchBlox Admin, navigate to the Product Discovery collection setup.
  2. Enter the fields:
    • Store Domain: your-store.myshopify.com
    • Access Token: shpat_xxxxxxxxxxxxxxxx
    • API Version: Select Custom and enter the version (e.g., 2025-07)
  3. Save the configuration. SearchBlox will use the Shopify Admin API to fetch product data for indexing and search.

📘

References:

Shopify CSV & Product Import

Shopify API & Authentication