Required Client Attributes

This is a list of attributes user can provide while adding channel account to PDX. Usually it will contain vendor credentials which will be used in authentication process: Authentication.

It can additionally contain attributes that define data provider or data receiver used to deliver products in Submission process.

Example:

{
    "name": "Vendor Portal Username",
    "id": "user",
    "type": {
        "restriction": {
            "patterns": [
                {
                    "pattern": "^.+$",
                    "message": "Value must be at least one character"
                }
            ]
        },
        "id": "string"
    }
},
{
    "name": "Vendor Portal Password",
    "id": "password",
    "type": {
        "restriction": {
            "patterns": [
                {
                    "pattern": "^.+$",
                    "message": "Value must be at least one character"
                }
            ]
        },
        "id": "password"
    }
},

Attribute Types

Only two attribute types are supported on account level. Available restrictions are limited to patterns only.

String Type

Attribute type idType specific restriction parameters
stringpatterns: List of patters that the value must match (Java Pattern). Values has to match all the patters.

📘

Other restrictions applied in regular product string attributes, won’t be applied here

{
    "id": "vendorId",
      "name": "Vendor Id",
        "type": {
              "id": "string",
                  "restriction": {
                          "patterns": [
                                    {
          "pattern": "^.+$",
          "message": "Value must be at least one character"
        }
      ]
    },
    "isHiddenOnInitialization": "false",
    "optional": "false",
    "multiValue": "false"
  }
}

{
  "id": "vendorTags",
  "name": "Vendor Tags",
  "type": {
    "id": "string",
    "restriction": {
      "patterns": [
        {
          "pattern": "^.+$",
          "message": "Value must be at least one character"
        }
      ]
    },
    "isHiddenOnInitialization": "false",
    "optional": "true",
    "multiValue": "true"
  }
}

{
  "id": "vendorElevatedTag",
  "name": "Vendo Elevated Tag",
  "type": {
    "id": "string",
    "restriction": {
    },
    "isHiddenOnInitialization": "true",
    "optional": "true",
    "multiValue": "false"
  }
}
ClientAttribute stringAttributeWithPattern = ClientAttributesBuilder.stringAttribute("vendorId", "Vendor Id")
        .withPattern(Pattern.compile("^.+$*"), "Value must be at least one character")
        .build();
        
ClientAttribute optionalMultivalueStringAttributeWithPattern = ClientAttributesBuilder.stringAttribute("vendorTags", "Vendor Tags")
        .withPattern(Pattern.compile("^.+$*"), "Value must be at least one character")
        .withIsOptional(true)
        .withMultiValue(true)
        .build();
        
ClientAttribute optionalHiddenOnInitStringAttribute = ClientAttributesBuilder.stringAttribute("vendorId", "Vendor Id")
        .withIsOptional(true)
        .withHiddenOnInitialization(true)
        .build();

Password Type

Attribute type idType specific restriction parameters
passwordpatterns: List of patters that the value must match (Java Pattern). Values has to match all the patterns.

📘

If attribute is added to an account attributes, it won’t be visible on the list view of accounts. Password accounts remain hidden, and are only visible while adding new or editing existing accounts.

{
  "id": "password",
  "name": "Vendor Portal Password",
  "type": {
    "id": "password",
    "restriction": {
      "patterns": [
        {
          "pattern": "^.+$",
          "message": "Value must be at least one character"
        }
      ]
    },
    "isHiddenOnInitialization": false,
    "optional": false,
  }
}

{
  "id": "passwordWithPattern",
  "name": "Vendor Portal Password With Pattern",
  "type": {
    "id": "password",
    "restriction": {
      "patterns": [
        {
          "pattern": "^.+$",
          "message": "Value must be at least one character"
        }
      ]
    },
    "isHiddenOnInitialization": false,
    "optional": false,
  }
}

{
  "id": "elevatedPassword",
  "name": "Elevated Vendor Portal Password",
  "type": {
    "id": "password",
    "restriction": {
    },
    "isHiddenOnInitialization": true,
    "optional": false,
  }
}

{
  "id": "optionalPassword",
  "name": "Optional Vendor Portal Password",
  "type": {
    "id": "password",
    "restriction": {
    },
    "isHiddenOnInitialization": false,
    "optional": true,
  }
}
ClientAttribute passwordAttribute = ClientAttributesBuilder.passwordAttribute("password", "Vendor Portal Password")
        .build();
        
ClientAttribute passwordAttributeWithPattern = ClientAttributesBuilder.passwordAttribute("passwordWithPattern", "Vendor Portal Password With Pattern")
        .withPattern(Pattern.compile("^.+$*"), "Value must be at least one character")
        .build();
        
ClientAttribute passwordHiddenOnInitialization = ClientAttributesBuilder.passwordAttribute("elevatedPassword", "Elevated Vendor Portal Password")
        .withHiddenOnInitialization(true)
        .build();
        
ClientAttribute passwordHiddenOnInitialization = ClientAttributesBuilder.passwordAttribute("optionalPassword", "Optional Vendor Portal Password")
        .withIsOptional(true)
        .build();

Attribute Modifiers

Client attributes can be specified with additional modifiers (visible on the examples above)

Attribute ModifierDescriptionCorresponding builder methodApplicable Attribute Types
optionalBy default all client attributes are marked as required. If needed they can be specified as optional using this modifier.withIsOptional(boolean)string
password
multiValueBy default all client attributes are only single valued.

If an attribute should support multiple values multiValue has to be set to true
.withMultiValue(boolean)string
isHiddenOnInitializationBy default all client attributes are enabled both when adding a new account and when editing existing one.

If an attribute should be only visible when editing an existing account isHiddenOnInitialization should be set to true
.withHiddenOnInitialization(boolean)string
password