The structure of the data object in Incremental Feed API requests
In the Sitecore Discover Incremental Feed API, the data object (in JSON format) contains updates to product information. This topic describes the structure of the data object, including its nested objects and properties (key-value pairs).
The following shows an example of the data object in JSON format:
{
"data": {
"products": [
{
"sku": "<sku number>",
"store": {
"id": "<store id>",
"group": "<store group identifier>"
},
"locale_country": "<2 letter country code, eg: us>",
"locale_language": "<2 letter language code, eg: en>",
"restriction": {
"isAvailable": true|false
},
"attributes": {
"<attribute-name-to-update>": "<value>",
"<attribute-name-to-update>": "<value>",
"..."
}
},
{ ... }
]
}
}The data object supports the following key:
|
Key |
Type |
Description |
|---|---|---|
|
|
Array of objects |
Required. Array of products to update. |
We recommend to include a maximum of 10 products in each API request.
The products object
The products object is an array of nested unkeyed product objects, each representing a product to update. Each nested product object contains key values that identify the product to update, and a required attribute object that specifies the product attributes to update.
The products object supports the following key:
|
Key |
Type |
Description |
|---|---|---|
|
|
string |
Required. The unique value identifying the stock keeping unit (SKU) to update. Note To update an attribute that is not specific to a product SKU, you can specify any |
|
|
string |
Optional. The country code of the localized attribute to update. |
|
|
string |
Optional. The language code of the localized attribute to update. |
|
|
object |
Optional. If your Discover implementation is set up for B2B or multiple stores support, you can include this object to update an attribute for a specific customer or group of customers, or for a specific store or group of stores. |
|
|
object |
Optional. Use this object if your Discover implementation is set up to support B2B or multiple stores, and you use whitelisting or blacklisting attributes to manage product availability per customer or group of customers, or per store or group of stores. |
|
|
object |
Required. The product attributes (in key-value pair) to update. |
Updates to localized attributes
If your domain is set up for multi locale support, you can include parameters to update a localized attribute for a given country or language.
You can chose to specify only the language. If you do so, then all countries configured to use that language are updated with the given values.
When you specify locale key values, you must ensure that the codes and convention you use to represent language and country are consistent with those you use in the product feed.
The following table lists supported keys for locale:
|
Key |
Value type |
Description |
|---|---|---|
|
|
string |
Optional. A code representing a language. If a value is specified, all product attributes configured to use that language are updated. |
|
|
string |
Optional. A code representing the country. If a value is specified, product attributes that specify this locale (language and country) are updated. |
The store object
The store object contains keys used to update product data for specific stores or groups of stores, or customers or groups of customers in the Discover implementation set up for multistore or for B2B support.
|
Key |
Type |
Description |
|---|---|---|
|
|
string |
Optional. A unique store ID (multistore support) or a unique customer ID (B2B). Note The specified |
|
|
string |
Optional. If your stores are organized in a two-level hierarchy (for example, as zones or regions and stores), or if you have a B2B site with customers organized in a two-level hierarchy, you pass the top level organization identifier as a Note The specified |
The restriction object
Use the restriction object to update product availability for each store or customer, if your Discover implementation is set up to support B2B or multiple stores, and you use B2B availability and restriction (whitelisting and blacklisting) attributes.
If you do not use availability restriction in your implementation to manage product availability for each customer or store, but instead you use stock_quantity attribute for this purpose, then you can use the attributes object to pass the updated stock_quantity value.
The following table lists the key of the restriction object:
|
Key |
Type |
Description |
|
|
Boolean |
Required if the When set to When set to Example: RequestResponse |
The attributes object
You use the attributes to update various product attributes.
The following table lists attributes keys:
|
Key |
Type |
Description |
|---|---|---|
|
Various |
Optional. One of more product attribute key-value pairs to update, for example, to update price and the stock quantity of a product, you pass the following key-value pairs: RequestResponse Note You can only pass attributes that are part of your data feed. API requests that contain invalid attributes are rejected. |