Store Fixes: API Consolodation

Richard Freytag 26 Reputation points
2023-01-25T01:35:58.9266667+00:00

There are two (2) APIs to determine user-owned licenses for an app. There should be only one API with parameters to retrieve this information; simplifying documentation and maintenance.

To retrieve a lit of Subscirption Addons one must call storeContext.GetAppLicenseAsync() like so....

StoreAppLicense appLicense = await storeContext.GetAppLicenseAsync();
if (appLicense.AddOnLicenses.Count > 0)
{
    foreach (var addOnLicense in appLicense.AddOnLicenses)
    {
        this.license = addOnLicense.Value;
    }
}

In above example appLicense.AddOnLicenses only returns list of subscription type addons.

To retrieve a list of Consumable Addons then one must call storeContext.GetUserCollectionAsync() and loop through the SKUs to find Skus.CollectionData. Then look in there for AcquiredDate to determine user ownership of a Consumable Addon.

Consolidating this API would certainly make life better for developers in the Microsoft Store and probably help the maintainers of the Store API.

Where/How can we get this issue on the Store API dev schedule?

Microsoft Partner Center
Microsoft Partner Center
A Microsoft website for partners that provides access to product support, a partner community, and other partner services.
839 questions
Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
302 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 31,481 Reputation points Microsoft Vendor
    2023-01-25T06:48:45.0166667+00:00

    Hello,

    Welcome to Microsoft Q&A!

    First of all, the StoreAppLicense.AddOnLicenses property could be used to check the durable add-ons. Subscription add-ons are Durable products. If the user has purchased other kind of durable add-ons, it will also be listed.

    Consumable add-ons are different. The consumable add-ons do not persist for the lifetime that you specify in Partner Center. It has a limit on the number of items use can used. So it is necessary to separate APIs for Consumable add-ons and durable add-ons.

    There are two types of consumable add-ons that you could choose. Developer-managed consumable and Store-managed consumable.

    Developer-managed consumable means developer needs to keeping track of the user's balance of items that the add-on represents, and for reporting the purchase of the add-on as fulfilled to the Store after the user has consumed all of the items

    Store-managed consumable means the Store keeps track of the user's balance of items that the add-on represents. When the user consumes any items, you are responsible for reporting those items as fulfilled to the Store, and the Store updates the user's balance.

    If you are using the Store-managed consumable, you just need to call StoreContext.GetConsumableBalanceRemainingAsync(addOnStoreId) to get all the remaining balance of the user. But if you are using Developer-managed consumable, then you need to check the remaining balance by yourself. I'm sorry to say that in this scenario, the StoreContext class don't have APIs to check all the consumable add-ons because it should be managed by the developer.

    In the end, if you still have questions about this, you could raise a feature request in the feedback about this.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our [documentation][2] to enable e-mail notifications if you want to receive the related email notification for this thread.