---
title: sales
description: >-
  Reference for the ShopifyQL `sales` table. Every metric and dimension, paired
  with worked example queries.
api_version: 2026-07
source_url:
  html: 'https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/sales'
  md: 'https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/sales.md'
api_name: shopifyql
---

# sales

The `sales` [schema](https://shopify.dev/docs/api/shopifyql/latest/schemas) captures the primary sales data for revenue and sale line-item analysis. Each row records one event, and a single order can produce multiple rows if refunds or adjustments follow. It's the broadest sales source, connecting sale amounts and adjustments to orders, customers, products, variants, discounts, refunds, staff, billing, and POS context.

### Use cases

* **Revenue trend**: Show [`gross_sales`](#salesmetric-propertydetail-grosssales), [`discounts`](#salesmetric-propertydetail-discounts), [`returns`](#salesmetric-propertydetail-returns), and [`net_sales`](#salesmetric-propertydetail-netsales) together by month to see how top-line revenue moves.
* **Product performance**: Group [`net_sales`](#salesmetric-propertydetail-netsales) by [`product_id`](#salesdimension-propertydetail-productid), [`product_variant_id`](#salesdimension-propertydetail-productvariantid), or [`customer_id`](#salesdimension-propertydetail-customerid) to rank what drives revenue.
* **Cost coverage**: Compare [`net_sales_with_cost_recorded`](#salesmetric-propertydetail-netsaleswithcostrecorded) and [`net_sales_without_cost_recorded`](#salesmetric-propertydetail-netsaleswithoutcostrecorded) to find revenue coverage for cost-based reporting.
* **Sale components**: Break out [`shipping_charges`](#salesmetric-propertydetail-shippingcharges), [`duties`](#salesmetric-propertydetail-duties), [`additional_fees`](#salesmetric-propertydetail-additionalfees), [`return_fees`](#salesmetric-propertydetail-returnfees), and [`taxes_excluding_gift_cards`](#salesmetric-propertydetail-taxesexcludinggiftcards) to see what's bundled into a sale beyond product revenue.

Examples

### Examples

* ####

  ##### Description

  Chart weekly \`gross\_sales\`, \`discounts\`, and \`net\_sales\` over last quarter. This example uses \[\`TIMESERIES week\`]\(/docs/api/shopifyql/latest/syntax/timeseries) to show how discounts pull gross sales down to net week by week.

  ##### ShopifyQL

  ```shopifyql
  FROM sales
    SHOW gross_sales, discounts, net_sales
    TIMESERIES week WITH TOTALS
    DURING last_quarter
    ORDER BY week ASC
  VISUALIZE gross_sales, discounts, net_sales TYPE line
  ```

* ####

  ##### Description

  Chart daily \`total\_sales\` over the last 30 days with a percent-change column. This example uses \[\`COMPARE TO previous\_period\`]\(/docs/api/shopifyql/latest/syntax/compare-to) to benchmark each day against the same day 30 days earlier.

  ##### ShopifyQL

  ```shopifyql
  FROM sales
    SHOW total_sales
    TIMESERIES day WITH TOTALS, PERCENT_CHANGE
    SINCE startOfDay(-30d) UNTIL today
    COMPARE TO previous_period
    ORDER BY day ASC
  VISUALIZE total_sales TYPE line
  ```

* ####

  ##### Description

  Rank your sales channels by \`gross\_sales\` last month, grouped by \`sales\_channel\`. This example pairs \[\`ORDER BY\`]\(/docs/api/shopifyql/latest/syntax/order-by) \`gross\_sales DESC\` with \`LIMIT 10\`, so the sort decides which 10 channels survive the cut.

  ##### ShopifyQL

  ```shopifyql
  FROM sales
    SHOW gross_sales
    GROUP BY sales_channel WITH TOTALS
    DURING last_month
    ORDER BY gross_sales DESC
    LIMIT 10
  VISUALIZE gross_sales TYPE horizontal_bar
  ```

* ####

  ##### Description

  Rank last month's top 10 products by \`net\_sales\`, splitting each product's bar into new and returning buyers. This example ranks on the \[\`GROUP\_TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with) per-product subtotal, so the order reflects each product's combined sales rather than either segment alone.

  ##### ShopifyQL

  ```shopifyql
  FROM sales
    SHOW net_sales, orders, net_items_sold, average_order_value
    GROUP BY ONLY TOP 10 product_title, new_or_returning_customer WITH TOTALS,
      GROUP_TOTALS
    DURING last_month
    ORDER BY net_sales__product_title_totals DESC, net_sales DESC, product_title
      ASC, new_or_returning_customer ASC
  VISUALIZE net_sales TYPE bar
  ```

***

## Metrics

Counts and calculations that let you track key business indicators. Metrics show up as the columns when queried.

Metrics you can use when querying `FROM sales`.

* **acceptable\_​fraud\_​risk\_​rate**

  **PERCENT**

  Percentage of orders marked as low or medium risk by Shopify's fraud analysis

* **additional\_​fees**

  **MONEY**

  Additional fees associated with the given sale

* **amount\_​spent\_​per\_​customer**

  **MONEY**

  The average all-time spend for customers in your results, in your store's currency.

* **average\_​order\_​value**

  **MONEY**

  The average amount per order before post-order adjustments, in your store's currency.

  `Average order value = (gross sales - discounts) / orders`

* **bundles\_​ordered**

  **INTEGER**

  The number of bundles ordered before returned or reversed quantities are taken out. Use [`bundles_ordered`](#salesmetric-propertydetail-bundlesordered) to track bundle demand over time or by [`bundle_title`](#salesdimension-propertydetail-bundletitle).

* **cost\_​of\_​goods\_​sold**

  **MONEY**

  The direct cost of the products sold, such as manufacturing or purchase cost, in your store's currency. Use [`cost_of_goods_sold`](#salesmetric-propertydetail-costofgoodssold) with [`gross_profit`](#salesmetric-propertydetail-grossprofit) or [`gross_margin`](#salesmetric-propertydetail-grossmargin) to evaluate profitability.

* **customers**

  **INTEGER**

  Counts each customer one time within the selected sales, even if the customer placed more than one order.

* **discount\_​reversals**

  **MONEY**

  Discount values no longer applied when discounted products are removed from orders

* **discounts**

  **MONEY**

  The amount taken off sales revenue through discounts, in your store's currency. Use [`discounts`](#salesmetric-propertydetail-discounts) to track discounting over time or by groupings like [`discount_code`](#salesdimension-propertydetail-discountcode).

* **duties**

  **MONEY**

  Customs duties or import tariffs associated with sales, in your store's currency. Use [`duties`](#salesmetric-propertydetail-duties) to report duty amounts over time or by destination fields like [`shipping_country`](#salesdimension-propertydetail-shippingcountry).

* **gift\_​card\_​discounts**

  **MONEY**

  Discounts applied to gift card sales, in your store's currency. Values are negative amounts. Use [`gift_card_discounts`](#salesmetric-propertydetail-giftcarddiscounts) to track reductions on gift card sales over time.

* **gift\_​card\_​gross\_​sales**

  **MONEY**

  Gift card sales revenue before discounts and returns are taken out, in your store's currency. Use [`gift_card_gross_sales`](#salesmetric-propertydetail-giftcardgrosssales) to see top-line gift card revenue over time.

* **gift\_​card\_​net\_​sales**

  **MONEY**

  Gift card sales revenue after discounts and returns are factored in, in your store's currency. Use [`gift_card_net_sales`](#salesmetric-propertydetail-giftcardnetsales) to measure gift card revenue net of those reductions.

* **gift\_​card\_​taxes**

  **MONEY**

  Taxes for sales of gift cards

* **gross\_​margin**

  **PERCENT**

  The share of sales kept as gross profit after cost of goods sold is factored in. Gross margin is based on sales where cost of goods sold is recorded.

  `Gross margin = gross profit / net sales`

* **gross\_​profit**

  **MONEY**

  Sales revenue after cost of goods sold is taken out, before other operating expenses, in your store's currency.

  `Gross profit = net sales - cost of goods sold`

* **gross\_​sales**

  **MONEY**

  Top-line sales revenue before discounts and returns are taken out, in your store's currency. Use [`gross_sales`](#salesmetric-propertydetail-grosssales) to see gross revenue over time or by a grouping like product or channel. It excludes taxes, shipping, duties, and fees.

* **gross\_​sales\_​reversals**

  **MONEY**

  Value of items removed from orders before discounts and taxes

* **high\_​fraud\_​risk\_​rate**

  **PERCENT**

  The share of orders Shopify's fraud analysis marked as high risk, shown as a percentage. Use [`high_fraud_risk_rate`](#salesmetric-propertydetail-highfraudriskrate) to monitor risky orders over time or by groupings like [`sales_channel`](#salesdimension-propertydetail-saleschannel).

* **line\_​item\_​discounts**

  **MONEY**

  Discounts applied to specific line items, in your store's currency. Use [`line_item_discounts`](#salesmetric-propertydetail-lineitemdiscounts) to track product-level discounting over time or by product.

* **net\_​items\_​sold**

  **INTEGER**

  The number of items sold after returned or reversed quantities are factored in. Use [`net_items_sold`](#salesmetric-propertydetail-netitemssold) to track product movement over time or by product.

* **net\_​sales**

  **MONEY**

  Sales revenue after discounts and sales reversals, excluding taxes, shipping, duties, and fees, in your store's currency.

  `Net sales = gross sales - discounts - sales reversals`

* **net\_​sales\_​reversals**

  **MONEY**

  Value of items removed from orders after discounts, before taxes

  `Net sales reversals = gross sales reversals + discount reversals`

* **net\_​sales\_​with\_​cost\_​recorded**

  **MONEY**

  Product net sales where cost of goods sold is recorded, in your store's currency. Use [`net_sales_with_cost_recorded`](#salesmetric-propertydetail-netsaleswithcostrecorded) to understand the revenue base used for profit measures.

* **net\_​sales\_​without\_​cost\_​recorded**

  **MONEY**

  Product net sales where cost of goods sold isn't recorded, in your store's currency. Use [`net_sales_without_cost_recorded`](#salesmetric-propertydetail-netsaleswithoutcostrecorded) to find revenue missing cost data.

* **new\_​customers**

  **INTEGER**

  The number of customers whose order in your results was their first purchase. Use [`new_customers`](#salesmetric-propertydetail-newcustomers) to track customer acquisition over time or by groupings like [`sales_channel`](#salesdimension-propertydetail-saleschannel).

* **number\_​of\_​orders\_​per\_​customer**

  **INTEGER**

  The average lifetime number of orders placed by customers in your results. Use [`number_of_orders_per_customer`](#salesmetric-propertydetail-numberoforderspercustomer) to understand repeat purchase depth over time or by customer cohort.

* **order\_​level\_​discounts**

  **MONEY**

  Discounts applied across the entire order, in your store's currency. Use [`order_level_discounts`](#salesmetric-propertydetail-orderleveldiscounts) to track order-wide discounting over time or by discount fields.

* **order\_​sale\_​agreements**

  **INTEGER**

  The number of order agreements that produced sale activity.

* **orders**

  **INTEGER**

  Counts each order one time within the selected sales, even when the order contains multiple items.

* **orders\_​first\_​time**

  **INTEGER**

  The number of orders placed by customers making their first purchase. Use [`orders_first_time`](#salesmetric-propertydetail-ordersfirsttime) to track first-purchase order volume over time.

* **orders\_​returning**

  **INTEGER**

  The number of orders placed by customers who had bought from you before. Use [`orders_returning`](#salesmetric-propertydetail-ordersreturning) to track repeat order volume over time.

* **quantity\_​ordered**

  **INTEGER**

  The number of items ordered before returned or reversed quantities are taken out. Use [`quantity_ordered`](#salesmetric-propertydetail-quantityordered) to track ordered item volume over time or by product.

* **quantity\_​ordered\_​per\_​order**

  **INTEGER**

  The average number of items ordered per order before returned or reversed quantities are taken out. Use [`quantity_ordered_per_order`](#salesmetric-propertydetail-quantityorderedperorder) to track typical basket size over time.

* **rate\_​of\_​staff\_​assisted\_​sales**

  **PERCENT**

  The share of sales revenue assisted by a staff member, shown as a percentage. Use [`rate_of_staff_assisted_sales`](#salesmetric-propertydetail-rateofstaffassistedsales) to understand how much revenue involves staff assistance over time or by retail location.

* **return\_​fees**

  **MONEY**

  Fees associated with returns, in your store's currency. Use [`return_fees`](#salesmetric-propertydetail-returnfees) to track return fee amounts over time or by return reason.

* **returning\_​customer\_​rate**

  **PERCENT**

  The share of customers in your results who had bought from you before.

  `Returning customer rate = returning customers / customers`

* **returning\_​customers**

  **INTEGER**

  The number of customers who placed an order after a previous purchase. Use [`returning_customers`](#salesmetric-propertydetail-returningcustomers) to track repeat customer activity over time or by grouping.

* **reversed\_​quantity**

  **INTEGER**

  Number of items removed from orders

* **reversed\_​quantity\_​rate**

  **PERCENT**

  Percentage of items removed from orders out of total items sold

* **sales\_​reversals**

  **MONEY**

  Value removed from orders through refunds, returns, cancellations, or edits

* **shipping\_​charge\_​discounts**

  **MONEY**

  Discounts applied to shipping charges, in your store's currency. Use [`shipping_charge_discounts`](#salesmetric-propertydetail-shippingchargediscounts) to track shipping discount amounts over time.

* **shipping\_​charge\_​taxes**

  **MONEY**

  Taxes charged on shipping, in your store's currency. Use [`shipping_charge_taxes`](#salesmetric-propertydetail-shippingchargetaxes) to report shipping tax amounts over time or by destination.

* **shipping\_​charges**

  **MONEY**

  The amount customers spent on shipping before shipping discounts and shipping taxes are factored into total shipping, in your store's currency. Use [`shipping_charges`](#salesmetric-propertydetail-shippingcharges) to track shipping revenue over time.

* **shipping\_​reversals**

  **MONEY**

  Shipping charges removed from orders

* **tax\_​reversals**

  **MONEY**

  Tax amounts removed from orders

* **taxes**

  **MONEY**

  Taxes charged on sales, in your store's currency. Use [`taxes`](#salesmetric-propertydetail-taxes) to report total tax amounts over time or by destination fields.

* **taxes\_​excluding\_​gift\_​cards**

  **MONEY**

  Taxes charged on sales excluding taxes from gift card sales, in your store's currency. Use [`taxes_excluding_gift_cards`](#salesmetric-propertydetail-taxesexcludinggiftcards) when you want tax amounts without gift card tax included.

* **tips**

  **MONEY**

  Customer gratuities added to sales, in your store's currency. Use [`tips`](#salesmetric-propertydetail-tips) to track tip amounts over time or by retail location.

* **total\_​sales**

  **MONEY**

  The full amount customers spent, including taxes, shipping, duties, and fees, in your store's currency.

  `Total sales = net sales + additional fees + duties + shipping charges + taxes`

* **total\_​sales\_​first\_​time**

  **MONEY**

  The full amount spent by customers making their first purchase, in your store's currency. Use [`total_sales_first_time`](#salesmetric-propertydetail-totalsalesfirsttime) to track revenue from newly acquired customers over time or by channel.

* **total\_​sales\_​returning**

  **MONEY**

  The full amount spent by customers who had bought from you before, in your store's currency. Use [`total_sales_returning`](#salesmetric-propertydetail-totalsalesreturning) to track repeat customer revenue over time or by channel.

* **total\_​sales\_​reversals**

  **MONEY**

  Total value removed from orders, including products, shipping, taxes, and fees

  `Total sales reversals = net sales reversals + shipping reversals + sale reversal fees + tax reversals`

* **total\_​shipping\_​charges**

  **MONEY**

  The full shipping amount customers spent, in your store's currency. It reflects shipping charges after shipping discounts and shipping taxes are included. Use [`total_shipping_charges`](#salesmetric-propertydetail-totalshippingcharges) to track total shipping revenue over time.

  `Total shipping charges = shipping charges - shipping discounts + shipping taxes`

* **discounts\_​returned**

  **MONEY**

  **deprecated**

  Discount values no longer applied when discounted products are removed from orders

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`discount_reversals`](#salesmetric-propertydetail-discountreversals)

* **gross\_​returns**

  **MONEY**

  **deprecated**

  Value of items removed from orders before discounts and taxes

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`gross_sales_reversals`](#salesmetric-propertydetail-grosssalesreversals)

* **net\_​returns**

  **MONEY**

  **deprecated**

  Value of items removed from orders after discounts, before taxes

  `Net returns = gross returns + discounts returned`

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`net_sales_reversals`](#salesmetric-propertydetail-netsalesreversals)

* **quantity\_​returned**

  **INTEGER**

  **deprecated**

  Number of items removed from orders

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`reversed_quantity`](#salesmetric-propertydetail-reversedquantity)

* **returned\_​quantity\_​rate**

  **PERCENT**

  **deprecated**

  Percentage of items removed from orders out of total items sold

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`reversed_quantity_rate`](#salesmetric-propertydetail-reversedquantityrate)

* **returns**

  **MONEY**

  **deprecated**

  Value removed from orders through refunds, returns, cancellations, or edits

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`sales_reversals`](#salesmetric-propertydetail-salesreversals)

* **shipping\_​returned**

  **MONEY**

  **deprecated**

  Shipping charges removed from orders

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`shipping_reversals`](#salesmetric-propertydetail-shippingreversals)

* **taxes\_​returned**

  **MONEY**

  **deprecated**

  Tax amounts removed from orders

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`tax_reversals`](#salesmetric-propertydetail-taxreversals)

* **total\_​returns**

  **MONEY**

  **deprecated**

  Total value removed from orders, including products, shipping, taxes, and fees

  `Total returns = net returns + shipping returned + return fees + taxes returned`

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`total_sales_reversals`](#salesmetric-propertydetail-totalsalesreversals)

### PERCENT

A percentage value represented as a decimal, where 0.25 represents 25%.

```ts
```

### MONEY

A monetary amount representing currency values such as prices, revenue, costs, and discounts.

```ts
```

### INTEGER

A whole number without decimal places, used for counts, quantities, and other discrete numeric values.

```ts
```

***

## Dimensions

Attributes of your data that let you look more granularly at aspects of the data. Group and filter by dimensions to shape the rows your query returns.

**Note:**

You can also group by or filter on custom metafields for customers, orders, products, and variants. Reference a metafield as `<owner>.metafields.<namespace>.<key>`, where `<owner>` is `customer`, `order`, `product`, or `product_variant`. To query a metafield, its definition must have the [`analyticsQueryable`](https://shopify.dev/docs/apps/build/metafields/use-metafield-capabilities#analytics-queryable) capability enabled. [Learn more about metafields](https://shopify.dev/docs/apps/build/metafields).

Dimensions you can use when querying `FROM sales`.

* **agentic\_​sales\_​channel**

  **STRING**

  The AI agent or assistant that directly helped facilitate the sale. Values are Google AI Mode and Gemini, Microsoft Copilot, and Shop.

* **assisting\_​staff\_​id**

  **IDENTITY**

  The unique Shopify identifier for the staff member who assisted with the retail sale. Use [`assisting_staff_id`](#salesdimension-propertydetail-assistingstaffid) to filter to a specific staff member, or use it with [`assisting_staff_member_name`](#salesdimension-propertydetail-assistingstaffmembername) to show readable labels.

* **billing\_​address\_​id**

  **IDENTITY**

  The unique Shopify identifier for the billing address on the order. Use [`billing_address_id`](#salesdimension-propertydetail-billingaddressid) to filter to a specific billing address, or use billing location fields for readable results.

* **channel\_​id**

  **IDENTITY**

  The unique Shopify identifier for the multi-channel app sales channel. Use [`channel_id`](#salesdimension-propertydetail-channelid) to filter to a specific channel by its Shopify identifier.

* **cost\_​is\_​recorded**

  **BOOLEAN**

  Whether cost of goods sold is recorded for the product sale. You can filter by [`cost_is_recorded`](#salesdimension-propertydetail-costisrecorded) to focus on sales with or without cost data. Values are `true` and `false`.

* **customer\_​id**

  **IDENTITY**

  The unique Shopify identifier for the customer on the sale. Use [`customer_id`](#salesdimension-propertydetail-customerid) to break results down by customer, or use it with [`customer_name`](#salesdimension-propertydetail-customername) or [`customer_email`](#salesdimension-propertydetail-customeremail) to show readable labels.

* **day**

  **DAY\_TIMESTAMP**

  The day a sale happened.

* **day\_​of\_​week**

  **DAY\_OF\_WEEK**

  The day of week a sale happened, with values Monday through Sunday.

* **discount\_​line\_​id**

  **STRING**

  The unique Shopify identifier for the discount line on the sale. Use [`discount_line_id`](#salesdimension-propertydetail-discountlineid) to filter to a specific discount application.

* **excludes\_​post\_​order\_​adjustments**

  **BOOLEAN**

  Whether the sale reflects the original order state before adjustments made after the order was created. You can filter by [`excludes_post_order_adjustments`](#salesdimension-propertydetail-excludespostorderadjustments) when you want original order activity. Values are `true` and `false`.

* **hour**

  **HOUR\_TIMESTAMP**

  The hour a sale happened.

* **hour\_​of\_​day**

  **HOUR\_OF\_DAY**

  The hour of day a sale happened, with values 0 through 23.

* **is\_​discounted\_​sale**

  **BOOLEAN**

  Whether the sale had a discount applied. You can filter by [`is_discounted_sale`](#salesdimension-propertydetail-isdiscountedsale) to separate discounted sales from full-price sales. Values are `true` and `false`.

* **is\_​pos\_​sale**

  **BOOLEAN**

  Whether the sale was made in person at a physical retail (POS) location. You can filter by [`is_pos_sale`](#salesdimension-propertydetail-ispossale) to separate in-store sales from other sales. Values are `true` and `false`.

* **is\_​sale\_​adjustment**

  **BOOLEAN**

  Whether the sale reflects an adjustment. You can filter by [`is_sale_adjustment`](#salesdimension-propertydetail-issaleadjustment) to focus on adjustment activity. Values are `true` and `false`.

* **is\_​sales\_​reversal**

  **BOOLEAN**

  Label specifying whether the transaction reverses a previous sale

* **line\_​item\_​id**

  **IDENTITY**

  The unique Shopify identifier for the line item on the sale. Use [`line_item_id`](#salesdimension-propertydetail-lineitemid) to filter to a specific item within an order.

* **line\_​type**

  **STRING**

  The kind of sales line represented, such as Product, Shipping, Duty, and Tip. You can group or filter by [`line_type`](#salesdimension-propertydetail-linetype) to review sales amounts by line category.

* **minute**

  **MINUTE\_TIMESTAMP**

  The minute a sale happened.

* **month**

  **MONTH\_TIMESTAMP**

  The month a sale happened.

* **month\_​of\_​year**

  **MONTH\_OF\_YEAR**

  The month of the year a sale happened, with values 1 through 12.

* **months\_​since\_​first\_​purchase**

  **INTEGER**

  The number of months between the customer's first order and this order, reported in your store's time zone. A value of -1 means this order is the customer's first order. You can group or filter by [`months_since_first_purchase`](#salesdimension-propertydetail-monthssincefirstpurchase) to analyze customer repeat timing.

* **new\_​or\_​returning\_​customer**

  **STRING**

  Whether an order came from a customer's very first purchase (New) or a later one (Returning). You can filter or group by [`new_or_returning_customer`](#salesdimension-propertydetail-neworreturningcustomer) to compare acquisition against repeat business. Values are New and Returning.

* **order\_​id**

  **IDENTITY**

  The unique Shopify identifier for the order. Use [`order_id`](#salesdimension-propertydetail-orderid) to filter to a specific order or break results down by order, or use it with [`order_name`](#salesdimension-propertydetail-ordername) to show customer-facing labels.

* **order\_​or\_​sales\_​reversal**

  **STRING**

  Label specifying whether the transaction adds or removes value from sales

* **pos\_​location\_​id**

  **IDENTITY**

  The unique Shopify identifier for the physical retail location. Use [`pos_location_id`](#salesdimension-propertydetail-poslocationid) to filter to a specific POS location, or use it with [`pos_location_name`](#salesdimension-propertydetail-poslocationname) to show readable labels.

* **product\_​id**

  **IDENTITY**

  The unique Shopify identifier for the product, which can include multiple variants. Use [`product_id`](#salesdimension-propertydetail-productid) to filter to a specific product, or use it with [`product_title`](#salesdimension-propertydetail-producttitle) to show readable labels.

* **product\_​variant\_​id**

  **IDENTITY**

  The unique Shopify identifier for the product variant. Use [`product_variant_id`](#salesdimension-propertydetail-productvariantid) to filter to a specific variant, or use it with [`product_variant_title`](#salesdimension-propertydetail-productvarianttitle) or [`product_variant_sku`](#salesdimension-propertydetail-productvariantsku) to show readable labels.

* **quarter**

  **QUARTER\_TIMESTAMP**

  The quarter a sale happened.

* **quarters\_​since\_​first\_​purchase**

  **INTEGER**

  The number of quarters between the customer's first order and this order, reported in your store's time zone. A value of -1 means this order is the customer's first order. You can group or filter by [`quarters_since_first_purchase`](#salesdimension-propertydetail-quarterssincefirstpurchase) to analyze customer repeat timing.

* **refund\_​id**

  **IDENTITY**

  The unique Shopify identifier for the refund. Use [`refund_id`](#salesdimension-propertydetail-refundid) to filter to a specific refund in sales and returns results.

* **sale\_​id**

  **IDENTITY**

  The unique Shopify identifier for the sale. Use [`sale_id`](#salesdimension-propertydetail-saleid) to filter to a specific sale.

* **sale\_​sales\_​channel\_​id**

  **IDENTITY**

  The unique Shopify identifier for the sales channel where the sale happened. Use [`sale_sales_channel_id`](#salesdimension-propertydetail-salesaleschannelid) to filter to a specific sales channel when you need the identifier.

* **sales\_​channel**

  **STRING**

  Name of the sales channel where the customer made a purchase

* **sales\_​line\_​item\_​group\_​id**

  **IDENTITY**

  The unique Shopify identifier for the bundle connected to the sale. Use [`sales_line_item_group_id`](#salesdimension-propertydetail-saleslineitemgroupid) to filter to a specific bundle, or use it with [`bundle_title`](#salesdimension-propertydetail-bundletitle) to show readable labels.

* **second**

  **SECOND\_TIMESTAMP**

  The second a sale happened.

* **shipping\_​address\_​id**

  **IDENTITY**

  The unique Shopify identifier for the shipping address on the order. Use [`shipping_address_id`](#salesdimension-propertydetail-shippingaddressid) to filter to a specific shipping address, or use shipping location fields for readable results.

* **shop\_​id**

  **IDENTITY**

  The unique Shopify identifier for your store. Use [`shop_id`](#salesdimension-propertydetail-shopid) with [`shop_name`](#salesdimension-propertydetail-shopname) to show readable store labels.

* **staff\_​id**

  **IDENTITY**

  The unique Shopify identifier for the staff member associated with the order. Use [`staff_id`](#salesdimension-propertydetail-staffid) to filter to a specific staff member, or use it with [`staff_member_name`](#salesdimension-propertydetail-staffmembername) to show readable labels.

* **subscription\_​or\_​one\_​time**

  **STRING**

  Whether the product sale was a one-time purchase or a subscription purchase. You can group or filter by [`subscription_or_one_time`](#salesdimension-propertydetail-subscriptionoronetime) to compare subscription and one-time sales. Values are One-time and Subscription.

* **week**

  **WEEK\_TIMESTAMP**

  The week a sale happened.

* **week\_​of\_​year**

  **WEEK\_OF\_YEAR**

  The week of the year a sale happened, with values 1 through 53.

* **weeks\_​since\_​first\_​purchase**

  **INTEGER**

  The number of weeks between the customer's first order and this order, reported in your store's time zone. A value of -1 means this order is the customer's first order. You can group or filter by [`weeks_since_first_purchase`](#salesdimension-propertydetail-weekssincefirstpurchase) to analyze customer repeat timing.

* **year**

  **YEAR\_TIMESTAMP**

  The year a sale happened.

* **years\_​since\_​first\_​purchase**

  **INTEGER**

  The number of years between the customer's first order and this order, reported in your store's time zone. A value of -1 means this order is the customer's first order. You can group or filter by [`years_since_first_purchase`](#salesdimension-propertydetail-yearssincefirstpurchase) to analyze long-term repeat timing.

* **assisting\_​staff\_​member\_​name**

  **STRING**

  Name of the staff member assisting with the retail sale

* **shop\_​name**

  **STRING**

  Name of your store

* **billing\_​city**

  **STRING**

  City of the billing address

* **billing\_​company**

  **STRING**

  B2B customer associated with the billing address

* **billing\_​country**

  **STRING**

  Country of the billing address (e.g., United States, Canada)

* **billing\_​postal\_​code**

  **STRING**

  Postal code of the billing address

* **billing\_​region**

  **STRING**

  State or province of the billing address (e.g., California, Ontario)

* **abandoned\_​checkout\_​date**

  **DAY\_TIMESTAMP**

  Date the customer most recently abandoned a cart

* **customer\_​account\_​status**

  **STRING**

  The customer's account state, with values Declined, Disabled, Enabled, and Invited.

* **customer\_​added\_​date**

  **DAY\_TIMESTAMP**

  The day the customer record was added, reported in your store's time zone.

* **customer\_​created\_​by\_​app\_​id**

  **IDENTITY**

  The Shopify identifier for the app that created the customer.

* **customer\_​email**

  **STRING**

  Email address of the customer

* **customer\_​email\_​domain**

  **STRING**

  The part of the customer's email address after the @ symbol, such as gmail.com or your company's domain.

* **customer\_​language**

  **STRING**

  Language associated with the customer

* **customer\_​name**

  **STRING**

  Full name of the customer

* **customer\_​email\_​subscription\_​status**

  **STRING**

  The customer's email marketing subscription state, with values such as Invalid, Not subscribed, Pending, and Subscribed.

* **customer\_​cities**

  **ARRAY\<STRING>**

  All cities in the customer's history of addresses

* **customer\_​countries**

  **ARRAY\<STRING>**

  All countries from the customer's address history. Values are country codes such as US, CA, GB, and AU.

* **customer\_​regions**

  **ARRAY\<STRING>**

  All states or provinces from the customer's address history. Values are region codes such as US-CA, US-NY, CA-ON, and GB-ENG.

* **customer\_​amount\_​spent**

  **MONEY**

  The customer's all-time spend is shown in your store's currency.

* **customer\_​last\_​order\_​date**

  **DAY\_TIMESTAMP**

  The day the customer most recently placed an order, reported in your store's time zone.

* **customer\_​number\_​of\_​orders**

  **INTEGER**

  Number of orders the customer has placed across all time

* **first\_​order\_​sales\_​channel**

  **STRING**

  The sales channel where the customer's first order was placed, shown as a channel name such as Online Store or POS.

* **customer\_​cohort\_​month**

  **MONTH\_TIMESTAMP**

  The month of the customer's first order, reported in your store's time zone.

* **customer\_​cohort\_​quarter**

  **QUARTER\_TIMESTAMP**

  The quarter of the customer's first order, reported in your store's time zone.

* **customer\_​cohort\_​week**

  **WEEK\_TIMESTAMP**

  The week of the customer's first order, reported in your store's time zone.

* **customer\_​first\_​order\_​date**

  **DAY\_TIMESTAMP**

  The day the customer placed their first order, reported in your store's time zone.

* **first\_​order\_​referring\_​channel**

  **STRING**

  Referring channel associated with the customer's first order

* **first\_​order\_​traffic\_​type**

  **STRING**

  Type of traffic associated with the customer's first order

* **first\_​order\_​has\_​subscription**

  **BOOLEAN**

  Whether the customer's first order included a subscription purchase, with values `true` and `false`.

* **first\_​order\_​products**

  **ARRAY\<STRING>**

  Products bought together in the customer's first order

* **predicted\_​spend\_​tier**

  **STRING**

  The customer's predicted spend tier for the next year, with values Low, Medium, and High.

* **customer\_​sms\_​subscription\_​status**

  **STRING**

  The customer's SMS marketing subscription state, with values such as Not subscribed, Pending, Redacted, and Subscribed.

* **customer\_​tag**

  **STRING**

  Tag associated with the customer

* **customer\_​tags**

  **ARRAY\<STRING>**

  Set of tags associated with the customer

* **rfm\_​group**

  **STRING**

  A customer relationship label based on recency, frequency, and monetary spend. Values include Champions, Loyal, Needs attention, and At risk.

* **discount\_​class**

  **STRING**

  What the discount applies to, with values Order, Shipping, and Product.

* **discount\_​code**

  **STRING**

  Promotional code entered by customer or applied automatically to receive the discount

* **discount\_​id**

  **IDENTITY**

  The unique Shopify identifier for the discount. Use [`discount_id`](#salesdimension-propertydetail-discountid) with [`discount_name`](#salesdimension-propertydetail-discountname) to show readable labels.

* **discount\_​method**

  **STRING**

  How the discount was triggered, with values Automatic, Manual, Discount code, and Script.

* **discount\_​name**

  **STRING**

  The code or title used to identify the discount.

* **discount\_​shipping\_​price**

  **MONEY**

  The shipping cost before the shipping discount was applied, in your store's currency.

* **discount\_​shipping\_​title**

  **STRING**

  Display name of the shipping discount when it was applied

* **discount\_​title**

  **STRING**

  Title of the discount when it was applied

* **discount\_​type**

  **STRING**

  Whether the discount reduces the price by a fixed amount or a percentage, with values Fixed amount and Percentage.

* **discount\_​value**

  **MONEY**

  The amount discounted, in your store's currency.

* **price\_​rule\_​discount\_​title**

  **STRING**

  Title of the discount attached to a price rule when it was applied

* **price\_​rule\_​discount\_​type**

  **STRING**

  The price rule's discount type, with values Fixed amount, Percentage, and App. App is used for discounts created by third-party Shopify apps.

* **price\_​rule\_​discount\_​value**

  **MONEY**

  The discount amount based on a price rule, in your store's currency.

* **price\_​rule\_​type**

  **STRING**

  The price rule's discount type and activation method. Values include Fixed amount (code), Percentage (automatic), Shipping (code), and Buy X Get Y (automatic).

* **product\_​title\_​at\_​time\_​of\_​sale**

  **STRING**

  The product name as it appeared when the item was sold.

* **product\_​type\_​at\_​time\_​of\_​sale**

  **STRING**

  The product type or category assigned when the item was sold.

* **product\_​variant\_​compare\_​at\_​price**

  **MONEY**

  The compare-at price of the product variant when the item was sold, in your store's currency.

* **product\_​variant\_​price**

  **MONEY**

  The price of the product variant when the item was sold, in your store's currency.

* **product\_​variant\_​sku\_​at\_​time\_​of\_​sale**

  **STRING**

  The SKU of the product variant when the item was sold.

* **product\_​variant\_​title\_​at\_​time\_​of\_​sale**

  **STRING**

  The variant name as it appeared when the item was sold.

* **product\_​vendor\_​at\_​time\_​of\_​sale**

  **STRING**

  The vendor assigned to the product when the item was sold.

* **collective\_​supplier**

  **STRING**

  Supplier of the product sourced through Shopify Collective

* **is\_​b2b\_​order**

  **BOOLEAN**

  Whether the order is a B2B order, with values `true` and `false`.

* **is\_​canceled\_​order**

  **BOOLEAN**

  Whether the order is canceled, with values `true` and `false`.

* **order\_​checkout\_​currency**

  **STRING**

  The currency the buyer saw at checkout when placing the order. Values are currency codes such as USD, CAD, EUR, and GBP.

* **order\_​fulfillment\_​status**

  **STRING**

  The order's fulfillment state, with values Fulfilled, Partial, Restocked, and Unfulfilled.

* **order\_​includes\_​duties**

  **BOOLEAN**

  Whether the order includes duties, with values `true` and `false`.

* **order\_​name**

  **STRING**

  The name or number of the order as the customer sees it.

* **order\_​payment\_​status**

  **STRING**

  The order's payment state, such as Authorized, Paid, Partially refunded, or Pending.

* **order\_​sales\_​channel**

  **STRING**

  The sales channel where the order was placed, shown as a channel name such as Online Store or POS.

* **order\_​sales\_​channel\_​id**

  **IDENTITY**

  The unique Shopify identifier for the order's sales channel. Use [`order_sales_channel_id`](#salesdimension-propertydetail-ordersaleschannelid) with [`order_sales_channel`](#salesdimension-propertydetail-ordersaleschannel) to show readable channel labels.

* **is\_​shop\_​referral\_​order**

  **BOOLEAN**

  Whether the order was referred from the Shop app or shop.app, with values `true` and `false`.

* **order\_​landing\_​page\_​path**

  **STRING**

  Path of the first page of the user session that resulted in the order

* **order\_​landing\_​page\_​url**

  **STRING**

  First page of the user session that resulted in the order

* **order\_​marketing\_​event\_​id**

  **IDENTITY**

  Shopify identifier for the marketing event associated with the order

* **order\_​referrer\_​domain**

  **STRING**

  Domain of the site that led to the order

* **order\_​referrer\_​name**

  **STRING**

  The readable name of the site that led to the order.

* **order\_​referrer\_​path**

  **STRING**

  Path of the site that led to the order

* **order\_​referrer\_​site**

  **STRING**

  Site that led to the order

* **order\_​referrer\_​source**

  **STRING**

  The referrer type that led to the order, such as organic or email.

* **order\_​referrer\_​url**

  **STRING**

  External page that referred a customer and led to the order

* **order\_​utm\_​campaign**

  **STRING**

  UTM name of the campaign associated with the order

* **order\_​utm\_​content**

  **STRING**

  The UTM content value associated with the order, often used to distinguish ads, links, or content variations.

* **order\_​utm\_​medium**

  **STRING**

  The UTM medium associated with the order, such as email, social, or paid search.

* **order\_​utm\_​source**

  **STRING**

  The UTM source associated with the order, such as Google, Facebook, or a newsletter.

* **order\_​utm\_​term**

  **STRING**

  The UTM term associated with the order, often used for paid search keywords or other tracked terms.

* **number\_​of\_​products\_​bought\_​together**

  **INTEGER**

  Total unique products in the same order

* **number\_​of\_​variants\_​bought\_​together**

  **INTEGER**

  The number of unique product variants in the same order, with each SKU counted a single time.

* **products\_​bought\_​together**

  **ARRAY\<STRING>**

  The product names that appear in the same order.

* **products\_​bought\_​together\_​ids**

  **ARRAY\<INTEGER>**

  The Shopify product identifiers for products in the same order.

* **variants\_​bought\_​together**

  **ARRAY\<STRING>**

  The product variant labels that appear in the same order, such as size, color, or style combinations.

* **company\_​id**

  **IDENTITY**

  The unique Shopify identifier for the company. Use [`company_id`](#salesdimension-propertydetail-companyid) with [`company_name`](#salesdimension-propertydetail-companyname) to show readable company labels.

* **company\_​name**

  **STRING**

  Name of the company that placed the order

* **company\_​location\_​id**

  **IDENTITY**

  The unique Shopify identifier for the company location. Use [`company_location_id`](#salesdimension-propertydetail-companylocationid) with [`company_location_name`](#salesdimension-propertydetail-companylocationname) to show readable company location labels.

* **company\_​location\_​name**

  **STRING**

  The company location or branch that placed the order

* **referring\_​channel**

  **STRING**

  Marketing channel that referred the customer to place the order

* **referring\_​medium**

  **STRING**

  The marketing medium that referred the customer to place the order, such as email, social, or search.

* **referring\_​platform**

  **STRING**

  The marketing platform that referred the customer to place the order, such as Google, Facebook, or Instagram.

* **traffic\_​type**

  **STRING**

  The type of traffic that led to the order, such as organic, paid, or direct.

* **order\_​marketing\_​event\_​target**

  **STRING**

  The platform or channel where the marketing activity was deployed, such as Email, Facebook, Google, or Instagram.

* **order\_​marketing\_​event\_​type**

  **STRING**

  The type of marketing activity that led to the order, such as Ad, Affiliate, Newsletter, or Retargeting. PLA means Product Listing Ads, and SEO means Search Engine Optimization.

* **market**

  **STRING**

  Market you've defined in Shopify, like a geographical market or customer group

* **markets**

  **ARRAY\<STRING>**

  Markets or customer segments associated with the order

* **order\_​cancellation\_​reason**

  **STRING**

  The reason specified for the order cancellation, such as Customer, Other, Fraud, or Inventory.

* **order\_​risk\_​level**

  **STRING**

  The fraud risk level Shopify assigned to the order, with values Low, Medium, High, None, and Pending.

* **order\_​is\_​shopify\_​protect\_​covered**

  **BOOLEAN**

  Whether the order has met Shopify Protect fulfillment requirements, including proper shipping and tracking, with values `true` and `false`.

* **order\_​is\_​shopify\_​protect\_​eligible**

  **BOOLEAN**

  Whether the order qualifies for Shopify Protect, with values `true` and `false`.

* **order\_​is\_​shopify\_​protect\_​protected**

  **BOOLEAN**

  Whether the order has full Shopify Protect coverage against fraud, with values `true` and `false`.

* **order\_​tag**

  **STRING**

  Tag associated with the order

* **order\_​tags**

  **ARRAY\<STRING>**

  Set of tags associated with the order

* **rollout\_​id**

  **IDENTITY**

  Unique identifier for the rollout or feature flag exposed to the order

* **rollout\_​ids**

  **ARRAY\<INTEGER>**

  All rollout or feature flag identifiers exposed to the order.

* **rollout\_​treatment\_​id**

  **IDENTITY**

  Unique identifier for the specific treatment exposed to the order

* **rollout\_​treatment\_​ids**

  **ARRAY\<INTEGER>**

  Array of all treatment identifiers exposed to the order

* **agentic\_​referring\_​channel**

  **STRING**

  The AI agent or assistant that referred the session to your online store, with values ChatGPT, Google AI Mode and Gemini, Microsoft Copilot, and Shop.

* **channel\_​handle**

  **STRING**

  Name of the marketing channel or platform that drove the marketing engagement

* **marketing\_​activity\_​id**

  **IDENTITY**

  The unique Shopify identifier for the marketing activity. Use [`marketing_activity_id`](#salesdimension-propertydetail-marketingactivityid) with [`marketing_activity_title`](#salesdimension-propertydetail-marketingactivitytitle) to show readable activity labels.

* **marketing\_​activity\_​status**

  **STRING**

  Current status of the marketing activity (such as Active or Paused)

* **marketing\_​activity\_​title**

  **STRING**

  Name of the marketing activity

* **marketing\_​activity\_​url\_​parameter\_​key**

  **STRING**

  URL parameter key for the marketing activity

* **marketing\_​activity\_​url\_​parameter\_​value**

  **STRING**

  URL parameter value for the marketing activity

* **marketing\_​automation\_​id**

  **IDENTITY**

  Unique ID that Shopify uses to identify the marketing automation

* **marketing\_​delivery\_​channel**

  **STRING**

  Channel through which the marketing activity is delivered

* **marketing\_​event\_​id**

  **IDENTITY**

  Unique identifier for the associated marketing event

* **marketing\_​platform**

  **STRING**

  The marketing platform that created the marketing activity, shown as a platform name.

* **page\_​host**

  **STRING**

  The host name of the session landing page.

* **page\_​path**

  **STRING**

  The path of the session landing page.

* **page\_​url**

  **STRING**

  The URL of the first page viewed in the session.

* **referrer\_​url**

  **STRING**

  External page that led to an online store session

* **utm\_​campaign**

  **STRING**

  UTM name of the campaign associated with the session

* **utm\_​content**

  **STRING**

  The UTM content value associated with the session, often used to distinguish ads, links, or content variations.

* **utm\_​medium**

  **STRING**

  The UTM medium associated with the session, such as email, social, or paid search.

* **utm\_​source**

  **STRING**

  The UTM source associated with the session, such as Google, Facebook, or a newsletter.

* **utm\_​term**

  **STRING**

  The UTM term associated with the session, often used for paid search keywords or other tracked terms.

* **pos\_​location\_​name**

  **STRING**

  Name of your physical retail location

* **product\_​status**

  **STRING**

  The product's current publishing state, with values Active, Archived, Draft, Suspended, and Unlisted.

* **product\_​title**

  **STRING**

  Display name of the product that your customers see

* **product\_​type**

  **STRING**

  Type (category) that you've assigned to the product

* **product\_​vendor**

  **STRING**

  Vendor of the product

* **product\_​collection**

  **STRING**

  Collection associated with the product

* **product\_​collections**

  **ARRAY\<STRING>**

  Set of collections associated with the product

* **app\_​product\_​creation**

  **STRING**

  The app that created the product, shown as an app name.

* **product\_​tag**

  **STRING**

  Tag associated with the product

* **product\_​tags**

  **ARRAY\<STRING>**

  Set of tags associated with the product

* **product\_​variant\_​abc\_​grade**

  **STRING**

  The ABC grade assigned to the product variant based on its share of revenue. A-grade variants account for about 80% of revenue, B-grade for 15%, and C-grade for 5%.

* **product\_​variant\_​sku**

  **STRING**

  SKU of the product variant

* **product\_​variant\_​title**

  **STRING**

  Display name of the product variant

* **is\_​unverified\_​return**

  **BOOLEAN**

  Whether the return is unverified, with values `true` and `false`.

* **return\_​reason**

  **STRING**

  The reason the item was returned, such as Changed my mind, Damaged or defective, Too big, or Received the wrong item.

* **bundle\_​product\_​id**

  **IDENTITY**

  The unique Shopify identifier for the bundle product. Use [`bundle_product_id`](#salesdimension-propertydetail-bundleproductid) with [`bundle_title`](#salesdimension-propertydetail-bundletitle) to show readable bundle labels.

* **bundle\_​title**

  **STRING**

  The bundle name as it appeared when the bundle was created.

* **line\_​item\_​is\_​bundle**

  **BOOLEAN**

  Whether the line item is a bundle, with values `true` and `false`.

* **shipping\_​city**

  **STRING**

  City of the shipping address

* **shipping\_​company**

  **STRING**

  Company of the shipping address

* **shipping\_​country**

  **STRING**

  Country of the shipping address (e.g., United States, Canada)

* **shipping\_​postal\_​code**

  **STRING**

  Postal code of the shipping address

* **shipping\_​region**

  **STRING**

  State or province of the shipping address (e.g., California, Ontario)

* **staff\_​member\_​name**

  **STRING**

  Name of the staff member associated with the order

* **is\_​return\_​related**

  **BOOLEAN**

  **deprecated**

  Label specifying whether the transaction reverses a previous sale

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`is_sales_reversal`](#salesdimension-propertydetail-issalesreversal)

* **order\_​or\_​return**

  **STRING**

  **deprecated**

  Label specifying whether the transaction adds or removes value from sales

  **Deprecated:**

  Deprecated since `2026-07`. Replaced by [`order_or_sales_reversal`](#salesdimension-propertydetail-orderorsalesreversal)

### STRING

A sequence of characters representing text data.

```ts
```

### IDENTITY

A unique identifier for a Shopify resource such as a customer, product, or order.

```ts
```

### BOOLEAN

A true or false value representing binary states.

```ts
```

### DAY\_TIMESTAMP

A date value truncated to day precision.

```ts
```

### DAY\_OF\_WEEK

A day within a week, used for weekday-based grouping and filtering.

```ts
```

### HOUR\_TIMESTAMP

A timestamp truncated to hour precision.

```ts
```

### HOUR\_OF\_DAY

An hour within a day, typically represented as an integer from 0 to 23.

```ts
```

### MINUTE\_TIMESTAMP

A timestamp truncated to minute precision.

```ts
```

### MONTH\_TIMESTAMP

A date value representing the start of a month.

```ts
```

### MONTH\_OF\_YEAR

A month number within a year.

```ts
```

### QUARTER\_TIMESTAMP

A date value representing the start of a fiscal quarter.

```ts
```

### SECOND\_TIMESTAMP

A timestamp truncated to second precision.

```ts
```

### WEEK\_TIMESTAMP

A date value representing the start of a week.

```ts
```

### WEEK\_OF\_YEAR

A week number within a year.

```ts
```

### YEAR\_TIMESTAMP

A date value representing the start of a year.

```ts
```

### ARRAY

A list of values. The element type appears inside angle brackets, such as ARRAY\<STRING>.

```ts
```

***

## MATCHES expressions

Use these expressions inside a [`MATCHES`](https://shopify.dev/docs/api/shopifyql/latest/syntax/where#matches) filter to keep `sales` rows that have at least one related record matching the parameters. Each parameter filters on a dimension or metric of the related records.

* **customer.​orders\_​placed**

  **SalesCustomerOrdersPlacedConditions**

  Orders the customer placed, filterable by order date, source app, location, order count, and spend.

* **customer.​products\_​purchased**

  **SalesCustomerProductsPurchasedConditions**

  Products the customer bought, filterable by product ID, purchase date, quantity per order, and total quantity.

* **customer.​shopify\_​email.​bounced**

  **SalesCustomerShopifyEmailBouncedConditions**

  Emails that bounced for the customer, filterable by marketing activity, bounce date, and bounce count.

* **customer.​shopify\_​email.​clicked**

  **SalesCustomerShopifyEmailClickedConditions**

  Emails the customer clicked, filterable by marketing activity, click date, and click count.

* **customer.​shopify\_​email.​delivered**

  **SalesCustomerShopifyEmailDeliveredConditions**

  Emails delivered to the customer, filterable by marketing activity, delivery date, and delivery count.

* **customer.​shopify\_​email.​marked\_​as\_​spam**

  **SalesCustomerShopifyEmailMarkedAsSpamConditions**

  Emails the customer marked as spam, filterable by marketing activity, spam-report date, and spam-report count.

* **customer.​shopify\_​email.​opened**

  **SalesCustomerShopifyEmailOpenedConditions**

  Emails the customer opened, filterable by marketing activity, open date, and open count.

* **customer.​shopify\_​email.​unsubscribed**

  **SalesCustomerShopifyEmailUnsubscribedConditions**

  Email unsubscribe events for the customer, filterable by marketing activity, unsubscribe date, and unsubscribe count.

* **customer.​store\_​credit\_​accounts**

  **SalesCustomerStoreCreditAccountsConditions**

  Store credit accounts for the customer, filterable by balance, currency, expiry date, and most recent credit date.

* **customer.​storefront\_​event.​collection\_​viewed**

  **SalesCustomerStorefrontEventCollectionViewedConditions**

  Collection pages the customer viewed, filterable by collection ID, view date, and view count.

* **customer.​storefront\_​event.​product\_​viewed**

  **SalesCustomerStorefrontEventProductViewedConditions**

  Product pages the customer viewed, filterable by product ID, view date, and view count.

* **customer.​within\_​distance**

  **SalesCustomerWithinDistanceConditions**

  Customers with an address within a distance of a location, filterable by coordinates and radius.

### SalesCustomerOrdersPlacedConditions

Fields you can use inside \`customer.orders\_placed MATCHES (...)\` when querying \`FROM sales\`.

* amount

  Filter. Amount spent per order.

  ```ts
  MONEY
  ```

* app\_id

  Filter. App ID associated with the order.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date the order was placed.

  ```ts
  TIMESTAMP
  ```

* location\_id

  Filter. Location ID associated with the order.

  ```ts
  IDENTITY
  ```

* count

  Metric. Number of orders placed.

  ```ts
  INTEGER
  ```

* sum\_amount

  Metric. Amount spent in the date range.

  ```ts
  MONEY
  ```

### TIMESTAMP

A full-precision timestamp including date and time.

```ts
```

### SalesCustomerProductsPurchasedConditions

Fields you can use inside \`customer.products\_purchased MATCHES (...)\` when querying \`FROM sales\`.

* date

  Filter. Date the product(s) were purchased.

  ```ts
  TIMESTAMP
  ```

* id

  Filter. Product IDs.

  ```ts
  IDENTITY
  ```

* quantity

  Filter. Number purchased per order.

  ```ts
  INTEGER
  ```

* sum\_quantity

  Metric. Number purchased within the date range.

  ```ts
  INTEGER
  ```

### SalesCustomerShopifyEmailBouncedConditions

Fields you can use inside \`customer.shopify\_email.bounced MATCHES (...)\` when querying \`FROM sales\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was bounced.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was bounced.

  ```ts
  INTEGER
  ```

### SalesCustomerShopifyEmailClickedConditions

Fields you can use inside \`customer.shopify\_email.clicked MATCHES (...)\` when querying \`FROM sales\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was clicked.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was clicked.

  ```ts
  INTEGER
  ```

### SalesCustomerShopifyEmailDeliveredConditions

Fields you can use inside \`customer.shopify\_email.delivered MATCHES (...)\` when querying \`FROM sales\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was delivered.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was delivered.

  ```ts
  INTEGER
  ```

### SalesCustomerShopifyEmailMarkedAsSpamConditions

Fields you can use inside \`customer.shopify\_email.marked\_as\_spam MATCHES (...)\` when querying \`FROM sales\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was marked as spam.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was marked as spam.

  ```ts
  INTEGER
  ```

### SalesCustomerShopifyEmailOpenedConditions

Fields you can use inside \`customer.shopify\_email.opened MATCHES (...)\` when querying \`FROM sales\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was opened.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was opened.

  ```ts
  INTEGER
  ```

### SalesCustomerShopifyEmailUnsubscribedConditions

Fields you can use inside \`customer.shopify\_email.unsubscribed MATCHES (...)\` when querying \`FROM sales\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was unsubscribed.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was unsubscribed.

  ```ts
  INTEGER
  ```

### SalesCustomerStoreCreditAccountsConditions

Fields you can use inside \`customer.store\_credit\_accounts MATCHES (...)\` when querying \`FROM sales\`.

* balance

  Filter. Amount available to spend.

  ```ts
  FLOAT
  ```

* currency

  Filter. Currency associated with the account.

  ```ts
  STRING
  ```

* last\_credit\_date

  Filter. Date when credits were last added.

  ```ts
  TIMESTAMP
  ```

* next\_expiry\_date

  Filter. Date when credits expire.

  ```ts
  TIMESTAMP
  ```

### FLOAT

A floating-point number used for measurements, rates, and other continuous numeric values.

```ts
```

### SalesCustomerStorefrontEventCollectionViewedConditions

Fields you can use inside \`customer.storefront\_event.collection\_viewed MATCHES (...)\` when querying \`FROM sales\`.

* date

  Filter. Date collection was viewed.

  ```ts
  TIMESTAMP
  ```

* id

  Filter. Collection ID.

  ```ts
  IDENTITY
  ```

* count

  Metric. Times collection was viewed.

  ```ts
  INTEGER
  ```

### SalesCustomerStorefrontEventProductViewedConditions

Fields you can use inside \`customer.storefront\_event.product\_viewed MATCHES (...)\` when querying \`FROM sales\`.

* date

  Filter. Date product was viewed.

  ```ts
  TIMESTAMP
  ```

* id

  Filter. Product ID.

  ```ts
  IDENTITY
  ```

* count

  Metric. Times product was viewed.

  ```ts
  INTEGER
  ```

### SalesCustomerWithinDistanceConditions

Fields you can use inside \`customer.within\_distance MATCHES (...)\` when querying \`FROM sales\`.

* coordinates

  Filter. Latitude and longitude of location. Required.

  ```ts
  GEO_COORDINATE
  ```

* distance\_km

  Filter. Maximum distance from location, in kilometers. Required: provide one of the \`distance\_km/mi\` group.

  ```ts
  FLOAT
  ```

* distance\_mi

  Filter. Maximum distance from location, in miles. Required: provide one of the \`distance\_km/mi\` group.

  ```ts
  FLOAT
  ```

### GEO\_COORDINATE

A geographic coordinate value.

```ts
```

***

## Related schemas

* [`profitability`](https://shopify.dev/docs/api/shopifyql/latest/schemas/orders/profitability): Pairs revenue with landed cost for margin and profit per order, not just top-line sales.
* [`payments`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payments): Drops to the transaction level for payout reconciliation, payment method comparison, and fee analysis.
* [`campaign_sales`](https://shopify.dev/docs/api/shopifyql/latest/schemas/marketing/campaign_sales): Attributes sales back to marketing campaigns to measure acquisition spend against revenue.

***
