Skip to main content
POST
/
api
/
v4
/
collateral-account
/
position
/
close
Close Position
curl --request POST \
  --url https://whitebit.com/api/v4/collateral-account/position/close \
  --header 'Content-Type: application/json' \
  --header 'X-TXC-APIKEY: <api-key>' \
  --data '
{
  "positionId": 123,
  "positionSide": "LONG",
  "market": "BTC_USDT",
  "request": "{{request}}",
  "nonce": "{{nonce}}"
}
'
{
  "code": 30,
  "message": "Validation failed",
  "errors": {}
}

Authorizations

X-TXC-APIKEY
string
header
required

API Key authentication for private endpoints.

Required headers:

  • X-TXC-APIKEY: API key
  • X-TXC-PAYLOAD: Base64 encoded JSON payload
  • X-TXC-SIGNATURE: HMAC SHA512 signature

Body

application/json
positionId
integer
required
Example:

123

market
string
required
Example:

"BTC_USDT"

request
string
required
Example:

"{{request}}"

nonce
string
required
Example:

"{{nonce}}"

positionSide
enum<string>
Available options:
LONG,
SHORT,
BOTH
Example:

"LONG"

Response

Position closed