Query Transaction History
The Query API (/consulta) allows you to search for past transactions based on date ranges, results, or specific identifiers. This is your primary tool for reconciliation and for “recovering” the status of operations if your server missed an asynchronous notification.
The Query Endpoint
- Test URL:
https://tpvpc-i.redsys.es:27443/TPV_PC/services/rest/tpvpcwss/v1/consulta - Production URL:
https://tpvpc.redsys.es/TPV_PC/services/rest/tpvpcwss/v1/consulta - Method:
POST
Search Criteria
To perform a search, you must send a signed JSON request. The specific fields you include determine the scope of the search.
Mandatory Fields
fechaInicio: Start date (Format:YYYY-MM-DD-HH.mm.ssorYYYY-MM-DD HH:mm:ss).fechaFin: End date. Note: The maximum range between start and end is 30 days.
Optional Filters
You can narrow your search using these fields:
pedido: The specific Order ID assigned by the system.factura: Your custom invoice reference.operacion: Filter by type (PAGO,PREAUTORIZACION,CONFIRMACION,DEVOLUCION).resultado: Filter by outcome (AUTORIZADA,DENEGADA).rts: The specific Transaction ID (RTS). If provided, this overrides other filters and returns only that specific operation.
Step 1: Send a Query Request
Here is an example request searching for authorized payments within a specific time window.
{
"info": {
"comercio": "777888991",
"timestamp": "20250428 111217",
"datosOperacion": {
"fechaInicio": "2025-03-03-16.00.01",
"fechaFin": "2025-03-04-16.35.09",
"operacion": "PAGO",
"resultado": "AUTORIZADA",
"factura": "FAC-LATENTE",
"pagina": 0
}
},
"signature": "YOUR_CALCULATED_SIGNATURE"
}Pagination: If your search returns many results, use the
paginafield (starting at0) to navigate through the result sets.
Step 2: Handle the Response
The response contains pagination metadata and a list of operaciones.
{
"info": {
"comercio": "777888991",
"resultadoConsulta": {
"numOperaciones": 1,
"numPagina": 0,
"totalPaginas": 1,
"operaciones": [
{
"tipoOper": "Autorizacion",
"tarjeta": "************7899",
"importe": "2.02",
"moneda": "978",
"pedido": "4894",
"fechaOperacion": "2025-05-05 16:10:56.0",
"factura": "FAC-LATENTE",
"estado": "F",
"resultado": "AUTORIZADA",
"codigoRespuesta": "0",
"numAutorizacion": "577498"
}
]
},
"resultado": {
"codigo": "0"
}
},
"signature": "SERVER_SIGNATURE"
}Interpreting Transaction Status
Inside the operaciones list, the estado field tells you the current lifecycle state of the transaction:
| Value | Meaning | Description |
|---|---|---|
F | Finalized | The operation completed successfully (Approved or Denied). |
P | In Process | The terminal is likely still waiting for user input. |
T | Technical Failure | An error occurred during processing. |
G | Denied | The bank rejected the transaction. |
A | Cancelled | The user or system cancelled the operation. |
Next Steps
- Debug Signature and Connectivity Issues: If your query returns “Firma Incorrecta”, ensure you are signing the exact JSON string sent.
- Totals and Reconciliation Endpoint: Learn how to get daily totals instead of individual transaction lists.