Developer Portal

Amend PositionPATCH

Modifies multi-level take profit and stop loss orders for an existing position

View as Markdown
PATCH
/accounts/{account_id}/positions/{position_id}/amend

Authorization

AuthorizationRequiredBearer <token>

JWT token obtained from the login endpoint

In: header

Request Body

application/jsonRequired
position_idstring

Position ID to amend (required for WebSocket, extracted from URL for HTTP)

tp_levelsarray<object>

Multi-level take profit configuration. Omit for no changes, empty array [] to cancel all, or provide levels to create/modify

sl_levelsarray<object>

Multi-level stop loss configuration. Omit for no changes, empty array [] to cancel all, or provide levels to create/modify

Path Parameters

account_idRequiredstring

The account ID where position to amend belongs

position_idRequiredstring

Position ID to amend

curl -X PATCH "http://localhost:8081/api/v1/accounts/<string>/positions/pos_123456/amend" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "tp_levels": [
      {
        "price": 1.087,
        "qty": 0.75
      },
      {
        "price": 1.088,
        "qty": 0.75
      }
    ]
  }'

Position amended successfully

{
  "message": "order was cancelled successfully",
  "operation_id": "orderCancelled"
}