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:
shopify://<shopify store URL>?api_key=tokenURI parameters:
shopify store URL: the Shopify store domain, e.g.myawesomestore.myshopify.comapi_key: the Admin API access token from your Shopify app. The query parameter is namedapi_keyfor compatibility, but its value is not the app's API key.
For this token-based connection, these are the only required values: the store domain and its Admin API access token. You do not need to provide the app's client ID or client secret.
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, create a custom app in the Shopify Dev Dashboard and install it in your store.
Step 1: Create or Select an App
- Go to the Shopify Dev Dashboard
- 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_productsread_customersread_ordersread_inventoryread_locations
After changing scopes:
- Create a new app version
- Release the new app version
Step 3: Install the App in Your Store
- Open the Shopify store admin:
https://admin.shopify.com/store/your-store-name - Go to Settings → Apps and sales channels
- Find and open your app
- Install or reinstall the app so the new scopes become active
Step 4: Get the Admin API Access Token
- After installation, go back to Apps and sales channels
- Click on your app
- Click API credentials
- Copy the Admin API access token
Important: The access token is displayed only once. Copy and store it securely.
Once you have the Admin API access token and your store name (e.g. my-store.myshopify.com), you can connect. Example: if the access token is stored in SHOPIFY_ADMIN_API_ACCESS_TOKEN and your store is my-store, the command below will copy Shopify data into DuckDB:
export SHOPIFY_ADMIN_API_ACCESS_TOKEN=your_admin_api_access_token
ingestr ingest --source-uri "shopify://my-store.myshopify.com?api_key=${SHOPIFY_ADMIN_API_ACCESS_TOKEN}" --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:
| Table | PK | Inc Key | Inc Strategy | Details |
|---|---|---|---|---|
| orders | id | updated_at | merge | Retrieves Shopify order data including customer info, line items, and shipping details |
| customers | id | updated_at | merge | Retrieves Shopify customer data including contact info and order history |
| discounts | id | updated_at | merge | Retrieves Shopify discount data using GraphQL API (use instead of deprecated price_rules) |
| products | id | updated_at | merge | Retrieves Shopify product information including variants, images, and inventory |
| inventory_items | id | updated_at | merge | Retrieves Shopify inventory item details and stock levels |
| transactions | id | id | merge | Retrieves Shopify transaction data for payments and refunds |
| balance | currency | - | merge | Retrieves Shopify balance information for financial tracking |
| events | id | created_at | merge | Retrieves Shopify event data for audit trails and activity tracking |
| price_rules | id | updated_at | merge | DEPRECATED - Use discounts table instead |
Use these as --source-table parameter in the ingestr ingest command.