Skip to main content
POST
Close position

Authorizations

X-API-Key
string
header
required

API key generated at Dashboard, Settings, Developer. Format: doji_ak_...

X-API-Secret
string
header
required

API secret returned once at key creation. Format: doji_sk_...

Path Parameters

account_id
string<uuid>
required

UUID of the account. Must be owned by the authenticated user.

Body

application/json
symbol
string
required

Symbol of the position to close.

Example:

"BTC-USD"

quantity
number

Partial close quantity. Omit to close the full position.

kind
enum<string>

Order type for the closing order. Defaults to MARKET.

Available options:
MARKET,
LIMIT
price
number

Limit price (required if kind is LIMIT).

tif
string

Time-in-force for the closing order.

client_id
string

Deduplication ID. Safe to retry.

Response

Order result for the closing order.

order
object
trades
object[]
violations
object[]