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

# Auth

> Autenticación y obtención de token JWT.

El módulo Auth permite autenticar usuarios partner y obtener el token JWT necesario para consumir endpoints protegidos.

## Login

```http theme={null}
POST /v2/auth/login
```

### Request

```json theme={null}
{
  "email": "partner@example.com",
  "password": "secret123"
}
```

### Response

```json theme={null}
{
  "success": true,
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Partner User",
    "email": "partner@example.com",
    "role": "tenant",
    "status": "ACTIVE",
    "completedOnboardingSteps": ["business_info", "bank_details"]
  },
  "message": "Login successful"
}
```

## Uso del Token

Incluye el token en cada request protegido:

```http theme={null}
Authorization: Bearer {accessToken}
```

## Errores Comunes

| Código | Causa                                                            |
| ------ | ---------------------------------------------------------------- |
| `400`  | Email o password con formato inválido.                           |
| `401`  | Credenciales inválidas o token expirado en endpoints protegidos. |
