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

# XStore

> XStore

# XStore

Reference material for XStore APIs.

Provides commerce related functionality to a game including, details about available content to purchase, downloadable content package management, license management, and game trials.

## Functions

| Function                                                                                                                            | Description                                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [XStoreAcquireLicenseForDurablesAsync](/reference/system/xstore/functions/xstoreacquirelicensefordurablesasync)                     | Acquires a license for the specified durable.                                                                                                                                                      |
| [XStoreAcquireLicenseForDurablesResult](/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult)                   | Retrieves the result of a call to [XStoreAcquireLicenseForDurablesAsync](/reference/system/xstore/functions/xstoreacquirelicensefordurablesasync).                                                 |
| [XStoreAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync)                       | Acquires a license for a game's DLC that the user is entitled to use.                                                                                                                              |
| [XStoreAcquireLicenseForPackageResult](/reference/system/xstore/functions/xstoreacquirelicenseforpackageresult)                     | Retrieves the results of a call to [XStoreAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync).                                                  |
| [XStoreCanAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync)                 | Retrieves a preview license for DLC.                                                                                                                                                               |
| [XStoreCanAcquireLicenseForPackageResult](/reference/system/xstore/functions/xstorecanacquirelicenseforpackageresult)               | Gets the results for a call to [XStoreCanAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync).                                                |
| [XStoreCanAcquireLicenseForStoreIdAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync)                 | Retrieves a preview license for content.                                                                                                                                                           |
| [XStoreCanAcquireLicenseForStoreIdResult](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidresult)               | Gets the results for a call to [XStoreCanAcquireLicenseForStoreIdAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync).                                                |
| [XStoreCloseContextHandle](/reference/system/xstore/functions/xstoreclosecontexthandle)                                             | Closes the specified store context handle.                                                                                                                                                         |
| [XStoreCloseLicenseHandle](/reference/system/xstore/functions/xstorecloselicensehandle)                                             | Closes the specified store license handle.                                                                                                                                                         |
| [XStoreCloseProductsQueryHandle](/reference/system/xstore/functions/xstorecloseproductsqueryhandle)                                 | Closes the specified store products query handle.                                                                                                                                                  |
| [XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext)                                                       | Creates a store context for the specified user.                                                                                                                                                    |
| [XStoreDownloadAndInstallPackagesAsync](/reference/system/xstore/functions/xstoredownloadandinstallpackagesasync)                   | Downloads and installs the specified store packages.                                                                                                                                               |
| [XStoreDownloadAndInstallPackagesResult](/reference/system/xstore/functions/xstoredownloadandinstallpackagesresult)                 | Gets the results for a call to [XStoreDownloadAndInstallPackagesAsync](/reference/system/xstore/functions/xstoredownloadandinstallpackagesasync).                                                  |
| [XStoreDownloadAndInstallPackagesResultCount](/reference/system/xstore/functions/xstoredownloadandinstallpackagesresultcount)       | Gets the number of items in the result that will be returned by [XStoreDownloadAndInstallPackagesResult](/reference/system/xstore/functions/xstoredownloadandinstallpackagesresult).               |
| [XStoreDownloadAndInstallPackageUpdatesAsync](/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesasync)       | Downloads and installs updates for the specified store packages.                                                                                                                                   |
| [XStoreDownloadAndInstallPackageUpdatesResult](/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesresult)     | Gets the results for a call to [XStoreDownloadAndInstallPackageUpdatesAsync](/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesasync).                                      |
| [XStoreDownloadPackageUpdatesAsync](/reference/system/xstore/functions/xstoredownloadpackageupdatesasync)                           | Downloads updates for the specified packages.                                                                                                                                                      |
| [XStoreDownloadPackageUpdatesResult](/reference/system/xstore/functions/xstoredownloadpackageupdatesresult)                         | Gets the results for a call to [XStoreDownloadPackageUpdatesAsync](/reference/system/xstore/functions/xstoredownloadpackageupdatesasync).                                                          |
| [XStoreEnumerateProductsQuery](/reference/system/xstore/functions/xstoreenumerateproductsquery)                                     | Enumerates the results of a products query.                                                                                                                                                        |
| [XStoreGameLicenseChangedCallback](/reference/system/xstore/functions/xstoregamelicensechangedcallback)                             | A game defined callback for the game license changed event.                                                                                                                                        |
| [XStoreGetUserCollectionsIdAsync](/reference/system/xstore/functions/xstoregetusercollectionsidasync)                               | Gets a customer collections ID.                                                                                                                                                                    |
| [XStoreGetUserCollectionsIdResult](/reference/system/xstore/functions/xstoregetusercollectionsidresult)                             | Gets the results of a call to [XStoreGetUserCollectionsIdAsync](/reference/system/xstore/functions/xstoregetusercollectionsidasync).                                                               |
| [XStoreGetUserCollectionsIdResultSize](/reference/system/xstore/functions/xstoregetusercollectionsidresultsize)                     | Gets the size of the ID returned by [XStoreGetUserCollectionsIdResult](/reference/system/xstore/functions/xstoregetusercollectionsidresult).                                                       |
| [XStoreGetUserPurchaseIdAsync](/reference/system/xstore/functions/xstoregetuserpurchaseidasync)                                     | Retrieves a customer purchase ID.                                                                                                                                                                  |
| [XStoreGetUserPurchaseIdResult](/reference/system/xstore/functions/xstoregetuserpurchaseidresult)                                   | Gets the result of a call to [XStoreGetUserPurchaseIdAsync](/reference/system/xstore/functions/xstoregetuserpurchaseidasync).                                                                      |
| [XStoreGetUserPurchaseIdResultSize](/reference/system/xstore/functions/xstoregetuserpurchaseidresultsize)                           | Gets the size of the result returned by [XStoreGetUserPurchaseIdResult](/reference/system/xstore/functions/xstoregetuserpurchaseidresult).                                                         |
| [XStoreIsLicenseValid](/reference/system/xstore/functions/xstoreislicensevalid)                                                     | Checks if the specified license is valid.                                                                                                                                                          |
| [XStorePackageLicenseLostCallback](/reference/system/xstore/functions/xstorepackagelicenselostcallback)                             | Game defined callback for the license lost event.                                                                                                                                                  |
| [XStoreProductQueryCallback](/reference/system/xstore/functions/xstoreproductquerycallback)                                         | Game defined callback for a product query.                                                                                                                                                         |
| [XStoreProductsQueryHasMorePages](/reference/system/xstore/functions/xstoreproductsqueryhasmorepages)                               | Checks if there are more results pages for the specified query.                                                                                                                                    |
| [XStoreProductsQueryNextPageAsync](/reference/system/xstore/functions/xstoreproductsquerynextpageasync)                             | Gets the next page of query results.                                                                                                                                                               |
| [XStoreProductsQueryNextPageResult](/reference/system/xstore/functions/xstoreproductsquerynextpageresult)                           | Gets the next page of results from a product query.                                                                                                                                                |
| [XStoreQueryAddOnLicensesAsync](/reference/system/xstore/functions/xstorequeryaddonlicensesasync)                                   | Enumerates the licenses the user was granted for durables without bits of the currently running game.                                                                                              |
| [XStoreQueryAddOnLicensesResult](/reference/system/xstore/functions/xstorequeryaddonlicensesresult)                                 | Retrieves the result of a call to XStoreQueryAddOnLicensesAsync.                                                                                                                                   |
| [XStoreQueryAddOnLicensesResultCount](/reference/system/xstore/functions/xstorequeryaddonlicensesresultcount)                       | Gets the number of licenses retrieved by [XStoreQueryAddonLicensesAsync](/reference/system/xstore/functions/xstorequeryaddonlicensesasync).                                                        |
| [XStoreQueryAssociatedProductsAsync](/reference/system/xstore/functions/xstorequeryassociatedproductsasync)                         | Gets store listing information for the products that can be purchased from within the current game.                                                                                                |
| [XStoreQueryAssociatedProductsForStoreIdAsync](/reference/system/xstore/functions/xstorequeryassociatedproductsforstoreidasync)     | Gets store listing information for the products that can be purchased from the product specified by the Store ID.                                                                                  |
| [XStoreQueryAssociatedProductsForStoreIdResult](/reference/system/xstore/functions/xstorequeryassociatedproductsforstoreidresult)   | Gets the results for a call to [XStoreQueryAssociatedProductsForStoreIdAsync](/reference/system/xstore/functions/xstorequeryassociatedproductsforstoreidasync).                                    |
| [XStoreQueryAssociatedProductsResult](/reference/system/xstore/functions/xstorequeryassociatedproductsresult)                       | Gets the results for a call to [XStoreQueryAssociatedProductsAsync](/reference/system/xstore/functions/xstorequeryassociatedproductsasync).                                                        |
| [XStoreQueryConsumableBalanceRemainingAsync](/reference/system/xstore/functions/xstorequeryconsumablebalanceremainingasync)         | Get the consumable balance remaining for the specified product ID.                                                                                                                                 |
| [XStoreQueryConsumableBalanceRemainingResult](/reference/system/xstore/functions/xstorequeryconsumablebalanceremainingresult)       | Retrieves the results of a call to [XStoreQueryConsumableBalanceRemainingAsync](/reference/system/xstore/functions/xstorequeryconsumablebalanceremainingasync).                                    |
| [XStoreQueryEntitledProductsAsync](/reference/system/xstore/functions/xstorequeryentitledproductsasync)                             | Provides the Store product information for all add-ons of the current game the user has purchased.                                                                                                 |
| [XStoreQueryEntitledProductsResult](/reference/system/xstore/functions/xstorequeryentitledproductsresult)                           | Gets the results for a call to [XStoreQueryEntitledProductsAsync](/reference/system/xstore/functions/xstorequeryentitledproductsasync).                                                            |
| [XStoreQueryGameAndDlcPackageUpdatesAsync](/reference/system/xstore/functions/xstorequerygameanddlcpackageupdatesasync)             | Gets game and optional updates for the current package.                                                                                                                                            |
| [XStoreQueryGameAndDlcPackageUpdatesResult](/reference/system/xstore/functions/xstorequerygameanddlcpackageupdatesresult)           | Gets the result for a call to [XStoreQueryGameAndDlcPackageUpdatesAsync](/reference/system/xstore/functions/xstorequerygameanddlcpackageupdatesasync).                                             |
| [XStoreQueryGameAndDlcPackageUpdatesResultCount](/reference/system/xstore/functions/xstorequerygameanddlcpackageupdatesresultcount) | Gets the number of updates retrieved by [XStoreQueryGameAndDlcPackageUpdatesAsync](/reference/system/xstore/functions/xstorequerygameanddlcpackageupdatesasync).                                   |
| [XStoreQueryGameLicenseAsync](/reference/system/xstore/functions/xstorequerygamelicenseasync)                                       | Retrieves information about the license that was acquired to allow the game to launch.                                                                                                             |
| [XStoreQueryGameLicenseResult](/reference/system/xstore/functions/xstorequerygamelicenseresult)                                     | Gets the results of a call to [XStoreQueryGameLicenseAsync](/reference/system/xstore/functions/xstorequerygamelicenseasync).                                                                       |
| [XStoreQueryLicenseTokenAsync](/reference/system/xstore/functions/xstorequerylicensetokenasync)                                     | Provides an opaque token to the calling game that can be passed to the game's service to make B2B calls.                                                                                           |
| [XStoreQueryLicenseTokenResult](/reference/system/xstore/functions/xstorequerylicensetokenresult)                                   | Retrieves the results of a call to [XStoreQueryLicenseTokenAsync](/reference/system/xstore/functions/xstorequerylicensetokenasync).                                                                |
| [XStoreQueryLicenseTokenResultSize](/reference/system/xstore/functions/xstorequerylicensetokenresultsize)                           | Gets the size of the result that will be returned by [XstoreQueryLicenseTokenResult](/reference/system/xstore/functions/xstorequerylicensetokenresult).                                            |
| [XStoreQueryPackageIdentifier](/reference/system/xstore/functions/xstorequerypackageidentifier)                                     | Retrieves the package identifier for the specified store ID.                                                                                                                                       |
| [XStoreQueryPackageUpdatesAsync](/reference/system/xstore/functions/xstorequerypackageupdatesasync)                                 | Retrieves the available updates for the packages specified.                                                                                                                                        |
| [XStoreQueryPackageUpdatesResult](/reference/system/xstore/functions/xstorequerypackageupdatesresult)                               | Gets the result for a call to [XStoreQueryPackageUpdatesAsync](/reference/system/xstore/functions/xstorequerypackageupdatesasync).                                                                 |
| [XStoreQueryPackageUpdatesResultCount](/reference/system/xstore/functions/xstorequerypackageupdatesresultcount)                     | Gets the number of updates retrieved by [XStoreQueryPackageUpdatesAsync](/reference/system/xstore/functions/xstorequerypackageupdatesasync).                                                       |
| [XStoreQueryProductForCurrentGameAsync](/reference/system/xstore/functions/xstorequeryproductforcurrentgameasync)                   | Provides store product information for the currently running game, its skus and availabilities, and other metadata.                                                                                |
| [XStoreQueryProductForCurrentGameResult](/reference/system/xstore/functions/xstorequeryproductforcurrentgameresult)                 | Gets the results for a call to [XStoreQueryProductForCurrentGameAsync](/reference/system/xstore/functions/xstorequeryproductforcurrentgameasync).                                                  |
| [XStoreQueryProductForPackageAsync](/reference/system/xstore/functions/xstorequeryproductforpackageasync)                           | Retrieves store product information for the specified package.                                                                                                                                     |
| [XStoreQueryProductForPackageResult](/reference/system/xstore/functions/xstorequeryproductforpackageresult)                         | Gets the results of a call to [XStoreQueryProductForPackageAsync](/reference/system/xstore/functions/xstorequeryproductforpackageasync).                                                           |
| [XStoreQueryProductsAsync](/reference/system/xstore/functions/xstorequeryproductsasync)                                             | Returns listing information for the specified products that are associated with the current game, regardless of whether the products are currently available for purchase within the current game. |
| [XStoreQueryProductsResult](/reference/system/xstore/functions/xstorequeryproductsresult)                                           | Gets the results for a call to [XStoreQueryProductsAsync](/reference/system/xstore/functions/xstorequeryproductsasync).                                                                            |
| [XStoreRegisterGameLicenseChanged](/reference/system/xstore/functions/xstoreregistergamelicensechanged)                             | Registers a callback for the game license changed event.                                                                                                                                           |
| [XStoreRegisterPackageLicenseLost](/reference/system/xstore/functions/xstoreregisterpackagelicenselost)                             | Registers a callback for the license lost event.                                                                                                                                                   |
| [XStoreReportConsumableFulfillmentAsync](/reference/system/xstore/functions/xstorereportconsumablefulfillmentasync)                 | Consumes the specified quantity of a consumable.                                                                                                                                                   |
| [XStoreReportConsumableFulfillmentResult](/reference/system/xstore/functions/xstorereportconsumablefulfillmentresult)               | Gets the results of a call to [XStoreReportConsumableFulfillmentAsync](/reference/system/xstore/functions/xstorereportconsumablefulfillmentasync).                                                 |
| [XStoreShowAssociatedProductsUIAsync](/reference/system/xstore/functions/xstoreshowassociatedproductsuiasync)                       | This will open up the Microsoft Store app and show the set of available add-ons associated with the game. This can be further filtered by product type.                                            |
| [XStoreShowAssociatedProductsUIResult](/reference/system/xstore/functions/xstoreshowassociatedproductsuiresult)                     | Gets the result of a call to [XStoreShowAssociatedProductsUIAsync](/reference/system/xstore/functions/xstoreshowassociatedproductsuiasync).                                                        |
| [XStoreShowGiftingUIAsync](/reference/system/xstore/functions/xstoreshowgiftinguiasync)                                             | Allows the game to request purchasing a particular store product as a gift for another user.                                                                                                       |
| [XStoreShowGiftingUIResult](/reference/system/xstore/functions/xstoreshowgiftinguiresult)                                           | Gets the results of a call to [XStoreShowGiftingUIAsync](/reference/system/xstore/functions/xstoreshowgiftinguiasync).                                                                             |
| [XStoreShowProductPageUIAsync](/reference/system/xstore/functions/xstoreshowproductpageuiasync)                                     | Opens the Store app directly to the details page of the specified ProductId.                                                                                                                       |
| [XStoreShowProductPageUIResult](/reference/system/xstore/functions/xstoreshowproductpageuiresult)                                   | Gets the result of a call to [XStoreShowProductPageUIAsync](/reference/system/xstore/functions/xstoreshowproductpageuiasync).                                                                      |
| [XStoreShowPurchaseUIAsync](/reference/system/xstore/functions/xstoreshowpurchaseuiasync)                                           | Allows the game to request a purchase for a particular store product.                                                                                                                              |
| [XStoreShowPurchaseUIResult](/reference/system/xstore/functions/xstoreshowpurchaseuiresult)                                         | Gets the results of a call to [XStoreShowPurchaseUIAsync](/reference/system/xstore/functions/xstoreshowpurchaseuiasync).                                                                           |
| [XStoreShowRateAndReviewUIAsync](/reference/system/xstore/functions/xstoreshowrateandreviewuiasync)                                 | Displays a system dialog to pop up to allow the user to provide a review or decline to do so.                                                                                                      |
| [XStoreShowRateAndReviewUIResult](/reference/system/xstore/functions/xstoreshowrateandreviewuiresult)                               | Gets the result of a call to [XStoreShowRateAndReviewUIAsync](/reference/system/xstore/functions/xstoreshowrateandreviewuiasync).                                                                  |
| [XStoreShowRedeemTokenUIAsync](/reference/system/xstore/functions/xstoreshowredeemtokenuiasync)                                     | Triggers a token redemption for the current user for a specified token.                                                                                                                            |
| [XStoreShowRedeemTokenUIResult](/reference/system/xstore/functions/xstoreshowredeemtokenuiresult)                                   | Gets the results of a call to [XStoreShowRedeemTokenUIAsync](/reference/system/xstore/functions/xstoreshowredeemtokenuiasync).                                                                     |
| [XStoreUnregisterGameLicenseChanged](/reference/system/xstore/functions/xstoreunregistergamelicensechanged)                         | Unregisters the specified game license changed callback.                                                                                                                                           |
| [XStoreUnregisterPackageLicenseLost](/reference/system/xstore/functions/xstoreunregisterpackagelicenselost)                         | Unregisters the specified store license lost callback.                                                                                                                                             |

## Structures

| Structure                                                                                       | Description                                                                                                                                                                                                                                                              |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [XStoreAddonLicense](/reference/system/xstore/structs/xstoreaddonlicense)                       | Describes an add-on license.                                                                                                                                                                                                                                             |
| [XStoreAvailability](/reference/system/xstore/structs/xstoreavailability)                       | Describes the availability of a product.                                                                                                                                                                                                                                 |
| [XStoreCanAcquireLicenseResult](/reference/system/xstore/structs/xstorecanacquirelicenseresult) | Gets the result of a call to [XStoreCanAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync) or [XStoreCanAcquireLicenseForStoreIdAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync). |
| [XStoreCollectionData](/reference/system/xstore/structs/xstorecollectiondata)                   | Describes a store collection.                                                                                                                                                                                                                                            |
| [XStoreConsumableResult](/reference/system/xstore/structs/xstoreconsumableresult)               | Represents the quantity of the consumable.                                                                                                                                                                                                                               |
| [XStoreGameLicense](/reference/system/xstore/structs/xstoregamelicense)                         | Describes a game license.                                                                                                                                                                                                                                                |
| [XStoreImage](/reference/system/xstore/structs/xstoreimage)                                     | Describes an image.                                                                                                                                                                                                                                                      |
| [XStorePackageUpdate](/reference/system/xstore/structs/xstorepackageupdate)                     | Describes a package update.                                                                                                                                                                                                                                              |
| [XStorePrice](/reference/system/xstore/structs/xstoreprice)                                     | Store price information.                                                                                                                                                                                                                                                 |
| [XStoreProduct](/reference/system/xstore/structs/xstoreproduct)                                 | Describes a store product.                                                                                                                                                                                                                                               |
| [XStoreRateAndReviewResult](/reference/system/xstore/structs/xstorerateandreviewresult)         | The results for a call to [XStoreShowRateAndReviewUIAsync](/reference/system/xstore/functions/xstoreshowrateandreviewuiasync).                                                                                                                                           |
| [XStoreSku](/reference/system/xstore/structs/xstoresku)                                         | Describes a store SKU.                                                                                                                                                                                                                                                   |
| [XStoreSubscriptionInfo](/reference/system/xstore/structs/xstoresubscriptioninfo)               | Contains information on a subscription.                                                                                                                                                                                                                                  |
| [XStoreVideo](/reference/system/xstore/structs/xstorevideo)                                     | Describes a store video.                                                                                                                                                                                                                                                 |

## Enumerations

| Enumeration                                                                     | Description                                             |
| ------------------------------------------------------------------------------- | ------------------------------------------------------- |
| [XStoreCanLicenseStatus](/reference/system/xstore/enums/xstorecanlicensestatus) | Indicates if a user would be able to license a package. |
| [XStoreDurationUnit](/reference/system/xstore/enums/xstoredurationunit)         | Units of a duration value.                              |
| [XStoreProductKind](/reference/system/xstore/enums/xstoreproductkind)           | Indicates the product type.                             |

## Error Codes

The following error codes may be returned by XStore APIs. For a complete list, see [Error codes](/reference/errorcodes).

| Code                                                        | Value      | Description                                                                                                                                         |
| ----------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| E\_GAMESTORE\_LICENSE\_ACTION\_NOT\_APPLICABLE\_TO\_PRODUCT | 0x89245300 | The game requested a license for a product that cannot be licensed.                                                                                 |
| E\_GAMESTORE\_NETWORK\_ERROR                                | 0x89245301 | The game failed to communicate with the store network.                                                                                              |
| E\_GAMESTORE\_SERVER\_ERROR                                 | 0x89245302 | The game received a bad response from the store server.                                                                                             |
| E\_GAMESTORE\_INSUFFICIENT\_QUANTITY                        | 0x89245303 | The user does not have enough of this consumable to use the requested amount.                                                                       |
| E\_GAMESTORE\_ALREADY\_PURCHASED                            | 0x89245304 | The user already owns this product.                                                                                                                 |
| E\_GAMESTORE\_LICENSE\_ACTION\_THROTTLED                    | 0x89245305 | The game excessively queried a license for the product and is now throttled. Limit is 30 licensing attempts within 10 minutes for the same product. |

## Conceptual documentation

* [Commerce overview](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/commerce-nav)
* [XStore overview](/publishing/xstore-commerce/xstore-overview)
* [XStore basic store operations](/publishing/xstore-commerce/xstore-basic-operations)

## See also

[System API reference](/reference/system/gc-reference-system-toc)\
[XPackage API reference](/reference/system/xpackage/xpackage_members)\
[Commerce Overview](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/commerce-nav)
