latestOpenAPI 3.0.12026-08-16171142480.4 KB

ff1699330afa

Trading API

Close an account position or cancel a pending order

By default closes the position (works for both live positions and pending orders). Set pendingOnly=true to cancel the order ONLY if it is still a pending (unfilled) order; if it has already filled into a live position it is left untouched (safe no-op). Use this to safely cancel pending orders on expiry without risking closing a filled position.

delete/rest/api/v1/accounts/{accountId}/positions/{positionId}

Path parameters

accountIdstring uuid required
positionIdstring required

Query parameters

pendingOnlyboolean

If true, only cancel when the id is still a pending (unfilled) order; a live (filled) position is not closed (no-op).

Response

No Content