Skip to main content
POST
TypeScript

Authorizations

Authorization
string
header
required

The Trading API key (trdrs_sk_…), for market data, orders and account state on the accounts its owner holds. Use it server-to-server, and keep it on your server. Its scope is named trading in the API.

Query Parameters

provider
string

The provider the account is at. Omit it to use your default provider.

account
string

The account number at that provider. It must be one of your own accounts.

Body

application/json

The position to reverse.

instrument
string
required

The instrument.

clientOrderId
string
required

Your own id for this reverse, and its idempotency key.

Response

The position is reversed. The response gives how many working orders were cancelled.

The order that reversed the position.

providerOrderId
string
required

The order id at the provider.

filledQty
number | null
required

How much filled, or null when it isn't known.

avgFillPrice
number | null
required

The average fill price, or null when it isn't known.

cancelledOrders
number
required

How many working orders on the instrument were cancelled first.

side
enum<string>
required

The side of the reversing order.

Available options:
buy,
sell
qty
number
required

The quantity of the reversing order.