here i am doing like this but not working
$requestData['number'] = [
'$in' => ["10028"]
];
$body = json_encode([
"query" => ([
"filter" => $requestData ? json_encode($requestData) : null,
"sort" => json_encode([["dateCreated" => "desc"]]),
"paging" => [
"limit" => getWixPerPage(),
"offset" => $offset
]
])
]);
return $this->connectWix($access_token, 'stores/v2/orders/query', 'POST', $body);
but it gives me errror like this:
“”" Client error: POST https://www.wixapis.com/stores/v2/orders/query
resulted in a 400 Bad Request
response:\n {“message”:“Invalid long filter ‘incrementId $in [10028.0]’”,“details”:{“applicationError”:{“code”:“SE-1105”,“descriptio (truncated…)\n “””
I’m not familiar with the language this code is written in but I think there’s a clue here:
‘$in’ => [“10028”]
‘incrementId $in [10028.0]’
Seems the 10028 string is getting automatically converted into a fixed or floating point number and "10028" != "10028.0"
how to solve this please help me… i have done this using postman sending string data and still same error
here is the parameter i sent using postman
{
"query": {
"filter": "{\"number\":{\"$in\":[\"10028\"]}}",
"sort": "[{\"dateCreated\":\"desc\"}]",
"paging": {
"limit": 10,
"offset": 0
}
}
}
{
"query": {
"filter": {"number":{"$eq":"10028"}},
"sort": [{"dateCreated":"desc"}],
"paging": {
"limit": 10,
"offset": 0
}
}
}
but i want to use $in operator like
{
“query”: {
“filter”: {“number”:{“$in”:[“10028”,“10027”]}},
“sort”: [{“dateCreated”:“desc”}],
“paging”: {
“limit”: 10,
“offset”: 0
}
}
}
and it give me error
“”" Client error: POST https://www.wixapis.com/stores/v2/orders/query
resulted in a 400 Bad Request
response:\n {“message”:“Invalid long filter ‘incrementId $in [10028.0,10027.0]’”,“details”:{“applicationError”:{“code”:“SE-1105”,“descriptio (truncated…)\n “””
I can propose to use $gte and $lte to provide range of orderIds instead.
another option is to use nested $or.