returns
Query stats on returns
Stats are aggregations that summarize your data within an operator (depending of the field, some of them could not be available), such as: value_count, cardinality, avg, min, max, sum or stats (which returns avg, min, max, sum) computed on the field specificed. When performing a stats query on the Metrics API endpoint you get in the response the value of the computation (based on the selected operator) on the selected field.
Stats request
{ "stats": { "field": "return_line_items.line_item_total_amount", "operator": "stats" } }
post/returns/stats
Request
- Base URLhttps://{your-domain}.commercelayer.io/metrics
- URLhttps://{your-domain}.commercelayer.io/metrics/returns/stats
- AuthHTTP bearer
Request body
Example request
{
"filter": {
"market": {
"numbers": {
"in": [
8
]
}
},
"return": {
"date_from": "2022-07-06T21:41:03Z",
"date_to": "2022-07-06T21:41:03Z",
"approved_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"archived_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"cancelled_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"created_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"received_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"rejected_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"shipped_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"updated_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"current_date": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"skus_count": {
"gt_lt": [
8
]
}
},
"return_line_items": {
"created_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"quantity": {
"gt_lt": [
8
]
},
"restocked_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"updated_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
},
"line_item_total_amount": {
"gt_lt": [
121
]
},
"line_item_tax_amount": {
"gt_lt": [
121
]
},
"line_item_tax_rate": {
"gt_lt": [
121
]
},
"line_item_updated_at": {
"gt_lt": [
"2022-07-06T21:41:03Z"
]
}
}
}
}Response
The stats result from returns
Changes
No recorded changes to this operation across all 1 revision of this API.