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

# profitability

The `profitability` [schema](https://shopify.dev/docs/api/shopifyql/latest/schemas) captures the pieces that make up profit on an order, measured before any returns are settled. Use it to break down the revenue, costs, shipping, duties, tax, and adjustments behind each order's economics.

### Use cases

* **Profit components**: Compare [`average_revenue_before_returns`](#profitabilitymetric-propertydetail-averagerevenuebeforereturns), [`average_store_costs_before_returns`](#profitabilitymetric-propertydetail-averagestorecostsbeforereturns), and [`average_profit_at_delivery_before_returns`](#profitabilitymetric-propertydetail-averageprofitatdeliverybeforereturns) by month to see how cost pressure moves your margin.
* **Shipping costs**: Show [`average_customer_shipping_charges`](#profitabilitymetric-propertydetail-averagecustomershippingcharges) beside [`average_store_shipping_costs`](#profitabilitymetric-propertydetail-averagestoreshippingcosts) to compare customer-paid and store-paid shipping amounts.
* **Order link**: Use [`order_id`](#profitabilitydimension-propertydetail-orderid) to align profitability averages with order-level sales or fulfillment views.

Examples

### Examples

* ####

  ##### Description

  Rank landed-cost adjustment types by \`average\_duty\_and\_import\_tax\_adjustment\_costs\` last month, most expensive first. This example uses \[\`WITH TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with#total-columns) to give the blended average across all adjustment types.

  ##### ShopifyQL

  ```shopifyql
  FROM profitability
    SHOW average_duty_and_import_tax_adjustment_costs
    GROUP BY landed_cost_adjustment_type WITH TOTALS
    DURING last_month
    ORDER BY average_duty_and_import_tax_adjustment_costs DESC
    LIMIT 10
  VISUALIZE average_duty_and_import_tax_adjustment_costs TYPE horizontal_bar
  ```

* ####

  ##### Description

  Track monthly \`average\_profit\_at\_delivery\_before\_returns\` over the last year, with revenue and cost of goods behind it. This example pairs \[\`WITH PERCENT\_CHANGE\`]\(/docs/api/shopifyql/latest/syntax/with#percent-change-columns) with \[\`COMPARE TO previous\_period\`]\(/docs/api/shopifyql/latest/syntax/compare-to) to add a change column measured against the prior 12 months.

  ##### ShopifyQL

  ```shopifyql
  FROM profitability
    SHOW average_profit_at_delivery_before_returns, average_revenue_before_returns,
      average_cost_of_goods_sold
    TIMESERIES month WITH PERCENT_CHANGE
    SINCE -365d UNTIL today
    COMPARE TO previous_period
    ORDER BY month ASC
  VISUALIZE average_profit_at_delivery_before_returns TYPE line
  ```

* ####

  ##### Description

  Track monthly \`average\_duty\_and\_import\_tax\_adjustment\_costs\` and \`average\_shipping\_label\_adjustment\_costs\` across this year. This example uses \[\`WITH TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with#total-columns) to add an overall year-to-date average beside the monthly rows, because both metrics are averages.

  ##### ShopifyQL

  ```shopifyql
  FROM profitability
    SHOW average_duty_and_import_tax_adjustment_costs,
      average_shipping_label_adjustment_costs
    TIMESERIES month WITH TOTALS
    DURING this_year
    ORDER BY month ASC
  VISUALIZE average_duty_and_import_tax_adjustment_costs, average_shipping_label_adjustment_costs TYPE line
  ```

* ####

  ##### Description

  Track weekly \`average\_duty\_and\_import\_tax\_adjustment\_costs\` split by \`landed\_cost\_adjustment\_type\` across last quarter. This example uses \[\`GROUP\_TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with#group-total-columns) to add a per-week average across types beside the per-type bands.

  ##### ShopifyQL

  ```shopifyql
  FROM profitability
    SHOW average_duty_and_import_tax_adjustment_costs
    GROUP BY landed_cost_adjustment_type WITH TOTALS, GROUP_TOTALS
    TIMESERIES week
    DURING last_quarter
    ORDER BY week ASC
    LIMIT 10
  VISUALIZE average_duty_and_import_tax_adjustment_costs TYPE stacked_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 profitability`.

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

  **MONEY**

  The average product cost tied to each order, in your store's currency.

* **average\_​customer\_​duties\_​and\_​import\_​taxes**

  **MONEY**

  Average duties and import taxes customers pay per order

* **average\_​customer\_​price\_​adjustments**

  **MONEY**

  Average price adjustments that affect what customers pay

* **average\_​customer\_​shipping\_​charges**

  **MONEY**

  Average shipping costs customers pay per order

* **average\_​duty\_​and\_​import\_​tax\_​adjustment\_​costs**

  **MONEY**

  Average amount you pay per order on duty and import tax adjustments

* **average\_​profit\_​at\_​delivery\_​before\_​returns**

  **MONEY**

  For orders with product sales, this per-order profit estimate is measured at delivery and excludes marketing costs, packaging costs, and returns, in your store's currency.

  `Average profit at delivery (before returns) = average_revenue_before_returns - average_store_costs_before_returns`

* **average\_​revenue\_​before\_​returns**

  **MONEY**

  The average revenue per order before returns, including product sales after discounts, customer shipping charges, and duties, and excluding sales tax, in your store's currency.

* **average\_​sale\_​after\_​discounts**

  **MONEY**

  Amount customers have paid on products before returns, averaged across orders

  `Average sale after discounts = gross sales - returns`

* **average\_​sales\_​taxes**

  **MONEY**

  Average taxes you collect per order

* **average\_​shipping\_​label\_​adjustment\_​costs**

  **MONEY**

  Average amount you pay per order on shipping label adjustments

* **average\_​store\_​costs\_​before\_​returns**

  **MONEY**

  Shows your store's per-order fulfillment cost for orders with product sales, before return activity is reflected, in your store's currency.

  `Average store costs (before returns) = average_cost_of_goods_sold + average_store_shipping_costs + average_store_duties_and_import_taxes + average_payment_processing_fees + average_international_fees`

* **average\_​store\_​duties\_​and\_​import\_​taxes**

  **MONEY**

  Average duties and import taxes you pay per order

  `Average store duties and import taxes = average_customer_duties_and_import_taxes + average_duty_and_import_tax_adjustment_costs`

* **average\_​store\_​shipping\_​costs**

  **MONEY**

  The average shipping cost your store pays per order, including shipping label costs and shipping label adjustments, in your store's currency.

### MONEY

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

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

* **day**

  **DAY\_TIMESTAMP**

  The day the order's sale happened.

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

  **DAY\_OF\_WEEK**

  The day of week the order's sale happened, with values Monday through Sunday.

* **hour**

  **HOUR\_TIMESTAMP**

  The hour the order's sale happened.

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

  **HOUR\_OF\_DAY**

  The hour of day the order's sale happened, with values 0 through 23.

* **landed\_​cost\_​adjustment\_​type**

  **STRING**

  Type of landed cost adjustment, either duty or tax

* **minute**

  **MINUTE\_TIMESTAMP**

  The minute the order's sale happened.

* **month**

  **MONTH\_TIMESTAMP**

  The month the order's sale happened.

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

  **MONTH\_OF\_YEAR**

  The month of year the order's sale happened, with values 1 through 12.

* **order\_​id**

  **IDENTITY**

  Use [`order_id`](#profitabilitydimension-propertydetail-orderid) with [`order_name`](#profitabilitydimension-propertydetail-ordername) to show the order name or number.

* **quarter**

  **QUARTER\_TIMESTAMP**

  The quarter the order's sale happened.

* **second**

  **SECOND\_TIMESTAMP**

  The second the order's sale happened.

* **shop\_​id**

  **IDENTITY**

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

* **week**

  **WEEK\_TIMESTAMP**

  The week the order's sale happened.

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

  **WEEK\_OF\_YEAR**

  The week of year the order's sale happened, with values 1 through 53.

* **year**

  **YEAR\_TIMESTAMP**

  The year the order's sale happened.

* **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`](#profitabilitydimension-propertydetail-ordersaleschannelid) with [`order_sales_channel`](#profitabilitydimension-propertydetail-ordersaleschannel) to show readable channel labels.

* **shop\_​name**

  **STRING**

  Name of your store

* **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`](#profitabilitydimension-propertydetail-companyid) with [`company_name`](#profitabilitydimension-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`](#profitabilitydimension-propertydetail-companylocationid) with [`company_location_name`](#profitabilitydimension-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`](#profitabilitydimension-propertydetail-marketingactivityid) with [`marketing_activity_title`](#profitabilitydimension-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.

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

### STRING

A sequence of characters representing text data.

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

### IDENTITY

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

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

### BOOLEAN

A true or false value representing binary states.

```ts
```

### INTEGER

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

```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 without the landed-cost side of the equation.
* [`discounts`](https://shopify.dev/docs/api/shopifyql/latest/schemas/sales_revenue/discounts): Applied discount value when you need to see what's eroding margin on the price side.
* [`payments`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payments): Transaction-level data including processing fees that don't appear in landed cost.

***
