Optional query parameters¶
There are a number of optional parameters that can be provided when sending queries to Elevate. 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/storefront/v3/queries/search-page?market=US&locale=en-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%7CSTORE&stores=soho%7Ctribeca'
const api = esales({ clusterId: 'w00000000', market:'US', locale: 'en-US', 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 behavior 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.
#!/bin/bash
curl -X GET \
'https://{cluster-id}.api.esales.apptus.cloud/api/storefront/v3/queries/autocomplete?market=US&locale=en-US&customerKey=b65f78d4-23f0-4043-bd5e-fea24b5837d3&sessionKey=cc6772fd-65e2-4392-a1ee-24977c99fd2e&touchpoint=desktop&q=shir¬ify=false'
const api = esales({ clusterId: 'w00000000', market: 'US', locale: 'en-US', touchpoint: 'desktop' });
const results = await api.query.autocomplete({ q: 'shir', notify: false });
Templates and Present custom¶
By default, Elevate returns the predefined product attributes in the query response. To include custom attributes in the query response, one of two methods can be used:
-
The first option is to supply a
templateId
parameter, corresponding to the id of an imported template. All attributes defined in the template will be returned in the query response. -
The second option is to supply all requested custom parameters as pipe-separated values in the
presentCustom
parameter. Custom attributes on a variant can be requested by prefixing the name withvariant.
, e.g.variant.grip
. Custom typed attributes can be requested by by prefixing the name with the type, e.g.length.diameter
orvariant.number.package_count
Note that these options are mutually exclusive: you can only use one of them in each request. In general, we suggest using templates to reduce the size of query requests and, in particular, query responses, as templates let you fine-tune what data you want.
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 url encoded pipe separators, e.g. presentCustom=category%7Cseason
.
#!/bin/bash
curl -X GET \
'https://{cluster-id}.api.esales.apptus.cloud/api/storefront/v3/queries/search-page?market=US&locale=en-US&sessionKey=4b116e34-0a7a-ce5d-5591-75c62f231967&customerKey=4b116e34-0a7a-ce5d-5591-75c62f231967&touchpoint=DESKTOP&q=silk&templateId=default'
Multiple custom attributes can be requested by specifying them as an array of strings, e.g. presentCustom:['category', 'season']
const api = esales({ clusterId: 'w00000000', market: 'US', locale: 'en-US', touchpoint: 'desktop' });
const results = await api.query.searchPage({
q: 'silk',
templateId: 'default'
});
Multiple custom attributes can be requested by specifying them using url encoded pipe separators, e.g. presentCustom=category%7Cseason
.
``` bash
#!/bin/bash
curl -X GET \
'https://{cluster-id}.api.esales.apptus.cloud/api/storefront/v3/queries/search-page?market=US&locale=en-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']
``` javascript
const api = esales({ clusterId: 'w00000000', market: 'US', locale: 'en-US', touchpoint: 'desktop' });
const results = await api.query.searchPage({
q: 'silk',
presentCustom:['season']
});
```
Present prices¶
Retailers can choose to simultaneously present multiple prices for products on the site, for example member price versus non-member price. To include these custom prices in the query response, they must specified in the presentPrices
parameter.
Example¶
The value(s) supplied in presentPrices
parameter must match with price identifiers defined in the data feed, see Custom prices in the Format specification. Below is an example on how to include custom prices in a query response.
Multiple custom prices can be requested by specifying them using url encoded pipe separators, e.g. presentPrices=VIP%7CNON_VIP
.
#!/bin/bash
curl -X GET \
'https://{cluster-id}.api.esales.apptus.cloud/api/storefront/v3/queries/search-page?market=US&locale=en-US&sessionKey=4b116e34-0a7a-ce5d-5591-75c62f231967&customerKey=4b116e34-0a7a-ce5d-5591-75c62f231967&touchpoint=DESKTOP&q=silk&presentPrices=VIP%7CNON_VIP'
Multiple custom prices can be requested by specifying them as an array of strings, e.g. presentPrices:['VIP', 'NON_VIP']
const api = esales({ clusterId: 'w00000000', market: 'US', locale: 'en-US', touchpoint: 'desktop' });
const results = await api.query.searchPage({
q: 'silk',
presentPrices:['VIP','NON_VIP']
});