Developer Portal

Close PositionPATCH

Creates a market order to close an existing position (partial or full closing supported)

View as Markdown
PATCH
/accounts/{account_id}/positions/{position_id}

Authorization

AuthorizationRequiredBearer <token>

JWT token obtained from the login endpoint

In: header

Path Parameters

account_idRequiredstring

The account ID where position to close belongs

position_idRequiredstring

Position ID to close

Query Parameters

qtyRequirednumber

Quantity to close (in lots). Use position's full qty to close completely.

Minimum: 0.01Format: "double"
curl -X PATCH "http://localhost:8081/api/v1/accounts/<string>/positions/pos_123456?qty=1" \
  -H "Authorization: Bearer <token>"

Position close order created successfully

{
  "order_id": "ord_close_123456"
}