Skip to content

Shopify

Shopify is a comprehensive e-commerce platform that enables individuals and businesses to create online stores.

ingestr supports Shopify as a source.

URI format

The URI format for Shopify is as follows:

plaintext
shopify://<shopify store URL>?api_key=token

URI parameters:

  • shopify store URI: the URL of the Shopify store you'd like to connect to, e.g. myawesomestore.myshopify.com
  • api_key: the API key used for authentication with the Shopify API

The URI is used to connect to the Shopify API for extracting data. More details on setting up Shopify integrations can be found here.

Setting up a Shopify Integration

To use the Shopify API, you need to create a custom app in the Shopify Partner Dashboard and install it in your store.

Step 1: Create or Select an App

  1. Go to the Shopify Dev Dashboard
  2. Select an existing app or create a new one

Step 2: Configure API Scopes

In the app configuration, make sure the app has read scopes for the data you want to ingest:

  • read_products
  • read_customers
  • read_orders
  • read_inventory
  • read_locations

After changing scopes:

  1. Create a new app version
  2. Release the new app version

Step 3: Install the App in Your Store

  1. Open the Shopify store admin: https://admin.shopify.com/store/your-store-name
  2. Go to SettingsApps and sales channels
  3. Find and open your app
  4. Install or reinstall the app so the new scopes become active

Step 4: Get the Admin API Access Token

  1. After installation, go back to Apps and sales channels
  2. Click on your app
  3. Click API credentials
  4. Copy the Admin API access token

Important: The access token is displayed only once. Copy and store it securely.

Once you have the API key (access token) and your store name (e.g. my-store.myshopify.com), you can connect. Example: if your API key is stored in SHOPIFY_API_KEY and your store is my-store, the command below will copy Shopify data into DuckDB:

sh
SHOPIFY_API_KEY=your_api_key \
ingestr ingest --source-uri "shopify://my-store.myshopify.com?api_key=${SHOPIFY_API_KEY}" --source-table "orders" --dest-uri "duckdb:///shopify.duckdb" --dest-table "dest.orders"

The result of this command will be a table in the shopify.duckdb database with JSON columns.

Tables

Shopify source allows ingesting the following sources into separate tables:

TablePKInc KeyInc StrategyDetails
ordersidupdated_atmergeRetrieves Shopify order data including customer info, line items, and shipping details
customersidupdated_atmergeRetrieves Shopify customer data including contact info and order history
discountsidupdated_atmergeRetrieves Shopify discount data using GraphQL API (use instead of deprecated price_rules)
productsidupdated_atmergeRetrieves Shopify product information including variants, images, and inventory
inventory_itemsidupdated_atmergeRetrieves Shopify inventory item details and stock levels
transactionsididmergeRetrieves Shopify transaction data for payments and refunds
balancecurrency-mergeRetrieves Shopify balance information for financial tracking
eventsidcreated_atmergeRetrieves Shopify event data for audit trails and activity tracking
price_rulesidupdated_atmergeDEPRECATED - Use discounts table instead

Use these as --source-table parameter in the ingestr ingest command.