Account attribute
| Attribute type id | Type specific restriction parameters |
|---|---|
| string | clientSpecificListOfValues: specifies predefined list of values for attribute. For account attribute it’s accountList. |
Account attribute is a special attribute. It will be automatically populated with the list of accounts defined for the channel.
Only one attribute can be set as an account identifier. This is the attribute that links a product to a specific account. Read more about accounts here: Accounts Authentication.This attribute should be attached to the root category so it’s always available.
Code Examples:
The accountAttribute(...) builder produces two things in the generated *.version.json: it adds the attribute to the root-level attributes array and registers it as the account entry in the root-level primaryAttributes map. That primaryAttributes.account entry is what marks the attribute as the channel's account identifier — note that it lives at the root of the datastandard version file, next to attributes (and the other root sections such as primaryCategories, unitsOfMeasure, attributeGroups and categories), not inside the attribute definition itself:
{
"versionId" : "your-company-channel_v2023-10-23T16:29:18",
"primaryAttributes" : {
"account" : "ACCOUNT"
},
"attributes" : [ {
"id" : "ACCOUNT",
"name" : "Account identifier",
"type" : {
"id" : "string",
"restriction" : {
"parameters" : {
"clientSpecificListOfValues" : "accountList"
}
}
}
} ]
}Attribute accountAttribute = AttributeBuilder
.accountAttribute("ACCOUNT", "Account identifier")
.build();Updated 8 days ago
Did this page help you?
