# Mutations / Classifications

# Classifications

**Mutation**
## addOrderNoteToFamily — Returns *Boolean*

**Scopes required:** edit_products

This allows you to quickly apply an order note to all products within a family. This is a once-off action and will not automatically apply the order note in the future.

| Arguments | Type | Description |
| --- | --- | --- |
| family | [ID!](/documentation/Types/UUID#UUID) | The family to apply the order note to |
| orderNote | *String* | The order note to apply |
| invoiceNote | *String* | The invoice note to apply |

**Example Mutation**

```graphql
mutation AddOrderNoteToFamily($family: ID!) {
    addOrderNoteToFamily(family: $family)
}

# Example variables
{
    "family": "<FAMILY>"
}
```

**Mutation**
## addTagToCategory — Returns *Boolean*

**Scopes required:** edit_products

This allows you to quickly apply a single tag to all products within a category. This is a once-off action and will not automatically apply the tag in the future.

| Arguments | Type | Description |
| --- | --- | --- |
| category | [ID!](/documentation/Types/UUID#UUID) | The category to apply the tag to |
| tag | [ID!](/documentation/Types/UUID#UUID) | The tag to apply |

**Example Mutation**

```graphql
mutation AddTagToCategory($category: ID!, $tag: ID!) {
    addTagToCategory(category: $category, tag: $tag)
}

# Example variables
{
    "category": "<CATEGORY>",
    "tag": "<TAG>"
}
```

**Mutation**
## assignBrand — Returns [Brand](/documentation/Objects/Classifications#Brand)

**Scopes required:** edit_products

Assign a brand to a list of products

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the brand to apply to the provided products |
| products | [[ID]](/documentation/Types/UUID#UUID) | The products to replace the brand |

**Example Mutation**

```graphql
mutation AssignBrand($id: ID!) {
    assignBrand(id: $id) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## assignCategory — Returns [Category](/documentation/Objects/Classifications#Category)

**Scopes required:** edit_products

Assign a category to a list of products

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the category to apply to the provided products |
| products | [[ID]](/documentation/Types/UUID#UUID) | The products to replace the category |

**Example Mutation**

```graphql
mutation AssignCategory($id: ID!) {
    assignCategory(id: $id) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## assignFamily — Returns [Family](/documentation/Objects/Classifications#Family)

**Scopes required:** edit_products

Assign a family to a list of products, this will price align to the first product

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the family to apply to the provided products |
| products | [[ID]](/documentation/Types/UUID#UUID) | The products to replace the family |

**Example Mutation**

```graphql
mutation AssignFamily($id: ID!) {
    assignFamily(id: $id) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## assignTag — Returns [Tag](/documentation/Objects/Classifications#Tag)

**Scopes required:** edit_products

Assign a tag to a list of products

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the tag to apply to the provided products |
| products | [[ID]](/documentation/Types/UUID#UUID) | The products to replace the tag |
| action | [AssignTagActionEnum](/documentation/Enums/Assign-Tag-Action-Enum#AssignTagActionEnum) | How the products should be assigned to the tag, defaults to `REPLACE` |

**Example Mutation**

```graphql
mutation AssignTag($id: ID!) {
    assignTag(id: $id) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## createBrand — Returns [Brand](/documentation/Objects/Classifications#Brand)

**Scopes required:** create_classifications

Create a brand

| Arguments | Type | Description |
| --- | --- | --- |
| name | *String!* | The name of the brand to create |
| mdbId | *Int* | The ID that corresponds to this brand from the master database, this can be safely ignored |

**Example Mutation**

```graphql
mutation CreateBrand($name: String!) {
    createBrand(name: $name) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "name": "<NAME>"
}
```

**Mutation**
## createCategory — Returns [Category](/documentation/Objects/Classifications#Category)

**Scopes required:** create_classifications

Create a category

| Arguments | Type | Description |
| --- | --- | --- |
| name | *String!* | The name of the category to create |
| mdbId | *Int* | The ID that corresponds to this category from the master database, this can be safely ignored |
| metcashMSC | *String* | The Metcash classification for this category |

**Example Mutation**

```graphql
mutation CreateCategory($name: String!) {
    createCategory(name: $name) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "name": "<NAME>"
}
```

**Mutation**
## createFamily — Returns [Family](/documentation/Objects/Classifications#Family)

**Scopes required:** create_classifications

Create a family

| Arguments | Type | Description |
| --- | --- | --- |
| name | *String!* | The name of the family to create |
| mdbId | *Int* | The ID that corresponds to this family from the master database, this can be safely ignored |

**Example Mutation**

```graphql
mutation CreateFamily($name: String!) {
    createFamily(name: $name) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "name": "<NAME>"
}
```

**Mutation**
## createTag — Returns [Tag](/documentation/Objects/Classifications#Tag)

**Scopes required:** create_classifications

Create a tag

| Arguments | Type | Description |
| --- | --- | --- |
| name | *String!* | The name of the tag to create |
| mdbId | *Int* | The ID that corresponds to this tag from the master database, this can be safely ignored |

**Example Mutation**

```graphql
mutation CreateTag($name: String!) {
    createTag(name: $name) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "name": "<NAME>"
}
```

**Mutation**
## deleteBrand — Returns [Brand](/documentation/Objects/Classifications#Brand)

**Scopes required:** delete_classifications

Delete a brand, this won't remove any products

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the brand to delete |

**Example Mutation**

```graphql
mutation DeleteBrand($id: ID!) {
    deleteBrand(id: $id) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## deleteCategory — Returns [Category](/documentation/Objects/Classifications#Category)

**Scopes required:** delete_classifications

Delete a category, this won't remove any products

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the category to delete |

**Example Mutation**

```graphql
mutation DeleteCategory($id: ID!) {
    deleteCategory(id: $id) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## deleteFamily — Returns [Family](/documentation/Objects/Classifications#Family)

**Scopes required:** delete_classifications

Delete a family, this won't remove any products

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the family to delete |

**Example Mutation**

```graphql
mutation DeleteFamily($id: ID!) {
    deleteFamily(id: $id) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## deleteTag — Returns [Tag](/documentation/Objects/Classifications#Tag)

**Scopes required:** delete_classifications

Delete a tag, this won't remove any products

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the tag to delete |

**Example Mutation**

```graphql
mutation DeleteTag($id: ID!) {
    deleteTag(id: $id) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## updateBrand — Returns [Brand](/documentation/Objects/Classifications#Brand)

**Scopes required:** edit_classifications

Update the name and master database id of a brand

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the brand to update |
| name | *String!* | The updated name of the brand |
| mdbId | *Int* | The ID that corresponds to the master database reference of this brand, can be safely ignored |

**Example Mutation**

```graphql
mutation UpdateBrand($id: ID!, $name: String!) {
    updateBrand(id: $id, name: $name) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>",
    "name": "<NAME>"
}
```

**Mutation**
## updateCategory — Returns [Category](/documentation/Objects/Classifications#Category)

**Scopes required:** edit_classifications

Update the name and master database id of a category

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the category to update |
| name | *String!* | The updated name of the category |
| mdbId | *Int* | The ID that corresponds to the master database reference of this category, can be safely ignored |
| metcashMSC | *String* | The Metcash classification for this category |

**Example Mutation**

```graphql
mutation UpdateCategory($id: ID!, $name: String!) {
    updateCategory(id: $id, name: $name) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>",
    "name": "<NAME>"
}
```

**Mutation**
## updateFamily — Returns [Family](/documentation/Objects/Classifications#Family)

**Scopes required:** edit_classifications

Update the name and master database id of a family

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the family to update |
| name | *String!* | The updated name of the family |
| mdbId | *Int* | The ID that corresponds to the master database reference of this family, can be safely ignored |

**Example Mutation**

```graphql
mutation UpdateFamily($id: ID!, $name: String!) {
    updateFamily(id: $id, name: $name) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>",
    "name": "<NAME>"
}
```

**Mutation**
## updateTag — Returns [Tag](/documentation/Objects/Classifications#Tag)

**Scopes required:** edit_classifications

Update the name and master database id of a tag

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the tag to update |
| name | *String!* | The updated name of the tag |
| mdbId | *Int* | The ID that corresponds to the master database reference of this tag, can be safely ignored |
| ticketTemplates | [[ID!]](/documentation/Types/UUID#UUID) | The ticket templates that are used by products with this tag |

**Example Mutation**

```graphql
mutation UpdateTag($id: ID!, $name: String!) {
    updateTag(id: $id, name: $name) {
        id,
        name,
        parent,
        deleted,
        mdbId
    }
}

# Example variables
{
    "id": "<ID>",
    "name": "<NAME>"
}
```