Skip to content
Get started

Positions

View positions and manage position instructions.

Get Positions
client.V1.Positions.GetPositions(ctx, accountID, query) (*V1PositionGetPositionsResponse, error)
GET/v1/accounts/{account_id}/positions
Close Positions
client.V1.Positions.ClosePositions(ctx, accountID, body) (*V1PositionClosePositionsResponse, error)
DELETE/v1/accounts/{account_id}/positions
Close Position
client.V1.Positions.ClosePosition(ctx, instrumentID, params) (*V1PositionClosePositionResponse, error)
DELETE/v1/accounts/{account_id}/positions/{instrument_id}
List Position Instructions
client.V1.Positions.GetPositionInstructions(ctx, accountID, query) (*V1PositionGetPositionInstructionsResponse, error)
GET/v1/accounts/{account_id}/positions/instructions
Submit Position Instructions
client.V1.Positions.SubmitPositionInstructions(ctx, accountID, body) (*V1PositionSubmitPositionInstructionsResponse, error)
POST/v1/accounts/{account_id}/positions/instructions
Cancel Position Instruction
client.V1.Positions.CancelPositionInstruction(ctx, instructionID, body) (*V1PositionCancelPositionInstructionResponse, error)
DELETE/v1/accounts/{account_id}/positions/instructions/{instruction_id}
ModelsExpand Collapse
type Position struct{…}

Represents a holding of a particular instrument in an account

AccountID int64

The account this position belongs to

formatint64
AvailableQuantity string

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

InstrumentID string

OEMS instrument UUID

formatuuid
InstrumentType SecurityType

Type of security

One of the following:
const SecurityTypeCommonStock SecurityType = "COMMON_STOCK"
const SecurityTypePreferredStock SecurityType = "PREFERRED_STOCK"
const SecurityTypeOption SecurityType = "OPTION"
const SecurityTypeCash SecurityType = "CASH"
const SecurityTypeOther SecurityType = "OTHER"
MarketValue string

The current market value of the position

PositionType PositionType

The type of position

One of the following:
const PositionTypeLong PositionType = "LONG"
const PositionTypeShort PositionType = "SHORT"
const PositionTypeLongCall PositionType = "LONG_CALL"
const PositionTypeShortCall PositionType = "SHORT_CALL"
const PositionTypeLongPut PositionType = "LONG_PUT"
const PositionTypeShortPut PositionType = "SHORT_PUT"
Quantity string

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

Symbol string

The trading symbol for the instrument

AvgPrice stringOptional

The average price paid per share or contract for this position

ClosingPrice stringOptional

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

ClosingPriceDate TimeOptional

The market date associated with closing_price

formatdate
CostBasis stringOptional

The total cost basis for this position

DailyUnrealizedPnl stringOptional

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

DailyUnrealizedPnlPct stringOptional

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

InstrumentPrice stringOptional

The current market price of the instrument

UnderlyingInstrumentID stringOptional

OEMS instrument identifier of the underlying instrument, if resolvable

formatuuid
UnrealizedPnl stringOptional

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

UnrealizedPnlPct stringOptional

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

type PositionInstruction struct{…}

A position instruction and its current lifecycle state.

ID string

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

formatuuid
AccountID int64

Account the instruction belongs to.

formatint64
InstructionID string

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

InstructionType PositionInstructionType

The action this instruction requests.

One of the following:
const PositionInstructionTypeExercise PositionInstructionType = "EXERCISE"
const PositionInstructionTypeDoNotExercise PositionInstructionType = "DO_NOT_EXERCISE"
const PositionInstructionTypeContraryExercise PositionInstructionType = "CONTRARY_EXERCISE"
InstrumentID string

Identifier of the options contract this instruction acts on.

formatuuid
Quantity string

Number of contracts included in the instruction.

Current lifecycle status.

One of the following:
const PositionInstructionStatusSent PositionInstructionStatus = "SENT"
const PositionInstructionStatusAccepted PositionInstructionStatus = "ACCEPTED"
const PositionInstructionStatusRejected PositionInstructionStatus = "REJECTED"
const PositionInstructionStatusEngineRejected PositionInstructionStatus = "ENGINE_REJECTED"
const PositionInstructionStatusCancelRequested PositionInstructionStatus = "CANCEL_REQUESTED"
const PositionInstructionStatusCancelled PositionInstructionStatus = "CANCELLED"
const PositionInstructionStatusCancelFailed PositionInstructionStatus = "CANCEL_FAILED"
const PositionInstructionStatusUnknown PositionInstructionStatus = "UNKNOWN"
Symbol string

Options symbol (OSI) for display.

AcceptedQuantity stringOptional

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

CreatedAt TimeOptional

When the instruction was first accepted by the service.

formatdate-time
RejectionReason stringOptional

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.

UpdatedAt TimeOptional

When the instruction’s lifecycle state last changed.

formatdate-time
type PositionInstructionList []PositionInstruction
ID string

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

formatuuid
AccountID int64

Account the instruction belongs to.

formatint64
InstructionID string

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

InstructionType PositionInstructionType

The action this instruction requests.

One of the following:
const PositionInstructionTypeExercise PositionInstructionType = "EXERCISE"
const PositionInstructionTypeDoNotExercise PositionInstructionType = "DO_NOT_EXERCISE"
const PositionInstructionTypeContraryExercise PositionInstructionType = "CONTRARY_EXERCISE"
InstrumentID string

Identifier of the options contract this instruction acts on.

formatuuid
Quantity string

Number of contracts included in the instruction.

Current lifecycle status.

One of the following:
const PositionInstructionStatusSent PositionInstructionStatus = "SENT"
const PositionInstructionStatusAccepted PositionInstructionStatus = "ACCEPTED"
const PositionInstructionStatusRejected PositionInstructionStatus = "REJECTED"
const PositionInstructionStatusEngineRejected PositionInstructionStatus = "ENGINE_REJECTED"
const PositionInstructionStatusCancelRequested PositionInstructionStatus = "CANCEL_REQUESTED"
const PositionInstructionStatusCancelled PositionInstructionStatus = "CANCELLED"
const PositionInstructionStatusCancelFailed PositionInstructionStatus = "CANCEL_FAILED"
const PositionInstructionStatusUnknown PositionInstructionStatus = "UNKNOWN"
Symbol string

Options symbol (OSI) for display.

AcceptedQuantity stringOptional

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

CreatedAt TimeOptional

When the instruction was first accepted by the service.

formatdate-time
RejectionReason stringOptional

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.

UpdatedAt TimeOptional

When the instruction’s lifecycle state last changed.

formatdate-time
type PositionInstructionStatus string

Lifecycle status of a position instruction.

One of the following:
const PositionInstructionStatusSent PositionInstructionStatus = "SENT"
const PositionInstructionStatusAccepted PositionInstructionStatus = "ACCEPTED"
const PositionInstructionStatusRejected PositionInstructionStatus = "REJECTED"
const PositionInstructionStatusEngineRejected PositionInstructionStatus = "ENGINE_REJECTED"
const PositionInstructionStatusCancelRequested PositionInstructionStatus = "CANCEL_REQUESTED"
const PositionInstructionStatusCancelled PositionInstructionStatus = "CANCELLED"
const PositionInstructionStatusCancelFailed PositionInstructionStatus = "CANCEL_FAILED"
const PositionInstructionStatusUnknown PositionInstructionStatus = "UNKNOWN"
type PositionInstructionType string

The action to take against an options position.

One of the following:
const PositionInstructionTypeExercise PositionInstructionType = "EXERCISE"
const PositionInstructionTypeDoNotExercise PositionInstructionType = "DO_NOT_EXERCISE"
const PositionInstructionTypeContraryExercise PositionInstructionType = "CONTRARY_EXERCISE"
type PositionList []Position
AccountID int64

The account this position belongs to

formatint64
AvailableQuantity string

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

InstrumentID string

OEMS instrument UUID

formatuuid
InstrumentType SecurityType

Type of security

One of the following:
const SecurityTypeCommonStock SecurityType = "COMMON_STOCK"
const SecurityTypePreferredStock SecurityType = "PREFERRED_STOCK"
const SecurityTypeOption SecurityType = "OPTION"
const SecurityTypeCash SecurityType = "CASH"
const SecurityTypeOther SecurityType = "OTHER"
MarketValue string

The current market value of the position

PositionType PositionType

The type of position

One of the following:
const PositionTypeLong PositionType = "LONG"
const PositionTypeShort PositionType = "SHORT"
const PositionTypeLongCall PositionType = "LONG_CALL"
const PositionTypeShortCall PositionType = "SHORT_CALL"
const PositionTypeLongPut PositionType = "LONG_PUT"
const PositionTypeShortPut PositionType = "SHORT_PUT"
Quantity string

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

Symbol string

The trading symbol for the instrument

AvgPrice stringOptional

The average price paid per share or contract for this position

ClosingPrice stringOptional

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

ClosingPriceDate TimeOptional

The market date associated with closing_price

formatdate
CostBasis stringOptional

The total cost basis for this position

DailyUnrealizedPnl stringOptional

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

DailyUnrealizedPnlPct stringOptional

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

InstrumentPrice stringOptional

The current market price of the instrument

UnderlyingInstrumentID stringOptional

OEMS instrument identifier of the underlying instrument, if resolvable

formatuuid
UnrealizedPnl stringOptional

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

UnrealizedPnlPct stringOptional

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

type PositionType string

Position type classification

One of the following:
const PositionTypeLong PositionType = "LONG"
const PositionTypeShort PositionType = "SHORT"
const PositionTypeLongCall PositionType = "LONG_CALL"
const PositionTypeShortCall PositionType = "SHORT_CALL"
const PositionTypeLongPut PositionType = "LONG_PUT"
const PositionTypeShortPut PositionType = "SHORT_PUT"