Close Position
Header Parameters
Bearer token issued for your trading account.
Optional UUID that makes a retry safe.
Path Parameters
Identifier of the position to close.
Body Parameters
Portion of the position to close, in lots, greater than 0. Omit it, or send no body, to close the position in full.
Response
No Content
error://trader-api/trading-validation-failed, error://trader-api/idempotency-key-invalid
Response Attributes
The request path with the actual identifiers filled in, without query parameters.
The HTTP status code, the same as the response status.
A stable identifier of the kind of error, in the form error://trader-api/{code}. Base your error handling on this field, not on title or detail.
error://trader-api/trading-validation-failederror://trader-api/idempotency-key-invalidA short, human-readable name of the error. Several types can share the same title.
A description of this particular occurrence. The wording can change, so never parse it or base logic on it.
Extra information as key-value pairs.
error://trader-api/unauthorized
Response Attributes
The request path with the actual identifiers filled in, without query parameters.
The HTTP status code, the same as the response status.
A stable identifier of the kind of error, in the form error://trader-api/{code}. Base your error handling on this field, not on title or detail.
error://trader-api/unauthorizedA short, human-readable name of the error. Several types can share the same title.
A description of this particular occurrence. The wording can change, so never parse it or base logic on it.
Extra information as key-value pairs.
error://trader-api/forbidden
Response Attributes
The request path with the actual identifiers filled in, without query parameters.
The HTTP status code, the same as the response status.
A stable identifier of the kind of error, in the form error://trader-api/{code}. Base your error handling on this field, not on title or detail.
error://trader-api/forbiddenA short, human-readable name of the error. Several types can share the same title.
A description of this particular occurrence. The wording can change, so never parse it or base logic on it.
Extra information as key-value pairs.
error://trader-api/position-not-found
Response Attributes
The request path with the actual identifiers filled in, without query parameters.
The HTTP status code, the same as the response status.
A stable identifier of the kind of error, in the form error://trader-api/{code}. Base your error handling on this field, not on title or detail.
error://trader-api/position-not-foundA short, human-readable name of the error. Several types can share the same title.
A description of this particular occurrence. The wording can change, so never parse it or base logic on it.
Extra information as key-value pairs.
error://trader-api/trading/not-allowed-to-trade, error://trader-api/trading-operation-failed, error://trader-api/idempotency-request-in-progress
Response Attributes
The request path with the actual identifiers filled in, without query parameters.
The HTTP status code, the same as the response status.
A stable identifier of the kind of error, in the form error://trader-api/{code}. Base your error handling on this field, not on title or detail.
error://trader-api/trading/not-allowed-to-tradeerror://trader-api/trading-operation-failederror://trader-api/idempotency-request-in-progressA short, human-readable name of the error. Several types can share the same title.
A description of this particular occurrence. The wording can change, so never parse it or base logic on it.
Extra information as key-value pairs.
error://trader-api/idempotency-key-reused
Response Attributes
The request path with the actual identifiers filled in, without query parameters.
The HTTP status code, the same as the response status.
A stable identifier of the kind of error, in the form error://trader-api/{code}. Base your error handling on this field, not on title or detail.
error://trader-api/idempotency-key-reusedA short, human-readable name of the error. Several types can share the same title.
A description of this particular occurrence. The wording can change, so never parse it or base logic on it.
Extra information as key-value pairs.
error://trader-api/idempotency-unavailable
Response Attributes
The request path with the actual identifiers filled in, without query parameters.
The HTTP status code, the same as the response status.
A stable identifier of the kind of error, in the form error://trader-api/{code}. Base your error handling on this field, not on title or detail.
error://trader-api/idempotency-unavailableA short, human-readable name of the error. Several types can share the same title.
A description of this particular occurrence. The wording can change, so never parse it or base logic on it.
Extra information as key-value pairs.