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.

PropertyDescription
idPDX owned product id.
nameProduct name - special attribute in PDX.
externalIdAdapter owned product id. Is set by adapter by setting the externalProductId on ItemStatus in SubmitStatus event.
categoryIdId of the category where product belongs.
familyIdId of the product’s family.
createdDate/time when product was created.
attributesMap 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 as primaryAttributes.account. Read it from the product's attributes map during submitBatch (using the id you gave that attribute), and report it back on the ItemStatus as accountId.

// "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:

PropertyDescription
idPDX attribute id (notice that it is not channel specific id - external id has to be looked up in the datastandard definition).
disabledFlag indicating that attribute is disabled - adapter can decide not to send disabled values.
attrValueValue 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.

PropertyDescription
valueText 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.

PropertyDescription
valueList 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.

PropertyDescription
valuePDX id of the asset.
assetMetadataAdditional asset properties.
idPDX id of the asset.
nameName of the asset file.
urlPDX asset url.
externalUrlExternal asset url (if asset was downloaded from url by PDX on import) or file name (if asset was uploaded to PDX).
contentTypeMIME type of the asset.
heightAsset height - if possible to specify (i.e. for image/* MIME types).
widthAsset 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.

PropertyDescription
valueList of PDX ids of the assets.
assetsMetadataList 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.

PropertyDescription
valueList of other attributes - including other composites.

Multi-Composite Attribute

Implemented by MultiCompositeAttribute represents a list of composites.

PropertyDescription
valueList of composites.

Did this page help you?