# Mutations / Sales

# Sales

**Mutation**
## changeSaleItemReadyStatus — Returns [Sale](/documentation/Objects/Sales#Sale)

**Scopes required:** use_bump_screen

| Arguments | Type | Description |
| --- | --- | --- |
| sale | [ID!](/documentation/Types/UUID#UUID) | The sale to mark items as ready |
| items | [[ID!]!](/documentation/Types/UUID#UUID) | The items on the sale to mark as ready (the sale item IDs, not the product IDs) |
| ready | *Boolean!* | Whether the items are ready or not |
| changeTime | [DateTime](/documentation/Types/Date-Time#DateTime) | The time the change occurred, defaults to now if not specified |

**Example Mutation**

```graphql
mutation ChangeSaleItemReadyStatus($sale: ID!, $items: [ID!]!, $ready: Boolean!) {
    changeSaleItemReadyStatus(sale: $sale, items: $items, ready: $ready) {
        id,
        clientId,
        status,
        accountSale,
        invoiceId
    }
}

# Example variables
{
    "sale": "<SALE>",
    "items": [
        "<ITEMS>"
    ],
    "ready": "<READY>"
}
```

**Mutation**
## createSale — Returns [Sale](/documentation/Objects/Sales#Sale)

**Scopes required:** sell

| Arguments | Type | Description |
| --- | --- | --- |
| sale | [SaleInput](/documentation/Inputs/Sales#SaleInput) | The sale to upload |
| checkDuplicates | *Boolean* | Whether we should check if this is a duplicate sale |
| deleteLinked | *Boolean* | Whether to delete the linked sale (only if the linked sale was parked), defaults to false |
| preventCancellation | *Boolean* | Whether to prevent the sale from being voided, default to false |

**Example Mutation**

```graphql
mutation CreateSale($sale: SaleInput) {
    createSale(sale: $sale) {
        id,
        clientId,
        status,
        accountSale,
        invoiceId
    }
}

# Example variables
{
    "sale": {
        "register": "<REGISTER>",
        "user": "<USER>",
        "status": "COMPLETED",
        "items": [
            {
                "total": "<TOTAL>"
            }
        ],
        "payments": [
            {
                "method": "<METHOD>",
                "amount": "<AMOUNT>"
            }
        ]
    }
}
```

**Mutation**
## unparkSale — Returns [Sale](/documentation/Objects/Sales#Sale)

**Scopes required:** sell

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the sale to unpark |
| time | [DateTime](/documentation/Types/Date-Time#DateTime) | The time that the sale was unparked, if not provided we presume it was the current time |
| register | [ID](/documentation/Types/UUID#UUID) | The register that unparked the sale, if not provided we presume it was the register the sale was completed on |

**Example Mutation**

```graphql
mutation UnparkSale($id: ID!) {
    unparkSale(id: $id) {
        id,
        clientId,
        status,
        accountSale,
        invoiceId
    }
}

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

**Mutation**
## updateSale — Returns [Sale](/documentation/Objects/Sales#Sale)

<p class="scopes"><span class="scope scope--none">No scope required</span></p>

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID](/documentation/Types/UUID#UUID) | The ID of the sale to update |
| register | [ID](/documentation/Types/UUID#UUID) | The register to update the sale to |
| search | [SaleSearchInput](/documentation/Inputs/Sales#SaleSearchInput) | Search criteria to find the sale |
| user | [ID](/documentation/Types/UUID#UUID) | The user to update the sale to |
| customer | [ID](/documentation/Types/UUID#UUID) | The customer to assign to the sale |
| saleTime | [DateTime](/documentation/Types/Date-Time#DateTime) | The date and time to update the sale to |
| payments | [[SalePaymentUpdateInput]](/documentation/Inputs/Sales#SalePaymentUpdateInput) | The payments to adjust on the sale |
| note | *String* | The external note to adjust on the sale |
| internalNote | *String* | The internal note to adjust on the sale |
| modifyReason | *String!* | The reason the sale was modified |

**Example Mutation**

```graphql
mutation UpdateSale($modifyReason: String!) {
    updateSale(modifyReason: $modifyReason) {
        id,
        clientId,
        status,
        accountSale,
        invoiceId
    }
}

# Example variables
{
    "modifyReason": "<MODIFY_REASON>"
}
```

**Mutation**
## voidSale — Returns [Sale](/documentation/Objects/Sales#Sale)

**Scopes required:** history_cancel_sale

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the sale to void |
| voidReason | *String* | The reason the sale is being voided (this will update the sale's modifiedReason) |

**Example Mutation**

```graphql
mutation VoidSale($id: ID!) {
    voidSale(id: $id) {
        id,
        clientId,
        status,
        accountSale,
        invoiceId
    }
}

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