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.

The Product Hierarchy Management API enables you to partially update the following types of category attribute data:
  • Terms

  • Sections

  • Requirements

  • Questions

  • Product Questionnaires

Terms

Use the PATCH /terms/{id} endpoint with the following required body parameters to partially update a term:
  • 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

Use the PATCH /sections/{id} and endpoint with the following required body parameters to partially update a section:
  • 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

Use the PATCH /requirements endpoint with the following required body parameters to partially update a requirement:
  • 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

Use the PATCH /questions/{id} endpoint with the following required body parameters to partially update a question:
  • 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

Use the PATCH /productQuestionnaires/{productQuestionnairesId} endpoint with the following required body parameters to partially update a requirement:
  • 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

Use the appropriate PATCH / endpoint to update a category attribute.

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.