Date breakdown

A comprehensive list of the date breakdown query keys, allowed fields values, and operators for the return resource

To perform a date breakdown query on the return resource send a POST request to the /returns/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

return.approved_at

The date and time at which the return was approved (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).

return.archived_at

The date and time at which the return was archived (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).

return.cancelled_at

The date and time at which the return was cancelled (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).

return.created_at

The date and time at which the return was created (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).

return.received_at

The date and time at which the return was received (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).

return.rejected_at

The date and time at which the return was rejected (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).

return.shipped_at

The date and time at which the return was shipped (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).

return.updated_at

The date and time at which the return was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard).

return.current_date

The date and time of the return's latest status change, regardless of the return's status (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

value_count

customer.email

value_count

customer.group_name

value_count

destination_address.business

value_count

destination_address.city

value_count

destination_address.country_code

value_count

destination_address.geocoded

value_count

destination_address.localized

value_count

destination_address.state_code

value_count

destination_address.zip_code

value_count

origin_address.business

value_count

origin_address.city

value_count

origin_address.country_code

value_count

origin_address.geocoded

value_count

origin_address.localized

value_count

origin_address.state_code

value_count

origin_address.zip_code

value_count

market.id

cardinality

value_count

market.number

cardinality

value_count

return.number

value_count

return.reference

value_count

return.reference_origin

value_count

return.status

value_count

return.id

cardinality

value_count

return.order_id

value_count

return.skus_count

avg

max

min

sum

stats

return_line_items.quantity

avg

max

min

sum

stats

return_line_items.line_item_id

value_count

return_line_items.line_item_code

value_count

return_line_items.line_item_item_type

value_count

return_line_items.line_item_total_amount

avg

max

min

sum

stats

return_line_items.line_item_tax_amount

avg

max

min

sum

stats

return_line_items.line_item_tax_rate

avg

max

min

sum

stats

stock_location.id

value_count

stock_location.name

value_count

stock_location.reference

value_count

stock_location.reference_origin

value_count

Last updated