# Mutations / Shelf Tickets

# Shelf Tickets

**Mutation**
## addShelfTickets — Returns [[ShelfTicket]](/documentation/Objects/Shelf-Tickets#ShelfTicket)

**Scopes required:** see_shelf_tickets

| Arguments | Type | Description |
| --- | --- | --- |
| products | [[ID!]!](/documentation/Types/UUID#UUID) | The products to add to shelf tickets, this may contain duplicate values |
| outlet | [ID](/documentation/Types/UUID#UUID) | The outlet to assign the shelf tickets to, if not specified it will add a ticket to all outlets |

**Example Mutation**

```graphql
mutation AddShelfTickets($products: [ID!]!) {
    addShelfTickets(products: $products) {
        id,
        createdAt
    }
}

# Example variables
{
    "products": [
        "<PRODUCTS>"
    ]
}
```

**Mutation**
## addTicketQueue — Returns [[Ticket]](/documentation/Objects/Shelf-Tickets#Ticket)

**Scopes required:** see_shelf_tickets

| Arguments | Type | Description |
| --- | --- | --- |
| products | [[ID!]](/documentation/Types/UUID#UUID) | The products to add to ticket queue, this may contain duplicate values |
| promotions | [[ID!]](/documentation/Types/UUID#UUID) | The promotions to add to the ticket queue, this may contain duplicate values |
| families | [[ID!]](/documentation/Types/UUID#UUID) | The families to add to the ticket queue, this may contain duplicate values |
| outlets | [[ID!]](/documentation/Types/UUID#UUID) | The outlets to assign the tickets to, if not specified it will add a ticket to all outlets |

**Example Mutation**

```graphql
mutation AddTicketQueue($products: [ID!]) {
    addTicketQueue(products: $products) {
        id,
        queuedAt
    }
}

# Example variables
{
    "products": [
        "<PRODUCTS>"
    ]
}
```

**Mutation**
## createTicketTemplate — Returns [TicketTemplate](/documentation/Objects/Shelf-Tickets#TicketTemplate)

**Scopes required:** modify_ticket_templates

| Arguments | Type | Description |
| --- | --- | --- |
| name | *String!* | The name of the ticket template |
| styles | *String!* | The styles to apply to the ticket template (in CSS) |
| transformationScript | *String!* | The transformation script to use (in JavaScript) |
| width | *Float!* | The width of the template panel on a page (in millimeters) |
| height | *Float!* | The height of the template panel on a page (in millimeters) |
| fonts | [[URL!]](/documentation/Types/Url#Url) | The fonts used by the ticket template |
| fieldsTracked | *[String!]* | The fields tracked by the ticket template |

**Example Mutation**

```graphql
mutation CreateTicketTemplate($name: String!, $styles: String!, $transformationScript: String!, $width: Float!, $height: Float!) {
    createTicketTemplate(name: $name, styles: $styles, transformationScript: $transformationScript, width: $width, height: $height) {
        id,
        name,
        styles,
        transformationScript,
        width
    }
}

# Example variables
{
    "name": "<NAME>",
    "styles": "<STYLES>",
    "transformationScript": "<TRANSFORMATION_SCRIPT>",
    "width": "<WIDTH>",
    "height": "<HEIGHT>"
}
```

**Mutation**
## createTicketTemplatePage — Returns [TicketTemplatePage](/documentation/Objects/Shelf-Tickets#TicketTemplatePage)

**Scopes required:** modify_ticket_templates

| Arguments | Type | Description |
| --- | --- | --- |
| name | *String!* | The name of the ticket template |
| horizontalPanels | *Int!* | The number of ticket template panels horizontally |
| verticalPanels | *Int!* | The number of ticket template panels vertically |
| pageWidth | *Float!* | The width of the page (in millimeters) |
| pageHeight | *Float!* | The height of the template panel on a page (in millimeters) |
| pageMargin | *String!* | The margin of the page (formatted as a CSS margin) |
| horizontalPanelSpacing | *Float!* | The spacing between the panels horizontally (in millimeters) |
| verticalPanelSpacing | *Float!* | The spacing between the panels vertically (in millimeters) |
| cuttingWidth | *Float!* | The width of the cutting line to display (in millimeters), this will be overlaid on the tickets |

**Example Mutation**

```graphql
mutation CreateTicketTemplatePage($name: String!, $horizontalPanels: Int!, $verticalPanels: Int!, $pageWidth: Float!, $pageHeight: Float!, $pageMargin: String!, $horizontalPanelSpacing: Float!, $verticalPanelSpacing: Float!, $cuttingWidth: Float!) {
    createTicketTemplatePage(name: $name, horizontalPanels: $horizontalPanels, verticalPanels: $verticalPanels, pageWidth: $pageWidth, pageHeight: $pageHeight, pageMargin: $pageMargin, horizontalPanelSpacing: $horizontalPanelSpacing, verticalPanelSpacing: $verticalPanelSpacing, cuttingWidth: $cuttingWidth) {
        id,
        name,
        horizontalPanels,
        verticalPanels,
        pageWidth
    }
}

# Example variables
{
    "name": "<NAME>",
    "horizontalPanels": "<HORIZONTAL_PANELS>",
    "verticalPanels": "<VERTICAL_PANELS>",
    "pageWidth": "<PAGE_WIDTH>",
    "pageHeight": "<PAGE_HEIGHT>",
    "pageMargin": "<PAGE_MARGIN>",
    "horizontalPanelSpacing": "<HORIZONTAL_PANEL_SPACING>",
    "verticalPanelSpacing": "<VERTICAL_PANEL_SPACING>",
    "cuttingWidth": "<CUTTING_WIDTH>"
}
```

**Mutation**
## deleteShelfTickets — Returns *boolean*

**Scopes required:** see_shelf_tickets

| Arguments | Type | Description |
| --- | --- | --- |
| tickets | [[ID!]!](/documentation/Types/UUID#UUID) | The tickets to delete |

**Example Mutation**

```graphql
mutation DeleteShelfTickets($tickets: [ID!]!) {
    deleteShelfTickets(tickets: $tickets)
}

# Example variables
{
    "tickets": [
        "<TICKETS>"
    ]
}
```

**Mutation**
## deleteTicketTemplate — Returns *boolean*

**Scopes required:** modify_ticket_templates

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

**Example Mutation**

```graphql
mutation DeleteTicketTemplate($id: ID!) {
    deleteTicketTemplate(id: $id)
}

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

**Mutation**
## deleteTicketTemplatePage — Returns *boolean*

**Scopes required:** modify_ticket_templates

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

**Example Mutation**

```graphql
mutation DeleteTicketTemplatePage($id: ID!) {
    deleteTicketTemplatePage(id: $id)
}

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

**Mutation**
## mapTicketTemplate — Returns [TicketTemplate](/documentation/Objects/Shelf-Tickets#TicketTemplate)

**Scopes required:** modify_ticket_templates

| Arguments | Type | Description |
| --- | --- | --- |
| id | *Int!* | The ID of the ticket template to map from the master database |
| options | [JSON!](/documentation/Types/JSON#JSON) | The options this ticket template should use, this is provided in the format `option` => `boolean` |

**Example Mutation**

```graphql
mutation MapTicketTemplate($id: Int!, $options: JSON!) {
    mapTicketTemplate(id: $id, options: $options) {
        id,
        name,
        styles,
        transformationScript,
        width
    }
}

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

**Mutation**
## mapTicketTemplatePage — Returns [TicketTemplatePage](/documentation/Objects/Shelf-Tickets#TicketTemplatePage)

**Scopes required:** modify_ticket_templates

| Arguments | Type | Description |
| --- | --- | --- |
| id | *Int!* | The ID of the ticket template page to map from the master database |

**Example Mutation**

```graphql
mutation MapTicketTemplatePage($id: Int!) {
    mapTicketTemplatePage(id: $id) {
        id,
        name,
        horizontalPanels,
        verticalPanels,
        pageWidth
    }
}

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

**Mutation**
## markTicketsAsPrinted — Returns *boolean*

**Scopes required:** see_shelf_tickets

| Arguments | Type | Description |
| --- | --- | --- |
| tickets | [[ID!]!](/documentation/Types/UUID#UUID) | The tickets to mark as printed |

**Example Mutation**

```graphql
mutation MarkTicketsAsPrinted($tickets: [ID!]!) {
    markTicketsAsPrinted(tickets: $tickets)
}

# Example variables
{
    "tickets": [
        "<TICKETS>"
    ]
}
```

**Mutation**
## updateMappedTicketTemplate — Returns [TicketTemplate](/documentation/Objects/Shelf-Tickets#TicketTemplate)

**Scopes required:** modify_ticket_templates

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the mapped ticket template to update |
| options | [JSON!](/documentation/Types/JSON#JSON) | The options this ticket template should use, this is provided in the format `option` => `boolean` |

**Example Mutation**

```graphql
mutation UpdateMappedTicketTemplate($id: ID!, $options: JSON!) {
    updateMappedTicketTemplate(id: $id, options: $options) {
        id,
        name,
        styles,
        transformationScript,
        width
    }
}

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

**Mutation**
## updateTicketTemplate — Returns [TicketTemplate](/documentation/Objects/Shelf-Tickets#TicketTemplate)

**Scopes required:** modify_ticket_templates

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the ticket template to update |
| name | *String* | The name of the ticket template |
| styles | *String* | The styles to apply to the ticket template (in CSS) |
| transformationScript | *String* | The transformation script to use (in JavaScript) |
| width | *Float* | The width of the template panel on a page (in millimeters) |
| height | *Float* | The height of the template panel on a page (in millimeters) |
| fonts | [[URL!]](/documentation/Types/Url#Url) | The fonts used by the template |
| fieldsTracked | *[String!]* | The fields tracked by the template |

**Example Mutation**

```graphql
mutation UpdateTicketTemplate($id: ID!) {
    updateTicketTemplate(id: $id) {
        id,
        name,
        styles,
        transformationScript,
        width
    }
}

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

**Mutation**
## updateTicketTemplatePage — Returns [TicketTemplatePage](/documentation/Objects/Shelf-Tickets#TicketTemplatePage)

**Scopes required:** modify_ticket_templates

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the ticket template page to update |
| name | *String* | The name of the ticket template |
| horizontalPanels | *Int* | The number of ticket template panels horizontally |
| verticalPanels | *Int* | The number of ticket template panels vertically |
| pageWidth | *Float* | The width of the page (in millimeters) |
| pageHeight | *Float* | The height of the template panel on a page (in millimeters) |
| pageMargin | *String* | The margin of the page (formatted as a CSS margin, only supports millimeters as units) |
| horizontalPanelSpacing | *Float* | The spacing between the panels horizontally (in millimeters) |
| verticalPanelSpacing | *Float* | The spacing between the panels vertically (in millimeters) |
| cuttingWidth | *Float* | The width of the cutting line to display (in millimeters), this will be overlaid on the tickets |

**Example Mutation**

```graphql
mutation UpdateTicketTemplatePage($id: ID!) {
    updateTicketTemplatePage(id: $id) {
        id,
        name,
        horizontalPanels,
        verticalPanels,
        pageWidth
    }
}

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