curl --request POST \
--url https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType} \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"filters": {
"and": [
{
"field": "locationId",
"operator": "equals",
"value": "warehouse-01",
"caseInsensitive": true
}
]
},
"facets": [
{
"name": "Location",
"field": "locationId",
"size": 20
}
],
"sort": [
{
"field": "stockAmount",
"order": "desc"
}
],
"pagination": {
"page": 0,
"pageSize": 20
}
}
'import requests
url = "https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}"
payload = {
"filters": { "and": [
{
"field": "locationId",
"operator": "equals",
"value": "warehouse-01",
"caseInsensitive": True
}
] },
"facets": [
{
"name": "Location",
"field": "locationId",
"size": 20
}
],
"sort": [
{
"field": "stockAmount",
"order": "desc"
}
],
"pagination": {
"page": 0,
"pageSize": 20
}
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Length": "<content-length>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Api-Key': '<x-api-key>',
'Content-Length': '<content-length>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filters: {
and: [
{
field: 'locationId',
operator: 'equals',
value: 'warehouse-01',
caseInsensitive: true
}
]
},
facets: [{name: 'Location', field: 'locationId', size: 20}],
sort: [{field: 'stockAmount', order: 'desc'}],
pagination: {page: 0, pageSize: 20}
})
};
fetch('https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filters' => [
'and' => [
[
'field' => 'locationId',
'operator' => 'equals',
'value' => 'warehouse-01',
'caseInsensitive' => true
]
]
],
'facets' => [
[
'name' => 'Location',
'field' => 'locationId',
'size' => 20
]
],
'sort' => [
[
'field' => 'stockAmount',
'order' => 'desc'
]
],
'pagination' => [
'page' => 0,
'pageSize' => 20
]
]),
CURLOPT_HTTPHEADER => [
"Content-Length: <content-length>",
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}"
payload := strings.NewReader("{\n \"filters\": {\n \"and\": [\n {\n \"field\": \"locationId\",\n \"operator\": \"equals\",\n \"value\": \"warehouse-01\",\n \"caseInsensitive\": true\n }\n ]\n },\n \"facets\": [\n {\n \"name\": \"Location\",\n \"field\": \"locationId\",\n \"size\": 20\n }\n ],\n \"sort\": [\n {\n \"field\": \"stockAmount\",\n \"order\": \"desc\"\n }\n ],\n \"pagination\": {\n \"page\": 0,\n \"pageSize\": 20\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Length", "<content-length>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"and\": [\n {\n \"field\": \"locationId\",\n \"operator\": \"equals\",\n \"value\": \"warehouse-01\",\n \"caseInsensitive\": true\n }\n ]\n },\n \"facets\": [\n {\n \"name\": \"Location\",\n \"field\": \"locationId\",\n \"size\": 20\n }\n ],\n \"sort\": [\n {\n \"field\": \"stockAmount\",\n \"order\": \"desc\"\n }\n ],\n \"pagination\": {\n \"page\": 0,\n \"pageSize\": 20\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Length"] = '<content-length>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"and\": [\n {\n \"field\": \"locationId\",\n \"operator\": \"equals\",\n \"value\": \"warehouse-01\",\n \"caseInsensitive\": true\n }\n ]\n },\n \"facets\": [\n {\n \"name\": \"Location\",\n \"field\": \"locationId\",\n \"size\": 20\n }\n ],\n \"sort\": [\n {\n \"field\": \"stockAmount\",\n \"order\": \"desc\"\n }\n ],\n \"pagination\": {\n \"page\": 0,\n \"pageSize\": 20\n }\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"totalResults": 200,
"results": [
{
"sku": "p-5427",
"stockAmount": 20,
"locationId": "warehouse-01",
"_originId": "p-5427",
"_sourceGuid": "9f741916-19e3-4791-9ebd-701634ba9b75",
"_updatedAt": "2025-01-07T08:43:15.7351089Z"
}
],
"facets": [
{
"name": "Location",
"field": "locationId",
"groups": [
{
"value": "warehouse-01",
"count": 95
},
{
"value": "warehouse-02",
"count": 78
}
],
"isValid": true
}
],
"nextPageToken": "WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0="
}{
"message": "Query is not valid",
"errors": [
"Operator not implemented: equal"
],
"status": 0
}{
"error": "Forbidden"
}Note: This endpoint is currently in preview
The Query API is used to query items in an index, this endpoint lets you query items ingested to Auto Indexing source groups.
curl --request POST \
--url https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType} \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"filters": {
"and": [
{
"field": "locationId",
"operator": "equals",
"value": "warehouse-01",
"caseInsensitive": true
}
]
},
"facets": [
{
"name": "Location",
"field": "locationId",
"size": 20
}
],
"sort": [
{
"field": "stockAmount",
"order": "desc"
}
],
"pagination": {
"page": 0,
"pageSize": 20
}
}
'import requests
url = "https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}"
payload = {
"filters": { "and": [
{
"field": "locationId",
"operator": "equals",
"value": "warehouse-01",
"caseInsensitive": True
}
] },
"facets": [
{
"name": "Location",
"field": "locationId",
"size": 20
}
],
"sort": [
{
"field": "stockAmount",
"order": "desc"
}
],
"pagination": {
"page": 0,
"pageSize": 20
}
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Length": "<content-length>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Api-Key': '<x-api-key>',
'Content-Length': '<content-length>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filters: {
and: [
{
field: 'locationId',
operator: 'equals',
value: 'warehouse-01',
caseInsensitive: true
}
]
},
facets: [{name: 'Location', field: 'locationId', size: 20}],
sort: [{field: 'stockAmount', order: 'desc'}],
pagination: {page: 0, pageSize: 20}
})
};
fetch('https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filters' => [
'and' => [
[
'field' => 'locationId',
'operator' => 'equals',
'value' => 'warehouse-01',
'caseInsensitive' => true
]
]
],
'facets' => [
[
'name' => 'Location',
'field' => 'locationId',
'size' => 20
]
],
'sort' => [
[
'field' => 'stockAmount',
'order' => 'desc'
]
],
'pagination' => [
'page' => 0,
'pageSize' => 20
]
]),
CURLOPT_HTTPHEADER => [
"Content-Length: <content-length>",
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}"
payload := strings.NewReader("{\n \"filters\": {\n \"and\": [\n {\n \"field\": \"locationId\",\n \"operator\": \"equals\",\n \"value\": \"warehouse-01\",\n \"caseInsensitive\": true\n }\n ]\n },\n \"facets\": [\n {\n \"name\": \"Location\",\n \"field\": \"locationId\",\n \"size\": 20\n }\n ],\n \"sort\": [\n {\n \"field\": \"stockAmount\",\n \"order\": \"desc\"\n }\n ],\n \"pagination\": {\n \"page\": 0,\n \"pageSize\": 20\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Length", "<content-length>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {\n \"and\": [\n {\n \"field\": \"locationId\",\n \"operator\": \"equals\",\n \"value\": \"warehouse-01\",\n \"caseInsensitive\": true\n }\n ]\n },\n \"facets\": [\n {\n \"name\": \"Location\",\n \"field\": \"locationId\",\n \"size\": 20\n }\n ],\n \"sort\": [\n {\n \"field\": \"stockAmount\",\n \"order\": \"desc\"\n }\n ],\n \"pagination\": {\n \"page\": 0,\n \"pageSize\": 20\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://query.enterspeed.com/v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Length"] = '<content-length>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filters\": {\n \"and\": [\n {\n \"field\": \"locationId\",\n \"operator\": \"equals\",\n \"value\": \"warehouse-01\",\n \"caseInsensitive\": true\n }\n ]\n },\n \"facets\": [\n {\n \"name\": \"Location\",\n \"field\": \"locationId\",\n \"size\": 20\n }\n ],\n \"sort\": [\n {\n \"field\": \"stockAmount\",\n \"order\": \"desc\"\n }\n ],\n \"pagination\": {\n \"page\": 0,\n \"pageSize\": 20\n }\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"totalResults": 200,
"results": [
{
"sku": "p-5427",
"stockAmount": 20,
"locationId": "warehouse-01",
"_originId": "p-5427",
"_sourceGuid": "9f741916-19e3-4791-9ebd-701634ba9b75",
"_updatedAt": "2025-01-07T08:43:15.7351089Z"
}
],
"facets": [
{
"name": "Location",
"field": "locationId",
"groups": [
{
"value": "warehouse-01",
"count": 95
},
{
"value": "warehouse-02",
"count": 78
}
],
"isValid": true
}
],
"nextPageToken": "WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0="
}{
"message": "Query is not valid",
"errors": [
"Operator not implemented: equal"
],
"status": 0
}{
"error": "Forbidden"
}Headers
Api key to validate your environment.
"environment-1637c4d0-e878-4738-b866-152106a4f88c"
The length of the message body, in bytes (this header is automatically added by most clients).
Body
The query uses the same format as the Query items endpoint with the only exeption that aliases is not supported here.
The body is of type object.
Response
Valid request.
0
The total number of results matched by query.
200
List of items from the index matched by the query provided.
Built in fields are prefixed with underscore (_).
List of aggregated field values based on the requested facet fields.
Continuation token for the next page of results. Pass this value in the pagination.nextPageToken field of the next request. null when no further results exist.
"WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0="
Was this page helpful?