# cancelTransferAdvice mutation


`cancelTransferAdvice` is a GraphQL mutation of the Chameleoon MAX API. Send it as `POST https://max-api.chameleoon.sk/api/v1/graphql` with your API key, see [Chameleoon MAX](/chameleoon-max).

Cancels an `OPEN` transfer advice that nothing has moved against, and releases its
reservations. Call it when the goods no longer need to be moved.

#### Permissions

Requires the same permissions as [`updateTransferAdvice`](/chameleoon-max/mutation/update-transfer-advice).

#### Errors

The call is refused with `CONFLICT` and one of these values of `extensions.reason`:

| Reason | When |
| --- | --- |
| `TRANSFER_ADVICE_STATUS` | The transfer advice is not `OPEN`. |
| `HANDHELD_DRAFT_OPEN` | A transfer is being scanned against the transfer advice on a handheld. It must be completed or deleted first. |
| `TRANSFER_ADVICE_HAS_MOVES` | Goods have moved against the transfer advice. Close it in MAX instead. |
| `TRANSFER_ADVICE_HAS_DRAFTS` | A draft transfer links the transfer advice. Delete or unlink the draft first. |

> An error whose path runs below this field does not mean the call failed: the transfer advice
> was cancelled, so do not retry. See [`Mutation`](/chameleoon-max/mutations).

## Arguments

- `id`: [`UUID!`](/chameleoon-max/type/uuid) · required

## Returns

[`TransferAdvice!`](/chameleoon-max/type/transfer-advice)

## Example

**Mutation**

```graphql
mutation cancelTransferAdvice($id: UUID!) {
  cancelTransferAdvice(id: $id) {
    id
    number
    status
    state
    sourceWarehouseId
    targetWarehouseId
    legalEntityId
    issuedAt
    plannedAt
    reference
    lines(first: 10) {
      totalCount
    }
    parameters(first: 10) {
      totalCount
    }
    progress {
      linesStarted
      linesDone
      linesInProgress
      linesRemaining
      activeDocuments
      startedAt
    }
    transfers(first: 10) {
      totalCount
    }
  }
}
```

**Variables**

```json
{
  "id": "00000000-0000-4000-8000-000000000001"
}
```

**Response**

```json
{
  "data": {
    "cancelTransferAdvice": {
      "id": "00000000-0000-4000-8000-000000000001",
      "number": "example",
      "status": "DRAFT",
      "state": "DRAFT",
      "sourceWarehouseId": "00000000-0000-4000-8000-000000000001",
      "targetWarehouseId": "00000000-0000-4000-8000-000000000001",
      "legalEntityId": "00000000-0000-4000-8000-000000000001",
      "issuedAt": "2026-01-01T00:00:00Z",
      "plannedAt": "2026-01-01T00:00:00Z",
      "reference": "example",
      "lines": {
        "totalCount": 1
      },
      "parameters": {
        "totalCount": 1
      },
      "progress": {
        "linesStarted": 1,
        "linesDone": 1,
        "linesInProgress": 1,
        "linesRemaining": 1,
        "activeDocuments": 1,
        "startedAt": "2026-01-01T00:00:00Z"
      },
      "transfers": {
        "totalCount": 1
      }
    }
  }
}
```

Values are illustrative: replace IDs and codes with your own before you send the call.
