Parent Relationships
POST
Create Parent Category Relationship
https://api.moltin.com/v2/categories/:id/relationships/parent
Create a relationship to a parent Category. If a relationship already exists, the one from the request overwrites it.
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 used to access 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. |
204 No Content
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"
}
}'
PUT
Update Parent Category Relationship
https://api.moltin.com/v2/categories/:id/relationships/parent
Change the parent of a Category.
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 used to access 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. |
200 OK
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"
}
}'
DELETE
Delete Parent Category Relationship
https://api.moltin.com/v2/categories/:id/relationships/parent
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 used to access the API. |
200 OK
curl -X DELETE https://api.moltin.com/v2/categories/:id/relationships/parent \
-H "Authorization: Bearer XXXX"