# finalizePaymentIntent

> The `finalizePaymentIntent` mutation. Returns `OrderIntent`.

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

```graphql
finalizePaymentIntent(
  paymentIntentId: ID!
  accessToken: String
): OrderIntent
```

## Arguments

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

## Returns

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

## Example

```graphql
mutation FinalizePaymentIntent($paymentIntentId: ID!) {
  finalizePaymentIntent(paymentIntentId: $paymentIntentId) {
    id
    createdAt
    updatedAt
    finalizeAccessToken
    metadata
    state
  }
}
```

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