Partially Updating Product Attributes Using the Product Hierarchy Management API
You can use the Product Hierarchy Management API to partially update question, section, product questionnaire, requirement, and term objects.
Context
You can use the PATCH / endpoint in the Product Hierarchy Management API to partially update question, section, product questionnaire, requirement, and term category attributes. The PATCH / endpoint enables you to update specific attributes without needing to resend all of the category attribute data.
-
Terms
-
Sections
-
Requirements
-
Questions
-
Product Questionnaires
Terms
-
realm: The name of your realm.
-
id: term ID.
-
body: Term request body.
Use the following data model for the request body:
{
"nameDefinition": [
{
"locale": "AR",
"label": "What is color?",
"formattedLabel": "What is color?"
}
],
"conditionId": "1CON1001",
"sectionId": "1SEC1001",
"autoAddTrigger": "NEVER",
"ruleId": "1RULE1001",
"refDocId": "1DOC1001",
"order": 55,
"answer": {
"type": "CHARACTER",
"acceptableValue": "MULTI_SELECT",
"choices": [
"orange",
"mango",
"papaya",
],
"initialValue": [
"mango",
"orange"
]
},
"responseRequired": "NOT_REQUIRED",
"visibilityType": "YES_VISIBLE_ALWAYS",
"externalFieldMapping": "string",
"externalFieldMappingForPIR": [
{
"fieldName": "string",
"setDefault": true
}
],
"pricingCondition": true,
"termEditMode": "NOT_EDITABLE",
"columDisplayMode": true,
"readOnly": true,
"historicValue": "YES",
"reserveValue": "REQUIRED",
"costType": "ADDER",
"rollUpSummary": false,
"rankBidMode": "LOWER_BID"
}
Sections
-
realm: The name of your realm.
-
id: section ID.
-
body: Section request body.
Use the following data model for the request body:
{
"nameDefinition": [
{
"locale": "AR",
"label": "What is color?",
"formattedLabel": "What is color?"
}
],
"conditionId": "1CON1001",
"order": 0
}
Requirements
-
realm: The name of your realm.
-
id: requirement ID.
-
body: Requirement request body.
Use the following data model for the request body:
{
"nameDefinition": [
{
"locale": "AR",
"label": "What is color?",
"formattedLabel": "What is color?"
}
],
"conditionId": "1CON1001",
"sectionId": "1SEC1001",
"autoAddTrigger": "NEVER",
"ruleId": "1RULE1001",
"refDocId": "1DOC1001",
"order": 0
}
Questions
-
realm: The name of your realm.
-
id: question ID.
-
body: Question request body.
Use the following data model for the request body:
{
"nameDefinition": [
{
"locale": "AR",
"label": "What is color?",
"formattedLabel": "What is color?"
}
],
"conditionId": "1CON1001",
"sectionId": "1SEC1001",
"autoAddTrigger": "NEVER",
"ruleId": "1RULE1001",
"refDocId": "1DOC1001",
"order": -1,
"answer": {
"type": "CHARACTER",
"acceptableValue": "MULTI_SELECT",
"choices": [
"orange",
"mango",
"papaya",
"orange"
],
"initialValue": [
"mango",
"orange"
]
},
"documentProperty": "string",
"contractTerm": true,
"responseRequired": "NOT_REQUIRED",
"visibilityType": "YES_VISIBLE_ALWAYS",
"prerequisite": "NOT_PREREQUISITE_QUESTION",
"externalFieldMapping": "string",
"externalFieldMappingForPIR": [
{
"fieldName": "string",
"setDefault": true
}
]
}
Product Questionnaires
-
productQuestionnaireId: product questionnaire ID.
-
ProductQuestionnaireRequestObject: create the product questionnaire request body.
-
realm: the name of your realm.
Use the following data model for the request body:
{
"name": "Product_Questionnaire",
"externalSystemName": "SAP",
"orderedQuestionIds": [
"1QUE22001",
"1QUE22002"
]
}
Procedure
The Product Hierarchy Management API updates the category attribute.
To troubleshoot your queries to the Product Hierarchy Management API, refer to Error Messages Returned by the Product Hierarchy Management API.