Skip to main content
ShopifyTools enable an Agent to analyze sales data, product performance, and customer insights using the Shopify Admin GraphQL API.

Prerequisites

The following example requires the openai library and a Shopify Admin API access token with appropriate scopes.
Set the following environment variables:
  • SHOPIFY_SHOP_NAME: Your Shopify shop name (e.g., “my-store” from my-store.myshopify.com)
  • SHOPIFY_ACCESS_TOKEN: Your Shopify Admin API access token
  • OPENAI_API_KEY: Your OpenAI API key
You can get your access token from: Shopify Admin > Settings > Apps and sales channels > Develop apps Required API scopes:
  • read_orders (for order and sales data)
  • read_products (for product information)
  • read_customers (for customer insights)
  • read_analytics (for analytics data)

Example

The following agent will analyze sales data and provide insights.
cookbook/91_tools/shopify_tools.py

Toolkit Params

Toolkit Functions

Developer Resources