---
title: discounts
description: >-
  Reference for the ShopifyQL `discounts` 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/discounts
  md: >-
    https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/discounts.md
api_name: shopifyql
---

# discounts

The `discounts` [schema](https://shopify.dev/docs/api/shopifyql/latest/schemas) captures discount amounts applied to orders and line items. It separates discount effects by discount source and commerce object, attributing discounted value to orders, products, or variants.

### Use cases

* **Applied value**: Group [`applied_discounts`](#discountsmetric-propertydetail-applieddiscounts) by [`discount_id`](#discountsdimension-propertydetail-discountid) to rank discounts by value given away.
* **Discount type**: Compare [`product_and_order_discounts`](#discountsmetric-propertydetail-productandorderdiscounts) with [`shipping_discounts`](#discountsmetric-propertydetail-shippingdiscounts) by month to see where your discount spend goes.
* **App discounts**: Use [`product_and_order_discounts_from_apps`](#discountsmetric-propertydetail-productandorderdiscountsfromapps) and [`shipping_discounts_from_apps`](#discountsmetric-propertydetail-shippingdiscountsfromapps) to isolate discounts from integrations.
* **Discounted orders**: Count [`discounted_orders`](#discountsmetric-propertydetail-discountedorders) by [`product_id`](#discountsdimension-propertydetail-productid) or [`product_variant_id`](#discountsdimension-propertydetail-productvariantid) to see which products rely most on discounting.

Examples

### Examples

* ####

  ##### Description

  Chart monthly discount spend this year, split between product-and-order discounts and shipping discounts, alongside the number of discounted orders. This example uses \[\`TIMESERIES month\`]\(/docs/api/shopifyql/latest/syntax/timeseries) to show how total discount spend builds across the year.

  ##### ShopifyQL

  ```shopifyql
  FROM discounts
    SHOW applied_discounts, product_and_order_discounts, shipping_discounts,
      discounted_orders
    TIMESERIES month WITH TOTALS
    DURING this_year
    ORDER BY month ASC
  VISUALIZE applied_discounts TYPE bar
  ```

* ####

  ##### Description

  Rank individual discounts by \`applied\_discounts\` last month, with \`discounted\_orders\` for each, grouped by \`discount\_id\`. This example pairs \[\`ORDER BY\`]\(/docs/api/shopifyql/latest/syntax/order-by) \`applied\_discounts DESC\` with \`LIMIT 25\`, so the sort decides which 25 discounts survive the cut.

  ##### ShopifyQL

  ```shopifyql
  FROM discounts
    SHOW applied_discounts, discounted_orders
    GROUP BY discount_id WITH TOTALS
    DURING last_month
    ORDER BY applied_discounts DESC
    LIMIT 25
  VISUALIZE applied_discounts TYPE horizontal_bar
  ```

* ####

  ##### Description

  Show the 20 products with the highest \`applied\_discounts\` last quarter, with \`discounted\_orders\` for each. This example uses \[\`GROUP BY\`]\(/docs/api/shopifyql/latest/syntax/group-by) \`product\_id\` with \`LIMIT 20\` to focus on the products that absorb the most discount spend.

  ##### ShopifyQL

  ```shopifyql
  FROM discounts
    SHOW applied_discounts, discounted_orders
    GROUP BY product_id WITH TOTALS
    DURING last_quarter
    ORDER BY applied_discounts DESC
    LIMIT 20
  VISUALIZE applied_discounts TYPE horizontal_bar
  ```

* ####

  ##### Description

  Compare \`applied\_discounts\` and \`discounted\_orders\` for last month against the month before. This example uses \[\`WITH PERCENT\_CHANGE\`]\(/docs/api/shopifyql/latest/syntax/with#percent-change-columns) and \[\`COMPARE TO previous\_period\`]\(/docs/api/shopifyql/latest/syntax/compare-to) to show the change in discount spend.

  ##### ShopifyQL

  ```shopifyql
  FROM discounts
    SHOW applied_discounts, discounted_orders
    WITH PERCENT_CHANGE
    DURING last_month
    COMPARE TO previous_period
  ```

***

## 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 discounts`.

* **additional\_​product\_​and\_​order\_​discounts**

  **MONEY**

  The value of other discounts on products or orders that were used on the same orders as the discount in your results, in your store's currency. Use [`additional_product_and_order_discounts`](#discountsmetric-propertydetail-additionalproductandorderdiscounts) to see how much extra non-shipping discounting happened alongside a specific discount.

* **additional\_​shipping\_​discounts**

  **MONEY**

  The value of other shipping discounts that were used on the same orders as the discount in your results, in your store's currency. Use [`additional_shipping_discounts`](#discountsmetric-propertydetail-additionalshippingdiscounts) to see how much extra shipping discounting happened alongside a specific discount.

* **applied\_​discounts**

  **MONEY**

  Amount discounted for the given discount

* **discounted\_​orders**

  **INTEGER**

  Counts each discounted order one time.

* **product\_​and\_​order\_​discounts**

  **MONEY**

  The amount taken off products or the order subtotal by discounts, excluding shipping-specific discounts, in your store's currency.

* **product\_​and\_​order\_​discounts\_​from\_​apps**

  **MONEY**

  The amount taken off products or orders by app-based discounts, in your store's currency.

* **shipping\_​discounts**

  **MONEY**

  The amount taken off shipping charges by shipping-specific discounts, in your store's currency.

* **shipping\_​discounts\_​from\_​apps**

  **MONEY**

  The amount taken off shipping charges by app-based discounts, in your store's currency.

### 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.

Dimensions you can use when querying `FROM discounts`.

* **day**

  **DAY\_TIMESTAMP**

  The day a discount was applied.

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

  **DAY\_OF\_WEEK**

  The day of the week a discount was applied, with values Monday through Sunday.

* **discount\_​id**

  **IDENTITY**

  The unique Shopify identifier for the discount. Use [`discount_id`](#discountsdimension-propertydetail-discountid) to filter to a specific discount, or use it with [`discount_title`](#discountsdimension-propertydetail-discounttitle) or [`discount_name`](#discountsdimension-propertydetail-discountname) to show readable results.

* **hour**

  **HOUR\_TIMESTAMP**

  The hour a discount was applied.

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

  **HOUR\_OF\_DAY**

  The hour of day a discount was applied, with values 0 through 23.

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

  **IDENTITY**

  The unique Shopify identifier for the line item connected to the discount. Use [`line_item_id`](#discountsdimension-propertydetail-lineitemid) to filter to a specific item on an order, or to break results down at the item level.

* **minute**

  **MINUTE\_TIMESTAMP**

  The minute a discount was applied.

* **month**

  **MONTH\_TIMESTAMP**

  The month a discount was applied.

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

  **MONTH\_OF\_YEAR**

  The month of the year a discount was applied, with values 1 through 12.

* **order\_​id**

  **IDENTITY**

  The unique Shopify identifier for the order with the discount. Use [`order_id`](#discountsdimension-propertydetail-orderid) to filter to a specific order, or use it with [`order_name`](#discountsdimension-propertydetail-ordername) to show a customer-facing label.

* **product\_​id**

  **IDENTITY**

  The unique Shopify identifier for the product connected to the discount. Use [`product_id`](#discountsdimension-propertydetail-productid) to filter to a specific product, or use it with [`product_title`](#discountsdimension-propertydetail-producttitle) to show readable results.

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

  **IDENTITY**

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

* **quarter**

  **QUARTER\_TIMESTAMP**

  The quarter a discount was applied.

* **shop\_​id**

  **IDENTITY**

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

* **week**

  **WEEK\_TIMESTAMP**

  The week a discount was applied.

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

  **WEEK\_OF\_YEAR**

  The week of the year a discount was applied, with values 1 through 53.

* **year**

  **YEAR\_TIMESTAMP**

  The year a discount was applied.

* **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\_​line\_​id**

  **STRING**

  Shopify identifier for the discount line

* **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).

* **shop\_​name**

  **STRING**

  Name of your store

* **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`](#discountsdimension-propertydetail-ordersaleschannelid) with [`order_sales_channel`](#discountsdimension-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`](#discountsdimension-propertydetail-companyid) with [`company_name`](#discountsdimension-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`](#discountsdimension-propertydetail-companylocationid) with [`company_location_name`](#discountsdimension-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

* **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`](#discountsdimension-propertydetail-marketingactivityid) with [`marketing_activity_title`](#discountsdimension-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.

* **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

### 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
```

### IDENTITY

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

```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
```

### 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
```

### STRING

A sequence of characters representing text data.

```ts
```

### BOOLEAN

A true or false value representing binary states.

```ts
```

### ARRAY

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

```ts
```

***

## Related schemas

* [`sales`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/sales): Top-line revenue context for the orders these discounts ran against.
* [`profitability`](https://shopify.dev/docs/api/shopifyql/latest/schemas/orders/profitability): Pairs revenue with cost to show whether discounting is eroding margin.

***
