Hi, I am wondering if there is a way to get each customer’s purchase amount over the past year.
Would I need to create a database and store the customer’s purchases? Is there a way to retrieve it with a simple GET request? Thanks
Hi, I am wondering if there is a way to get each customer’s purchase amount over the past year.
Would I need to create a database and store the customer’s purchases? Is there a way to retrieve it with a simple GET request? Thanks
With the Orders API you can SearchOrders with a query for specific customers get their order history. It would look something like this:
{
"location_ids": [
"{{location_id}}"
],
"query": {
"filter": {
"customer_filter": {
"customer_ids": [
"{{customer_id}}"
]
},
"date_time_filter": {
"created_at": {
"end_at": "2022-06-16T19:29:49.582Z",
"start_at": "2021-06-16T19:29:49.582Z"
}
}
},
"sort": {
"sort_order": "DESC"
}
}
}