Child Relationships

post
Create Child Collection Relationships

https://api.moltin.com/v2/collections/:collectionId/relationships/children
Create a relationship to a parent Collection. If any relationship(s) already exists, new ones will be added.
Request
Response
Path Parameters
collectionId
required
string
The ID of the collection 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 collection)
id
required
string
The ID of the parent collection
200: OK
cURL
curl -X "POST" https://api.moltin.com/v2/collections/:collectionId/relationships/children \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": [
{
"type": "collection",
"id": "8a43aea7-79f0-4bcf-9bc8-a0f5d3d3642c"
}
]
}'

put
Update Child Collection Relationship

https://api.moltin.com/v2/collections/:collectionId/relationships/children
Request
Response
Path Parameters
collectionId
required
string
The ID of the collection 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 collection)
id
required
string
The ID of the parent collection
200: OK
cURL
curl -X PUT https://api.moltin.com/v2/collections/:collectionId/relationships/children \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": [
{
"type": "collection",
"id": "c902aea9-ec90-4fdd-8084-3c2d879a2c52"
}
]
}'

delete
Delete Child Collection Relationship

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