- [HTTP request](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.request_body.SCHEMA_REPRESENTATION)
    - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.request_body.SCHEMA_REPRESENTATION.config.SCHEMA_REPRESENTATION)
    - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.request_body.SCHEMA_REPRESENTATION.config.SCHEMA_REPRESENTATION_1)
    - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.request_body.SCHEMA_REPRESENTATION.config.SCHEMA_REPRESENTATION_2)
    - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.request_body.SCHEMA_REPRESENTATION.config.SCHEMA_REPRESENTATION_3)
- [Response body](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.ProcessOrderResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#body.aspect)

Performs a single turn logic to process user input and return the result.

### HTTP request

`POST https://foodorderingaiagent.googleapis.com/v1beta/{config.session=projects/*/locations/*/sessions/*}:processOrder`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `config.session` | `string` Required. The session for the order. Format: `projects/{project}/locations/{location}/sessions/{session}` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "config": { "session": string, "store": string, "laneId": string, "enableEchoCancellation": boolean, "daypartId": string, "userInfo": { "preferredName": string, "paymentInfo": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order#PaymentInfo`) }, "deliveryAddress": string, "pastOrders": [ { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Config#PastOrder`) } ], "loyaltyInfo": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/LoyaltyInfo`) }, "phoneNumber": string, "userId": string, "savedDeliveryAddress": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order#DeliveryAddress`) }, "additionalSavedAddresses": [ { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order#DeliveryAddress`) } ], "additionalSavedCustomerNames": [ string ] }, "orderType": enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Config#OrderType`), "initialOrder": { "items": [ { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order#OrderItem`) } ], "metadata": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order#OrderMetadata`) }, "fulfillment": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order#OrderFulfillment`) }, "priceInfo": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order#OrderPriceInfo`) }, "externalOrderId": string, "orderPayment": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order#OrderPayment`) }, "customIntegrationAttributes": { object } }, "featureGate": { "triggerOfferEngineOnDemand": boolean, "triggerLoyaltyOnDemand": boolean, "triggerOrderMediaAssistantOnDemand": boolean, "menuResponseEnabled": boolean, "revampedPaymentFlowEnabled": boolean, "updatedOrderStateEnabled": boolean, "enableOrderStatusRetrieval": boolean, "enableClientEscalationAudio": boolean }, "initialUtterance": string, "clientAppInfo": { "deviceModel": string, "osVersion": string, "sdkVersion": string }, "mode": enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Config#SessionMode`), "channelType": enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/ChannelType`), "enableListenOnlyDualChannel": boolean, "testSessionStartTime": string, "fulfillmentMethod": enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/FulfillmentMethod`), "clientEnv": string }, "turnType": enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/TurnType`), // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "textInput": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/TextInput`) }, "audioInput": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/AudioInput`) }, "eventInput": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/EventInput`) }, "clientExecutionResult": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/ClientExecutionResult`) }, "blobInput": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Blob`) }, "dtmfInput": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/DtmfInput`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `config.store` | `string` Required. The store the order is being placed for. Format: `projects/{project}/locations/{location}/brands/{brand}/stores/{store}` |
| `config.laneId` | `string` Optional. The id of a specifc drive through lane. |
| `config.enableEchoCancellation` | `boolean` Optional. Whether to enable echo cancellation for the session. If enabled, the client should provide the customerAudio and crewAudio in the AudioInput. |
| `config.daypartId` | `string` Optional. Daypart of the food menu, including breakfast, lunch, dinner, etc. This is used to determine the menu to use for the order. |
| `config.userInfo` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Config#UserInfo`)`` Optional. The personal information of the end user shared with the agent. |
| `config.orderType (deprecated)` | ``enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Config#OrderType`)`` Optional. Deprecated: Use initialOrder.fulfillment.fulfillment_type instead. The type of order to be placed. |
| `config.initialOrder` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order`)`` Optional. The initial order before starting the agent session. If provided, the agent will use it as the initial order state. |
| `config.featureGate` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Config#FeatureGate`)`` Optional. The feature gates for the session. This is used to enable or disable features for the session. |
| `config.initialUtterance` | `string` Optional. The initial utterance from the client to kick off the conversation. If provided, the agent will use this as the first user utterance, and will not start with a greeting message. |
| `config.clientAppInfo` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Config#ClientAppInfo`)`` Optional. The information about the client application and device environment. |
| `config.mode` | ``enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Config#SessionMode`)`` Optional. The mode of the session. |
| `config.channelType` | ``enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/ChannelType`)`` Optional. The type of channel used for agent communication. |
| `config.enableListenOnlyDualChannel` | `boolean` Optional. Whether to enable listen-only dual channel for the session. If enabled, the client should provide the customerAudio and crewAudio in the AudioInput. |
| `config.testSessionStartTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Optional. The start time of the session, used for testing or evaluation purposes. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `config.fulfillmentMethod` | ``enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/FulfillmentMethod`)`` Optional. The fulfillment method for the session. |
| `config.clientEnv` | `string` Optional. The environment on the client side (e.g., "qa", "uat", "preprod"). |
| `turnType` | ``enum (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/TurnType`)`` Optional. Explicit indicator of the request's position in the session lifecycle. Allows clients to deterministically control when initial session setup variables are injected. |
| The input from the client. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `textInput` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/TextInput`)`` The text input from the client. |
| `audioInput` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/AudioInput`)`` The audio input from the client. |
| `eventInput` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/EventInput`)`` The event input from the client. |
| `clientExecutionResult` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/ClientExecutionResult`)`` The result of a client execution request. |
| `blobInput` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Blob`)`` Generic binary data input. |
| `dtmfInput` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/DtmfInput`)`` The DTMF input from the client. |
| End of mutually exclusive fields. ||

### Response body

Response message for `https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.sessions/processOrder#google.cloud.foodorderingaiagent.v1beta.FoodOrderingService.ProcessOrder`. Functionally contains fields from BidiProcessOrderResponse minus streaming-specific ones.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "responses": [ { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/BidiProcessOrderResponse`) } ] } ``` |

| Fields ||
|---|---|
| `responses[]` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/BidiProcessOrderResponse`)`` Output only. List of agent responses to the request, returned in-order. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).