> 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/tokenize-a-card/digitize-card/green-flow-digitization.md).

# Digitalización del flujo verde

## Descripción general

El flujo verde es un flujo de tokenización en el que el backend del emisor aprueba la tokenización sin autenticación adicional.

Este flujo es común cuando el SDK de NFC Wallet está integrado en la aplicación del emisor y el usuario final ya está autenticado en la app.

## Experiencia de usuario

Consulta [Experiencia de usuario del flujo verde](/nfc-wallet-sdk-ios/es/implement-nfc-wallet/tokenize-a-card.md#green-flow).

## Diagrama de secuencia

<figure><img src="https://1114080274-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bUtiXdSFHu8lmOj8A0X%2Fuploads%2FDuBVzOO9pN0Fubkxtt5v%2FSequence%20Diagram%20-%20Implement%20the%20green%20flow.svg?alt=media&amp;token=2512a32c-f488-4aee-b790-7ee6f369a93e" alt=""><figcaption><p>Secuencia de digitalización del flujo verde</p></figcaption></figure>

## Integrar el SDK

Después de que tú [Verificar la elegibilidad de la tarjeta](/nfc-wallet-sdk-ios/es/implement-nfc-wallet/tokenize-a-card/check-card-eligibility.md):

1. Llama a `CardDigitizationService.digitizeCard()`.

   Incluye un `authenticationToken` generado por el backend de tu billetera digital.
2. Si la tokenización se aprueba sin condiciones (flujo verde):
   * El SDK de NFC Wallet aprovisiona la tarjeta digital y las claves de pago en el dispositivo.
   * Cuando el aprovisionamiento tiene éxito, el SDK emite el `digitizationApproved` evento.

El siguiente ejemplo muestra cómo iniciar la digitalización y manejar el resultado del flujo verde.

```swift
func digitizeCard(
    _ términosYCondiciones: CardDigitizationService.TermsAndConditions
) async throws {
    // Paso 1: Inicializar el servicio.
    let cardDigitizationService = CardDigitizationService()

    // Paso 2: Recopilar entradas.
    let authenticationToken = Data() // Token del backend del emisor para el registro en flujo verde.
    let fcmToken = "FACY6074293608087656831WRF1234" // Solo un ejemplo.

    // Paso 3: Iniciar la digitalización.
    try await cardDigitizationService.digitizeCard(
        withTNC: termsAndConditions.accept(),
        pushToken: fcmToken, // Token de Firebase Cloud Messaging (FCM)
        language: "en",
        authenticationToken: authenticationToken
    )

    // Paso 4: Escuchar los resultados.
    for await state in await cardDigitizationService.eventStream {
        switch state {
        case let .digitizationApproved(digitalCardID):
            // Flujo verde: el aprovisionamiento tuvo éxito.
            _ = digitalCardID
            return
        default:
            break
        }
    }
}
```


---

# 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/tokenize-a-card/digitize-card/green-flow-digitization.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.
