Share via

Why does Microsoft Store Collections API return an empty items list for the purchased subscription?

Muhammed Işık 60 Reputation points
2026-02-13T12:01:26.4+00:00

I am integrating the Microsoft Store Collections API to retrieve the transactionId of the purchased subscription product.

Firstly I generate an Entra ID access token for query:

    try {
      final response = await http.post(
        Uri.parse('https://login.microsoftonline.com/<tenant_id>/oauth2/token'),
        headers: {'Content-Type': 'application/x-www-form-urlencoded'},
        body: {
          'grant_type': 'client_credentials',
          'client_id': <client_id>,
          'client_secret': <client_secret>,
          'resource': 'https://onestore.microsoft.com',
        },
      );

Later, I do following request with specified header and body parts:


    try {
      final response = await http.post(
        Uri.parse('https://collections.mp.microsoft.com/v6.0/collections/query'),
        headers: {
          'Authorization': 'Bearer <access_token>',
          'Content-Type': 'application/json',
        },
        body: json.encode({
          "beneficiaries": [
            {
              'identityType': 'b2b',
              'identityValue': <ms_store_id_key>,
              'localTicketReference': <any_irrelevant_value>,
            },
          ],
          'productTypes': ["Durable"],
          'productSkuIds': [
            {'productId': <product_id>, 'skuId': <sku_id>},
          ],
        }),
      );

Response Status Code: 200 OK
Response Body: { "items": [] }

Windows development | Windows App SDK
{count} votes

2 answers

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 14,805 Reputation points Microsoft External Staff Moderator
    2026-02-16T03:23:48.01+00:00

    Hi @Muhammed Işık ,

    Thanks for reaching out.

    From what you shared, the main reason you're getting { "items": [] } is most likely because the request is filtering by the wrong product type. You're currently using "productTypes": ["Durable"], but subscriptions are not Durable products. Durable means a one-time purchase. For subscriptions, you should use:

    "productTypes": ["Subscription"]
    

    If you update that and still receive an empty list, the next things to double-check are:

    • Make sure the identityType and identityValue match the exact account that made the purchase. You’re currently using 'identityType': 'b2b', which represents a business identity. If the purchase was made by a regular consumer account (B2C), or if the identity value doesn’t exactly match the purchasing account, the API will return 200 OK with no items.
    • Verify that the productId and skuId are correct and belong to the same environment.
    • Ensure you're not mixing Sandbox and Production (a Sandbox purchase won’t appear in Production queries).
    • Confirm the subscription is active and not expired or refunded.

    The Microsoft Store Collections API only returns items that match all filters exactly, so even a small mismatch will result in an empty list rather than an error.

    Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.


  2. Q&A Assist
    2026-02-13T12:01:39.6033333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    There could be several reasons why the Microsoft Store Collections API returns an empty items list for the purchased subscription:

    1. Incorrect Product Type: Ensure that the productTypes specified in your request matches the type of the subscription you are querying. If the subscription is not categorized as "Durable," it may not be returned in the response.
    2. Product SKU IDs: Verify that the productSkuIds you are using in the request are correct and correspond to the actual subscription product in the Microsoft Store. If the SKU ID is incorrect or does not exist, the API will not return any items.
    3. Beneficiary Identity: Check that the identityType and identityValue for the beneficiaries are correctly set. If the provided Microsoft Store ID is not valid or does not have any associated purchases, the response will be empty.
    4. Timing Issues: If the subscription was recently purchased, there might be a delay in the system updating the records. Ensure that enough time has passed since the purchase.
    5. Access Token Scope: Make sure that the access token you generated has the appropriate permissions to access the subscription data. If the token lacks the necessary scopes, it may not retrieve the expected results.
    6. API Limitations: Review the API documentation for any limitations or specific conditions under which items might not be returned.

    If you have checked all of these factors and are still encountering issues, consider reaching out to Microsoft support for further assistance.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.