# Totals and Reconciliation Endpoint

This reference details the `/totales` endpoint, used to retrieve aggregated session data for reconciliation purposes.

## Endpoint Details

* **URL (Test):** `https://tpvpc-i.redsys.es:27443/TPV_PC/services/rest/tpvpcwss/v1/totales`  
* **URL (Prod):** `https://tpvpc.redsys.es/TPV_PC/services/rest/tpvpcwss/v1/totales`  
* **Method:** `POST`

## Request Parameters (`datosOperacion`)

| Field | Type | Required | Description |
| :---- | :---- | :---- | :---- |
| `fecha` | String | Yes | Date to retrieve (`YYYY-MM-DD`). |
| `desgloseMarca` | Boolean | No | If `true`, provides breakdown by Card Brand. |
| `desgloseVM` | Boolean | No | If `true`, provides breakdown by Visa/Mastercard. |

## Response Structure (`totales`)

The response contains aggregated sums for each operation type.

### Top-Level Fields

| Field | Type | Description |
| :--- | :--- | :--- |
| `moneda` | String | Currency code (e.g., `978` for EUR). |
| `total_neto` | String | Net total of all operations. |
| `Autorizaciones` | Object | Aggregates for Sales ( `/pago` ). |
| `Devoluciones` | Object | Aggregates for Refunds. |
| `PreAutorizaciones` | Object | Aggregates for Pre-auths. |
| `Confirmaciones` | Object | Aggregates for Confirmations. |

### Operation Aggregate Object

Each operation object (e.g., `Autorizaciones`) contains:

| Field | Description |
| :--- | :--- |
| `autorizadas` | Count of successful operations. |
| `denegadas` | Count of denied operations. |
| `importe_autorizadas` | Total value of successful operations. |
| `Marcas` | (Optional) Object containing breakdown by brand if requested. |