Brand Relationship

Create Brand Relationship(s)

POST https://api.moltin.com/v2/products/:productId/relationships/brands

Create a Product relationship to one or more Brand. If any relationships already exist, the one's made in the request will be added to them.

Path Parameters

NameTypeDescription

productId

string

The ID of the product you wish to relate to the brand(s)

Headers

NameTypeDescription

Authorization

string

The Bearer used to access the API

Request Body

NameTypeDescription

data[].type

string

Represents the type of object (should be brand)

data[].id

string

The ID of the brand

{
  "data": [
    {
      "type": "brand",
      "id": "d1e04526-7870-469c-a940-8f3033893084"
    }
  ]
}
curl -X "PUT" https://api.moltin.com/v2/products/:productID/relationships/brands \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
      "data": [
        {
          "type": "brand",
          "id": "8a43aea7-79f0-4bcf-9bc8-a0f5d3d3642c"
        }
      ]
    }'

Update Brand Relationship(s)

PUT https://api.moltin.com/v2/products/:productId/relationships/brands

Replace the relationships between a Product and a Brand. Unlike a POST to this endpoint, a PUT overrides any existing relationships.

Path Parameters

NameTypeDescription

productId

string

The ID of the product you wish to relate to the brand(s).

Headers

NameTypeDescription

Authorization

string

The Bearer token used to access the API.

Request Body

NameTypeDescription

data[].type

string

Represents the type of object (should be brand)

data[].id

string

The ID of the brand

{
  "data": [
      {
        "type": "brand",
        "id": "0af10e37-066a-47a9-ad14-cc17eb31eed4"
      }
    ]
}
curl -X "PUT" https://api.moltin.com/v2/products/:productId/relationships/brands \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
      "data": [
        {
          "type": "brand",
          "id": "8a43aea7-79f0-4bcf-9bc8-a0f5d3d3642c"
        }
      ]
    }'

Delete Brand Relationship(s)

DELETE https://api.moltin.com/v2/products/:productId/relationships/brands

Remove a relationship between a Product and Brand(s). This deletes the relationships specified in the payload.

Path Parameters

NameTypeDescription

productId

string

The iID of the product you wish to relate to the brand.

Headers

NameTypeDescription

Authorization

string

The Bearer token used to access the API.

Request Body

NameTypeDescription

data[].type

string

Represents the type of object (should be brand).

data[].id

string

The ID of the brand.

curl -X "DELETE" https://api.moltin.com/v2/products/:productId/relationships/brands \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
      "data": [
        {
          "type": "brand",
          "id": "8a43aea7-79f0-4bcf-9bc8-a0f5d3d3642c"
        }
      ]
    }'

Last updated