ProductLicense ProductLicense ProductLicense ProductLicense ProductLicense Class


Provides info about a license that is associated with an add-on (also called an in-app product or IAP).

public : sealed class ProductLicense : IProductLicense, IProductLicenseWithFulfillment
struct winrt::Windows::ApplicationModel::Store::ProductLicense : IProductLicense, IProductLicenseWithFulfillment
public sealed class ProductLicense : IProductLicense, IProductLicenseWithFulfillment
Public NotInheritable Class ProductLicense Implements IProductLicense, IProductLicenseWithFulfillment
// This class does not provide a public constructor.
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


The following code example demonstrates how to use this object to get the expiration date of an add-on offer.

// get current app object using the simulator interface
currentApp = Windows.ApplicationModel.Store.CurrentAppSimulator;

// get the license information object
licenseInformation = CurrentAppSimulator.licenseInformation;

// get info about the licenses of the app's in-app offers
inAppOfferLicenses = licenseInformation.productLicenses;

// get the license information for a specific in-app offer
myFavoriteInAppOffer = inAppOfferLicenses("MyFavoriteInAppOffer");

// and look up the offer's expiration date
// get the license info for this app from the simulator
LicenseInformation licenseInformation = CurrentAppSimulator.LicenseInformation;

// get the license info for one of the app's in-app offers
ProductLicense inAppOfferLicense =

// get the expiration date of this in-app offer
DateTimeOffset expirationDate = inAppOfferLicense.ExpirationDate;


The ProductLicenses property of the LicenseInformation object contains one or more instances of this object.


ExpirationDate ExpirationDate ExpirationDate ExpirationDate ExpirationDate

Gets the current expiration date and time of the add-on (also called an in-app product or IAP) license.

public : DateTime ExpirationDate { get; }
DateTime ExpirationDate();
public DateTimeOffset ExpirationDate { get; }
Public ReadOnly Property ExpirationDate As DateTimeOffset
var dateTimeOffset = productLicense.expirationDate;
DateTimeOffset DateTimeOffset DateTimeOffset

The date and time indicating when the add-on license expires.

IsActive IsActive IsActive IsActive IsActive

Indicates if the add-on (also called an in-app product or IAP) license is currently active.

public : Platform::Boolean IsActive { get; }
bool IsActive();
public bool IsActive { get; }
Public ReadOnly Property IsActive As bool
var bool = productLicense.isActive;
bool bool bool

Returns true if the add-on's license is active, and otherwise false. This property can return false if the license is missing, expired, or revoked.

IsConsumable IsConsumable IsConsumable IsConsumable IsConsumable

Indicates if the add-on (also called an in-app product or IAP) is consumable. A consumable add-on can be purchased, used, and purchased again.

public : Platform::Boolean IsConsumable { get; }
bool IsConsumable();
public bool IsConsumable { get; }
Public ReadOnly Property IsConsumable As bool
var bool = productLicense.isConsumable;
bool bool bool

true if the add-on is a consumable add-on; Otherwise, false.

ProductId ProductId ProductId ProductId ProductId

Gets the ID of an add-on (also called an in-app product or IAP). This ID is used by the app to get info about the product or feature that is enabled when the customer buys it through an in-app purchase.

public : Platform::String ProductId { get; }
winrt::hstring ProductId();
public string ProductId { get; }
Public ReadOnly Property ProductId As string
var string = productLicense.productId;
string string string

The ID specified in the Windows Dev Center dashboard to identify this add-on.


The product ID is the string that the app uses to identify the add-on. You enter the product ID when submitting your add-on in the Windows Dev Center dashboard, where it is associated with the description, price tier and lifetime. For more information, see How to use product IDs for add-ons in your code.

See Also