Category Relationship
Create Category Relationship(s)
POST
https://api.moltin.com/v2/products/:productId/relationships/categories
Create a Product relationship to on or more Categories. If any relationships already exist, the one's made in the request will be added to them.
Path Parameters
Name | Type | Description |
---|---|---|
productId | string | The ID of the product you wish to relate to the category(s). |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer used to access the API. |
Request Body
Name | Type | Description |
---|---|---|
data[].type | string | Represents the type of object (should be category). |
data[].id | string | The ID of the category. |
Update Category Relationship(s)
PUT
https://api.moltin.com/v2/products/:productId/relationships/categories
Replace the relationships between a Product and a Category. Unlike a POST to this endpoint a PUT overrides any existing relationships.
Path Parameters
Name | Type | Description |
---|---|---|
productId | string | The ID of the product you wish to relate to the category(s). |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer used to access the API. |
Request Body
Name | Type | Description |
---|---|---|
data[].type | string | Represents the type of objects (should be category). |
data[].id | string | The ID of the category. |
Delete Category Relationship(s)
DELETE
https://api.moltin.com/v2/products/:productId/relationships/categories
Removing a relationships between a Product and Category(s) deletes the relationships specified in the payload.
Path Parameters
Name | Type | Description |
---|---|---|
productId | string | The ID of the product you wish to delete. |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | The Bearer token used to access the API. |
Request Body
Name | Type | Description |
---|---|---|
data[].type | string | Represents the type of object (should be category). |
data[].id | string | The ID of the category. |
Last updated