> 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 donde el backend del emisor aprueba la tokenización sin autenticación adicional.

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

## Experiencia del usuario

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

## Diagrama de secuencia

<figure><img src="/files/43dc18558834a5227f381d44f6443b363b881da0" alt=""><figcaption><p>Secuencia de digitalización del flujo verde</p></figcaption></figure>

## Integrar SDK

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

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

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

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

```swift
func digitizeCard(
    _ termsAndConditions: 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 la inscripción en el flujo verde.
    let fcmToken = "FACY6074293608087656831WRF1234" // Solo 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 resultados.
    for await state in await cardDigitizationService.eventStream {
        switch state {
        case let .digitizationApproved(digitalCardID):
            // Flujo verde: la provisión 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:

```
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>
```

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.
