Before submitting
Check availability, permissions, active verification, and that the provider has enabled trading. Query existing positions and orders, and retrieve a tick for the symbol. Confirm volume units and restrictions with the provider.Sequence
- Define the intent: account, symbol, direction, and volume.
- For market orders, omit price and digits to resolve them automatically. For pending orders, provide the target price.
- Store the exact body and an idempotency key before submission.
- Submit the opening order and keep
answer.idoranswer.ID. - Query the result with the same token and reconcile the account.
- Identify the actual ticket of the position you want to close.
- Submit the closing order in the opposite direction with a new key.
- Confirm the closing result and the reduction or disappearance of the position.
- Revoke verification when authorization ends and you no longer need access.
Distinguish these identifiers
An intent may require several HTTP queries, each with its own
X-Request-ID.
None of these tracking identifiers replaces the position ticket.
For netting accounts or concurrent trades, do not associate a position with your
request solely because it has the same symbol. Reconcile the broker result,
available identifiers, and the account’s state before and after the trade.
Pending orders: limit, stop, and stop-limit.