Links

Date breakdown

A comprehensive list of the date breakdown query keys, allowed fields values, and operators for the order resource
To perform a date breakdown query on the order resource send a POST request to the /orders/date_breakdown endpoint specifying in the payload the query keys and filter parameters like in the generic example below:
{
"date_breakdown": {
"by": "...",
"field": "...",
"operator": "...",
"interval": "...",
"breakdown": {
"by": "...",
"field": "...",
"operator": "...",
"condition": { ... },
"sort": "...",
"limit": ...,
"breakdown": {
"by": "...",
"field": "...",
"operator": "...",
"condition": { ... },
"sort": "...",
"limit": ...
}
}
},
"filter": { ... }
}
Please find more information on how date breakdown queries work here.

Query keys

These are the keys you need to set when performing a date breakdown query:
Key
Type
Required
Description
Values
by
String
The date field you want the results of the query aggragated by.
See the related table to check the full list of valid values for this key.
field
String
The field you want the metrics or statistics computed on.
See the related table to check the full list of valid values for this key.
operator
String
The computing operator.
See the related table to check the full list of valid operators based on the value you assigned to the field key.
interval
String
The time interval over which the metrics / stats are computed. The results will be aggregated by date accordingly.
One of hour, day, week, month, or year (default is month).
breakdown
Object
The optional breakdown (eventually nested).
See the related section for any information about the breakdown query.

by values

These are the valid values you can specify for the by key of the date breakdown query:
Value
Description
order.approved_at
The date and time at which the order was approved (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
order.cancelled_at
The date and time at which the order was cancelled (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
order.created_at
The date and time at which the order was created (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
order.fulfillment_updated_at
The date and time at which the order's fulfillment status was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
order.payment_updated_at
The date and time at which the order's payment status was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
order.placed_at
The date and time at which the order was placed (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
order.updated_at
The date and time at which the order was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
order.current_date
The date and time of the order's latest status change, regardless of the order's status (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
shipments.cancelled_at
The date and time at which the shipment status was cancelled (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
shipments.on_hold_at
The date and time at which the shipment status was put on hold (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
shipments.picking_at
The date and time at which the shipment was picked (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
shipments.packing_at
The date and time at which the shipment was packed (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
shipments.ready_to_ship_at
The date and time at which the shipment was ready to ship (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
shipments.shipped_at
The date and time at which the shipment was shipped (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
shipments.created_at
The date and time at which the shipment was created (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).
shipments.updated_at
The date and time at which the shipment was updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).

Operators and field values

These are the valid values you can specify for the field key of the date breakdown query and the related valid operators, based on that key:
Value
Operators
customer.id
cardinality
value_count
customer.email
cardinality
value_count
customer.group_name
cardinality
value_count
line_items.code
cardinality
value_count
line_items.discount
avg
max
min
sum
stats
line_items.id
cardinality
value_count
line_items.item_id
cardinality
value_count
line_items.options_amount
avg
max
min
sum
stats
line_items.quantity
avg
max
min
sum
stats
line_items.tax_amount
avg
max
min
sum
stats
line_items.tax_rate
avg
max
min
sum
stats
line_items.total_amount
avg
max
min
sum
stats
line_items.unit_amount
avg
max
min
sum
stats
line_items.options.id
cardinality
value_count
line_items.options.quantity
avg
max
min
sum
stats
line_items.options.total_amount
avg
max
min
sum
stats
line_items.options.unit_amount
avg
max
min
sum
stats
market.id
cardinality
market.number
cardinality
value_count
order.adjustment_amount
avg
max
min
sum
stats
order.adjustment_tax_amount
avg
max
min
sum
stats
order.adjustment_taxable_amount
avg
max
min
sum
stats
order.discount_amount
avg
max
min
sum
stats
order.duty_amount
avg
max
min
sum
stats
order.gift_card_code
value_count
order.gift_card_amount
avg
max
min
sum
stats
order.id
cardinality
value_count
order.line_item_options_count
avg
max
min
sum
stats
order.number
value_count
order.payment_method_amount
avg
max
min
sum
stats
order.payment_method_tax_amount
avg
max
min
sum
stats
order.payment_method_taxable_amount
avg
max
min
sum
stats
order.reference
cardinality
value_count
order.reference_origin
cardinality
value_count
order.shipments_count
avg
max
min
sum
stats
order.shipping_amount
avg
max
min
sum
stats
order.shipping_taxable_amount
avg
max
min
sum
stats
order.skus_count
avg
max
min
sum
stats
order.subtotal_amount
avg
max
min
sum
stats
order.subtotal_tax_amount
avg
max
min
sum
stats
order.subtotal_taxable_amount
avg
max
min
sum
stats
order.total_amount
avg
max
min
sum
stats
order.total_amount_with_taxes
avg
max
min
sum
stats
order.total_tax_amount
avg
max
min
sum
stats
order.total_taxable_amount
avg
max
min
sum
stats
order.seconds_in_draft
avg
max
min
stats
percentiles
order.seconds_in_approved
avg
max
min
stats
percentiles
order.seconds_in_placed
avg
max
min
stats
percentiles
order.refunds_total_amount_with_taxes
avg
max
min
sum
stats
order.total_amount_with_taxes_net_of_refunds
avg
max
min
sum
stats
refunds.id
value_count
refunds.amount
avg
max
min
sum
stats
refunds.number
value_count
shipments.reference
cardinality
value_count
shipments.reference_origin
cardinality
value_count
shipments.seconds_in_picking
avg
max
min
stats
percentiles
shipments.seconds_in_ready_to_ship
avg
max
min
stats
percentiles
shipments.stock_location.reference
cardinality
value_count
shipments.stock_location_reference_origin
cardinality
value_count
shipments.shipping_method.reference
cardinality
value_count
shipments.shipping_method.reference_origin
cardinality
value_count
shipments.shipping_category.reference
cardinality
value_count
shipments.shipping_category.reference_origin
cardinality
value_count
Last modified 2mo ago