> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/es/implement-nfc-wallet/make-payments/get-transaction-history.md).

# Obtener historial de transacciones

## Resumen

Con el historial de transacciones, su aplicación de billetera digital puede admitir:

* Notificaciones de transacciones
* Actualización del historial de transacciones

{% hint style="warning" %}
Durante la incorporación, confirme que el historial de transacciones esté habilitado para su programa.
{% endhint %}

## Integración del SDK

### Notificación de transacción

Para admitir notificaciones de transacciones, procese **notificaciones TNS (transacciones)** como se describe en [Manejar notificaciones push](/nfc-wallet-sdk-ios/es/get-started/configuration/4.-push-notifications/handle-push-notifications.md#process-tns-notifications-transactions).

### Obtener transacciones

`TransactionHistoryService` recupera tanto el historial de transacciones como los detalles de notificaciones de transacciones desde el backend de la Billetera NFC.

El registro de la transacción contiene la siguiente información:

* ID de la transacción
* Fecha de la transacción
* Tipo de transacción
* Estado de la transacción
* Código de moneda
* Importe e importe para mostrar
* Nombre del comerciante
* Tipo de comerciante
* Código postal del comerciante
* ID del terminal
* ID del comerciante
* Indicador de tarjeta principal o auxiliar (para tarjetas co-marcadas)

Los límites del historial de transacciones dependen de la red de pago:

* Ventana de tiempo (por ejemplo, transacciones de los últimos 30 días).
* Recuento máximo (por ejemplo, las últimas 10 transacciones).

El siguiente fragmento de código demuestra cómo recuperar los registros de transacciones:

```swift
func transactionHistory() async {
    do {
        let historyService = TransactionHistoryService()
        let records = try await historyService.records(forDigitalCardID: "DIGITAL_CARD_ID")

        for record in records {
            // Mostrar campos del registro en su interfaz de usuario.
            _ = record.id
            _ = record.date
            _ = record.status
            _ = record.type
            _ = record.currencyCode
            _ = record.amount
            _ = record.displayAmount
            _ = record.merchantName
            _ = record.merchantType
            _ = record.merchantPostalCode
            _ = record.terminalID
            _ = record.merchantID
            _ = record.isAuxiliaryTransaction
        }
    } catch {
        if let error = error as? TransactionHistoryService.Error {
            // Manejar el error.
        }
    }
}
```

Para tarjetas co-marcadas, `isAuxiliaryTransaction` indica si el registro pertenece a la tarjeta auxiliar.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/es/implement-nfc-wallet/make-payments/get-transaction-history.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
