StoreProduct StoreProduct StoreProduct StoreProduct Class

Definition

Represents a product that is available in the Windows Store.

public : sealed class StoreProduct : IStoreProductpublic sealed class StoreProduct : IStoreProductPublic NotInheritable Class StoreProduct Implements IStoreProduct// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Services.Store.StoreContract (introduced v1)

Remarks

Products in the Store are organized in a hierarcy of product, SKU, and availability objects. Products are represented by StoreProduct objects. The SKUs for each product are represented by StoreSku objects, and the availabilities for each SKU are represented by StoreAvailability objects. For more information, see In-app purchases and trials.

To retrieve a StoreProduct object for the current app, use the GetStoreProductForCurrentAppAsync method.

To retrieve StoreProduct objects for products that can be purchased from within the current app, use these methods.

Properties

Description Description Description Description

Gets the product description from the Windows Store listing.

public : PlatForm::String Description { get; }public string Description { get; }Public ReadOnly Property Description As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The product description.

ExtendedJsonData ExtendedJsonData ExtendedJsonData ExtendedJsonData

Gets complete data for the product from the Store in JSON format.

public : PlatForm::String ExtendedJsonData { get; }public string ExtendedJsonData { get; }Public ReadOnly Property ExtendedJsonData As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A JSON-formatted string that contains complete data for the product from the Store in JSON format.

Remarks

Use the ExtendedJsonData property to access the complete data for the StoreProduct object as a JSON-formatted string in your code. For more information about the structure of the data, see Data schemas for Store products.

See Also

HasDigitalDownload HasDigitalDownload HasDigitalDownload HasDigitalDownload

Gets a value that indicates whether the product has optional downloadable content (DLC).

public : PlatForm::Boolean HasDigitalDownload { get; }public bool HasDigitalDownload { get; }Public ReadOnly Property HasDigitalDownload As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the product has optional downloadable content; otherwise, false.

Remarks

Note

Downloadable content (DLC) is a feature that is not available to all developer accounts.

Images Images Images Images

Gets the images from the Windows Store listing for the product.

public : IVectorView<StoreImage> Images { get; }public IReadOnlyList<StoreImage> Images { get; }Public ReadOnly Property Images As IReadOnlyList<StoreImage>// You can use this property in JavaScript.
Value
IVectorView<StoreImage> IReadOnlyList<StoreImage> IReadOnlyList<StoreImage> IReadOnlyList<StoreImage>

A collection of StoreImage objects that represent the images from the Windows Store listing for the product.

InAppOfferToken InAppOfferToken InAppOfferToken InAppOfferToken

Gets the product ID for this product, if the current StoreProduct represents an add-on.

public : PlatForm::String InAppOfferToken { get; }public string InAppOfferToken { get; }Public ReadOnly Property InAppOfferToken As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The product ID for this product, if the current StoreProduct represents an add-on.

Remarks

If the current StoreProduct represents an add-on, this property returns the product ID that you gave the add-on when you submitted the add-on in the Windows Dev Center dashboard. For more information, see How to use product IDs for add-ons in your code.

IsInUserCollection IsInUserCollection IsInUserCollection IsInUserCollection

Gets a value that indicates whether the current user has an entitlement to use the default SKU of the product.

public : PlatForm::Boolean IsInUserCollection { get; }public bool IsInUserCollection { get; }Public ReadOnly Property IsInUserCollection As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the current user has an entitlement to use the default SKU of the product; otherwise, false.

Keywords Keywords Keywords Keywords

Gets the keywords that are associated with the product in the Windows Dev Center dashboard. This property only applies to StoreProduct objects that represent add-ons. These strings correspond to the value of the Keywords field in the properties page for the add-on in the Windows Dev Center dashboard.

public : IVectorView<string> Keywords { get; }public IReadOnlyList<string> Keywords { get; }Public ReadOnly Property Keywords As IReadOnlyList<string>// You can use this property in JavaScript.
Value
IVectorView<PlatForm::String> IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>

A collection of strings that contain the keywords that are associated with the product in the Windows Dev Center dashboard.

Remarks

For more information about setting the keywords for an add-on in the dashboard, see Enter add-on properties.

Language Language Language Language

Gets the language for the data in the Windows Store listing for the product.

public : PlatForm::String Language { get; }public string Language { get; }Public ReadOnly Property Language As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The language for the data in the Windows Store listing for the product.

LinkUri LinkUri LinkUri LinkUri

Gets the URI to the Windows Store listing for the product.

public : Uri LinkUri { get; }public Uri LinkUri { get; }Public ReadOnly Property LinkUri As Uri// You can use this property in JavaScript.
Value
Uri Uri Uri Uri

The URI to the Windows Store listing for the product.

Remarks

An example URI is https://www.microsoft.com/store/apps/<Store ID for the product>. If there is no listing page for the product, this link resolves to the Windows Store home page.

Price Price Price Price

Gets the price for the default SKU and availability for the product.

public : StorePrice Price { get; }public StorePrice Price { get; }Public ReadOnly Property Price As StorePrice// You can use this property in JavaScript.
Value
StorePrice StorePrice StorePrice StorePrice

The price for the default SKU and availability for the product.

ProductKind ProductKind ProductKind ProductKind

Gets the type of the product. These values are currently supported: Application, Game, Consumable, UnmanagedConsumable, and Durable.

public : PlatForm::String ProductKind { get; }public string ProductKind { get; }Public ReadOnly Property ProductKind As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The type of the product.

Remarks

The following table provides definitions for the currently supported values. Additional values may be supported in the future.

String valueDescription
ApplicationAn app that belongs to any category other than Games. For more info, see Category and subcategory table.
GameAn app that belongs to the Games category. For more info, see Category and subcategory table.
ConsumableA Store-managed consumable add-on that can be purchased, used, and purchased again. Microsoft keeps track of the user's balance for these types of add-ons.
UnmanagedConsumableA developer-managed consumable add-on that can be purchased, used, and purchased again. Microsoft does not keep track of the user's balance for these types of add-ons; the developer is responsible for keeping track of the user's balance.
DurableAn add-on that persists for the lifetime that you specify in the Windows Dev Center dashboard. By default, durable add-ons never expire, in which case they can only be purchased once. If you specify a particular duration for the add-on, the user can repurchase the add-on after it expires.

See Also

Skus Skus Skus Skus

Gets the list of available SKUs for the product.

public : IVectorView<StoreSku> Skus { get; }public IReadOnlyList<StoreSku> Skus { get; }Public ReadOnly Property Skus As IReadOnlyList<StoreSku>// You can use this property in JavaScript.
Value
IVectorView<StoreSku> IReadOnlyList<StoreSku> IReadOnlyList<StoreSku> IReadOnlyList<StoreSku>

A collection of StoreSku objects that represent the available SKUs for the product.

StoreId StoreId StoreId StoreId

Gets the Store ID for this product.

public : PlatForm::String StoreId { get; }public string StoreId { get; }Public ReadOnly Property StoreId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The Store ID for this product.

Remarks

For an app, this property corresponds to the Store ID that is available on the App identity page for the app in the Windows Dev Center dashboard. For more information, see View app identity details.

For an add-on, this property corresponds to the Store ID that is available on the overview page for the add-on in the Dev Center dashboard.

Title Title Title Title

Gets the product title from the Windows Store listing.

public : PlatForm::String Title { get; }public string Title { get; }Public ReadOnly Property Title As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The product title from the Windows Store listing.

Videos Videos Videos Videos

Gets the videos from the Windows Store listing for the product.

public : IVectorView<StoreVideo> Videos { get; }public IReadOnlyList<StoreVideo> Videos { get; }Public ReadOnly Property Videos As IReadOnlyList<StoreVideo>// You can use this property in JavaScript.
Value
IVectorView<StoreVideo> IReadOnlyList<StoreVideo> IReadOnlyList<StoreVideo> IReadOnlyList<StoreVideo>

A collection of StoreVideo objects that represent the videos from the Windows Store listing for the product.

Methods

GetIsAnySkuInstalledAsync() GetIsAnySkuInstalledAsync() GetIsAnySkuInstalledAsync() GetIsAnySkuInstalledAsync()

Indicates whether any SKU of this product is installed on the current device. This method is intended to be used for products that have downloadable content (DLC).

public : IAsyncOperation<PlatForm::Boolean> GetIsAnySkuInstalledAsync()public IAsyncOperation<bool> GetIsAnySkuInstalledAsync()Public Function GetIsAnySkuInstalledAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Returns

An asynchronous operation that, on successful completion, returns true if a SKU of this product is installed on the current device; otherwise, false.

Remarks

To determine whether the product has downloadable content, use the HasDigitalDownload property.

Note

Downloadable content (DLC) is a feature that is not available to all developer accounts.

RequestPurchaseAsync() RequestPurchaseAsync() RequestPurchaseAsync() RequestPurchaseAsync()

Requests the purchase of the default SKU and availability for the product and displays the UI that is used to complete the transaction via the Windows Store.

Important

This method must be called on the UI thread.

public : IAsyncOperation<StorePurchaseResult> RequestPurchaseAsync()public IAsyncOperation<StorePurchaseResult> RequestPurchaseAsync()Public Function RequestPurchaseAsync() As IAsyncOperation( Of StorePurchaseResult )// You can use this method in JavaScript.
Returns

An asynchronous operation that, on successful completion, returns a StorePurchaseResult object that provides status and error info about the purchase.

Exceptions
COMException COMException COMException COMException

If the ErrorCode property of the exception has the value 0x80070578 (ERROR_INVALID_WINDOW_HANDLE), this indicates that the method was not called on the UI thread. If you are calling this method in a desktop application that uses the Desktop Bridge, this can also indicate that you did not configure the StoreContext object to specify which application window is the owner window for modal dialogs shown by this method. For more information, see this article.

See Also

RequestPurchaseAsync(StorePurchaseProperties) RequestPurchaseAsync(StorePurchaseProperties) RequestPurchaseAsync(StorePurchaseProperties) RequestPurchaseAsync(StorePurchaseProperties)

Requests the purchase of the default SKU and availability for the product and displays the UI that is used to complete the transaction via the Windows Store. This method provides the option to specify additional details for a specific offer within a large catalog of products that are represented by a single listing in the Windows Store, including the product name to display to the user during the purchase.

Important

This method must be called on the UI thread.

public : IAsyncOperation<StorePurchaseResult> RequestPurchaseAsync(StorePurchaseProperties storePurchaseProperties)public IAsyncOperation<StorePurchaseResult> RequestPurchaseAsync(StorePurchaseProperties storePurchaseProperties)Public Function RequestPurchaseAsync(storePurchaseProperties As StorePurchaseProperties) As IAsyncOperation( Of StorePurchaseResult )// You can use this method in JavaScript.
Parameters
storePurchaseProperties
StorePurchaseProperties StorePurchaseProperties StorePurchaseProperties StorePurchaseProperties

An object that specifies additional info for the purchase request, including the product name to display to the user during the purchase.

Returns

An asynchronous operation that, on successful completion, returns a StorePurchaseResult object that provides status and error info about the purchase.

Exceptions
COMException COMException COMException COMException

If the ErrorCode property of the exception has the value 0x80070578 (ERROR_INVALID_WINDOW_HANDLE), this indicates that the method was not called on the UI thread. If you are calling this method in a desktop application that uses the Desktop Bridge, this can also indicate that you did not configure the StoreContext object to specify which application window is the owner window for modal dialogs shown by this method. For more information, see this article.

See Also

See Also