> ## 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.

# XStoreAcquireLicenseForDurablesAsync

> XStoreAcquireLicenseForDurablesAsync

# XStoreAcquireLicenseForDurablesAsync

Acquires a license for a DLC (Durable with a package), Durable without a package, or Durable add-on product.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
HRESULT XStoreAcquireLicenseForDurablesAsync(
         const XStoreContextHandle storeContextHandle,
         const char* storeId,
         XAsyncBlock* async
)
```

<a id="parametersSection" />

### Parameters

*storeContextHandle*   \_In\_\
Type: XStoreContextHandle

The store context handle for the user, returned by [XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext).

*storeId*   \_In\_z\_\
Type: char\*

The store ID for the durable to acquire a license for.

*async*   \_Inout\_\
Type: XAsyncBlock\*

An [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) defining the asynchronous work.
Use the [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) to check for the call's status and get call results.
For more information, see [XAsyncBlock](/reference/system/xasync/structs/xasyncblock).

<a id="retvalSection" />

### Return value

Type: HRESULT

Returns **S\_OK** upon success, or an error code otherwise.

<a id="remarksSection" />

## Remarks

This API attempts to acquire a license for the requested durable.
If it's the first time the device is acquiring the license, a service call is made, therefore requiring an online connection.
Subsequent calls for the same license may be faster due to caching, but the license can be invalidated at any time.
On Console, offline access requires that 'Home XBOX' be enabled for the owning account and the license must first be obtained once while online.
For PC, offline access requires that 'Offline permissions' be set for the account that owns the license and the license must first be obtained once while online.

[XStoreRegisterPackageLicenseLost](/reference/system/xstore/functions/xstoreregisterpackagelicenselost) can be used to monitor if the license obtained from this API is lost.

<a id="requirementsSection" />

## Requirements

**Header:** XStore.h

**Library:** xgameruntime.lib

**Supported Platforms**: Windows, XBOX One family consoles, and XBOX Series consoles

<a id="seealsoSection" />

## Conceptual documentation

* [Basic store operations](/publishing/xstore-commerce/xstore-basic-operations)
* [How to use a durable without a package](/publishing/xstore-commerce/xstore-dwob)
* [Granting players access to add-on content](/publishing/xstore-commerce/xstore-granting-access)
* [Enabling licensing testing](/publishing/xstore-commerce/xstore-licensing-setup)

## See also

[XStore](/reference/system/xstore/xstore_members)\
[XAsyncBlock](/reference/system/xasync/structs/xasyncblock)\
[XStoreAcquireLicenseForDurablesResult](/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult)\
[How to use a durable without a package](/publishing/xstore-commerce/xstore-dwob)\
[Granting players access to add-on content](/publishing/xstore-commerce/xstore-granting-access)


## Related topics

- [XStoreAcquireLicenseForDurablesResult](/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult.md)
- [XStoreAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md)
- [XStoreRegisterPackageLicenseLost](/reference/system/xstore/functions/xstoreregisterpackagelicenselost.md)
- [XStoreQueryAddOnLicensesAsync](/reference/system/xstore/functions/xstorequeryaddonlicensesasync.md)
- [How to use a durable without a package](/publishing/xstore-commerce/xstore-dwob.md)
