Main Image Relationship
Create a Main Image Relationship
POST
https://api.moltin.com/v2/products/:productId/relationships/main-image
Create a Product relationship to a single File, which can be used as a main_image. You can only have one main image relationship.
Path Parameters
Name | Type | Description |
---|---|---|
productId | string | The ID of the product you wish to relate to the image. |
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 the object (should be main_image). |
data[].id | string | The ID of the image. |
Update a Main Image Relationship
PUT
https://api.moltin.com/v2/products/:productId/relationships/main-image
Update the main image relationship. This will replace any currently related image.
Path Parameters
Name | Type | Description |
---|---|---|
productId | string | The ID of the product you wish to relate to the image. |
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 main_image) |
data[].id | string | The ID of the image. |
Delete a Main Image Relationship
DELETE
https://api.moltin.com/v2/products/:productId/relationships/main-image
Delete the main image relationship. This will remove the related main image.
Path Parameters
Name | Type | Description |
---|---|---|
productId | string | The ID of the product you wish to remove the relationship for. |
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 main_image). |
data[].id | string | The ID of the image. |
Last updated