Latest archived orders
How to use the Metrics API to get the most recently archived orders
PreviousOrders by resource error code and messageNextLatest placed orders from customers with specific email domains
Last updated
How to use the Metrics API to get the most recently archived orders
Last updated
curl -g -X POST \
'https://{{your_domain}}.commercelayer.io/metrics/orders/search' \
-H 'Accept: application/vnd.api.v1+json' \
-H 'Content-Type: application/vnd.api+json' \
-H 'Authorization: Bearer {{your_access_token}}' \
-d '{
"search": {
"limit": 100,
"sort": "desc",
"sort_by": "order.archived_at",
"fields": [ "order.id", "order.number", "order.archived_at" ]
},
"filter": {
"order": {
"date_from": "2021-01-01T00:00:00Z",
"date_to": "2021-12-31T23:59:00Z",
"date_field": "archived_at",
"archived": true
}
}
}'{
"data": [
{
"id": "NrnYhAdVXO",
"number": "2434779",
"archived_at": "2021-07-15T15:00:49.154Z"
},
{
"id": "NEBrhvrjRO",
"number": "2431839",
"archived_at": "2021-04-16T14:29:29.350Z"
},
{ ... }
],
"meta": {
"pagination": {
"record_count": 123,
"cursor": "LS0tCi0gJzIwMjEtMTItMzFUMjM6NDE6M=="
},
"type": "search",
"trace_id": "fe571ea2-8a4f-4a5e-bd26-ac54651bb2e4",
"mode": "test",
"organization_id": "xYZkjABcde",
"market_ids": [ "yzXKjYzaCx", "..." ]
}
}