Skip to main content
Every opening and closing order requires Idempotency-Key: 16–128 characters using ASCII letters, numbers, periods, underscores, colons, or hyphens. A UUID meets the format. The key belongs to your token and one intent; use a different key for each opening and closing order, even when they share an account and symbol.

Before submitting

Persist the intent, route, full body, and key. Do not generate a new key for every HTTP attempt. A retry of the same intent keeps the same route, key, and data, including price and comment.

Responses when reusing a key

Permissions and account authorization are also checked when repeating a request. A stored response is the submission response, not final execution confirmation.

Timeout, disconnection, or error after submission

  1. Stop automatic POST retries and mark the intent as uncertain.
  2. If you know the MT5 ID, query its result.
  3. Query account positions and orders to reconcile the state.
  4. Keep the key, exact body, UTC time, and identifiers for support.
  5. If you cannot confirm the result, request a provider review before creating a new intent that could duplicate the previous one.
An HTTP 5xx response does not prove that MT5 did not receive the request. A reservation can remain pending after an error, including during closing validation. The partner API does not expose recovery by key, reservation cancellation, or manual unlocking. Elapsed time does not mean it is safe to resubmit with another key. Do not assume repeating the POST will update the price: changing it alters the intent and can produce a conflict. Resolve the previous trade before preparing another one. Pending orders also require a key. For automatic market pricing, the intent stores the submitted body without changing quotes; a completed retry does not query or submit again. Do not switch between explicit and automatic mode with the same key.