Parent Relationships

Create Parent Category Relationship

POST 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 will overwrite it.

Path Parameters

NameTypeDescription

id

string

The ID of the category you wish to make relationships to

Headers

NameTypeDescription

Authorization

string

The Bearer token used to access the API.

Request Body

NameTypeDescription

type

string

The type of related object. (should be category)

id

string

The ID of the parent category

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"
      }
    }'

Update Parent Category Relationship

PUT https://api.moltin.com/v2/categories/:id/relationships/parent

Change the parent of a Category.

Path Parameters

NameTypeDescription

id

string

The ID of the category you wish to make relationships to

Headers

NameTypeDescription

Authorization

string

The Bearer token used to access the API

Request Body

NameTypeDescription

type

string

The type of related object. (should be category)

id

string

The ID of the parent category

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 Parent Category Relationship

DELETE https://api.moltin.com/v2/categories/:id/relationships/parent

Path Parameters

NameTypeDescription

id

string

The ID of the parent category you with to delete the relationship to

Headers

NameTypeDescription

Authorization

string

The Bearer token used to access the API

curl -X DELETE https://api.moltin.com/v2/categories/:id/relationships/parent \
     -H "Authorization: Bearer XXXX"

Last updated