The CreatorCon Call for Content is officially open! Get started here.

Update data using Product Catalog Open API

RavinderK
Tera Contributor

Hello All,

I am facing issue while trying to break link or update Product Categories link using Product Catalog Open API.

Let's take an example, I have created below Product Category Hierarchy or linkage with LCat1,2,3,4 as Leaf nodes.  

 

PCATL1
      PCATL1.1
             -LCat1
             -LCat2
       PCATL1.2
             -LCat3
             -LCat4
 
Now I need to break linkage and remove LCat4 from PCATL1.2 but I don't see any option to do this using out of the box Product Catalog API. I see only "Create Product Offering Category"  post API that always creates new  Category instead of updating PCATL1.2 and remove subCategory -LCat4 from Parent Catogery PCATL1.2.
 
Please advice how to achieve this using OOB Product Catalog API's. Below Sample JSON.
 

--Step1 Create Leaf Categories
{
"id": "a90c20c483ac7a10eadbf7efeeaad375",
"name": "LCat1",
"description": "01-LCat1",
"isLeaf": true,
"subCategory": [],
"lifecycleStatus": "Active",
"validFor": {
"startDateTime": "2025-09-11",
"endDateTime": ""
}
}

{
"id": "6b9c20c483ac7a10eadbf7efeeaad379",
"name": "LCat2",
"description": "02-LCat2",
"isLeaf": true,
"subCategory": [],
"lifecycleStatus": "Active",
"validFor": {
"startDateTime": "2025-09-11",
"endDateTime": ""
}
}

{
"id": "ab6e6c848320ba10eadbf7efeeaad3f3",
"name": "LCat3",
"description": "03-LCat3",
"isLeaf": true,
"subCategory": [],
"lifecycleStatus": "Active",
"validFor": {
"startDateTime": "2025-09-11",
"endDateTime": ""
}
}

{
"id": "e38e6c848320ba10eadbf7efeeaad3f6",
"name": "LCat4",
"description": "04-LCat4",
"isLeaf": true,
"subCategory": [],
"lifecycleStatus": "Active",
"validFor": {
"startDateTime": "2025-09-11",
"endDateTime": ""
}
}


--Step2 Link Leaf nodes with 2 Parent Categories.

{
"id": "08a07c848320ba10eadbf7efeeaad3fa",
"name": "PCATL2.1",
"description": "PCATL2.1",
"isLeaf": false,
"subCategory": [
{
"id": "a90c20c483ac7a10eadbf7efeeaad375",
"name": "LCat1"
},
{
"id": "6b9c20c483ac7a10eadbf7efeeaad379",
"name": "LCat2"
}
],
"lifecycleStatus": "Active",
"validFor": {
"startDateTime": "2025-09-11",
"endDateTime": ""
}
}


{
"id": "a331784c8320ba10eadbf7efeeaad3c6",
"name": "PCATL2.2",
"description": "PCATL2.2",
"isLeaf": false,
"subCategory": [
{
"id": "ab6e6c848320ba10eadbf7efeeaad3f3",
"name": "LCat3"
},
{
"id": "e38e6c848320ba10eadbf7efeeaad3f6",
"name": "LCat4"
}
],
"lifecycleStatus": "Active",
"validFor": {
"startDateTime": "2025-09-11",
"endDateTime": ""
}
}

--Step3--> Break link and remove LCat4 from Parent Category "PCATL2.2" and have only "LCat3" as it's child but with below POST call new Category
is being created with "LCat3". Now "LCat3" is linked to 2 Parent Categories instead of having only one ParentCategory PCATL2.2 with only one chaild
"LCat3". Also there is no Patch option on Product Category to update Category.

{
"id": "a331784c8320ba10eadbf7efeeaad3c6",
"name": "PCATL2.2",
"description": "PCATL2.2",
"code": "PCATL2.21",
"isLeaf": false,
"subCategory": [
{
"id": "ab6e6c848320ba10eadbf7efeeaad3f3",
"name": "LCat3"
}
],
"lifecycleStatus": "Active",
"validFor": {
"startDateTime": "2025-09-11",
"endDateTime": ""
}
}

 

Thanks

0 REPLIES 0