Latest placed orders from customers with specific email domains
How to use the Metrics API to get the last placed orders containing specific email domains in the aggregated details
Last updated
How to use the Metrics API to get the last placed orders containing specific email domains in the aggregated details
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": 10,
"sort": "asc",
"sort_by": "order.placed_at",
"fields": [ "order.id", "order.number", "order.status", "customer.email" ]
},
"filter": {
"order": {
"date_from": "2021-01-01T00:00:00Z",
"date_to": "2021-12-31T23:59:00Z",
"date_field": "placed_at",
"aggregated_details": {"query": "(*@gmail.com | *@hotmail.com) + placed" }
}
}
}'{
"data": [
{
"id": "XQehvkzvEW",
"number": "57228640",
"status": "placed",
"customer": {
"email": "[email protected]"
}
},
{
"id": "KaeheDObgV",
"number": "57230928",
"status": "placed",
"customer": {
"email": "[email protected]"
}
},
{
"id": "FafhdDOgvK",
"number": "57242561",
"status": "placed",
"customer": {
"email": "[email protected]"
}
},
{ ... }
],
"meta": {
"pagination": {
"record_count": 123,
"cursor": "LS0tCi0gJzIwMjEtMTItMzFUMjM6NDE6M=="
},
"type": "search",
"trace_id": "fe571ea2-8a4f-4a5e-bd26-ac54651bb2e4",
"mode": "test",
"organization_id": "xYZkjABcde",
"market_ids": [ "yzXKjYzaCx", "..." ]
}
}