# Method: orders.createWithCustomToken

- [HTTP request](https://developers.google.com/assistant/transactions/reference/physical/rest/v3/orders/createWithCustomToken#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/assistant/transactions/reference/physical/rest/v3/orders/createWithCustomToken#body.request_body)
  - [JSON representation](https://developers.google.com/assistant/transactions/reference/physical/rest/v3/orders/createWithCustomToken#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/assistant/transactions/reference/physical/rest/v3/orders/createWithCustomToken#body.response_body)

Creates and returns the new Order using a custom token minted by google. Developers using this method should set the userToken passed by google in the request. This method is used in cases where developers/merchant directly saves orders to Google on behalf of order (instead of Transactions and AMP flow).

### HTTP request

`POST https://actions.googleapis.com/v3/orders:createWithCustomToken`

The URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.

### Request body

The request body contains data with the following structure:

| JSON representation ||
|---|---|
| ``` { "header": { object (`https://developers.google.com/assistant/transactions/reference/physical/rest/v3/OrderRequestHeader`) }, "order": { object (`https://developers.google.com/assistant/transactions/reference/physical/rest/v3/Order`) }, "userToken": string } ``` |

| Fields ||
|---|---|
| `header` | ``object (`https://developers.google.com/assistant/transactions/reference/physical/rest/v3/OrderRequestHeader`)`` Required: Header for the create order request. |
| `order` | ``object (`https://developers.google.com/assistant/transactions/reference/physical/rest/v3/Order`)`` Required: Order to be created. Note: 1. Following fields are always required to create a valid order: order.create_time, order.merchant_order_id, order.contents.line_items, order.contents.line_items.id 2. Order must have at-least 1 line item and line item must have defined vertical/extension. 3. All extensions (both at order level and line_item level) must map to 1 vertical type ie. an order is not a valid order if it represents more than 1 vertical. <br /> |
| `userToken` | `string` Required: Encrypted token provided to partner by Google via asynchronous channel. |

### Response body

If successful, the response body contains an instance of `https://developers.google.com/assistant/transactions/reference/physical/rest/v3/Order`.