Skip to content
Get started

Positions

View positions and manage position instructions.

Get Positions
PositionGetPositionsResponse v1().positions().getPositions(PositionGetPositionsParamsparams = PositionGetPositionsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/accounts/{account_id}/positions
Close Positions
PositionClosePositionsResponse v1().positions().closePositions(PositionClosePositionsParamsparams = PositionClosePositionsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
DELETE/v1/accounts/{account_id}/positions
Close Position
PositionClosePositionResponse v1().positions().closePosition(PositionClosePositionParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
DELETE/v1/accounts/{account_id}/positions/{instrument_id}
List Position Instructions
PositionGetPositionInstructionsResponse v1().positions().getPositionInstructions(PositionGetPositionInstructionsParamsparams = PositionGetPositionInstructionsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/accounts/{account_id}/positions/instructions
Submit Position Instructions
PositionSubmitPositionInstructionsResponse v1().positions().submitPositionInstructions(PositionSubmitPositionInstructionsParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/accounts/{account_id}/positions/instructions
Cancel Position Instruction
PositionCancelPositionInstructionResponse v1().positions().cancelPositionInstruction(PositionCancelPositionInstructionParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
DELETE/v1/accounts/{account_id}/positions/instructions/{instruction_id}
ModelsExpand Collapse
class Position:

Represents a holding of a particular instrument in an account

long accountId

The account this position belongs to

formatint64
String availableQuantity

The quantity of a position that is free to be operated on.

String instrumentId

OEMS instrument UUID

formatuuid
SecurityType instrumentType

Type of security

One of the following:
COMMON_STOCK("COMMON_STOCK")
PREFERRED_STOCK("PREFERRED_STOCK")
OPTION("OPTION")
CASH("CASH")
OTHER("OTHER")
String marketValue

The current market value of the position

PositionType positionType

The type of position

One of the following:
LONG("LONG")
SHORT("SHORT")
LONG_CALL("LONG_CALL")
SHORT_CALL("SHORT_CALL")
LONG_PUT("LONG_PUT")
SHORT_PUT("SHORT_PUT")
String quantity

The number of shares or contracts. Can be positive (long) or negative (short)

String symbol

The trading symbol for the instrument

Optional<String> avgPrice

The average price paid per share or contract for this position

Optional<String> closingPrice

The closing price used to value the position for the last trading day

Optional<LocalDate> closingPriceDate

The market date associated with closing_price

formatdate
Optional<String> costBasis

The total cost basis for this position

Optional<String> dailyUnrealizedPnl

The unrealized profit or loss for this position relative to the previous close

Optional<String> dailyUnrealizedPnlPct

The unrealized profit/loss for the position for the current day, expressed as a percentage of the baseline value (range: 0-100).

Optional<String> instrumentPrice

The current market price of the instrument

Optional<String> underlyingInstrumentId

OEMS instrument identifier of the underlying instrument, if resolvable

formatuuid
Optional<String> unrealizedPnl

The total unrealized profit or loss for this position based on current market value

Optional<String> unrealizedPnlPct

The unrealized profit/loss for the position, expressed as a percentage of the position’s cost basis (range: 0-100).

class PositionInstruction:

A position instruction and its current lifecycle state.

String id

Server-assigned id. Used as the path parameter on cancel.

formatuuid
long accountId

Account the instruction belongs to.

formatint64
String instructionId

Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied.

PositionInstructionType instructionType

The action this instruction requests.

One of the following:
EXERCISE("EXERCISE")
DO_NOT_EXERCISE("DO_NOT_EXERCISE")
CONTRARY_EXERCISE("CONTRARY_EXERCISE")
String instrumentId

Identifier of the options contract this instruction acts on.

formatuuid
String quantity

Number of contracts included in the instruction.

Current lifecycle status.

One of the following:
SENT("SENT")
ACCEPTED("ACCEPTED")
REJECTED("REJECTED")
ENGINE_REJECTED("ENGINE_REJECTED")
CANCEL_REQUESTED("CANCEL_REQUESTED")
CANCELLED("CANCELLED")
CANCEL_FAILED("CANCEL_FAILED")
UNKNOWN("UNKNOWN")
String symbol

Options symbol (OSI) for display.

Optional<String> acceptedQuantity

Number of contracts accepted by the clearing venue. Populated once the instruction reaches ACCEPTED.

Optional<LocalDateTime> createdAt

When the instruction was first accepted by the service.

formatdate-time
Optional<String> rejectionReason

Human-readable explanation populated on any non-success terminal status — REJECTED, ENGINE_REJECTED, or CANCEL_FAILED. On a 207 Multi-Status batch submit the top-level error field summarizes the batch; per-row detail continues to live here.

Optional<LocalDateTime> updatedAt

When the instruction’s lifecycle state last changed.

formatdate-time
enum PositionInstructionStatus:

Lifecycle status of a position instruction.

SENT("SENT")
ACCEPTED("ACCEPTED")
REJECTED("REJECTED")
ENGINE_REJECTED("ENGINE_REJECTED")
CANCEL_REQUESTED("CANCEL_REQUESTED")
CANCELLED("CANCELLED")
CANCEL_FAILED("CANCEL_FAILED")
UNKNOWN("UNKNOWN")
enum PositionInstructionType:

The action to take against an options position.

EXERCISE("EXERCISE")
DO_NOT_EXERCISE("DO_NOT_EXERCISE")
CONTRARY_EXERCISE("CONTRARY_EXERCISE")
enum PositionType:

Position type classification

LONG("LONG")
SHORT("SHORT")
LONG_CALL("LONG_CALL")
SHORT_CALL("SHORT_CALL")
LONG_PUT("LONG_PUT")
SHORT_PUT("SHORT_PUT")