# cancelOrderIntent

> Required permission: RestaurantOrderRefund

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

```graphql
cancelOrderIntent(
  restaurantId: ID!
  orderIntentId: ID!
  input: RefundIntentInput
): RefundIntent
```

## Arguments

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

## Returns

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

## Example

```graphql
mutation CancelOrderIntent($restaurantId: ID!, $orderIntentId: ID!) {
  cancelOrderIntent(restaurantId: $restaurantId, orderIntentId: $orderIntentId) {
    id
    completedAt
    createdAt
    discountAmount
    paymentProvider
    tipAmount
  }
}
```

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