Skip to main content

XStoreGetUserPurchaseIdAsync

Gets a customer purchase ID. This ID retrieves a Microsoft Store ID key that can be used to grant entitlements for free products on behalf of the current user. This API is used in the flow outlined in Manage products from your services

Syntax

Parameters

storeContextHandle   _In_
Type: XStoreContextHandle
The store context handle for the user returned by XStoreCreateContext. serviceTicket   _In_z_
Type: char*
The service ticket associated with the purchase. publisherUserId   _In_z_
Type: char*
A string containing the publisher user ID. async   _Inout_
Type: XAsyncBlock*
An XAsyncBlock defining the asynchronous work being done. The XAsyncBlock can be used to poll for the call’s status and retrieve call results. See XAsyncBlock for more information.

Return value

Type: HRESULT HRESULT success or error code.

Remarks

To retrieve the customer’s purchase ID as well as the execution result of this function call XStoreGetUserPurchaseIdResult after calling this function. To retrieve the size of the customer’s purchase ID call XStoreGetUSerPurchaseIdResultSize after calling this function. Knowing the result size will help you read the result more efficiently. The following code snippet shows an example of retrieving a customer purchase ID.

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
XStoreGetUserPurchaseIdResult
XStoreGetUSerPurchaseIdResultSize
Manage products from your services
Last modified on August 20, 2026