> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XStoreShowRedeemTokenUIAsync

> XStoreShowRedeemTokenUIAsync

# XStoreShowRedeemTokenUIAsync

Desencadena un canje de token para el usuario actual con el token especificado.

## Sintaxis

```cpp theme={null}
HRESULT XStoreShowRedeemTokenUIAsync(  
         const XStoreContextHandle storeContextHandle,  
         const char* token,  
         const char** allowedStoreIds,  
         size_t allowedStoreIdsCount,  
         bool disallowCsvRedemption,  
         XAsyncBlock* async  
)  
```

### Parámetros

*storeContextHandle*   \_In\_\
Tipo: XStoreContextHandle

El identificador de contexto de la tienda para el usuario, devuelto por [XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext).

*token*   \_In\_z\_\
Tipo: char\*

El token que se va a canjear. Este valor no puede estar vacío ni ser nulo; si quiere mostrar la interfaz de usuario sin proporcionar un código para rellenarla previamente, pase un único espacio " ".

*allowedStoreIds*   \_In\_z\_count\_(allowedStoreIdsCount)\
Tipo: char\*\*

Le permite restringir los códigos 5x5 para que solo funcionen con productos específicos.

*allowedStoreIdsCount*   \_In\_\
Tipo: size\_t

El número de elementos en **allowedStoreIds**.

*disallowCsvRedemption*   \_In\_\
Tipo: bool

Impide que se canjeen CSV (códigos 5x5 de tipo tarjeta regalo/dinero).

*async*   \_Inout\_\
Tipo: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

Un [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) que define el trabajo asincrónico que se está realizando. El [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) se puede usar para sondear el estado de la llamada y recuperar los resultados de la llamada. Consulte [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) para obtener más información.

### Valor devuelto

Tipo: HRESULT

Código HRESULT de éxito o de error.

## Comentarios

Para recuperar el resultado de ejecución de esta función, llame a [XStoreShowRedeemTokenUIResult](/reference/system/xstore/functions/xstoreshowredeemtokenuiresult) después de llamar a esta función.

El siguiente fragmento de código muestra un ejemplo de inicio de la interfaz de usuario de canje de tokens.

```cpp theme={null}
void CALLBACK ShowRedeemTokenUICallback(XAsyncBlock* asyncBlock)
{
    HRESULT hr = XStoreShowRedeemTokenUIResult(asyncBlock);

    if (FAILED(hr))
    {
        printf("Failed redeem token: 0x%x\r\n", hr);
        return;
    }
}

void ShowRedeemTokenUI(XStoreContextHandle storeContextHandle, XTaskQueueHandle taskQueueHandle, const char* token)
{
    auto asyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(asyncBlock.get(), sizeof(*asyncBlock));
    asyncBlock->queue = taskQueueHandle;
    asyncBlock->callback = ShowRedeemTokenUICallback;

    HRESULT hr = XStoreShowRedeemTokenUIAsync(
        storeContextHandle,
        token,
        nullptr,    // Can restrict to specific store IDs
        0,
        false,      // Can prevent CSV (cash gift cards)
        asyncBlock.get());

    if (FAILED(hr))
    {
        printf("Failed to request redeem token: 0x%x\r\n", hr);
        return;
    }
}


```

## Requisitos

**Encabezado:** XStore.h (incluido en XGameRuntime.h)

**Biblioteca:** xgameruntime.lib

**Plataformas compatibles:** Windows, consolas de la familia XBOX One y consolas XBOX Series

## Consulte también

[XStore](/reference/system/xstore/xstore_members)\
[XStoreShowRedeemTokenUIResult](/reference/system/xstore/functions/xstoreshowredeemtokenuiresult)


## Related topics

- [XStoreShowRedeemTokenUIResult](/es/reference/system/xstore/functions/xstoreshowredeemtokenuiresult.md)
- [XStore](/es/reference/system/xstore/xstore_members.md)
- [Contenedores de API de C# de Unity para el GDK](/es/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [PFInventoryRedeemMicrosoftStoreInventoryItemsRequest](/es/services/playfab/api-references/c/pfinventorytypes/structs/pfinventoryredeemmicrosoftstoreinventoryitemsrequest.md)
- [Información general de la API de C de Services - PFInventory.h](/es/services/playfab/api-references/c/pfinventory/pfinventory_members.md)
