> For the complete documentation index, see [llms.txt](https://docs.clickoptions.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clickoptions.ai/api/trading-orders-v1.md).

# Trading Orders v1

Trading REST API for order management

## Get orders

> Returns a paginated list of open and partially filled orders for the authenticated account. Supports filtering by asset and option type (CALL/PUT).

```json
{"openapi":"3.1.0","info":{"title":"fintp-public-api","version":"0.0.1"},"tags":[{"name":"Trading Orders v1","description":"Trading REST API for order management"}],"servers":[{"url":"https://api.clickoptions.ai/api","description":"Generated server url"}],"paths":{"/v1/orders":{"get":{"tags":["Trading Orders v1"],"summary":"Get orders","description":"Returns a paginated list of open and partially filled orders for the authenticated account. Supports filtering by asset and option type (CALL/PUT).","operationId":"getOrders","parameters":[{"name":"asset","in":"query","description":"Underlying asset symbol to filter orders","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","description":"Option type to filter orders (CALL or PUT)","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (1-based)","required":false,"schema":{"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","description":"Number of orders per page (max 100)","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"Orders retrieved successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedResponseV1OrderResponseV1"}}}},"400":{"description":"Invalid request parameters","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}},"401":{"description":"Authentication required","content":{"*/*":{"schema":{"type":"object"}}}},"413":{"description":"Request size too large","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}},"429":{"description":"Rate Limit exceed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}},"500":{"description":"Internal server error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}}}}}},"components":{"schemas":{"PagedResponseV1OrderResponseV1":{"type":"object","properties":{"total":{"type":"integer","format":"int32","description":"Total number of items"},"page":{"type":"integer","format":"int32","description":"Current page number"},"pageSize":{"type":"integer","format":"int32","description":"Number of items per page"},"items":{"type":"array","description":"List of items for the current page","items":{"$ref":"#/components/schemas/OrderResponseV1"}}}},"OrderResponseV1":{"type":"object","description":"Response DTO for order operations in v1 API","properties":{"orderId":{"type":"string","description":"Unique identifier of the order"},"positionId":{"type":"integer","format":"int64","description":"Identifier of the related position, if available"},"symbol":{"type":"string","description":"Trading symbol"},"price":{"type":"string","description":"Order price"},"size":{"type":"string","description":"Order size"},"side":{"type":"string","description":"Order side (BUY/SELL)"},"orderType":{"type":"string","description":"Order type (LIMIT/MARKET)"},"status":{"type":"string","description":"Order status"},"asset":{"type":"string","description":"Underlaying asset name"},"type":{"type":"string","description":"Option type (CALL/PUT)"},"expiryDate":{"type":"integer","format":"int64","description":"Expiry date as epoch millis"},"sizeUsdt":{"type":"string","description":"Order size in USDT"},"sizeContracts":{"type":"string","description":"Order size in contracts"},"strikePrice":{"type":"string","description":"Strike price"},"openPrice":{"type":"string","description":"Open price (VWAP)"},"openDate":{"type":"integer","format":"int64","description":"Open date as epoch millis"},"fee":{"type":"string","description":"Fee paid"},"timestamp":{"type":"integer","format":"int64","description":"Order creation timestamp as epoch millis"}}},"ApiErrorV1":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"object","additionalProperties":{}}}}}}}
```

## Create limit order

> Creates a new limit order with idempotency support

```json
{"openapi":"3.1.0","info":{"title":"fintp-public-api","version":"0.0.1"},"tags":[{"name":"Trading Orders v1","description":"Trading REST API for order management"}],"servers":[{"url":"https://api.clickoptions.ai/api","description":"Generated server url"}],"paths":{"/v1/orders":{"post":{"tags":["Trading Orders v1"],"summary":"Create limit order","description":"Creates a new limit order with idempotency support","operationId":"createOrder","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequestV1"}}},"required":true},"responses":{"200":{"description":"Order created successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OrderResponseV1"}}}},"400":{"description":"Invalid input data","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}},"401":{"description":"Authentication required","content":{"*/*":{"schema":{"type":"object"}}}},"409":{"description":"Duplicate idempotency key with different payload","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}},"422":{"description":"Business validation failed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiErrorV1"}}}},"429":{"description":"Rate limit exceeded","content":{"*/*":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"CreateOrderRequestV1":{"type":"object","description":"Request DTO for creating orders in v1 API","properties":{"idempotencyKey":{"type":"string","description":"Idempotency key for the order","minLength":1},"symbol":{"type":"string","description":"Trading symbol","minLength":1},"price":{"type":"string","description":"Order price as a decimal string","minLength":1,"pattern":"^\\d+(\\.\\d+)?$"},"size":{"type":"string","description":"Order size as a decimal string","minLength":1,"pattern":"^\\d+(\\.\\d+)?$"},"side":{"type":"string","description":"Order side","enum":["BUY","SELL"],"pattern":"^(BUY|SELL)$"},"orderType":{"type":"string","default":"LIMIT","description":"Order type","enum":["LIMIT"],"pattern":"^LIMIT$"},"positionId":{"type":"integer","format":"int64","description":"Position ID (optional)"}},"required":["idempotencyKey","price","side","size","symbol"]},"OrderResponseV1":{"type":"object","description":"Response DTO for order operations in v1 API","properties":{"orderId":{"type":"string","description":"Unique identifier of the order"},"positionId":{"type":"integer","format":"int64","description":"Identifier of the related position, if available"},"symbol":{"type":"string","description":"Trading symbol"},"price":{"type":"string","description":"Order price"},"size":{"type":"string","description":"Order size"},"side":{"type":"string","description":"Order side (BUY/SELL)"},"orderType":{"type":"string","description":"Order type (LIMIT/MARKET)"},"status":{"type":"string","description":"Order status"},"asset":{"type":"string","description":"Underlaying asset name"},"type":{"type":"string","description":"Option type (CALL/PUT)"},"expiryDate":{"type":"integer","format":"int64","description":"Expiry date as epoch millis"},"sizeUsdt":{"type":"string","description":"Order size in USDT"},"sizeContracts":{"type":"string","description":"Order size in contracts"},"strikePrice":{"type":"string","description":"Strike price"},"openPrice":{"type":"string","description":"Open price (VWAP)"},"openDate":{"type":"integer","format":"int64","description":"Open date as epoch millis"},"fee":{"type":"string","description":"Fee paid"},"timestamp":{"type":"integer","format":"int64","description":"Order creation timestamp as epoch millis"}}},"ApiErrorV1":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"object","additionalProperties":{}}}}}}}
```

## Cancel order

> Cancels an existing order by ID

```json
{"openapi":"3.1.0","info":{"title":"fintp-public-api","version":"0.0.1"},"tags":[{"name":"Trading Orders v1","description":"Trading REST API for order management"}],"servers":[{"url":"https://api.clickoptions.ai/api","description":"Generated server url"}],"paths":{"/v1/orders/{orderId}":{"delete":{"tags":["Trading Orders v1"],"summary":"Cancel order","description":"Cancels an existing order by ID","operationId":"cancelOrder","parameters":[{"name":"orderId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Order cancelled successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OrderResponseV1"}}}},"404":{"description":"Order not found","content":{"*/*":{"schema":{"type":"object"}}}},"409":{"description":"Order already in final state","content":{"*/*":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"OrderResponseV1":{"type":"object","description":"Response DTO for order operations in v1 API","properties":{"orderId":{"type":"string","description":"Unique identifier of the order"},"positionId":{"type":"integer","format":"int64","description":"Identifier of the related position, if available"},"symbol":{"type":"string","description":"Trading symbol"},"price":{"type":"string","description":"Order price"},"size":{"type":"string","description":"Order size"},"side":{"type":"string","description":"Order side (BUY/SELL)"},"orderType":{"type":"string","description":"Order type (LIMIT/MARKET)"},"status":{"type":"string","description":"Order status"},"asset":{"type":"string","description":"Underlaying asset name"},"type":{"type":"string","description":"Option type (CALL/PUT)"},"expiryDate":{"type":"integer","format":"int64","description":"Expiry date as epoch millis"},"sizeUsdt":{"type":"string","description":"Order size in USDT"},"sizeContracts":{"type":"string","description":"Order size in contracts"},"strikePrice":{"type":"string","description":"Strike price"},"openPrice":{"type":"string","description":"Open price (VWAP)"},"openDate":{"type":"integer","format":"int64","description":"Open date as epoch millis"},"fee":{"type":"string","description":"Fee paid"},"timestamp":{"type":"integer","format":"int64","description":"Order creation timestamp as epoch millis"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clickoptions.ai/api/trading-orders-v1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
