> This page is for Web API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://interactivebrokers.com/docs/llms.txt.

# Midprice

A [Midprice](https://www.interactivebrokers.com/en/index.php?f=36735) order is designed to split the difference between the bid and ask prices, and fill at the current midpoint of the NBBO or better. Set an optional price cap to define the highest price (for a buy order) or the lowest price (for a sell order) you are willing to accept. Smart-routing to US stocks only.

* * Exchanges: Smart-routing only

**Set OrderType to** "MIDPRICE".

No algo params or strategy required.

#### Midprice Algo

```json
{
    "orders":[
        {
            "conid": {{ conid }},
            "orderType": "MIDPRICE",
            "price": {{ price }},
            "quantity": {{ quantity }},
            "side": {{ side }},
            "tif": {{ tif }}
        }
    ]
}
```

For the Web API, a price must be included. If no price cap is desired, '"price": 0' should be included.