Close position by units
Rate limit: 20 requests per 60 seconds. This is a shared quota — the same budget is consumed by a group of related endpoints, so calling any of them reduces what is left for the others (you cannot call each at the full rate independently). Endpoints sharing this quota:
DELETE /api/v1/trading/execution/limit-orders/{orderId}DELETE /api/v1/trading/execution/market-close-orders/{orderId}DELETE /api/v1/trading/execution/market-open-orders/{orderId}DELETE /api/v2/trading/execution/orders/{orderId}POST /api/v1/trading/execution/limit-ordersPOST /api/v1/trading/execution/market-open-orders/by-amountPOST /api/v1/trading/execution/market-open-orders/by-unitsPOST /api/v2/trading/execution/orders
This endpoint allows traders to close an entire position or a portion of it at the current market rate. If UnitsToDeduct is provided, only the specified portion will be closed. If UnitsToDeduct is omitted or set to null, the full position will be closed. A 200 response means the close order was submitted, not that the position was closed. Confirm the outcome with GET /api/v1/trading/info/real/close-orders/, using the orderID returned under orderForClose.
Authorizations
API key of the application. Only valid together with the x-user-key header — the pair is an alternative to OAuth bearer authentication, never sent alongside it. The pair is granted the same permissions the operation's OAuth scopes describe.
Demo credential for trying the API from these docs: lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663
User-specific authentication key. Only valid together with the x-api-key header — the pair is an alternative to OAuth bearer authentication, never sent alongside it.
Demo credential for trying the API from these docs: eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_
Headers
A unique request identifier.
"832adb2b-8dfa-4fb8-bc77-9503fd6708bf"
Path Parameters
The unique identifier of the position to close.