Optional Query Parameters¶
There are a number of optional parameters that can be provided when sending queries to eSales. The following sections provide examples on how to work with some of these parameters.
Stores and channels¶
Retailers can provide online and physical store stock numbers in the data feed. For more information, see Stores and channels.
If STORE
is explicitly declared in the channel
parameter, then value(s) for the store
parameter must be supplied with the relevant store keys. The following example shows a query to the search-page
endpoint to include the stock level from both online and physical stores, particularly for stores with store keys soho
and tribeca
.
Example¶
#!/bin/bash
curl -X GET \
'https://{cluster-id}.api.esales.apptus.cloud/api/v2/queries/search-page?market=US&customerKey=b65f78d4-23f0-4043-bd5e-fea24b5837d3&sessionKey=cc6772fd-65e2-4392-a1ee-24977c99fd2e&touchpoint=desktop&limit=60&skip=0&viewId=production&q=blue%20shirt&channels=ONLINE|STORE&stores=soho|tribeca'
const api = esales ({ market:'US',webApiId: 'cluster-id',touchpoint:'desktop' });
const results = await api.query.searchPage({ q: 'blue shirt',
channels: 'ONLINE|STORE', stores:'soho|tribeca' });
Notify¶
If large scale testing is done to simulate visitor behaviour during development and testing, it is recommended to ensure that notify=false
is applied. For more information, see the Notify query parameter.
Example¶
The following is an example on how to work with the notify
parameter.
https://{cluster-id}.api.esales.apptus.cloud/api/v2/queries/autocomplete?market=US& customerKey=b65f78d4-23f0-4043-bd5e-fea24b5837d3&sessionKey=cc6772fd-65e2-4392-a1ee-24977c99fd2e&touchpoint=desktop&q=shir¬ify=false
const api = esales ({ market:'US', webApiId: 'cluster-id', touchpoint:'desktop' });
const results = await api.query.autocomplete({ q: 'shir', notify: false });
Present custom¶
By default, eSales returns the predefined product attributes in the query response. To include custom attributes in the query response, they must be specified as values in the presentCustom
parameter.
Example¶
Below is an example on how to include custom attributes in a query response.
Multiple custom attributes can be requested by specifying them using pipe separators, e.g. presentCustom=category|season
.
https://{{cluster-id}}.api.esales.apptus.cloud/api/v2/queries/search-page?market=US&sessionKey=4b116e34-0a7a-ce5d-5591-75c62f231967&customerKey=4b116e34-0a7a-ce5d-5591-75c62f231967&touchpoint=DESKTOP&q=silk&presentCustom=season
Multiple custom attributes can be requested by specifying them as an array of strings, e.g. presentCustom:['category', 'season']
const api = esales({ market: 'US', webApiId: 'wf7e2b2a0', touchpoint: 'desktop' });
const results = await api.query.searchPage({ q: 'silk', presentCustom:['season'] });