Line items table
The line items table contains information about the line items in your orders. It contains product and product variant details as they were at the time of the order. This table does not include information about returns. Each row in the table is a line item in an order.
Join the line items table with the sales table to get the details of the product on the day it was sold. This data will match what appears on the order in your Shopify admin as well as in the Sales reports.
Column | Data type | Description |
---|---|---|
line_item_id | numeric | ID of the line item. This column is the primary key for the line items table. |
billing_address_id | numeric | ID of the customer's billing address. This column is a foreign key reference to the ID of the billing address in the addresses table. Contains null if the customer didn't or couldn't specify a billing address. For example, orders made using the Shopify Point of Sale (POS) usually don't have a billing address associated with them. |
order_id | numeric | ID of the order. This column is a foreign key reference to the orders_id column in the orders table. |
product_id | numeric | ID of the product ordered, unless the line item is for shipping costs (you can add custom items using a draft order). This column is a foreign key reference to the product_id column in the products table. |
product_variant_id | numeric | ID of the product variant ordered. This column is a foreign key reference to the product_variant_id column in the Product_variants table. Contains null when the product variant was deleted after the order was created or the item ordered was a custom item that had no ID. |
shop_id | numeric | ID of the store. This column is a foreign key reference to the shop_id column in the Shops table. |
name | varchar | Name of the line item. This name combines the product title and the variant title into the following format: product-title - variant-title. If there is no variant title, then the format is product-title. This column is the same as order.line_items.name"in the Admin API. |
product_title | varchar | Name of the product ordered. This column is the same as order.line_items.title in the Admin API. |
product_variant_title | varchar | Name of the product variant. This column is the same as order.line_items.variant_titlein the Admin API. |
price | numeric | Price of the product variant. |
quantity | numeric | Number of product variant items ordered in the line item. |
product_variant_sku | numeric | SKU number for the product variant. |
requires_shipping | boolean | Whether the product variant requires fulfillment (shipping). For example, online gift cards don't require shipping. |
taxable | boolean | Whether taxes are charged for the product variant, otherwise contains 0. For example, when the line item is a gift card, taxes are not charged. |
gift_card | boolean | Whether the product variant is a gift card. |
grams | numeric | Weight of a single unit of the product variant. Contains 0 when the product variant is a gift card. |
product_type | varchar | Type of the product. This value is set by the merchant. |
product_vendor | varchar | Name of the manufacturer, wholesaler, or other vendor of the product. |
fulfillable_quantity | numeric | Number of product variant items in the line item that require fulfillment. Some product variants, such as gift cards and digital products, do not need to be fulfilled. |
fulfillment_status | varchar | The status of the fulfillment of the product variant. Values include:
|
fulfillment_service | varchar | Name of the fulfillment service provider that fulfilled (shipped) the variant ordered. Contains manual when there is no fulfillment service specified for the variant. |
Imagine you change your product titles, but the product is otherwise the same. If you want to use the title at the time of the order, then use the line items table. If you want to use the current title, then use the products or product variants table.
An order can have the following types of line items:
- Sale of a product variant
- Shipping costs (applied at the order level)
The following example returns the sales by SKU: