StoreAvailability
StoreAvailability
StoreAvailability
StoreAvailability
Class
Definition
Represents a specific instance of a product SKU that can be purchased.
public : sealed class StoreAvailability : IStoreAvailabilitypublic sealed class StoreAvailability : IStoreAvailabilityPublic NotInheritable Class StoreAvailability Implements IStoreAvailability// You can use this class in JavaScript.
- Attributes
| 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 access the availabilities for a SKU, use the Availabilities property of the StoreSku object in which you are interested.
Properties
EndDate EndDate EndDate EndDate
Gets the end date for the current SKU availability.
public : DateTime EndDate { get; }public DateTimeOffset EndDate { get; }Public ReadOnly Property EndDate As DateTimeOffset// You can use this property in JavaScript.
- Value
- DateTime DateTimeOffset DateTimeOffset DateTimeOffset
The end date for the current SKU availability.
ExtendedJsonData ExtendedJsonData ExtendedJsonData ExtendedJsonData
Gets complete data for the current SKU availability 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 current SKU availability from the Store.
Remarks
Use the ExtendedJsonData property to access the complete data for the StoreAvailability 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
Price Price Price Price
Gets price info for the current SKU availability, including the base price, current price, and sale info.
public : StorePrice Price { get; }public StorePrice Price { get; }Public ReadOnly Property Price As StorePrice// You can use this property in JavaScript.
An object that contains price info for the current SKU availability.
StoreId StoreId StoreId StoreId
Gets the Store ID of the current SKU availability from the Windows Store catalog.
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 of the current SKU availability from the Windows Store catalog.
Remarks
The Store ID returned by this property has the format <product Store ID>/<SKU Store ID>/<availability Store ID>, where:
- <product Store ID> is a 12-character alpha-numeric string, such as 9NBLGGH69M0B. This Store ID is available in the Windows Dev Center dashboard page for the app or add-on, and it is returned by the StoreId property of the related StoreProduct object.
- <SKU Store ID> is a 4-character alpha-numeric string that identifies the SKU.
- <availability Store ID> is a 12-character alpha-numeric string that identifies the availability. An example complete Store ID returned by this property is 9NBLGGH69M0B/000N/4KW6QZD2VN6X.
Methods
RequestPurchaseAsync() RequestPurchaseAsync() RequestPurchaseAsync() RequestPurchaseAsync()
Requests the purchase of the current SKU availability 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.
An asynchronous operation that, on successful completion, returns a StorePurchaseResult object that provides status and error info about the purchase.
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 current SKU availability 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.
- 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.
An asynchronous operation that, on successful completion, returns a StorePurchaseResult object that provides status and error info about the purchase.
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