> ## Documentation Index
> Fetch the complete documentation index at: https://api-trading-docs.vexprofx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Trading workflow

> The complete sequence from an authorized account to a confirmed result.

## 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

1. Define the intent: account, symbol, direction, and volume.
2. For market orders, omit price and digits to resolve them automatically. For pending orders, provide the target price.
3. Store the exact body and an idempotency key before submission.
4. [Submit the opening order](/trading/orders) and keep `answer.id` or `answer.ID`.
5. [Query the result](/trading/results) with the same token and reconcile the account.
6. Identify the actual ticket of the position you want to close.
7. [Submit the closing order](/trading/close) in the opposite direction with a new key.
8. Confirm the closing result and the reduction or disappearance of the position.
9. Revoke verification when authorization ends and you no longer need access.

## Distinguish these identifiers

| Identifier | Source | Usage |
| - | - | - |
| `login` | Customer's MT5 account | Verify, query, and trade on that account |
| `Idempotency-Key` | Generated by your backend | Identify a single opening or closing intent |
| `answer.id` / `answer.ID` | Submission response | Query the MT5 request result |
| `Position` | Position query | Select the position to close |
| `X-Request-ID` | HTTP header | Diagnose that HTTP request |
| `X-Audit-ID` | HTTP header, when available | Audit reference for support |

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](/trading/pending).
