# Basket Order Margin

## POST /api/oms/basket-margin

Basket Order Margin

Basket order margin

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| Authorization | header | string | Yes | Access token in the following format:  Bearer <api_key>:<access_token>  Both values are required. The `api_key` is your app credential from the Apps Section. The `access_token` is obtained from the authentication endpoint and is valid for 24 hours. |

### Request Body (application/json)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| basketOrders | object[] | No | Basket order is basket of multiple orders |
| basketOrders[].symId | string | Yes | Unique identifier of the symbol |
| basketOrders[].qty | number | Yes | No of shares to buy or sell. For derivatives, pass the quantity by multiplying with lot size. Example: To buy 1 lot of NIFTY option, pass the quantity as 50. |
| basketOrders[].limitPrice | number | No | This is required only for limit and stop limit orders |
| basketOrders[].side | string ("buy" | "sell") | Yes | Order side 'buy' or 'sell' |
| basketOrders[].type | string ("limit" | "market" | "stoplimit" | "stopmarket") | Yes | Price type of an order |
| basketOrders[].product | string ("delivery" | "intraday" | "normal") | Yes | Product type of an order. 'delivery' is applicable for equities. 'normal' is applicable for derivatives. 'intraday' is applicable for both equity and derivatives |
| basketOrders[].trigPrice | number | No | This is required only for stoploss limit and stoploss market orders |

### Responses

#### 200 — OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("ok" | "no-data" | "error") | No |  |
| d | object | No |  |
| d.requiredMargin | number | No | Required margin |
| d.finalMargin | number | No | Final margin |
| d.existingMarginUsed | number | No | Existing margin used |
| d.combinedRequiredMargin | number | No | Combined required margin is a combination of required margin of an order and margin used |
| d.combinedFinalMargin | number | No | Combined Final margin is a combination of final margin of an order and margin used |
| d.availableMargin | number | No | Available margin to trade |
| msg | string ("no-data" | "error msg") | No |  |
| s | string ("ok" | "error" | "no-data") | No |  |

#### 401 — Unauthorized — one of: (1) invalid or expired access token — tokens expire after 24 hours, re-authenticate to get a new one; (2) `Authorization` header missing or malformed — use format `Bearer <api_key>:<access_token>`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string ("Unauthorized") | No | Error message. |

#### 429 — Too Many Requests — rate limit exceeded. General API: 10 req/sec per auth token (400 req/min).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string | No | Error message indicating the rate limit was exceeded. |

#### 500 — Internal Server Error — retry with backoff; contact support if it persists.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string | No | Error message. |