Submissions Object Model
This page describes how a product and its attributes are represented when the adapter receives them for a submission. The status objects the adapter returns to report the outcome (SubmitStatus and ItemStatus) are described in Status Handling.
Product
Product object represents single product.
| Property | Description |
|---|---|
| id | PDX owned product id. |
| name | Product name - special attribute in PDX. |
| externalId | Adapter owned product id. Is set by adapter by setting the externalProductId on ItemStatus in SubmitStatus event. |
| categoryId | Id of the category where product belongs. |
| familyId | Id of the product’s family. |
| created | Date/time when product was created. |
| attributes | Map of product’s attributes. Key in this map is the PDX attribute id, not the external id. Different attribute types are represented by sub-classes of the AbstractAttribute class. |
The account a product was submitted for is not a dedicated field on Product. It is carried as the value of the channel's account attribute — the attribute registered asprimaryAttributes.account. Read it from the product'sattributesmap during submitBatch (using the id you gave that attribute), and report it back on the ItemStatus asaccountId.
// "ACCOUNT" is the id of your account attribute
String accountId = (String) product.getAttributes().get("ACCOUNT").attrValue();Attributes
Base class for all attribute types is AbstractAttribute. It defines two basic properties:
| Property | Description |
|---|---|
| id | PDX attribute id (notice that it is not channel specific id - external id has to be looked up in the datastandard definition). |
| disabled | Flag indicating that attribute is disabled - adapter can decide not to send disabled values. |
| attrValue | Value of the attribute - different for each attribute type. |
Example:
{
"attributeType": "TextAttribute",
"id": "PRICE",
"disabled": false,
"value": "123.23",
"languageValue": {
"default": "123.23"
}
},
{
"attributeType": "MultiTextAttribute",
"id": "ACCOUNT_DISCRIMINATOR",
"disabled": false,
"value": [
"1234", "7891"
]
},
{
"attributeType": "TextAttribute",
"id": "DISABLED_ALWAYS",
"disabled": true,
"value": "DISABLED_ALWAYS"
}Different Attribute types
Text Attribute
Implemented by TextAttribute represents simple text value.
| Property | Description |
| value | Text value of the attribute (Java type: String). |
Example:
{
"attributeType": "TextAttribute",
"id": "PRICE",
"disabled": false,
"value": "123.23",
"languageValue": {
"default": "123.23"
}
}Multi-Text Attribute
Implemented by MultiTextAttribute represents list of simple text values.
| Property | Description |
| value | List of text values of the attribute (Java type: List |
Example:
{
"attributeType": "MultiTextAttribute",
"id": "ACCOUNT_DISCRIMINATOR",
"disabled": false,
"value": [
"1234", "7891"
]
}Asset Attribute
Implemented by AssetAttribute represents the single asset attribute which can contain various types of files.
| Property | Description |
|---|---|
| value | PDX id of the asset. |
| assetMetadata | Additional asset properties. |
| id | PDX id of the asset. |
| name | Name of the asset file. |
| url | PDX asset url. |
| externalUrl | External asset url (if asset was downloaded from url by PDX on import) or file name (if asset was uploaded to PDX). |
| contentType | MIME type of the asset. |
| height | Asset height - if possible to specify (i.e. for image/* MIME types). |
| width | Asset width - if possible to specify (i.e. for image/* MIME types). |
Example:
{
"attributeType": "AssetAttribute",
"id": "ASSET_BRAND_LOGO",
"disabled": false,
"value": "40673de5-1fd3-42ec-873b-ab4aa124af79",
"assetMetadata": {
"id": "40673de5-1fd3-42ec-873b-ab4aa124af79",
"name": "11fa559e-3f63-5790-b08b-d67120bee658.jpg",
"url": "https://assets.s3.amazonaws.com/clientid/40673de5-1fd3-42ec-873b-ab4aa124af79/40673de5-1fd3-42ec-873b-ab4aa124af79.jpg",
"externalUrl": "11fa559e-3f63-5790-b08b-d67120bee658.jpg",
"contentType": "image/jpeg",
"height": 400,
"width": 400
}
}Multi-Asset Attribute
Implemented by MultiAssetAttribute represents a list of assets.
| Property | Description |
|---|---|
| value | List of PDX ids of the assets. |
| assetsMetadata | List of assetMetadata (as described above) object of the assets. |
Composite Attribute
Implemented by CompositeAttribute represents more complicated structures consisting of other attributes - including other composites.
| Property | Description |
|---|---|
| value | List of other attributes - including other composites. |
Multi-Composite Attribute
Implemented by MultiCompositeAttribute represents a list of composites.
| Property | Description |
|---|---|
| value | List of composites. |
Updated 4 days ago
