# Mutations / Receipts

# Receipts

**Mutation**
## cloneReceipt — Returns [Receipt](/documentation/Objects/Receipts#Receipt)

**Scopes required:** modify_receipts

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the Receipt to clone |
| name | *String!* | The name of the newly cloned Receipt |

**Example Mutation**

```graphql
mutation CloneReceipt($id: ID!, $name: String!) {
    cloneReceipt(id: $id, name: $name) {
        id,
        name,
        type,
        components,
        receiptWidth
    }
}

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

**Mutation**
## createReceipt — Returns [Receipt](/documentation/Objects/Receipts#Receipt)

**Scopes required:** modify_receipts

| Arguments | Type | Description |
| --- | --- | --- |
| name | *String!* | The name of the receipt |
| type | [ReceiptTypeEnum!](/documentation/Enums/Receipt-Type-Enum#ReceiptTypeEnum) | The type of receipt this is |
| width | *Int* | The width of the receipt (currently only valid for TEXT_ONLY receipts) |
| account | *Boolean* | Whether this is an account receipt (true) or a normal sale receipt (false) |
| empty | *Boolean* | Whether the new receipt should contain the default template or be empty (defaults to true) |
| attachments | [[ReceiptAttachmentInput!]](/documentation/Inputs/Receipts#ReceiptAttachmentInput) | The receipts to attach when sent via email, this is only valid when `type` is `EMAIL` |

**Example Mutation**

```graphql
mutation CreateReceipt($name: String!, $type: ReceiptTypeEnum!) {
    createReceipt(name: $name, type: $type) {
        id,
        name,
        type,
        components,
        receiptWidth
    }
}

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

**Mutation**
## deleteReceipt — Returns [Receipt](/documentation/Objects/Receipts#Receipt)

**Scopes required:** modify_receipts

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

**Example Mutation**

```graphql
mutation DeleteReceipt($id: ID!) {
    deleteReceipt(id: $id) {
        id,
        name,
        type,
        components,
        receiptWidth
    }
}

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

**Mutation**
## updateReceipt — Returns [Receipt](/documentation/Objects/Receipts#Receipt)

**Scopes required:** modify_receipts

> <p>This is currently an experimental mutation, please get in contact with us before using it.</p>

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the receipt |
| name | *String* | The name of the receipt |
| components | [JSON](/documentation/Types/JSON#JSON) | The components this receipt contains |
| padding | [ReceiptPaddingInput](/documentation/Inputs/Receipts#ReceiptPaddingInput) | The padding this receipt should have |
| receiptWidth | *Float* | The width of the receipt (typically in mm) |
| attachments | [[ReceiptAttachmentInput!]](/documentation/Inputs/Receipts#ReceiptAttachmentInput) | The attachments that should be automatically connected to this receipt |

**Example Mutation**

```graphql
mutation UpdateReceipt($id: ID!) {
    updateReceipt(id: $id) {
        id,
        name,
        type,
        components,
        receiptWidth
    }
}

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