A DreamFactory service package for connecting to Shopify stores via the Admin API. This connector provides read-only access to your Shopify store data including products, orders, customers, and collections.
- Products: List products, get individual products, and access product variants
- Orders: List orders with filtering by status, financial status, and date ranges
- Customers: List customers and access individual customer details
- Collections: List collections and browse products within collections
- Advanced Filtering: Server-side filtering using Shopify API parameters
- Performance Optimized: Lightweight responses with optional large field inclusion
- Read-Only Access: Secure read-only mode for data analytics and reporting
- DreamFactory 4.0+
- PHP 8.0+
- Shopify Admin API access (Private App)
Add the package to your DreamFactory's composer.json
:
{
"repositories": [
{
"type": "path",
"url": "/path/to/dreamfactory-development-packages/df-shopify"
}
],
"require": {
"dreamfactory/df-shopify": "*"
}
}
composer install
php artisan migrate
php artisan cache:clear
- Go to your Shopify Admin:
https://your-store.myshopify.com/admin
- Navigate to Apps > App and sales channel settings
- Click Develop apps > Create an app
- Configure Admin API access with these permissions:
read_products
read_orders
read_customers
read_collections
- Log into your DreamFactory Admin Console
- Go to Services > Create > Remote Service > Shopify Store
- Fill in the configuration:
Field | Description | Example |
---|---|---|
Name | Service name | my_shopify |
Label | Display name | My Shopify Store |
Shop Domain | Your Shopify domain | my-store.myshopify.com |
API Key | Admin API Key from Private App | abc123... |
API Secret | Admin API Secret from Private App | def456... |
Access Token | Admin API Access Token | shpat_789... |
API Version | Shopify API version | 2023-10 |
Use the API Docs to test your endpoints:
GET /api/v2/my_shopify/products
GET /api/v2/my_shopify/orders
GET /api/v2/my_shopify/customers
GET /api/v2/my_shopify/collections
# List products
GET /api/v2/my_shopify/products?limit=10
# Get specific product
GET /api/v2/my_shopify/products/123456789
# Get product variants
GET /api/v2/my_shopify/products/123456789/variants
# Filter products
GET /api/v2/my_shopify/products?filter=vendor='Nike' AND status='active'
# List orders
GET /api/v2/my_shopify/orders?limit=50
# Filter by status
GET /api/v2/my_shopify/orders?financial_status=paid
# Filter by date range
GET /api/v2/my_shopify/orders?created_at_min=2023-01-01&created_at_max=2023-12-31
# List customers
GET /api/v2/my_shopify/customers
# Get specific customer
GET /api/v2/my_shopify/customers/123456789
# Filter by state
GET /api/v2/my_shopify/customers?state=enabled
# List collections
GET /api/v2/my_shopify/collections
# Get specific collection
GET /api/v2/my_shopify/collections/123456789
# Get products in collection
GET /api/v2/my_shopify/collections/123456789/products
Use the fields
parameter to limit returned data for better performance:
# Only return id, title, and price
GET /api/v2/my_shopify/products?fields=id,title,price
# Include large fields like description and images
GET /api/v2/my_shopify/products?fields=id,title,description,images
The connector supports both DreamFactory-style SQL filters and Shopify-specific parameters:
# DreamFactory SQL-style filter
GET /api/v2/my_shopify/products?filter=vendor='Nike' AND status='active'
# Direct Shopify parameters
GET /api/v2/my_shopify/orders?financial_status=paid&fulfillment_status=shipped
# Standard pagination
GET /api/v2/my_shopify/products?limit=25&offset=50
# Shopify cursor-based pagination
GET /api/v2/my_shopify/products?since_id=123456789
By default, list endpoints exclude large fields for better performance:
- Products: Excludes
description
,images
,variants
,options
- Orders: Excludes
line_items
,addresses
,shipping_lines
- Customers: Excludes
addresses
,default_address
Use the fields
parameter to explicitly include these when needed.
Filters are passed directly to Shopify's API for efficient server-side processing, reducing bandwidth and improving response times.
The connector includes comprehensive error handling:
- Authentication errors: Clear messages for invalid credentials
- Rate limiting: Automatic handling of Shopify API rate limits
- Not found errors: Proper 404 responses for missing resources
- Validation errors: Detailed error messages for invalid requests
- Read-only access: All write operations (POST, PUT, DELETE) are blocked
- Encrypted storage: API secrets and access tokens are encrypted in the database
- Input validation: All parameters are validated before sending to Shopify
-
"Invalid API key or access token"
- Verify your Private App credentials
- Check that the API key and access token match
-
"No operations defined in spec"
- Clear application cache:
php artisan cache:clear
- Restart your DreamFactory service
- Clear application cache:
-
Empty responses
- Check your Private App permissions
- Verify the shop domain is correct (without
https://
)
Check DreamFactory logs for detailed error information:
tail -f storage/logs/dreamfactory.log | grep -i shopify
For issues and questions:
- Check the DreamFactory Documentation
- Review Shopify Admin API Documentation
- Contact DreamFactory Support
This package is licensed under the same license as DreamFactory.