# createRefundIntent

> Required permission: RestaurantOrderRefund

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

```graphql
createRefundIntent(
  input: RefundIntentInput
  orderId: ID
  restaurantId: ID!
): RefundIntent
```

## Arguments

| Name | Type | Description |
| --- | --- | --- |
| `input` | [`RefundIntentInput`](https://docs.gastrogate.io/docs/api/types/RefundIntentInput.md) |  |
| `orderId` | [`ID`](https://docs.gastrogate.io/docs/api/types/ID.md) | MANDATORY: This field will be made mandatory in the future. |
| `restaurantId` | [`ID`](https://docs.gastrogate.io/docs/api/types/ID.md)! |  |

## Returns

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

## Example

```graphql
mutation CreateRefundIntent($restaurantId: ID!) {
  createRefundIntent(restaurantId: $restaurantId) {
    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 { createRefundIntent(...) { __typename } }"}'
```
