Child Relationships

post
Create Child Category Relationships

https://api.moltin.com/v2/categories/:categoryId/relationships/children
Create a relationship to a parent Category. If any relationship(s) already exists, new ones will be added.
Request
Response
Path Parameters
categoryId
required
string
The ID of the category you wish to make relationships to
Headers
Authorization
required
string
The Bearer token used to access the API
Body Parameters
type
required
string
The type of related object (should be be category)
id
required
string
The ID of the parent category
201: Created
cURL
curl -X POST https://api.moltin.com/v2/categories/:categoryId/relationships/children \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": [
{
"type": "category",
"id": "8a43aea7-79f0-4bcf-9bc8-a0f5d3d3642c"
}
]
}'

put
Update Child Category Relationship

https://api.moltin.com/v2/categories/:categoryId/relationships/children
Request
Response
Path Parameters
categoryId
required
string
The ID of the category you wish to make relationships to
Body Parameters
type
required
string
The type of related object (should be category)
id
required
string
The ID of the parent category
200: OK
cURL
curl -X PUT https://api.moltin.com/v2/categories/:categoryId/relationships/children \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": [
{
"type": "category",
"id": "c902aea9-ec90-4fdd-8084-3c2d879a2c52"
}
]
}'

delete
Delete Child Category Relationship

https://api.moltin.com/v2/categories/:categoryId/relationships/parent
Request
Response
Path Parameters
categoryId
required
string
The ID of the category you wish to update relationships to.
Body Parameters
data
required
object
data[].type
required
string
The type of related object. (should be category)
data[].id
required
string
The ID of the child category
200: OK
cURL
curl -X DELETE https://api.moltin.com/v2/categories/:categoryId/relationships/parent \
-H "Authorization: Bearer XXXX" \
-d $'{
"data": [{
"type": "category",
"id": "c902aea9-ec90-4fdd-8084-3c2d879a2c52"
}]
}'