# OrderIntent

> The `OrderIntent` object.

Source: https://docs.gastrogate.io/docs/api/types/OrderIntent

**Kind:** Objects

## Fields

### `id`

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

### `createdAt`

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

### `updatedAt`

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

### `finalizeAccessToken`

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

An access token that can be used to finalize the order intent without requiring an authenticated user.

### `metadata`

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

Any metadata that was passed in by the client will be returned as is here.

### `paidItems`

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

If payment intents have been made for specific items in this order intent, this field will contain the items that have been paid for.

### `paymentIntents`

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

### `state`

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

The state which this Order Intent is currently in.

- 'Ready' - This order intent is ready to be finalized.
- 'RequiresAction' - An action is required to be performed by the user before this order intent can progress, see the 'action' field for more info.
- 'Done' - This order intent has successfully resulted in an Order.
- 'Failed' - The order intent has failed and will never result in an Order.

### `action`

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

For state "RequiresAction" this is the action that the user needs to perform.

### `openOrder`

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

If this order intent was created from an open order, this field will contain the open order.

### `order`

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

For state "Done" this is the Order that was created from this Order Intent.

### `refundIntent`

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

For state "RefundPending" this is the RefundIntent that is currently pending.

### `deliveryLocation`

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

### `discountAmount`

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

### `items`

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

### `receiptPrinter`

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

### `tipAmountPaid`

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

### `tipAmountPayable`

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

### `type`

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

### `totalAmountPaid`

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

### `totalAmountPayable`

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

### `vatAmountPaid`

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

### `vatAmountPayable`

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

## How to get it

This type is returned by:

- [`checkoutOpenOrderItems`](https://docs.gastrogate.io/docs/api/mutations/checkoutOpenOrderItems.md) (mutation)
- [`createOrderIntent`](https://docs.gastrogate.io/docs/api/mutations/createOrderIntent.md) (mutation)
- [`finalizePaymentIntent`](https://docs.gastrogate.io/docs/api/mutations/finalizePaymentIntent.md) (mutation)
- [`Restaurant.orderIntent`](https://docs.gastrogate.io/docs/api/types/Restaurant.md#orderintent) (field on [`Restaurant`](https://docs.gastrogate.io/docs/api/types/Restaurant.md))
- [`Restaurant.resumableOrderIntents`](https://docs.gastrogate.io/docs/api/types/Restaurant.md#resumableorderintents) (field on [`Restaurant`](https://docs.gastrogate.io/docs/api/types/Restaurant.md))
- [`Order.orderIntent`](https://docs.gastrogate.io/docs/api/types/Order.md#orderintent) (field on [`Order`](https://docs.gastrogate.io/docs/api/types/Order.md))
- [`PaymentIntent.orderIntent`](https://docs.gastrogate.io/docs/api/types/PaymentIntent.md#orderintent) (field on [`PaymentIntent`](https://docs.gastrogate.io/docs/api/types/PaymentIntent.md))
- [`RefundIntent.orderIntent`](https://docs.gastrogate.io/docs/api/types/RefundIntent.md#orderintent) (field on [`RefundIntent`](https://docs.gastrogate.io/docs/api/types/RefundIntent.md))
