Skip to main content

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

Send login and at least one editable field. Levels are absolute prices, not pips or distances. These prices are illustrative:
This example modifies a pending order. For positions, send only 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

  1. Verify the account. Use its broker token with the appropriate scope: POST:/api/v1/orders/*/modify or POST:/api/v1/positions/*/modify.
  2. Persist body, route and a new 16–128 character Idempotency-Key per intent. The API checks ticket ownership and enabled trading.
  3. Submit POST with Bearer and that key. Save answer.id or answer.ID. The response confirms submission, not final modification.
  4. Query GET /api/v1/trading/requests/{request_id}: 10009 confirms success; 10025 means no changes. Respect Retry-After while pending.
  5. 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.