v1

latestOpenAPI 3.0.12026-07-2683220192.3 KB
Orders

Close Position Order

Create an order to close an existing position in a market. This will sell all contracts held in the specified market.

post/v1/order/close-position

Request body

marketSlugstring required

Market slug of the position to close

manualOrderIndicator'MANUAL_ORDER_INDICATOR_MANUAL' | 'MANUAL_ORDER_INDICATOR_AUTOMATED'

ManualOrderIndicator designates the manual or automated nature of an order.

synchronousExecutionboolean

If true, will block until the order is filled, rejected, canceled, or expired, up to maxBlockTime seconds

maxBlockTimestring int64

Maximum block time in seconds if synchronous execution is requested

Example request

{
  "slippageTolerance": {
    "currentPrice": {
      "value": "123.45"
    }
  }
}

Response

Position order closed successfully

idstring

Exchange-assigned order ID for the close position order