# Estimate Maximum Purchase Quantity

`GET` `/v1/trade/estimate/buy_limit`

This API is used for estimating the maximum purchase quantity for Hong Kong and US stocks, warrants, and options.

## Parameters

### Query Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | Yes | Stock code, using ticker.region format, for example: `AAPL.US` |
| `order_type` | string | Yes | Order Type. One of: `LO`, `ELO`, `MO`, `AO`, `ALO`, `ODD`, `LIT`, `MIT`, `TSLPAMT`, `TSLPPCT`, `SLO`. |
| `price` | string | No | Estimated order price, for example: `388.5` |
| `side` | string | Yes | Order side. **Enum Value**, `Buy` - Buy, `Sell` - Sell (Short selling is only supported for US stocks) |
| `currency` | string | No | Settlement currency |
| `order_id` | string | No | Order ID, required when estimating the maximum purchase quantity for a modified order |

## Request Example

```bash
curl --request GET \
  --url 'https://openapi.longbridge.com/v1/trade/estimate/buy_limit?symbol=<symbol>&order_type=<order_type>&side=<side>' \
  --header 'Authorization: Bearer <access_token>'
```

## Response

### Response Properties

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cash_max_qty` | string | Yes | Cash available quantity, default value is empty string. |
| `margin_max_qty` | string | Yes | Margin available quantity, default value is empty string. |

### Response JSON Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "cash_max_qty": "100",
    "margin_max_qty": "100"
  }
}
```
