Access sales analytics and performance insights.
SalesIntelligences — Returns a paginated list of sales intelligence data for line items
SalesIntelligences — Returns a paginated list of sales intelligence data for line itemsquery GetSalesIntelligences(
$where: QuerySalesIntelligencesWhereWhereConditions,
$orderBy: [QuerySalesIntelligencesOrderByOrderByClause!]
) {
SalesIntelligences(
where: $where
orderBy: $orderBy
) {
paginatorInfo {
total
lastPage
}
data {
line_item_id
variant_sku
variant_label
product_label
customer_label
customer_tax_number
document_label
location_label
brand_label
season_label
quantity
total_without_taxes
total_with_taxes
tax_amount
on_hand
margin
profit
year
month_year
}
}
}Example Variables:
{
"where": {
"AND": [
{ "column": "YEAR_CUSTOM", "operator": "EQ", "value": "2024" },
{ "column": "MONTH_YEAR_CUSTOM", "operator": "EQ", "value": "2024-01" }
]
},
"orderBy": [{ "column": "TOTAL_WITHOUT_TAXES", "order": "DESC" }]
}Available fields
| Field | Type | Description |
|---|---|---|
line_item_id | Int | Line item identifier. |
variant_sku | String | Variant SKU code. |
variant_label | String | Variant label/name. |
variant_barcode | String | Variant barcode. |
product_label | String | Product label/name. |
customer_label | String | Customer name. |
customer_tax_number | String | Customer tax number. |
document_label | String | Document reference number. |
location_label | String | Location name. |
brand_label | String | Brand name. |
season_label | String | Season name. |
account_representative_label | String | Account representative name. |
external_reference | String | External reference number. |
payment_information_label | String | Payment method label. |
year | String | Year of the document date. |
month_year | String | Year-month of the document date (YYYY-MM). |
day_month_year | String | Full date (YYYY-MM-DD). |
shipping_type | String | Shipping type. |
quantity | Float | Quantity sold. |
total_without_taxes | Float | Total before taxes. |
total_with_taxes | Float | Total including taxes. |
tax_amount | Float | Tax amount. |
on_hand | Float | Current stock on hand. |
ecotax | Float | Ecotax amount. |
discount | Float | Discount amount. |
average_discount | Float | Average discount rate. |
cogs | Float | Cost of goods sold. |
margin | Float | Profit margin percentage. |
profit | Float | Profit amount. |
product_tags_label | String | Product tags (comma-separated). |
customer_tags_label | String | Customer tags (comma-separated). |
suppliers_label | String | Supplier names (comma-separated). |
sales_order_label | String | Related sales order reference. |
bill_to_country | String | Billing country. |
bill_to_city | String | Billing city. |
bill_to_state | String | Billing state/province. |
bill_to_postal_code | String | Billing postal code. |
ship_to_country | String | Shipping country. |
ship_to_city | String | Shipping city. |
ship_to_state | String | Shipping state/province. |
ship_to_postal_code | String | Shipping postal code. |
Data Types
SalesIntelligence
SalesIntelligence| Field | Type | Description |
|---|---|---|
line_item_id | Int | Line item identifier. |
variant_sku | String | Variant SKU code. |
variant_label | String | Variant label/name. |
variant_barcode | String | Variant barcode. |
product_label | String | Product label/name. |
customer_label | String | Customer name. |
customer_tax_number | String | Customer tax number. |
document_label | String | Document reference number. |
location_label | String | Location name. |
brand_label | String | Brand name. |
season_label | String | Season name. |
account_representative_label | String | Account representative name. |
external_reference | String | External reference number. |
payment_information_label | String | Payment method label. |
year | String | Year of the document date. |
month_year | String | Year-month of the document date (YYYY-MM). |
day_month_year | String | Full date (YYYY-MM-DD). |
shipping_type | String | Shipping type. |
quantity | Float | Quantity sold. |
total_without_taxes | Float | Total before taxes. |
total_with_taxes | Float | Total including taxes. |
tax_amount | Float | Tax amount. |
on_hand | Float | Current stock on hand. |
ecotax | Float | Ecotax amount. |
discount | Float | Discount amount. |
average_discount | Float | Average discount rate. |
cogs | Float | Cost of goods sold. |
margin | Float | Profit margin percentage. |
profit | Float | Profit amount. |
product_tags_label | String | Product tags (comma-separated). |
customer_tags_label | String | Customer tags (comma-separated). |
suppliers_label | String | Supplier names (comma-separated). |
sales_order_label | String | Related sales order reference. |
bill_to_country | String | Billing country. |
bill_to_city | String | Billing city. |
bill_to_state | String | Billing state/province. |
bill_to_postal_code | String | Billing postal code. |
ship_to_country | String | Shipping country. |
ship_to_city | String | Shipping city. |
ship_to_state | String | Shipping state/province. |
ship_to_postal_code | String | Shipping postal code. |
Filters
The following fields can be used in the where parameter:
document_id_custom, document_label_custom, document_type_custom, document_status_custom, variant_label_custom, variant_id_custom, variant_barcode_custom, variant_sku_custom, product_label_custom, product_id_custom, customer_label_custom, customer_tax_number_custom, customer_id_custom, location_label_custom, location_id_custom, brand_label_custom, brand_id_custom, season_label_custom, season_id_custom, account_representative_label_custom, account_representative_id_custom, external_reference_custom, payment_information_id_custom, year_custom, month_year_custom, day_month_year_custom, shipping_type_custom, quantity, total_without_taxes, total_with_taxes, tax_amount, on_hand, ecotax, discount, average_discount, cogs, margin, profit, bill_to_country_custom, bill_to_city_custom, bill_to_state_custom, bill_to_postal_code_custom, ship_to_country_custom, ship_to_city_custom, ship_to_state_custom, ship_to_postal_code_custom
Sorting
You can sort data based on following fields: line_item_id_custom, document_id_custom, document_label_custom, variant_id_custom, variant_label_custom, variant_sku_custom, variant_barcode_custom, product_label_custom, customer_label_custom, customer_tax_number_custom, location_label_custom, brand_label_custom, season_label_custom, account_representative_label_custom, external_reference_custom, year_custom, month_year_custom, day_month_year_custom, shipping_type_custom, quantity, total_without_taxes, total_with_taxes, tax_amount, on_hand, ecotax, discount, average_discount, cogs, margin, profit, bill_to_country_custom, bill_to_city_custom, bill_to_state_custom, bill_to_postal_code_custom, ship_to_country_custom, ship_to_city_custom, ship_to_state_custom, ship_to_postal_code_custom
