> 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 el historial de transacciones

## Descripción general

Con el historial de transacciones, su aplicación de monedero 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 [Gestionar 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 la notificación de transacciones del backend de NFC Wallet.

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

* ID de transacción
* Fecha de la transacción
* Tipo de transacción
* Estado de la transacción
* Código de moneda
* Importe e importe mostrado
* 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 con doble marca)

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

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

El siguiente fragmento de código muestra 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 {
            // Muestra los campos del registro en tu 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 con doble marca, `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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
