Skip to main content

XStoreQueryAssociatedProductsForStoreIdAsync

Gets store listing information for purchasable products related to a target product that’s specified by its Store ID.

Syntax

Parameters

storeContextHandle   _In_
Type: XStoreContextHandle
The store context handle for the user returned by XStoreCreateContext. storeId   _In_
Type: const char*
The Store ID for the product for which the associated products are retrieved. productKinds   _In_
Type: XStoreProductKind
The type of products to return. maxItemsToRetrievePerPage   _In_
Type: uint32_t
The maximum number of items to retrieve per page. The number of items returned per page can vary from 0 to maxItemsToRetrievePerPage. async   _Inout_
Type: XAsyncBlock*
An XAsyncBlock that defines the asynchronous work being done. Use the XAsyncBlock to poll for the call’s status and retrieve call results. For more information, see XAsyncBlock.

Return value

Type: HRESULT HRESULT success or error code.

Remarks

To get the store listing information and execution result for this function, call XStoreQueryAssociatedProductsForStoreIdResult after calling this function. XStoreQueryAssociatedProductsForStoreIdResult contains an XStoreProductQueryHandle that’s enumerated by calling XStoreEnumerateProductsQuery.
This API supports the same paging pattern as described in XStoreQueryAssociatedProductsAsync.Paging can behave differently between sandboxes and RETAIL. Verify your paging implementation and be sure to test in RETAIL before release.For more information, see Paging.
You can’t know the number of products this query returns upfront. Use the API to find add-ons that are associated with a target product by using its Store ID. This ability is especially useful for franchise game hubs. A franchise game hub can enumerate add-ons for multiple games, but it can’t tell which game these add-ons are associated with. Examples of usage scenarios:
  • Developers run XPackageEnumeratePackages to enumerate installed XPackageKind::Game products, then for one of these games, they run XStoreQueryAssociatedProductsForStoreIdAsync using the storeId obtained from the XPackageDetails. Developers run XPackageEnumeratePackages for XPackageKind::Content to enumerate installed DLC. Results from the content enumeration and product query are cross-referenced so developers can now identify which DLCs are installed for the specific game.
  • Developers run XStoreQueryAssociatedProductsAsync to get a list of purchasable products associated with the current game. Then, by using the storeId from the target game’s XStoreProduct, developers run XStoreQueryAssociatedProductsForStoreIdAsync to find out which DLCs are associated with it.
The following code snippet shows an example of querying for products associated with a target product by using its Store ID. Results are processed across multiple pages.

Requirements

Header: XStore.h (included in XGameRuntime.h) Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles, and XBOX Series consoles

Conceptual documentation

See also

XStore
XStoreQueryAssociatedProductsForStoreIdResult
XStoreQueryAssociatedProductsAsync
XStoreEnumerateProductsQuery
XStoreProductsQueryHasMorePages
XStoreProductsQueryNextPageAsync
Last modified on October 19, 2026