Orders paid with gift cards
How to use the Metrics API to get the total number of orders that were paid using a gift card
The problem
The solution
Query
Key
Value
Filter
Attribute
Operator
Example
curl -g -X POST \
'https://{{your_domain}}.commercelayer.io/metrics/orders/stats' \
-H 'Accept: application/vnd.api.v1+json' \
-H 'Content-Type: application/vnd.api+json' \
-H 'Authorization: Bearer {{your_access_token}}' \
-d '{
"stats": {
"field": "order.id",
"operator": "value_count"
},
"filter": {
"order": {
"date_from": "2021-01-01T00:00:00Z",
"date_to": "2021-12-31T23:59:00Z",
"date_field": "approved_at",
"gift_card": true,
"payment_statuses": {
"in": [ "paid" ]
}
}
}
}'Similar cases
PreviousOrders by shipment status and shipping method nameNextOrders associated with a specific promotion
Last updated