# cancelTransaction

> Required permission: RestaurantWrite

Source: https://docs.gastrogate.io/docs/api/mutations/cancelTransaction

> [!WARNING]
> Deprecated. Use cancelPaymentIntent/cancelRefundIntent instead

```graphql
cancelTransaction(
  restaurantId: ID!
  posTerminalId: ID!
): CancelTransactionResult!
```

## Arguments

| Name | Type | Description |
| --- | --- | --- |
| `restaurantId` | [`ID`](https://docs.gastrogate.io/docs/api/types/ID.md)! |  |
| `posTerminalId` | [`ID`](https://docs.gastrogate.io/docs/api/types/ID.md)! |  |

## Returns

[`CancelTransactionResult`](https://docs.gastrogate.io/docs/api/types/CancelTransactionResult.md)!

## Example

```graphql
mutation CancelTransaction($restaurantId: ID!, $posTerminalId: ID!) {
  cancelTransaction(restaurantId: $restaurantId, posTerminalId: $posTerminalId)
}
```

```bash
curl https://api.thelocoapp.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $LOCO_API_KEY" \
  -d '{"query": "mutation { cancelTransaction(...) { __typename } }"}'
```
