Skip to main content

REST API History - Get orders for closed positions

Get orders for closed positions

Written by Albert
Updated today

Get orders for closed positions

POST /frontoffice/api/v4/orders/closed-positions

Summary

Use this method to retrieve orders associated with closed positions within specified date ranges and market filters.

Request

Header parameters

accountId required

The trading account identifier.

Body

createdAtFrom string · date-time | nullable

The start date of the period when the positions were opened.

createdAtTo string · date-time | nullable

The end date of the period when the positions were opened.

closedAtFrom string · date-time | nullable

The start date of the period when the positions were closed.

closedAtTo string · date-time | nullable

The end date of the period when the positions were closed.

marketId string | nullable

The market identifier, in the following format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: cfd.eth_eur.

marketType string | nullable

The market type.

Possible values:

  • Cfd

  • Perp

limit integer · int32 | nullable

The maximum number of items to return.

lastOrderId string | nullable

The identifier of the final order to be returned.

Request example

POST /frontoffice/api/v4/orders/closed-positions HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*

{
"limit": 2,
"createdAtFrom": "2025-08-01T12:00:32.886Z",
"createdAtTo": "2025-08-15T12:00:32.886Z"
}

Response

In case of success, an object will be returned.

Each object contains the following information:

marketId string

The market identifier.

marketFullName string | nullable

The market full name or description (optional).

marketDisplayName string | nullable

The market ticker.

marketType string

The market type.

Possible values:

  • Cfd

  • Perp

orderId string

The order identifier.

orderType string

The order type.

Possible values:

  • Market

  • Limit

timeInForce string

The time-in-force setting of the order.

Possible values:

  • Gtc

  • Ioc

  • Fok

  • Gtd

  • Day

side string

The order side.

Possible values:

  • Buy

  • Sell

positionCloseLotAmount decimal string

The position amount closed by the order, in lots.

reason string

The reason for placing the order.

Possible values:

  • Trader

  • StopOut

  • MarketHalted

  • MarketDisabled

  • TakeProfit

  • StopLoss

  • Admin

realizedPnlInRAT decimal string

The realized PnL, in conversion to RAT.

closedAt string · date-time | nullable

The date and time when the position was closed.

positionId string

The position identifier.

openPrice decimal string

The volume-weighted average price (VWAP) at which the position was opened.

closePrice decimal string

The volume-weighted average price (VWAP) of trades related to a position-closing order.

positionPriceInRAT decimal string

The position price, in conversion to RAT.

rateToRAT decimal string

The conversion rate to RAT.

openedAt string · date-time

The date and time when the position was opened.

isExceeded boolean

Indicates whether the number of returned items reached the response limit and more data is available.

Response example — 200: OK

{
"data": [
{
"marketId": "cfd.eth_eur",
"marketFullName": null,
"marketDisplayName": "CFD ETH/EUR",
"marketType": "Cfd",
"orderId": "01K2PNGX50SR1FRE6P14PJC17E",
"orderType": "Market",
"timeInForce": "Ioc",
"side": "Sell",
"positionCloseLotAmount": "15",
"reason": "Trader",
"realizedPnlInRAT": "-144.64",
"closedAt": "2025-08-15T10:48:32.393Z",
"positionId": "01K2PMXY63HESK110WT1CHMAFA",
"openPrice": "4333.69288",
"closePrice": "3370.58389",
"positionPriceInRAT": "50558.75",
"rateToRAT": "1",
"openedAt": "2025-08-15T10:38:10.628Z"
},
{
"marketId": "perp.eth_usdt",
"marketFullName": "ETH/USDT_4s8hKqiPXmXOEhsO1J6W",
"marketDisplayName": "ETH/USDT_jC6Im5PxwgZLrwyccRcI",
"marketType": "Perpetual",
"orderId": "01K2PNG3N6NKAJVV4RV5E2V0HK",
"orderType": "Market",
"timeInForce": "Ioc",
"side": "Sell",
"positionCloseLotAmount": "0.5",
"reason": "Trader",
"realizedPnlInRAT": "13.42",
"closedAt": "2025-08-15T10:48:06.234Z",
"positionId": "01K2PMT0VMJG5B8XBDNZ7FNM1F",
"openPrice": "4603.1607",
"closePrice": "4634.3915",
"positionPriceInRAT": "1992.78",
"rateToRAT": "0.86",
"openedAt": "2025-08-15T10:36:02.293Z"
}
],
"isExceeded": true
}


Did this answer your question?