Skip to main content

discounts

The discounts schema 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.


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.

Anchor to additional_product_and_order_discounts
additional_product_and_order_discounts

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 to see how much extra non-shipping discounting happened alongside a specific discount.

Anchor to additional_shipping_discounts
additional_shipping_discounts

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 to see how much extra shipping discounting happened alongside a specific discount.

Anchor to applied_discounts
applied_discounts

Amount discounted for the given discount

Anchor to discounted_orders
discounted_orders

Counts each discounted order one time.

Anchor to product_and_order_discounts
product_and_order_discounts

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

Anchor to product_and_order_discounts_from_apps
product_and_order_discounts_from_apps

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

Anchor to shipping_discounts
shipping_discounts

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

Anchor to shipping_discounts_from_apps
shipping_discounts_from_apps

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


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.

The day a discount was applied.

Anchor to day_of_week
day_of_week

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

Anchor to discount_id
discount_id

The unique Shopify identifier for the discount. Use discount_id to filter to a specific discount, or use it with discount_title or discount_name to show readable results.

The hour a discount was applied.

Anchor to hour_of_day
hour_of_day

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

Anchor to line_item_id
line_item_id

The unique Shopify identifier for the line item connected to the discount. Use line_item_id to filter to a specific item on an order, or to break results down at the item level.

Anchor to minute
minute

The minute a discount was applied.

Anchor to month
month

The month a discount was applied.

Anchor to month_of_year
month_of_year

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

Anchor to order_id
order_id

The unique Shopify identifier for the order with the discount. Use order_id to filter to a specific order, or use it with order_name to show a customer-facing label.

Anchor to product_id
product_id

The unique Shopify identifier for the product connected to the discount. Use product_id to filter to a specific product, or use it with product_title to show readable results.

Anchor to product_variant_id
product_variant_id

The unique Shopify identifier for the product variant connected to the discount. Use product_variant_id to filter to a specific variant, or use it with product_variant_title or product_variant_sku to show readable results.

Anchor to quarter
quarter

The quarter a discount was applied.

Anchor to shop_id
shop_id

The unique Shopify identifier for your store. Use shop_id with shop_name to show readable store labels.

The week a discount was applied.

Anchor to week_of_year
week_of_year

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

The year a discount was applied.

Anchor to discount_class
discount_class

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

Anchor to discount_code
discount_code

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

Anchor to discount_line_id
discount_line_id

Shopify identifier for the discount line

Anchor to discount_method
discount_method

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

Anchor to discount_name
discount_name

The code or title used to identify the discount.

Anchor to discount_shipping_price
discount_shipping_price

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

Anchor to discount_shipping_title
discount_shipping_title

Display name of the shipping discount when it was applied

Anchor to discount_title
discount_title

Title of the discount when it was applied

Anchor to discount_type
discount_type

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

Anchor to discount_value
discount_value

The amount discounted, in your store's currency.

Anchor to price_rule_discount_title
price_rule_discount_title

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

Anchor to price_rule_discount_type
price_rule_discount_type

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

Anchor to price_rule_discount_value
price_rule_discount_value

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

Anchor to price_rule_type
price_rule_type

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

Anchor to shop_name
shop_name

Name of your store

Anchor to product_title_at_time_of_sale
product_title_at_time_of_sale

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

Anchor to product_type_at_time_of_sale
product_type_at_time_of_sale

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

Anchor to product_variant_compare_at_price
product_variant_compare_at_price

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

Anchor to product_variant_price
product_variant_price

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

Anchor to product_variant_sku_at_time_of_sale
product_variant_sku_at_time_of_sale

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

Anchor to product_variant_title_at_time_of_sale
product_variant_title_at_time_of_sale

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

Anchor to product_vendor_at_time_of_sale
product_vendor_at_time_of_sale

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

Anchor to collective_supplier
collective_supplier

Supplier of the product sourced through Shopify Collective

Anchor to is_b2b_order
is_b2b_order

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

Anchor to is_canceled_order
is_canceled_order

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

Anchor to order_checkout_currency
order_checkout_currency

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

Anchor to order_fulfillment_status
order_fulfillment_status

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

Anchor to order_includes_duties
order_includes_duties

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

Anchor to order_name
order_name

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

Anchor to order_payment_status
order_payment_status

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

Anchor to order_sales_channel
order_sales_channel

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

Anchor to order_sales_channel_id
order_sales_channel_id

The unique Shopify identifier for the order's sales channel. Use order_sales_channel_id with order_sales_channel to show readable channel labels.

Anchor to is_shop_referral_order
is_shop_referral_order

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

Anchor to order_landing_page_path
order_landing_page_path

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

Anchor to order_landing_page_url
order_landing_page_url

First page of the user session that resulted in the order

Anchor to order_marketing_event_id
order_marketing_event_id

Shopify identifier for the marketing event associated with the order

Anchor to order_referrer_domain
order_referrer_domain

Domain of the site that led to the order

Anchor to order_referrer_name
order_referrer_name

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

Anchor to order_referrer_path
order_referrer_path

Path of the site that led to the order

Anchor to order_referrer_site
order_referrer_site

Site that led to the order

Anchor to order_referrer_source
order_referrer_source

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

Anchor to order_referrer_url
order_referrer_url

External page that referred a customer and led to the order

Anchor to order_utm_campaign
order_utm_campaign

UTM name of the campaign associated with the order

Anchor to order_utm_content
order_utm_content

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

Anchor to order_utm_medium
order_utm_medium

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

Anchor to order_utm_source
order_utm_source

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

Anchor to order_utm_term
order_utm_term

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

Anchor to number_of_products_bought_together
number_of_products_bought_together

Total unique products in the same order

Anchor to number_of_variants_bought_together
number_of_variants_bought_together

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

Anchor to products_bought_together
products_bought_together
<>

The product names that appear in the same order.

Anchor to products_bought_together_ids
products_bought_together_ids
<>

The Shopify product identifiers for products in the same order.

Anchor to variants_bought_together
variants_bought_together
<>

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

Anchor to company_id
company_id

The unique Shopify identifier for the company. Use company_id with company_name to show readable company labels.

Anchor to company_name
company_name

Name of the company that placed the order

Anchor to company_location_id
company_location_id

The unique Shopify identifier for the company location. Use company_location_id with company_location_name to show readable company location labels.

Anchor to company_location_name
company_location_name

The company location or branch that placed the order

Anchor to referring_channel
referring_channel

Marketing channel that referred the customer to place the order

Anchor to referring_medium
referring_medium

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

Anchor to referring_platform
referring_platform

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

Anchor to traffic_type
traffic_type

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

Anchor to order_marketing_event_target
order_marketing_event_target

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

Anchor to order_marketing_event_type
order_marketing_event_type

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.

Anchor to market
market

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

Anchor to markets
markets
<>

Markets or customer segments associated with the order

Anchor to order_cancellation_reason
order_cancellation_reason

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

Anchor to order_risk_level
order_risk_level

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

Anchor to order_is_shopify_protect_covered
order_is_shopify_protect_covered

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

Anchor to order_is_shopify_protect_eligible
order_is_shopify_protect_eligible

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

Anchor to order_is_shopify_protect_protected
order_is_shopify_protect_protected

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

Anchor to order_tag
order_tag

Tag associated with the order

Anchor to order_tags
order_tags
<>

Set of tags associated with the order

Anchor to agentic_referring_channel
agentic_referring_channel

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.

Anchor to channel_handle
channel_handle

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

Anchor to marketing_activity_id
marketing_activity_id

The unique Shopify identifier for the marketing activity. Use marketing_activity_id with marketing_activity_title to show readable activity labels.

Anchor to marketing_activity_status
marketing_activity_status

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

Anchor to marketing_activity_title
marketing_activity_title

Name of the marketing activity

Anchor to marketing_activity_url_parameter_key
marketing_activity_url_parameter_key

URL parameter key for the marketing activity

Anchor to marketing_activity_url_parameter_value
marketing_activity_url_parameter_value

URL parameter value for the marketing activity

Anchor to marketing_automation_id
marketing_automation_id

Unique ID that Shopify uses to identify the marketing automation

Anchor to marketing_delivery_channel
marketing_delivery_channel

Channel through which the marketing activity is delivered

Anchor to marketing_event_id
marketing_event_id

Unique identifier for the associated marketing event

Anchor to marketing_platform
marketing_platform

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

Anchor to page_host
page_host

The host name of the session landing page.

Anchor to page_path
page_path

The path of the session landing page.

Anchor to page_url
page_url

The URL of the first page viewed in the session.

Anchor to referrer_url
referrer_url

External page that led to an online store session

Anchor to utm_campaign
utm_campaign

UTM name of the campaign associated with the session

Anchor to utm_content
utm_content

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

Anchor to utm_medium
utm_medium

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

Anchor to utm_source
utm_source

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

Anchor to utm_term
utm_term

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

Anchor to product_status
product_status

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

Anchor to product_title
product_title

Display name of the product that your customers see

Anchor to product_type
product_type

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

Anchor to product_vendor
product_vendor

Vendor of the product

Anchor to product_collection
product_collection

Collection associated with the product

Anchor to product_collections
product_collections
<>

Set of collections associated with the product

Anchor to app_product_creation
app_product_creation

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

Anchor to product_tag
product_tag

Tag associated with the product

Anchor to product_tags
product_tags
<>

Set of tags associated with the product

Anchor to product_variant_abc_grade
product_variant_abc_grade

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

Anchor to product_variant_sku
product_variant_sku

SKU of the product variant

Anchor to product_variant_title
product_variant_title

Display name of the product variant


  • sales: Top-line revenue context for the orders these discounts ran against.
  • profitability: Pairs revenue with cost to show whether discounting is eroding margin.

Was this page helpful?