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

# fees

The `fees` [schema](https://shopify.dev/docs/api/shopifyql/latest/schemas) captures the fees charged on order sales. Each row ties to an order and the date of the sale.

### Use cases

* **Processing fees**: Group [`shopify_payments_processing_fees`](#feesmetric-propertydetail-shopifypaymentsprocessingfees) by month to show payment processing fee totals over time.
* **Fee components**: Compare [`foreign_exchange_fees`](#feesmetric-propertydetail-foreignexchangefees) and [`managed_markets_fees`](#feesmetric-propertydetail-managedmarketsfees) by quarter to see how your fee load splits between currency conversion and cross-border selling.
* **Order join**: Join through [`order_id`](#feesdimension-propertydetail-orderid) to place fee metrics beside order or sales metrics for the same order.

Examples

### Examples

* ####

  ##### Description

  Chart all four fee types accumulating month by month this year, from Shopify Payments processing to foreign exchange, managed markets, and international fees. This example uses \[\`CUMULATIVE\_VALUES\`]\(/docs/api/shopifyql/latest/syntax/with#cumulative-values) to turn each month into a running year-to-date total.

  ##### ShopifyQL

  ```shopifyql
  FROM fees
    SHOW shopify_payments_processing_fees, foreign_exchange_fees,
      managed_markets_fees, international_fees
    TIMESERIES month WITH CUMULATIVE_VALUES, TOTALS
    DURING this_year
    ORDER BY month ASC
  VISUALIZE shopify_payments_processing_fees TYPE line
  ```

* ####

  ##### Description

  Compare \`average\_shopify\_payments\_processing\_fees\` by day of the week over the last 30 days, against the prior 30. This example uses \[\`WITH TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with#total-columns) to add the period's blended fee average to every row.

  ##### ShopifyQL

  ```shopifyql
  FROM fees
    SHOW average_shopify_payments_processing_fees, average_foreign_exchange_fees,
      average_managed_markets_fees, average_international_fees
    GROUP BY day_of_week WITH TOTALS
    SINCE startOfDay(-30d) UNTIL today
    COMPARE TO previous_period
    ORDER BY day_of_week ASC
  VISUALIZE average_shopify_payments_processing_fees TYPE grouped_bar
  ```

* ####

  ##### Description

  See how your weekly fee mix splits between payment processing, currency conversion, and cross-border selling across last quarter. This example uses \[\`WITH TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with#total-columns) to add a last-quarter total beside the weekly rows.

  ##### ShopifyQL

  ```shopifyql
  FROM fees
    SHOW shopify_payments_processing_fees, foreign_exchange_fees,
      managed_markets_fees
    TIMESERIES week WITH TOTALS
    DURING last_quarter
    ORDER BY week ASC
  VISUALIZE shopify_payments_processing_fees TYPE stacked_area
  ```

* ####

  ##### Description

  Rank the 10 orders with the highest \`shopify\_payments\_processing\_fees\` last month, with \`foreign\_exchange\_fees\` and \`managed\_markets\_fees\` beside each, grouped by \`order\_id\`. This example pairs \[\`ORDER BY\`]\(/docs/api/shopifyql/latest/syntax/order-by) \`shopify\_payments\_processing\_fees DESC\` with \`LIMIT 10\`, so the sort decides which 10 orders survive the cut.

  ##### ShopifyQL

  ```shopifyql
  FROM fees
    SHOW shopify_payments_processing_fees, foreign_exchange_fees,
      managed_markets_fees
    GROUP BY order_id WITH TOTALS
    DURING last_month
    ORDER BY shopify_payments_processing_fees DESC
    LIMIT 10
  VISUALIZE shopify_payments_processing_fees TYPE horizontal_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 fees`.

* **average\_​foreign\_​exchange\_​fees**

  **MONEY**

  The average foreign exchange fee per order, in your store's currency.

* **average\_​international\_​fees**

  **MONEY**

  Average fees that you pay per order for foreign exchanges and Managed Markets

  `Average international fees = average foreign exchange fees + average managed markets fees`

* **average\_​managed\_​markets\_​fees**

  **MONEY**

  The average Managed Markets fee per order, in your store's currency.

* **average\_​shopify\_​payments\_​processing\_​fees**

  **MONEY**

  The average Shopify Payments processing fee per order, in your store's currency.

* **foreign\_​exchange\_​fees**

  **MONEY**

  Foreign exchange fees are the currency conversion charges for orders paid in a different currency, reported in your store's currency.

* **international\_​fees**

  **MONEY**

  Fees you pay for foreign exchanges and Managed Markets

  `International fees = foreign exchange fees + managed markets fees`

* **managed\_​markets\_​fees**

  **MONEY**

  Fees charged when you use Shopify's Managed Markets to sell internationally

* **shopify\_​payments\_​processing\_​fees**

  **MONEY**

  Payment processing fees you pay per order through Shopify Payments

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

* **day**

  **DAY\_TIMESTAMP**

  The day the order happened.

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

  **DAY\_OF\_WEEK**

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

* **hour**

  **HOUR\_TIMESTAMP**

  The hour the order happened.

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

  **HOUR\_OF\_DAY**

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

* **minute**

  **MINUTE\_TIMESTAMP**

  The minute the order happened.

* **month**

  **MONTH\_TIMESTAMP**

  The month the order happened.

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

  **MONTH\_OF\_YEAR**

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

* **order\_​id**

  **IDENTITY**

  The unique Shopify identifier for the order. Use [`order_id`](#feesdimension-propertydetail-orderid) to inspect fees for a specific order, or use it with [`order_name`](#feesdimension-propertydetail-ordername) to show the customer-facing name or number.

* **quarter**

  **QUARTER\_TIMESTAMP**

  The quarter the order happened.

* **second**

  **SECOND\_TIMESTAMP**

  The second the order happened.

* **shop\_​id**

  **IDENTITY**

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

* **week**

  **WEEK\_TIMESTAMP**

  The week the order happened.

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

  **WEEK\_OF\_YEAR**

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

* **year**

  **YEAR\_TIMESTAMP**

  The year the order 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`](#feesdimension-propertydetail-ordersaleschannelid) with [`order_sales_channel`](#feesdimension-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`](#feesdimension-propertydetail-companyid) with [`company_name`](#feesdimension-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`](#feesdimension-propertydetail-companylocationid) with [`company_location_name`](#feesdimension-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`](#feesdimension-propertydetail-marketingactivityid) with [`marketing_activity_title`](#feesdimension-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
```

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

### STRING

A sequence of characters representing text data.

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

* [`payments`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payments): Transaction data upstream of these fees.
* [`payouts`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payouts): Payout amounts after fees are deducted.
* [`payment_attempts`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payment_attempts): Authorization data alongside the fees charged on successful attempts.

***
