XM

Retrieve Product Category Tree

Path:

GET https://{baseurl}/api-category/v1/category/tree?id={Category ID}

Retrieves the product category tree.

Headers

Content-Type : application/json

x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Authorization: The JWT Authorization token from the Login API.

Parameters

Type : query

Name : The ID of the category to retrieve the category tree.

Required: true

Sample Request

GET https://{baseurl}/api-category/v1/category/tree?id=60c698280567a40009a72d1f

Sample Response

Response Code: 200

Message: OK

Description: You will see this paginated response when the query parameters are page and size.

{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"attributes": [
{
"id": "60ab953d0ce58c0008bdae24",
"name": "Category Status",
"description": "",
"type": "BOOLEAN",
"value": ""
},
{
"id": "60ab952d0ce58c0008bdae21",
"name": "Category Created Date",
"description": "",
"type": "DATETIME",
"value": ""
},
{
"id": "60ab951b0ce58c0008bdae1e",
"name": "Category Id",
"description": "",
"type": "DECIMAL",
"value": ""
},
{
"id": "60ab950e0ce58c0008bdae1b",
"name": "Category Name",
"description": "",
"type": "TEXT",
"value": ""
}
],
"children": [
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"attributes": [
{
"id": "60ab953d0ce58c0008bdae24",
"name": "Category Status",
"description": "",
"type": "BOOLEAN",
"value": "true"
},
{
"id": "60ab952d0ce58c0008bdae21",
"name": "Category Created Date",
"description": "",
"type": "DATETIME",
"value": "06-13-2021"
},
{
"id": "60ab951b0ce58c0008bdae1e",
"name": "Category Id",
"description": "",
"type": "DECIMAL",
"value": "111"
},
{
"id": "60ab950e0ce58c0008bdae1b",
"name": "Category Name",
"description": "",
"type": "TEXT",
"value": "Bedding"
}
],
"children": [
{
"id": "60c698369e8ce300097bb610",
"name": "Sheets + Pillowcases",
"attributes": [],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
}
],
"children": []
},
{
"id": "60c698369e8ce300097bb60f",
"name": "Duvets + Shams",
"attributes": [],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
}
],
"children": []
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"attributes": [],
"children": [
{
"id": "60c698369e8ce300097bb60e",
"name": "sub prime",
"attributes": [],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
}
],
"children": []
}
],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
}
]
}
],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
}
]
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"attributes": [],
"children": [
{
"id": "60c6983e9e8ce300097bb639",
"name": "Task Chairs",
"attributes": [],
"children": [
{
"id": "60c6983e9e8ce300097bb63a",
"name": "Computer Chairs",
"attributes": [],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb639",
"name": "Task Chairs",
"level": 3
}
],
"children": []
}
],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"level": 2
}
]
}
],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
}
]
},
{
"id": "60c6983a9e8ce300097bb61d",
"name": "Furniture",
"attributes": [],
"children": [
{
"id": "60c6983a9e8ce300097bb621",
"name": "Bedroom",
"attributes": [],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb639",
"name": "Task Chairs",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61d",
"name": "Furniture",
"level": 3
}
],
"children": []
},
{
"id": "60c6983a9e8ce300097bb61e",
"name": "Living",
"attributes": [],
"children": [
{
"id": "60c6983a9e8ce300097bb61f",
"name": "Lounge Chair",
"attributes": [],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb639",
"name": "Task Chairs",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61d",
"name": "Furniture",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61e",
"name": "Living",
"level": 4
}
],
"children": []
},
{
"id": "60c6983a9e8ce300097bb620",
"name": "Sectional",
"attributes": [],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb639",
"name": "Task Chairs",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61d",
"name": "Furniture",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61e",
"name": "Living",
"level": 4
}
],
"children": []
},
{
"id": "60c6983a9e8ce300097bb622",
"name": "Sofas",
"attributes": [],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb639",
"name": "Task Chairs",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61d",
"name": "Furniture",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61e",
"name": "Living",
"level": 4
}
],
"children": []
}
],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb639",
"name": "Task Chairs",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61d",
"name": "Furniture",
"level": 3
}
]
},
{
"id": "60c6983a9e8ce300097bb623",
"name": "Dinning",
"attributes": [],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb639",
"name": "Task Chairs",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61d",
"name": "Furniture",
"level": 3
},
{
"id": "60c6983a9e8ce300097bb61e",
"name": "Living",
"level": 4
}
],
"children": []
}
],
"breadcrumbs": [
{
"id": "60c698280567a40009a72d1f",
"name": "New Hierarchy 6",
"level": 0
},
{
"id": "60c698369e8ce300097bb60c",
"name": "Bedding",
"level": 1
},
{
"id": "60c698369e8ce300097bb60d",
"name": "Sub",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb638",
"name": "Chairs",
"level": 2
},
{
"id": "60c6983e9e8ce300097bb639",
"name": "Task Chairs",
"level": 3
}
]
}
]
}

Error Code: 401

Message: Unauthorized

Description: You will see this error when the Authorization (JWT token from the Login APIs) is not valid.

{
"code": "INVALID_AUTHORIZATION_TOKEN",
"message": "Invalid Authorization Token"
}

Change Log

  • June - 2021 First Updated

‚Äč