# User

Endpoints related to user actions.

## Retrieves Open Trade Reports for a specific account

> Retrieves the Open Trade Reports, only Block Trades, for the given accountId.\
> ReceiveTime in POSIX format × 1000 (milliseconds since 1 January 1970).<br>

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OMSOrderData":{"type":"object","properties":{"Side":{"type":"string"},"OrderId":{"type":"integer"},"Price":{"type":"number"},"Quantity":{"type":"number"},"DisplayQuantity":{"type":"number"},"Instrument":{"type":"integer"},"Account":{"type":"integer"},"OrderType":{"type":"string"},"ClientOrderId":{"type":"integer"},"OrderState":{"type":"string"},"ReceiveTime":{"type":"integer"},"ReceiveTimeTicks":{"type":"integer"},"OrigQuantity":{"type":"number"},"QuantityExecuted":{"type":"number"},"AvgPrice":{"type":"number"},"CounterPartyId":{"type":"integer"},"ChangeReason":{"type":"string"},"OrigOrderId":{"type":"integer"},"OrigClOrdId":{"type":"integer"},"EnteredBy":{"type":"integer"},"IsQuote":{"type":"boolean"},"InsideAsk":{"type":"number"},"InsideAskSize":{"type":"number"},"InsideBid":{"type":"number"},"InsideBidSize":{"type":"number"},"LastTradePrice":{"type":"number"},"RejectReason":{"type":"string"},"IsLockedIn":{"type":"boolean"},"CancelReason":{"type":"string"},"OMSId":{"type":"integer"}}}}},"paths":{"/GetOpenTradeReports":{"get":{"tags":["User"],"summary":"Retrieves Open Trade Reports for a specific account","description":"Retrieves the Open Trade Reports, only Block Trades, for the given accountId.\nReceiveTime in POSIX format × 1000 (milliseconds since 1 January 1970).\n","operationId":"GetOpenTradeReports","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"OMSId":{"type":"integer"},"AccountId":{"type":"integer"}}}}}},"responses":{"200":{"description":"A list of open trade reports","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OMSOrderData"}}}}},"400":{"description":"Invalid request parameters"},"401":{"description":"Unauthorized access"}}}}}}
```

## Retrieves Open Trade Reports for a specific instrument

> Retrieves the Open Trade Reports, only Block Trades, for the given instrumentId.\
> Identifying information of counterparty is removed.<br>

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"OMSOrderData":{"type":"object","properties":{"Side":{"type":"string"},"OrderId":{"type":"integer"},"Price":{"type":"number"},"Quantity":{"type":"number"},"DisplayQuantity":{"type":"number"},"Instrument":{"type":"integer"},"Account":{"type":"integer"},"OrderType":{"type":"string"},"ClientOrderId":{"type":"integer"},"OrderState":{"type":"string"},"ReceiveTime":{"type":"integer"},"ReceiveTimeTicks":{"type":"integer"},"OrigQuantity":{"type":"number"},"QuantityExecuted":{"type":"number"},"AvgPrice":{"type":"number"},"CounterPartyId":{"type":"integer"},"ChangeReason":{"type":"string"},"OrigOrderId":{"type":"integer"},"OrigClOrdId":{"type":"integer"},"EnteredBy":{"type":"integer"},"IsQuote":{"type":"boolean"},"InsideAsk":{"type":"number"},"InsideAskSize":{"type":"number"},"InsideBid":{"type":"number"},"InsideBidSize":{"type":"number"},"LastTradePrice":{"type":"number"},"RejectReason":{"type":"string"},"IsLockedIn":{"type":"boolean"},"CancelReason":{"type":"string"},"OMSId":{"type":"integer"}}}}},"paths":{"/GetAllOpenTradeReports":{"get":{"tags":["User"],"summary":"Retrieves Open Trade Reports for a specific instrument","description":"Retrieves the Open Trade Reports, only Block Trades, for the given instrumentId.\nIdentifying information of counterparty is removed.\n","operationId":"GetAllOpenTradeReports","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"OMSId":{"type":"integer"},"InstrumentId":{"type":"integer"}}}}}},"responses":{"200":{"description":"A list of open trade reports","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OMSOrderData"}}}}},"400":{"description":"Invalid request parameters"},"401":{"description":"Unauthorized access"}}}}}}
```

## Cancel and Replace Order

> Cancels and replaces an order with a new order in a single call.

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CancelReplaceRequest":{"type":"object","properties":{"omsId":{"type":"integer"},"orderIdToReplace":{"type":"integer"},"clientOrdId":{"type":"integer"},"orderType":{"type":"integer"},"side":{"type":"integer"},"accountId":{"type":"integer"},"instrumentId":{"type":"integer"},"useDisplayQuantity":{"type":"boolean"},"displayQuantity":{"type":"number"},"limitPrice":{"type":"number"},"stopPrice":{"type":"number"},"referencePrice":{"type":"number"},"pegPriceType":{"type":"integer"},"timeInForce":{"type":"integer"},"orderIdOCO":{"type":"integer"},"quantity":{"type":"number"}},"required":["omsId","orderIdToReplace","clientOrdId","accountId","instrumentId","side","quantity"]},"CancelReplaceResponse":{"type":"object","properties":{"replacementOrderId":{"type":"integer"},"replacementClOrdId":{"type":"integer"},"origOrderId":{"type":"integer"},"origClOrdId":{"type":"integer"}}},"ApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"requestcode":{"type":"string"}}}}},"paths":{"/CancelReplaceOrder":{"post":{"tags":["User"],"summary":"Cancel and Replace Order","description":"Cancels and replaces an order with a new order in a single call.","operationId":"CancelReplaceOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelReplaceRequest"}}}},"responses":{"200":{"description":"Replacement order created successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelReplaceResponse"}}}},"400":{"description":"Invalid request or order cannot be replaced.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}}}}
```

## Modify Order Quantity

> Reduces an order’s quantity without affecting its position in the book.

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ModifyOrderRequest":{"type":"object","properties":{"OMSId":{"type":"integer"},"OrderId":{"type":"integer"},"InstrumentId":{"type":"integer"},"PreviousOrderRevision":{"type":"integer"},"Quantity":{"type":"number"},"AccountId":{"type":"integer"}},"required":["OMSId","OrderId","InstrumentId","PreviousOrderRevision","Quantity","AccountId"]},"ApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"requestcode":{"type":"string"}}}}},"paths":{"/ModifyOrder":{"post":{"tags":["User"],"summary":"Modify Order Quantity","description":"Reduces an order’s quantity without affecting its position in the book.","operationId":"ModifyOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyOrderRequest"}}}},"responses":{"200":{"description":"Order modified successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"Modification failed due to validation or order state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}}}}
```

## Cancel Order

> Cancels an order using OrderId or ClientOrderId.

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CancelOrderRequest":{"type":"object","properties":{"OMSId":{"type":"integer"},"AccountId":{"type":"integer"},"OrderId":{"type":"integer"},"ClorderId":{"type":"integer"}},"required":["OMSId","AccountId"]},"ApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"requestcode":{"type":"string"}}}}},"paths":{"/CancelOrder":{"post":{"tags":["User"],"summary":"Cancel Order","description":"Cancels an order using OrderId or ClientOrderId.","operationId":"CancelOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOrderRequest"}}}},"responses":{"200":{"description":"Order cancelled successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"Order cancellation failed due to invalid input or state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}}}}
```

## Cancel All Orders

> Cancels all active orders for a specified account and OMS.

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CancelAllOrdersRequest":{"type":"object","properties":{"AccountId":{"type":"integer"},"OMSId":{"type":"integer"}},"required":["AccountId","OMSId"]},"ApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"requestcode":{"type":"string"}}}}},"paths":{"/CancelAllOrders":{"post":{"tags":["User"],"summary":"Cancel All Orders","description":"Cancels all active orders for a specified account and OMS.","operationId":"CancelAllOrders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelAllOrdersRequest"}}}},"responses":{"200":{"description":"All orders cancelled successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"One or more orders could not be cancelled due to validation or status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}}}}
```

## Creates an order

> Submits a new order with the specified parameters.

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SendOrderRequest":{"type":"object","properties":{"InstrumentId":{"type":"integer"},"OMSId":{"type":"integer"},"AccountId":{"type":"integer"},"TimeInForce":{"type":"integer"},"ClientOrderId":{"type":"integer"},"OrderIdOCO":{"type":"integer"},"UseDisplayQuantity":{"type":"boolean"},"Side":{"type":"integer"},"quantity":{"type":"number"},"OrderType":{"type":"integer"},"PegPriceType":{"type":"integer"},"LimitPrice":{"type":"number"},"PostOnly":{"type":"boolean"}},"required":["InstrumentId","OMSId","AccountId","TimeInForce","ClientOrderId","Side","quantity","OrderType"]},"SendOrderResponse":{"type":"object","properties":{"status":{"type":"string"},"errormsg":{"type":"string"},"OrderId":{"type":"integer"}}}}},"paths":{"/SendOrder":{"post":{"tags":["User"],"summary":"Creates an order","description":"Submits a new order with the specified parameters.","operationId":"SendOrder","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendOrderRequest"}}}},"responses":{"200":{"description":"Order submission response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendOrderResponse"}}}},"400":{"description":"Bad request"}}}}}}
```

## POST /GetWithdrawFee

> Get a fee estimate for a withdrawal

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GetWithdrawFeeRequest":{"type":"object","properties":{"OMSId":{"type":"integer"},"AccountId":{"type":"integer"},"ProductId":{"type":"integer"},"Amount":{"type":"number","format":"float"},"AccountProviderId":{"type":"integer","required":["OMSId","AccountId","ProductId","Amount","AccountProviderId"]}}},"GetWithdrawFeeResponse":{"type":"object","properties":{"FeeAmount":{"type":"number","format":"float"},"TicketAmount":{"type":"number","format":"float"}}},"ApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"requestcode":{"type":"string"}}}}},"paths":{"/GetWithdrawFee":{"post":{"tags":["User"],"summary":"Get a fee estimate for a withdrawal","operationId":"GetWithdrawFee","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWithdrawFeeRequest"}}}},"responses":{"200":{"description":"Withdrawal fee estimate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWithdrawFeeResponse"}}}},"400":{"description":"Bad request - invalid or missing parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"401":{"description":"Unauthorized - authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}}}}
```

## POST /GetAccountDepositTransactions

> Gets a list of deposits for an Account

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GetAccountDepositTransactionsRequest":{"type":"object","properties":{"OMSId":{"type":"integer"},"AccountId":{"type":"integer"},"Depth":{"type":"integer"}},"required":["OMSId","AccountId"]},"GetAccountDepositTransactionsResponse":{"type":"object","properties":{"transactionId":{"type":"integer"},"omsId":{"type":"integer"},"accountId":{"type":"integer"},"cr":{"type":"number"},"dr":{"type":"number"},"counterparty":{"type":"integer"},"transactionType":{"type":"integer"},"referenceId":{"type":"integer"},"referenceType":{"type":"integer"},"productId":{"type":"integer"},"balance":{"type":"number"},"timeStamp":{"type":"integer"}}}}},"paths":{"/GetAccountDepositTransactions":{"post":{"summary":"Gets a list of deposits for an Account","operationId":"GetAccountDepositTransactions","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccountDepositTransactionsRequest"}}}},"responses":{"200":{"description":"A list of account deposit transactions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GetAccountDepositTransactionsResponse"}}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}}}}}}
```

## POST /GetAccountTransactions

> Gets a list of transactions for an Account

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GetAccountTransactionsRequest":{"type":"object","properties":{"startIndex":{"type":"integer"},"depth":{"type":"integer"},"transactionId":{"type":"integer"},"referenceId":{"type":"integer"},"omsId":{"type":"integer"},"accountId":{"type":"integer"},"counterParty":{"type":"integer"},"productId":{"type":"integer"},"userId":{"type":"integer"},"startTimestamp":{"type":"integer"},"endTimestamp":{"type":"integer"},"transactionTypes":{"type":"array","items":{"type":"integer"}},"transactionReferenceTypes":{"type":"array","items":{"type":"integer"}}},"required":["omsId","accountId"]},"GetAccountTransactionsResponse":{"type":"object","properties":{"transactionId":{"type":"integer"},"omsId":{"type":"integer"},"accountId":{"type":"integer"},"cr":{"type":"number"},"dr":{"type":"number"},"counterparty":{"type":"integer"},"transactionType":{"type":"integer"},"referenceId":{"type":"integer"},"referenceType":{"type":"integer"},"productId":{"type":"integer"},"balance":{"type":"number"},"timeStamp":{"type":"integer"}},"required":["transactionId","omsId","accountId","cr","dr","counterparty","transactionType","productId","balance","timeStamp"]}}},"paths":{"/GetAccountTransactions":{"post":{"summary":"Gets a list of transactions for an Account","operationId":"GetAccountTransactions","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccountTransactionsRequest"}}}},"responses":{"200":{"description":"A list of account transactions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GetAccountTransactionsResponse"}}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}}}}}}
```

## Retrieves a list of orders for an account

> ReceiveTime in POSIX format X 1000 (milliseconds since 1 January 1970)

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GetOrdersHistoryRequest":{"type":"object","properties":{"omsId":{"type":"integer"},"accountId":{"type":"integer"},"OrderId":{"type":"integer"},"clientOrderId":{"type":"integer"},"originalOrderId":{"type":"integer"},"originalClientOrderId":{"type":"integer"},"userId":{"type":"integer"},"instrumentId":{"type":"integer"},"startTimestamp":{"type":"integer"},"endTimestamp":{"type":"integer"},"depth":{"type":"integer"},"startIndex":{"type":"integer"}},"required":["omsId","accountId","startTimestamp","endTimestamp"]},"OMSOrderData":{"type":"object","properties":{"Side":{"type":"string"},"OrderId":{"type":"integer"},"Price":{"type":"number"},"Quantity":{"type":"number"},"DisplayQuantity":{"type":"number"},"Instrument":{"type":"integer"},"Account":{"type":"integer"},"OrderType":{"type":"string"},"ClientOrderId":{"type":"integer"},"OrderState":{"type":"string"},"ReceiveTime":{"type":"integer"},"ReceiveTimeTicks":{"type":"integer"},"OrigQuantity":{"type":"number"},"QuantityExecuted":{"type":"number"},"AvgPrice":{"type":"number"},"CounterPartyId":{"type":"integer"},"ChangeReason":{"type":"string"},"OrigOrderId":{"type":"integer"},"OrigClOrdId":{"type":"integer"},"EnteredBy":{"type":"integer"},"IsQuote":{"type":"boolean"},"InsideAsk":{"type":"number"},"InsideAskSize":{"type":"number"},"InsideBid":{"type":"number"},"InsideBidSize":{"type":"number"},"LastTradePrice":{"type":"number"},"RejectReason":{"type":"string"},"IsLockedIn":{"type":"boolean"},"CancelReason":{"type":"string"},"OMSId":{"type":"integer"}}}}},"paths":{"/GetOrderHistory":{"post":{"summary":"Retrieves a list of orders for an account","description":"ReceiveTime in POSIX format X 1000 (milliseconds since 1 January 1970)","operationId":"GetOrderHistory","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrdersHistoryRequest"}}}},"responses":{"200":{"description":"A list of orders","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OMSOrderData"}}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}}}}}}
```

## POST /GetAccountPositions

> Retrieves a list of Positions (Balances) on a specific account.

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GetAccountPositionsResponse":{"type":"object","properties":{"omsId":{"type":"integer"},"accountId":{"type":"integer"},"productSymbol":{"type":"string"},"productId":{"type":"integer"},"amount":{"type":"number","format":"float"},"hold":{"type":"number","format":"float"},"pendingDeposits":{"type":"number","format":"float"},"pendingWithdraws":{"type":"number","format":"float"},"totalDayDeposits":{"type":"number","format":"float"},"totalMonthDeposits":{"type":"number","format":"float"},"totalYearDeposits":{"type":"number","format":"float"},"totalYearDepositNotional":{"type":"number","format":"float"},"totalDayWithdraws":{"type":"number","format":"float"},"totalMonthWithdraws":{"type":"number","format":"float"},"totalYearWithdraws":{"type":"number","format":"float"},"totalYearWithdrawNotional":{"type":"number","format":"float"}},"required":["omsId","accountId","productId","productSymbol"]}}},"paths":{"/GetAccountPositions":{"post":{"summary":"Retrieves a list of Positions (Balances) on a specific account.","operationId":"GetAccountPositions","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"AccountId":{"type":"integer"},"OMSId":{"type":"integer"},"IncludePending":{"type":"boolean"}}}}}},"responses":{"200":{"description":"A list of account positions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GetAccountPositionsResponse"}}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}}}}}}
```

## POST /GetAccountTrades

> Retrieves Trade History for a specific account.

```json
{"openapi":"3.0.3","info":{"title":"Trading API","version":"1.0.0"},"tags":[{"name":"User","description":"Endpoints related to user actions."}],"servers":[{"url":"https://apstage.proxy.kiiex.io/ap","description":"Staging Environment"},{"url":"https://alphaprod.proxy.kiiex.io/ap","description":"Production Environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"GetAccountTradesResponse":{"type":"object","properties":{"omsId":{"type":"integer"},"executionId":{"type":"integer"},"tradeId":{"type":"integer"},"orderId":{"type":"integer"},"accountId":{"type":"integer"},"subAccountId":{"type":"integer"},"clientOrderId":{"type":"integer"},"instrumentId":{"type":"integer"},"side":{"type":"integer"},"quantity":{"type":"number","format":"float"},"remainingQuantity":{"type":"number","format":"float"},"price":{"type":"number","format":"float"},"value":{"type":"number","format":"float"},"tradeTime":{"type":"integer","description":"POSIX timestamp in milliseconds"},"counterParty":{"type":"string","nullable":true},"orderTradeRevision":{"type":"integer"},"direction":{"type":"integer"},"isBlockTrade":{"type":"boolean"},"tradeTimeMS":{"type":"integer"},"fee":{"type":"number","format":"float"},"feeProductId":{"type":"integer"},"orderOriginator":{"type":"integer"}},"required":["omsId","executionId","tradeId","orderId","accountId","instrumentId"]}}},"paths":{"/GetAccountTrades":{"post":{"summary":"Retrieves Trade History for a specific account.","operationId":"GetAccountTrades","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"omsId":{"type":"integer"},"accountId":{"type":"integer"},"instrumentId":{"type":"integer"},"tradeId":{"type":"integer"},"orderId":{"type":"integer"},"userId":{"type":"integer"},"startTimestamp":{"type":"integer"},"endTimestamp":{"type":"integer"},"depth":{"type":"integer"},"startIndex":{"type":"integer"},"executionId":{"type":"integer"}}}}}},"responses":{"200":{"description":"A list of account trades","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GetAccountTradesResponse"}}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}}}}}}
```
