> ## Documentation Index
> Fetch the complete documentation index at: https://docs.queryful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Order line items

> One row per line item: what each order contained, with quantities, prices, discounts and custom properties.

One row per line item: what each order contained, with quantities, prices, discounts and custom properties.

## Example

```sql theme={null}
FROM order_lines
  SHOW unfulfilled_quantity, unfulfilled_value
  GROUP BY sales_channel
  SINCE startOfMonth(-1m) UNTIL today
  ORDER BY unfulfilled_quantity DESC
```

## Metrics

| Metric | Type | Description |
| - | - | - |
| `unfulfilled_quantity` | Number | Units on the lines still to be fulfilled. |
| `unfulfilled_value` | Currency | What the units still to be fulfilled are worth, after discounts. |
| `non_fulfillable_quantity` | Number | Units on the lines that can't be fulfilled, such as removed or digital ones. |
| `refundable_quantity` | Number | Units on the lines that can still be refunded. |
| `line_weight_kg` | Number | The lines' weight in kilograms, units included. |
| `line_tax` | Currency | Tax charged on the lines, from each line's own tax lines. |
| `line_duties` | Currency | Import duties charged on the lines. |
| `line_discount_allocated` | Currency | Discounts allocated to the lines, every discount application counted. |
| `line_count` | Number | Number of order line items. |
| `quantity` | Number | Units ordered. |
| `current_quantity` | Number | Units still on the order after edits and refunds. |
| `original_total` | Currency | Line totals at the original unit price, before discounts. |
| `line_item_discounts` | Currency | Discounts allocated to the lines. |
| `discounted_total` | Currency | Line totals after discounts. |

## Dimensions

| Dimension | Description |
| - | - |
| `order_name` | Order name, such as #1001. |
| `line_customer_currency` | The currency the customer paid in for the line. |
| `line_tax_title` | Each tax charged on the line, such as VAT 20%. A line with several taxes counts under each, so totals overlap. |
| `duty_hs_code` | The harmonized system code each duty on the line was charged under. |
| `duty_country_of_origin` | The country of origin each duty on the line was charged for. |
| `line_discount` | Each discount allocated to the line, by title or code. A line with several counts under each, so totals overlap. |
| `hour_of_day` | The hour of day the order was placed, from 0 to 23. |
| `day_of_week` | The day of week the order was placed, Monday through Sunday. |
| `line_item` | Each line item on its own row, with its title and variant. |
| `product_title` | Product title (variants roll up). |
| `product_variant_sku` | Variant SKU. |
| `product_vendor` | Product vendor. |
| `product_type` | Shopify product type. |
| `product_tag` | Product tag. A product with several tags counts under each, so totals across tags overlap. |
| `product_collection` | Collection the product is in. A product in several collections counts under each, so totals across collections overlap. |
| `product_status` | The product's current status: Active, Archived, Draft, Suspended or Unlisted. |
| `product_variant_compare_at_price` | The variant's compare-at price when it was sold. Empty for orders before Queryful was installed. |
| `product_title_at_time_of_sale` | The product's title when it was sold. |
| `product_variant_sku_at_time_of_sale` | The variant's SKU when it was sold. |
| `product_vendor_at_time_of_sale` | The product's vendor when it was sold. |
| `product_type_at_time_of_sale` | The product's type when it was sold. |
| `properties` | The line's custom properties (such as engraving text), as name: value pairs. |
| `sales_channel` | The sales channel the order came through. |
| `market` | The market the order belongs to, as Shopify reports it. |
| `company_name` | The B2B company that placed the order. |
| `company_location_name` | The B2B company location the order was for. |
| `app_name` | The app or channel that created the order, such as Online Store, Point of Sale or Draft Orders. |
| `order_number` | The order's number without its prefix, such as 1001. |
| `order_confirmation_number` | The code the customer sees on their order confirmation. |
| `order_customer_language` | The language the customer placed the order in, such as en-GB. |
| `order_accepts_marketing` | Whether the customer agreed to marketing when they ordered: true or false. |
| `order_return_status` | Where the order's returns stand: No return, Return requested, In progress, Returned and so on. |
| `order_edit_request_status` | Whether the customer asked to change the order, and where that stands. |
| `order_tax_exempt` | Whether the order was exempt from tax: true or false. |
| `order_duties_included` | Whether duties were included in the prices: true or false. |
| `order_requires_shipping` | Whether anything on the order needs shipping: true or false. |
| `order_fully_paid` | Whether the order is paid in full: true or false. |
| `order_confirmed` | Whether the order is confirmed (stock reserved): true or false. |
| `merchant_of_record_app` | The app that sold the order as merchant of record, if not the store itself. |
| `order_product_network` | Whether the order came through Shopify's product network: true or false. |
| `order_source_identifier` | The id the channel that created the order gave it, such as a POS device's reference. |
| `order_customer_currency` | The currency the customer paid in. |
| `last_visit_landing_page` | The page the visit the customer ordered in started on. |
| `last_visit_referrer_url` | The page that sent the customer on the visit they ordered in. |
| `last_visit_utm_source` | UTM source of the visit the customer ordered in. |
| `last_visit_utm_medium` | UTM medium of the visit the customer ordered in. |
| `last_visit_utm_campaign` | UTM campaign of the visit the customer ordered in. |
| `last_visit_utm_content` | UTM content of the visit the customer ordered in. |
| `last_visit_utm_term` | UTM term of the visit the customer ordered in. |
| `first_visit_referral_code` | The referral code on the customer's first visit. |
| `last_visit_referral_code` | The referral code on the visit the customer ordered in. |
| `first_visit_source_description` | Shopify's description of where the first visit came from. |
| `last_visit_source_description` | Shopify's description of where the visit the customer ordered in came from. |
| `first_visit_marketing_event` | The marketing event (campaign) behind the customer's first visit. |
| `last_visit_marketing_event` | The marketing event (campaign) behind the visit the customer ordered in. |
| `po_number` | The purchase order number on the order. |
| `order_tax_id` | The tax ID the buyer gave at checkout, such as a VAT number. |
| `business_entity` | The legal entity that sold the order (stores selling as more than one). |
| `sales_sub_channel` | The part of the channel the order came from, such as Instagram within Facebook & Instagram. |
| `is_marketplace_order` | Whether the order came from a marketplace channel: true or false. |
| `taxes_included` | Whether the order's prices include tax: true or false. |
| `order_edited` | Whether the order was edited after it was placed: true or false. |
| `order_closed` | Whether the order is closed (archived): true or false. |
| `shipping_country` | The country the order ships to. |
| `shipping_region` | The state or province the order ships to. |
| `shipping_city` | The city the order ships to. |
| `shipping_postcode` | The postcode the order ships to. |
| `shipping_company` | The company in the shipping address. |
| `shipping_address` | The first line of the shipping address. |
| `billing_country` | The country in the billing address. |
| `billing_region` | The state or province in the billing address. |
| `billing_city` | The city in the billing address. |
| `billing_postcode` | The postcode in the billing address. |
| `billing_company` | The company in the billing address. |
| `order_risk_level` | The fraud risk level Shopify assigned to the order: High, Medium, Low, None or Pending. |
| `order_risk_recommendation` | What Shopify's fraud analysis recommends: Accept, Investigate, Cancel or None. |
| `order_is_shopify_protect_protected` | Whether Shopify Protect covered the order against fraud: true or false. |
| `order_is_shopify_protect_covered` | Whether the order met Shopify Protect's fulfilment requirements, with proper shipping and tracking: true or false. |
| `order_is_shopify_protect_eligible` | Whether the order was eligible for Shopify Protect: true or false. |
| `shipping_method` | The shipping method the customer chose, as it reads at checkout. |
| `shipping_method_source` | Where the shipping rate came from: shopify, or the carrier or app that calculated it. |
| `days_to_conversion` | Days between the customer's first visit and the order. |
| `sessions_before_order` | The visits Shopify recorded on the way to the order. |
| `first_visit_source` | Where the customer's first visit came from, such as google or an email. |
| `first_visit_source_type` | The kind of source of the first visit: search, social, email, direct and so on. |
| `first_visit_date` | The day of the customer's first visit before the order, in the store's timezone. |
| `last_visit_source` | Where the visit the customer ordered in came from, such as google or an email. |
| `last_visit_source_type` | The kind of source of the visit the customer ordered in: search, social, email, direct and so on. |
| `customer_order_index` | Which of the customer's orders this is: 1 for their first, 2 for their second and so on. |
| `payment_terms` | The order's payment terms, such as Net 30 or Due on fulfillment. |
| `payment_due_date` | When payment for the order falls due, in the store's timezone. |
| `payment_overdue` | Whether the order's payment is past its due date and not yet paid: true or false. |
| `discount_names` | Every discount on the order by name, automatic ones included, comma separated. |
| `order_referrer_source` | The kind of site that referred the order: search, social, email, direct and so on. |
| `order_referrer_name` | The site that referred the order, such as Google or Instagram. |
| `is_shop_referral_order` | Whether the Shop app referred the order: true or false. |
| `traffic_type` | How Shopify classes the visit the order is credited to: paid, organic, direct or unknown. |
| `referring_channel` | The channel Shopify credits the order to, such as google, klaviyo or direct. |
| `referring_medium` | The kind of channel Shopify credits the order to: search, email, sms, social and so on. |
| `marketing_channel` | The marketing channel Shopify credits the order to, such as google\_ads or meta\_ads. |
| `marketing_platform` | The platform behind the channel Shopify credits the order to, such as google or meta. |
| `agentic_sales_channel` | The AI agent the order came through, if any. |
| `selling_plan` | The subscription, pre-order or try-before-you-buy plan the item was sold on. |
| `selling_plan_group` | The group of plans the item's plan belongs to, such as Subscribe and save. |
| `selling_plan_category` | Subscription, Pre order, Try before you buy, or None for a one-time purchase. |
| `bundle_title` | The bundle the item was sold in. Items sold on their own show None. |
| `line_item_is_bundle` | Whether the item was sold as part of a bundle: true or false. |
| `is_bundle_component` | Whether the item was sold as part of a bundle: true or false. |
| `line_item_property` | Each line item property as name: value. A row with several counts under each, so totals overlap. |
| `line_item_property_name` | Each line item property's name, without its value. |

## Filters

| Filter | Type | Description |
| - | - | - |
| `line_customer_currency` | Text | The currency the customer paid in for the line. |
| `hour_of_day` | Text | The hour of day the order was placed, from 0 to 23. |
| `product_variant_compare_at_price` | Number | The variant's compare-at price when it was sold. Empty for orders before Queryful was installed. |
| `product_vendor_at_time_of_sale` | Text | The product's vendor when it was sold. |
| `product_type_at_time_of_sale` | Text | The product's type when it was sold. |
| `market` | Text | The market the order belongs to, as Shopify reports it. |
| `company_name` | Text | The B2B company that placed the order. |
| `company_location_name` | Text | The B2B company location the order was for. |
| `app_name` | Text | The app or channel that created the order, such as Online Store, Point of Sale or Draft Orders. |
| `order_confirmation_number` | Text | The code the customer sees on their order confirmation. |
| `order_customer_language` | Text | The language the customer placed the order in, such as en-GB. |
| `order_accepts_marketing` | Text | Whether the customer agreed to marketing when they ordered: true or false. |
| `order_edit_request_status` | Text | Whether the customer asked to change the order, and where that stands. |
| `order_tax_exempt` | Text | Whether the order was exempt from tax: true or false. |
| `order_duties_included` | Text | Whether duties were included in the prices: true or false. |
| `order_requires_shipping` | Text | Whether anything on the order needs shipping: true or false. |
| `order_confirmed` | Text | Whether the order is confirmed (stock reserved): true or false. |
| `merchant_of_record_app` | Text | The app that sold the order as merchant of record, if not the store itself. |
| `order_product_network` | Text | Whether the order came through Shopify's product network: true or false. |
| `order_source_identifier` | Text | The id the channel that created the order gave it, such as a POS device's reference. |
| `last_visit_landing_page` | Text | The page the visit the customer ordered in started on. |
| `last_visit_referrer_url` | Text | The page that sent the customer on the visit they ordered in. |
| `last_visit_utm_medium` | Text | UTM medium of the visit the customer ordered in. |
| `last_visit_utm_content` | Text | UTM content of the visit the customer ordered in. |
| `last_visit_utm_term` | Text | UTM term of the visit the customer ordered in. |
| `first_visit_referral_code` | Text | The referral code on the customer's first visit. |
| `last_visit_referral_code` | Text | The referral code on the visit the customer ordered in. |
| `first_visit_source_description` | Text | Shopify's description of where the first visit came from. |
| `last_visit_source_description` | Text | Shopify's description of where the visit the customer ordered in came from. |
| `first_visit_marketing_event` | Text | The marketing event (campaign) behind the customer's first visit. |
| `last_visit_marketing_event` | Text | The marketing event (campaign) behind the visit the customer ordered in. |
| `is_marketplace_order` | Text | Whether the order came from a marketplace channel: true or false. |
| `order_closed` | Text | Whether the order is closed (archived): true or false. |
| `shipping_company` | Text | The company in the shipping address. |
| `shipping_address` | Text | The first line of the shipping address. |
| `billing_region` | Text | The state or province in the billing address. |
| `billing_company` | Text | The company in the billing address. |
| `order_risk_recommendation` | Text | What Shopify's fraud analysis recommends: Accept, Investigate, Cancel or None. |
| `shipping_method_source` | Text | Where the shipping rate came from: shopify, or the carrier or app that calculated it. |
| `first_visit_source` | Text | Where the customer's first visit came from, such as google or an email. |
| `first_visit_source_type` | Text | The kind of source of the first visit: search, social, email, direct and so on. |
| `first_visit_date` | Text | The day of the customer's first visit before the order, in the store's timezone. |
| `agentic_sales_channel` | Text | The AI agent the order came through, if any. |
| `order_name` | Text | Order name, such as #1001. |
| `product_title` | Text | Product title. |
| `product_variant_title` | Text | Variant title. |
| `product_variant_sku` | Text | Variant SKU. |
| `product_vendor` | Text | Product vendor. |
| `product_type` | Text | Shopify product type. |
| `product_tag` | Text | The product's tags, comma separated. Use contains to match one tag. |
| `product_collection` | Text | The collections the product is in, comma separated. Use contains to match one collection. |
| `product_status` | Text | The product's current status: active, archived, draft, suspended or unlisted. |
| `product_title_at_time_of_sale` | Text | The product's title when it was sold. |
| `product_variant_sku_at_time_of_sale` | Text | The variant's SKU when it was sold. |
| `properties` | Text | The line's custom properties as text. Use contains to match a name or value. |
| `gift_card` | Yes or no | Whether the line is a gift card. |
| `sales_channel` | Text | The sales channel the order came through. |
| `line_item_property_name` | Text | Line item property names, comma separated. Use contains to match one. |
| `traffic_type` | Text | How Shopify classes the visit the order is credited to: paid, organic, direct or unknown. |
| `referring_channel` | Text | The channel Shopify credits the order to, such as google, klaviyo or direct. |
| `referring_medium` | Text | The kind of channel Shopify credits the order to: search, email, sms, social and so on. |
| `marketing_channel` | Text | The marketing channel Shopify credits the order to, such as google\_ads or meta\_ads. |
| `marketing_platform` | Text | The platform behind the channel Shopify credits the order to, such as google or meta. |
| `order_return_status` | Text | Where the order's returns stand. |
| `order_fully_paid` | Yes or no | Whether the order is paid in full. |
| `order_customer_currency` | Text | The currency the customer paid in. |
| `last_visit_utm_campaign` | Text | UTM campaign of the visit the customer ordered in. |
| `last_visit_utm_source` | Text | UTM source of the visit the customer ordered in. |
| `po_number` | Text | The purchase order number. |
| `order_tax_id` | Text | The tax ID the buyer gave at checkout. |
| `business_entity` | Text | The legal entity that sold the order. |
| `sales_sub_channel` | Text | The part of the channel the order came from. |
| `taxes_included` | Yes or no | Whether the order's prices include tax. |
| `order_edited` | Yes or no | Whether the order was edited after it was placed. |
| `order_weight` | Number | The order's total weight in kilograms. |
| `order_outstanding` | Number | What the customer still owes on the order. |
| `shipping_country` | Text | The country the order ships to. |
| `shipping_region` | Text | The state or province the order ships to. |
| `shipping_city` | Text | The city the order ships to. |
| `shipping_postcode` | Text | The postcode the order ships to. |
| `billing_country` | Text | The country in the billing address. |
| `billing_city` | Text | The city in the billing address. |
| `billing_postcode` | Text | The postcode in the billing address. |
| `order_risk_level` | Text | High, Medium, Low, None or Pending. |
| `order_is_shopify_protect_protected` | Yes or no | Whether Shopify Protect covered the order. |
| `order_is_shopify_protect_covered` | Yes or no | Whether the order met Shopify Protect's fulfilment requirements. |
| `order_is_shopify_protect_eligible` | Yes or no | Whether the order was eligible for Shopify Protect. |
| `order_referrer_source` | Text | search, social, email, direct and so on. |
| `order_referrer_name` | Text | The site that referred the order. |
| `is_shop_referral_order` | Yes or no | Whether the Shop app referred the order. |
| `shipping_method` | Text | The shipping method chosen at checkout. |
| `days_to_conversion` | Number | Days between the first visit and the order. |
| `last_visit_source` | Text | Where the visit the customer ordered in came from. |
| `last_visit_source_type` | Text | Search, social, email, direct and so on. |
| `customer_order_index` | Number | Which of the customer's orders this is: 1 for their first. |
| `payment_terms` | Text | Net 30, Due on fulfillment and so on. |
| `payment_due_date` | Date | When payment falls due. |
| `payment_overdue` | Yes or no | Past its due date and not yet paid. |
| `discount_names` | Text | Discount names on the order, comma separated. Use contains to match one. |

## Linked records

Fields of the records this dataset reaches can be shown, grouped by and filtered on, written with a dot after the record (for example `order.name`). Each record's page lists its fields.

| Write | Record | Reached through |
| - | - | - |
| `order.<field>` | [Order](https://docs.queryful.app/queryfulql/records/order.md) | Order |
| `order.customer.<field>` | [Customer](https://docs.queryful.app/queryfulql/records/customer.md) | Order › Customer |
| `order.customer.company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Order › Customer › Company |
| `order.company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Order › Company |
| `order.company_location.<field>` | [Company location](https://docs.queryful.app/queryfulql/records/company_location.md) | Order › Company location |
| `order.company_location.company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Order › Company location › Company |
| `order.location.<field>` | [Location](https://docs.queryful.app/queryfulql/records/location.md) | Order › Location |
| `order.market.<field>` | [Market](https://docs.queryful.app/queryfulql/records/market.md) | Order › Market |
| `product.<field>` | [Product](https://docs.queryful.app/queryfulql/records/product.md) | Product |
| `variant.<field>` | [Variant](https://docs.queryful.app/queryfulql/records/variant.md) | Variant |
| `variant.product.<field>` | [Product](https://docs.queryful.app/queryfulql/records/product.md) | Variant › Product |
| `customer.<field>` | [Customer](https://docs.queryful.app/queryfulql/records/customer.md) | Customer |
| `customer.company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Customer › Company |
| `company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Company |
| `company_location.<field>` | [Company location](https://docs.queryful.app/queryfulql/records/company_location.md) | Company location |
| `company_location.company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Company location › Company |
| `location.<field>` | [Location](https://docs.queryful.app/queryfulql/records/location.md) | Location |
| `shop.<field>` | [Store](https://docs.queryful.app/queryfulql/records/shop.md) | Store |

## Related datasets

* [Sales](https://docs.queryful.app/queryfulql/datasets/sales.md)
* [Orders](https://docs.queryful.app/queryfulql/datasets/orders.md)
* [Returns](https://docs.queryful.app/queryfulql/datasets/returns.md)
* [Restocks](https://docs.queryful.app/queryfulql/datasets/refund_lines.md)
* [Refunds](https://docs.queryful.app/queryfulql/datasets/refunds.md)
* [Sales taxes](https://docs.queryful.app/queryfulql/datasets/sales_taxes.md)
* [Write-offs](https://docs.queryful.app/queryfulql/datasets/sale_write_offs.md)
* [Profitability](https://docs.queryful.app/queryfulql/datasets/profitability.md)
* [Agentic sales](https://docs.queryful.app/queryfulql/datasets/agentic_sales.md)
* [Products bought together](https://docs.queryful.app/queryfulql/datasets/product_pairs.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.