---
title: Schemas
description: >-
  Choose a ShopifyQL schema and open its reference page to find metrics and
  dimensions.
api_version: 2026-07
source_url:
  html: 'https://shopify.dev/docs/api/shopifyql/latest/schemas'
  md: 'https://shopify.dev/docs/api/shopifyql/latest/schemas.md'
api_name: shopifyql
---

# Schemas

Each ShopifyQL schema is a table you query with [`FROM`](https://shopify.dev/docs/api/shopifyql/latest/syntax/from-and-show#from), like [`sales`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/sales) or [`customers`](https://shopify.dev/docs/api/shopifyql/latest/schemas/customers/customers). A schema defines the metrics you can measure and the dimensions you can break them down by. Choosing one is the first decision in any query, because it sets which fields the rest of your query can use.

Use this reference to browse every schema and find the metrics and dimensions you can query.

## Query the sales schema

```shopifyql
FROM sales
  SHOW total_sales, orders, average_order_value
  GROUP BY sales_channel
  DURING last_month
```

***

## What's in a schema

Each schema covers one business area, so it groups the metrics and dimensions that belong together: sales data lives in [`sales`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/sales), customer behavior in [`customers`](https://shopify.dev/docs/api/shopifyql/latest/schemas/customers/customers), and payment disputes in [`chargebacks`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/chargebacks). A query can reference only the fields its schema defines.

### Metrics

Metrics are the values a schema lets you measure, like `total_sales`, `orders`, and `average_order_value` in the `sales` schema. You return them with [`SHOW`](https://shopify.dev/docs/api/shopifyql/latest/syntax/from-and-show#show). Each schema page lists its metrics with a data type and description.

### Dimensions

Dimensions are the attributes a schema lets you break those metrics down by, like `sales_channel`, `product_title`, or `month`. Group by them with [`GROUP BY`](https://shopify.dev/docs/api/shopifyql/latest/syntax/group-by), bucket them over time with [`TIMESERIES`](https://shopify.dev/docs/api/shopifyql/latest/syntax/timeseries), or filter on them with [`WHERE`](https://shopify.dev/docs/api/shopifyql/latest/syntax/where). Each schema page lists its dimensions next to its metrics.

![The sales schema split into the metrics you measure, such as total\_sales, orders, and average\_order\_value, and the dimensions you break them down by, such as sales\_channel, product\_title, and month.](https://shopify.dev/assets/assets/images/landing-pages/templated-apis/shopifyql-next/shopifyql-schema-fields-light-DMFj5ZwJ.svg)

***

## Customers

Use this schema to analyze customer acquisition, retention, and lifetime behavior.

| Name | Description |
| - | - |
| [`customers`](https://shopify.dev/docs/api/shopifyql/latest/schemas/customers/customers) | Customer records, including first-purchase timing, new customer counts, lifetime spend, order count, average spend per order, and days since last order. |

***

## Finance and payments

Use these schemas to reconcile money movement, payment activity, fees, payouts, gift cards, store credit, and payment disputes.

| Name | Description |
| - | - |
| [`chargebacks`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/chargebacks) | Payment disputes, including chargeback counts, amounts, rates, reasons, reported fraud, and [Rapid Dispute Resolution](https://help.shopify.com/en/manual/payments/chargebacks/network-dispute-resolution-programs) status. |
| [`fees`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/fees) | [Shopify Payments](https://help.shopify.com/en/manual/payments/shopify-payments) processing, foreign exchange, and [Managed Markets](https://help.shopify.com/en/manual/international/managed-markets) fee amounts and averages. |
| [`gift_cards`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/gift_cards) | Gift card issuance, sales, adjustments, disablement, and starting and ending balances over time. |
| [`payment_attempts`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payment_attempts) | Payment attempt volume, failures, and authorization rates by payment method, amount, card details, and retry pattern. |
| [`payments`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payments) | Payment transaction amounts, refunds, gift card redemptions, payment methods, gateways, and transaction status by order and customer. |
| [`payouts`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payouts) | Payout amounts from payment transactions by payout currency and date. |
| [`store_credit_summaries`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/store_credit_summaries) | Store credit starting balance, ending balance, and net change by date and currency. |
| [`store_credit_transactions`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/store_credit_transactions) | Credited, debited, and expired store credit by event, source, customer, company, order, currency, and expiration date. |

***

## Inventory

Use these schemas to understand stock quantities, location availability, adjustments, shipments, and transfers.

| Name | Description |
| - | - |
| [`inventory`](https://shopify.dev/docs/api/shopifyql/latest/schemas/inventory/inventory) | Inventory item history by stock levels, units sold, days in stock or out of stock, sell-through rate, days remaining, and inventory value over time. |
| [`inventory_adjustment_history`](https://shopify.dev/docs/api/shopifyql/latest/schemas/inventory/inventory_adjustment_history) | Inventory quantity changes and adjustment counts by reason, state, app, staff member, and reference document. |
| [`inventory_by_location`](https://shopify.dev/docs/api/shopifyql/latest/schemas/inventory/inventory_by_location) | Inventory stock levels, net unit changes, days in stock or out of stock, days remaining, and value by location over time. |
| [`inventory_shipments`](https://shopify.dev/docs/api/shopifyql/latest/schemas/inventory/inventory_shipments) | Shipped, received, accepted, and rejected quantities by carrier, tracking, status, and origin and destination. |
| [`inventory_transfers`](https://shopify.dev/docs/api/shopifyql/latest/schemas/inventory/inventory_transfers) | Inventory transfer quantities and counts by item, origin, destination, app, and staff member. |

***

## Marketing

Use these schemas to measure campaign performance and ad spend.

| Name | Description |
| - | - |
| [`campaign_products`](https://shopify.dev/docs/api/shopifyql/latest/schemas/marketing/campaign_products) | Product quantities and average order quantities for orders attributed to marketing campaigns. |
| [`campaign_sales`](https://shopify.dev/docs/api/shopifyql/latest/schemas/marketing/campaign_sales) | Campaign-attributed orders, sales, and average order value across first-click, last-click, last non-direct click, and linear attribution models. |
| [`campaign_sessions`](https://shopify.dev/docs/api/shopifyql/latest/schemas/marketing/campaign_sessions) | Campaign-attributed online store visits, including page views, cart additions, checkout progress, and conversion rates. |
| [`marketing_engagements`](https://shopify.dev/docs/api/shopifyql/latest/schemas/marketing/marketing_engagements) | Engagement, spend, order, and sales metrics reported by marketing channels for marketing events. |
| [`shop_campaign_insights`](https://shopify.dev/docs/api/shopifyql/latest/schemas/marketing/shop_campaign_insights) | Sales, customers, ad spend, customer acquisition cost, and return on ad spend from [Shop Campaigns](https://help.shopify.com/en/manual/online-sales-channels/shop/shop-campaigns). |

***

## Orders

Use these schemas to analyze order operations, including fulfillment, shipping label costs, and profitability.

| Name | Description |
| - | - |
| [`fulfillments`](https://shopify.dev/docs/api/shopifyql/latest/schemas/orders/fulfillments) | Fulfillment speed and volume from order placement through fulfillment, shipping handoff, and delivery. |
| [`profitability`](https://shopify.dev/docs/api/shopifyql/latest/schemas/orders/profitability) | Per-order profitability before returns, including revenue, cost of goods sold, shipping costs, duties, import taxes, sales taxes, and fulfillment costs. |
| [`shipping_labels`](https://shopify.dev/docs/api/shopifyql/latest/schemas/orders/shipping_labels) | Shipping label counts and costs by carrier, service, origin, destination, package, and order. |

***

## Sales revenue

Use these schemas to analyze sales, returns, discounts, taxes, and subscriptions.

| Name | Description |
| - | - |
| [`discounts`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/discounts) | Discounted order counts and discount amounts across product, order, shipping, and app-applied discounts. |
| [`returns`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/returns) | Returned item quantities by return status, reason, refund, return app, staff member, and line item. |
| [`sales`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/sales) | Core sales metrics across channels, including revenue, orders, discounts, taxes, shipping, sales reversals, and customer type. |
| [`sales_taxes`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/sales_taxes) | Tax amounts applied to sales and returns by tax name, rate, location, sales channel, product, and order. |
| [`subscriptions`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/subscriptions) | Subscription counts for active, added, and canceled subscriptions over time. |

***

## Sessions and behavior

Use these schemas to understand online store traffic, search behavior, product recommendations, Shop engagement, forms, and web performance.

| Name | Description |
| - | - |
| [`global_searches`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/global_searches) | Global catalog search requests by product, product variant, store, and time. |
| [`low_engagement_product_recommendations`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/low_engagement_product_recommendations) | Low-engagement product recommendations and their click-rate gap from the store's 30-day average. |
| [`product_recommendation_conversions`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/product_recommendation_conversions) | Click, cart-addition, and purchase conversion metrics for online store product recommendations. |
| [`search_conversions`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/search_conversions) | Click, cart-addition, and purchase conversion metrics for online store search sessions. |
| [`search_queries`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/search_queries) | Online store search query volume and result-click counts by query and click status. |
| [`searches`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/searches) | Online store search query volume by query, intent, content type, and whether results were returned. |
| [`sessions`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/sessions) | Online store visits, page views, traffic sources, devices, visitor locations, cart additions, checkout progress, and conversion rates. |
| [`shop_post_purchase_offers`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/shop_post_purchase_offers) | Counts of customers who receive Shop post-purchase offers by discount code and time. |
| [`shop_product_impressions`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/shop_product_impressions) | Product impression counts in the Shop channel by product and time. |
| [`shopify_forms`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/shopify_forms) | Views, submissions, and conversion rates for [Shopify Forms](https://help.shopify.com/en/manual/promoting-marketing/create-marketing/forms-app) by form, page type, and product. |
| [`web_performance`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sessions_and_behavior/web_performance) | Online store page load, responsiveness, and visual stability metrics by page, device, browser, and storefront. |

***
