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

# Primeros pasos

> Comprueba la conexión y verifica una cuenta desde tu backend.

Necesitas el token del proveedor, el login MT5 del cliente y su contraseña maestra,
con autorización para verificar la cuenta. Los valores de ejemplo son ficticios.

## 1. Configura la URL y el token

Los ejemplos cURL utilizan `API_BASE` y `MT5_API_TOKEN`. Carga el token desde el gestor
de secretos de tu backend; no lo incluyas en el repositorio.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export API_BASE="https://api-trading.vexprofx.com"
# MT5_API_TOKEN debe estar definido en el entorno seguro de tu backend.
```

## 2. Comprueba disponibilidad

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --fail-with-body "$API_BASE/health/live"
curl --fail-with-body "$API_BASE/health/ready" \
  -H "Authorization: Bearer $MT5_API_TOKEN"
```

La primera consulta devuelve `{"status":"ok"}`. La segunda comprueba la conexión con
MT5 y requiere permiso específico. Si falla, resuelve [el error](/es/errors) antes de continuar.

## 3. Verifica la cuenta

Este ejemplo Python solicita la contraseña sin mostrarla ni dejarla como argumento
del comando. Requiere `httpx` (`python -m pip install httpx`).

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import getpass
import os
import httpx

login = int(input("Login MT5: "))
with httpx.Client(
    base_url="https://api-trading.vexprofx.com",
    headers={"Authorization": "Bearer " + os.environ["MT5_API_TOKEN"]},
    timeout=30.0,
) as client:
    password = getpass.getpass("Contraseña maestra: ")
    response = client.post(
        f"/api/v1/accounts/{login}/verify", json={"password": password}
    )
    del password
    response.raise_for_status()
    verification = response.json()
    if not (verification.get("valid") is True and verification.get("verified") is True):
        raise RuntimeError("La cuenta no quedó verificada")
    print("Verificación vigente hasta:", verification["expires_at"])
    account = client.get(f"/api/v1/accounts/{login}")
    account.raise_for_status()
    print("Consulta de cuenta completada")
```

No registres el cuerpo de la petición de verificación. La contraseña de inversor
no sirve para este proceso. [Consulta las respuestas y la expiración](/es/accounts-passwords).

## 4. Consulta antes de operar

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --fail-with-body "$API_BASE/api/v1/account-verifications" \
  -H "Authorization: Bearer $MT5_API_TOKEN"
curl --fail-with-body "$API_BASE/api/v1/accounts/123456/positions?offset=0&total=100" \
  -H "Authorization: Bearer $MT5_API_TOKEN"
curl --fail-with-body "$API_BASE/api/v1/market/ticks?symbols=EURUSD&trans_id=0" \
  -H "Authorization: Bearer $MT5_API_TOKEN"
```

Reemplaza `123456` por el login verificado y `EURUSD` por el símbolo de tu broker.
Para enviar una operación continúa con [el flujo de trading](/es/trading/overview).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.