Choose the right endpoint
If you are using the Product Experience Manager (EP PXM) services, use the pcm/hierarchies
endpoints instead of the v2/categories
endpoints. For details about the pcm/hierarchies
endpoints, see the topics in the EP PXM Hierarchies section.
POST
Create Parent Category Relationship
https://api.moltin.com/v2/categories/:id/relationships/parent
Create a relationship to a parent category. The new relationship in the request overwrites any existing relationship.
Parameters
Path parameters
Name Required Type Description
id
Required string
The ID of the category you want to make relationships to.
Headers
Name Required Type Description
Authorization
Required string
The Bearer token required to get access to the API.
Body
Name Required Type Description
type
Required string
The type of related object. (should be category
).
id
Required string
The ID of the parent category.
Request example
curl -X POST https://api.moltin.com/v2/categories/:id/relationships/parent \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type": "category",
"id": "8a43aea7-79f0-4bcf-9bc8-a0f5d3d3642c"
}
}'
Response Example
204 No Content
PUT
Update Parent Category Relationship
https://api.moltin.com/v2/categories/:id/relationships/parent
Change the parent of a Category.
Parameters
Path parameters
Name Required Type Description
id
Required string
The ID of the category you want to make relationships to.
Headers
Name Required Type Description
Authorization
Required string
The Bearer token required to get access to the API.
Body
Name Required Type Description
type
Required string
The type of related object. (should be category
).
id
Required string
The ID of the parent category.
Request example
curl -X PUT https://api.moltin.com/v2/categories/:id/relationships/parent \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type": "category",
"id": "8a43aea7-79f0-4bcf-9bc8-a0f5d3d3642c"
}
}'
Response example
200 OK
DELETE
Delete Parent Category Relationship
https://api.moltin.com/v2/categories/:id/relationships/parent
Parameters
Path parameters
Name Required Type Description
id
Required string
The ID of the parent category you with to delete the relationship to.
Headers
Name Required Type Description
Authorization
Required string
The Bearer token required to get access to the API.
Request example
curl -X DELETE https://api.moltin.com/v2/categories/:id/relationships/parent \
-H "Authorization: Bearer XXXX"
Response example
200 OK
Last updated on 10/12/2022