Choose endpoint and ticket
Never use a request ID or deal ID as the ticket. Modification does not change
volume, symbol, direction or expiration. Position entry price is unchanged;
use
/close to reduce position volume.
Request body
Sendlogin and at least one editable field. Levels are absolute prices, not pips
or distances. These prices are illustrative:
login and sl
and/or tp, for example {"login":104205,"tp":1.12}.
For stop-limit,
price triggers the order and stop_limit_price sets the subsequent
limit price. Retained stops must remain valid after an entry change; correct them
in the same body if needed. Precision, tick size, minimum distances and freeze
levels are checked. MT5 makes the final acceptance decision.
Submit and confirm
- Verify the account. Use its broker token with the appropriate scope:
POST:/api/v1/orders/*/modifyorPOST:/api/v1/positions/*/modify. - Persist body, route and a new 16–128 character
Idempotency-Keyper intent. The API checks ticket ownership and enabled trading. - Submit POST with Bearer and that key. Save
answer.idoranswer.ID. The response confirms submission, not final modification. - Query
GET /api/v1/trading/requests/{request_id}:10009confirms success;10025means no changes. RespectRetry-Afterwhile pending. - Read orders or positions for current levels. Stored results are historical and do not fetch the current position.
summary.operation is modify_order or modify_position. Serialize dependent
changes to the same ticket. If a pending order fills first, modification may
fail; its resulting position is not modified. After a timeout, reuse the same
key and body. Never use a new key for an uncertain intent; reconcile the account first.
Python client, using already persisted keys:
Migration from /stops
Position modification now uses /modify; /stops no longer accepts requests.
Update the URL, scope and Python helper (modify_position). Old explicit scopes
are not automatically expanded. Historical result queries remain available and
may retain operation=modify_stops.