This guide explains how to prepare your Shopify store and configuration so the Python Shopify connector can read data from your store using the GraphQL Admin API under the hood.
Note: If you don't have a Shopify store yet, you can create a development store through Shopify Partners for free testing.
If you're new to Shopify development, we recommend starting with a development store:
Note: Your store URL will be your-name.myshopify.com
- keep this for API calls.
For realistic testing of your connector, especially if you'll be reading orders and payment data:
Why This Matters: Having realistic test data ensures your connector can handle real-world scenarios and edge cases during development.
If you later decide to turn your connector into an installable Shopify app:
npm install -g @shopify/cli @shopify/theme
shopify auth login
shopify app dev
for local development with hot reloadingshopify store preview
to test your app in different store contextsNote: This is optional for the current read-only connector implementation but useful if you plan to expand functionality later.
Important Note: This connector uses the GraphQL Admin API by default with no REST fallback in this release. Provide SHOPIFY_SHOP
, SHOPIFY_API_VERSION
(e.g., 2025-07
), and SHOPIFY_ACCESS_TOKEN
before use. REST may be added later if needed.
Future Considerations:
read_products
, read_collections
(or read_collection_listings
)read_inventory
, read_locations
read_orders
, read_fulfillments
read_customers
X-Shopify-Access-Token
header with every API requestUnderstanding API Scopes: Each scope grants access to specific data. For example:
read_products
allows you to fetch products, variants, and their metadataread_orders
gives access to order history, customer details, and fulfillment statusread_inventory
provides current stock levels across locationsyour-store.myshopify.com
(no protocol)2025-07
(pin a stable version)export SHOPIFY_SHOP="your-store.myshopify.com"
export SHOPIFY_API_VERSION="2025-07"
export SHOPIFY_ACCESS_TOKEN="<your-admin-api-access-token>"
Use these values when configuring the connector:
{
"shop": "{SHOPIFY_SHOP}",
"apiVersion": "2025-07",
"accessToken": "<SHOPIFY_ACCESS_TOKEN>",
"useGraphQL": true,
"defaults": { "query": { "limit": 250 } }
}
Note: This is a minimal configuration. For advanced options including retry policies, rate limiting, connection pooling, and hooks, see the Configuration Guide.
GET /admin/api/{version}/shop.json
with header X-Shopify-Access-Token: <token>
X-Shopify-Shop-Api-Call-Limit: used/40
in response headersOptional REST Smoke Test (Manual):
import requests
store = "your-store-name" # no https, just the subdomain
token = "shpat_xxx" # Admin API access token
url = f"https://{store}.myshopify.com/admin/api/2025-07/shop.json"
r = requests.get(url, headers={
"X-Shopify-Access-Token": token
})
r.raise_for_status()
print(r.json())
# If that returns shop data, your connector is authenticated and ready to go
X-Shopify-Shop-Api-Call-Limit
and maps GraphQL cost extensions into headers for visibility. 429 is retried with backoff and Retry-After
.edges
/pageInfo
) with limit
defaulted and capped internally (≤250).apiVersion
and monitor X-Shopify-Api-Deprecated-Reason
warnings.For richer test data, you can programmatically create customers and orders in a development store. The helper script uses GraphQL to create customers and draft orders, completes them, then creates a REST test transaction (Bogus gateway) so order.test == true
.
Prerequisites:
write_customers
, write_draft_orders
, write_orders
Usage:
# Reuse existing customers tagged automation-test
python test/test_create_test_orders.py --count 1000 --skip-customers --customer-tag automation-test
# Create new customers and orders (avoid duplicates with an offset)
python test/test_create_test_orders.py --count 1000 --customer-tag automation-test --customer-offset 1000
# Handle draft order REST rate limits more patiently
python test/test_create_test_orders.py --count 50 --skip-customers --customer-tag automation-test --rest-retries 8 --rest-sleep 70
# Add --verbose for additional logging
python test/test_create_test_orders.py --count 10 --skip-customers --customer-tag automation-test --verbose
Notes:
SHOPIFY_SHOP
, SHOPIFY_API_VERSION
, SHOPIFY_ACCESS_TOKEN
.automation-test
by default.401 Unauthorized: Check that your access token is correct and hasn't been revoked 403 Forbidden: Verify you have the correct API scopes enabled for the endpoint you're trying to access 404 Not Found: Ensure your shop domain is correct and the API version exists 429 Too Many Requests: The connector handles this automatically, but you can monitor rate limit headers 500+ Server Errors: These are usually temporary; the connector will retry automatically
Still having issues? Check the Shopify API documentation for endpoint-specific requirements and limitations.